diff --git a/clients/client-payment-cryptography/.gitignore b/clients/client-payment-cryptography/.gitignore new file mode 100644 index 000000000000..54f14c9aef25 --- /dev/null +++ b/clients/client-payment-cryptography/.gitignore @@ -0,0 +1,9 @@ +/node_modules/ +/build/ +/coverage/ +/docs/ +/dist-* +*.tsbuildinfo +*.tgz +*.log +package-lock.json diff --git a/clients/client-payment-cryptography/LICENSE b/clients/client-payment-cryptography/LICENSE new file mode 100644 index 000000000000..5001cd317c44 --- /dev/null +++ b/clients/client-payment-cryptography/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/clients/client-payment-cryptography/README.md b/clients/client-payment-cryptography/README.md new file mode 100644 index 000000000000..6ffd2d6de38e --- /dev/null +++ b/clients/client-payment-cryptography/README.md @@ -0,0 +1,369 @@ + + +# @aws-sdk/client-payment-cryptography + +## Description + +AWS SDK for JavaScript PaymentCryptography Client for Node.js, Browser and React Native. + +

You use the Amazon Web Services Payment Cryptography Control Plane to manage the encryption keys you use for payment-related cryptographic operations. You can create, import, export, share, manage, and delete keys. You can also manage Identity and Access Management (IAM) policies for keys. For more information, see Identity and access management in the Amazon Web Services Payment Cryptography User Guide. +

+

To use encryption keys for payment-related transaction processing and associated cryptographic operations, you use the Amazon Web Services Payment Cryptography Data Plane. You can encrypt, decrypt, generate, verify, and translate payment-related cryptographic operations.

+

All Amazon Web Services Payment Cryptography API calls must be signed and transmitted using Transport Layer Security (TLS). We recommend you always use the latest supported TLS version for logging API requests.

+

Amazon Web Services Payment Cryptography supports CloudTrail, a service that logs Amazon Web Services API calls and related events for your Amazon Web Services account and delivers them to an Amazon S3 bucket that you specify. By using the information collected by CloudTrail, you can determine what requests were made to Amazon Web Services Payment Cryptography, who made the request, when it was made, and so on. If you don't configure a trail, you can still view the most recent events in the CloudTrail console. For more information, see the CloudTrail User Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-payment-cryptography +using your favorite package manager: + +- `npm install @aws-sdk/client-payment-cryptography` +- `yarn add @aws-sdk/client-payment-cryptography` +- `pnpm add @aws-sdk/client-payment-cryptography` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `PaymentCryptographyClient` and +the commands you need, for example `CreateAliasCommand`: + +```js +// ES5 example +const { PaymentCryptographyClient, CreateAliasCommand } = require("@aws-sdk/client-payment-cryptography"); +``` + +```ts +// ES6+ example +import { PaymentCryptographyClient, CreateAliasCommand } from "@aws-sdk/client-payment-cryptography"; +``` + +### 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 PaymentCryptographyClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateAliasCommand(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-payment-cryptography"; +const client = new AWS.PaymentCryptography({ region: "REGION" }); + +// async/await. +try { + const data = await client.createAlias(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createAlias(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createAlias(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-payment-cryptography` 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) + +
+ +CreateAlias + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/classes/createaliascommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/createaliascommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/createaliascommandoutput.html) + +
+
+ +CreateKey + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/classes/createkeycommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/createkeycommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/createkeycommandoutput.html) + +
+
+ +DeleteAlias + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/classes/deletealiascommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/deletealiascommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/deletealiascommandoutput.html) + +
+
+ +DeleteKey + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/classes/deletekeycommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/deletekeycommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/deletekeycommandoutput.html) + +
+
+ +ExportKey + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/classes/exportkeycommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/exportkeycommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/exportkeycommandoutput.html) + +
+
+ +GetAlias + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/classes/getaliascommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/getaliascommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/getaliascommandoutput.html) + +
+
+ +GetKey + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/classes/getkeycommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/getkeycommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/getkeycommandoutput.html) + +
+
+ +GetParametersForExport + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/classes/getparametersforexportcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/getparametersforexportcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/getparametersforexportcommandoutput.html) + +
+
+ +GetParametersForImport + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/classes/getparametersforimportcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/getparametersforimportcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/getparametersforimportcommandoutput.html) + +
+
+ +GetPublicKeyCertificate + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/classes/getpublickeycertificatecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/getpublickeycertificatecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/getpublickeycertificatecommandoutput.html) + +
+
+ +ImportKey + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/classes/importkeycommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/importkeycommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/importkeycommandoutput.html) + +
+
+ +ListAliases + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/classes/listaliasescommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/listaliasescommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/listaliasescommandoutput.html) + +
+
+ +ListKeys + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/classes/listkeyscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/listkeyscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/listkeyscommandoutput.html) + +
+
+ +ListTagsForResource + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/classes/listtagsforresourcecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/listtagsforresourcecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/listtagsforresourcecommandoutput.html) + +
+
+ +RestoreKey + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/classes/restorekeycommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/restorekeycommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/restorekeycommandoutput.html) + +
+
+ +StartKeyUsage + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/classes/startkeyusagecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/startkeyusagecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/startkeyusagecommandoutput.html) + +
+
+ +StopKeyUsage + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/classes/stopkeyusagecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/stopkeyusagecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/stopkeyusagecommandoutput.html) + +
+
+ +TagResource + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/classes/tagresourcecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/tagresourcecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/tagresourcecommandoutput.html) + +
+
+ +UntagResource + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/classes/untagresourcecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/untagresourcecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/untagresourcecommandoutput.html) + +
+
+ +UpdateAlias + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/classes/updatealiascommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/updatealiascommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-payment-cryptography/interfaces/updatealiascommandoutput.html) + +
diff --git a/clients/client-payment-cryptography/api-extractor.json b/clients/client-payment-cryptography/api-extractor.json new file mode 100644 index 000000000000..d5bf5ffeee85 --- /dev/null +++ b/clients/client-payment-cryptography/api-extractor.json @@ -0,0 +1,4 @@ +{ + "extends": "../../api-extractor.json", + "mainEntryPointFilePath": "/dist-types/index.d.ts" +} diff --git a/clients/client-payment-cryptography/package.json b/clients/client-payment-cryptography/package.json new file mode 100644 index 000000000000..6a87b315ae8f --- /dev/null +++ b/clients/client-payment-cryptography/package.json @@ -0,0 +1,99 @@ +{ + "name": "@aws-sdk/client-payment-cryptography", + "description": "AWS SDK for JavaScript Payment Cryptography Client for Node.js, Browser and React Native", + "version": "3.0.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:docs": "typedoc", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "extract:docs": "api-extractor run --local", + "generate:client": "node ../../scripts/generate-clients/single-service --solo payment-cryptography" + }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", + "sideEffects": false, + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/client-sts": "*", + "@aws-sdk/config-resolver": "*", + "@aws-sdk/credential-provider-node": "*", + "@aws-sdk/fetch-http-handler": "*", + "@aws-sdk/hash-node": "*", + "@aws-sdk/invalid-dependency": "*", + "@aws-sdk/middleware-content-length": "*", + "@aws-sdk/middleware-endpoint": "*", + "@aws-sdk/middleware-host-header": "*", + "@aws-sdk/middleware-logger": "*", + "@aws-sdk/middleware-recursion-detection": "*", + "@aws-sdk/middleware-retry": "*", + "@aws-sdk/middleware-serde": "*", + "@aws-sdk/middleware-signing": "*", + "@aws-sdk/middleware-stack": "*", + "@aws-sdk/middleware-user-agent": "*", + "@aws-sdk/node-config-provider": "*", + "@aws-sdk/node-http-handler": "*", + "@aws-sdk/smithy-client": "*", + "@aws-sdk/types": "*", + "@aws-sdk/url-parser": "*", + "@aws-sdk/util-base64": "*", + "@aws-sdk/util-body-length-browser": "*", + "@aws-sdk/util-body-length-node": "*", + "@aws-sdk/util-defaults-mode-browser": "*", + "@aws-sdk/util-defaults-mode-node": "*", + "@aws-sdk/util-endpoints": "*", + "@aws-sdk/util-retry": "*", + "@aws-sdk/util-user-agent-browser": "*", + "@aws-sdk/util-user-agent-node": "*", + "@aws-sdk/util-utf8": "*", + "@smithy/protocol-http": "^1.0.1", + "@smithy/types": "^1.0.0", + "tslib": "^2.5.0" + }, + "devDependencies": { + "@aws-sdk/service-client-documentation-generator": "*", + "@tsconfig/node14": "1.0.3", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.23.23", + "typescript": "~4.9.5" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*/**" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-payment-cryptography", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "clients/client-payment-cryptography" + } +} diff --git a/clients/client-payment-cryptography/src/PaymentCryptography.ts b/clients/client-payment-cryptography/src/PaymentCryptography.ts new file mode 100644 index 000000000000..076c0c465b7d --- /dev/null +++ b/clients/client-payment-cryptography/src/PaymentCryptography.ts @@ -0,0 +1,333 @@ +// smithy-typescript generated code +import { createAggregatedClient } from "@aws-sdk/smithy-client"; +import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types"; + +import { CreateAliasCommand, CreateAliasCommandInput, CreateAliasCommandOutput } from "./commands/CreateAliasCommand"; +import { CreateKeyCommand, CreateKeyCommandInput, CreateKeyCommandOutput } from "./commands/CreateKeyCommand"; +import { DeleteAliasCommand, DeleteAliasCommandInput, DeleteAliasCommandOutput } from "./commands/DeleteAliasCommand"; +import { DeleteKeyCommand, DeleteKeyCommandInput, DeleteKeyCommandOutput } from "./commands/DeleteKeyCommand"; +import { ExportKeyCommand, ExportKeyCommandInput, ExportKeyCommandOutput } from "./commands/ExportKeyCommand"; +import { GetAliasCommand, GetAliasCommandInput, GetAliasCommandOutput } from "./commands/GetAliasCommand"; +import { GetKeyCommand, GetKeyCommandInput, GetKeyCommandOutput } from "./commands/GetKeyCommand"; +import { + GetParametersForExportCommand, + GetParametersForExportCommandInput, + GetParametersForExportCommandOutput, +} from "./commands/GetParametersForExportCommand"; +import { + GetParametersForImportCommand, + GetParametersForImportCommandInput, + GetParametersForImportCommandOutput, +} from "./commands/GetParametersForImportCommand"; +import { + GetPublicKeyCertificateCommand, + GetPublicKeyCertificateCommandInput, + GetPublicKeyCertificateCommandOutput, +} from "./commands/GetPublicKeyCertificateCommand"; +import { ImportKeyCommand, ImportKeyCommandInput, ImportKeyCommandOutput } from "./commands/ImportKeyCommand"; +import { ListAliasesCommand, ListAliasesCommandInput, ListAliasesCommandOutput } from "./commands/ListAliasesCommand"; +import { ListKeysCommand, ListKeysCommandInput, ListKeysCommandOutput } from "./commands/ListKeysCommand"; +import { + ListTagsForResourceCommand, + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "./commands/ListTagsForResourceCommand"; +import { RestoreKeyCommand, RestoreKeyCommandInput, RestoreKeyCommandOutput } from "./commands/RestoreKeyCommand"; +import { + StartKeyUsageCommand, + StartKeyUsageCommandInput, + StartKeyUsageCommandOutput, +} from "./commands/StartKeyUsageCommand"; +import { + StopKeyUsageCommand, + StopKeyUsageCommandInput, + StopKeyUsageCommandOutput, +} from "./commands/StopKeyUsageCommand"; +import { TagResourceCommand, TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand"; +import { + UntagResourceCommand, + UntagResourceCommandInput, + UntagResourceCommandOutput, +} from "./commands/UntagResourceCommand"; +import { UpdateAliasCommand, UpdateAliasCommandInput, UpdateAliasCommandOutput } from "./commands/UpdateAliasCommand"; +import { PaymentCryptographyClient, PaymentCryptographyClientConfig } from "./PaymentCryptographyClient"; + +const commands = { + CreateAliasCommand, + CreateKeyCommand, + DeleteAliasCommand, + DeleteKeyCommand, + ExportKeyCommand, + GetAliasCommand, + GetKeyCommand, + GetParametersForExportCommand, + GetParametersForImportCommand, + GetPublicKeyCertificateCommand, + ImportKeyCommand, + ListAliasesCommand, + ListKeysCommand, + ListTagsForResourceCommand, + RestoreKeyCommand, + StartKeyUsageCommand, + StopKeyUsageCommand, + TagResourceCommand, + UntagResourceCommand, + UpdateAliasCommand, +}; + +export interface PaymentCryptography { + /** + * @see {@link CreateAliasCommand} + */ + createAlias(args: CreateAliasCommandInput, options?: __HttpHandlerOptions): Promise; + createAlias(args: CreateAliasCommandInput, cb: (err: any, data?: CreateAliasCommandOutput) => void): void; + createAlias( + args: CreateAliasCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateAliasCommandOutput) => void + ): void; + + /** + * @see {@link CreateKeyCommand} + */ + createKey(args: CreateKeyCommandInput, options?: __HttpHandlerOptions): Promise; + createKey(args: CreateKeyCommandInput, cb: (err: any, data?: CreateKeyCommandOutput) => void): void; + createKey( + args: CreateKeyCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateKeyCommandOutput) => void + ): void; + + /** + * @see {@link DeleteAliasCommand} + */ + deleteAlias(args: DeleteAliasCommandInput, options?: __HttpHandlerOptions): Promise; + deleteAlias(args: DeleteAliasCommandInput, cb: (err: any, data?: DeleteAliasCommandOutput) => void): void; + deleteAlias( + args: DeleteAliasCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteAliasCommandOutput) => void + ): void; + + /** + * @see {@link DeleteKeyCommand} + */ + deleteKey(args: DeleteKeyCommandInput, options?: __HttpHandlerOptions): Promise; + deleteKey(args: DeleteKeyCommandInput, cb: (err: any, data?: DeleteKeyCommandOutput) => void): void; + deleteKey( + args: DeleteKeyCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteKeyCommandOutput) => void + ): void; + + /** + * @see {@link ExportKeyCommand} + */ + exportKey(args: ExportKeyCommandInput, options?: __HttpHandlerOptions): Promise; + exportKey(args: ExportKeyCommandInput, cb: (err: any, data?: ExportKeyCommandOutput) => void): void; + exportKey( + args: ExportKeyCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ExportKeyCommandOutput) => void + ): void; + + /** + * @see {@link GetAliasCommand} + */ + getAlias(args: GetAliasCommandInput, options?: __HttpHandlerOptions): Promise; + getAlias(args: GetAliasCommandInput, cb: (err: any, data?: GetAliasCommandOutput) => void): void; + getAlias( + args: GetAliasCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetAliasCommandOutput) => void + ): void; + + /** + * @see {@link GetKeyCommand} + */ + getKey(args: GetKeyCommandInput, options?: __HttpHandlerOptions): Promise; + getKey(args: GetKeyCommandInput, cb: (err: any, data?: GetKeyCommandOutput) => void): void; + getKey( + args: GetKeyCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetKeyCommandOutput) => void + ): void; + + /** + * @see {@link GetParametersForExportCommand} + */ + getParametersForExport( + args: GetParametersForExportCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getParametersForExport( + args: GetParametersForExportCommandInput, + cb: (err: any, data?: GetParametersForExportCommandOutput) => void + ): void; + getParametersForExport( + args: GetParametersForExportCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetParametersForExportCommandOutput) => void + ): void; + + /** + * @see {@link GetParametersForImportCommand} + */ + getParametersForImport( + args: GetParametersForImportCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getParametersForImport( + args: GetParametersForImportCommandInput, + cb: (err: any, data?: GetParametersForImportCommandOutput) => void + ): void; + getParametersForImport( + args: GetParametersForImportCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetParametersForImportCommandOutput) => void + ): void; + + /** + * @see {@link GetPublicKeyCertificateCommand} + */ + getPublicKeyCertificate( + args: GetPublicKeyCertificateCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getPublicKeyCertificate( + args: GetPublicKeyCertificateCommandInput, + cb: (err: any, data?: GetPublicKeyCertificateCommandOutput) => void + ): void; + getPublicKeyCertificate( + args: GetPublicKeyCertificateCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetPublicKeyCertificateCommandOutput) => void + ): void; + + /** + * @see {@link ImportKeyCommand} + */ + importKey(args: ImportKeyCommandInput, options?: __HttpHandlerOptions): Promise; + importKey(args: ImportKeyCommandInput, cb: (err: any, data?: ImportKeyCommandOutput) => void): void; + importKey( + args: ImportKeyCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ImportKeyCommandOutput) => void + ): void; + + /** + * @see {@link ListAliasesCommand} + */ + listAliases(args: ListAliasesCommandInput, options?: __HttpHandlerOptions): Promise; + listAliases(args: ListAliasesCommandInput, cb: (err: any, data?: ListAliasesCommandOutput) => void): void; + listAliases( + args: ListAliasesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListAliasesCommandOutput) => void + ): void; + + /** + * @see {@link ListKeysCommand} + */ + listKeys(args: ListKeysCommandInput, options?: __HttpHandlerOptions): Promise; + listKeys(args: ListKeysCommandInput, cb: (err: any, data?: ListKeysCommandOutput) => void): void; + listKeys( + args: ListKeysCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListKeysCommandOutput) => 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 RestoreKeyCommand} + */ + restoreKey(args: RestoreKeyCommandInput, options?: __HttpHandlerOptions): Promise; + restoreKey(args: RestoreKeyCommandInput, cb: (err: any, data?: RestoreKeyCommandOutput) => void): void; + restoreKey( + args: RestoreKeyCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: RestoreKeyCommandOutput) => void + ): void; + + /** + * @see {@link StartKeyUsageCommand} + */ + startKeyUsage(args: StartKeyUsageCommandInput, options?: __HttpHandlerOptions): Promise; + startKeyUsage(args: StartKeyUsageCommandInput, cb: (err: any, data?: StartKeyUsageCommandOutput) => void): void; + startKeyUsage( + args: StartKeyUsageCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: StartKeyUsageCommandOutput) => void + ): void; + + /** + * @see {@link StopKeyUsageCommand} + */ + stopKeyUsage(args: StopKeyUsageCommandInput, options?: __HttpHandlerOptions): Promise; + stopKeyUsage(args: StopKeyUsageCommandInput, cb: (err: any, data?: StopKeyUsageCommandOutput) => void): void; + stopKeyUsage( + args: StopKeyUsageCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: StopKeyUsageCommandOutput) => void + ): void; + + /** + * @see {@link TagResourceCommand} + */ + tagResource(args: TagResourceCommandInput, options?: __HttpHandlerOptions): Promise; + tagResource(args: TagResourceCommandInput, cb: (err: any, data?: TagResourceCommandOutput) => void): void; + tagResource( + args: TagResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: TagResourceCommandOutput) => void + ): void; + + /** + * @see {@link UntagResourceCommand} + */ + untagResource(args: UntagResourceCommandInput, options?: __HttpHandlerOptions): Promise; + untagResource(args: UntagResourceCommandInput, cb: (err: any, data?: UntagResourceCommandOutput) => void): void; + untagResource( + args: UntagResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UntagResourceCommandOutput) => void + ): void; + + /** + * @see {@link UpdateAliasCommand} + */ + updateAlias(args: UpdateAliasCommandInput, options?: __HttpHandlerOptions): Promise; + updateAlias(args: UpdateAliasCommandInput, cb: (err: any, data?: UpdateAliasCommandOutput) => void): void; + updateAlias( + args: UpdateAliasCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateAliasCommandOutput) => void + ): void; +} + +/** + * @public + *

You use the Amazon Web Services Payment Cryptography Control Plane to manage the encryption keys you use for payment-related cryptographic operations. You can create, import, export, share, manage, and delete keys. You can also manage Identity and Access Management (IAM) policies for keys. For more information, see Identity and access management in the Amazon Web Services Payment Cryptography User Guide. + *

+ *

To use encryption keys for payment-related transaction processing and associated cryptographic operations, you use the Amazon Web Services Payment Cryptography Data Plane. You can encrypt, decrypt, generate, verify, and translate payment-related cryptographic operations.

+ *

All Amazon Web Services Payment Cryptography API calls must be signed and transmitted using Transport Layer Security (TLS). We recommend you always use the latest supported TLS version for logging API requests.

+ *

Amazon Web Services Payment Cryptography supports CloudTrail, a service that logs Amazon Web Services API calls and related events for your Amazon Web Services account and delivers them to an Amazon S3 bucket that you specify. By using the information collected by CloudTrail, you can determine what requests were made to Amazon Web Services Payment Cryptography, who made the request, when it was made, and so on. If you don't configure a trail, you can still view the most recent events in the CloudTrail console. For more information, see the CloudTrail User Guide.

+ */ +export class PaymentCryptography extends PaymentCryptographyClient implements PaymentCryptography {} +createAggregatedClient(commands, PaymentCryptography); diff --git a/clients/client-payment-cryptography/src/PaymentCryptographyClient.ts b/clients/client-payment-cryptography/src/PaymentCryptographyClient.ts new file mode 100644 index 000000000000..d8ba7c22c4cc --- /dev/null +++ b/clients/client-payment-cryptography/src/PaymentCryptographyClient.ts @@ -0,0 +1,355 @@ +// smithy-typescript generated code +import { RegionInputConfig, RegionResolvedConfig, resolveRegionConfig } from "@aws-sdk/config-resolver"; +import { getContentLengthPlugin } from "@aws-sdk/middleware-content-length"; +import { EndpointInputConfig, EndpointResolvedConfig, resolveEndpointConfig } from "@aws-sdk/middleware-endpoint"; +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 { getRetryPlugin, resolveRetryConfig, RetryInputConfig, RetryResolvedConfig } from "@aws-sdk/middleware-retry"; +import { + AwsAuthInputConfig, + AwsAuthResolvedConfig, + getAwsAuthPlugin, + resolveAwsAuthConfig, +} from "@aws-sdk/middleware-signing"; +import { + getUserAgentPlugin, + resolveUserAgentConfig, + UserAgentInputConfig, + UserAgentResolvedConfig, +} from "@aws-sdk/middleware-user-agent"; +import { + Client as __Client, + DefaultsMode as __DefaultsMode, + SmithyConfiguration as __SmithyConfiguration, + SmithyResolvedConfiguration as __SmithyResolvedConfiguration, +} from "@aws-sdk/smithy-client"; +import { + BodyLengthCalculator as __BodyLengthCalculator, + Checksum as __Checksum, + ChecksumConstructor as __ChecksumConstructor, + Credentials as __Credentials, + EndpointV2 as __EndpointV2, + Hash as __Hash, + HashConstructor as __HashConstructor, + HttpHandlerOptions as __HttpHandlerOptions, + Logger as __Logger, + Provider, + UrlParser as __UrlParser, + UserAgent as __UserAgent, +} from "@aws-sdk/types"; +import { HttpHandler as __HttpHandler } from "@smithy/protocol-http"; +import { + Decoder as __Decoder, + Encoder as __Encoder, + Provider as __Provider, + StreamCollector as __StreamCollector, +} from "@smithy/types"; + +import { CreateAliasCommandInput, CreateAliasCommandOutput } from "./commands/CreateAliasCommand"; +import { CreateKeyCommandInput, CreateKeyCommandOutput } from "./commands/CreateKeyCommand"; +import { DeleteAliasCommandInput, DeleteAliasCommandOutput } from "./commands/DeleteAliasCommand"; +import { DeleteKeyCommandInput, DeleteKeyCommandOutput } from "./commands/DeleteKeyCommand"; +import { ExportKeyCommandInput, ExportKeyCommandOutput } from "./commands/ExportKeyCommand"; +import { GetAliasCommandInput, GetAliasCommandOutput } from "./commands/GetAliasCommand"; +import { GetKeyCommandInput, GetKeyCommandOutput } from "./commands/GetKeyCommand"; +import { + GetParametersForExportCommandInput, + GetParametersForExportCommandOutput, +} from "./commands/GetParametersForExportCommand"; +import { + GetParametersForImportCommandInput, + GetParametersForImportCommandOutput, +} from "./commands/GetParametersForImportCommand"; +import { + GetPublicKeyCertificateCommandInput, + GetPublicKeyCertificateCommandOutput, +} from "./commands/GetPublicKeyCertificateCommand"; +import { ImportKeyCommandInput, ImportKeyCommandOutput } from "./commands/ImportKeyCommand"; +import { ListAliasesCommandInput, ListAliasesCommandOutput } from "./commands/ListAliasesCommand"; +import { ListKeysCommandInput, ListKeysCommandOutput } from "./commands/ListKeysCommand"; +import { + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "./commands/ListTagsForResourceCommand"; +import { RestoreKeyCommandInput, RestoreKeyCommandOutput } from "./commands/RestoreKeyCommand"; +import { StartKeyUsageCommandInput, StartKeyUsageCommandOutput } from "./commands/StartKeyUsageCommand"; +import { StopKeyUsageCommandInput, StopKeyUsageCommandOutput } from "./commands/StopKeyUsageCommand"; +import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand"; +import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand"; +import { UpdateAliasCommandInput, UpdateAliasCommandOutput } from "./commands/UpdateAliasCommand"; +import { + ClientInputEndpointParameters, + ClientResolvedEndpointParameters, + EndpointParameters, + resolveClientEndpointParameters, +} from "./endpoint/EndpointParameters"; +import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig"; + +export { __Client }; + +/** + * @public + */ +export type ServiceInputTypes = + | CreateAliasCommandInput + | CreateKeyCommandInput + | DeleteAliasCommandInput + | DeleteKeyCommandInput + | ExportKeyCommandInput + | GetAliasCommandInput + | GetKeyCommandInput + | GetParametersForExportCommandInput + | GetParametersForImportCommandInput + | GetPublicKeyCertificateCommandInput + | ImportKeyCommandInput + | ListAliasesCommandInput + | ListKeysCommandInput + | ListTagsForResourceCommandInput + | RestoreKeyCommandInput + | StartKeyUsageCommandInput + | StopKeyUsageCommandInput + | TagResourceCommandInput + | UntagResourceCommandInput + | UpdateAliasCommandInput; + +/** + * @public + */ +export type ServiceOutputTypes = + | CreateAliasCommandOutput + | CreateKeyCommandOutput + | DeleteAliasCommandOutput + | DeleteKeyCommandOutput + | ExportKeyCommandOutput + | GetAliasCommandOutput + | GetKeyCommandOutput + | GetParametersForExportCommandOutput + | GetParametersForImportCommandOutput + | GetPublicKeyCertificateCommandOutput + | ImportKeyCommandOutput + | ListAliasesCommandOutput + | ListKeysCommandOutput + | ListTagsForResourceCommandOutput + | RestoreKeyCommandOutput + | StartKeyUsageCommandOutput + | StopKeyUsageCommandOutput + | TagResourceCommandOutput + | UntagResourceCommandOutput + | UpdateAliasCommandOutput; + +/** + * @public + */ +export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> { + /** + * The HTTP handler to use. Fetch in browser and Https in Nodejs. + */ + requestHandler?: __HttpHandler; + + /** + * A constructor for a class implementing the {@link @aws-sdk/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 dyanamically changing the endpoint of the client based on the hostPrefix + * trait of an operation. + */ + disableHostPrefix?: boolean; + + /** + * Unique service identifier. + * @internal + */ + serviceId?: string; + + /** + * Enables IPv6/IPv4 dualstack endpoint. + */ + useDualstackEndpoint?: boolean | __Provider; + + /** + * Enables FIPS compatible endpoints. + */ + useFipsEndpoint?: boolean | __Provider; + + /** + * The AWS region to which this client will send requests + */ + region?: string | __Provider; + + /** + * Default credentials provider; Not available in browser runtime. + * @internal + */ + credentialDefaultProvider?: (input: any) => __Provider<__Credentials>; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; + + /** + * Value for how many times a request will be made at most in case of retry. + */ + maxAttempts?: number | __Provider; + + /** + * Specifies which retry algorithm to use. + */ + retryMode?: string | __Provider; + + /** + * Optional logger for logging debug/info/warn/error. + */ + logger?: __Logger; + + /** + * The {@link @aws-sdk/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 PaymentCryptographyClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & + ClientDefaults & + RegionInputConfig & + EndpointInputConfig & + RetryInputConfig & + HostHeaderInputConfig & + AwsAuthInputConfig & + UserAgentInputConfig & + ClientInputEndpointParameters; +/** + * @public + * + * The configuration interface of PaymentCryptographyClient class constructor that set the region, credentials and other options. + */ +export interface PaymentCryptographyClientConfig extends PaymentCryptographyClientConfigType {} + +/** + * @public + */ +export type PaymentCryptographyClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & + Required & + RegionResolvedConfig & + EndpointResolvedConfig & + RetryResolvedConfig & + HostHeaderResolvedConfig & + AwsAuthResolvedConfig & + UserAgentResolvedConfig & + ClientResolvedEndpointParameters; +/** + * @public + * + * The resolved configuration interface of PaymentCryptographyClient class. This is resolved and normalized from the {@link PaymentCryptographyClientConfig | constructor configuration interface}. + */ +export interface PaymentCryptographyClientResolvedConfig extends PaymentCryptographyClientResolvedConfigType {} + +/** + * @public + *

You use the Amazon Web Services Payment Cryptography Control Plane to manage the encryption keys you use for payment-related cryptographic operations. You can create, import, export, share, manage, and delete keys. You can also manage Identity and Access Management (IAM) policies for keys. For more information, see Identity and access management in the Amazon Web Services Payment Cryptography User Guide. + *

+ *

To use encryption keys for payment-related transaction processing and associated cryptographic operations, you use the Amazon Web Services Payment Cryptography Data Plane. You can encrypt, decrypt, generate, verify, and translate payment-related cryptographic operations.

+ *

All Amazon Web Services Payment Cryptography API calls must be signed and transmitted using Transport Layer Security (TLS). We recommend you always use the latest supported TLS version for logging API requests.

+ *

Amazon Web Services Payment Cryptography supports CloudTrail, a service that logs Amazon Web Services API calls and related events for your Amazon Web Services account and delivers them to an Amazon S3 bucket that you specify. By using the information collected by CloudTrail, you can determine what requests were made to Amazon Web Services Payment Cryptography, who made the request, when it was made, and so on. If you don't configure a trail, you can still view the most recent events in the CloudTrail console. For more information, see the CloudTrail User Guide.

+ */ +export class PaymentCryptographyClient extends __Client< + __HttpHandlerOptions, + ServiceInputTypes, + ServiceOutputTypes, + PaymentCryptographyClientResolvedConfig +> { + /** + * The resolved configuration of PaymentCryptographyClient class. This is resolved and normalized from the {@link PaymentCryptographyClientConfig | constructor configuration interface}. + */ + readonly config: PaymentCryptographyClientResolvedConfig; + + constructor(configuration: PaymentCryptographyClientConfig) { + const _config_0 = __getRuntimeConfig(configuration); + const _config_1 = resolveClientEndpointParameters(_config_0); + const _config_2 = resolveRegionConfig(_config_1); + const _config_3 = resolveEndpointConfig(_config_2); + const _config_4 = resolveRetryConfig(_config_3); + const _config_5 = resolveHostHeaderConfig(_config_4); + const _config_6 = resolveAwsAuthConfig(_config_5); + const _config_7 = resolveUserAgentConfig(_config_6); + super(_config_7); + this.config = _config_7; + this.middlewareStack.use(getRetryPlugin(this.config)); + this.middlewareStack.use(getContentLengthPlugin(this.config)); + this.middlewareStack.use(getHostHeaderPlugin(this.config)); + this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getRecursionDetectionPlugin(this.config)); + this.middlewareStack.use(getAwsAuthPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); + } + + /** + * Destroy underlying resources, like sockets. It's usually not necessary to do this. + * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed. + * Otherwise, sockets might stay open for quite a long time before the server terminates them. + */ + destroy(): void { + super.destroy(); + } +} diff --git a/clients/client-payment-cryptography/src/commands/CreateAliasCommand.ts b/clients/client-payment-cryptography/src/commands/CreateAliasCommand.ts new file mode 100644 index 000000000000..98a20304c8f8 --- /dev/null +++ b/clients/client-payment-cryptography/src/commands/CreateAliasCommand.ts @@ -0,0 +1,201 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { SerdeContext as __SerdeContext } from "@smithy/types"; + +import { CreateAliasInput, CreateAliasOutput } from "../models/models_0"; +import { + PaymentCryptographyClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../PaymentCryptographyClient"; +import { de_CreateAliasCommand, se_CreateAliasCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link CreateAliasCommand}. + */ +export interface CreateAliasCommandInput extends CreateAliasInput {} +/** + * @public + * + * The output of {@link CreateAliasCommand}. + */ +export interface CreateAliasCommandOutput extends CreateAliasOutput, __MetadataBearer {} + +/** + * @public + *

Creates an alias, or a friendly name, for an Amazon Web Services Payment Cryptography key. You can use an alias to identify a key in the console and when you call cryptographic operations such as EncryptData or DecryptData.

+ *

You can associate the alias with any key in the same Amazon Web Services Region. Each alias is associated with only one key at a time, but a key can have multiple aliases. You can't create an alias without a key. The alias must be unique in the account and Amazon Web Services Region, but you can create another alias with the same name in a different Amazon Web Services Region.

+ *

To change the key that's associated with the alias, call UpdateAlias. To delete the alias, call DeleteAlias. These operations don't affect the underlying key. To get the alias that you created, call ListAliases.

+ *

+ * Cross-account use: This operation can't be used across different Amazon Web Services accounts.

+ *

+ * Related operations: + *

+ * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { PaymentCryptographyClient, CreateAliasCommand } from "@aws-sdk/client-payment-cryptography"; // ES Modules import + * // const { PaymentCryptographyClient, CreateAliasCommand } = require("@aws-sdk/client-payment-cryptography"); // CommonJS import + * const client = new PaymentCryptographyClient(config); + * const input = { // CreateAliasInput + * AliasName: "STRING_VALUE", // required + * KeyArn: "STRING_VALUE", + * }; + * const command = new CreateAliasCommand(input); + * const response = await client.send(command); + * // { // CreateAliasOutput + * // Alias: { // Alias + * // AliasName: "STRING_VALUE", // required + * // KeyArn: "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param CreateAliasCommandInput - {@link CreateAliasCommandInput} + * @returns {@link CreateAliasCommandOutput} + * @see {@link CreateAliasCommandInput} for command's `input` shape. + * @see {@link CreateAliasCommandOutput} for command's `response` shape. + * @see {@link PaymentCryptographyClientResolvedConfig | config} for PaymentCryptographyClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

This request can cause an inconsistent state for the resource.

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

The request processing has failed because of an unknown error, exception, or failure.

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

The request was denied due to an invalid resource error.

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

This request would cause a service quota to be exceeded.

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

The service cannot complete the request.

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

The request was denied due to request throttling.

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

The request was denied due to an invalid request error.

+ * + * @throws {@link PaymentCryptographyServiceException} + *

Base exception class for all service exceptions from PaymentCryptography service.

+ * + */ +export class CreateAliasCommand extends $Command< + CreateAliasCommandInput, + CreateAliasCommandOutput, + PaymentCryptographyClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: CreateAliasCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: PaymentCryptographyClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, CreateAliasCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "PaymentCryptographyClient"; + const commandName = "CreateAliasCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: CreateAliasCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_CreateAliasCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_CreateAliasCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-payment-cryptography/src/commands/CreateKeyCommand.ts b/clients/client-payment-cryptography/src/commands/CreateKeyCommand.ts new file mode 100644 index 000000000000..2f8d653458ca --- /dev/null +++ b/clients/client-payment-cryptography/src/commands/CreateKeyCommand.ts @@ -0,0 +1,246 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { SerdeContext as __SerdeContext } from "@smithy/types"; + +import { CreateKeyInput, CreateKeyOutput } from "../models/models_0"; +import { + PaymentCryptographyClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../PaymentCryptographyClient"; +import { de_CreateKeyCommand, se_CreateKeyCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link CreateKeyCommand}. + */ +export interface CreateKeyCommandInput extends CreateKeyInput {} +/** + * @public + * + * The output of {@link CreateKeyCommand}. + */ +export interface CreateKeyCommandOutput extends CreateKeyOutput, __MetadataBearer {} + +/** + * @public + *

Creates an Amazon Web Services Payment Cryptography key, a logical representation of a cryptographic key, that is unique in your account and Amazon Web Services Region. You use keys for cryptographic functions such as encryption and decryption.

+ *

In addition to the key material used in cryptographic operations, an Amazon Web Services Payment Cryptography key includes metadata such as the key ARN, key usage, key origin, creation date, description, and key state.

+ *

When you create a key, you specify both immutable and mutable data about the key. The immutable data contains key attributes that defines the scope and cryptographic operations that you can perform using the key, for example key class (example: SYMMETRIC_KEY), key algorithm (example: TDES_2KEY), key usage (example: TR31_P0_PIN_ENCRYPTION_KEY) and key modes of use (example: Encrypt). For information about valid combinations of key attributes, see Understanding key attributes in the Amazon Web Services Payment Cryptography User Guide. The mutable data contained within a key includes usage timestamp and key deletion timestamp and can be modified after creation.

+ *

Amazon Web Services Payment Cryptography binds key attributes to keys using key blocks when you store or export them. Amazon Web Services Payment Cryptography stores the key contents wrapped and never stores or transmits them in the clear.

+ *

+ * Cross-account use: This operation can't be used across different Amazon Web Services accounts.

+ *

+ * Related operations: + *

+ * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { PaymentCryptographyClient, CreateKeyCommand } from "@aws-sdk/client-payment-cryptography"; // ES Modules import + * // const { PaymentCryptographyClient, CreateKeyCommand } = require("@aws-sdk/client-payment-cryptography"); // CommonJS import + * const client = new PaymentCryptographyClient(config); + * const input = { // CreateKeyInput + * KeyAttributes: { // KeyAttributes + * KeyUsage: "STRING_VALUE", // required + * KeyClass: "STRING_VALUE", // required + * KeyAlgorithm: "STRING_VALUE", // required + * KeyModesOfUse: { // KeyModesOfUse + * Encrypt: true || false, + * Decrypt: true || false, + * Wrap: true || false, + * Unwrap: true || false, + * Generate: true || false, + * Sign: true || false, + * Verify: true || false, + * DeriveKey: true || false, + * NoRestrictions: true || false, + * }, + * }, + * KeyCheckValueAlgorithm: "STRING_VALUE", + * Exportable: true || false, // required + * Enabled: true || false, + * Tags: [ // Tags + * { // Tag + * Key: "STRING_VALUE", // required + * Value: "STRING_VALUE", + * }, + * ], + * }; + * const command = new CreateKeyCommand(input); + * const response = await client.send(command); + * // { // CreateKeyOutput + * // Key: { // Key + * // KeyArn: "STRING_VALUE", // required + * // KeyAttributes: { // KeyAttributes + * // KeyUsage: "STRING_VALUE", // required + * // KeyClass: "STRING_VALUE", // required + * // KeyAlgorithm: "STRING_VALUE", // required + * // KeyModesOfUse: { // KeyModesOfUse + * // Encrypt: true || false, + * // Decrypt: true || false, + * // Wrap: true || false, + * // Unwrap: true || false, + * // Generate: true || false, + * // Sign: true || false, + * // Verify: true || false, + * // DeriveKey: true || false, + * // NoRestrictions: true || false, + * // }, + * // }, + * // KeyCheckValue: "STRING_VALUE", // required + * // KeyCheckValueAlgorithm: "STRING_VALUE", // required + * // Enabled: true || false, // required + * // Exportable: true || false, // required + * // KeyState: "STRING_VALUE", // required + * // KeyOrigin: "STRING_VALUE", // required + * // CreateTimestamp: new Date("TIMESTAMP"), // required + * // UsageStartTimestamp: new Date("TIMESTAMP"), + * // UsageStopTimestamp: new Date("TIMESTAMP"), + * // DeletePendingTimestamp: new Date("TIMESTAMP"), + * // DeleteTimestamp: new Date("TIMESTAMP"), + * // }, + * // }; + * + * ``` + * + * @param CreateKeyCommandInput - {@link CreateKeyCommandInput} + * @returns {@link CreateKeyCommandOutput} + * @see {@link CreateKeyCommandInput} for command's `input` shape. + * @see {@link CreateKeyCommandOutput} for command's `response` shape. + * @see {@link PaymentCryptographyClientResolvedConfig | config} for PaymentCryptographyClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

This request can cause an inconsistent state for the resource.

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

The request processing has failed because of an unknown error, exception, or failure.

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

The request was denied due to an invalid resource error.

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

This request would cause a service quota to be exceeded.

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

The service cannot complete the request.

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

The request was denied due to request throttling.

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

The request was denied due to an invalid request error.

+ * + * @throws {@link PaymentCryptographyServiceException} + *

Base exception class for all service exceptions from PaymentCryptography service.

+ * + */ +export class CreateKeyCommand extends $Command< + CreateKeyCommandInput, + CreateKeyCommandOutput, + PaymentCryptographyClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: CreateKeyCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: PaymentCryptographyClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, CreateKeyCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "PaymentCryptographyClient"; + const commandName = "CreateKeyCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: CreateKeyCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_CreateKeyCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_CreateKeyCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-payment-cryptography/src/commands/DeleteAliasCommand.ts b/clients/client-payment-cryptography/src/commands/DeleteAliasCommand.ts new file mode 100644 index 000000000000..4492982eb145 --- /dev/null +++ b/clients/client-payment-cryptography/src/commands/DeleteAliasCommand.ts @@ -0,0 +1,191 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { SerdeContext as __SerdeContext } from "@smithy/types"; + +import { DeleteAliasInput, DeleteAliasOutput } from "../models/models_0"; +import { + PaymentCryptographyClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../PaymentCryptographyClient"; +import { de_DeleteAliasCommand, se_DeleteAliasCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link DeleteAliasCommand}. + */ +export interface DeleteAliasCommandInput extends DeleteAliasInput {} +/** + * @public + * + * The output of {@link DeleteAliasCommand}. + */ +export interface DeleteAliasCommandOutput extends DeleteAliasOutput, __MetadataBearer {} + +/** + * @public + *

Deletes the alias, but doesn't affect the underlying key.

+ *

Each key can have multiple aliases. To get the aliases of all keys, use the ListAliases operation. To change the alias of a key, first use DeleteAlias to delete the current alias and then use CreateAlias to create a new alias. To associate an existing alias with a different key, call UpdateAlias.

+ *

+ * Cross-account use: This operation can't be used across different Amazon Web Services accounts.

+ *

+ * Related operations: + *

+ * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { PaymentCryptographyClient, DeleteAliasCommand } from "@aws-sdk/client-payment-cryptography"; // ES Modules import + * // const { PaymentCryptographyClient, DeleteAliasCommand } = require("@aws-sdk/client-payment-cryptography"); // CommonJS import + * const client = new PaymentCryptographyClient(config); + * const input = { // DeleteAliasInput + * AliasName: "STRING_VALUE", // required + * }; + * const command = new DeleteAliasCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param DeleteAliasCommandInput - {@link DeleteAliasCommandInput} + * @returns {@link DeleteAliasCommandOutput} + * @see {@link DeleteAliasCommandInput} for command's `input` shape. + * @see {@link DeleteAliasCommandOutput} for command's `response` shape. + * @see {@link PaymentCryptographyClientResolvedConfig | config} for PaymentCryptographyClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

This request can cause an inconsistent state for the resource.

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

The request processing has failed because of an unknown error, exception, or failure.

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

The request was denied due to an invalid resource error.

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

The service cannot complete the request.

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

The request was denied due to request throttling.

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

The request was denied due to an invalid request error.

+ * + * @throws {@link PaymentCryptographyServiceException} + *

Base exception class for all service exceptions from PaymentCryptography service.

+ * + */ +export class DeleteAliasCommand extends $Command< + DeleteAliasCommandInput, + DeleteAliasCommandOutput, + PaymentCryptographyClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: DeleteAliasCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: PaymentCryptographyClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, DeleteAliasCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "PaymentCryptographyClient"; + const commandName = "DeleteAliasCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: DeleteAliasCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_DeleteAliasCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_DeleteAliasCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-payment-cryptography/src/commands/DeleteKeyCommand.ts b/clients/client-payment-cryptography/src/commands/DeleteKeyCommand.ts new file mode 100644 index 000000000000..23b11e2a28b5 --- /dev/null +++ b/clients/client-payment-cryptography/src/commands/DeleteKeyCommand.ts @@ -0,0 +1,220 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { SerdeContext as __SerdeContext } from "@smithy/types"; + +import { DeleteKeyInput, DeleteKeyOutput } from "../models/models_0"; +import { + PaymentCryptographyClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../PaymentCryptographyClient"; +import { de_DeleteKeyCommand, se_DeleteKeyCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link DeleteKeyCommand}. + */ +export interface DeleteKeyCommandInput extends DeleteKeyInput {} +/** + * @public + * + * The output of {@link DeleteKeyCommand}. + */ +export interface DeleteKeyCommandOutput extends DeleteKeyOutput, __MetadataBearer {} + +/** + * @public + *

Deletes the key material and all metadata associated with Amazon Web Services Payment Cryptography key.

+ *

Key deletion is irreversible. After a key is deleted, you can't perform cryptographic operations using the key. For example, you can't decrypt data that was encrypted by a deleted Amazon Web Services Payment Cryptography key, and the data may become unrecoverable. Because key deletion is destructive, Amazon Web Services Payment Cryptography has a safety mechanism to prevent accidental deletion of a key. When you call this operation, Amazon Web Services Payment Cryptography disables the specified key but doesn't delete it until after a waiting period. The default waiting period is 7 days. To set a different waiting period, set DeleteKeyInDays. During the waiting period, the KeyState is DELETE_PENDING. After the key is deleted, the KeyState is DELETE_COMPLETE.

+ *

If you delete key material, you can use ImportKey to reimport the same key material into the Amazon Web Services Payment Cryptography key.

+ *

You should delete a key only when you are sure that you don't need to use it anymore and no other parties are utilizing this key. If you aren't sure, consider deactivating it instead by calling StopKeyUsage.

+ *

+ * Cross-account use: This operation can't be used across different Amazon Web Services accounts.

+ *

+ * Related operations: + *

+ * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { PaymentCryptographyClient, DeleteKeyCommand } from "@aws-sdk/client-payment-cryptography"; // ES Modules import + * // const { PaymentCryptographyClient, DeleteKeyCommand } = require("@aws-sdk/client-payment-cryptography"); // CommonJS import + * const client = new PaymentCryptographyClient(config); + * const input = { // DeleteKeyInput + * KeyIdentifier: "STRING_VALUE", // required + * DeleteKeyInDays: Number("int"), + * }; + * const command = new DeleteKeyCommand(input); + * const response = await client.send(command); + * // { // DeleteKeyOutput + * // Key: { // Key + * // KeyArn: "STRING_VALUE", // required + * // KeyAttributes: { // KeyAttributes + * // KeyUsage: "STRING_VALUE", // required + * // KeyClass: "STRING_VALUE", // required + * // KeyAlgorithm: "STRING_VALUE", // required + * // KeyModesOfUse: { // KeyModesOfUse + * // Encrypt: true || false, + * // Decrypt: true || false, + * // Wrap: true || false, + * // Unwrap: true || false, + * // Generate: true || false, + * // Sign: true || false, + * // Verify: true || false, + * // DeriveKey: true || false, + * // NoRestrictions: true || false, + * // }, + * // }, + * // KeyCheckValue: "STRING_VALUE", // required + * // KeyCheckValueAlgorithm: "STRING_VALUE", // required + * // Enabled: true || false, // required + * // Exportable: true || false, // required + * // KeyState: "STRING_VALUE", // required + * // KeyOrigin: "STRING_VALUE", // required + * // CreateTimestamp: new Date("TIMESTAMP"), // required + * // UsageStartTimestamp: new Date("TIMESTAMP"), + * // UsageStopTimestamp: new Date("TIMESTAMP"), + * // DeletePendingTimestamp: new Date("TIMESTAMP"), + * // DeleteTimestamp: new Date("TIMESTAMP"), + * // }, + * // }; + * + * ``` + * + * @param DeleteKeyCommandInput - {@link DeleteKeyCommandInput} + * @returns {@link DeleteKeyCommandOutput} + * @see {@link DeleteKeyCommandInput} for command's `input` shape. + * @see {@link DeleteKeyCommandOutput} for command's `response` shape. + * @see {@link PaymentCryptographyClientResolvedConfig | config} for PaymentCryptographyClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

This request can cause an inconsistent state for the resource.

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

The request processing has failed because of an unknown error, exception, or failure.

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

The request was denied due to an invalid resource error.

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

The service cannot complete the request.

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

The request was denied due to request throttling.

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

The request was denied due to an invalid request error.

+ * + * @throws {@link PaymentCryptographyServiceException} + *

Base exception class for all service exceptions from PaymentCryptography service.

+ * + */ +export class DeleteKeyCommand extends $Command< + DeleteKeyCommandInput, + DeleteKeyCommandOutput, + PaymentCryptographyClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: DeleteKeyCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: PaymentCryptographyClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, DeleteKeyCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "PaymentCryptographyClient"; + const commandName = "DeleteKeyCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: DeleteKeyCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_DeleteKeyCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_DeleteKeyCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-payment-cryptography/src/commands/ExportKeyCommand.ts b/clients/client-payment-cryptography/src/commands/ExportKeyCommand.ts new file mode 100644 index 000000000000..9b70ad8a63c0 --- /dev/null +++ b/clients/client-payment-cryptography/src/commands/ExportKeyCommand.ts @@ -0,0 +1,229 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { SerdeContext as __SerdeContext } from "@smithy/types"; + +import { + ExportKeyInput, + ExportKeyInputFilterSensitiveLog, + ExportKeyOutput, + ExportKeyOutputFilterSensitiveLog, +} from "../models/models_0"; +import { + PaymentCryptographyClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../PaymentCryptographyClient"; +import { de_ExportKeyCommand, se_ExportKeyCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ExportKeyCommand}. + */ +export interface ExportKeyCommandInput extends ExportKeyInput {} +/** + * @public + * + * The output of {@link ExportKeyCommand}. + */ +export interface ExportKeyCommandOutput extends ExportKeyOutput, __MetadataBearer {} + +/** + * @public + *

Exports a key from Amazon Web Services Payment Cryptography using either ANSI X9 TR-34 or TR-31 key export standard.

+ *

Amazon Web Services Payment Cryptography simplifies main or root key exchange process by eliminating the need of a paper-based key exchange process. It takes a modern and secure approach based of the ANSI X9 TR-34 key exchange standard.

+ *

You can use ExportKey to export main or root keys such as KEK (Key Encryption Key), using asymmetric key exchange technique following ANSI X9 TR-34 standard. The ANSI X9 TR-34 standard uses asymmetric keys to establishes bi-directional trust between the two parties exchanging keys. After which you can export working keys using the ANSI X9 TR-31 symmetric key exchange standard as mandated by PCI PIN. Using this operation, you can share your Amazon Web Services Payment Cryptography generated keys with other service partners to perform cryptographic operations outside of Amazon Web Services Payment Cryptography

+ *

+ * TR-34 key export + *

+ *

Amazon Web Services Payment Cryptography uses TR-34 asymmetric key exchange standard to export main keys such as KEK. In TR-34 terminology, the sending party of the key is called Key Distribution Host (KDH) and the receiving party of the key is called Key Receiving Host (KRH). In key export process, KDH is Amazon Web Services Payment Cryptography which initiates key export. KRH is the user receiving the key. Before you initiate TR-34 key export, you must obtain an export token by calling GetParametersForExport. This operation also returns the signing key certificate that KDH uses to sign the wrapped key to generate a TR-34 wrapped key block. The export token expires after 7 days.

+ *

Set the following parameters:

+ *
+ *
CertificateAuthorityPublicKeyIdentifier
+ *
+ *

The KeyARN of the certificate chain that will sign the wrapping key certificate. This must exist within Amazon Web Services Payment Cryptography before you initiate TR-34 key export. If it does not exist, you can import it by calling ImportKey for RootCertificatePublicKey.

+ *
+ *
ExportToken
+ *
+ *

Obtained from KDH by calling GetParametersForExport.

+ *
+ *
WrappingKeyCertificate
+ *
+ *

Amazon Web Services Payment Cryptography uses this to wrap the key under export.

+ *
+ *
+ *

When this operation is successful, Amazon Web Services Payment Cryptography returns the TR-34 wrapped key block.

+ *

+ * TR-31 key export + *

+ *

Amazon Web Services Payment Cryptography uses TR-31 symmetric key exchange standard to export working keys. In TR-31, you must use a main key such as KEK to encrypt or wrap the key under export. To establish a KEK, you can use CreateKey or ImportKey. When this operation is successful, Amazon Web Services Payment Cryptography returns a TR-31 wrapped key block.

+ *

+ * Cross-account use: This operation can't be used across different Amazon Web Services accounts.

+ *

+ * Related operations: + *

+ * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { PaymentCryptographyClient, ExportKeyCommand } from "@aws-sdk/client-payment-cryptography"; // ES Modules import + * // const { PaymentCryptographyClient, ExportKeyCommand } = require("@aws-sdk/client-payment-cryptography"); // CommonJS import + * const client = new PaymentCryptographyClient(config); + * const input = { // ExportKeyInput + * KeyMaterial: { // ExportKeyMaterial Union: only one key present + * Tr31KeyBlock: { // ExportTr31KeyBlock + * WrappingKeyIdentifier: "STRING_VALUE", // required + * }, + * Tr34KeyBlock: { // ExportTr34KeyBlock + * CertificateAuthorityPublicKeyIdentifier: "STRING_VALUE", // required + * WrappingKeyCertificate: "STRING_VALUE", // required + * ExportToken: "STRING_VALUE", // required + * KeyBlockFormat: "STRING_VALUE", // required + * RandomNonce: "STRING_VALUE", + * }, + * }, + * ExportKeyIdentifier: "STRING_VALUE", // required + * }; + * const command = new ExportKeyCommand(input); + * const response = await client.send(command); + * // { // ExportKeyOutput + * // WrappedKey: { // WrappedKey + * // WrappingKeyArn: "STRING_VALUE", // required + * // WrappedKeyMaterialFormat: "STRING_VALUE", // required + * // KeyMaterial: "STRING_VALUE", // required + * // }, + * // }; + * + * ``` + * + * @param ExportKeyCommandInput - {@link ExportKeyCommandInput} + * @returns {@link ExportKeyCommandOutput} + * @see {@link ExportKeyCommandInput} for command's `input` shape. + * @see {@link ExportKeyCommandOutput} for command's `response` shape. + * @see {@link PaymentCryptographyClientResolvedConfig | config} for PaymentCryptographyClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

This request can cause an inconsistent state for the resource.

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

The request processing has failed because of an unknown error, exception, or failure.

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

The request was denied due to an invalid resource error.

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

The service cannot complete the request.

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

The request was denied due to request throttling.

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

The request was denied due to an invalid request error.

+ * + * @throws {@link PaymentCryptographyServiceException} + *

Base exception class for all service exceptions from PaymentCryptography service.

+ * + */ +export class ExportKeyCommand extends $Command< + ExportKeyCommandInput, + ExportKeyCommandOutput, + PaymentCryptographyClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: ExportKeyCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: PaymentCryptographyClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, ExportKeyCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "PaymentCryptographyClient"; + const commandName = "ExportKeyCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: ExportKeyInputFilterSensitiveLog, + outputFilterSensitiveLog: ExportKeyOutputFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: ExportKeyCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_ExportKeyCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_ExportKeyCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-payment-cryptography/src/commands/GetAliasCommand.ts b/clients/client-payment-cryptography/src/commands/GetAliasCommand.ts new file mode 100644 index 000000000000..dd7c96d71f67 --- /dev/null +++ b/clients/client-payment-cryptography/src/commands/GetAliasCommand.ts @@ -0,0 +1,192 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { SerdeContext as __SerdeContext } from "@smithy/types"; + +import { GetAliasInput, GetAliasOutput } from "../models/models_0"; +import { + PaymentCryptographyClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../PaymentCryptographyClient"; +import { de_GetAliasCommand, se_GetAliasCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link GetAliasCommand}. + */ +export interface GetAliasCommandInput extends GetAliasInput {} +/** + * @public + * + * The output of {@link GetAliasCommand}. + */ +export interface GetAliasCommandOutput extends GetAliasOutput, __MetadataBearer {} + +/** + * @public + *

Gets the Amazon Web Services Payment Cryptography key associated with the alias.

+ *

+ * Cross-account use: This operation can't be used across different Amazon Web Services accounts.

+ *

+ * Related operations: + *

+ * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { PaymentCryptographyClient, GetAliasCommand } from "@aws-sdk/client-payment-cryptography"; // ES Modules import + * // const { PaymentCryptographyClient, GetAliasCommand } = require("@aws-sdk/client-payment-cryptography"); // CommonJS import + * const client = new PaymentCryptographyClient(config); + * const input = { // GetAliasInput + * AliasName: "STRING_VALUE", // required + * }; + * const command = new GetAliasCommand(input); + * const response = await client.send(command); + * // { // GetAliasOutput + * // Alias: { // Alias + * // AliasName: "STRING_VALUE", // required + * // KeyArn: "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param GetAliasCommandInput - {@link GetAliasCommandInput} + * @returns {@link GetAliasCommandOutput} + * @see {@link GetAliasCommandInput} for command's `input` shape. + * @see {@link GetAliasCommandOutput} for command's `response` shape. + * @see {@link PaymentCryptographyClientResolvedConfig | config} for PaymentCryptographyClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

The request processing has failed because of an unknown error, exception, or failure.

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

The request was denied due to an invalid resource error.

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

The service cannot complete the request.

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

The request was denied due to request throttling.

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

The request was denied due to an invalid request error.

+ * + * @throws {@link PaymentCryptographyServiceException} + *

Base exception class for all service exceptions from PaymentCryptography service.

+ * + */ +export class GetAliasCommand extends $Command< + GetAliasCommandInput, + GetAliasCommandOutput, + PaymentCryptographyClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: GetAliasCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: PaymentCryptographyClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, GetAliasCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "PaymentCryptographyClient"; + const commandName = "GetAliasCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: GetAliasCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_GetAliasCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_GetAliasCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-payment-cryptography/src/commands/GetKeyCommand.ts b/clients/client-payment-cryptography/src/commands/GetKeyCommand.ts new file mode 100644 index 000000000000..dcf8c1b3e5b5 --- /dev/null +++ b/clients/client-payment-cryptography/src/commands/GetKeyCommand.ts @@ -0,0 +1,213 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { SerdeContext as __SerdeContext } from "@smithy/types"; + +import { GetKeyInput, GetKeyOutput } from "../models/models_0"; +import { + PaymentCryptographyClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../PaymentCryptographyClient"; +import { de_GetKeyCommand, se_GetKeyCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link GetKeyCommand}. + */ +export interface GetKeyCommandInput extends GetKeyInput {} +/** + * @public + * + * The output of {@link GetKeyCommand}. + */ +export interface GetKeyCommandOutput extends GetKeyOutput, __MetadataBearer {} + +/** + * @public + *

Gets the key material for an Amazon Web Services Payment Cryptography key, including the immutable and mutable data specified when the key was created.

+ *

+ * Cross-account use: This operation can't be used across different Amazon Web Services accounts.

+ *

+ * Related operations: + *

+ * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { PaymentCryptographyClient, GetKeyCommand } from "@aws-sdk/client-payment-cryptography"; // ES Modules import + * // const { PaymentCryptographyClient, GetKeyCommand } = require("@aws-sdk/client-payment-cryptography"); // CommonJS import + * const client = new PaymentCryptographyClient(config); + * const input = { // GetKeyInput + * KeyIdentifier: "STRING_VALUE", // required + * }; + * const command = new GetKeyCommand(input); + * const response = await client.send(command); + * // { // GetKeyOutput + * // Key: { // Key + * // KeyArn: "STRING_VALUE", // required + * // KeyAttributes: { // KeyAttributes + * // KeyUsage: "STRING_VALUE", // required + * // KeyClass: "STRING_VALUE", // required + * // KeyAlgorithm: "STRING_VALUE", // required + * // KeyModesOfUse: { // KeyModesOfUse + * // Encrypt: true || false, + * // Decrypt: true || false, + * // Wrap: true || false, + * // Unwrap: true || false, + * // Generate: true || false, + * // Sign: true || false, + * // Verify: true || false, + * // DeriveKey: true || false, + * // NoRestrictions: true || false, + * // }, + * // }, + * // KeyCheckValue: "STRING_VALUE", // required + * // KeyCheckValueAlgorithm: "STRING_VALUE", // required + * // Enabled: true || false, // required + * // Exportable: true || false, // required + * // KeyState: "STRING_VALUE", // required + * // KeyOrigin: "STRING_VALUE", // required + * // CreateTimestamp: new Date("TIMESTAMP"), // required + * // UsageStartTimestamp: new Date("TIMESTAMP"), + * // UsageStopTimestamp: new Date("TIMESTAMP"), + * // DeletePendingTimestamp: new Date("TIMESTAMP"), + * // DeleteTimestamp: new Date("TIMESTAMP"), + * // }, + * // }; + * + * ``` + * + * @param GetKeyCommandInput - {@link GetKeyCommandInput} + * @returns {@link GetKeyCommandOutput} + * @see {@link GetKeyCommandInput} for command's `input` shape. + * @see {@link GetKeyCommandOutput} for command's `response` shape. + * @see {@link PaymentCryptographyClientResolvedConfig | config} for PaymentCryptographyClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

The request processing has failed because of an unknown error, exception, or failure.

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

The request was denied due to an invalid resource error.

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

The service cannot complete the request.

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

The request was denied due to request throttling.

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

The request was denied due to an invalid request error.

+ * + * @throws {@link PaymentCryptographyServiceException} + *

Base exception class for all service exceptions from PaymentCryptography service.

+ * + */ +export class GetKeyCommand extends $Command< + GetKeyCommandInput, + GetKeyCommandOutput, + PaymentCryptographyClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: GetKeyCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: PaymentCryptographyClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, GetKeyCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "PaymentCryptographyClient"; + const commandName = "GetKeyCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: GetKeyCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_GetKeyCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_GetKeyCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-payment-cryptography/src/commands/GetParametersForExportCommand.ts b/clients/client-payment-cryptography/src/commands/GetParametersForExportCommand.ts new file mode 100644 index 000000000000..67909dfb3436 --- /dev/null +++ b/clients/client-payment-cryptography/src/commands/GetParametersForExportCommand.ts @@ -0,0 +1,197 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { SerdeContext as __SerdeContext } from "@smithy/types"; + +import { + GetParametersForExportInput, + GetParametersForExportOutput, + GetParametersForExportOutputFilterSensitiveLog, +} from "../models/models_0"; +import { + PaymentCryptographyClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../PaymentCryptographyClient"; +import { de_GetParametersForExportCommand, se_GetParametersForExportCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link GetParametersForExportCommand}. + */ +export interface GetParametersForExportCommandInput extends GetParametersForExportInput {} +/** + * @public + * + * The output of {@link GetParametersForExportCommand}. + */ +export interface GetParametersForExportCommandOutput extends GetParametersForExportOutput, __MetadataBearer {} + +/** + * @public + *

Gets the export token and the signing key certificate to initiate a TR-34 key export from Amazon Web Services Payment Cryptography.

+ *

The signing key certificate signs the wrapped key under export within the TR-34 key payload. The export token and signing key certificate must be in place and operational before calling ExportKey. The export token expires in 7 days. You can use the same export token to export multiple keys from your service account.

+ *

+ * Cross-account use: This operation can't be used across different Amazon Web Services accounts.

+ *

+ * Related operations: + *

+ * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { PaymentCryptographyClient, GetParametersForExportCommand } from "@aws-sdk/client-payment-cryptography"; // ES Modules import + * // const { PaymentCryptographyClient, GetParametersForExportCommand } = require("@aws-sdk/client-payment-cryptography"); // CommonJS import + * const client = new PaymentCryptographyClient(config); + * const input = { // GetParametersForExportInput + * KeyMaterialType: "STRING_VALUE", // required + * SigningKeyAlgorithm: "STRING_VALUE", // required + * }; + * const command = new GetParametersForExportCommand(input); + * const response = await client.send(command); + * // { // GetParametersForExportOutput + * // SigningKeyCertificate: "STRING_VALUE", // required + * // SigningKeyCertificateChain: "STRING_VALUE", // required + * // SigningKeyAlgorithm: "STRING_VALUE", // required + * // ExportToken: "STRING_VALUE", // required + * // ParametersValidUntilTimestamp: new Date("TIMESTAMP"), // required + * // }; + * + * ``` + * + * @param GetParametersForExportCommandInput - {@link GetParametersForExportCommandInput} + * @returns {@link GetParametersForExportCommandOutput} + * @see {@link GetParametersForExportCommandInput} for command's `input` shape. + * @see {@link GetParametersForExportCommandOutput} for command's `response` shape. + * @see {@link PaymentCryptographyClientResolvedConfig | config} for PaymentCryptographyClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

This request can cause an inconsistent state for the resource.

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

The request processing has failed because of an unknown error, exception, or failure.

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

The request was denied due to an invalid resource error.

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

This request would cause a service quota to be exceeded.

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

The service cannot complete the request.

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

The request was denied due to request throttling.

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

The request was denied due to an invalid request error.

+ * + * @throws {@link PaymentCryptographyServiceException} + *

Base exception class for all service exceptions from PaymentCryptography service.

+ * + */ +export class GetParametersForExportCommand extends $Command< + GetParametersForExportCommandInput, + GetParametersForExportCommandOutput, + PaymentCryptographyClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: GetParametersForExportCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: PaymentCryptographyClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, GetParametersForExportCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "PaymentCryptographyClient"; + const commandName = "GetParametersForExportCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: GetParametersForExportOutputFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: GetParametersForExportCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_GetParametersForExportCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_GetParametersForExportCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-payment-cryptography/src/commands/GetParametersForImportCommand.ts b/clients/client-payment-cryptography/src/commands/GetParametersForImportCommand.ts new file mode 100644 index 000000000000..0259fa4ff16b --- /dev/null +++ b/clients/client-payment-cryptography/src/commands/GetParametersForImportCommand.ts @@ -0,0 +1,197 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { SerdeContext as __SerdeContext } from "@smithy/types"; + +import { + GetParametersForImportInput, + GetParametersForImportOutput, + GetParametersForImportOutputFilterSensitiveLog, +} from "../models/models_0"; +import { + PaymentCryptographyClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../PaymentCryptographyClient"; +import { de_GetParametersForImportCommand, se_GetParametersForImportCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link GetParametersForImportCommand}. + */ +export interface GetParametersForImportCommandInput extends GetParametersForImportInput {} +/** + * @public + * + * The output of {@link GetParametersForImportCommand}. + */ +export interface GetParametersForImportCommandOutput extends GetParametersForImportOutput, __MetadataBearer {} + +/** + * @public + *

Gets the import token and the wrapping key certificate to initiate a TR-34 key import into Amazon Web Services Payment Cryptography.

+ *

The wrapping key certificate wraps the key under import within the TR-34 key payload. The import token and wrapping key certificate must be in place and operational before calling ImportKey. The import token expires in 7 days. The same import token can be used to import multiple keys into your service account.

+ *

+ * Cross-account use: This operation can't be used across different Amazon Web Services accounts.

+ *

+ * Related operations: + *

+ * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { PaymentCryptographyClient, GetParametersForImportCommand } from "@aws-sdk/client-payment-cryptography"; // ES Modules import + * // const { PaymentCryptographyClient, GetParametersForImportCommand } = require("@aws-sdk/client-payment-cryptography"); // CommonJS import + * const client = new PaymentCryptographyClient(config); + * const input = { // GetParametersForImportInput + * KeyMaterialType: "STRING_VALUE", // required + * WrappingKeyAlgorithm: "STRING_VALUE", // required + * }; + * const command = new GetParametersForImportCommand(input); + * const response = await client.send(command); + * // { // GetParametersForImportOutput + * // WrappingKeyCertificate: "STRING_VALUE", // required + * // WrappingKeyCertificateChain: "STRING_VALUE", // required + * // WrappingKeyAlgorithm: "STRING_VALUE", // required + * // ImportToken: "STRING_VALUE", // required + * // ParametersValidUntilTimestamp: new Date("TIMESTAMP"), // required + * // }; + * + * ``` + * + * @param GetParametersForImportCommandInput - {@link GetParametersForImportCommandInput} + * @returns {@link GetParametersForImportCommandOutput} + * @see {@link GetParametersForImportCommandInput} for command's `input` shape. + * @see {@link GetParametersForImportCommandOutput} for command's `response` shape. + * @see {@link PaymentCryptographyClientResolvedConfig | config} for PaymentCryptographyClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

This request can cause an inconsistent state for the resource.

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

The request processing has failed because of an unknown error, exception, or failure.

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

The request was denied due to an invalid resource error.

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

This request would cause a service quota to be exceeded.

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

The service cannot complete the request.

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

The request was denied due to request throttling.

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

The request was denied due to an invalid request error.

+ * + * @throws {@link PaymentCryptographyServiceException} + *

Base exception class for all service exceptions from PaymentCryptography service.

+ * + */ +export class GetParametersForImportCommand extends $Command< + GetParametersForImportCommandInput, + GetParametersForImportCommandOutput, + PaymentCryptographyClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: GetParametersForImportCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: PaymentCryptographyClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, GetParametersForImportCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "PaymentCryptographyClient"; + const commandName = "GetParametersForImportCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: GetParametersForImportOutputFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: GetParametersForImportCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_GetParametersForImportCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_GetParametersForImportCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-payment-cryptography/src/commands/GetPublicKeyCertificateCommand.ts b/clients/client-payment-cryptography/src/commands/GetPublicKeyCertificateCommand.ts new file mode 100644 index 000000000000..eacdd7991435 --- /dev/null +++ b/clients/client-payment-cryptography/src/commands/GetPublicKeyCertificateCommand.ts @@ -0,0 +1,172 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { SerdeContext as __SerdeContext } from "@smithy/types"; + +import { + GetPublicKeyCertificateInput, + GetPublicKeyCertificateOutput, + GetPublicKeyCertificateOutputFilterSensitiveLog, +} from "../models/models_0"; +import { + PaymentCryptographyClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../PaymentCryptographyClient"; +import { de_GetPublicKeyCertificateCommand, se_GetPublicKeyCertificateCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link GetPublicKeyCertificateCommand}. + */ +export interface GetPublicKeyCertificateCommandInput extends GetPublicKeyCertificateInput {} +/** + * @public + * + * The output of {@link GetPublicKeyCertificateCommand}. + */ +export interface GetPublicKeyCertificateCommandOutput extends GetPublicKeyCertificateOutput, __MetadataBearer {} + +/** + * @public + *

Gets the public key certificate of the asymmetric key pair that exists within Amazon Web Services Payment Cryptography.

+ *

Unlike the private key of an asymmetric key, which never leaves Amazon Web Services Payment Cryptography unencrypted, callers with GetPublicKeyCertificate permission can download the public key certificate of the asymmetric key. You can share the public key certificate to allow others to encrypt messages and verify signatures outside of Amazon Web Services Payment Cryptography

+ *

+ * Cross-account use: This operation can't be used across different Amazon Web Services accounts.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { PaymentCryptographyClient, GetPublicKeyCertificateCommand } from "@aws-sdk/client-payment-cryptography"; // ES Modules import + * // const { PaymentCryptographyClient, GetPublicKeyCertificateCommand } = require("@aws-sdk/client-payment-cryptography"); // CommonJS import + * const client = new PaymentCryptographyClient(config); + * const input = { // GetPublicKeyCertificateInput + * KeyIdentifier: "STRING_VALUE", // required + * }; + * const command = new GetPublicKeyCertificateCommand(input); + * const response = await client.send(command); + * // { // GetPublicKeyCertificateOutput + * // KeyCertificate: "STRING_VALUE", // required + * // KeyCertificateChain: "STRING_VALUE", // required + * // }; + * + * ``` + * + * @param GetPublicKeyCertificateCommandInput - {@link GetPublicKeyCertificateCommandInput} + * @returns {@link GetPublicKeyCertificateCommandOutput} + * @see {@link GetPublicKeyCertificateCommandInput} for command's `input` shape. + * @see {@link GetPublicKeyCertificateCommandOutput} for command's `response` shape. + * @see {@link PaymentCryptographyClientResolvedConfig | config} for PaymentCryptographyClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

The request processing has failed because of an unknown error, exception, or failure.

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

The request was denied due to an invalid resource error.

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

The service cannot complete the request.

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

The request was denied due to request throttling.

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

The request was denied due to an invalid request error.

+ * + * @throws {@link PaymentCryptographyServiceException} + *

Base exception class for all service exceptions from PaymentCryptography service.

+ * + */ +export class GetPublicKeyCertificateCommand extends $Command< + GetPublicKeyCertificateCommandInput, + GetPublicKeyCertificateCommandOutput, + PaymentCryptographyClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: GetPublicKeyCertificateCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: PaymentCryptographyClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, GetPublicKeyCertificateCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "PaymentCryptographyClient"; + const commandName = "GetPublicKeyCertificateCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: GetPublicKeyCertificateOutputFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: GetPublicKeyCertificateCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_GetPublicKeyCertificateCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_GetPublicKeyCertificateCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-payment-cryptography/src/commands/ImportKeyCommand.ts b/clients/client-payment-cryptography/src/commands/ImportKeyCommand.ts new file mode 100644 index 000000000000..5281c7e6469d --- /dev/null +++ b/clients/client-payment-cryptography/src/commands/ImportKeyCommand.ts @@ -0,0 +1,372 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { SerdeContext as __SerdeContext } from "@smithy/types"; + +import { ImportKeyInput, ImportKeyInputFilterSensitiveLog, ImportKeyOutput } from "../models/models_0"; +import { + PaymentCryptographyClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../PaymentCryptographyClient"; +import { de_ImportKeyCommand, se_ImportKeyCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ImportKeyCommand}. + */ +export interface ImportKeyCommandInput extends ImportKeyInput {} +/** + * @public + * + * The output of {@link ImportKeyCommand}. + */ +export interface ImportKeyCommandOutput extends ImportKeyOutput, __MetadataBearer {} + +/** + * @public + *

Imports keys and public key certificates into Amazon Web Services Payment Cryptography.

+ *

Amazon Web Services Payment Cryptography simplifies main or root key exchange process by eliminating the need of a paper-based key exchange process. It takes a modern and secure approach based of the ANSI X9 TR-34 key exchange standard.

+ *

You can use ImportKey to import main or root keys such as KEK (Key Encryption Key) using asymmetric key exchange technique following the ANSI X9 TR-34 standard. The ANSI X9 TR-34 standard uses asymmetric keys to establishes bi-directional trust between the two parties exchanging keys.

+ *

After you have imported a main or root key, you can import working keys to perform various cryptographic operations within Amazon Web Services Payment Cryptography using the ANSI X9 TR-31 symmetric key exchange standard as mandated by PCI PIN.

+ *

You can also import a root public key certificate, a self-signed certificate used to sign other public key certificates, or a trusted public key certificate under an already established root public key certificate.

+ *

+ * To import a public root key certificate + *

+ *

Using this operation, you can import the public component (in PEM cerificate format) of your private root key. You can use the imported public root key certificate for digital signatures, for example signing wrapping key or signing key in TR-34, within your Amazon Web Services Payment Cryptography account.

+ *

Set the following parameters:

+ *
    + *
  • + *

    + * KeyMaterial: RootCertificatePublicKey + *

    + *
  • + *
  • + *

    + * KeyClass: PUBLIC_KEY + *

    + *
  • + *
  • + *

    + * KeyModesOfUse: Verify + *

    + *
  • + *
  • + *

    + * KeyUsage: TR31_S0_ASYMMETRIC_KEY_FOR_DIGITAL_SIGNATURE + *

    + *
  • + *
  • + *

    + * PublicKeyCertificate: The certificate authority used to sign the root public key certificate.

    + *
  • + *
+ *

+ * To import a trusted public key certificate + *

+ *

The root public key certificate must be in place and operational before you import a trusted public key certificate. Set the following parameters:

+ *
    + *
  • + *

    + * KeyMaterial: TrustedCertificatePublicKey + *

    + *
  • + *
  • + *

    + * CertificateAuthorityPublicKeyIdentifier: KeyArn of the RootCertificatePublicKey.

    + *
  • + *
  • + *

    + * KeyModesOfUse and KeyUsage: Corresponding to the cryptographic operations such as wrap, sign, or encrypt that you will allow the trusted public key certificate to perform.

    + *
  • + *
  • + *

    + * PublicKeyCertificate: The certificate authority used to sign the trusted public key certificate.

    + *
  • + *
+ *

+ * Import main keys + *

+ *

Amazon Web Services Payment Cryptography uses TR-34 asymmetric key exchange standard to import main keys such as KEK. In TR-34 terminology, the sending party of the key is called Key Distribution Host (KDH) and the receiving party of the key is called Key Receiving Host (KRH). During the key import process, KDH is the user who initiates the key import and KRH is Amazon Web Services Payment Cryptography who receives the key. Before initiating TR-34 key import, you must obtain an import token by calling GetParametersForImport. This operation also returns the wrapping key certificate that KDH uses wrap key under import to generate a TR-34 wrapped key block. The import token expires after 7 days.

+ *

Set the following parameters:

+ *
    + *
  • + *

    + * CertificateAuthorityPublicKeyIdentifier: The KeyArn of the certificate chain that will sign the signing key certificate and should exist within Amazon Web Services Payment Cryptography before initiating TR-34 key import. If it does not exist, you can import it by calling by calling ImportKey for RootCertificatePublicKey.

    + *
  • + *
  • + *

    + * ImportToken: Obtained from KRH by calling GetParametersForImport.

    + *
  • + *
  • + *

    + * WrappedKeyBlock: The TR-34 wrapped key block from KDH. It contains the KDH key under import, wrapped with KRH provided wrapping key certificate and signed by the KDH private signing key. This TR-34 key block is generated by the KDH Hardware Security Module (HSM) outside of Amazon Web Services Payment Cryptography.

    + *
  • + *
  • + *

    + * SigningKeyCertificate: The public component of the private key that signed the KDH TR-34 wrapped key block. In PEM certificate format.

    + *
  • + *
+ * + *

TR-34 is intended primarily to exchange 3DES keys. Your ability to export AES-128 and larger AES keys may be dependent on your source system.

+ *
+ *

+ * Import working keys + *

+ *

Amazon Web Services Payment Cryptography uses TR-31 symmetric key exchange standard to import working keys. A KEK must be established within Amazon Web Services Payment Cryptography by using TR-34 key import. To initiate a TR-31 key import, set the following parameters:

+ *
    + *
  • + *

    + * WrappedKeyBlock: The key under import and encrypted using KEK. The TR-31 key block generated by your HSM outside of Amazon Web Services Payment Cryptography.

    + *
  • + *
  • + *

    + * WrappingKeyIdentifier: The KeyArn of the KEK that Amazon Web Services Payment Cryptography uses to decrypt or unwrap the key under import.

    + *
  • + *
+ *

+ * Cross-account use: This operation can't be used across different Amazon Web Services accounts.

+ *

+ * Related operations: + *

+ * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { PaymentCryptographyClient, ImportKeyCommand } from "@aws-sdk/client-payment-cryptography"; // ES Modules import + * // const { PaymentCryptographyClient, ImportKeyCommand } = require("@aws-sdk/client-payment-cryptography"); // CommonJS import + * const client = new PaymentCryptographyClient(config); + * const input = { // ImportKeyInput + * KeyMaterial: { // ImportKeyMaterial Union: only one key present + * RootCertificatePublicKey: { // RootCertificatePublicKey + * KeyAttributes: { // KeyAttributes + * KeyUsage: "STRING_VALUE", // required + * KeyClass: "STRING_VALUE", // required + * KeyAlgorithm: "STRING_VALUE", // required + * KeyModesOfUse: { // KeyModesOfUse + * Encrypt: true || false, + * Decrypt: true || false, + * Wrap: true || false, + * Unwrap: true || false, + * Generate: true || false, + * Sign: true || false, + * Verify: true || false, + * DeriveKey: true || false, + * NoRestrictions: true || false, + * }, + * }, + * PublicKeyCertificate: "STRING_VALUE", // required + * }, + * TrustedCertificatePublicKey: { // TrustedCertificatePublicKey + * KeyAttributes: { + * KeyUsage: "STRING_VALUE", // required + * KeyClass: "STRING_VALUE", // required + * KeyAlgorithm: "STRING_VALUE", // required + * KeyModesOfUse: { + * Encrypt: true || false, + * Decrypt: true || false, + * Wrap: true || false, + * Unwrap: true || false, + * Generate: true || false, + * Sign: true || false, + * Verify: true || false, + * DeriveKey: true || false, + * NoRestrictions: true || false, + * }, + * }, + * PublicKeyCertificate: "STRING_VALUE", // required + * CertificateAuthorityPublicKeyIdentifier: "STRING_VALUE", // required + * }, + * Tr31KeyBlock: { // ImportTr31KeyBlock + * WrappingKeyIdentifier: "STRING_VALUE", // required + * WrappedKeyBlock: "STRING_VALUE", // required + * }, + * Tr34KeyBlock: { // ImportTr34KeyBlock + * CertificateAuthorityPublicKeyIdentifier: "STRING_VALUE", // required + * SigningKeyCertificate: "STRING_VALUE", // required + * ImportToken: "STRING_VALUE", // required + * WrappedKeyBlock: "STRING_VALUE", // required + * KeyBlockFormat: "STRING_VALUE", // required + * RandomNonce: "STRING_VALUE", + * }, + * }, + * KeyCheckValueAlgorithm: "STRING_VALUE", + * Enabled: true || false, + * Tags: [ // Tags + * { // Tag + * Key: "STRING_VALUE", // required + * Value: "STRING_VALUE", + * }, + * ], + * }; + * const command = new ImportKeyCommand(input); + * const response = await client.send(command); + * // { // ImportKeyOutput + * // Key: { // Key + * // KeyArn: "STRING_VALUE", // required + * // KeyAttributes: { // KeyAttributes + * // KeyUsage: "STRING_VALUE", // required + * // KeyClass: "STRING_VALUE", // required + * // KeyAlgorithm: "STRING_VALUE", // required + * // KeyModesOfUse: { // KeyModesOfUse + * // Encrypt: true || false, + * // Decrypt: true || false, + * // Wrap: true || false, + * // Unwrap: true || false, + * // Generate: true || false, + * // Sign: true || false, + * // Verify: true || false, + * // DeriveKey: true || false, + * // NoRestrictions: true || false, + * // }, + * // }, + * // KeyCheckValue: "STRING_VALUE", // required + * // KeyCheckValueAlgorithm: "STRING_VALUE", // required + * // Enabled: true || false, // required + * // Exportable: true || false, // required + * // KeyState: "STRING_VALUE", // required + * // KeyOrigin: "STRING_VALUE", // required + * // CreateTimestamp: new Date("TIMESTAMP"), // required + * // UsageStartTimestamp: new Date("TIMESTAMP"), + * // UsageStopTimestamp: new Date("TIMESTAMP"), + * // DeletePendingTimestamp: new Date("TIMESTAMP"), + * // DeleteTimestamp: new Date("TIMESTAMP"), + * // }, + * // }; + * + * ``` + * + * @param ImportKeyCommandInput - {@link ImportKeyCommandInput} + * @returns {@link ImportKeyCommandOutput} + * @see {@link ImportKeyCommandInput} for command's `input` shape. + * @see {@link ImportKeyCommandOutput} for command's `response` shape. + * @see {@link PaymentCryptographyClientResolvedConfig | config} for PaymentCryptographyClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

This request can cause an inconsistent state for the resource.

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

The request processing has failed because of an unknown error, exception, or failure.

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

The request was denied due to an invalid resource error.

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

This request would cause a service quota to be exceeded.

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

The service cannot complete the request.

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

The request was denied due to request throttling.

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

The request was denied due to an invalid request error.

+ * + * @throws {@link PaymentCryptographyServiceException} + *

Base exception class for all service exceptions from PaymentCryptography service.

+ * + */ +export class ImportKeyCommand extends $Command< + ImportKeyCommandInput, + ImportKeyCommandOutput, + PaymentCryptographyClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: ImportKeyCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: PaymentCryptographyClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, ImportKeyCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "PaymentCryptographyClient"; + const commandName = "ImportKeyCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: ImportKeyInputFilterSensitiveLog, + outputFilterSensitiveLog: (_: any) => _, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: ImportKeyCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_ImportKeyCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_ImportKeyCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-payment-cryptography/src/commands/ListAliasesCommand.ts b/clients/client-payment-cryptography/src/commands/ListAliasesCommand.ts new file mode 100644 index 000000000000..b16feceff47e --- /dev/null +++ b/clients/client-payment-cryptography/src/commands/ListAliasesCommand.ts @@ -0,0 +1,198 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { SerdeContext as __SerdeContext } from "@smithy/types"; + +import { ListAliasesInput, ListAliasesOutput } from "../models/models_0"; +import { + PaymentCryptographyClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../PaymentCryptographyClient"; +import { de_ListAliasesCommand, se_ListAliasesCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListAliasesCommand}. + */ +export interface ListAliasesCommandInput extends ListAliasesInput {} +/** + * @public + * + * The output of {@link ListAliasesCommand}. + */ +export interface ListAliasesCommandOutput extends ListAliasesOutput, __MetadataBearer {} + +/** + * @public + *

Lists the aliases for all keys in the caller's Amazon Web Services account and Amazon Web Services Region. You can filter the list of aliases. For more information, see Using aliases in the Amazon Web Services Payment Cryptography User Guide.

+ *

This is a paginated operation, which means that each response might contain only a subset of all the aliases. When the response contains only a subset of aliases, it includes a NextToken value. + * Use this value in a subsequent ListAliases request to get more aliases. When you receive a response with no NextToken (or an empty or null value), that means there are no more aliases to get.

+ *

+ * Cross-account use: This operation can't be used across different Amazon Web Services accounts.

+ *

+ * Related operations: + *

+ * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { PaymentCryptographyClient, ListAliasesCommand } from "@aws-sdk/client-payment-cryptography"; // ES Modules import + * // const { PaymentCryptographyClient, ListAliasesCommand } = require("@aws-sdk/client-payment-cryptography"); // CommonJS import + * const client = new PaymentCryptographyClient(config); + * const input = { // ListAliasesInput + * NextToken: "STRING_VALUE", + * MaxResults: Number("int"), + * }; + * const command = new ListAliasesCommand(input); + * const response = await client.send(command); + * // { // ListAliasesOutput + * // Aliases: [ // Aliases // required + * // { // Alias + * // AliasName: "STRING_VALUE", // required + * // KeyArn: "STRING_VALUE", + * // }, + * // ], + * // NextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListAliasesCommandInput - {@link ListAliasesCommandInput} + * @returns {@link ListAliasesCommandOutput} + * @see {@link ListAliasesCommandInput} for command's `input` shape. + * @see {@link ListAliasesCommandOutput} for command's `response` shape. + * @see {@link PaymentCryptographyClientResolvedConfig | config} for PaymentCryptographyClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

The request processing has failed because of an unknown error, exception, or failure.

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

The request was denied due to an invalid resource error.

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

The service cannot complete the request.

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

The request was denied due to request throttling.

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

The request was denied due to an invalid request error.

+ * + * @throws {@link PaymentCryptographyServiceException} + *

Base exception class for all service exceptions from PaymentCryptography service.

+ * + */ +export class ListAliasesCommand extends $Command< + ListAliasesCommandInput, + ListAliasesCommandOutput, + PaymentCryptographyClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: ListAliasesCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: PaymentCryptographyClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, ListAliasesCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "PaymentCryptographyClient"; + const commandName = "ListAliasesCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: ListAliasesCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_ListAliasesCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_ListAliasesCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-payment-cryptography/src/commands/ListKeysCommand.ts b/clients/client-payment-cryptography/src/commands/ListKeysCommand.ts new file mode 100644 index 000000000000..6937e2f6951b --- /dev/null +++ b/clients/client-payment-cryptography/src/commands/ListKeysCommand.ts @@ -0,0 +1,214 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { SerdeContext as __SerdeContext } from "@smithy/types"; + +import { ListKeysInput, ListKeysOutput } from "../models/models_0"; +import { + PaymentCryptographyClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../PaymentCryptographyClient"; +import { de_ListKeysCommand, se_ListKeysCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListKeysCommand}. + */ +export interface ListKeysCommandInput extends ListKeysInput {} +/** + * @public + * + * The output of {@link ListKeysCommand}. + */ +export interface ListKeysCommandOutput extends ListKeysOutput, __MetadataBearer {} + +/** + * @public + *

Lists the keys in the caller's Amazon Web Services account and Amazon Web Services Region. You can filter the list of keys.

+ *

This is a paginated operation, which means that each response might contain only a subset of all the keys. + * When the response contains only a subset of keys, it includes a NextToken value. Use this value in a subsequent ListKeys request to get more keys. + * When you receive a response with no NextToken (or an empty or null value), that means there are no more keys to get.

+ *

+ * Cross-account use: This operation can't be used across different Amazon Web Services accounts.

+ *

+ * Related operations: + *

+ * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { PaymentCryptographyClient, ListKeysCommand } from "@aws-sdk/client-payment-cryptography"; // ES Modules import + * // const { PaymentCryptographyClient, ListKeysCommand } = require("@aws-sdk/client-payment-cryptography"); // CommonJS import + * const client = new PaymentCryptographyClient(config); + * const input = { // ListKeysInput + * KeyState: "STRING_VALUE", + * NextToken: "STRING_VALUE", + * MaxResults: Number("int"), + * }; + * const command = new ListKeysCommand(input); + * const response = await client.send(command); + * // { // ListKeysOutput + * // Keys: [ // KeySummaryList // required + * // { // KeySummary + * // KeyArn: "STRING_VALUE", // required + * // KeyState: "STRING_VALUE", // required + * // KeyAttributes: { // KeyAttributes + * // KeyUsage: "STRING_VALUE", // required + * // KeyClass: "STRING_VALUE", // required + * // KeyAlgorithm: "STRING_VALUE", // required + * // KeyModesOfUse: { // KeyModesOfUse + * // Encrypt: true || false, + * // Decrypt: true || false, + * // Wrap: true || false, + * // Unwrap: true || false, + * // Generate: true || false, + * // Sign: true || false, + * // Verify: true || false, + * // DeriveKey: true || false, + * // NoRestrictions: true || false, + * // }, + * // }, + * // KeyCheckValue: "STRING_VALUE", // required + * // Exportable: true || false, // required + * // Enabled: true || false, // required + * // }, + * // ], + * // NextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListKeysCommandInput - {@link ListKeysCommandInput} + * @returns {@link ListKeysCommandOutput} + * @see {@link ListKeysCommandInput} for command's `input` shape. + * @see {@link ListKeysCommandOutput} for command's `response` shape. + * @see {@link PaymentCryptographyClientResolvedConfig | config} for PaymentCryptographyClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

The request processing has failed because of an unknown error, exception, or failure.

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

The request was denied due to an invalid resource error.

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

The service cannot complete the request.

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

The request was denied due to request throttling.

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

The request was denied due to an invalid request error.

+ * + * @throws {@link PaymentCryptographyServiceException} + *

Base exception class for all service exceptions from PaymentCryptography service.

+ * + */ +export class ListKeysCommand extends $Command< + ListKeysCommandInput, + ListKeysCommandOutput, + PaymentCryptographyClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: ListKeysCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: PaymentCryptographyClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, ListKeysCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "PaymentCryptographyClient"; + const commandName = "ListKeysCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: ListKeysCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_ListKeysCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_ListKeysCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-payment-cryptography/src/commands/ListTagsForResourceCommand.ts b/clients/client-payment-cryptography/src/commands/ListTagsForResourceCommand.ts new file mode 100644 index 000000000000..f73c0f34d4e8 --- /dev/null +++ b/clients/client-payment-cryptography/src/commands/ListTagsForResourceCommand.ts @@ -0,0 +1,192 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { SerdeContext as __SerdeContext } from "@smithy/types"; + +import { ListTagsForResourceInput, ListTagsForResourceOutput } from "../models/models_0"; +import { + PaymentCryptographyClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../PaymentCryptographyClient"; +import { de_ListTagsForResourceCommand, se_ListTagsForResourceCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListTagsForResourceCommand}. + */ +export interface ListTagsForResourceCommandInput extends ListTagsForResourceInput {} +/** + * @public + * + * The output of {@link ListTagsForResourceCommand}. + */ +export interface ListTagsForResourceCommandOutput extends ListTagsForResourceOutput, __MetadataBearer {} + +/** + * @public + *

Lists the tags for an Amazon Web Services resource.

+ *

This is a paginated operation, which means that each response might contain only a subset of all the tags. + * When the response contains only a subset of tags, it includes a NextToken value. Use this value in a subsequent ListTagsForResource request to get more tags. + * When you receive a response with no NextToken (or an empty or null value), that means there are no more tags to get.

+ *

+ * Cross-account use: This operation can't be used across different Amazon Web Services accounts.

+ *

+ * Related operations: + *

+ * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { PaymentCryptographyClient, ListTagsForResourceCommand } from "@aws-sdk/client-payment-cryptography"; // ES Modules import + * // const { PaymentCryptographyClient, ListTagsForResourceCommand } = require("@aws-sdk/client-payment-cryptography"); // CommonJS import + * const client = new PaymentCryptographyClient(config); + * const input = { // ListTagsForResourceInput + * ResourceArn: "STRING_VALUE", // required + * NextToken: "STRING_VALUE", + * MaxResults: Number("int"), + * }; + * const command = new ListTagsForResourceCommand(input); + * const response = await client.send(command); + * // { // ListTagsForResourceOutput + * // Tags: [ // Tags // required + * // { // Tag + * // Key: "STRING_VALUE", // required + * // Value: "STRING_VALUE", + * // }, + * // ], + * // NextToken: "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 PaymentCryptographyClientResolvedConfig | config} for PaymentCryptographyClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

The request processing has failed because of an unknown error, exception, or failure.

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

The request was denied due to an invalid resource error.

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

The service cannot complete the request.

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

The request was denied due to request throttling.

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

The request was denied due to an invalid request error.

+ * + * @throws {@link PaymentCryptographyServiceException} + *

Base exception class for all service exceptions from PaymentCryptography service.

+ * + */ +export class ListTagsForResourceCommand extends $Command< + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, + PaymentCryptographyClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: ListTagsForResourceCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: PaymentCryptographyClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, ListTagsForResourceCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "PaymentCryptographyClient"; + const commandName = "ListTagsForResourceCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: ListTagsForResourceCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_ListTagsForResourceCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_ListTagsForResourceCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-payment-cryptography/src/commands/RestoreKeyCommand.ts b/clients/client-payment-cryptography/src/commands/RestoreKeyCommand.ts new file mode 100644 index 000000000000..5dc7a2ba85c8 --- /dev/null +++ b/clients/client-payment-cryptography/src/commands/RestoreKeyCommand.ts @@ -0,0 +1,221 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { SerdeContext as __SerdeContext } from "@smithy/types"; + +import { RestoreKeyInput, RestoreKeyOutput } from "../models/models_0"; +import { + PaymentCryptographyClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../PaymentCryptographyClient"; +import { de_RestoreKeyCommand, se_RestoreKeyCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link RestoreKeyCommand}. + */ +export interface RestoreKeyCommandInput extends RestoreKeyInput {} +/** + * @public + * + * The output of {@link RestoreKeyCommand}. + */ +export interface RestoreKeyCommandOutput extends RestoreKeyOutput, __MetadataBearer {} + +/** + * @public + *

Cancels a scheduled key deletion during the waiting period. Use this operation to restore a Key that is scheduled for deletion.

+ *

During the waiting period, the KeyState is DELETE_PENDING and deletePendingTimestamp contains the date and time after which the Key will be deleted. + * After Key is restored, the KeyState is CREATE_COMPLETE, and the value for deletePendingTimestamp is removed.

+ *

+ * Cross-account use: This operation can't be used across different Amazon Web Services accounts.

+ *

+ * Related operations: + *

+ * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { PaymentCryptographyClient, RestoreKeyCommand } from "@aws-sdk/client-payment-cryptography"; // ES Modules import + * // const { PaymentCryptographyClient, RestoreKeyCommand } = require("@aws-sdk/client-payment-cryptography"); // CommonJS import + * const client = new PaymentCryptographyClient(config); + * const input = { // RestoreKeyInput + * KeyIdentifier: "STRING_VALUE", // required + * }; + * const command = new RestoreKeyCommand(input); + * const response = await client.send(command); + * // { // RestoreKeyOutput + * // Key: { // Key + * // KeyArn: "STRING_VALUE", // required + * // KeyAttributes: { // KeyAttributes + * // KeyUsage: "STRING_VALUE", // required + * // KeyClass: "STRING_VALUE", // required + * // KeyAlgorithm: "STRING_VALUE", // required + * // KeyModesOfUse: { // KeyModesOfUse + * // Encrypt: true || false, + * // Decrypt: true || false, + * // Wrap: true || false, + * // Unwrap: true || false, + * // Generate: true || false, + * // Sign: true || false, + * // Verify: true || false, + * // DeriveKey: true || false, + * // NoRestrictions: true || false, + * // }, + * // }, + * // KeyCheckValue: "STRING_VALUE", // required + * // KeyCheckValueAlgorithm: "STRING_VALUE", // required + * // Enabled: true || false, // required + * // Exportable: true || false, // required + * // KeyState: "STRING_VALUE", // required + * // KeyOrigin: "STRING_VALUE", // required + * // CreateTimestamp: new Date("TIMESTAMP"), // required + * // UsageStartTimestamp: new Date("TIMESTAMP"), + * // UsageStopTimestamp: new Date("TIMESTAMP"), + * // DeletePendingTimestamp: new Date("TIMESTAMP"), + * // DeleteTimestamp: new Date("TIMESTAMP"), + * // }, + * // }; + * + * ``` + * + * @param RestoreKeyCommandInput - {@link RestoreKeyCommandInput} + * @returns {@link RestoreKeyCommandOutput} + * @see {@link RestoreKeyCommandInput} for command's `input` shape. + * @see {@link RestoreKeyCommandOutput} for command's `response` shape. + * @see {@link PaymentCryptographyClientResolvedConfig | config} for PaymentCryptographyClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

This request can cause an inconsistent state for the resource.

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

The request processing has failed because of an unknown error, exception, or failure.

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

The request was denied due to an invalid resource error.

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

This request would cause a service quota to be exceeded.

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

The service cannot complete the request.

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

The request was denied due to request throttling.

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

The request was denied due to an invalid request error.

+ * + * @throws {@link PaymentCryptographyServiceException} + *

Base exception class for all service exceptions from PaymentCryptography service.

+ * + */ +export class RestoreKeyCommand extends $Command< + RestoreKeyCommandInput, + RestoreKeyCommandOutput, + PaymentCryptographyClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: RestoreKeyCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: PaymentCryptographyClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, RestoreKeyCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "PaymentCryptographyClient"; + const commandName = "RestoreKeyCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: RestoreKeyCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_RestoreKeyCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_RestoreKeyCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-payment-cryptography/src/commands/StartKeyUsageCommand.ts b/clients/client-payment-cryptography/src/commands/StartKeyUsageCommand.ts new file mode 100644 index 000000000000..437c90d7f643 --- /dev/null +++ b/clients/client-payment-cryptography/src/commands/StartKeyUsageCommand.ts @@ -0,0 +1,209 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { SerdeContext as __SerdeContext } from "@smithy/types"; + +import { StartKeyUsageInput, StartKeyUsageOutput } from "../models/models_0"; +import { + PaymentCryptographyClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../PaymentCryptographyClient"; +import { de_StartKeyUsageCommand, se_StartKeyUsageCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link StartKeyUsageCommand}. + */ +export interface StartKeyUsageCommandInput extends StartKeyUsageInput {} +/** + * @public + * + * The output of {@link StartKeyUsageCommand}. + */ +export interface StartKeyUsageCommandOutput extends StartKeyUsageOutput, __MetadataBearer {} + +/** + * @public + *

Enables an Amazon Web Services Payment Cryptography key, which makes it active for cryptographic operations within Amazon Web Services Payment Cryptography

+ *

+ * Cross-account use: This operation can't be used across different Amazon Web Services accounts.

+ *

+ * Related operations: + *

+ * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { PaymentCryptographyClient, StartKeyUsageCommand } from "@aws-sdk/client-payment-cryptography"; // ES Modules import + * // const { PaymentCryptographyClient, StartKeyUsageCommand } = require("@aws-sdk/client-payment-cryptography"); // CommonJS import + * const client = new PaymentCryptographyClient(config); + * const input = { // StartKeyUsageInput + * KeyIdentifier: "STRING_VALUE", // required + * }; + * const command = new StartKeyUsageCommand(input); + * const response = await client.send(command); + * // { // StartKeyUsageOutput + * // Key: { // Key + * // KeyArn: "STRING_VALUE", // required + * // KeyAttributes: { // KeyAttributes + * // KeyUsage: "STRING_VALUE", // required + * // KeyClass: "STRING_VALUE", // required + * // KeyAlgorithm: "STRING_VALUE", // required + * // KeyModesOfUse: { // KeyModesOfUse + * // Encrypt: true || false, + * // Decrypt: true || false, + * // Wrap: true || false, + * // Unwrap: true || false, + * // Generate: true || false, + * // Sign: true || false, + * // Verify: true || false, + * // DeriveKey: true || false, + * // NoRestrictions: true || false, + * // }, + * // }, + * // KeyCheckValue: "STRING_VALUE", // required + * // KeyCheckValueAlgorithm: "STRING_VALUE", // required + * // Enabled: true || false, // required + * // Exportable: true || false, // required + * // KeyState: "STRING_VALUE", // required + * // KeyOrigin: "STRING_VALUE", // required + * // CreateTimestamp: new Date("TIMESTAMP"), // required + * // UsageStartTimestamp: new Date("TIMESTAMP"), + * // UsageStopTimestamp: new Date("TIMESTAMP"), + * // DeletePendingTimestamp: new Date("TIMESTAMP"), + * // DeleteTimestamp: new Date("TIMESTAMP"), + * // }, + * // }; + * + * ``` + * + * @param StartKeyUsageCommandInput - {@link StartKeyUsageCommandInput} + * @returns {@link StartKeyUsageCommandOutput} + * @see {@link StartKeyUsageCommandInput} for command's `input` shape. + * @see {@link StartKeyUsageCommandOutput} for command's `response` shape. + * @see {@link PaymentCryptographyClientResolvedConfig | config} for PaymentCryptographyClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

This request can cause an inconsistent state for the resource.

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

The request processing has failed because of an unknown error, exception, or failure.

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

The request was denied due to an invalid resource error.

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

This request would cause a service quota to be exceeded.

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

The service cannot complete the request.

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

The request was denied due to request throttling.

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

The request was denied due to an invalid request error.

+ * + * @throws {@link PaymentCryptographyServiceException} + *

Base exception class for all service exceptions from PaymentCryptography service.

+ * + */ +export class StartKeyUsageCommand extends $Command< + StartKeyUsageCommandInput, + StartKeyUsageCommandOutput, + PaymentCryptographyClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: StartKeyUsageCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: PaymentCryptographyClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, StartKeyUsageCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "PaymentCryptographyClient"; + const commandName = "StartKeyUsageCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: StartKeyUsageCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_StartKeyUsageCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_StartKeyUsageCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-payment-cryptography/src/commands/StopKeyUsageCommand.ts b/clients/client-payment-cryptography/src/commands/StopKeyUsageCommand.ts new file mode 100644 index 000000000000..cad90135f597 --- /dev/null +++ b/clients/client-payment-cryptography/src/commands/StopKeyUsageCommand.ts @@ -0,0 +1,215 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { SerdeContext as __SerdeContext } from "@smithy/types"; + +import { StopKeyUsageInput, StopKeyUsageOutput } from "../models/models_0"; +import { + PaymentCryptographyClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../PaymentCryptographyClient"; +import { de_StopKeyUsageCommand, se_StopKeyUsageCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link StopKeyUsageCommand}. + */ +export interface StopKeyUsageCommandInput extends StopKeyUsageInput {} +/** + * @public + * + * The output of {@link StopKeyUsageCommand}. + */ +export interface StopKeyUsageCommandOutput extends StopKeyUsageOutput, __MetadataBearer {} + +/** + * @public + *

Disables an Amazon Web Services Payment Cryptography key, which makes it inactive within Amazon Web Services Payment Cryptography.

+ *

You can use this operation instead of DeleteKey to deactivate a key. You can enable the key in the future by calling StartKeyUsage.

+ *

+ * Cross-account use: This operation can't be used across different Amazon Web Services accounts.

+ *

+ * Related operations: + *

+ * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { PaymentCryptographyClient, StopKeyUsageCommand } from "@aws-sdk/client-payment-cryptography"; // ES Modules import + * // const { PaymentCryptographyClient, StopKeyUsageCommand } = require("@aws-sdk/client-payment-cryptography"); // CommonJS import + * const client = new PaymentCryptographyClient(config); + * const input = { // StopKeyUsageInput + * KeyIdentifier: "STRING_VALUE", // required + * }; + * const command = new StopKeyUsageCommand(input); + * const response = await client.send(command); + * // { // StopKeyUsageOutput + * // Key: { // Key + * // KeyArn: "STRING_VALUE", // required + * // KeyAttributes: { // KeyAttributes + * // KeyUsage: "STRING_VALUE", // required + * // KeyClass: "STRING_VALUE", // required + * // KeyAlgorithm: "STRING_VALUE", // required + * // KeyModesOfUse: { // KeyModesOfUse + * // Encrypt: true || false, + * // Decrypt: true || false, + * // Wrap: true || false, + * // Unwrap: true || false, + * // Generate: true || false, + * // Sign: true || false, + * // Verify: true || false, + * // DeriveKey: true || false, + * // NoRestrictions: true || false, + * // }, + * // }, + * // KeyCheckValue: "STRING_VALUE", // required + * // KeyCheckValueAlgorithm: "STRING_VALUE", // required + * // Enabled: true || false, // required + * // Exportable: true || false, // required + * // KeyState: "STRING_VALUE", // required + * // KeyOrigin: "STRING_VALUE", // required + * // CreateTimestamp: new Date("TIMESTAMP"), // required + * // UsageStartTimestamp: new Date("TIMESTAMP"), + * // UsageStopTimestamp: new Date("TIMESTAMP"), + * // DeletePendingTimestamp: new Date("TIMESTAMP"), + * // DeleteTimestamp: new Date("TIMESTAMP"), + * // }, + * // }; + * + * ``` + * + * @param StopKeyUsageCommandInput - {@link StopKeyUsageCommandInput} + * @returns {@link StopKeyUsageCommandOutput} + * @see {@link StopKeyUsageCommandInput} for command's `input` shape. + * @see {@link StopKeyUsageCommandOutput} for command's `response` shape. + * @see {@link PaymentCryptographyClientResolvedConfig | config} for PaymentCryptographyClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

This request can cause an inconsistent state for the resource.

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

The request processing has failed because of an unknown error, exception, or failure.

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

The request was denied due to an invalid resource error.

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

This request would cause a service quota to be exceeded.

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

The service cannot complete the request.

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

The request was denied due to request throttling.

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

The request was denied due to an invalid request error.

+ * + * @throws {@link PaymentCryptographyServiceException} + *

Base exception class for all service exceptions from PaymentCryptography service.

+ * + */ +export class StopKeyUsageCommand extends $Command< + StopKeyUsageCommandInput, + StopKeyUsageCommandOutput, + PaymentCryptographyClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: StopKeyUsageCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: PaymentCryptographyClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, StopKeyUsageCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "PaymentCryptographyClient"; + const commandName = "StopKeyUsageCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: StopKeyUsageCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_StopKeyUsageCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_StopKeyUsageCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-payment-cryptography/src/commands/TagResourceCommand.ts b/clients/client-payment-cryptography/src/commands/TagResourceCommand.ts new file mode 100644 index 000000000000..fe0048b54d46 --- /dev/null +++ b/clients/client-payment-cryptography/src/commands/TagResourceCommand.ts @@ -0,0 +1,193 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { SerdeContext as __SerdeContext } from "@smithy/types"; + +import { TagResourceInput, TagResourceOutput } from "../models/models_0"; +import { + PaymentCryptographyClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../PaymentCryptographyClient"; +import { de_TagResourceCommand, se_TagResourceCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link TagResourceCommand}. + */ +export interface TagResourceCommandInput extends TagResourceInput {} +/** + * @public + * + * The output of {@link TagResourceCommand}. + */ +export interface TagResourceCommandOutput extends TagResourceOutput, __MetadataBearer {} + +/** + * @public + *

Adds or edits tags on an Amazon Web Services Payment Cryptography key.

+ * + *

Tagging or untagging an Amazon Web Services Payment Cryptography key can allow or deny permission to the key.

+ *
+ *

Each tag consists of a tag key and a tag value, both of which are case-sensitive strings. The tag value can be an empty (null) string. To add a tag, specify a new tag key and a tag value. To edit a tag, specify an existing tag key and a new tag value. You can also add tags to an Amazon Web Services Payment Cryptography key when you create it with CreateKey.

+ *

+ * Cross-account use: This operation can't be used across different Amazon Web Services accounts.

+ *

+ * Related operations: + *

+ * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { PaymentCryptographyClient, TagResourceCommand } from "@aws-sdk/client-payment-cryptography"; // ES Modules import + * // const { PaymentCryptographyClient, TagResourceCommand } = require("@aws-sdk/client-payment-cryptography"); // CommonJS import + * const client = new PaymentCryptographyClient(config); + * const input = { // TagResourceInput + * ResourceArn: "STRING_VALUE", // required + * Tags: [ // Tags // required + * { // Tag + * Key: "STRING_VALUE", // required + * Value: "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 PaymentCryptographyClientResolvedConfig | config} for PaymentCryptographyClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

This request can cause an inconsistent state for the resource.

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

The request processing has failed because of an unknown error, exception, or failure.

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

The request was denied due to an invalid resource error.

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

This request would cause a service quota to be exceeded.

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

The service cannot complete the request.

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

The request was denied due to request throttling.

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

The request was denied due to an invalid request error.

+ * + * @throws {@link PaymentCryptographyServiceException} + *

Base exception class for all service exceptions from PaymentCryptography service.

+ * + */ +export class TagResourceCommand extends $Command< + TagResourceCommandInput, + TagResourceCommandOutput, + PaymentCryptographyClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: TagResourceCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: PaymentCryptographyClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, TagResourceCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "PaymentCryptographyClient"; + const commandName = "TagResourceCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: TagResourceCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_TagResourceCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_TagResourceCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-payment-cryptography/src/commands/UntagResourceCommand.ts b/clients/client-payment-cryptography/src/commands/UntagResourceCommand.ts new file mode 100644 index 000000000000..b68031800a30 --- /dev/null +++ b/clients/client-payment-cryptography/src/commands/UntagResourceCommand.ts @@ -0,0 +1,186 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { SerdeContext as __SerdeContext } from "@smithy/types"; + +import { UntagResourceInput, UntagResourceOutput } from "../models/models_0"; +import { + PaymentCryptographyClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../PaymentCryptographyClient"; +import { de_UntagResourceCommand, se_UntagResourceCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link UntagResourceCommand}. + */ +export interface UntagResourceCommandInput extends UntagResourceInput {} +/** + * @public + * + * The output of {@link UntagResourceCommand}. + */ +export interface UntagResourceCommandOutput extends UntagResourceOutput, __MetadataBearer {} + +/** + * @public + *

Deletes a tag from an Amazon Web Services Payment Cryptography key.

+ * + *

Tagging or untagging an Amazon Web Services Payment Cryptography key can allow or deny permission to the key.

+ *
+ *

+ * Cross-account use: This operation can't be used across different Amazon Web Services accounts.

+ *

+ * Related operations: + *

+ * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { PaymentCryptographyClient, UntagResourceCommand } from "@aws-sdk/client-payment-cryptography"; // ES Modules import + * // const { PaymentCryptographyClient, UntagResourceCommand } = require("@aws-sdk/client-payment-cryptography"); // CommonJS import + * const client = new PaymentCryptographyClient(config); + * const input = { // UntagResourceInput + * ResourceArn: "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 PaymentCryptographyClientResolvedConfig | config} for PaymentCryptographyClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

This request can cause an inconsistent state for the resource.

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

The request processing has failed because of an unknown error, exception, or failure.

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

The request was denied due to an invalid resource error.

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

The service cannot complete the request.

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

The request was denied due to request throttling.

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

The request was denied due to an invalid request error.

+ * + * @throws {@link PaymentCryptographyServiceException} + *

Base exception class for all service exceptions from PaymentCryptography service.

+ * + */ +export class UntagResourceCommand extends $Command< + UntagResourceCommandInput, + UntagResourceCommandOutput, + PaymentCryptographyClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: UntagResourceCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: PaymentCryptographyClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, UntagResourceCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "PaymentCryptographyClient"; + const commandName = "UntagResourceCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: UntagResourceCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_UntagResourceCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_UntagResourceCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-payment-cryptography/src/commands/UpdateAliasCommand.ts b/clients/client-payment-cryptography/src/commands/UpdateAliasCommand.ts new file mode 100644 index 000000000000..5a28f51c061b --- /dev/null +++ b/clients/client-payment-cryptography/src/commands/UpdateAliasCommand.ts @@ -0,0 +1,196 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { SerdeContext as __SerdeContext } from "@smithy/types"; + +import { UpdateAliasInput, UpdateAliasOutput } from "../models/models_0"; +import { + PaymentCryptographyClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../PaymentCryptographyClient"; +import { de_UpdateAliasCommand, se_UpdateAliasCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link UpdateAliasCommand}. + */ +export interface UpdateAliasCommandInput extends UpdateAliasInput {} +/** + * @public + * + * The output of {@link UpdateAliasCommand}. + */ +export interface UpdateAliasCommandOutput extends UpdateAliasOutput, __MetadataBearer {} + +/** + * @public + *

Associates an existing Amazon Web Services Payment Cryptography alias with a different key. Each alias is associated with only one Amazon Web Services Payment Cryptography key at a time, although a key can have multiple aliases. The alias and the Amazon Web Services Payment Cryptography key must be in the same Amazon Web Services account and Amazon Web Services Region

+ *

+ * Cross-account use: This operation can't be used across different Amazon Web Services accounts.

+ *

+ * Related operations: + *

+ * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { PaymentCryptographyClient, UpdateAliasCommand } from "@aws-sdk/client-payment-cryptography"; // ES Modules import + * // const { PaymentCryptographyClient, UpdateAliasCommand } = require("@aws-sdk/client-payment-cryptography"); // CommonJS import + * const client = new PaymentCryptographyClient(config); + * const input = { // UpdateAliasInput + * AliasName: "STRING_VALUE", // required + * KeyArn: "STRING_VALUE", + * }; + * const command = new UpdateAliasCommand(input); + * const response = await client.send(command); + * // { // UpdateAliasOutput + * // Alias: { // Alias + * // AliasName: "STRING_VALUE", // required + * // KeyArn: "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param UpdateAliasCommandInput - {@link UpdateAliasCommandInput} + * @returns {@link UpdateAliasCommandOutput} + * @see {@link UpdateAliasCommandInput} for command's `input` shape. + * @see {@link UpdateAliasCommandOutput} for command's `response` shape. + * @see {@link PaymentCryptographyClientResolvedConfig | config} for PaymentCryptographyClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

This request can cause an inconsistent state for the resource.

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

The request processing has failed because of an unknown error, exception, or failure.

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

The request was denied due to an invalid resource error.

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

The service cannot complete the request.

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

The request was denied due to request throttling.

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

The request was denied due to an invalid request error.

+ * + * @throws {@link PaymentCryptographyServiceException} + *

Base exception class for all service exceptions from PaymentCryptography service.

+ * + */ +export class UpdateAliasCommand extends $Command< + UpdateAliasCommandInput, + UpdateAliasCommandOutput, + PaymentCryptographyClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: UpdateAliasCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: PaymentCryptographyClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, UpdateAliasCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "PaymentCryptographyClient"; + const commandName = "UpdateAliasCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: UpdateAliasCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_UpdateAliasCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_UpdateAliasCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-payment-cryptography/src/commands/index.ts b/clients/client-payment-cryptography/src/commands/index.ts new file mode 100644 index 000000000000..976a7d0ce1d1 --- /dev/null +++ b/clients/client-payment-cryptography/src/commands/index.ts @@ -0,0 +1,21 @@ +// smithy-typescript generated code +export * from "./CreateAliasCommand"; +export * from "./CreateKeyCommand"; +export * from "./DeleteAliasCommand"; +export * from "./DeleteKeyCommand"; +export * from "./ExportKeyCommand"; +export * from "./GetAliasCommand"; +export * from "./GetKeyCommand"; +export * from "./GetParametersForExportCommand"; +export * from "./GetParametersForImportCommand"; +export * from "./GetPublicKeyCertificateCommand"; +export * from "./ImportKeyCommand"; +export * from "./ListAliasesCommand"; +export * from "./ListKeysCommand"; +export * from "./ListTagsForResourceCommand"; +export * from "./RestoreKeyCommand"; +export * from "./StartKeyUsageCommand"; +export * from "./StopKeyUsageCommand"; +export * from "./TagResourceCommand"; +export * from "./UntagResourceCommand"; +export * from "./UpdateAliasCommand"; diff --git a/clients/client-payment-cryptography/src/endpoint/EndpointParameters.ts b/clients/client-payment-cryptography/src/endpoint/EndpointParameters.ts new file mode 100644 index 000000000000..f6682de9e94f --- /dev/null +++ b/clients/client-payment-cryptography/src/endpoint/EndpointParameters.ts @@ -0,0 +1,32 @@ +// smithy-typescript generated code +import { EndpointParameters as __EndpointParameters, EndpointV2 } from "@aws-sdk/types"; +import { Endpoint, Provider } from "@smithy/types"; + +export interface ClientInputEndpointParameters { + region?: string | Provider; + useDualstackEndpoint?: boolean | Provider; + useFipsEndpoint?: boolean | Provider; + endpoint?: string | Provider | Endpoint | Provider | EndpointV2 | Provider; +} + +export type ClientResolvedEndpointParameters = ClientInputEndpointParameters & { + defaultSigningName: string; +}; + +export const resolveClientEndpointParameters = ( + options: T & ClientInputEndpointParameters +): T & ClientResolvedEndpointParameters => { + return { + ...options, + useDualstackEndpoint: options.useDualstackEndpoint ?? false, + useFipsEndpoint: options.useFipsEndpoint ?? false, + defaultSigningName: "payment-cryptography", + }; +}; + +export interface EndpointParameters extends __EndpointParameters { + Region?: string; + UseDualStack?: boolean; + UseFIPS?: boolean; + Endpoint?: string; +} diff --git a/clients/client-payment-cryptography/src/endpoint/endpointResolver.ts b/clients/client-payment-cryptography/src/endpoint/endpointResolver.ts new file mode 100644 index 000000000000..4a70bb06b40a --- /dev/null +++ b/clients/client-payment-cryptography/src/endpoint/endpointResolver.ts @@ -0,0 +1,16 @@ +// smithy-typescript generated code +import { EndpointV2, Logger } from "@aws-sdk/types"; +import { EndpointParams, resolveEndpoint } from "@aws-sdk/util-endpoints"; + +import { EndpointParameters } from "./EndpointParameters"; +import { ruleSet } from "./ruleset"; + +export const defaultEndpointResolver = ( + endpointParams: EndpointParameters, + context: { logger?: Logger } = {} +): EndpointV2 => { + return resolveEndpoint(ruleSet, { + endpointParams: endpointParams as EndpointParams, + logger: context.logger, + }); +}; diff --git a/clients/client-payment-cryptography/src/endpoint/ruleset.ts b/clients/client-payment-cryptography/src/endpoint/ruleset.ts new file mode 100644 index 000000000000..d40b34395e4f --- /dev/null +++ b/clients/client-payment-cryptography/src/endpoint/ruleset.ts @@ -0,0 +1,30 @@ +// @ts-nocheck +// generated code, do not edit +import { RuleSetObject } from "@aws-sdk/util-endpoints"; + +/* This file is compressed. Log this object + or see "smithy.rules#endpointRuleSet" + in codegen/sdk-codegen/aws-models/payment-cryptography.json */ + +const q="required", +r="fn", +s="argv", +t="ref"; +const a="isSet", +b="tree", +c="error", +d="endpoint", +e="PartitionResult", +f={[q]:false,"type":"String"}, +g={[q]:true,"default":false,"type":"Boolean"}, +h={[t]:"Endpoint"}, +i={[r]:"booleanEquals",[s]:[{[t]:"UseFIPS"},true]}, +j={[r]:"booleanEquals",[s]:[{[t]:"UseDualStack"},true]}, +k={}, +l={[r]:"booleanEquals",[s]:[true,{[r]:"getAttr",[s]:[{[t]:e},"supportsFIPS"]}]}, +m={[r]:"booleanEquals",[s]:[true,{[r]:"getAttr",[s]:[{[t]:e},"supportsDualStack"]}]}, +n=[i], +o=[j], +p=[{[t]:"Region"}]; +const _data={version:"1.0",parameters:{Region:f,UseDualStack:g,UseFIPS:g,Endpoint:f},rules:[{conditions:[{[r]:a,[s]:[h]}],type:b,rules:[{conditions:n,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{type:b,rules:[{conditions:o,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:h,properties:k,headers:k},type:d}]}]},{type:b,rules:[{conditions:[{[r]:a,[s]:p}],type:b,rules:[{conditions:[{[r]:"aws.partition",[s]:p,assign:e}],type:b,rules:[{conditions:[i,j],type:b,rules:[{conditions:[l,m],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://controlplane.payment-cryptography-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:n,type:b,rules:[{conditions:[l],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://controlplane.payment-cryptography-fips.{Region}.{PartitionResult#dnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:o,type:b,rules:[{conditions:[m],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://controlplane.payment-cryptography.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{type:b,rules:[{endpoint:{url:"https://controlplane.payment-cryptography.{Region}.{PartitionResult#dnsSuffix}",properties:k,headers:k},type:d}]}]}]},{error:"Invalid Configuration: Missing Region",type:c}]}]}; +export const ruleSet: RuleSetObject = _data; diff --git a/clients/client-payment-cryptography/src/index.ts b/clients/client-payment-cryptography/src/index.ts new file mode 100644 index 000000000000..bd3c5f6e324f --- /dev/null +++ b/clients/client-payment-cryptography/src/index.ts @@ -0,0 +1,18 @@ +// smithy-typescript generated code +/* eslint-disable */ +/** + *

You use the Amazon Web Services Payment Cryptography Control Plane to manage the encryption keys you use for payment-related cryptographic operations. You can create, import, export, share, manage, and delete keys. You can also manage Identity and Access Management (IAM) policies for keys. For more information, see Identity and access management in the Amazon Web Services Payment Cryptography User Guide. + *

+ *

To use encryption keys for payment-related transaction processing and associated cryptographic operations, you use the Amazon Web Services Payment Cryptography Data Plane. You can encrypt, decrypt, generate, verify, and translate payment-related cryptographic operations.

+ *

All Amazon Web Services Payment Cryptography API calls must be signed and transmitted using Transport Layer Security (TLS). We recommend you always use the latest supported TLS version for logging API requests.

+ *

Amazon Web Services Payment Cryptography supports CloudTrail, a service that logs Amazon Web Services API calls and related events for your Amazon Web Services account and delivers them to an Amazon S3 bucket that you specify. By using the information collected by CloudTrail, you can determine what requests were made to Amazon Web Services Payment Cryptography, who made the request, when it was made, and so on. If you don't configure a trail, you can still view the most recent events in the CloudTrail console. For more information, see the CloudTrail User Guide.

+ * + * @packageDocumentation + */ +export * from "./PaymentCryptographyClient"; +export * from "./PaymentCryptography"; +export * from "./commands"; +export * from "./pagination"; +export * from "./models"; + +export { PaymentCryptographyServiceException } from "./models/PaymentCryptographyServiceException"; diff --git a/clients/client-payment-cryptography/src/models/PaymentCryptographyServiceException.ts b/clients/client-payment-cryptography/src/models/PaymentCryptographyServiceException.ts new file mode 100644 index 000000000000..ecf8f1c3efa3 --- /dev/null +++ b/clients/client-payment-cryptography/src/models/PaymentCryptographyServiceException.ts @@ -0,0 +1,22 @@ +// smithy-typescript generated code +import { + ServiceException as __ServiceException, + ServiceExceptionOptions as __ServiceExceptionOptions, +} from "@aws-sdk/smithy-client"; + +export { __ServiceException, __ServiceExceptionOptions }; + +/** + * @public + * + * Base exception class for all service exceptions from PaymentCryptography service. + */ +export class PaymentCryptographyServiceException extends __ServiceException { + /** + * @internal + */ + constructor(options: __ServiceExceptionOptions) { + super(options); + Object.setPrototypeOf(this, PaymentCryptographyServiceException.prototype); + } +} diff --git a/clients/client-payment-cryptography/src/models/index.ts b/clients/client-payment-cryptography/src/models/index.ts new file mode 100644 index 000000000000..9eaceb12865f --- /dev/null +++ b/clients/client-payment-cryptography/src/models/index.ts @@ -0,0 +1,2 @@ +// smithy-typescript generated code +export * from "./models_0"; diff --git a/clients/client-payment-cryptography/src/models/models_0.ts b/clients/client-payment-cryptography/src/models/models_0.ts new file mode 100644 index 000000000000..0d9539425e95 --- /dev/null +++ b/clients/client-payment-cryptography/src/models/models_0.ts @@ -0,0 +1,1538 @@ +// smithy-typescript generated code +import { ExceptionOptionType as __ExceptionOptionType, SENSITIVE_STRING } from "@aws-sdk/smithy-client"; + +import { PaymentCryptographyServiceException as __BaseException } from "./PaymentCryptographyServiceException"; + +/** + * @public + *

You do not have sufficient access to perform this action.

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

Contains information about an alias.

+ */ +export interface Alias { + /** + *

A friendly name that you can use to refer to a key. The value must begin with alias/.

+ * + *

Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.

+ *
+ */ + AliasName: string | undefined; + + /** + *

The KeyARN of the key associated with the alias.

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

This request can cause an inconsistent state for the resource.

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

A friendly name that you can use to refer a key. An alias must begin with alias/ followed by a name, for example alias/ExampleAlias. It can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-).

+ * + *

Don't include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.

+ *
+ */ + AliasName: string | undefined; + + /** + *

The KeyARN of the key to associate with the alias.

+ */ + KeyArn?: string; +} + +/** + * @public + */ +export interface CreateAliasOutput { + /** + *

The alias for the key.

+ */ + Alias: Alias | undefined; +} + +/** + * @public + *

The request processing has failed because of an unknown error, exception, or failure.

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

The request was denied due to an invalid resource error.

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

The string for the exception.

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

This request would cause a service quota to be exceeded.

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

The service cannot complete the request.

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

The request was denied due to request throttling.

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

The request was denied due to an invalid request error.

+ */ +export class ValidationException extends __BaseException { + readonly name: "ValidationException" = "ValidationException"; + readonly $fault: "client" = "client"; + Message?: string; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ValidationException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ValidationException.prototype); + this.Message = opts.Message; + } +} + +/** + * @public + * @enum + */ +export const KeyAlgorithm = { + AES_128: "AES_128", + AES_192: "AES_192", + AES_256: "AES_256", + RSA_2048: "RSA_2048", + RSA_3072: "RSA_3072", + RSA_4096: "RSA_4096", + TDES_2KEY: "TDES_2KEY", + TDES_3KEY: "TDES_3KEY", +} as const; + +/** + * @public + */ +export type KeyAlgorithm = (typeof KeyAlgorithm)[keyof typeof KeyAlgorithm]; + +/** + * @public + * @enum + */ +export const KeyClass = { + ASYMMETRIC_KEY_PAIR: "ASYMMETRIC_KEY_PAIR", + PRIVATE_KEY: "PRIVATE_KEY", + PUBLIC_KEY: "PUBLIC_KEY", + SYMMETRIC_KEY: "SYMMETRIC_KEY", +} as const; + +/** + * @public + */ +export type KeyClass = (typeof KeyClass)[keyof typeof KeyClass]; + +/** + * @public + *

The list of cryptographic operations that you can perform using the key. The modes of use are defined in section A.5.3 of the TR-31 spec.

+ */ +export interface KeyModesOfUse { + /** + *

Specifies whether an Amazon Web Services Payment Cryptography key can be used to encrypt data.

+ */ + Encrypt?: boolean; + + /** + *

Specifies whether an Amazon Web Services Payment Cryptography key can be used to decrypt data.

+ */ + Decrypt?: boolean; + + /** + *

Specifies whether an Amazon Web Services Payment Cryptography key can be used to wrap other keys.

+ */ + Wrap?: boolean; + + /** + *

Specifies whether an Amazon Web Services Payment Cryptography key can be used to unwrap other keys.

+ */ + Unwrap?: boolean; + + /** + *

Specifies whether an Amazon Web Services Payment Cryptography key can be used to generate and verify other card and PIN verification keys.

+ */ + Generate?: boolean; + + /** + *

Specifies whether an Amazon Web Services Payment Cryptography key can be used for signing.

+ */ + Sign?: boolean; + + /** + *

Specifies whether an Amazon Web Services Payment Cryptography key can be used to verify signatures.

+ */ + Verify?: boolean; + + /** + *

Specifies whether an Amazon Web Services Payment Cryptography key can be used to derive new keys.

+ */ + DeriveKey?: boolean; + + /** + *

Specifies whether an Amazon Web Services Payment Cryptography key has no special restrictions other than the restrictions implied by KeyUsage.

+ */ + NoRestrictions?: boolean; +} + +/** + * @public + * @enum + */ +export const KeyUsage = { + TR31_B0_BASE_DERIVATION_KEY: "TR31_B0_BASE_DERIVATION_KEY", + TR31_C0_CARD_VERIFICATION_KEY: "TR31_C0_CARD_VERIFICATION_KEY", + TR31_D0_SYMMETRIC_DATA_ENCRYPTION_KEY: "TR31_D0_SYMMETRIC_DATA_ENCRYPTION_KEY", + TR31_D1_ASYMMETRIC_KEY_FOR_DATA_ENCRYPTION: "TR31_D1_ASYMMETRIC_KEY_FOR_DATA_ENCRYPTION", + TR31_E0_EMV_MKEY_APP_CRYPTOGRAMS: "TR31_E0_EMV_MKEY_APP_CRYPTOGRAMS", + TR31_E1_EMV_MKEY_CONFIDENTIALITY: "TR31_E1_EMV_MKEY_CONFIDENTIALITY", + TR31_E2_EMV_MKEY_INTEGRITY: "TR31_E2_EMV_MKEY_INTEGRITY", + TR31_E4_EMV_MKEY_DYNAMIC_NUMBERS: "TR31_E4_EMV_MKEY_DYNAMIC_NUMBERS", + TR31_E5_EMV_MKEY_CARD_PERSONALIZATION: "TR31_E5_EMV_MKEY_CARD_PERSONALIZATION", + TR31_E6_EMV_MKEY_OTHER: "TR31_E6_EMV_MKEY_OTHER", + TR31_K0_KEY_ENCRYPTION_KEY: "TR31_K0_KEY_ENCRYPTION_KEY", + TR31_K1_KEY_BLOCK_PROTECTION_KEY: "TR31_K1_KEY_BLOCK_PROTECTION_KEY", + TR31_K2_TR34_ASYMMETRIC_KEY: "TR31_K2_TR34_ASYMMETRIC_KEY", + TR31_K3_ASYMMETRIC_KEY_FOR_KEY_AGREEMENT: "TR31_K3_ASYMMETRIC_KEY_FOR_KEY_AGREEMENT", + TR31_M3_ISO_9797_3_MAC_KEY: "TR31_M3_ISO_9797_3_MAC_KEY", + TR31_M6_ISO_9797_5_CMAC_KEY: "TR31_M6_ISO_9797_5_CMAC_KEY", + TR31_M7_HMAC_KEY: "TR31_M7_HMAC_KEY", + TR31_P0_PIN_ENCRYPTION_KEY: "TR31_P0_PIN_ENCRYPTION_KEY", + TR31_P1_PIN_GENERATION_KEY: "TR31_P1_PIN_GENERATION_KEY", + TR31_S0_ASYMMETRIC_KEY_FOR_DIGITAL_SIGNATURE: "TR31_S0_ASYMMETRIC_KEY_FOR_DIGITAL_SIGNATURE", + TR31_V1_IBM3624_PIN_VERIFICATION_KEY: "TR31_V1_IBM3624_PIN_VERIFICATION_KEY", + TR31_V2_VISA_PIN_VERIFICATION_KEY: "TR31_V2_VISA_PIN_VERIFICATION_KEY", +} as const; + +/** + * @public + */ +export type KeyUsage = (typeof KeyUsage)[keyof typeof KeyUsage]; + +/** + * @public + *

The role of the key, the algorithm it supports, and the cryptographic operations allowed with the key. This data is immutable after the key is created.

+ */ +export interface KeyAttributes { + /** + *

The cryptographic usage of an Amazon Web Services Payment Cryptography key as defined in section A.5.2 of the TR-31 spec.

+ */ + KeyUsage: KeyUsage | string | undefined; + + /** + *

The type of Amazon Web Services Payment Cryptography key to create, which determines the classification of the cryptographic method and whether Amazon Web Services Payment Cryptography key contains a symmetric key or an asymmetric key pair.

+ */ + KeyClass: KeyClass | string | undefined; + + /** + *

The key algorithm to be use during creation of an Amazon Web Services Payment Cryptography key.

+ *

For symmetric keys, Amazon Web Services Payment Cryptography supports AES and TDES algorithms. For asymmetric keys, Amazon Web Services Payment Cryptography supports RSA and ECC_NIST algorithms.

+ */ + KeyAlgorithm: KeyAlgorithm | string | undefined; + + /** + *

The list of cryptographic operations that you can perform using the key.

+ */ + KeyModesOfUse: KeyModesOfUse | undefined; +} + +/** + * @public + * @enum + */ +export const KeyCheckValueAlgorithm = { + ANSI_X9_24: "ANSI_X9_24", + CMAC: "CMAC", +} as const; + +/** + * @public + */ +export type KeyCheckValueAlgorithm = (typeof KeyCheckValueAlgorithm)[keyof typeof KeyCheckValueAlgorithm]; + +/** + * @public + *

A structure that contains information about a tag.

+ */ +export interface Tag { + /** + *

The key of the tag.

+ */ + Key: string | undefined; + + /** + *

The value of the tag.

+ */ + Value?: string; +} + +/** + * @public + */ +export interface CreateKeyInput { + /** + *

The role of the key, the algorithm it supports, and the cryptographic operations allowed with the key. This data is immutable after the key is created.

+ */ + KeyAttributes: KeyAttributes | undefined; + + /** + *

The algorithm that Amazon Web Services Payment Cryptography uses to calculate the key check value (KCV) for DES and AES keys.

+ *

For DES key, the KCV is computed by encrypting 8 bytes, each with value '00', with the key to be checked and retaining the 3 highest order bytes of the encrypted result. For AES key, the KCV is computed by encrypting 8 bytes, each with value '01', with the key to be checked and retaining the 3 highest order bytes of the encrypted result.

+ */ + KeyCheckValueAlgorithm?: KeyCheckValueAlgorithm | string; + + /** + *

Specifies whether the key is exportable from the service.

+ */ + Exportable: boolean | undefined; + + /** + *

Specifies whether to enable the key. If the key is enabled, it is activated for use within the service. If the key not enabled, then it is created but not activated. The default value is enabled.

+ */ + Enabled?: boolean; + + /** + *

The tags to attach to the key. Each tag consists of a tag key and a tag value. Both the tag key and the tag value are required, but the tag value can be an empty (null) string. You can't have more than one tag on an Amazon Web Services Payment Cryptography key with the same tag key.

+ *

To use this parameter, you must have TagResource permission.

+ * + *

Don't include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.

+ *
+ * + *

Tagging or untagging an Amazon Web Services Payment Cryptography key can allow or deny permission to the key.

+ *
+ */ + Tags?: Tag[]; +} + +/** + * @public + * @enum + */ +export const KeyOrigin = { + AWS_PAYMENT_CRYPTOGRAPHY: "AWS_PAYMENT_CRYPTOGRAPHY", + EXTERNAL: "EXTERNAL", +} as const; + +/** + * @public + */ +export type KeyOrigin = (typeof KeyOrigin)[keyof typeof KeyOrigin]; + +/** + * @public + * @enum + */ +export const KeyState = { + CREATE_COMPLETE: "CREATE_COMPLETE", + CREATE_IN_PROGRESS: "CREATE_IN_PROGRESS", + DELETE_COMPLETE: "DELETE_COMPLETE", + DELETE_PENDING: "DELETE_PENDING", +} as const; + +/** + * @public + */ +export type KeyState = (typeof KeyState)[keyof typeof KeyState]; + +/** + * @public + *

Metadata about an Amazon Web Services Payment Cryptography key.

+ */ +export interface Key { + /** + *

The Amazon Resource Name (ARN) of the key.

+ */ + KeyArn: string | undefined; + + /** + *

The role of the key, the algorithm it supports, and the cryptographic operations allowed with the key. This data is immutable after the key is created.

+ */ + KeyAttributes: KeyAttributes | undefined; + + /** + *

The key check value (KCV) is used to check if all parties holding a given key have the same key or to detect that a key has changed. Amazon Web Services Payment Cryptography calculates the KCV by using standard algorithms, typically by encrypting 8 or 16 bytes or "00" or "01" and then truncating the result to the first 3 bytes, or 6 hex digits, of the resulting cryptogram.

+ */ + KeyCheckValue: string | undefined; + + /** + *

The algorithm used for calculating key check value (KCV) for DES and AES keys. For a DES key, Amazon Web Services Payment Cryptography computes the KCV by encrypting 8 bytes, each with value '00', with the key to be checked and retaining the 3 highest order bytes of the encrypted result. For an AES key, Amazon Web Services Payment Cryptography computes the KCV by encrypting 8 bytes, each with value '01', with the key to be checked and retaining the 3 highest order bytes of the encrypted result.

+ */ + KeyCheckValueAlgorithm: KeyCheckValueAlgorithm | string | undefined; + + /** + *

Specifies whether the key is enabled.

+ */ + Enabled: boolean | undefined; + + /** + *

Specifies whether the key is exportable. This data is immutable after the key is created.

+ */ + Exportable: boolean | undefined; + + /** + *

The state of key that is being created or deleted.

+ */ + KeyState: KeyState | string | undefined; + + /** + *

The source of the key material. For keys created within Amazon Web Services Payment Cryptography, the value is AWS_PAYMENT_CRYPTOGRAPHY. For keys imported into Amazon Web Services Payment Cryptography, the value is EXTERNAL.

+ */ + KeyOrigin: KeyOrigin | string | undefined; + + /** + *

The date and time when the key was created.

+ */ + CreateTimestamp: Date | undefined; + + /** + *

The date and time after which Amazon Web Services Payment Cryptography will start using the key material for cryptographic operations.

+ */ + UsageStartTimestamp?: Date; + + /** + *

The date and time after which Amazon Web Services Payment Cryptography will stop using the key material for cryptographic operations.

+ */ + UsageStopTimestamp?: Date; + + /** + *

The date and time after which Amazon Web Services Payment Cryptography will delete the key. This value is present only when KeyState is DELETE_PENDING and the key is scheduled for deletion.

+ */ + DeletePendingTimestamp?: Date; + + /** + *

The date and time after which Amazon Web Services Payment Cryptography will delete the key. This value is present only when when the KeyState is DELETE_COMPLETE and the Amazon Web Services Payment Cryptography key is deleted.

+ */ + DeleteTimestamp?: Date; +} + +/** + * @public + */ +export interface CreateKeyOutput { + /** + *

The key material that contains all the key attributes.

+ */ + Key: Key | undefined; +} + +/** + * @public + */ +export interface DeleteAliasInput { + /** + *

A friendly name that you can use to refer Amazon Web Services Payment Cryptography key. This value must begin with alias/ followed by a name, such as alias/ExampleAlias.

+ */ + AliasName: string | undefined; +} + +/** + * @public + */ +export interface DeleteAliasOutput {} + +/** + * @public + */ +export interface DeleteKeyInput { + /** + *

The KeyARN of the key that is scheduled for deletion.

+ */ + KeyIdentifier: string | undefined; + + /** + *

The waiting period for key deletion. The default value is seven days.

+ */ + DeleteKeyInDays?: number; +} + +/** + * @public + */ +export interface DeleteKeyOutput { + /** + *

The KeyARN of the key that is scheduled for deletion.

+ */ + Key: Key | undefined; +} + +/** + * @public + *

Parameter information for key material export using TR-31 standard.

+ */ +export interface ExportTr31KeyBlock { + /** + *

The KeyARN of the the wrapping key. This key encrypts or wraps the key under export for TR-31 key block generation.

+ */ + WrappingKeyIdentifier: string | undefined; +} + +/** + * @public + * @enum + */ +export const Tr34KeyBlockFormat = { + X9_TR34_2012: "X9_TR34_2012", +} as const; + +/** + * @public + */ +export type Tr34KeyBlockFormat = (typeof Tr34KeyBlockFormat)[keyof typeof Tr34KeyBlockFormat]; + +/** + * @public + *

Parameter information for key material export using TR-34 standard.

+ */ +export interface ExportTr34KeyBlock { + /** + *

The KeyARN of the certificate chain that signs the wrapping key certificate during TR-34 key export.

+ */ + CertificateAuthorityPublicKeyIdentifier: string | undefined; + + /** + *

The KeyARN of the wrapping key certificate. Amazon Web Services Payment Cryptography uses this certificate to wrap the key under export.

+ */ + WrappingKeyCertificate: string | undefined; + + /** + *

The export token to initiate key export from Amazon Web Services Payment Cryptography. It also contains the signing key certificate that will sign the wrapped key during TR-34 key block generation. Call GetParametersForExport to receive an export token. It expires after 7 days. You can use the same export token to export multiple keys from the same service account.

+ */ + ExportToken: string | undefined; + + /** + *

The format of key block that Amazon Web Services Payment Cryptography will use during key export.

+ */ + KeyBlockFormat: Tr34KeyBlockFormat | string | undefined; + + /** + *

A random number value that is unique to the TR-34 key block generated using 2 pass. The operation will fail, if a random nonce value is not provided for a TR-34 key block generated using 2 pass.

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

Parameter information for key material export from Amazon Web Services Payment Cryptography.

+ */ +export type ExportKeyMaterial = + | ExportKeyMaterial.Tr31KeyBlockMember + | ExportKeyMaterial.Tr34KeyBlockMember + | ExportKeyMaterial.$UnknownMember; + +/** + * @public + */ +export namespace ExportKeyMaterial { + /** + *

Parameter information for key material export using TR-31 standard.

+ */ + export interface Tr31KeyBlockMember { + Tr31KeyBlock: ExportTr31KeyBlock; + Tr34KeyBlock?: never; + $unknown?: never; + } + + /** + *

Parameter information for key material export using TR-34 standard.

+ */ + export interface Tr34KeyBlockMember { + Tr31KeyBlock?: never; + Tr34KeyBlock: ExportTr34KeyBlock; + $unknown?: never; + } + + export interface $UnknownMember { + Tr31KeyBlock?: never; + Tr34KeyBlock?: never; + $unknown: [string, any]; + } + + export interface Visitor { + Tr31KeyBlock: (value: ExportTr31KeyBlock) => T; + Tr34KeyBlock: (value: ExportTr34KeyBlock) => T; + _: (name: string, value: any) => T; + } + + export const visit = (value: ExportKeyMaterial, visitor: Visitor): T => { + if (value.Tr31KeyBlock !== undefined) return visitor.Tr31KeyBlock(value.Tr31KeyBlock); + if (value.Tr34KeyBlock !== undefined) return visitor.Tr34KeyBlock(value.Tr34KeyBlock); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; +} + +/** + * @public + */ +export interface ExportKeyInput { + /** + *

The key block format type, for example, TR-34 or TR-31, to use during key material export.

+ */ + KeyMaterial: ExportKeyMaterial | undefined; + + /** + *

The KeyARN of the key under export from Amazon Web Services Payment Cryptography.

+ */ + ExportKeyIdentifier: string | undefined; +} + +/** + * @public + * @enum + */ +export const WrappedKeyMaterialFormat = { + KEY_CRYPTOGRAM: "KEY_CRYPTOGRAM", + TR31_KEY_BLOCK: "TR31_KEY_BLOCK", + TR34_KEY_BLOCK: "TR34_KEY_BLOCK", +} as const; + +/** + * @public + */ +export type WrappedKeyMaterialFormat = (typeof WrappedKeyMaterialFormat)[keyof typeof WrappedKeyMaterialFormat]; + +/** + * @public + *

Parameter information for generating a wrapped key using TR-31 or TR-34 standard.

+ */ +export interface WrappedKey { + /** + *

The KeyARN of the wrapped key.

+ */ + WrappingKeyArn: string | undefined; + + /** + *

The key block format of a wrapped key.

+ */ + WrappedKeyMaterialFormat: WrappedKeyMaterialFormat | string | undefined; + + /** + *

Parameter information for generating a wrapped key using TR-31 or TR-34 standard.

+ */ + KeyMaterial: string | undefined; +} + +/** + * @public + */ +export interface ExportKeyOutput { + /** + *

The key material under export as a TR-34 or TR-31 wrapped key block.

+ */ + WrappedKey?: WrappedKey; +} + +/** + * @public + */ +export interface GetAliasInput { + /** + *

The alias of the Amazon Web Services Payment Cryptography key.

+ */ + AliasName: string | undefined; +} + +/** + * @public + */ +export interface GetAliasOutput { + /** + *

The alias of the Amazon Web Services Payment Cryptography key.

+ */ + Alias: Alias | undefined; +} + +/** + * @public + */ +export interface GetKeyInput { + /** + *

The KeyARN of the Amazon Web Services Payment Cryptography key.

+ */ + KeyIdentifier: string | undefined; +} + +/** + * @public + */ +export interface GetKeyOutput { + /** + *

The key material, including the immutable and mutable data for the key.

+ */ + Key: Key | undefined; +} + +/** + * @public + * @enum + */ +export const KeyMaterialType = { + ROOT_PUBLIC_KEY_CERTIFICATE: "ROOT_PUBLIC_KEY_CERTIFICATE", + TR31_KEY_BLOCK: "TR31_KEY_BLOCK", + TR34_KEY_BLOCK: "TR34_KEY_BLOCK", + TRUSTED_PUBLIC_KEY_CERTIFICATE: "TRUSTED_PUBLIC_KEY_CERTIFICATE", +} as const; + +/** + * @public + */ +export type KeyMaterialType = (typeof KeyMaterialType)[keyof typeof KeyMaterialType]; + +/** + * @public + */ +export interface GetParametersForExportInput { + /** + *

The key block format type (for example, TR-34 or TR-31) to use during key material export. Export token is only required for a TR-34 key export, TR34_KEY_BLOCK. Export token is not required for TR-31 key export.

+ */ + KeyMaterialType: KeyMaterialType | string | undefined; + + /** + *

The signing key algorithm to generate a signing key certificate. This certificate signs the wrapped key under export within the TR-34 key block cryptogram. RSA_2048 is the only signing key algorithm allowed.

+ */ + SigningKeyAlgorithm: KeyAlgorithm | string | undefined; +} + +/** + * @public + */ +export interface GetParametersForExportOutput { + /** + *

The signing key certificate of the public key for signature within the TR-34 key block cryptogram. The certificate expires after 7 days.

+ */ + SigningKeyCertificate: string | undefined; + + /** + *

The certificate chain that signed the signing key certificate. This is the root certificate authority (CA) within your service account.

+ */ + SigningKeyCertificateChain: string | undefined; + + /** + *

The algorithm of the signing key certificate for use in TR-34 key block generation. RSA_2048 is the only signing key algorithm allowed.

+ */ + SigningKeyAlgorithm: KeyAlgorithm | string | undefined; + + /** + *

The export token to initiate key export from Amazon Web Services Payment Cryptography. The export token expires after 7 days. You can use the same export token to export multiple keys from the same service account.

+ */ + ExportToken: string | undefined; + + /** + *

The validity period of the export token.

+ */ + ParametersValidUntilTimestamp: Date | undefined; +} + +/** + * @public + */ +export interface GetParametersForImportInput { + /** + *

The key block format type such as TR-34 or TR-31 to use during key material import. Import token is only required for TR-34 key import TR34_KEY_BLOCK. Import token is not required for TR-31 key import.

+ */ + KeyMaterialType: KeyMaterialType | string | undefined; + + /** + *

The wrapping key algorithm to generate a wrapping key certificate. This certificate wraps the key under import within the TR-34 key block cryptogram. RSA_2048 is the only wrapping key algorithm allowed.

+ */ + WrappingKeyAlgorithm: KeyAlgorithm | string | undefined; +} + +/** + * @public + */ +export interface GetParametersForImportOutput { + /** + *

The wrapping key certificate of the wrapping key for use within the TR-34 key block. The certificate expires in 7 days.

+ */ + WrappingKeyCertificate: string | undefined; + + /** + *

The Amazon Web Services Payment Cryptography certificate chain that signed the wrapping key certificate. This is the root certificate authority (CA) within your service account.

+ */ + WrappingKeyCertificateChain: string | undefined; + + /** + *

The algorithm of the wrapping key for use within TR-34 key block. RSA_2048 is the only wrapping key algorithm allowed.

+ */ + WrappingKeyAlgorithm: KeyAlgorithm | string | undefined; + + /** + *

The import token to initiate key import into Amazon Web Services Payment Cryptography. The import token expires after 7 days. You can use the same import token to import multiple keys to the same service account.

+ */ + ImportToken: string | undefined; + + /** + *

The validity period of the import token.

+ */ + ParametersValidUntilTimestamp: Date | undefined; +} + +/** + * @public + */ +export interface GetPublicKeyCertificateInput { + /** + *

The KeyARN of the asymmetric key pair.

+ */ + KeyIdentifier: string | undefined; +} + +/** + * @public + */ +export interface GetPublicKeyCertificateOutput { + /** + *

The public key component of the asymmetric key pair in a certificate (PEM) format. It is signed by the root certificate authority (CA) within your service account. The certificate expires in 90 days.

+ */ + KeyCertificate: string | undefined; + + /** + *

The certificate chain that signed the public key certificate of the asymmetric key pair. This is the root certificate authority (CA) within your service account.

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

Parameter information for root public key certificate import.

+ */ +export interface RootCertificatePublicKey { + /** + *

The role of the key, the algorithm it supports, and the cryptographic operations allowed with the key. This data is immutable after the root public key is imported.

+ */ + KeyAttributes: KeyAttributes | undefined; + + /** + *

Parameter information for root public key certificate import.

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

Parameter information for key material import using TR-31 standard.

+ */ +export interface ImportTr31KeyBlock { + /** + *

The KeyARN of the key that will decrypt or unwrap a TR-31 key block during import.

+ */ + WrappingKeyIdentifier: string | undefined; + + /** + *

The TR-34 wrapped key block to import.

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

Parameter information for key material import using TR-34 standard.

+ */ +export interface ImportTr34KeyBlock { + /** + *

The KeyARN of the certificate chain that signs the signing key certificate during TR-34 key import.

+ */ + CertificateAuthorityPublicKeyIdentifier: string | undefined; + + /** + *

The public key component in PEM certificate format of the private key that signs the KDH TR-34 wrapped key block.

+ */ + SigningKeyCertificate: string | undefined; + + /** + *

The import token that initiates key import into Amazon Web Services Payment Cryptography. It expires after 7 days. You can use the same import token to import multiple keys to the same service account.

+ */ + ImportToken: string | undefined; + + /** + *

The TR-34 wrapped key block to import.

+ */ + WrappedKeyBlock: string | undefined; + + /** + *

The key block format to use during key import. The only value allowed is X9_TR34_2012.

+ */ + KeyBlockFormat: Tr34KeyBlockFormat | string | undefined; + + /** + *

A random number value that is unique to the TR-34 key block generated using 2 pass. The operation will fail, if a random nonce value is not provided for a TR-34 key block generated using 2 pass.

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

Parameter information for trusted public key certificate import.

+ */ +export interface TrustedCertificatePublicKey { + /** + *

The role of the key, the algorithm it supports, and the cryptographic operations allowed with the key. This data is immutable after a trusted public key is imported.

+ */ + KeyAttributes: KeyAttributes | undefined; + + /** + *

Parameter information for trusted public key certificate import.

+ */ + PublicKeyCertificate: string | undefined; + + /** + *

The KeyARN of the root public key certificate or certificate chain that signs the trusted public key certificate import.

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

Parameter information for key material import.

+ */ +export type ImportKeyMaterial = + | ImportKeyMaterial.RootCertificatePublicKeyMember + | ImportKeyMaterial.Tr31KeyBlockMember + | ImportKeyMaterial.Tr34KeyBlockMember + | ImportKeyMaterial.TrustedCertificatePublicKeyMember + | ImportKeyMaterial.$UnknownMember; + +/** + * @public + */ +export namespace ImportKeyMaterial { + /** + *

Parameter information for root public key certificate import.

+ */ + export interface RootCertificatePublicKeyMember { + RootCertificatePublicKey: RootCertificatePublicKey; + TrustedCertificatePublicKey?: never; + Tr31KeyBlock?: never; + Tr34KeyBlock?: never; + $unknown?: never; + } + + /** + *

Parameter information for trusted public key certificate import.

+ */ + export interface TrustedCertificatePublicKeyMember { + RootCertificatePublicKey?: never; + TrustedCertificatePublicKey: TrustedCertificatePublicKey; + Tr31KeyBlock?: never; + Tr34KeyBlock?: never; + $unknown?: never; + } + + /** + *

Parameter information for key material import using TR-31 standard.

+ */ + export interface Tr31KeyBlockMember { + RootCertificatePublicKey?: never; + TrustedCertificatePublicKey?: never; + Tr31KeyBlock: ImportTr31KeyBlock; + Tr34KeyBlock?: never; + $unknown?: never; + } + + /** + *

Parameter information for key material import using TR-34 standard.

+ */ + export interface Tr34KeyBlockMember { + RootCertificatePublicKey?: never; + TrustedCertificatePublicKey?: never; + Tr31KeyBlock?: never; + Tr34KeyBlock: ImportTr34KeyBlock; + $unknown?: never; + } + + export interface $UnknownMember { + RootCertificatePublicKey?: never; + TrustedCertificatePublicKey?: never; + Tr31KeyBlock?: never; + Tr34KeyBlock?: never; + $unknown: [string, any]; + } + + export interface Visitor { + RootCertificatePublicKey: (value: RootCertificatePublicKey) => T; + TrustedCertificatePublicKey: (value: TrustedCertificatePublicKey) => T; + Tr31KeyBlock: (value: ImportTr31KeyBlock) => T; + Tr34KeyBlock: (value: ImportTr34KeyBlock) => T; + _: (name: string, value: any) => T; + } + + export const visit = (value: ImportKeyMaterial, visitor: Visitor): T => { + if (value.RootCertificatePublicKey !== undefined) + return visitor.RootCertificatePublicKey(value.RootCertificatePublicKey); + if (value.TrustedCertificatePublicKey !== undefined) + return visitor.TrustedCertificatePublicKey(value.TrustedCertificatePublicKey); + if (value.Tr31KeyBlock !== undefined) return visitor.Tr31KeyBlock(value.Tr31KeyBlock); + if (value.Tr34KeyBlock !== undefined) return visitor.Tr34KeyBlock(value.Tr34KeyBlock); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; +} + +/** + * @public + */ +export interface ImportKeyInput { + /** + *

The key or public key certificate type to use during key material import, for example TR-34 or RootCertificatePublicKey.

+ */ + KeyMaterial: ImportKeyMaterial | undefined; + + /** + *

The algorithm that Amazon Web Services Payment Cryptography uses to calculate the key check value (KCV) for DES and AES keys.

+ *

For DES key, the KCV is computed by encrypting 8 bytes, each with value '00', with the key to be checked and retaining the 3 highest order bytes of the encrypted result. For AES key, the KCV is computed by encrypting 8 bytes, each with value '01', with the key to be checked and retaining the 3 highest order bytes of the encrypted result.

+ */ + KeyCheckValueAlgorithm?: KeyCheckValueAlgorithm | string; + + /** + *

Specifies whether import key is enabled.

+ */ + Enabled?: boolean; + + /** + *

The tags to attach to the key. Each tag consists of a tag key and a tag value. Both the tag key and the tag value are required, but the tag value can be an empty (null) string. You can't have more than one tag on an Amazon Web Services Payment Cryptography key with the same tag key.

+ *

You can't have more than one tag on an Amazon Web Services Payment Cryptography key with the same tag key. If you specify an existing tag key with a different tag value, Amazon Web Services Payment Cryptography replaces the current tag value with the specified one.

+ *

To use this parameter, you must have TagResource permission.

+ * + *

Don't include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.

+ *
+ * + *

Tagging or untagging an Amazon Web Services Payment Cryptography key can allow or deny permission to the key.

+ *
+ */ + Tags?: Tag[]; +} + +/** + * @public + */ +export interface ImportKeyOutput { + /** + *

The KeyARN of the key material imported within Amazon Web Services Payment Cryptography.

+ */ + Key: Key | undefined; +} + +/** + * @public + *

Metadata about an Amazon Web Services Payment Cryptography key.

+ */ +export interface KeySummary { + /** + *

The Amazon Resource Name (ARN) of the key.

+ */ + KeyArn: string | undefined; + + /** + *

The state of an Amazon Web Services Payment Cryptography that is being created or deleted.

+ */ + KeyState: KeyState | string | undefined; + + /** + *

The role of the key, the algorithm it supports, and the cryptographic operations allowed with the key. This data is immutable after the key is created.

+ */ + KeyAttributes: KeyAttributes | undefined; + + /** + *

The key check value (KCV) is used to check if all parties holding a given key have the same key or to detect that a key has changed. Amazon Web Services Payment Cryptography calculates the KCV by using standard algorithms, typically by encrypting 8 or 16 bytes or "00" or "01" and then truncating the result to the first 3 bytes, or 6 hex digits, of the resulting cryptogram.

+ */ + KeyCheckValue: string | undefined; + + /** + *

Specifies whether the key is exportable. This data is immutable after the key is created.

+ */ + Exportable: boolean | undefined; + + /** + *

Specifies whether the key is enabled.

+ */ + Enabled: boolean | undefined; +} + +/** + * @public + */ +export interface ListAliasesInput { + /** + *

Use this parameter in a subsequent request after you receive a response with truncated results. Set it to the value of NextToken from the truncated response you just received.

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

Use this parameter to specify the maximum number of items to return. When this value is present, Amazon Web Services Payment Cryptography does not return more than the specified number of items, but it might return fewer.

+ *

This value is optional. If you include a value, it must be between 1 and 100, inclusive. If you do not include a value, it defaults to 50.

+ */ + MaxResults?: number; +} + +/** + * @public + */ +export interface ListAliasesOutput { + /** + *

The list of aliases. Each alias describes the KeyArn contained within.

+ */ + Aliases: Alias[] | undefined; + + /** + *

The token for the next set of results, or an empty or null value if there are no more results.

+ */ + NextToken?: string; +} + +/** + * @public + */ +export interface ListKeysInput { + /** + *

The key state of the keys you want to list.

+ */ + KeyState?: KeyState | string; + + /** + *

Use this parameter in a subsequent request after you receive a response with truncated results. Set it to the value of NextToken from the truncated response you just received.

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

Use this parameter to specify the maximum number of items to return. When this value is present, Amazon Web Services Payment Cryptography does not return more than the specified number of items, but it might return fewer.

+ */ + MaxResults?: number; +} + +/** + * @public + */ +export interface ListKeysOutput { + /** + *

The list of keys created within the caller's Amazon Web Services account and Amazon Web Services Region.

+ */ + Keys: KeySummary[] | undefined; + + /** + *

The token for the next set of results, or an empty or null value if there are no more results.

+ */ + NextToken?: string; +} + +/** + * @public + */ +export interface ListTagsForResourceInput { + /** + *

The KeyARN of the key whose tags you are getting.

+ */ + ResourceArn: string | undefined; + + /** + *

Use this parameter in a subsequent request after you receive a response with truncated results. Set it to the value of NextToken from the truncated response you just received.

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

Use this parameter to specify the maximum number of items to return. When this value is present, Amazon Web Services Payment Cryptography does not return more than the specified number of items, but it might return fewer.

+ */ + MaxResults?: number; +} + +/** + * @public + */ +export interface ListTagsForResourceOutput { + /** + *

The list of tags associated with a ResourceArn. Each tag will list the key-value pair contained within that tag.

+ */ + Tags: Tag[] | undefined; + + /** + *

The token for the next set of results, or an empty or null value if there are no more results.

+ */ + NextToken?: string; +} + +/** + * @public + */ +export interface RestoreKeyInput { + /** + *

The KeyARN of the key to be restored within Amazon Web Services Payment Cryptography.

+ */ + KeyIdentifier: string | undefined; +} + +/** + * @public + */ +export interface RestoreKeyOutput { + /** + *

The key material of the restored key. The KeyState will change to CREATE_COMPLETE and value for DeletePendingTimestamp gets removed.

+ */ + Key: Key | undefined; +} + +/** + * @public + */ +export interface StartKeyUsageInput { + /** + *

The KeyArn of the key.

+ */ + KeyIdentifier: string | undefined; +} + +/** + * @public + */ +export interface StartKeyUsageOutput { + /** + *

The KeyARN of the Amazon Web Services Payment Cryptography key activated for use.

+ */ + Key: Key | undefined; +} + +/** + * @public + */ +export interface StopKeyUsageInput { + /** + *

The KeyArn of the key.

+ */ + KeyIdentifier: string | undefined; +} + +/** + * @public + */ +export interface StopKeyUsageOutput { + /** + *

The KeyARN of the key.

+ */ + Key: Key | undefined; +} + +/** + * @public + */ +export interface TagResourceInput { + /** + *

The KeyARN of the key whose tags are being updated.

+ */ + ResourceArn: string | undefined; + + /** + *

One or more tags. Each tag consists of a tag key and a tag value. The tag value can be an empty (null) string. You can't have more than one tag on an Amazon Web Services Payment Cryptography key with the same tag key. If you specify an existing tag key with a different tag value, Amazon Web Services Payment Cryptography replaces the current tag value with the new one.

+ * + *

Don't include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.

+ *
+ *

To use this parameter, you must have TagResource permission in an IAM policy.

+ * + *

Don't include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.

+ *
+ */ + Tags: Tag[] | undefined; +} + +/** + * @public + */ +export interface TagResourceOutput {} + +/** + * @public + */ +export interface UntagResourceInput { + /** + *

The KeyARN of the key whose tags are being removed.

+ */ + ResourceArn: string | undefined; + + /** + *

One or more tag keys. Don't include the tag values.

+ *

If the Amazon Web Services Payment Cryptography key doesn't have the specified tag key, Amazon Web Services Payment Cryptography doesn't throw an exception or return a response. To confirm that the operation succeeded, use the ListTagsForResource operation.

+ */ + TagKeys: string[] | undefined; +} + +/** + * @public + */ +export interface UntagResourceOutput {} + +/** + * @public + */ +export interface UpdateAliasInput { + /** + *

The alias whose associated key is changing.

+ */ + AliasName: string | undefined; + + /** + *

The KeyARN for the key that you are updating or removing from the alias.

+ */ + KeyArn?: string; +} + +/** + * @public + */ +export interface UpdateAliasOutput { + /** + *

The alias name.

+ */ + Alias: Alias | undefined; +} + +/** + * @internal + */ +export const ExportTr34KeyBlockFilterSensitiveLog = (obj: ExportTr34KeyBlock): any => ({ + ...obj, + ...(obj.WrappingKeyCertificate && { WrappingKeyCertificate: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const ExportKeyMaterialFilterSensitiveLog = (obj: ExportKeyMaterial): any => { + if (obj.Tr31KeyBlock !== undefined) return { Tr31KeyBlock: obj.Tr31KeyBlock }; + if (obj.Tr34KeyBlock !== undefined) return { Tr34KeyBlock: ExportTr34KeyBlockFilterSensitiveLog(obj.Tr34KeyBlock) }; + if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" }; +}; + +/** + * @internal + */ +export const ExportKeyInputFilterSensitiveLog = (obj: ExportKeyInput): any => ({ + ...obj, + ...(obj.KeyMaterial && { KeyMaterial: ExportKeyMaterialFilterSensitiveLog(obj.KeyMaterial) }), +}); + +/** + * @internal + */ +export const WrappedKeyFilterSensitiveLog = (obj: WrappedKey): any => ({ + ...obj, + ...(obj.KeyMaterial && { KeyMaterial: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const ExportKeyOutputFilterSensitiveLog = (obj: ExportKeyOutput): any => ({ + ...obj, + ...(obj.WrappedKey && { WrappedKey: WrappedKeyFilterSensitiveLog(obj.WrappedKey) }), +}); + +/** + * @internal + */ +export const GetParametersForExportOutputFilterSensitiveLog = (obj: GetParametersForExportOutput): any => ({ + ...obj, + ...(obj.SigningKeyCertificate && { SigningKeyCertificate: SENSITIVE_STRING }), + ...(obj.SigningKeyCertificateChain && { SigningKeyCertificateChain: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const GetParametersForImportOutputFilterSensitiveLog = (obj: GetParametersForImportOutput): any => ({ + ...obj, + ...(obj.WrappingKeyCertificate && { WrappingKeyCertificate: SENSITIVE_STRING }), + ...(obj.WrappingKeyCertificateChain && { WrappingKeyCertificateChain: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const GetPublicKeyCertificateOutputFilterSensitiveLog = (obj: GetPublicKeyCertificateOutput): any => ({ + ...obj, + ...(obj.KeyCertificate && { KeyCertificate: SENSITIVE_STRING }), + ...(obj.KeyCertificateChain && { KeyCertificateChain: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const RootCertificatePublicKeyFilterSensitiveLog = (obj: RootCertificatePublicKey): any => ({ + ...obj, + ...(obj.PublicKeyCertificate && { PublicKeyCertificate: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const ImportTr34KeyBlockFilterSensitiveLog = (obj: ImportTr34KeyBlock): any => ({ + ...obj, + ...(obj.SigningKeyCertificate && { SigningKeyCertificate: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const TrustedCertificatePublicKeyFilterSensitiveLog = (obj: TrustedCertificatePublicKey): any => ({ + ...obj, + ...(obj.PublicKeyCertificate && { PublicKeyCertificate: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const ImportKeyMaterialFilterSensitiveLog = (obj: ImportKeyMaterial): any => { + if (obj.RootCertificatePublicKey !== undefined) + return { RootCertificatePublicKey: RootCertificatePublicKeyFilterSensitiveLog(obj.RootCertificatePublicKey) }; + if (obj.TrustedCertificatePublicKey !== undefined) + return { + TrustedCertificatePublicKey: TrustedCertificatePublicKeyFilterSensitiveLog(obj.TrustedCertificatePublicKey), + }; + if (obj.Tr31KeyBlock !== undefined) return { Tr31KeyBlock: obj.Tr31KeyBlock }; + if (obj.Tr34KeyBlock !== undefined) return { Tr34KeyBlock: ImportTr34KeyBlockFilterSensitiveLog(obj.Tr34KeyBlock) }; + if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" }; +}; + +/** + * @internal + */ +export const ImportKeyInputFilterSensitiveLog = (obj: ImportKeyInput): any => ({ + ...obj, + ...(obj.KeyMaterial && { KeyMaterial: ImportKeyMaterialFilterSensitiveLog(obj.KeyMaterial) }), +}); diff --git a/clients/client-payment-cryptography/src/pagination/Interfaces.ts b/clients/client-payment-cryptography/src/pagination/Interfaces.ts new file mode 100644 index 000000000000..2f981c3905b3 --- /dev/null +++ b/clients/client-payment-cryptography/src/pagination/Interfaces.ts @@ -0,0 +1,11 @@ +// smithy-typescript generated code +import { PaginationConfiguration } from "@aws-sdk/types"; + +import { PaymentCryptographyClient } from "../PaymentCryptographyClient"; + +/** + * @public + */ +export interface PaymentCryptographyPaginationConfiguration extends PaginationConfiguration { + client: PaymentCryptographyClient; +} diff --git a/clients/client-payment-cryptography/src/pagination/ListAliasesPaginator.ts b/clients/client-payment-cryptography/src/pagination/ListAliasesPaginator.ts new file mode 100644 index 000000000000..724450b806b9 --- /dev/null +++ b/clients/client-payment-cryptography/src/pagination/ListAliasesPaginator.ts @@ -0,0 +1,46 @@ +// smithy-typescript generated code +import { Paginator } from "@aws-sdk/types"; + +import { ListAliasesCommand, ListAliasesCommandInput, ListAliasesCommandOutput } from "../commands/ListAliasesCommand"; +import { PaymentCryptographyClient } from "../PaymentCryptographyClient"; +import { PaymentCryptographyPaginationConfiguration } from "./Interfaces"; + +/** + * @internal + */ +const makePagedClientRequest = async ( + client: PaymentCryptographyClient, + input: ListAliasesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAliasesCommand(input), ...args); +}; +/** + * @public + */ +export async function* paginateListAliases( + config: PaymentCryptographyPaginationConfiguration, + input: ListAliasesCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.NextToken + let token: typeof input.NextToken | undefined = config.startingToken || undefined; + let hasNext = true; + let page: ListAliasesCommandOutput; + while (hasNext) { + input.NextToken = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof PaymentCryptographyClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected PaymentCryptography | PaymentCryptographyClient"); + } + yield page; + const prevToken = token; + token = page.NextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-payment-cryptography/src/pagination/ListKeysPaginator.ts b/clients/client-payment-cryptography/src/pagination/ListKeysPaginator.ts new file mode 100644 index 000000000000..77572600e68d --- /dev/null +++ b/clients/client-payment-cryptography/src/pagination/ListKeysPaginator.ts @@ -0,0 +1,46 @@ +// smithy-typescript generated code +import { Paginator } from "@aws-sdk/types"; + +import { ListKeysCommand, ListKeysCommandInput, ListKeysCommandOutput } from "../commands/ListKeysCommand"; +import { PaymentCryptographyClient } from "../PaymentCryptographyClient"; +import { PaymentCryptographyPaginationConfiguration } from "./Interfaces"; + +/** + * @internal + */ +const makePagedClientRequest = async ( + client: PaymentCryptographyClient, + input: ListKeysCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListKeysCommand(input), ...args); +}; +/** + * @public + */ +export async function* paginateListKeys( + config: PaymentCryptographyPaginationConfiguration, + input: ListKeysCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.NextToken + let token: typeof input.NextToken | undefined = config.startingToken || undefined; + let hasNext = true; + let page: ListKeysCommandOutput; + while (hasNext) { + input.NextToken = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof PaymentCryptographyClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected PaymentCryptography | PaymentCryptographyClient"); + } + yield page; + const prevToken = token; + token = page.NextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-payment-cryptography/src/pagination/ListTagsForResourcePaginator.ts b/clients/client-payment-cryptography/src/pagination/ListTagsForResourcePaginator.ts new file mode 100644 index 000000000000..0405c92b824c --- /dev/null +++ b/clients/client-payment-cryptography/src/pagination/ListTagsForResourcePaginator.ts @@ -0,0 +1,50 @@ +// smithy-typescript generated code +import { Paginator } from "@aws-sdk/types"; + +import { + ListTagsForResourceCommand, + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "../commands/ListTagsForResourceCommand"; +import { PaymentCryptographyClient } from "../PaymentCryptographyClient"; +import { PaymentCryptographyPaginationConfiguration } from "./Interfaces"; + +/** + * @internal + */ +const makePagedClientRequest = async ( + client: PaymentCryptographyClient, + input: ListTagsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTagsForResourceCommand(input), ...args); +}; +/** + * @public + */ +export async function* paginateListTagsForResource( + config: PaymentCryptographyPaginationConfiguration, + input: ListTagsForResourceCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.NextToken + let token: typeof input.NextToken | undefined = config.startingToken || undefined; + let hasNext = true; + let page: ListTagsForResourceCommandOutput; + while (hasNext) { + input.NextToken = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof PaymentCryptographyClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected PaymentCryptography | PaymentCryptographyClient"); + } + yield page; + const prevToken = token; + token = page.NextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-payment-cryptography/src/pagination/index.ts b/clients/client-payment-cryptography/src/pagination/index.ts new file mode 100644 index 000000000000..4748a5fca8b0 --- /dev/null +++ b/clients/client-payment-cryptography/src/pagination/index.ts @@ -0,0 +1,5 @@ +// smithy-typescript generated code +export * from "./Interfaces"; +export * from "./ListAliasesPaginator"; +export * from "./ListKeysPaginator"; +export * from "./ListTagsForResourcePaginator"; diff --git a/clients/client-payment-cryptography/src/protocols/Aws_json1_0.ts b/clients/client-payment-cryptography/src/protocols/Aws_json1_0.ts new file mode 100644 index 000000000000..7acf508eb56f --- /dev/null +++ b/clients/client-payment-cryptography/src/protocols/Aws_json1_0.ts @@ -0,0 +1,2097 @@ +// smithy-typescript generated code +import { + _json, + decorateServiceException as __decorateServiceException, + expectBoolean as __expectBoolean, + expectNonNull as __expectNonNull, + expectNumber as __expectNumber, + expectString as __expectString, + parseEpochTimestamp as __parseEpochTimestamp, + take, + withBaseException, +} from "@aws-sdk/smithy-client"; +import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; + +import { CreateAliasCommandInput, CreateAliasCommandOutput } from "../commands/CreateAliasCommand"; +import { CreateKeyCommandInput, CreateKeyCommandOutput } from "../commands/CreateKeyCommand"; +import { DeleteAliasCommandInput, DeleteAliasCommandOutput } from "../commands/DeleteAliasCommand"; +import { DeleteKeyCommandInput, DeleteKeyCommandOutput } from "../commands/DeleteKeyCommand"; +import { ExportKeyCommandInput, ExportKeyCommandOutput } from "../commands/ExportKeyCommand"; +import { GetAliasCommandInput, GetAliasCommandOutput } from "../commands/GetAliasCommand"; +import { GetKeyCommandInput, GetKeyCommandOutput } from "../commands/GetKeyCommand"; +import { + GetParametersForExportCommandInput, + GetParametersForExportCommandOutput, +} from "../commands/GetParametersForExportCommand"; +import { + GetParametersForImportCommandInput, + GetParametersForImportCommandOutput, +} from "../commands/GetParametersForImportCommand"; +import { + GetPublicKeyCertificateCommandInput, + GetPublicKeyCertificateCommandOutput, +} from "../commands/GetPublicKeyCertificateCommand"; +import { ImportKeyCommandInput, ImportKeyCommandOutput } from "../commands/ImportKeyCommand"; +import { ListAliasesCommandInput, ListAliasesCommandOutput } from "../commands/ListAliasesCommand"; +import { ListKeysCommandInput, ListKeysCommandOutput } from "../commands/ListKeysCommand"; +import { + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "../commands/ListTagsForResourceCommand"; +import { RestoreKeyCommandInput, RestoreKeyCommandOutput } from "../commands/RestoreKeyCommand"; +import { StartKeyUsageCommandInput, StartKeyUsageCommandOutput } from "../commands/StartKeyUsageCommand"; +import { StopKeyUsageCommandInput, StopKeyUsageCommandOutput } from "../commands/StopKeyUsageCommand"; +import { TagResourceCommandInput, TagResourceCommandOutput } from "../commands/TagResourceCommand"; +import { UntagResourceCommandInput, UntagResourceCommandOutput } from "../commands/UntagResourceCommand"; +import { UpdateAliasCommandInput, UpdateAliasCommandOutput } from "../commands/UpdateAliasCommand"; +import { + AccessDeniedException, + ConflictException, + CreateAliasInput, + CreateKeyInput, + CreateKeyOutput, + DeleteAliasInput, + DeleteKeyInput, + DeleteKeyOutput, + ExportKeyInput, + ExportKeyMaterial, + ExportTr31KeyBlock, + ExportTr34KeyBlock, + GetAliasInput, + GetKeyInput, + GetKeyOutput, + GetParametersForExportInput, + GetParametersForExportOutput, + GetParametersForImportInput, + GetParametersForImportOutput, + GetPublicKeyCertificateInput, + ImportKeyInput, + ImportKeyMaterial, + ImportKeyOutput, + ImportTr31KeyBlock, + ImportTr34KeyBlock, + InternalServerException, + Key, + KeyAttributes, + KeyModesOfUse, + ListAliasesInput, + ListKeysInput, + ListTagsForResourceInput, + ResourceNotFoundException, + RestoreKeyInput, + RestoreKeyOutput, + RootCertificatePublicKey, + ServiceQuotaExceededException, + ServiceUnavailableException, + StartKeyUsageInput, + StartKeyUsageOutput, + StopKeyUsageInput, + StopKeyUsageOutput, + Tag, + TagResourceInput, + ThrottlingException, + TrustedCertificatePublicKey, + UntagResourceInput, + UpdateAliasInput, + ValidationException, +} from "../models/models_0"; +import { PaymentCryptographyServiceException as __BaseException } from "../models/PaymentCryptographyServiceException"; + +/** + * serializeAws_json1_0CreateAliasCommand + */ +export const se_CreateAliasCommand = async ( + input: CreateAliasCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("CreateAlias"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0CreateKeyCommand + */ +export const se_CreateKeyCommand = async ( + input: CreateKeyCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("CreateKey"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0DeleteAliasCommand + */ +export const se_DeleteAliasCommand = async ( + input: DeleteAliasCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("DeleteAlias"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0DeleteKeyCommand + */ +export const se_DeleteKeyCommand = async ( + input: DeleteKeyCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("DeleteKey"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0ExportKeyCommand + */ +export const se_ExportKeyCommand = async ( + input: ExportKeyCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("ExportKey"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0GetAliasCommand + */ +export const se_GetAliasCommand = async ( + input: GetAliasCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("GetAlias"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0GetKeyCommand + */ +export const se_GetKeyCommand = async (input: GetKeyCommandInput, context: __SerdeContext): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("GetKey"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0GetParametersForExportCommand + */ +export const se_GetParametersForExportCommand = async ( + input: GetParametersForExportCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("GetParametersForExport"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0GetParametersForImportCommand + */ +export const se_GetParametersForImportCommand = async ( + input: GetParametersForImportCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("GetParametersForImport"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0GetPublicKeyCertificateCommand + */ +export const se_GetPublicKeyCertificateCommand = async ( + input: GetPublicKeyCertificateCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("GetPublicKeyCertificate"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0ImportKeyCommand + */ +export const se_ImportKeyCommand = async ( + input: ImportKeyCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("ImportKey"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0ListAliasesCommand + */ +export const se_ListAliasesCommand = async ( + input: ListAliasesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("ListAliases"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0ListKeysCommand + */ +export const se_ListKeysCommand = async ( + input: ListKeysCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("ListKeys"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0ListTagsForResourceCommand + */ +export const se_ListTagsForResourceCommand = async ( + input: ListTagsForResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0RestoreKeyCommand + */ +export const se_RestoreKeyCommand = async ( + input: RestoreKeyCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("RestoreKey"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0StartKeyUsageCommand + */ +export const se_StartKeyUsageCommand = async ( + input: StartKeyUsageCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("StartKeyUsage"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0StopKeyUsageCommand + */ +export const se_StopKeyUsageCommand = async ( + input: StopKeyUsageCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("StopKeyUsage"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0TagResourceCommand + */ +export const se_TagResourceCommand = async ( + input: TagResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("TagResource"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0UntagResourceCommand + */ +export const se_UntagResourceCommand = async ( + input: UntagResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("UntagResource"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0UpdateAliasCommand + */ +export const se_UpdateAliasCommand = async ( + input: UpdateAliasCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("UpdateAlias"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * deserializeAws_json1_0CreateAliasCommand + */ +export const de_CreateAliasCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CreateAliasCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateAliasCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0CreateAliasCommandError + */ +const de_CreateAliasCommandError = 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.paymentcryptography#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.paymentcryptography#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.paymentcryptography#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.paymentcryptography#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.paymentcryptography#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.paymentcryptography#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.paymentcryptography#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.paymentcryptography#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_json1_0CreateKeyCommand + */ +export const de_CreateKeyCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CreateKeyCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateKeyOutput(data, context); + const response: CreateKeyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0CreateKeyCommandError + */ +const de_CreateKeyCommandError = 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.paymentcryptography#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.paymentcryptography#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.paymentcryptography#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.paymentcryptography#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.paymentcryptography#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.paymentcryptography#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.paymentcryptography#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.paymentcryptography#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_json1_0DeleteAliasCommand + */ +export const de_DeleteAliasCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_DeleteAliasCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteAliasCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0DeleteAliasCommandError + */ +const de_DeleteAliasCommandError = 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.paymentcryptography#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.paymentcryptography#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.paymentcryptography#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.paymentcryptography#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.paymentcryptography#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.paymentcryptography#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.paymentcryptography#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_json1_0DeleteKeyCommand + */ +export const de_DeleteKeyCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_DeleteKeyCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteKeyOutput(data, context); + const response: DeleteKeyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0DeleteKeyCommandError + */ +const de_DeleteKeyCommandError = 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.paymentcryptography#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.paymentcryptography#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.paymentcryptography#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.paymentcryptography#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.paymentcryptography#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.paymentcryptography#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.paymentcryptography#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_json1_0ExportKeyCommand + */ +export const de_ExportKeyCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_ExportKeyCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ExportKeyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0ExportKeyCommandError + */ +const de_ExportKeyCommandError = 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.paymentcryptography#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.paymentcryptography#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.paymentcryptography#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.paymentcryptography#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.paymentcryptography#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.paymentcryptography#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.paymentcryptography#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_json1_0GetAliasCommand + */ +export const de_GetAliasCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_GetAliasCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetAliasCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0GetAliasCommandError + */ +const de_GetAliasCommandError = 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.paymentcryptography#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.paymentcryptography#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.paymentcryptography#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.paymentcryptography#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.paymentcryptography#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.paymentcryptography#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_json1_0GetKeyCommand + */ +export const de_GetKeyCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_GetKeyCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetKeyOutput(data, context); + const response: GetKeyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0GetKeyCommandError + */ +const de_GetKeyCommandError = 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.paymentcryptography#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.paymentcryptography#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.paymentcryptography#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.paymentcryptography#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.paymentcryptography#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.paymentcryptography#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_json1_0GetParametersForExportCommand + */ +export const de_GetParametersForExportCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_GetParametersForExportCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetParametersForExportOutput(data, context); + const response: GetParametersForExportCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0GetParametersForExportCommandError + */ +const de_GetParametersForExportCommandError = 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.paymentcryptography#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.paymentcryptography#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.paymentcryptography#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.paymentcryptography#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.paymentcryptography#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.paymentcryptography#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.paymentcryptography#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.paymentcryptography#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_json1_0GetParametersForImportCommand + */ +export const de_GetParametersForImportCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_GetParametersForImportCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetParametersForImportOutput(data, context); + const response: GetParametersForImportCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0GetParametersForImportCommandError + */ +const de_GetParametersForImportCommandError = 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.paymentcryptography#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.paymentcryptography#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.paymentcryptography#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.paymentcryptography#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.paymentcryptography#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.paymentcryptography#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.paymentcryptography#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.paymentcryptography#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_json1_0GetPublicKeyCertificateCommand + */ +export const de_GetPublicKeyCertificateCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_GetPublicKeyCertificateCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetPublicKeyCertificateCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0GetPublicKeyCertificateCommandError + */ +const de_GetPublicKeyCertificateCommandError = 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.paymentcryptography#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.paymentcryptography#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.paymentcryptography#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.paymentcryptography#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.paymentcryptography#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.paymentcryptography#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_json1_0ImportKeyCommand + */ +export const de_ImportKeyCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_ImportKeyCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ImportKeyOutput(data, context); + const response: ImportKeyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0ImportKeyCommandError + */ +const de_ImportKeyCommandError = 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.paymentcryptography#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.paymentcryptography#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.paymentcryptography#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.paymentcryptography#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.paymentcryptography#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.paymentcryptography#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.paymentcryptography#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.paymentcryptography#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_json1_0ListAliasesCommand + */ +export const de_ListAliasesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_ListAliasesCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListAliasesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0ListAliasesCommandError + */ +const de_ListAliasesCommandError = 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.paymentcryptography#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.paymentcryptography#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.paymentcryptography#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.paymentcryptography#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.paymentcryptography#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.paymentcryptography#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_json1_0ListKeysCommand + */ +export const de_ListKeysCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_ListKeysCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListKeysCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0ListKeysCommandError + */ +const de_ListKeysCommandError = 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.paymentcryptography#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.paymentcryptography#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.paymentcryptography#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.paymentcryptography#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.paymentcryptography#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.paymentcryptography#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_json1_0ListTagsForResourceCommand + */ +export const de_ListTagsForResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_ListTagsForResourceCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0ListTagsForResourceCommandError + */ +const de_ListTagsForResourceCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.paymentcryptography#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.paymentcryptography#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.paymentcryptography#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.paymentcryptography#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.paymentcryptography#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.paymentcryptography#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_json1_0RestoreKeyCommand + */ +export const de_RestoreKeyCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_RestoreKeyCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RestoreKeyOutput(data, context); + const response: RestoreKeyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0RestoreKeyCommandError + */ +const de_RestoreKeyCommandError = 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.paymentcryptography#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.paymentcryptography#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.paymentcryptography#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.paymentcryptography#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.paymentcryptography#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.paymentcryptography#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.paymentcryptography#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.paymentcryptography#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_json1_0StartKeyUsageCommand + */ +export const de_StartKeyUsageCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_StartKeyUsageCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_StartKeyUsageOutput(data, context); + const response: StartKeyUsageCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0StartKeyUsageCommandError + */ +const de_StartKeyUsageCommandError = 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.paymentcryptography#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.paymentcryptography#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.paymentcryptography#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.paymentcryptography#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.paymentcryptography#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.paymentcryptography#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.paymentcryptography#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.paymentcryptography#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_json1_0StopKeyUsageCommand + */ +export const de_StopKeyUsageCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_StopKeyUsageCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_StopKeyUsageOutput(data, context); + const response: StopKeyUsageCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0StopKeyUsageCommandError + */ +const de_StopKeyUsageCommandError = 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.paymentcryptography#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.paymentcryptography#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.paymentcryptography#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.paymentcryptography#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.paymentcryptography#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.paymentcryptography#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.paymentcryptography#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.paymentcryptography#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_json1_0TagResourceCommand + */ +export const de_TagResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_TagResourceCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: TagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0TagResourceCommandError + */ +const de_TagResourceCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.paymentcryptography#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.paymentcryptography#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.paymentcryptography#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.paymentcryptography#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.paymentcryptography#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.paymentcryptography#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.paymentcryptography#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.paymentcryptography#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_json1_0UntagResourceCommand + */ +export const de_UntagResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_UntagResourceCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UntagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0UntagResourceCommandError + */ +const de_UntagResourceCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.paymentcryptography#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.paymentcryptography#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.paymentcryptography#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.paymentcryptography#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.paymentcryptography#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.paymentcryptography#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.paymentcryptography#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_json1_0UpdateAliasCommand + */ +export const de_UpdateAliasCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_UpdateAliasCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateAliasCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0UpdateAliasCommandError + */ +const de_UpdateAliasCommandError = 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.paymentcryptography#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.paymentcryptography#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.paymentcryptography#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.paymentcryptography#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.paymentcryptography#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.paymentcryptography#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.paymentcryptography#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_json1_0AccessDeniedExceptionRes + */ +const de_AccessDeniedExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new AccessDeniedException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * deserializeAws_json1_0ConflictExceptionRes + */ +const de_ConflictExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new ConflictException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * deserializeAws_json1_0InternalServerExceptionRes + */ +const de_InternalServerExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new InternalServerException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * deserializeAws_json1_0ResourceNotFoundExceptionRes + */ +const de_ResourceNotFoundExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new ResourceNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * deserializeAws_json1_0ServiceQuotaExceededExceptionRes + */ +const de_ServiceQuotaExceededExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new ServiceQuotaExceededException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * deserializeAws_json1_0ServiceUnavailableExceptionRes + */ +const de_ServiceUnavailableExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new ServiceUnavailableException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * deserializeAws_json1_0ThrottlingExceptionRes + */ +const de_ThrottlingExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new ThrottlingException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * deserializeAws_json1_0ValidationExceptionRes + */ +const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new ValidationException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +// se_CreateAliasInput omitted. + +// se_CreateKeyInput omitted. + +// se_DeleteAliasInput omitted. + +// se_DeleteKeyInput omitted. + +// se_ExportKeyInput omitted. + +// se_ExportKeyMaterial omitted. + +// se_ExportTr31KeyBlock omitted. + +// se_ExportTr34KeyBlock omitted. + +// se_GetAliasInput omitted. + +// se_GetKeyInput omitted. + +// se_GetParametersForExportInput omitted. + +// se_GetParametersForImportInput omitted. + +// se_GetPublicKeyCertificateInput omitted. + +// se_ImportKeyInput omitted. + +// se_ImportKeyMaterial omitted. + +// se_ImportTr31KeyBlock omitted. + +// se_ImportTr34KeyBlock omitted. + +// se_KeyAttributes omitted. + +// se_KeyModesOfUse omitted. + +// se_ListAliasesInput omitted. + +// se_ListKeysInput omitted. + +// se_ListTagsForResourceInput omitted. + +// se_RestoreKeyInput omitted. + +// se_RootCertificatePublicKey omitted. + +// se_StartKeyUsageInput omitted. + +// se_StopKeyUsageInput omitted. + +// se_Tag omitted. + +// se_TagKeys omitted. + +// se_TagResourceInput omitted. + +// se_Tags omitted. + +// se_TrustedCertificatePublicKey omitted. + +// se_UntagResourceInput omitted. + +// se_UpdateAliasInput omitted. + +// de_AccessDeniedException omitted. + +// de_Alias omitted. + +// de_Aliases omitted. + +// de_ConflictException omitted. + +// de_CreateAliasOutput omitted. + +/** + * deserializeAws_json1_0CreateKeyOutput + */ +const de_CreateKeyOutput = (output: any, context: __SerdeContext): CreateKeyOutput => { + return take(output, { + Key: (_: any) => de_Key(_, context), + }) as any; +}; + +// de_DeleteAliasOutput omitted. + +/** + * deserializeAws_json1_0DeleteKeyOutput + */ +const de_DeleteKeyOutput = (output: any, context: __SerdeContext): DeleteKeyOutput => { + return take(output, { + Key: (_: any) => de_Key(_, context), + }) as any; +}; + +// de_ExportKeyOutput omitted. + +// de_GetAliasOutput omitted. + +/** + * deserializeAws_json1_0GetKeyOutput + */ +const de_GetKeyOutput = (output: any, context: __SerdeContext): GetKeyOutput => { + return take(output, { + Key: (_: any) => de_Key(_, context), + }) as any; +}; + +/** + * deserializeAws_json1_0GetParametersForExportOutput + */ +const de_GetParametersForExportOutput = (output: any, context: __SerdeContext): GetParametersForExportOutput => { + return take(output, { + ExportToken: __expectString, + ParametersValidUntilTimestamp: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + SigningKeyAlgorithm: __expectString, + SigningKeyCertificate: __expectString, + SigningKeyCertificateChain: __expectString, + }) as any; +}; + +/** + * deserializeAws_json1_0GetParametersForImportOutput + */ +const de_GetParametersForImportOutput = (output: any, context: __SerdeContext): GetParametersForImportOutput => { + return take(output, { + ImportToken: __expectString, + ParametersValidUntilTimestamp: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + WrappingKeyAlgorithm: __expectString, + WrappingKeyCertificate: __expectString, + WrappingKeyCertificateChain: __expectString, + }) as any; +}; + +// de_GetPublicKeyCertificateOutput omitted. + +/** + * deserializeAws_json1_0ImportKeyOutput + */ +const de_ImportKeyOutput = (output: any, context: __SerdeContext): ImportKeyOutput => { + return take(output, { + Key: (_: any) => de_Key(_, context), + }) as any; +}; + +// de_InternalServerException omitted. + +/** + * deserializeAws_json1_0Key + */ +const de_Key = (output: any, context: __SerdeContext): Key => { + return take(output, { + CreateTimestamp: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + DeletePendingTimestamp: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + DeleteTimestamp: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + Enabled: __expectBoolean, + Exportable: __expectBoolean, + KeyArn: __expectString, + KeyAttributes: _json, + KeyCheckValue: __expectString, + KeyCheckValueAlgorithm: __expectString, + KeyOrigin: __expectString, + KeyState: __expectString, + UsageStartTimestamp: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + UsageStopTimestamp: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }) as any; +}; + +// de_KeyAttributes omitted. + +// de_KeyModesOfUse omitted. + +// de_KeySummary omitted. + +// de_KeySummaryList omitted. + +// de_ListAliasesOutput omitted. + +// de_ListKeysOutput omitted. + +// de_ListTagsForResourceOutput omitted. + +// de_ResourceNotFoundException omitted. + +/** + * deserializeAws_json1_0RestoreKeyOutput + */ +const de_RestoreKeyOutput = (output: any, context: __SerdeContext): RestoreKeyOutput => { + return take(output, { + Key: (_: any) => de_Key(_, context), + }) as any; +}; + +// de_ServiceQuotaExceededException omitted. + +// de_ServiceUnavailableException omitted. + +/** + * deserializeAws_json1_0StartKeyUsageOutput + */ +const de_StartKeyUsageOutput = (output: any, context: __SerdeContext): StartKeyUsageOutput => { + return take(output, { + Key: (_: any) => de_Key(_, context), + }) as any; +}; + +/** + * deserializeAws_json1_0StopKeyUsageOutput + */ +const de_StopKeyUsageOutput = (output: any, context: __SerdeContext): StopKeyUsageOutput => { + return take(output, { + Key: (_: any) => de_Key(_, context), + }) as any; +}; + +// de_Tag omitted. + +// de_TagResourceOutput omitted. + +// de_Tags omitted. + +// de_ThrottlingException omitted. + +// de_UntagResourceOutput omitted. + +// de_UpdateAliasOutput omitted. + +// de_ValidationException omitted. + +// de_WrappedKey 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"], +}); + +// Collect low-level response body stream to Uint8Array. +const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { + if (streamBody instanceof Uint8Array) { + return Promise.resolve(streamBody); + } + return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); +}; + +// Encode Uint8Array data into string with utf-8. +const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => + collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); + +const throwDefaultError = withBaseException(__BaseException); +const buildHttpRpcRequest = async ( + context: __SerdeContext, + headers: __HeaderBag, + path: string, + resolvedHostname: string | undefined, + body: any +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const contents: any = { + protocol, + hostname, + port, + method: "POST", + path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path, + headers, + }; + if (resolvedHostname !== undefined) { + contents.hostname = resolvedHostname; + } + if (body !== undefined) { + contents.body = body; + } + return new __HttpRequest(contents); +}; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.0", + "x-amz-target": `PaymentCryptographyControlPlane.${operation}`, + }; +} + +const parseBody = (streamBody: any, context: __SerdeContext): any => + collectBodyString(streamBody, context).then((encoded) => { + if (encoded.length) { + return JSON.parse(encoded); + } + return {}; + }); + +const parseErrorBody = async (errorBody: any, context: __SerdeContext) => { + const value = await parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string | number): string => { + let cleanValue = rawValue; + if (typeof cleanValue === "number") { + cleanValue = cleanValue.toString(); + } + if (cleanValue.indexOf(",") >= 0) { + cleanValue = cleanValue.split(",")[0]; + } + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } +}; diff --git a/clients/client-payment-cryptography/src/runtimeConfig.browser.ts b/clients/client-payment-cryptography/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..941313cc475f --- /dev/null +++ b/clients/client-payment-cryptography/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 { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@aws-sdk/config-resolver"; +import { FetchHttpHandler as RequestHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/util-retry"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { PaymentCryptographyClientConfig } from "./PaymentCryptographyClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client"; +import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-browser"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: PaymentCryptographyClientConfig) => { + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider), + retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)), + useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)), + }; +}; diff --git a/clients/client-payment-cryptography/src/runtimeConfig.native.ts b/clients/client-payment-cryptography/src/runtimeConfig.native.ts new file mode 100644 index 000000000000..b69a94da45f1 --- /dev/null +++ b/clients/client-payment-cryptography/src/runtimeConfig.native.ts @@ -0,0 +1,18 @@ +// smithy-typescript generated code +import { Sha256 } from "@aws-crypto/sha256-js"; + +import { PaymentCryptographyClientConfig } from "./PaymentCryptographyClient"; +import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: PaymentCryptographyClientConfig) => { + const browserDefaults = getBrowserRuntimeConfig(config); + return { + ...browserDefaults, + ...config, + runtime: "react-native", + sha256: config?.sha256 ?? Sha256, + }; +}; diff --git a/clients/client-payment-cryptography/src/runtimeConfig.shared.ts b/clients/client-payment-cryptography/src/runtimeConfig.shared.ts new file mode 100644 index 000000000000..61d493e55cf0 --- /dev/null +++ b/clients/client-payment-cryptography/src/runtimeConfig.shared.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { NoOpLogger } from "@aws-sdk/smithy-client"; +import { parseUrl } from "@aws-sdk/url-parser"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8"; + +import { defaultEndpointResolver } from "./endpoint/endpointResolver"; +import { PaymentCryptographyClientConfig } from "./PaymentCryptographyClient"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: PaymentCryptographyClientConfig) => ({ + apiVersion: "2021-09-14", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? defaultEndpointResolver, + logger: config?.logger ?? new NoOpLogger(), + serviceId: config?.serviceId ?? "Payment Cryptography", + urlParser: config?.urlParser ?? parseUrl, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, +}); diff --git a/clients/client-payment-cryptography/src/runtimeConfig.ts b/clients/client-payment-cryptography/src/runtimeConfig.ts new file mode 100644 index 000000000000..731c66af6ead --- /dev/null +++ b/clients/client-payment-cryptography/src/runtimeConfig.ts @@ -0,0 +1,59 @@ +// smithy-typescript generated code +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; // eslint-disable-line + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { + NODE_REGION_CONFIG_FILE_OPTIONS, + NODE_REGION_CONFIG_OPTIONS, + NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, + NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, +} from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler as RequestHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { DEFAULT_RETRY_MODE } from "@aws-sdk/util-retry"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { PaymentCryptographyClientConfig } from "./PaymentCryptographyClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client"; +import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-node"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: PaymentCryptographyClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider), + retryMode: + config?.retryMode ?? + loadNodeConfig({ + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), + }; +}; diff --git a/clients/client-payment-cryptography/tsconfig.cjs.json b/clients/client-payment-cryptography/tsconfig.cjs.json new file mode 100644 index 000000000000..3567d85ba846 --- /dev/null +++ b/clients/client-payment-cryptography/tsconfig.cjs.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "outDir": "dist-cjs" + } +} diff --git a/clients/client-payment-cryptography/tsconfig.es.json b/clients/client-payment-cryptography/tsconfig.es.json new file mode 100644 index 000000000000..809f57bde65e --- /dev/null +++ b/clients/client-payment-cryptography/tsconfig.es.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "lib": ["dom"], + "module": "esnext", + "outDir": "dist-es" + } +} diff --git a/clients/client-payment-cryptography/tsconfig.json b/clients/client-payment-cryptography/tsconfig.json new file mode 100644 index 000000000000..344909de2128 --- /dev/null +++ b/clients/client-payment-cryptography/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "@tsconfig/node14/tsconfig.json", + "compilerOptions": { + "downlevelIteration": true, + "importHelpers": true, + "incremental": true, + "removeComments": true, + "resolveJsonModule": true, + "rootDir": "src", + "useUnknownInCatchVariables": false + }, + "exclude": ["test/"] +} diff --git a/clients/client-payment-cryptography/tsconfig.types.json b/clients/client-payment-cryptography/tsconfig.types.json new file mode 100644 index 000000000000..4c3dfa7b3d25 --- /dev/null +++ b/clients/client-payment-cryptography/tsconfig.types.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "removeComments": false, + "declaration": true, + "declarationDir": "dist-types", + "emitDeclarationOnly": true + }, + "exclude": ["test/**/*", "dist-types/**/*"] +} diff --git a/clients/client-payment-cryptography/typedoc.json b/clients/client-payment-cryptography/typedoc.json new file mode 100644 index 000000000000..8a364aa93b69 --- /dev/null +++ b/clients/client-payment-cryptography/typedoc.json @@ -0,0 +1,6 @@ +{ + "extends": ["../../typedoc.client.json"], + "entryPoints": ["src/index.ts"], + "out": "docs", + "readme": "README.md" +} diff --git a/codegen/sdk-codegen/aws-models/payment-cryptography.json b/codegen/sdk-codegen/aws-models/payment-cryptography.json new file mode 100644 index 000000000000..c67cd315f870 --- /dev/null +++ b/codegen/sdk-codegen/aws-models/payment-cryptography.json @@ -0,0 +1,3381 @@ +{ + "smithy": "2.0", + "shapes": { + "com.amazonaws.paymentcryptography#AccessDeniedException": { + "type": "structure", + "members": { + "Message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

You do not have sufficient access to perform this action.

", + "smithy.api#error": "client", + "smithy.api#httpError": 403 + } + }, + "com.amazonaws.paymentcryptography#Alias": { + "type": "structure", + "members": { + "AliasName": { + "target": "com.amazonaws.paymentcryptography#AliasName", + "traits": { + "smithy.api#documentation": "

A friendly name that you can use to refer to a key. The value must begin with alias/.

\n \n

Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.

\n
", + "smithy.api#required": {} + } + }, + "KeyArn": { + "target": "com.amazonaws.paymentcryptography#KeyArn", + "traits": { + "smithy.api#documentation": "

The KeyARN of the key associated with the alias.

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

Contains information about an alias.

" + } + }, + "com.amazonaws.paymentcryptography#AliasName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 7, + "max": 256 + }, + "smithy.api#pattern": "^alias/[a-zA-Z0-9/_-]+$" + } + }, + "com.amazonaws.paymentcryptography#Aliases": { + "type": "list", + "member": { + "target": "com.amazonaws.paymentcryptography#Alias" + } + }, + "com.amazonaws.paymentcryptography#CertificateType": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 32768 + }, + "smithy.api#pattern": "^[^\\[;\\]<>]+$", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.paymentcryptography#ConflictException": { + "type": "structure", + "members": { + "Message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

This request can cause an inconsistent state for the resource.

", + "smithy.api#error": "client", + "smithy.api#httpError": 409 + } + }, + "com.amazonaws.paymentcryptography#CreateAlias": { + "type": "operation", + "input": { + "target": "com.amazonaws.paymentcryptography#CreateAliasInput" + }, + "output": { + "target": "com.amazonaws.paymentcryptography#CreateAliasOutput" + }, + "errors": [ + { + "target": "com.amazonaws.paymentcryptography#AccessDeniedException" + }, + { + "target": "com.amazonaws.paymentcryptography#ConflictException" + }, + { + "target": "com.amazonaws.paymentcryptography#InternalServerException" + }, + { + "target": "com.amazonaws.paymentcryptography#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceUnavailableException" + }, + { + "target": "com.amazonaws.paymentcryptography#ThrottlingException" + }, + { + "target": "com.amazonaws.paymentcryptography#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "smithy.api#documentation": "

Creates an alias, or a friendly name, for an Amazon Web Services Payment Cryptography key. You can use an alias to identify a key in the console and when you call cryptographic operations such as EncryptData or DecryptData.

\n

You can associate the alias with any key in the same Amazon Web Services Region. Each alias is associated with only one key at a time, but a key can have multiple aliases. You can't create an alias without a key. The alias must be unique in the account and Amazon Web Services Region, but you can create another alias with the same name in a different Amazon Web Services Region.

\n

To change the key that's associated with the alias, call UpdateAlias. To delete the alias, call DeleteAlias. These operations don't affect the underlying key. To get the alias that you created, call ListAliases.

\n

\n Cross-account use: This operation can't be used across different Amazon Web Services accounts.

\n

\n Related operations:\n

\n " + } + }, + "com.amazonaws.paymentcryptography#CreateAliasInput": { + "type": "structure", + "members": { + "AliasName": { + "target": "com.amazonaws.paymentcryptography#AliasName", + "traits": { + "smithy.api#documentation": "

A friendly name that you can use to refer a key. An alias must begin with alias/ followed by a name, for example alias/ExampleAlias. It can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-).

\n \n

Don't include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.

\n
", + "smithy.api#required": {} + } + }, + "KeyArn": { + "target": "com.amazonaws.paymentcryptography#KeyArn", + "traits": { + "smithy.api#documentation": "

The KeyARN of the key to associate with the alias.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.paymentcryptography#CreateAliasOutput": { + "type": "structure", + "members": { + "Alias": { + "target": "com.amazonaws.paymentcryptography#Alias", + "traits": { + "smithy.api#documentation": "

The alias for the key.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.paymentcryptography#CreateKey": { + "type": "operation", + "input": { + "target": "com.amazonaws.paymentcryptography#CreateKeyInput" + }, + "output": { + "target": "com.amazonaws.paymentcryptography#CreateKeyOutput" + }, + "errors": [ + { + "target": "com.amazonaws.paymentcryptography#AccessDeniedException" + }, + { + "target": "com.amazonaws.paymentcryptography#ConflictException" + }, + { + "target": "com.amazonaws.paymentcryptography#InternalServerException" + }, + { + "target": "com.amazonaws.paymentcryptography#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceUnavailableException" + }, + { + "target": "com.amazonaws.paymentcryptography#ThrottlingException" + }, + { + "target": "com.amazonaws.paymentcryptography#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "smithy.api#documentation": "

Creates an Amazon Web Services Payment Cryptography key, a logical representation of a cryptographic key, that is unique in your account and Amazon Web Services Region. You use keys for cryptographic functions such as encryption and decryption.

\n

In addition to the key material used in cryptographic operations, an Amazon Web Services Payment Cryptography key includes metadata such as the key ARN, key usage, key origin, creation date, description, and key state.

\n

When you create a key, you specify both immutable and mutable data about the key. The immutable data contains key attributes that defines the scope and cryptographic operations that you can perform using the key, for example key class (example: SYMMETRIC_KEY), key algorithm (example: TDES_2KEY), key usage (example: TR31_P0_PIN_ENCRYPTION_KEY) and key modes of use (example: Encrypt). For information about valid combinations of key attributes, see Understanding key attributes in the Amazon Web Services Payment Cryptography User Guide. The mutable data contained within a key includes usage timestamp and key deletion timestamp and can be modified after creation.

\n

Amazon Web Services Payment Cryptography binds key attributes to keys using key blocks when you store or export them. Amazon Web Services Payment Cryptography stores the key contents wrapped and never stores or transmits them in the clear.

\n

\n Cross-account use: This operation can't be used across different Amazon Web Services accounts.

\n

\n Related operations:\n

\n " + } + }, + "com.amazonaws.paymentcryptography#CreateKeyInput": { + "type": "structure", + "members": { + "KeyAttributes": { + "target": "com.amazonaws.paymentcryptography#KeyAttributes", + "traits": { + "smithy.api#documentation": "

The role of the key, the algorithm it supports, and the cryptographic operations allowed with the key. This data is immutable after the key is created.

", + "smithy.api#required": {} + } + }, + "KeyCheckValueAlgorithm": { + "target": "com.amazonaws.paymentcryptography#KeyCheckValueAlgorithm", + "traits": { + "smithy.api#documentation": "

The algorithm that Amazon Web Services Payment Cryptography uses to calculate the key check value (KCV) for DES and AES keys.

\n

For DES key, the KCV is computed by encrypting 8 bytes, each with value '00', with the key to be checked and retaining the 3 highest order bytes of the encrypted result. For AES key, the KCV is computed by encrypting 8 bytes, each with value '01', with the key to be checked and retaining the 3 highest order bytes of the encrypted result.

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

Specifies whether the key is exportable from the service.

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

Specifies whether to enable the key. If the key is enabled, it is activated for use within the service. If the key not enabled, then it is created but not activated. The default value is enabled.

" + } + }, + "Tags": { + "target": "com.amazonaws.paymentcryptography#Tags", + "traits": { + "smithy.api#documentation": "

The tags to attach to the key. Each tag consists of a tag key and a tag value. Both the tag key and the tag value are required, but the tag value can be an empty (null) string. You can't have more than one tag on an Amazon Web Services Payment Cryptography key with the same tag key.

\n

To use this parameter, you must have TagResource permission.

\n \n

Don't include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.

\n
\n \n

Tagging or untagging an Amazon Web Services Payment Cryptography key can allow or deny permission to the key.

\n
" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.paymentcryptography#CreateKeyOutput": { + "type": "structure", + "members": { + "Key": { + "target": "com.amazonaws.paymentcryptography#Key", + "traits": { + "smithy.api#documentation": "

The key material that contains all the key attributes.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.paymentcryptography#DeleteAlias": { + "type": "operation", + "input": { + "target": "com.amazonaws.paymentcryptography#DeleteAliasInput" + }, + "output": { + "target": "com.amazonaws.paymentcryptography#DeleteAliasOutput" + }, + "errors": [ + { + "target": "com.amazonaws.paymentcryptography#AccessDeniedException" + }, + { + "target": "com.amazonaws.paymentcryptography#ConflictException" + }, + { + "target": "com.amazonaws.paymentcryptography#InternalServerException" + }, + { + "target": "com.amazonaws.paymentcryptography#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceUnavailableException" + }, + { + "target": "com.amazonaws.paymentcryptography#ThrottlingException" + }, + { + "target": "com.amazonaws.paymentcryptography#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "smithy.api#documentation": "

Deletes the alias, but doesn't affect the underlying key.

\n

Each key can have multiple aliases. To get the aliases of all keys, use the ListAliases operation. To change the alias of a key, first use DeleteAlias to delete the current alias and then use CreateAlias to create a new alias. To associate an existing alias with a different key, call UpdateAlias.

\n

\n Cross-account use: This operation can't be used across different Amazon Web Services accounts.

\n

\n Related operations:\n

\n " + } + }, + "com.amazonaws.paymentcryptography#DeleteAliasInput": { + "type": "structure", + "members": { + "AliasName": { + "target": "com.amazonaws.paymentcryptography#AliasName", + "traits": { + "smithy.api#documentation": "

A friendly name that you can use to refer Amazon Web Services Payment Cryptography key. This value must begin with alias/ followed by a name, such as alias/ExampleAlias.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.paymentcryptography#DeleteAliasOutput": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.paymentcryptography#DeleteKey": { + "type": "operation", + "input": { + "target": "com.amazonaws.paymentcryptography#DeleteKeyInput" + }, + "output": { + "target": "com.amazonaws.paymentcryptography#DeleteKeyOutput" + }, + "errors": [ + { + "target": "com.amazonaws.paymentcryptography#AccessDeniedException" + }, + { + "target": "com.amazonaws.paymentcryptography#ConflictException" + }, + { + "target": "com.amazonaws.paymentcryptography#InternalServerException" + }, + { + "target": "com.amazonaws.paymentcryptography#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceUnavailableException" + }, + { + "target": "com.amazonaws.paymentcryptography#ThrottlingException" + }, + { + "target": "com.amazonaws.paymentcryptography#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "smithy.api#documentation": "

Deletes the key material and all metadata associated with Amazon Web Services Payment Cryptography key.

\n

Key deletion is irreversible. After a key is deleted, you can't perform cryptographic operations using the key. For example, you can't decrypt data that was encrypted by a deleted Amazon Web Services Payment Cryptography key, and the data may become unrecoverable. Because key deletion is destructive, Amazon Web Services Payment Cryptography has a safety mechanism to prevent accidental deletion of a key. When you call this operation, Amazon Web Services Payment Cryptography disables the specified key but doesn't delete it until after a waiting period. The default waiting period is 7 days. To set a different waiting period, set DeleteKeyInDays. During the waiting period, the KeyState is DELETE_PENDING. After the key is deleted, the KeyState is DELETE_COMPLETE.

\n

If you delete key material, you can use ImportKey to reimport the same key material into the Amazon Web Services Payment Cryptography key.

\n

You should delete a key only when you are sure that you don't need to use it anymore and no other parties are utilizing this key. If you aren't sure, consider deactivating it instead by calling StopKeyUsage.

\n

\n Cross-account use: This operation can't be used across different Amazon Web Services accounts.

\n

\n Related operations:\n

\n " + } + }, + "com.amazonaws.paymentcryptography#DeleteKeyInput": { + "type": "structure", + "members": { + "KeyIdentifier": { + "target": "com.amazonaws.paymentcryptography#KeyArnOrKeyAliasType", + "traits": { + "smithy.api#documentation": "

The KeyARN of the key that is scheduled for deletion.

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

The waiting period for key deletion. The default value is seven days.

", + "smithy.api#range": { + "min": 3, + "max": 180 + } + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.paymentcryptography#DeleteKeyOutput": { + "type": "structure", + "members": { + "Key": { + "target": "com.amazonaws.paymentcryptography#Key", + "traits": { + "smithy.api#documentation": "

The KeyARN of the key that is scheduled for deletion.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.paymentcryptography#ExportKey": { + "type": "operation", + "input": { + "target": "com.amazonaws.paymentcryptography#ExportKeyInput" + }, + "output": { + "target": "com.amazonaws.paymentcryptography#ExportKeyOutput" + }, + "errors": [ + { + "target": "com.amazonaws.paymentcryptography#AccessDeniedException" + }, + { + "target": "com.amazonaws.paymentcryptography#ConflictException" + }, + { + "target": "com.amazonaws.paymentcryptography#InternalServerException" + }, + { + "target": "com.amazonaws.paymentcryptography#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceUnavailableException" + }, + { + "target": "com.amazonaws.paymentcryptography#ThrottlingException" + }, + { + "target": "com.amazonaws.paymentcryptography#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "smithy.api#documentation": "

Exports a key from Amazon Web Services Payment Cryptography using either ANSI X9 TR-34 or TR-31 key export standard.

\n

Amazon Web Services Payment Cryptography simplifies main or root key exchange process by eliminating the need of a paper-based key exchange process. It takes a modern and secure approach based of the ANSI X9 TR-34 key exchange standard.

\n

You can use ExportKey to export main or root keys such as KEK (Key Encryption Key), using asymmetric key exchange technique following ANSI X9 TR-34 standard. The ANSI X9 TR-34 standard uses asymmetric keys to establishes bi-directional trust between the two parties exchanging keys. After which you can export working keys using the ANSI X9 TR-31 symmetric key exchange standard as mandated by PCI PIN. Using this operation, you can share your Amazon Web Services Payment Cryptography generated keys with other service partners to perform cryptographic operations outside of Amazon Web Services Payment Cryptography

\n

\n TR-34 key export\n

\n

Amazon Web Services Payment Cryptography uses TR-34 asymmetric key exchange standard to export main keys such as KEK. In TR-34 terminology, the sending party of the key is called Key Distribution Host (KDH) and the receiving party of the key is called Key Receiving Host (KRH). In key export process, KDH is Amazon Web Services Payment Cryptography which initiates key export. KRH is the user receiving the key. Before you initiate TR-34 key export, you must obtain an export token by calling GetParametersForExport. This operation also returns the signing key certificate that KDH uses to sign the wrapped key to generate a TR-34 wrapped key block. The export token expires after 7 days.

\n

Set the following parameters:

\n
\n
CertificateAuthorityPublicKeyIdentifier
\n
\n

The KeyARN of the certificate chain that will sign the wrapping key certificate. This must exist within Amazon Web Services Payment Cryptography before you initiate TR-34 key export. If it does not exist, you can import it by calling ImportKey for RootCertificatePublicKey.

\n
\n
ExportToken
\n
\n

Obtained from KDH by calling GetParametersForExport.

\n
\n
WrappingKeyCertificate
\n
\n

Amazon Web Services Payment Cryptography uses this to wrap the key under export.

\n
\n
\n

When this operation is successful, Amazon Web Services Payment Cryptography returns the TR-34 wrapped key block.

\n

\n TR-31 key export\n

\n

Amazon Web Services Payment Cryptography uses TR-31 symmetric key exchange standard to export working keys. In TR-31, you must use a main key such as KEK to encrypt or wrap the key under export. To establish a KEK, you can use CreateKey or ImportKey. When this operation is successful, Amazon Web Services Payment Cryptography returns a TR-31 wrapped key block.

\n

\n Cross-account use: This operation can't be used across different Amazon Web Services accounts.

\n

\n Related operations:\n

\n " + } + }, + "com.amazonaws.paymentcryptography#ExportKeyInput": { + "type": "structure", + "members": { + "KeyMaterial": { + "target": "com.amazonaws.paymentcryptography#ExportKeyMaterial", + "traits": { + "smithy.api#documentation": "

The key block format type, for example, TR-34 or TR-31, to use during key material export.

", + "smithy.api#required": {} + } + }, + "ExportKeyIdentifier": { + "target": "com.amazonaws.paymentcryptography#KeyArnOrKeyAliasType", + "traits": { + "smithy.api#documentation": "

The KeyARN of the key under export from Amazon Web Services Payment Cryptography.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.paymentcryptography#ExportKeyMaterial": { + "type": "union", + "members": { + "Tr31KeyBlock": { + "target": "com.amazonaws.paymentcryptography#ExportTr31KeyBlock", + "traits": { + "smithy.api#documentation": "

Parameter information for key material export using TR-31 standard.

" + } + }, + "Tr34KeyBlock": { + "target": "com.amazonaws.paymentcryptography#ExportTr34KeyBlock", + "traits": { + "smithy.api#documentation": "

Parameter information for key material export using TR-34 standard.

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

Parameter information for key material export from Amazon Web Services Payment Cryptography.

" + } + }, + "com.amazonaws.paymentcryptography#ExportKeyOutput": { + "type": "structure", + "members": { + "WrappedKey": { + "target": "com.amazonaws.paymentcryptography#WrappedKey", + "traits": { + "smithy.api#documentation": "

The key material under export as a TR-34 or TR-31 wrapped key block.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.paymentcryptography#ExportTokenId": { + "type": "string", + "traits": { + "smithy.api#pattern": "^export-token-[0-9a-zA-Z]{16,64}$" + } + }, + "com.amazonaws.paymentcryptography#ExportTr31KeyBlock": { + "type": "structure", + "members": { + "WrappingKeyIdentifier": { + "target": "com.amazonaws.paymentcryptography#KeyArnOrKeyAliasType", + "traits": { + "smithy.api#documentation": "

The KeyARN of the the wrapping key. This key encrypts or wraps the key under export for TR-31 key block generation.

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

Parameter information for key material export using TR-31 standard.

" + } + }, + "com.amazonaws.paymentcryptography#ExportTr34KeyBlock": { + "type": "structure", + "members": { + "CertificateAuthorityPublicKeyIdentifier": { + "target": "com.amazonaws.paymentcryptography#KeyArnOrKeyAliasType", + "traits": { + "smithy.api#documentation": "

The KeyARN of the certificate chain that signs the wrapping key certificate during TR-34 key export.

", + "smithy.api#required": {} + } + }, + "WrappingKeyCertificate": { + "target": "com.amazonaws.paymentcryptography#CertificateType", + "traits": { + "smithy.api#documentation": "

The KeyARN of the wrapping key certificate. Amazon Web Services Payment Cryptography uses this certificate to wrap the key under export.

", + "smithy.api#required": {} + } + }, + "ExportToken": { + "target": "com.amazonaws.paymentcryptography#ExportTokenId", + "traits": { + "smithy.api#documentation": "

The export token to initiate key export from Amazon Web Services Payment Cryptography. It also contains the signing key certificate that will sign the wrapped key during TR-34 key block generation. Call GetParametersForExport to receive an export token. It expires after 7 days. You can use the same export token to export multiple keys from the same service account.

", + "smithy.api#required": {} + } + }, + "KeyBlockFormat": { + "target": "com.amazonaws.paymentcryptography#Tr34KeyBlockFormat", + "traits": { + "smithy.api#documentation": "

The format of key block that Amazon Web Services Payment Cryptography will use during key export.

", + "smithy.api#required": {} + } + }, + "RandomNonce": { + "target": "com.amazonaws.paymentcryptography#HexLength16", + "traits": { + "smithy.api#documentation": "

A random number value that is unique to the TR-34 key block generated using 2 pass. The operation will fail, if a random nonce value is not provided for a TR-34 key block generated using 2 pass.

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

Parameter information for key material export using TR-34 standard.

" + } + }, + "com.amazonaws.paymentcryptography#GetAlias": { + "type": "operation", + "input": { + "target": "com.amazonaws.paymentcryptography#GetAliasInput" + }, + "output": { + "target": "com.amazonaws.paymentcryptography#GetAliasOutput" + }, + "errors": [ + { + "target": "com.amazonaws.paymentcryptography#AccessDeniedException" + }, + { + "target": "com.amazonaws.paymentcryptography#InternalServerException" + }, + { + "target": "com.amazonaws.paymentcryptography#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceUnavailableException" + }, + { + "target": "com.amazonaws.paymentcryptography#ThrottlingException" + }, + { + "target": "com.amazonaws.paymentcryptography#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "smithy.api#documentation": "

Gets the Amazon Web Services Payment Cryptography key associated with the alias.

\n

\n Cross-account use: This operation can't be used across different Amazon Web Services accounts.

\n

\n Related operations:\n

\n ", + "smithy.api#readonly": {} + } + }, + "com.amazonaws.paymentcryptography#GetAliasInput": { + "type": "structure", + "members": { + "AliasName": { + "target": "com.amazonaws.paymentcryptography#AliasName", + "traits": { + "smithy.api#documentation": "

The alias of the Amazon Web Services Payment Cryptography key.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.paymentcryptography#GetAliasOutput": { + "type": "structure", + "members": { + "Alias": { + "target": "com.amazonaws.paymentcryptography#Alias", + "traits": { + "smithy.api#documentation": "

The alias of the Amazon Web Services Payment Cryptography key.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.paymentcryptography#GetKey": { + "type": "operation", + "input": { + "target": "com.amazonaws.paymentcryptography#GetKeyInput" + }, + "output": { + "target": "com.amazonaws.paymentcryptography#GetKeyOutput" + }, + "errors": [ + { + "target": "com.amazonaws.paymentcryptography#AccessDeniedException" + }, + { + "target": "com.amazonaws.paymentcryptography#InternalServerException" + }, + { + "target": "com.amazonaws.paymentcryptography#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceUnavailableException" + }, + { + "target": "com.amazonaws.paymentcryptography#ThrottlingException" + }, + { + "target": "com.amazonaws.paymentcryptography#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "smithy.api#documentation": "

Gets the key material for an Amazon Web Services Payment Cryptography key, including the immutable and mutable data specified when the key was created.

\n

\n Cross-account use: This operation can't be used across different Amazon Web Services accounts.

\n

\n Related operations:\n

\n ", + "smithy.api#readonly": {} + } + }, + "com.amazonaws.paymentcryptography#GetKeyInput": { + "type": "structure", + "members": { + "KeyIdentifier": { + "target": "com.amazonaws.paymentcryptography#KeyArnOrKeyAliasType", + "traits": { + "smithy.api#documentation": "

The KeyARN of the Amazon Web Services Payment Cryptography key.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.paymentcryptography#GetKeyOutput": { + "type": "structure", + "members": { + "Key": { + "target": "com.amazonaws.paymentcryptography#Key", + "traits": { + "smithy.api#documentation": "

The key material, including the immutable and mutable data for the key.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.paymentcryptography#GetParametersForExport": { + "type": "operation", + "input": { + "target": "com.amazonaws.paymentcryptography#GetParametersForExportInput" + }, + "output": { + "target": "com.amazonaws.paymentcryptography#GetParametersForExportOutput" + }, + "errors": [ + { + "target": "com.amazonaws.paymentcryptography#AccessDeniedException" + }, + { + "target": "com.amazonaws.paymentcryptography#ConflictException" + }, + { + "target": "com.amazonaws.paymentcryptography#InternalServerException" + }, + { + "target": "com.amazonaws.paymentcryptography#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceUnavailableException" + }, + { + "target": "com.amazonaws.paymentcryptography#ThrottlingException" + }, + { + "target": "com.amazonaws.paymentcryptography#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "smithy.api#documentation": "

Gets the export token and the signing key certificate to initiate a TR-34 key export from Amazon Web Services Payment Cryptography.

\n

The signing key certificate signs the wrapped key under export within the TR-34 key payload. The export token and signing key certificate must be in place and operational before calling ExportKey. The export token expires in 7 days. You can use the same export token to export multiple keys from your service account.

\n

\n Cross-account use: This operation can't be used across different Amazon Web Services accounts.

\n

\n Related operations:\n

\n " + } + }, + "com.amazonaws.paymentcryptography#GetParametersForExportInput": { + "type": "structure", + "members": { + "KeyMaterialType": { + "target": "com.amazonaws.paymentcryptography#KeyMaterialType", + "traits": { + "smithy.api#documentation": "

The key block format type (for example, TR-34 or TR-31) to use during key material export. Export token is only required for a TR-34 key export, TR34_KEY_BLOCK. Export token is not required for TR-31 key export.

", + "smithy.api#required": {} + } + }, + "SigningKeyAlgorithm": { + "target": "com.amazonaws.paymentcryptography#KeyAlgorithm", + "traits": { + "smithy.api#documentation": "

The signing key algorithm to generate a signing key certificate. This certificate signs the wrapped key under export within the TR-34 key block cryptogram. RSA_2048 is the only signing key algorithm allowed.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.paymentcryptography#GetParametersForExportOutput": { + "type": "structure", + "members": { + "SigningKeyCertificate": { + "target": "com.amazonaws.paymentcryptography#CertificateType", + "traits": { + "smithy.api#documentation": "

The signing key certificate of the public key for signature within the TR-34 key block cryptogram. The certificate expires after 7 days.

", + "smithy.api#required": {} + } + }, + "SigningKeyCertificateChain": { + "target": "com.amazonaws.paymentcryptography#CertificateType", + "traits": { + "smithy.api#documentation": "

The certificate chain that signed the signing key certificate. This is the root certificate authority (CA) within your service account.

", + "smithy.api#required": {} + } + }, + "SigningKeyAlgorithm": { + "target": "com.amazonaws.paymentcryptography#KeyAlgorithm", + "traits": { + "smithy.api#documentation": "

The algorithm of the signing key certificate for use in TR-34 key block generation. RSA_2048 is the only signing key algorithm allowed.

", + "smithy.api#required": {} + } + }, + "ExportToken": { + "target": "com.amazonaws.paymentcryptography#ExportTokenId", + "traits": { + "smithy.api#documentation": "

The export token to initiate key export from Amazon Web Services Payment Cryptography. The export token expires after 7 days. You can use the same export token to export multiple keys from the same service account.

", + "smithy.api#required": {} + } + }, + "ParametersValidUntilTimestamp": { + "target": "com.amazonaws.paymentcryptography#Timestamp", + "traits": { + "smithy.api#documentation": "

The validity period of the export token.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.paymentcryptography#GetParametersForImport": { + "type": "operation", + "input": { + "target": "com.amazonaws.paymentcryptography#GetParametersForImportInput" + }, + "output": { + "target": "com.amazonaws.paymentcryptography#GetParametersForImportOutput" + }, + "errors": [ + { + "target": "com.amazonaws.paymentcryptography#AccessDeniedException" + }, + { + "target": "com.amazonaws.paymentcryptography#ConflictException" + }, + { + "target": "com.amazonaws.paymentcryptography#InternalServerException" + }, + { + "target": "com.amazonaws.paymentcryptography#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceUnavailableException" + }, + { + "target": "com.amazonaws.paymentcryptography#ThrottlingException" + }, + { + "target": "com.amazonaws.paymentcryptography#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "smithy.api#documentation": "

Gets the import token and the wrapping key certificate to initiate a TR-34 key import into Amazon Web Services Payment Cryptography.

\n

The wrapping key certificate wraps the key under import within the TR-34 key payload. The import token and wrapping key certificate must be in place and operational before calling ImportKey. The import token expires in 7 days. The same import token can be used to import multiple keys into your service account.

\n

\n Cross-account use: This operation can't be used across different Amazon Web Services accounts.

\n

\n Related operations:\n

\n " + } + }, + "com.amazonaws.paymentcryptography#GetParametersForImportInput": { + "type": "structure", + "members": { + "KeyMaterialType": { + "target": "com.amazonaws.paymentcryptography#KeyMaterialType", + "traits": { + "smithy.api#documentation": "

The key block format type such as TR-34 or TR-31 to use during key material import. Import token is only required for TR-34 key import TR34_KEY_BLOCK. Import token is not required for TR-31 key import.

", + "smithy.api#required": {} + } + }, + "WrappingKeyAlgorithm": { + "target": "com.amazonaws.paymentcryptography#KeyAlgorithm", + "traits": { + "smithy.api#documentation": "

The wrapping key algorithm to generate a wrapping key certificate. This certificate wraps the key under import within the TR-34 key block cryptogram. RSA_2048 is the only wrapping key algorithm allowed.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.paymentcryptography#GetParametersForImportOutput": { + "type": "structure", + "members": { + "WrappingKeyCertificate": { + "target": "com.amazonaws.paymentcryptography#CertificateType", + "traits": { + "smithy.api#documentation": "

The wrapping key certificate of the wrapping key for use within the TR-34 key block. The certificate expires in 7 days.

", + "smithy.api#required": {} + } + }, + "WrappingKeyCertificateChain": { + "target": "com.amazonaws.paymentcryptography#CertificateType", + "traits": { + "smithy.api#documentation": "

The Amazon Web Services Payment Cryptography certificate chain that signed the wrapping key certificate. This is the root certificate authority (CA) within your service account.

", + "smithy.api#required": {} + } + }, + "WrappingKeyAlgorithm": { + "target": "com.amazonaws.paymentcryptography#KeyAlgorithm", + "traits": { + "smithy.api#documentation": "

The algorithm of the wrapping key for use within TR-34 key block. RSA_2048 is the only wrapping key algorithm allowed.

", + "smithy.api#required": {} + } + }, + "ImportToken": { + "target": "com.amazonaws.paymentcryptography#ImportTokenId", + "traits": { + "smithy.api#documentation": "

The import token to initiate key import into Amazon Web Services Payment Cryptography. The import token expires after 7 days. You can use the same import token to import multiple keys to the same service account.

", + "smithy.api#required": {} + } + }, + "ParametersValidUntilTimestamp": { + "target": "com.amazonaws.paymentcryptography#Timestamp", + "traits": { + "smithy.api#documentation": "

The validity period of the import token.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.paymentcryptography#GetPublicKeyCertificate": { + "type": "operation", + "input": { + "target": "com.amazonaws.paymentcryptography#GetPublicKeyCertificateInput" + }, + "output": { + "target": "com.amazonaws.paymentcryptography#GetPublicKeyCertificateOutput" + }, + "errors": [ + { + "target": "com.amazonaws.paymentcryptography#AccessDeniedException" + }, + { + "target": "com.amazonaws.paymentcryptography#InternalServerException" + }, + { + "target": "com.amazonaws.paymentcryptography#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceUnavailableException" + }, + { + "target": "com.amazonaws.paymentcryptography#ThrottlingException" + }, + { + "target": "com.amazonaws.paymentcryptography#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "smithy.api#documentation": "

Gets the public key certificate of the asymmetric key pair that exists within Amazon Web Services Payment Cryptography.

\n

Unlike the private key of an asymmetric key, which never leaves Amazon Web Services Payment Cryptography unencrypted, callers with GetPublicKeyCertificate permission can download the public key certificate of the asymmetric key. You can share the public key certificate to allow others to encrypt messages and verify signatures outside of Amazon Web Services Payment Cryptography

\n

\n Cross-account use: This operation can't be used across different Amazon Web Services accounts.

", + "smithy.api#readonly": {} + } + }, + "com.amazonaws.paymentcryptography#GetPublicKeyCertificateInput": { + "type": "structure", + "members": { + "KeyIdentifier": { + "target": "com.amazonaws.paymentcryptography#KeyArnOrKeyAliasType", + "traits": { + "smithy.api#documentation": "

The KeyARN of the asymmetric key pair.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.paymentcryptography#GetPublicKeyCertificateOutput": { + "type": "structure", + "members": { + "KeyCertificate": { + "target": "com.amazonaws.paymentcryptography#CertificateType", + "traits": { + "smithy.api#documentation": "

The public key component of the asymmetric key pair in a certificate (PEM) format. It is signed by the root certificate authority (CA) within your service account. The certificate expires in 90 days.

", + "smithy.api#required": {} + } + }, + "KeyCertificateChain": { + "target": "com.amazonaws.paymentcryptography#CertificateType", + "traits": { + "smithy.api#documentation": "

The certificate chain that signed the public key certificate of the asymmetric key pair. This is the root certificate authority (CA) within your service account.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.paymentcryptography#HexLength16": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 16, + "max": 16 + }, + "smithy.api#pattern": "^[0-9A-F]+$" + } + }, + "com.amazonaws.paymentcryptography#ImportKey": { + "type": "operation", + "input": { + "target": "com.amazonaws.paymentcryptography#ImportKeyInput" + }, + "output": { + "target": "com.amazonaws.paymentcryptography#ImportKeyOutput" + }, + "errors": [ + { + "target": "com.amazonaws.paymentcryptography#AccessDeniedException" + }, + { + "target": "com.amazonaws.paymentcryptography#ConflictException" + }, + { + "target": "com.amazonaws.paymentcryptography#InternalServerException" + }, + { + "target": "com.amazonaws.paymentcryptography#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceUnavailableException" + }, + { + "target": "com.amazonaws.paymentcryptography#ThrottlingException" + }, + { + "target": "com.amazonaws.paymentcryptography#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "smithy.api#documentation": "

Imports keys and public key certificates into Amazon Web Services Payment Cryptography.

\n

Amazon Web Services Payment Cryptography simplifies main or root key exchange process by eliminating the need of a paper-based key exchange process. It takes a modern and secure approach based of the ANSI X9 TR-34 key exchange standard.

\n

You can use ImportKey to import main or root keys such as KEK (Key Encryption Key) using asymmetric key exchange technique following the ANSI X9 TR-34 standard. The ANSI X9 TR-34 standard uses asymmetric keys to establishes bi-directional trust between the two parties exchanging keys.

\n

After you have imported a main or root key, you can import working keys to perform various cryptographic operations within Amazon Web Services Payment Cryptography using the ANSI X9 TR-31 symmetric key exchange standard as mandated by PCI PIN.

\n

You can also import a root public key certificate, a self-signed certificate used to sign other public key certificates, or a trusted public key certificate under an already established root public key certificate.

\n

\n To import a public root key certificate\n

\n

Using this operation, you can import the public component (in PEM cerificate format) of your private root key. You can use the imported public root key certificate for digital signatures, for example signing wrapping key or signing key in TR-34, within your Amazon Web Services Payment Cryptography account.

\n

Set the following parameters:

\n
    \n
  • \n

    \n KeyMaterial: RootCertificatePublicKey\n

    \n
  • \n
  • \n

    \n KeyClass: PUBLIC_KEY\n

    \n
  • \n
  • \n

    \n KeyModesOfUse: Verify\n

    \n
  • \n
  • \n

    \n KeyUsage: TR31_S0_ASYMMETRIC_KEY_FOR_DIGITAL_SIGNATURE\n

    \n
  • \n
  • \n

    \n PublicKeyCertificate: The certificate authority used to sign the root public key certificate.

    \n
  • \n
\n

\n To import a trusted public key certificate\n

\n

The root public key certificate must be in place and operational before you import a trusted public key certificate. Set the following parameters:

\n
    \n
  • \n

    \n KeyMaterial: TrustedCertificatePublicKey\n

    \n
  • \n
  • \n

    \n CertificateAuthorityPublicKeyIdentifier: KeyArn of the RootCertificatePublicKey.

    \n
  • \n
  • \n

    \n KeyModesOfUse and KeyUsage: Corresponding to the cryptographic operations such as wrap, sign, or encrypt that you will allow the trusted public key certificate to perform.

    \n
  • \n
  • \n

    \n PublicKeyCertificate: The certificate authority used to sign the trusted public key certificate.

    \n
  • \n
\n

\n Import main keys\n

\n

Amazon Web Services Payment Cryptography uses TR-34 asymmetric key exchange standard to import main keys such as KEK. In TR-34 terminology, the sending party of the key is called Key Distribution Host (KDH) and the receiving party of the key is called Key Receiving Host (KRH). During the key import process, KDH is the user who initiates the key import and KRH is Amazon Web Services Payment Cryptography who receives the key. Before initiating TR-34 key import, you must obtain an import token by calling GetParametersForImport. This operation also returns the wrapping key certificate that KDH uses wrap key under import to generate a TR-34 wrapped key block. The import token expires after 7 days.

\n

Set the following parameters:

\n
    \n
  • \n

    \n CertificateAuthorityPublicKeyIdentifier: The KeyArn of the certificate chain that will sign the signing key certificate and should exist within Amazon Web Services Payment Cryptography before initiating TR-34 key import. If it does not exist, you can import it by calling by calling ImportKey for RootCertificatePublicKey.

    \n
  • \n
  • \n

    \n ImportToken: Obtained from KRH by calling GetParametersForImport.

    \n
  • \n
  • \n

    \n WrappedKeyBlock: The TR-34 wrapped key block from KDH. It contains the KDH key under import, wrapped with KRH provided wrapping key certificate and signed by the KDH private signing key. This TR-34 key block is generated by the KDH Hardware Security Module (HSM) outside of Amazon Web Services Payment Cryptography.

    \n
  • \n
  • \n

    \n SigningKeyCertificate: The public component of the private key that signed the KDH TR-34 wrapped key block. In PEM certificate format.

    \n
  • \n
\n \n

TR-34 is intended primarily to exchange 3DES keys. Your ability to export AES-128 and larger AES keys may be dependent on your source system.

\n
\n

\n Import working keys\n

\n

Amazon Web Services Payment Cryptography uses TR-31 symmetric key exchange standard to import working keys. A KEK must be established within Amazon Web Services Payment Cryptography by using TR-34 key import. To initiate a TR-31 key import, set the following parameters:

\n
    \n
  • \n

    \n WrappedKeyBlock: The key under import and encrypted using KEK. The TR-31 key block generated by your HSM outside of Amazon Web Services Payment Cryptography.

    \n
  • \n
  • \n

    \n WrappingKeyIdentifier: The KeyArn of the KEK that Amazon Web Services Payment Cryptography uses to decrypt or unwrap the key under import.

    \n
  • \n
\n

\n Cross-account use: This operation can't be used across different Amazon Web Services accounts.

\n

\n Related operations:\n

\n " + } + }, + "com.amazonaws.paymentcryptography#ImportKeyInput": { + "type": "structure", + "members": { + "KeyMaterial": { + "target": "com.amazonaws.paymentcryptography#ImportKeyMaterial", + "traits": { + "smithy.api#documentation": "

The key or public key certificate type to use during key material import, for example TR-34 or RootCertificatePublicKey.

", + "smithy.api#required": {} + } + }, + "KeyCheckValueAlgorithm": { + "target": "com.amazonaws.paymentcryptography#KeyCheckValueAlgorithm", + "traits": { + "smithy.api#documentation": "

The algorithm that Amazon Web Services Payment Cryptography uses to calculate the key check value (KCV) for DES and AES keys.

\n

For DES key, the KCV is computed by encrypting 8 bytes, each with value '00', with the key to be checked and retaining the 3 highest order bytes of the encrypted result. For AES key, the KCV is computed by encrypting 8 bytes, each with value '01', with the key to be checked and retaining the 3 highest order bytes of the encrypted result.

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

Specifies whether import key is enabled.

" + } + }, + "Tags": { + "target": "com.amazonaws.paymentcryptography#Tags", + "traits": { + "smithy.api#documentation": "

The tags to attach to the key. Each tag consists of a tag key and a tag value. Both the tag key and the tag value are required, but the tag value can be an empty (null) string. You can't have more than one tag on an Amazon Web Services Payment Cryptography key with the same tag key.

\n

You can't have more than one tag on an Amazon Web Services Payment Cryptography key with the same tag key. If you specify an existing tag key with a different tag value, Amazon Web Services Payment Cryptography replaces the current tag value with the specified one.

\n

To use this parameter, you must have TagResource permission.

\n \n

Don't include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.

\n
\n \n

Tagging or untagging an Amazon Web Services Payment Cryptography key can allow or deny permission to the key.

\n
" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.paymentcryptography#ImportKeyMaterial": { + "type": "union", + "members": { + "RootCertificatePublicKey": { + "target": "com.amazonaws.paymentcryptography#RootCertificatePublicKey", + "traits": { + "smithy.api#documentation": "

Parameter information for root public key certificate import.

" + } + }, + "TrustedCertificatePublicKey": { + "target": "com.amazonaws.paymentcryptography#TrustedCertificatePublicKey", + "traits": { + "smithy.api#documentation": "

Parameter information for trusted public key certificate import.

" + } + }, + "Tr31KeyBlock": { + "target": "com.amazonaws.paymentcryptography#ImportTr31KeyBlock", + "traits": { + "smithy.api#documentation": "

Parameter information for key material import using TR-31 standard.

" + } + }, + "Tr34KeyBlock": { + "target": "com.amazonaws.paymentcryptography#ImportTr34KeyBlock", + "traits": { + "smithy.api#documentation": "

Parameter information for key material import using TR-34 standard.

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

Parameter information for key material import.

" + } + }, + "com.amazonaws.paymentcryptography#ImportKeyOutput": { + "type": "structure", + "members": { + "Key": { + "target": "com.amazonaws.paymentcryptography#Key", + "traits": { + "smithy.api#documentation": "

The KeyARN of the key material imported within Amazon Web Services Payment Cryptography.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.paymentcryptography#ImportTokenId": { + "type": "string", + "traits": { + "smithy.api#pattern": "^import-token-[0-9a-zA-Z]{16,64}$" + } + }, + "com.amazonaws.paymentcryptography#ImportTr31KeyBlock": { + "type": "structure", + "members": { + "WrappingKeyIdentifier": { + "target": "com.amazonaws.paymentcryptography#KeyArnOrKeyAliasType", + "traits": { + "smithy.api#documentation": "

The KeyARN of the key that will decrypt or unwrap a TR-31 key block during import.

", + "smithy.api#required": {} + } + }, + "WrappedKeyBlock": { + "target": "com.amazonaws.paymentcryptography#Tr31WrappedKeyBlock", + "traits": { + "smithy.api#documentation": "

The TR-34 wrapped key block to import.

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

Parameter information for key material import using TR-31 standard.

" + } + }, + "com.amazonaws.paymentcryptography#ImportTr34KeyBlock": { + "type": "structure", + "members": { + "CertificateAuthorityPublicKeyIdentifier": { + "target": "com.amazonaws.paymentcryptography#KeyArnOrKeyAliasType", + "traits": { + "smithy.api#documentation": "

The KeyARN of the certificate chain that signs the signing key certificate during TR-34 key import.

", + "smithy.api#required": {} + } + }, + "SigningKeyCertificate": { + "target": "com.amazonaws.paymentcryptography#CertificateType", + "traits": { + "smithy.api#documentation": "

The public key component in PEM certificate format of the private key that signs the KDH TR-34 wrapped key block.

", + "smithy.api#required": {} + } + }, + "ImportToken": { + "target": "com.amazonaws.paymentcryptography#ImportTokenId", + "traits": { + "smithy.api#documentation": "

The import token that initiates key import into Amazon Web Services Payment Cryptography. It expires after 7 days. You can use the same import token to import multiple keys to the same service account.

", + "smithy.api#required": {} + } + }, + "WrappedKeyBlock": { + "target": "com.amazonaws.paymentcryptography#Tr34WrappedKeyBlock", + "traits": { + "smithy.api#documentation": "

The TR-34 wrapped key block to import.

", + "smithy.api#required": {} + } + }, + "KeyBlockFormat": { + "target": "com.amazonaws.paymentcryptography#Tr34KeyBlockFormat", + "traits": { + "smithy.api#documentation": "

The key block format to use during key import. The only value allowed is X9_TR34_2012.

", + "smithy.api#required": {} + } + }, + "RandomNonce": { + "target": "com.amazonaws.paymentcryptography#HexLength16", + "traits": { + "smithy.api#documentation": "

A random number value that is unique to the TR-34 key block generated using 2 pass. The operation will fail, if a random nonce value is not provided for a TR-34 key block generated using 2 pass.

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

Parameter information for key material import using TR-34 standard.

" + } + }, + "com.amazonaws.paymentcryptography#InternalServerException": { + "type": "structure", + "members": { + "Message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

The request processing has failed because of an unknown error, exception, or failure.

", + "smithy.api#error": "server", + "smithy.api#httpError": 500 + } + }, + "com.amazonaws.paymentcryptography#Key": { + "type": "structure", + "members": { + "KeyArn": { + "target": "com.amazonaws.paymentcryptography#KeyArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the key.

", + "smithy.api#required": {} + } + }, + "KeyAttributes": { + "target": "com.amazonaws.paymentcryptography#KeyAttributes", + "traits": { + "smithy.api#documentation": "

The role of the key, the algorithm it supports, and the cryptographic operations allowed with the key. This data is immutable after the key is created.

", + "smithy.api#required": {} + } + }, + "KeyCheckValue": { + "target": "com.amazonaws.paymentcryptography#KeyCheckValue", + "traits": { + "smithy.api#documentation": "

The key check value (KCV) is used to check if all parties holding a given key have the same key or to detect that a key has changed. Amazon Web Services Payment Cryptography calculates the KCV by using standard algorithms, typically by encrypting 8 or 16 bytes or \"00\" or \"01\" and then truncating the result to the first 3 bytes, or 6 hex digits, of the resulting cryptogram.

", + "smithy.api#required": {} + } + }, + "KeyCheckValueAlgorithm": { + "target": "com.amazonaws.paymentcryptography#KeyCheckValueAlgorithm", + "traits": { + "smithy.api#documentation": "

The algorithm used for calculating key check value (KCV) for DES and AES keys. For a DES key, Amazon Web Services Payment Cryptography computes the KCV by encrypting 8 bytes, each with value '00', with the key to be checked and retaining the 3 highest order bytes of the encrypted result. For an AES key, Amazon Web Services Payment Cryptography computes the KCV by encrypting 8 bytes, each with value '01', with the key to be checked and retaining the 3 highest order bytes of the encrypted result.

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

Specifies whether the key is enabled.

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

Specifies whether the key is exportable. This data is immutable after the key is created.

", + "smithy.api#required": {} + } + }, + "KeyState": { + "target": "com.amazonaws.paymentcryptography#KeyState", + "traits": { + "smithy.api#documentation": "

The state of key that is being created or deleted.

", + "smithy.api#required": {} + } + }, + "KeyOrigin": { + "target": "com.amazonaws.paymentcryptography#KeyOrigin", + "traits": { + "smithy.api#documentation": "

The source of the key material. For keys created within Amazon Web Services Payment Cryptography, the value is AWS_PAYMENT_CRYPTOGRAPHY. For keys imported into Amazon Web Services Payment Cryptography, the value is EXTERNAL.

", + "smithy.api#required": {} + } + }, + "CreateTimestamp": { + "target": "com.amazonaws.paymentcryptography#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time when the key was created.

", + "smithy.api#required": {} + } + }, + "UsageStartTimestamp": { + "target": "com.amazonaws.paymentcryptography#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time after which Amazon Web Services Payment Cryptography will start using the key material for cryptographic operations.

" + } + }, + "UsageStopTimestamp": { + "target": "com.amazonaws.paymentcryptography#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time after which Amazon Web Services Payment Cryptography will stop using the key material for cryptographic operations.

" + } + }, + "DeletePendingTimestamp": { + "target": "com.amazonaws.paymentcryptography#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time after which Amazon Web Services Payment Cryptography will delete the key. This value is present only when KeyState is DELETE_PENDING and the key is scheduled for deletion.

" + } + }, + "DeleteTimestamp": { + "target": "com.amazonaws.paymentcryptography#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time after which Amazon Web Services Payment Cryptography will delete the key. This value is present only when when the KeyState is DELETE_COMPLETE and the Amazon Web Services Payment Cryptography key is deleted.

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

Metadata about an Amazon Web Services Payment Cryptography key.

" + } + }, + "com.amazonaws.paymentcryptography#KeyAlgorithm": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "TDES_2KEY", + "name": "TDES_2KEY" + }, + { + "value": "TDES_3KEY", + "name": "TDES_3KEY" + }, + { + "value": "AES_128", + "name": "AES_128" + }, + { + "value": "AES_192", + "name": "AES_192" + }, + { + "value": "AES_256", + "name": "AES_256" + }, + { + "value": "RSA_2048", + "name": "RSA_2048" + }, + { + "value": "RSA_3072", + "name": "RSA_3072" + }, + { + "value": "RSA_4096", + "name": "RSA_4096" + } + ] + } + }, + "com.amazonaws.paymentcryptography#KeyArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 70, + "max": 150 + }, + "smithy.api#pattern": "^arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:key/[0-9a-zA-Z]{16,64}$" + } + }, + "com.amazonaws.paymentcryptography#KeyArnOrKeyAliasType": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 7, + "max": 322 + }, + "smithy.api#pattern": "^arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:(key/[0-9a-zA-Z]{16,64}|alias/[a-zA-Z0-9/_-]+)$|^alias/[a-zA-Z0-9/_-]+$" + } + }, + "com.amazonaws.paymentcryptography#KeyAttributes": { + "type": "structure", + "members": { + "KeyUsage": { + "target": "com.amazonaws.paymentcryptography#KeyUsage", + "traits": { + "smithy.api#documentation": "

The cryptographic usage of an Amazon Web Services Payment Cryptography key as defined in section A.5.2 of the TR-31 spec.

", + "smithy.api#required": {} + } + }, + "KeyClass": { + "target": "com.amazonaws.paymentcryptography#KeyClass", + "traits": { + "smithy.api#documentation": "

The type of Amazon Web Services Payment Cryptography key to create, which determines the classification of the cryptographic method and whether Amazon Web Services Payment Cryptography key contains a symmetric key or an asymmetric key pair.

", + "smithy.api#required": {} + } + }, + "KeyAlgorithm": { + "target": "com.amazonaws.paymentcryptography#KeyAlgorithm", + "traits": { + "smithy.api#documentation": "

The key algorithm to be use during creation of an Amazon Web Services Payment Cryptography key.

\n

For symmetric keys, Amazon Web Services Payment Cryptography supports AES and TDES algorithms. For asymmetric keys, Amazon Web Services Payment Cryptography supports RSA and ECC_NIST algorithms.

", + "smithy.api#required": {} + } + }, + "KeyModesOfUse": { + "target": "com.amazonaws.paymentcryptography#KeyModesOfUse", + "traits": { + "smithy.api#documentation": "

The list of cryptographic operations that you can perform using the key.

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

The role of the key, the algorithm it supports, and the cryptographic operations allowed with the key. This data is immutable after the key is created.

" + } + }, + "com.amazonaws.paymentcryptography#KeyCheckValue": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 4, + "max": 16 + }, + "smithy.api#pattern": "^[0-9a-fA-F]+$" + } + }, + "com.amazonaws.paymentcryptography#KeyCheckValueAlgorithm": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "CMAC", + "name": "CMAC" + }, + { + "value": "ANSI_X9_24", + "name": "ANSI_X9_24" + } + ] + } + }, + "com.amazonaws.paymentcryptography#KeyClass": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "SYMMETRIC_KEY", + "name": "SYMMETRIC_KEY" + }, + { + "value": "ASYMMETRIC_KEY_PAIR", + "name": "ASYMMETRIC_KEY_PAIR" + }, + { + "value": "PRIVATE_KEY", + "name": "PRIVATE_KEY" + }, + { + "value": "PUBLIC_KEY", + "name": "PUBLIC_KEY" + } + ] + } + }, + "com.amazonaws.paymentcryptography#KeyMaterial": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 48, + "max": 16384 + }, + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.paymentcryptography#KeyMaterialType": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "TR34_KEY_BLOCK", + "name": "TR34_KEY_BLOCK" + }, + { + "value": "TR31_KEY_BLOCK", + "name": "TR31_KEY_BLOCK" + }, + { + "value": "ROOT_PUBLIC_KEY_CERTIFICATE", + "name": "ROOT_PUBLIC_KEY_CERTIFICATE" + }, + { + "value": "TRUSTED_PUBLIC_KEY_CERTIFICATE", + "name": "TRUSTED_PUBLIC_KEY_CERTIFICATE" + } + ] + } + }, + "com.amazonaws.paymentcryptography#KeyModesOfUse": { + "type": "structure", + "members": { + "Encrypt": { + "target": "smithy.api#PrimitiveBoolean", + "traits": { + "smithy.api#default": false, + "smithy.api#documentation": "

Specifies whether an Amazon Web Services Payment Cryptography key can be used to encrypt data.

" + } + }, + "Decrypt": { + "target": "smithy.api#PrimitiveBoolean", + "traits": { + "smithy.api#default": false, + "smithy.api#documentation": "

Specifies whether an Amazon Web Services Payment Cryptography key can be used to decrypt data.

" + } + }, + "Wrap": { + "target": "smithy.api#PrimitiveBoolean", + "traits": { + "smithy.api#default": false, + "smithy.api#documentation": "

Specifies whether an Amazon Web Services Payment Cryptography key can be used to wrap other keys.

" + } + }, + "Unwrap": { + "target": "smithy.api#PrimitiveBoolean", + "traits": { + "smithy.api#default": false, + "smithy.api#documentation": "

Specifies whether an Amazon Web Services Payment Cryptography key can be used to unwrap other keys.

" + } + }, + "Generate": { + "target": "smithy.api#PrimitiveBoolean", + "traits": { + "smithy.api#default": false, + "smithy.api#documentation": "

Specifies whether an Amazon Web Services Payment Cryptography key can be used to generate and verify other card and PIN verification keys.

" + } + }, + "Sign": { + "target": "smithy.api#PrimitiveBoolean", + "traits": { + "smithy.api#default": false, + "smithy.api#documentation": "

Specifies whether an Amazon Web Services Payment Cryptography key can be used for signing.

" + } + }, + "Verify": { + "target": "smithy.api#PrimitiveBoolean", + "traits": { + "smithy.api#default": false, + "smithy.api#documentation": "

Specifies whether an Amazon Web Services Payment Cryptography key can be used to verify signatures.

" + } + }, + "DeriveKey": { + "target": "smithy.api#PrimitiveBoolean", + "traits": { + "smithy.api#default": false, + "smithy.api#documentation": "

Specifies whether an Amazon Web Services Payment Cryptography key can be used to derive new keys.

" + } + }, + "NoRestrictions": { + "target": "smithy.api#PrimitiveBoolean", + "traits": { + "smithy.api#default": false, + "smithy.api#documentation": "

Specifies whether an Amazon Web Services Payment Cryptography key has no special restrictions other than the restrictions implied by KeyUsage.

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

The list of cryptographic operations that you can perform using the key. The modes of use are defined in section A.5.3 of the TR-31 spec.

" + } + }, + "com.amazonaws.paymentcryptography#KeyOrigin": { + "type": "string", + "traits": { + "smithy.api#documentation": "Defines the source of a key", + "smithy.api#enum": [ + { + "value": "EXTERNAL", + "name": "EXTERNAL" + }, + { + "value": "AWS_PAYMENT_CRYPTOGRAPHY", + "name": "AWS_PAYMENT_CRYPTOGRAPHY" + } + ] + } + }, + "com.amazonaws.paymentcryptography#KeyState": { + "type": "string", + "traits": { + "smithy.api#documentation": "Defines the state of a key", + "smithy.api#enum": [ + { + "value": "CREATE_IN_PROGRESS", + "name": "CREATE_IN_PROGRESS" + }, + { + "value": "CREATE_COMPLETE", + "name": "CREATE_COMPLETE" + }, + { + "value": "DELETE_PENDING", + "name": "DELETE_PENDING" + }, + { + "value": "DELETE_COMPLETE", + "name": "DELETE_COMPLETE" + } + ] + } + }, + "com.amazonaws.paymentcryptography#KeySummary": { + "type": "structure", + "members": { + "KeyArn": { + "target": "com.amazonaws.paymentcryptography#KeyArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the key.

", + "smithy.api#required": {} + } + }, + "KeyState": { + "target": "com.amazonaws.paymentcryptography#KeyState", + "traits": { + "smithy.api#documentation": "

The state of an Amazon Web Services Payment Cryptography that is being created or deleted.

", + "smithy.api#required": {} + } + }, + "KeyAttributes": { + "target": "com.amazonaws.paymentcryptography#KeyAttributes", + "traits": { + "smithy.api#documentation": "

The role of the key, the algorithm it supports, and the cryptographic operations allowed with the key. This data is immutable after the key is created.

", + "smithy.api#required": {} + } + }, + "KeyCheckValue": { + "target": "com.amazonaws.paymentcryptography#KeyCheckValue", + "traits": { + "smithy.api#documentation": "

The key check value (KCV) is used to check if all parties holding a given key have the same key or to detect that a key has changed. Amazon Web Services Payment Cryptography calculates the KCV by using standard algorithms, typically by encrypting 8 or 16 bytes or \"00\" or \"01\" and then truncating the result to the first 3 bytes, or 6 hex digits, of the resulting cryptogram.

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

Specifies whether the key is exportable. This data is immutable after the key is created.

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

Specifies whether the key is enabled.

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

Metadata about an Amazon Web Services Payment Cryptography key.

" + } + }, + "com.amazonaws.paymentcryptography#KeySummaryList": { + "type": "list", + "member": { + "target": "com.amazonaws.paymentcryptography#KeySummary" + } + }, + "com.amazonaws.paymentcryptography#KeyUsage": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "TR31_B0_BASE_DERIVATION_KEY", + "name": "TR31_B0_BASE_DERIVATION_KEY" + }, + { + "value": "TR31_C0_CARD_VERIFICATION_KEY", + "name": "TR31_C0_CARD_VERIFICATION_KEY" + }, + { + "value": "TR31_D0_SYMMETRIC_DATA_ENCRYPTION_KEY", + "name": "TR31_D0_SYMMETRIC_DATA_ENCRYPTION_KEY" + }, + { + "value": "TR31_D1_ASYMMETRIC_KEY_FOR_DATA_ENCRYPTION", + "name": "TR31_D1_ASYMMETRIC_KEY_FOR_DATA_ENCRYPTION" + }, + { + "value": "TR31_E0_EMV_MKEY_APP_CRYPTOGRAMS", + "name": "TR31_E0_EMV_MKEY_APP_CRYPTOGRAMS" + }, + { + "value": "TR31_E1_EMV_MKEY_CONFIDENTIALITY", + "name": "TR31_E1_EMV_MKEY_CONFIDENTIALITY" + }, + { + "value": "TR31_E2_EMV_MKEY_INTEGRITY", + "name": "TR31_E2_EMV_MKEY_INTEGRITY" + }, + { + "value": "TR31_E4_EMV_MKEY_DYNAMIC_NUMBERS", + "name": "TR31_E4_EMV_MKEY_DYNAMIC_NUMBERS" + }, + { + "value": "TR31_E5_EMV_MKEY_CARD_PERSONALIZATION", + "name": "TR31_E5_EMV_MKEY_CARD_PERSONALIZATION" + }, + { + "value": "TR31_E6_EMV_MKEY_OTHER", + "name": "TR31_E6_EMV_MKEY_OTHER" + }, + { + "value": "TR31_K0_KEY_ENCRYPTION_KEY", + "name": "TR31_K0_KEY_ENCRYPTION_KEY" + }, + { + "value": "TR31_K1_KEY_BLOCK_PROTECTION_KEY", + "name": "TR31_K1_KEY_BLOCK_PROTECTION_KEY" + }, + { + "value": "TR31_K3_ASYMMETRIC_KEY_FOR_KEY_AGREEMENT", + "name": "TR31_K3_ASYMMETRIC_KEY_FOR_KEY_AGREEMENT" + }, + { + "value": "TR31_M3_ISO_9797_3_MAC_KEY", + "name": "TR31_M3_ISO_9797_3_MAC_KEY" + }, + { + "value": "TR31_M6_ISO_9797_5_CMAC_KEY", + "name": "TR31_M6_ISO_9797_5_CMAC_KEY" + }, + { + "value": "TR31_M7_HMAC_KEY", + "name": "TR31_M7_HMAC_KEY" + }, + { + "value": "TR31_P0_PIN_ENCRYPTION_KEY", + "name": "TR31_P0_PIN_ENCRYPTION_KEY" + }, + { + "value": "TR31_P1_PIN_GENERATION_KEY", + "name": "TR31_P1_PIN_GENERATION_KEY" + }, + { + "value": "TR31_S0_ASYMMETRIC_KEY_FOR_DIGITAL_SIGNATURE", + "name": "TR31_S0_ASYMMETRIC_KEY_FOR_DIGITAL_SIGNATURE" + }, + { + "value": "TR31_V1_IBM3624_PIN_VERIFICATION_KEY", + "name": "TR31_V1_IBM3624_PIN_VERIFICATION_KEY" + }, + { + "value": "TR31_V2_VISA_PIN_VERIFICATION_KEY", + "name": "TR31_V2_VISA_PIN_VERIFICATION_KEY" + }, + { + "value": "TR31_K2_TR34_ASYMMETRIC_KEY", + "name": "TR31_K2_TR34_ASYMMETRIC_KEY" + } + ] + } + }, + "com.amazonaws.paymentcryptography#ListAliases": { + "type": "operation", + "input": { + "target": "com.amazonaws.paymentcryptography#ListAliasesInput" + }, + "output": { + "target": "com.amazonaws.paymentcryptography#ListAliasesOutput" + }, + "errors": [ + { + "target": "com.amazonaws.paymentcryptography#AccessDeniedException" + }, + { + "target": "com.amazonaws.paymentcryptography#InternalServerException" + }, + { + "target": "com.amazonaws.paymentcryptography#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceUnavailableException" + }, + { + "target": "com.amazonaws.paymentcryptography#ThrottlingException" + }, + { + "target": "com.amazonaws.paymentcryptography#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "smithy.api#documentation": "

Lists the aliases for all keys in the caller's Amazon Web Services account and Amazon Web Services Region. You can filter the list of aliases. For more information, see Using aliases in the Amazon Web Services Payment Cryptography User Guide.

\n

This is a paginated operation, which means that each response might contain only a subset of all the aliases. When the response contains only a subset of aliases, it includes a NextToken value.\n Use this value in a subsequent ListAliases request to get more aliases. When you receive a response with no NextToken (or an empty or null value), that means there are no more aliases to get.

\n

\n Cross-account use: This operation can't be used across different Amazon Web Services accounts.

\n

\n Related operations:\n

\n ", + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults", + "items": "Aliases" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.paymentcryptography#ListAliasesInput": { + "type": "structure", + "members": { + "NextToken": { + "target": "com.amazonaws.paymentcryptography#NextToken", + "traits": { + "smithy.api#documentation": "

Use this parameter in a subsequent request after you receive a response with truncated results. Set it to the value of NextToken from the truncated response you just received.

" + } + }, + "MaxResults": { + "target": "com.amazonaws.paymentcryptography#MaxResults", + "traits": { + "smithy.api#documentation": "

Use this parameter to specify the maximum number of items to return. When this value is present, Amazon Web Services Payment Cryptography does not return more than the specified number of items, but it might return fewer.

\n

This value is optional. If you include a value, it must be between 1 and 100, inclusive. If you do not include a value, it defaults to 50.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.paymentcryptography#ListAliasesOutput": { + "type": "structure", + "members": { + "Aliases": { + "target": "com.amazonaws.paymentcryptography#Aliases", + "traits": { + "smithy.api#documentation": "

The list of aliases. Each alias describes the KeyArn contained within.

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

The token for the next set of results, or an empty or null value if there are no more results.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.paymentcryptography#ListKeys": { + "type": "operation", + "input": { + "target": "com.amazonaws.paymentcryptography#ListKeysInput" + }, + "output": { + "target": "com.amazonaws.paymentcryptography#ListKeysOutput" + }, + "errors": [ + { + "target": "com.amazonaws.paymentcryptography#AccessDeniedException" + }, + { + "target": "com.amazonaws.paymentcryptography#InternalServerException" + }, + { + "target": "com.amazonaws.paymentcryptography#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceUnavailableException" + }, + { + "target": "com.amazonaws.paymentcryptography#ThrottlingException" + }, + { + "target": "com.amazonaws.paymentcryptography#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "smithy.api#documentation": "

Lists the keys in the caller's Amazon Web Services account and Amazon Web Services Region. You can filter the list of keys.

\n

This is a paginated operation, which means that each response might contain only a subset of all the keys.\n When the response contains only a subset of keys, it includes a NextToken value. Use this value in a subsequent ListKeys request to get more keys.\n When you receive a response with no NextToken (or an empty or null value), that means there are no more keys to get.

\n

\n Cross-account use: This operation can't be used across different Amazon Web Services accounts.

\n

\n Related operations:\n

\n ", + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults", + "items": "Keys" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.paymentcryptography#ListKeysInput": { + "type": "structure", + "members": { + "KeyState": { + "target": "com.amazonaws.paymentcryptography#KeyState", + "traits": { + "smithy.api#documentation": "

The key state of the keys you want to list.

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

Use this parameter in a subsequent request after you receive a response with truncated results. Set it to the value of NextToken from the truncated response you just received.

" + } + }, + "MaxResults": { + "target": "com.amazonaws.paymentcryptography#MaxResults", + "traits": { + "smithy.api#documentation": "

Use this parameter to specify the maximum number of items to return. When this value is present, Amazon Web Services Payment Cryptography does not return more than the specified number of items, but it might return fewer.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.paymentcryptography#ListKeysOutput": { + "type": "structure", + "members": { + "Keys": { + "target": "com.amazonaws.paymentcryptography#KeySummaryList", + "traits": { + "smithy.api#documentation": "

The list of keys created within the caller's Amazon Web Services account and Amazon Web Services Region.

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

The token for the next set of results, or an empty or null value if there are no more results.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.paymentcryptography#ListTagsForResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.paymentcryptography#ListTagsForResourceInput" + }, + "output": { + "target": "com.amazonaws.paymentcryptography#ListTagsForResourceOutput" + }, + "errors": [ + { + "target": "com.amazonaws.paymentcryptography#AccessDeniedException" + }, + { + "target": "com.amazonaws.paymentcryptography#InternalServerException" + }, + { + "target": "com.amazonaws.paymentcryptography#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceUnavailableException" + }, + { + "target": "com.amazonaws.paymentcryptography#ThrottlingException" + }, + { + "target": "com.amazonaws.paymentcryptography#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "smithy.api#documentation": "

Lists the tags for an Amazon Web Services resource.

\n

This is a paginated operation, which means that each response might contain only a subset of all the tags.\n When the response contains only a subset of tags, it includes a NextToken value. Use this value in a subsequent ListTagsForResource request to get more tags.\n When you receive a response with no NextToken (or an empty or null value), that means there are no more tags to get.

\n

\n Cross-account use: This operation can't be used across different Amazon Web Services accounts.

\n

\n Related operations:\n

\n ", + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults", + "items": "Tags" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.paymentcryptography#ListTagsForResourceInput": { + "type": "structure", + "members": { + "ResourceArn": { + "target": "com.amazonaws.paymentcryptography#ResourceArn", + "traits": { + "smithy.api#documentation": "

The KeyARN of the key whose tags you are getting.

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

Use this parameter in a subsequent request after you receive a response with truncated results. Set it to the value of NextToken from the truncated response you just received.

" + } + }, + "MaxResults": { + "target": "com.amazonaws.paymentcryptography#MaxResults", + "traits": { + "smithy.api#documentation": "

Use this parameter to specify the maximum number of items to return. When this value is present, Amazon Web Services Payment Cryptography does not return more than the specified number of items, but it might return fewer.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.paymentcryptography#ListTagsForResourceOutput": { + "type": "structure", + "members": { + "Tags": { + "target": "com.amazonaws.paymentcryptography#Tags", + "traits": { + "smithy.api#documentation": "

The list of tags associated with a ResourceArn. Each tag will list the key-value pair contained within that tag.

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

The token for the next set of results, or an empty or null value if there are no more results.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.paymentcryptography#MaxResults": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.paymentcryptography#NextToken": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 8192 + } + } + }, + "com.amazonaws.paymentcryptography#PaymentCryptographyControlPlane": { + "type": "service", + "version": "2021-09-14", + "operations": [ + { + "target": "com.amazonaws.paymentcryptography#CreateAlias" + }, + { + "target": "com.amazonaws.paymentcryptography#CreateKey" + }, + { + "target": "com.amazonaws.paymentcryptography#DeleteAlias" + }, + { + "target": "com.amazonaws.paymentcryptography#DeleteKey" + }, + { + "target": "com.amazonaws.paymentcryptography#ExportKey" + }, + { + "target": "com.amazonaws.paymentcryptography#GetAlias" + }, + { + "target": "com.amazonaws.paymentcryptography#GetKey" + }, + { + "target": "com.amazonaws.paymentcryptography#GetParametersForExport" + }, + { + "target": "com.amazonaws.paymentcryptography#GetParametersForImport" + }, + { + "target": "com.amazonaws.paymentcryptography#GetPublicKeyCertificate" + }, + { + "target": "com.amazonaws.paymentcryptography#ImportKey" + }, + { + "target": "com.amazonaws.paymentcryptography#ListAliases" + }, + { + "target": "com.amazonaws.paymentcryptography#ListKeys" + }, + { + "target": "com.amazonaws.paymentcryptography#ListTagsForResource" + }, + { + "target": "com.amazonaws.paymentcryptography#RestoreKey" + }, + { + "target": "com.amazonaws.paymentcryptography#StartKeyUsage" + }, + { + "target": "com.amazonaws.paymentcryptography#StopKeyUsage" + }, + { + "target": "com.amazonaws.paymentcryptography#TagResource" + }, + { + "target": "com.amazonaws.paymentcryptography#UntagResource" + }, + { + "target": "com.amazonaws.paymentcryptography#UpdateAlias" + } + ], + "traits": { + "aws.api#service": { + "sdkId": "Payment Cryptography", + "arnNamespace": "payment-cryptography", + "endpointPrefix": "controlplane.payment-cryptography" + }, + "aws.auth#sigv4": { + "name": "payment-cryptography" + }, + "aws.protocols#awsJson1_0": {}, + "smithy.api#cors": {}, + "smithy.api#documentation": "

You use the Amazon Web Services Payment Cryptography Control Plane to manage the encryption keys you use for payment-related cryptographic operations. You can create, import, export, share, manage, and delete keys. You can also manage Identity and Access Management (IAM) policies for keys. For more information, see Identity and access management in the Amazon Web Services Payment Cryptography User Guide.\n

\n

To use encryption keys for payment-related transaction processing and associated cryptographic operations, you use the Amazon Web Services Payment Cryptography Data Plane. You can encrypt, decrypt, generate, verify, and translate payment-related cryptographic operations.

\n

All Amazon Web Services Payment Cryptography API calls must be signed and transmitted using Transport Layer Security (TLS). We recommend you always use the latest supported TLS version for logging API requests.

\n

Amazon Web Services Payment Cryptography supports CloudTrail, a service that logs Amazon Web Services API calls and related events for your Amazon Web Services account and delivers them to an Amazon S3 bucket that you specify. By using the information collected by CloudTrail, you can determine what requests were made to Amazon Web Services Payment Cryptography, who made the request, when it was made, and so on. If you don't configure a trail, you can still view the most recent events in the CloudTrail console. For more information, see the CloudTrail User Guide.

", + "smithy.api#title": "Payment Cryptography Control Plane", + "smithy.rules#endpointRuleSet": { + "version": "1.0", + "parameters": { + "Region": { + "builtIn": "AWS::Region", + "required": false, + "documentation": "The AWS region used to dispatch the request.", + "type": "String" + }, + "UseDualStack": { + "builtIn": "AWS::UseDualStack", + "required": true, + "default": false, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "Boolean" + }, + "UseFIPS": { + "builtIn": "AWS::UseFIPS", + "required": true, + "default": false, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "Boolean" + }, + "Endpoint": { + "builtIn": "SDK::Endpoint", + "required": false, + "documentation": "Override the endpoint used to send this request", + "type": "String" + } + }, + "rules": [ + { + "conditions": [ + { + "fn": "isSet", + "argv": [ + { + "ref": "Endpoint" + } + ] + } + ], + "type": "tree", + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + } + ], + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error" + }, + { + "conditions": [], + "type": "tree", + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error" + }, + { + "conditions": [], + "endpoint": { + "url": { + "ref": "Endpoint" + }, + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ] + } + ] + }, + { + "conditions": [], + "type": "tree", + "rules": [ + { + "conditions": [ + { + "fn": "isSet", + "argv": [ + { + "ref": "Region" + } + ] + } + ], + "type": "tree", + "rules": [ + { + "conditions": [ + { + "fn": "aws.partition", + "argv": [ + { + "ref": "Region" + } + ], + "assign": "PartitionResult" + } + ], + "type": "tree", + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "type": "tree", + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsFIPS" + ] + } + ] + }, + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsDualStack" + ] + } + ] + } + ], + "type": "tree", + "rules": [ + { + "conditions": [], + "type": "tree", + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://controlplane.payment-cryptography-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ] + } + ] + }, + { + "conditions": [], + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error" + } + ] + }, + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + } + ], + "type": "tree", + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsFIPS" + ] + } + ] + } + ], + "type": "tree", + "rules": [ + { + "conditions": [], + "type": "tree", + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://controlplane.payment-cryptography-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ] + } + ] + }, + { + "conditions": [], + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error" + } + ] + }, + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "type": "tree", + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsDualStack" + ] + } + ] + } + ], + "type": "tree", + "rules": [ + { + "conditions": [], + "type": "tree", + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://controlplane.payment-cryptography.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ] + } + ] + }, + { + "conditions": [], + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error" + } + ] + }, + { + "conditions": [], + "type": "tree", + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://controlplane.payment-cryptography.{Region}.{PartitionResult#dnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ] + } + ] + } + ] + }, + { + "conditions": [], + "error": "Invalid Configuration: Missing Region", + "type": "error" + } + ] + } + ] + }, + "smithy.rules#endpointTests": { + "testCases": [ + { + "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://controlplane.payment-cryptography-fips.us-gov-east-1.api.aws" + } + }, + "params": { + "UseFIPS": true, + "Region": "us-gov-east-1", + "UseDualStack": true + } + }, + { + "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://controlplane.payment-cryptography-fips.us-gov-east-1.amazonaws.com" + } + }, + "params": { + "UseFIPS": true, + "Region": "us-gov-east-1", + "UseDualStack": false + } + }, + { + "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://controlplane.payment-cryptography.us-gov-east-1.api.aws" + } + }, + "params": { + "UseFIPS": false, + "Region": "us-gov-east-1", + "UseDualStack": true + } + }, + { + "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://controlplane.payment-cryptography.us-gov-east-1.amazonaws.com" + } + }, + "params": { + "UseFIPS": false, + "Region": "us-gov-east-1", + "UseDualStack": false + } + }, + { + "documentation": "For region cn-north-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://controlplane.payment-cryptography-fips.cn-north-1.api.amazonwebservices.com.cn" + } + }, + "params": { + "UseFIPS": true, + "Region": "cn-north-1", + "UseDualStack": true + } + }, + { + "documentation": "For region cn-north-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://controlplane.payment-cryptography-fips.cn-north-1.amazonaws.com.cn" + } + }, + "params": { + "UseFIPS": true, + "Region": "cn-north-1", + "UseDualStack": false + } + }, + { + "documentation": "For region cn-north-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://controlplane.payment-cryptography.cn-north-1.api.amazonwebservices.com.cn" + } + }, + "params": { + "UseFIPS": false, + "Region": "cn-north-1", + "UseDualStack": true + } + }, + { + "documentation": "For region cn-north-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://controlplane.payment-cryptography.cn-north-1.amazonaws.com.cn" + } + }, + "params": { + "UseFIPS": false, + "Region": "cn-north-1", + "UseDualStack": false + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "error": "FIPS and DualStack are enabled, but this partition does not support one or both" + }, + "params": { + "UseFIPS": true, + "Region": "us-iso-east-1", + "UseDualStack": true + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://controlplane.payment-cryptography-fips.us-iso-east-1.c2s.ic.gov" + } + }, + "params": { + "UseFIPS": true, + "Region": "us-iso-east-1", + "UseDualStack": false + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "error": "DualStack is enabled but this partition does not support DualStack" + }, + "params": { + "UseFIPS": false, + "Region": "us-iso-east-1", + "UseDualStack": true + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://controlplane.payment-cryptography.us-iso-east-1.c2s.ic.gov" + } + }, + "params": { + "UseFIPS": false, + "Region": "us-iso-east-1", + "UseDualStack": false + } + }, + { + "documentation": "For region us-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://controlplane.payment-cryptography-fips.us-east-1.api.aws" + } + }, + "params": { + "UseFIPS": true, + "Region": "us-east-1", + "UseDualStack": true + } + }, + { + "documentation": "For region us-east-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://controlplane.payment-cryptography-fips.us-east-1.amazonaws.com" + } + }, + "params": { + "UseFIPS": true, + "Region": "us-east-1", + "UseDualStack": false + } + }, + { + "documentation": "For region us-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://controlplane.payment-cryptography.us-east-1.api.aws" + } + }, + "params": { + "UseFIPS": false, + "Region": "us-east-1", + "UseDualStack": true + } + }, + { + "documentation": "For region us-east-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://controlplane.payment-cryptography.us-east-1.amazonaws.com" + } + }, + "params": { + "UseFIPS": false, + "Region": "us-east-1", + "UseDualStack": false + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "error": "FIPS and DualStack are enabled, but this partition does not support one or both" + }, + "params": { + "UseFIPS": true, + "Region": "us-isob-east-1", + "UseDualStack": true + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://controlplane.payment-cryptography-fips.us-isob-east-1.sc2s.sgov.gov" + } + }, + "params": { + "UseFIPS": true, + "Region": "us-isob-east-1", + "UseDualStack": false + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "error": "DualStack is enabled but this partition does not support DualStack" + }, + "params": { + "UseFIPS": false, + "Region": "us-isob-east-1", + "UseDualStack": true + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://controlplane.payment-cryptography.us-isob-east-1.sc2s.sgov.gov" + } + }, + "params": { + "UseFIPS": false, + "Region": "us-isob-east-1", + "UseDualStack": false + } + }, + { + "documentation": "For custom endpoint with fips disabled and dualstack disabled", + "expect": { + "endpoint": { + "url": "https://example.com" + } + }, + "params": { + "UseFIPS": false, + "Region": "us-east-1", + "UseDualStack": false, + "Endpoint": "https://example.com" + } + }, + { + "documentation": "For custom endpoint with fips enabled and dualstack disabled", + "expect": { + "error": "Invalid Configuration: FIPS and custom endpoint are not supported" + }, + "params": { + "UseFIPS": true, + "Region": "us-east-1", + "UseDualStack": false, + "Endpoint": "https://example.com" + } + }, + { + "documentation": "For custom endpoint with fips disabled and dualstack enabled", + "expect": { + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported" + }, + "params": { + "UseFIPS": false, + "Region": "us-east-1", + "UseDualStack": true, + "Endpoint": "https://example.com" + } + } + ], + "version": "1.0" + } + } + }, + "com.amazonaws.paymentcryptography#ResourceArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 70, + "max": 150 + }, + "smithy.api#pattern": "^arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:key/[0-9a-zA-Z]{16,64}$" + } + }, + "com.amazonaws.paymentcryptography#ResourceNotFoundException": { + "type": "structure", + "members": { + "ResourceId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The string for the exception.

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

The request was denied due to an invalid resource error.

", + "smithy.api#error": "client", + "smithy.api#httpError": 404 + } + }, + "com.amazonaws.paymentcryptography#RestoreKey": { + "type": "operation", + "input": { + "target": "com.amazonaws.paymentcryptography#RestoreKeyInput" + }, + "output": { + "target": "com.amazonaws.paymentcryptography#RestoreKeyOutput" + }, + "errors": [ + { + "target": "com.amazonaws.paymentcryptography#AccessDeniedException" + }, + { + "target": "com.amazonaws.paymentcryptography#ConflictException" + }, + { + "target": "com.amazonaws.paymentcryptography#InternalServerException" + }, + { + "target": "com.amazonaws.paymentcryptography#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceUnavailableException" + }, + { + "target": "com.amazonaws.paymentcryptography#ThrottlingException" + }, + { + "target": "com.amazonaws.paymentcryptography#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "smithy.api#documentation": "

Cancels a scheduled key deletion during the waiting period. Use this operation to restore a Key that is scheduled for deletion.

\n

During the waiting period, the KeyState is DELETE_PENDING and deletePendingTimestamp contains the date and time after which the Key will be deleted.\n After Key is restored, the KeyState is CREATE_COMPLETE, and the value for deletePendingTimestamp is removed.

\n

\n Cross-account use: This operation can't be used across different Amazon Web Services accounts.

\n

\n Related operations:\n

\n " + } + }, + "com.amazonaws.paymentcryptography#RestoreKeyInput": { + "type": "structure", + "members": { + "KeyIdentifier": { + "target": "com.amazonaws.paymentcryptography#KeyArnOrKeyAliasType", + "traits": { + "smithy.api#documentation": "

The KeyARN of the key to be restored within Amazon Web Services Payment Cryptography.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.paymentcryptography#RestoreKeyOutput": { + "type": "structure", + "members": { + "Key": { + "target": "com.amazonaws.paymentcryptography#Key", + "traits": { + "smithy.api#documentation": "

The key material of the restored key. The KeyState will change to CREATE_COMPLETE and value for DeletePendingTimestamp gets removed.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.paymentcryptography#RootCertificatePublicKey": { + "type": "structure", + "members": { + "KeyAttributes": { + "target": "com.amazonaws.paymentcryptography#KeyAttributes", + "traits": { + "smithy.api#documentation": "

The role of the key, the algorithm it supports, and the cryptographic operations allowed with the key. This data is immutable after the root public key is imported.

", + "smithy.api#required": {} + } + }, + "PublicKeyCertificate": { + "target": "com.amazonaws.paymentcryptography#CertificateType", + "traits": { + "smithy.api#documentation": "

Parameter information for root public key certificate import.

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

Parameter information for root public key certificate import.

" + } + }, + "com.amazonaws.paymentcryptography#ServiceQuotaExceededException": { + "type": "structure", + "members": { + "Message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

This request would cause a service quota to be exceeded.

", + "smithy.api#error": "client", + "smithy.api#httpError": 402 + } + }, + "com.amazonaws.paymentcryptography#ServiceUnavailableException": { + "type": "structure", + "members": { + "Message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

The service cannot complete the request.

", + "smithy.api#error": "server", + "smithy.api#httpError": 503 + } + }, + "com.amazonaws.paymentcryptography#StartKeyUsage": { + "type": "operation", + "input": { + "target": "com.amazonaws.paymentcryptography#StartKeyUsageInput" + }, + "output": { + "target": "com.amazonaws.paymentcryptography#StartKeyUsageOutput" + }, + "errors": [ + { + "target": "com.amazonaws.paymentcryptography#AccessDeniedException" + }, + { + "target": "com.amazonaws.paymentcryptography#ConflictException" + }, + { + "target": "com.amazonaws.paymentcryptography#InternalServerException" + }, + { + "target": "com.amazonaws.paymentcryptography#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceUnavailableException" + }, + { + "target": "com.amazonaws.paymentcryptography#ThrottlingException" + }, + { + "target": "com.amazonaws.paymentcryptography#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "smithy.api#documentation": "

Enables an Amazon Web Services Payment Cryptography key, which makes it active for cryptographic operations within Amazon Web Services Payment Cryptography

\n

\n Cross-account use: This operation can't be used across different Amazon Web Services accounts.

\n

\n Related operations:\n

\n " + } + }, + "com.amazonaws.paymentcryptography#StartKeyUsageInput": { + "type": "structure", + "members": { + "KeyIdentifier": { + "target": "com.amazonaws.paymentcryptography#KeyArnOrKeyAliasType", + "traits": { + "smithy.api#documentation": "

The KeyArn of the key.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.paymentcryptography#StartKeyUsageOutput": { + "type": "structure", + "members": { + "Key": { + "target": "com.amazonaws.paymentcryptography#Key", + "traits": { + "smithy.api#documentation": "

The KeyARN of the Amazon Web Services Payment Cryptography key activated for use.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.paymentcryptography#StopKeyUsage": { + "type": "operation", + "input": { + "target": "com.amazonaws.paymentcryptography#StopKeyUsageInput" + }, + "output": { + "target": "com.amazonaws.paymentcryptography#StopKeyUsageOutput" + }, + "errors": [ + { + "target": "com.amazonaws.paymentcryptography#AccessDeniedException" + }, + { + "target": "com.amazonaws.paymentcryptography#ConflictException" + }, + { + "target": "com.amazonaws.paymentcryptography#InternalServerException" + }, + { + "target": "com.amazonaws.paymentcryptography#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceUnavailableException" + }, + { + "target": "com.amazonaws.paymentcryptography#ThrottlingException" + }, + { + "target": "com.amazonaws.paymentcryptography#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "smithy.api#documentation": "

Disables an Amazon Web Services Payment Cryptography key, which makes it inactive within Amazon Web Services Payment Cryptography.

\n

You can use this operation instead of DeleteKey to deactivate a key. You can enable the key in the future by calling StartKeyUsage.

\n

\n Cross-account use: This operation can't be used across different Amazon Web Services accounts.

\n

\n Related operations:\n

\n " + } + }, + "com.amazonaws.paymentcryptography#StopKeyUsageInput": { + "type": "structure", + "members": { + "KeyIdentifier": { + "target": "com.amazonaws.paymentcryptography#KeyArnOrKeyAliasType", + "traits": { + "smithy.api#documentation": "

The KeyArn of the key.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.paymentcryptography#StopKeyUsageOutput": { + "type": "structure", + "members": { + "Key": { + "target": "com.amazonaws.paymentcryptography#Key", + "traits": { + "smithy.api#documentation": "

The KeyARN of the key.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.paymentcryptography#Tag": { + "type": "structure", + "members": { + "Key": { + "target": "com.amazonaws.paymentcryptography#TagKey", + "traits": { + "smithy.api#documentation": "

The key of the tag.

", + "smithy.api#required": {} + } + }, + "Value": { + "target": "com.amazonaws.paymentcryptography#TagValue", + "traits": { + "smithy.api#documentation": "

The value of the tag.

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

A structure that contains information about a tag.

" + } + }, + "com.amazonaws.paymentcryptography#TagKey": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 128 + } + } + }, + "com.amazonaws.paymentcryptography#TagKeys": { + "type": "list", + "member": { + "target": "com.amazonaws.paymentcryptography#TagKey" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 200 + } + } + }, + "com.amazonaws.paymentcryptography#TagResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.paymentcryptography#TagResourceInput" + }, + "output": { + "target": "com.amazonaws.paymentcryptography#TagResourceOutput" + }, + "errors": [ + { + "target": "com.amazonaws.paymentcryptography#AccessDeniedException" + }, + { + "target": "com.amazonaws.paymentcryptography#ConflictException" + }, + { + "target": "com.amazonaws.paymentcryptography#InternalServerException" + }, + { + "target": "com.amazonaws.paymentcryptography#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceUnavailableException" + }, + { + "target": "com.amazonaws.paymentcryptography#ThrottlingException" + }, + { + "target": "com.amazonaws.paymentcryptography#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "smithy.api#documentation": "

Adds or edits tags on an Amazon Web Services Payment Cryptography key.

\n \n

Tagging or untagging an Amazon Web Services Payment Cryptography key can allow or deny permission to the key.

\n
\n

Each tag consists of a tag key and a tag value, both of which are case-sensitive strings. The tag value can be an empty (null) string. To add a tag, specify a new tag key and a tag value. To edit a tag, specify an existing tag key and a new tag value. You can also add tags to an Amazon Web Services Payment Cryptography key when you create it with CreateKey.

\n

\n Cross-account use: This operation can't be used across different Amazon Web Services accounts.

\n

\n Related operations:\n

\n " + } + }, + "com.amazonaws.paymentcryptography#TagResourceInput": { + "type": "structure", + "members": { + "ResourceArn": { + "target": "com.amazonaws.paymentcryptography#ResourceArn", + "traits": { + "smithy.api#documentation": "

The KeyARN of the key whose tags are being updated.

", + "smithy.api#required": {} + } + }, + "Tags": { + "target": "com.amazonaws.paymentcryptography#Tags", + "traits": { + "smithy.api#documentation": "

One or more tags. Each tag consists of a tag key and a tag value. The tag value can be an empty (null) string. You can't have more than one tag on an Amazon Web Services Payment Cryptography key with the same tag key. If you specify an existing tag key with a different tag value, Amazon Web Services Payment Cryptography replaces the current tag value with the new one.

\n \n

Don't include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.

\n
\n

To use this parameter, you must have TagResource permission in an IAM policy.

\n \n

Don't include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.

\n
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.paymentcryptography#TagResourceOutput": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.paymentcryptography#TagValue": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 256 + } + } + }, + "com.amazonaws.paymentcryptography#Tags": { + "type": "list", + "member": { + "target": "com.amazonaws.paymentcryptography#Tag" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 200 + } + } + }, + "com.amazonaws.paymentcryptography#ThrottlingException": { + "type": "structure", + "members": { + "Message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

The request was denied due to request throttling.

", + "smithy.api#error": "client", + "smithy.api#httpError": 429 + } + }, + "com.amazonaws.paymentcryptography#Timestamp": { + "type": "timestamp" + }, + "com.amazonaws.paymentcryptography#Tr31WrappedKeyBlock": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 56, + "max": 9984 + }, + "smithy.api#pattern": "^[0-9A-Z]+$" + } + }, + "com.amazonaws.paymentcryptography#Tr34KeyBlockFormat": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "X9_TR34_2012", + "name": "X9_TR34_2012" + } + ] + } + }, + "com.amazonaws.paymentcryptography#Tr34WrappedKeyBlock": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 2, + "max": 4096 + }, + "smithy.api#pattern": "^[0-9A-F]+$" + } + }, + "com.amazonaws.paymentcryptography#TrustedCertificatePublicKey": { + "type": "structure", + "members": { + "KeyAttributes": { + "target": "com.amazonaws.paymentcryptography#KeyAttributes", + "traits": { + "smithy.api#documentation": "

The role of the key, the algorithm it supports, and the cryptographic operations allowed with the key. This data is immutable after a trusted public key is imported.

", + "smithy.api#required": {} + } + }, + "PublicKeyCertificate": { + "target": "com.amazonaws.paymentcryptography#CertificateType", + "traits": { + "smithy.api#documentation": "

Parameter information for trusted public key certificate import.

", + "smithy.api#required": {} + } + }, + "CertificateAuthorityPublicKeyIdentifier": { + "target": "com.amazonaws.paymentcryptography#KeyArnOrKeyAliasType", + "traits": { + "smithy.api#documentation": "

The KeyARN of the root public key certificate or certificate chain that signs the trusted public key certificate import.

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

Parameter information for trusted public key certificate import.

" + } + }, + "com.amazonaws.paymentcryptography#UntagResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.paymentcryptography#UntagResourceInput" + }, + "output": { + "target": "com.amazonaws.paymentcryptography#UntagResourceOutput" + }, + "errors": [ + { + "target": "com.amazonaws.paymentcryptography#AccessDeniedException" + }, + { + "target": "com.amazonaws.paymentcryptography#ConflictException" + }, + { + "target": "com.amazonaws.paymentcryptography#InternalServerException" + }, + { + "target": "com.amazonaws.paymentcryptography#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceUnavailableException" + }, + { + "target": "com.amazonaws.paymentcryptography#ThrottlingException" + }, + { + "target": "com.amazonaws.paymentcryptography#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "smithy.api#documentation": "

Deletes a tag from an Amazon Web Services Payment Cryptography key.

\n \n

Tagging or untagging an Amazon Web Services Payment Cryptography key can allow or deny permission to the key.

\n
\n

\n Cross-account use: This operation can't be used across different Amazon Web Services accounts.

\n

\n Related operations:\n

\n " + } + }, + "com.amazonaws.paymentcryptography#UntagResourceInput": { + "type": "structure", + "members": { + "ResourceArn": { + "target": "com.amazonaws.paymentcryptography#ResourceArn", + "traits": { + "smithy.api#documentation": "

The KeyARN of the key whose tags are being removed.

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

One or more tag keys. Don't include the tag values.

\n

If the Amazon Web Services Payment Cryptography key doesn't have the specified tag key, Amazon Web Services Payment Cryptography doesn't throw an exception or return a response. To confirm that the operation succeeded, use the ListTagsForResource operation.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.paymentcryptography#UntagResourceOutput": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.paymentcryptography#UpdateAlias": { + "type": "operation", + "input": { + "target": "com.amazonaws.paymentcryptography#UpdateAliasInput" + }, + "output": { + "target": "com.amazonaws.paymentcryptography#UpdateAliasOutput" + }, + "errors": [ + { + "target": "com.amazonaws.paymentcryptography#AccessDeniedException" + }, + { + "target": "com.amazonaws.paymentcryptography#ConflictException" + }, + { + "target": "com.amazonaws.paymentcryptography#InternalServerException" + }, + { + "target": "com.amazonaws.paymentcryptography#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.paymentcryptography#ServiceUnavailableException" + }, + { + "target": "com.amazonaws.paymentcryptography#ThrottlingException" + }, + { + "target": "com.amazonaws.paymentcryptography#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "smithy.api#documentation": "

Associates an existing Amazon Web Services Payment Cryptography alias with a different key. Each alias is associated with only one Amazon Web Services Payment Cryptography key at a time, although a key can have multiple aliases. The alias and the Amazon Web Services Payment Cryptography key must be in the same Amazon Web Services account and Amazon Web Services Region

\n

\n Cross-account use: This operation can't be used across different Amazon Web Services accounts.

\n

\n Related operations:\n

\n " + } + }, + "com.amazonaws.paymentcryptography#UpdateAliasInput": { + "type": "structure", + "members": { + "AliasName": { + "target": "com.amazonaws.paymentcryptography#AliasName", + "traits": { + "smithy.api#documentation": "

The alias whose associated key is changing.

", + "smithy.api#required": {} + } + }, + "KeyArn": { + "target": "com.amazonaws.paymentcryptography#KeyArn", + "traits": { + "smithy.api#documentation": "

The KeyARN for the key that you are updating or removing from the alias.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.paymentcryptography#UpdateAliasOutput": { + "type": "structure", + "members": { + "Alias": { + "target": "com.amazonaws.paymentcryptography#Alias", + "traits": { + "smithy.api#documentation": "

The alias name.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.paymentcryptography#ValidationException": { + "type": "structure", + "members": { + "Message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

The request was denied due to an invalid request error.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.paymentcryptography#WrappedKey": { + "type": "structure", + "members": { + "WrappingKeyArn": { + "target": "com.amazonaws.paymentcryptography#KeyArn", + "traits": { + "smithy.api#documentation": "

The KeyARN of the wrapped key.

", + "smithy.api#required": {} + } + }, + "WrappedKeyMaterialFormat": { + "target": "com.amazonaws.paymentcryptography#WrappedKeyMaterialFormat", + "traits": { + "smithy.api#documentation": "

The key block format of a wrapped key.

", + "smithy.api#required": {} + } + }, + "KeyMaterial": { + "target": "com.amazonaws.paymentcryptography#KeyMaterial", + "traits": { + "smithy.api#documentation": "

Parameter information for generating a wrapped key using TR-31 or TR-34 standard.

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

Parameter information for generating a wrapped key using TR-31 or TR-34 standard.

" + } + }, + "com.amazonaws.paymentcryptography#WrappedKeyMaterialFormat": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "KEY_CRYPTOGRAM", + "name": "KEY_CRYPTOGRAM" + }, + { + "value": "TR31_KEY_BLOCK", + "name": "TR31_KEY_BLOCK" + }, + { + "value": "TR34_KEY_BLOCK", + "name": "TR34_KEY_BLOCK" + } + ] + } + } + } +}