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

+Amazon Web Services End User Messaging Social, also referred to as Social messaging, is a messaging service that enables +application developers to incorporate WhatsApp into their existing workflows. The Amazon Web Services End User Messaging Social API provides information about the +Amazon Web Services End User Messaging Social API resources, including supported HTTP methods, parameters, and schemas.

+

The Amazon Web Services End User Messaging Social API provides programmatic access to options that are unique to the WhatsApp Business Platform.

+

If you're new to the Amazon Web Services End User Messaging Social API, it's also helpful to review What is +Amazon Web Services End User Messaging Social in the Amazon Web Services End User Messaging Social User Guide. The +Amazon Web Services End User Messaging Social User Guide provides tutorials, code samples, and procedures that demonstrate how to use +Amazon Web Services End User Messaging Social API features programmatically and how to integrate functionality into applications. +The guide also provides key information, such as integration with other Amazon Web Services +services, and the quotas that apply to use of the service.

+

+Regional availability +

+

The Amazon Web Services End User Messaging Social API is available across several Amazon Web Services Regions and it provides a dedicated endpoint for each of these Regions. For a list of +all the Regions and endpoints where the API is currently available, see Amazon Web Services Service Endpoints and Amazon Web Services End User Messaging endpoints and quotas in the Amazon Web Services General Reference. To learn more about Amazon Web Services Regions, see +Managing +Amazon Web Services Regions in the Amazon Web Services General +Reference.

+

In each Region, Amazon Web Services maintains multiple Availability Zones. These +Availability Zones are physically isolated from each other, but are united by private, +low-latency, high-throughput, and highly redundant network connections. These Availability +Zones enable us to provide very high levels of availability and redundancy, while also +minimizing latency. To learn more about the number of Availability Zones that are available +in each Region, see Amazon Web Services Global Infrastructure. +

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-socialmessaging +using your favorite package manager: + +- `npm install @aws-sdk/client-socialmessaging` +- `yarn add @aws-sdk/client-socialmessaging` +- `pnpm add @aws-sdk/client-socialmessaging` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `SocialMessagingClient` and +the commands you need, for example `ListTagsForResourceCommand`: + +```js +// ES5 example +const { SocialMessagingClient, ListTagsForResourceCommand } = require("@aws-sdk/client-socialmessaging"); +``` + +```ts +// ES6+ example +import { SocialMessagingClient, ListTagsForResourceCommand } from "@aws-sdk/client-socialmessaging"; +``` + +### 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 SocialMessagingClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new ListTagsForResourceCommand(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-socialmessaging"; +const client = new AWS.SocialMessaging({ region: "REGION" }); + +// async/await. +try { + const data = await client.listTagsForResource(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .listTagsForResource(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.listTagsForResource(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-socialmessaging` 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) + +
+ +AssociateWhatsAppBusinessAccount + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/socialmessaging/command/AssociateWhatsAppBusinessAccountCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-socialmessaging/Interface/AssociateWhatsAppBusinessAccountCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-socialmessaging/Interface/AssociateWhatsAppBusinessAccountCommandOutput/) + +
+
+ +DeleteWhatsAppMessageMedia + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/socialmessaging/command/DeleteWhatsAppMessageMediaCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-socialmessaging/Interface/DeleteWhatsAppMessageMediaCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-socialmessaging/Interface/DeleteWhatsAppMessageMediaCommandOutput/) + +
+
+ +DisassociateWhatsAppBusinessAccount + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/socialmessaging/command/DisassociateWhatsAppBusinessAccountCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-socialmessaging/Interface/DisassociateWhatsAppBusinessAccountCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-socialmessaging/Interface/DisassociateWhatsAppBusinessAccountCommandOutput/) + +
+
+ +GetLinkedWhatsAppBusinessAccount + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/socialmessaging/command/GetLinkedWhatsAppBusinessAccountCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-socialmessaging/Interface/GetLinkedWhatsAppBusinessAccountCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-socialmessaging/Interface/GetLinkedWhatsAppBusinessAccountCommandOutput/) + +
+
+ +GetLinkedWhatsAppBusinessAccountPhoneNumber + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/socialmessaging/command/GetLinkedWhatsAppBusinessAccountPhoneNumberCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-socialmessaging/Interface/GetLinkedWhatsAppBusinessAccountPhoneNumberCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-socialmessaging/Interface/GetLinkedWhatsAppBusinessAccountPhoneNumberCommandOutput/) + +
+
+ +GetWhatsAppMessageMedia + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/socialmessaging/command/GetWhatsAppMessageMediaCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-socialmessaging/Interface/GetWhatsAppMessageMediaCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-socialmessaging/Interface/GetWhatsAppMessageMediaCommandOutput/) + +
+
+ +ListLinkedWhatsAppBusinessAccounts + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/socialmessaging/command/ListLinkedWhatsAppBusinessAccountsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-socialmessaging/Interface/ListLinkedWhatsAppBusinessAccountsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-socialmessaging/Interface/ListLinkedWhatsAppBusinessAccountsCommandOutput/) + +
+
+ +ListTagsForResource + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/socialmessaging/command/ListTagsForResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-socialmessaging/Interface/ListTagsForResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-socialmessaging/Interface/ListTagsForResourceCommandOutput/) + +
+
+ +PostWhatsAppMessageMedia + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/socialmessaging/command/PostWhatsAppMessageMediaCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-socialmessaging/Interface/PostWhatsAppMessageMediaCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-socialmessaging/Interface/PostWhatsAppMessageMediaCommandOutput/) + +
+
+ +PutWhatsAppBusinessAccountEventDestinations + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/socialmessaging/command/PutWhatsAppBusinessAccountEventDestinationsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-socialmessaging/Interface/PutWhatsAppBusinessAccountEventDestinationsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-socialmessaging/Interface/PutWhatsAppBusinessAccountEventDestinationsCommandOutput/) + +
+
+ +SendWhatsAppMessage + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/socialmessaging/command/SendWhatsAppMessageCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-socialmessaging/Interface/SendWhatsAppMessageCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-socialmessaging/Interface/SendWhatsAppMessageCommandOutput/) + +
+
+ +TagResource + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/socialmessaging/command/TagResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-socialmessaging/Interface/TagResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-socialmessaging/Interface/TagResourceCommandOutput/) + +
+
+ +UntagResource + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/socialmessaging/command/UntagResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-socialmessaging/Interface/UntagResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-socialmessaging/Interface/UntagResourceCommandOutput/) + +
diff --git a/clients/client-socialmessaging/api-extractor.json b/clients/client-socialmessaging/api-extractor.json new file mode 100644 index 000000000000..d5bf5ffeee85 --- /dev/null +++ b/clients/client-socialmessaging/api-extractor.json @@ -0,0 +1,4 @@ +{ + "extends": "../../api-extractor.json", + "mainEntryPointFilePath": "/dist-types/index.d.ts" +} diff --git a/clients/client-socialmessaging/package.json b/clients/client-socialmessaging/package.json new file mode 100644 index 000000000000..f306dcce2ce1 --- /dev/null +++ b/clients/client-socialmessaging/package.json @@ -0,0 +1,101 @@ +{ + "name": "@aws-sdk/client-socialmessaging", + "description": "AWS SDK for JavaScript Socialmessaging Client for Node.js, Browser and React Native", + "version": "3.0.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0", + "extract:docs": "api-extractor run --local", + "generate:client": "node ../../scripts/generate-clients/single-service --solo socialmessaging" + }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", + "sideEffects": false, + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "*", + "@aws-sdk/client-sts": "*", + "@aws-sdk/core": "*", + "@aws-sdk/credential-provider-node": "*", + "@aws-sdk/middleware-host-header": "*", + "@aws-sdk/middleware-logger": "*", + "@aws-sdk/middleware-recursion-detection": "*", + "@aws-sdk/middleware-user-agent": "*", + "@aws-sdk/region-config-resolver": "*", + "@aws-sdk/types": "*", + "@aws-sdk/util-endpoints": "*", + "@aws-sdk/util-user-agent-browser": "*", + "@aws-sdk/util-user-agent-node": "*", + "@smithy/config-resolver": "^3.0.9", + "@smithy/core": "^2.4.8", + "@smithy/fetch-http-handler": "^3.2.9", + "@smithy/hash-node": "^3.0.7", + "@smithy/invalid-dependency": "^3.0.7", + "@smithy/middleware-content-length": "^3.0.9", + "@smithy/middleware-endpoint": "^3.1.4", + "@smithy/middleware-retry": "^3.0.23", + "@smithy/middleware-serde": "^3.0.7", + "@smithy/middleware-stack": "^3.0.7", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/node-http-handler": "^3.2.4", + "@smithy/protocol-http": "^4.1.4", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", + "@smithy/url-parser": "^3.0.7", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.23", + "@smithy/util-defaults-mode-node": "^3.0.23", + "@smithy/util-endpoints": "^2.1.3", + "@smithy/util-middleware": "^3.0.7", + "@smithy/util-retry": "^3.0.7", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "devDependencies": { + "@tsconfig/node16": "16.1.3", + "@types/node": "^16.18.96", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typescript": "~4.9.5" + }, + "engines": { + "node": ">=16.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*/**" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-socialmessaging", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "clients/client-socialmessaging" + } +} diff --git a/clients/client-socialmessaging/src/SocialMessaging.ts b/clients/client-socialmessaging/src/SocialMessaging.ts new file mode 100644 index 000000000000..8dca208e4471 --- /dev/null +++ b/clients/client-socialmessaging/src/SocialMessaging.ts @@ -0,0 +1,327 @@ +// smithy-typescript generated code +import { createAggregatedClient } from "@smithy/smithy-client"; +import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types"; + +import { + AssociateWhatsAppBusinessAccountCommand, + AssociateWhatsAppBusinessAccountCommandInput, + AssociateWhatsAppBusinessAccountCommandOutput, +} from "./commands/AssociateWhatsAppBusinessAccountCommand"; +import { + DeleteWhatsAppMessageMediaCommand, + DeleteWhatsAppMessageMediaCommandInput, + DeleteWhatsAppMessageMediaCommandOutput, +} from "./commands/DeleteWhatsAppMessageMediaCommand"; +import { + DisassociateWhatsAppBusinessAccountCommand, + DisassociateWhatsAppBusinessAccountCommandInput, + DisassociateWhatsAppBusinessAccountCommandOutput, +} from "./commands/DisassociateWhatsAppBusinessAccountCommand"; +import { + GetLinkedWhatsAppBusinessAccountCommand, + GetLinkedWhatsAppBusinessAccountCommandInput, + GetLinkedWhatsAppBusinessAccountCommandOutput, +} from "./commands/GetLinkedWhatsAppBusinessAccountCommand"; +import { + GetLinkedWhatsAppBusinessAccountPhoneNumberCommand, + GetLinkedWhatsAppBusinessAccountPhoneNumberCommandInput, + GetLinkedWhatsAppBusinessAccountPhoneNumberCommandOutput, +} from "./commands/GetLinkedWhatsAppBusinessAccountPhoneNumberCommand"; +import { + GetWhatsAppMessageMediaCommand, + GetWhatsAppMessageMediaCommandInput, + GetWhatsAppMessageMediaCommandOutput, +} from "./commands/GetWhatsAppMessageMediaCommand"; +import { + ListLinkedWhatsAppBusinessAccountsCommand, + ListLinkedWhatsAppBusinessAccountsCommandInput, + ListLinkedWhatsAppBusinessAccountsCommandOutput, +} from "./commands/ListLinkedWhatsAppBusinessAccountsCommand"; +import { + ListTagsForResourceCommand, + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "./commands/ListTagsForResourceCommand"; +import { + PostWhatsAppMessageMediaCommand, + PostWhatsAppMessageMediaCommandInput, + PostWhatsAppMessageMediaCommandOutput, +} from "./commands/PostWhatsAppMessageMediaCommand"; +import { + PutWhatsAppBusinessAccountEventDestinationsCommand, + PutWhatsAppBusinessAccountEventDestinationsCommandInput, + PutWhatsAppBusinessAccountEventDestinationsCommandOutput, +} from "./commands/PutWhatsAppBusinessAccountEventDestinationsCommand"; +import { + SendWhatsAppMessageCommand, + SendWhatsAppMessageCommandInput, + SendWhatsAppMessageCommandOutput, +} from "./commands/SendWhatsAppMessageCommand"; +import { TagResourceCommand, TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand"; +import { + UntagResourceCommand, + UntagResourceCommandInput, + UntagResourceCommandOutput, +} from "./commands/UntagResourceCommand"; +import { SocialMessagingClient, SocialMessagingClientConfig } from "./SocialMessagingClient"; + +const commands = { + AssociateWhatsAppBusinessAccountCommand, + DeleteWhatsAppMessageMediaCommand, + DisassociateWhatsAppBusinessAccountCommand, + GetLinkedWhatsAppBusinessAccountCommand, + GetLinkedWhatsAppBusinessAccountPhoneNumberCommand, + GetWhatsAppMessageMediaCommand, + ListLinkedWhatsAppBusinessAccountsCommand, + ListTagsForResourceCommand, + PostWhatsAppMessageMediaCommand, + PutWhatsAppBusinessAccountEventDestinationsCommand, + SendWhatsAppMessageCommand, + TagResourceCommand, + UntagResourceCommand, +}; + +export interface SocialMessaging { + /** + * @see {@link AssociateWhatsAppBusinessAccountCommand} + */ + associateWhatsAppBusinessAccount(): Promise; + associateWhatsAppBusinessAccount( + args: AssociateWhatsAppBusinessAccountCommandInput, + options?: __HttpHandlerOptions + ): Promise; + associateWhatsAppBusinessAccount( + args: AssociateWhatsAppBusinessAccountCommandInput, + cb: (err: any, data?: AssociateWhatsAppBusinessAccountCommandOutput) => void + ): void; + associateWhatsAppBusinessAccount( + args: AssociateWhatsAppBusinessAccountCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: AssociateWhatsAppBusinessAccountCommandOutput) => void + ): void; + + /** + * @see {@link DeleteWhatsAppMessageMediaCommand} + */ + deleteWhatsAppMessageMedia( + args: DeleteWhatsAppMessageMediaCommandInput, + options?: __HttpHandlerOptions + ): Promise; + deleteWhatsAppMessageMedia( + args: DeleteWhatsAppMessageMediaCommandInput, + cb: (err: any, data?: DeleteWhatsAppMessageMediaCommandOutput) => void + ): void; + deleteWhatsAppMessageMedia( + args: DeleteWhatsAppMessageMediaCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteWhatsAppMessageMediaCommandOutput) => void + ): void; + + /** + * @see {@link DisassociateWhatsAppBusinessAccountCommand} + */ + disassociateWhatsAppBusinessAccount( + args: DisassociateWhatsAppBusinessAccountCommandInput, + options?: __HttpHandlerOptions + ): Promise; + disassociateWhatsAppBusinessAccount( + args: DisassociateWhatsAppBusinessAccountCommandInput, + cb: (err: any, data?: DisassociateWhatsAppBusinessAccountCommandOutput) => void + ): void; + disassociateWhatsAppBusinessAccount( + args: DisassociateWhatsAppBusinessAccountCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DisassociateWhatsAppBusinessAccountCommandOutput) => void + ): void; + + /** + * @see {@link GetLinkedWhatsAppBusinessAccountCommand} + */ + getLinkedWhatsAppBusinessAccount( + args: GetLinkedWhatsAppBusinessAccountCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getLinkedWhatsAppBusinessAccount( + args: GetLinkedWhatsAppBusinessAccountCommandInput, + cb: (err: any, data?: GetLinkedWhatsAppBusinessAccountCommandOutput) => void + ): void; + getLinkedWhatsAppBusinessAccount( + args: GetLinkedWhatsAppBusinessAccountCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetLinkedWhatsAppBusinessAccountCommandOutput) => void + ): void; + + /** + * @see {@link GetLinkedWhatsAppBusinessAccountPhoneNumberCommand} + */ + getLinkedWhatsAppBusinessAccountPhoneNumber( + args: GetLinkedWhatsAppBusinessAccountPhoneNumberCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getLinkedWhatsAppBusinessAccountPhoneNumber( + args: GetLinkedWhatsAppBusinessAccountPhoneNumberCommandInput, + cb: (err: any, data?: GetLinkedWhatsAppBusinessAccountPhoneNumberCommandOutput) => void + ): void; + getLinkedWhatsAppBusinessAccountPhoneNumber( + args: GetLinkedWhatsAppBusinessAccountPhoneNumberCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetLinkedWhatsAppBusinessAccountPhoneNumberCommandOutput) => void + ): void; + + /** + * @see {@link GetWhatsAppMessageMediaCommand} + */ + getWhatsAppMessageMedia( + args: GetWhatsAppMessageMediaCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getWhatsAppMessageMedia( + args: GetWhatsAppMessageMediaCommandInput, + cb: (err: any, data?: GetWhatsAppMessageMediaCommandOutput) => void + ): void; + getWhatsAppMessageMedia( + args: GetWhatsAppMessageMediaCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetWhatsAppMessageMediaCommandOutput) => void + ): void; + + /** + * @see {@link ListLinkedWhatsAppBusinessAccountsCommand} + */ + listLinkedWhatsAppBusinessAccounts(): Promise; + listLinkedWhatsAppBusinessAccounts( + args: ListLinkedWhatsAppBusinessAccountsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listLinkedWhatsAppBusinessAccounts( + args: ListLinkedWhatsAppBusinessAccountsCommandInput, + cb: (err: any, data?: ListLinkedWhatsAppBusinessAccountsCommandOutput) => void + ): void; + listLinkedWhatsAppBusinessAccounts( + args: ListLinkedWhatsAppBusinessAccountsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListLinkedWhatsAppBusinessAccountsCommandOutput) => 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 PostWhatsAppMessageMediaCommand} + */ + postWhatsAppMessageMedia( + args: PostWhatsAppMessageMediaCommandInput, + options?: __HttpHandlerOptions + ): Promise; + postWhatsAppMessageMedia( + args: PostWhatsAppMessageMediaCommandInput, + cb: (err: any, data?: PostWhatsAppMessageMediaCommandOutput) => void + ): void; + postWhatsAppMessageMedia( + args: PostWhatsAppMessageMediaCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: PostWhatsAppMessageMediaCommandOutput) => void + ): void; + + /** + * @see {@link PutWhatsAppBusinessAccountEventDestinationsCommand} + */ + putWhatsAppBusinessAccountEventDestinations( + args: PutWhatsAppBusinessAccountEventDestinationsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + putWhatsAppBusinessAccountEventDestinations( + args: PutWhatsAppBusinessAccountEventDestinationsCommandInput, + cb: (err: any, data?: PutWhatsAppBusinessAccountEventDestinationsCommandOutput) => void + ): void; + putWhatsAppBusinessAccountEventDestinations( + args: PutWhatsAppBusinessAccountEventDestinationsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: PutWhatsAppBusinessAccountEventDestinationsCommandOutput) => void + ): void; + + /** + * @see {@link SendWhatsAppMessageCommand} + */ + sendWhatsAppMessage( + args: SendWhatsAppMessageCommandInput, + options?: __HttpHandlerOptions + ): Promise; + sendWhatsAppMessage( + args: SendWhatsAppMessageCommandInput, + cb: (err: any, data?: SendWhatsAppMessageCommandOutput) => void + ): void; + sendWhatsAppMessage( + args: SendWhatsAppMessageCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: SendWhatsAppMessageCommandOutput) => 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; +} + +/** + *

+ * Amazon Web Services End User Messaging Social, also referred to as Social messaging, is a messaging service that enables + * application developers to incorporate WhatsApp into their existing workflows. The Amazon Web Services End User Messaging Social API provides information about the + * Amazon Web Services End User Messaging Social API resources, including supported HTTP methods, parameters, and schemas.

+ *

The Amazon Web Services End User Messaging Social API provides programmatic access to options that are unique to the WhatsApp Business Platform.

+ *

If you're new to the Amazon Web Services End User Messaging Social API, it's also helpful to review What is + * Amazon Web Services End User Messaging Social in the Amazon Web Services End User Messaging Social User Guide. The + * Amazon Web Services End User Messaging Social User Guide provides tutorials, code samples, and procedures that demonstrate how to use + * Amazon Web Services End User Messaging Social API features programmatically and how to integrate functionality into applications. + * The guide also provides key information, such as integration with other Amazon Web Services + * services, and the quotas that apply to use of the service.

+ *

+ * Regional availability + *

+ *

The Amazon Web Services End User Messaging Social API is available across several Amazon Web Services Regions and it provides a dedicated endpoint for each of these Regions. For a list of + * all the Regions and endpoints where the API is currently available, see Amazon Web Services Service Endpoints and Amazon Web Services End User Messaging endpoints and quotas in the Amazon Web Services General Reference. To learn more about Amazon Web Services Regions, see + * Managing + * Amazon Web Services Regions in the Amazon Web Services General + * Reference.

+ *

In each Region, Amazon Web Services maintains multiple Availability Zones. These + * Availability Zones are physically isolated from each other, but are united by private, + * low-latency, high-throughput, and highly redundant network connections. These Availability + * Zones enable us to provide very high levels of availability and redundancy, while also + * minimizing latency. To learn more about the number of Availability Zones that are available + * in each Region, see Amazon Web Services Global Infrastructure. + *

+ * @public + */ +export class SocialMessaging extends SocialMessagingClient implements SocialMessaging {} +createAggregatedClient(commands, SocialMessaging); diff --git a/clients/client-socialmessaging/src/SocialMessagingClient.ts b/clients/client-socialmessaging/src/SocialMessagingClient.ts new file mode 100644 index 000000000000..e5d1b08be065 --- /dev/null +++ b/clients/client-socialmessaging/src/SocialMessagingClient.ts @@ -0,0 +1,398 @@ +// smithy-typescript generated code +import { + getHostHeaderPlugin, + HostHeaderInputConfig, + HostHeaderResolvedConfig, + resolveHostHeaderConfig, +} from "@aws-sdk/middleware-host-header"; +import { getLoggerPlugin } from "@aws-sdk/middleware-logger"; +import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection"; +import { + getUserAgentPlugin, + resolveUserAgentConfig, + UserAgentInputConfig, + UserAgentResolvedConfig, +} from "@aws-sdk/middleware-user-agent"; +import { RegionInputConfig, RegionResolvedConfig, resolveRegionConfig } from "@smithy/config-resolver"; +import { + DefaultIdentityProviderConfig, + getHttpAuthSchemeEndpointRuleSetPlugin, + getHttpSigningPlugin, +} from "@smithy/core"; +import { getContentLengthPlugin } from "@smithy/middleware-content-length"; +import { EndpointInputConfig, EndpointResolvedConfig, resolveEndpointConfig } from "@smithy/middleware-endpoint"; +import { getRetryPlugin, resolveRetryConfig, RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry"; +import { HttpHandlerUserInput as __HttpHandlerUserInput } from "@smithy/protocol-http"; +import { + Client as __Client, + DefaultsMode as __DefaultsMode, + SmithyConfiguration as __SmithyConfiguration, + SmithyResolvedConfiguration as __SmithyResolvedConfiguration, +} from "@smithy/smithy-client"; +import { + AwsCredentialIdentityProvider, + BodyLengthCalculator as __BodyLengthCalculator, + CheckOptionalClientConfig as __CheckOptionalClientConfig, + ChecksumConstructor as __ChecksumConstructor, + Decoder as __Decoder, + Encoder as __Encoder, + EndpointV2 as __EndpointV2, + HashConstructor as __HashConstructor, + HttpHandlerOptions as __HttpHandlerOptions, + Logger as __Logger, + Provider as __Provider, + Provider, + StreamCollector as __StreamCollector, + UrlParser as __UrlParser, + UserAgent as __UserAgent, +} from "@smithy/types"; + +import { + defaultSocialMessagingHttpAuthSchemeParametersProvider, + HttpAuthSchemeInputConfig, + HttpAuthSchemeResolvedConfig, + resolveHttpAuthSchemeConfig, +} from "./auth/httpAuthSchemeProvider"; +import { + AssociateWhatsAppBusinessAccountCommandInput, + AssociateWhatsAppBusinessAccountCommandOutput, +} from "./commands/AssociateWhatsAppBusinessAccountCommand"; +import { + DeleteWhatsAppMessageMediaCommandInput, + DeleteWhatsAppMessageMediaCommandOutput, +} from "./commands/DeleteWhatsAppMessageMediaCommand"; +import { + DisassociateWhatsAppBusinessAccountCommandInput, + DisassociateWhatsAppBusinessAccountCommandOutput, +} from "./commands/DisassociateWhatsAppBusinessAccountCommand"; +import { + GetLinkedWhatsAppBusinessAccountCommandInput, + GetLinkedWhatsAppBusinessAccountCommandOutput, +} from "./commands/GetLinkedWhatsAppBusinessAccountCommand"; +import { + GetLinkedWhatsAppBusinessAccountPhoneNumberCommandInput, + GetLinkedWhatsAppBusinessAccountPhoneNumberCommandOutput, +} from "./commands/GetLinkedWhatsAppBusinessAccountPhoneNumberCommand"; +import { + GetWhatsAppMessageMediaCommandInput, + GetWhatsAppMessageMediaCommandOutput, +} from "./commands/GetWhatsAppMessageMediaCommand"; +import { + ListLinkedWhatsAppBusinessAccountsCommandInput, + ListLinkedWhatsAppBusinessAccountsCommandOutput, +} from "./commands/ListLinkedWhatsAppBusinessAccountsCommand"; +import { + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "./commands/ListTagsForResourceCommand"; +import { + PostWhatsAppMessageMediaCommandInput, + PostWhatsAppMessageMediaCommandOutput, +} from "./commands/PostWhatsAppMessageMediaCommand"; +import { + PutWhatsAppBusinessAccountEventDestinationsCommandInput, + PutWhatsAppBusinessAccountEventDestinationsCommandOutput, +} from "./commands/PutWhatsAppBusinessAccountEventDestinationsCommand"; +import { + SendWhatsAppMessageCommandInput, + SendWhatsAppMessageCommandOutput, +} from "./commands/SendWhatsAppMessageCommand"; +import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand"; +import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand"; +import { + ClientInputEndpointParameters, + ClientResolvedEndpointParameters, + EndpointParameters, + resolveClientEndpointParameters, +} from "./endpoint/EndpointParameters"; +import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig"; +import { resolveRuntimeExtensions, RuntimeExtension, RuntimeExtensionsConfig } from "./runtimeExtensions"; + +export { __Client }; + +/** + * @public + */ +export type ServiceInputTypes = + | AssociateWhatsAppBusinessAccountCommandInput + | DeleteWhatsAppMessageMediaCommandInput + | DisassociateWhatsAppBusinessAccountCommandInput + | GetLinkedWhatsAppBusinessAccountCommandInput + | GetLinkedWhatsAppBusinessAccountPhoneNumberCommandInput + | GetWhatsAppMessageMediaCommandInput + | ListLinkedWhatsAppBusinessAccountsCommandInput + | ListTagsForResourceCommandInput + | PostWhatsAppMessageMediaCommandInput + | PutWhatsAppBusinessAccountEventDestinationsCommandInput + | SendWhatsAppMessageCommandInput + | TagResourceCommandInput + | UntagResourceCommandInput; + +/** + * @public + */ +export type ServiceOutputTypes = + | AssociateWhatsAppBusinessAccountCommandOutput + | DeleteWhatsAppMessageMediaCommandOutput + | DisassociateWhatsAppBusinessAccountCommandOutput + | GetLinkedWhatsAppBusinessAccountCommandOutput + | GetLinkedWhatsAppBusinessAccountPhoneNumberCommandOutput + | GetWhatsAppMessageMediaCommandOutput + | ListLinkedWhatsAppBusinessAccountsCommandOutput + | ListTagsForResourceCommandOutput + | PostWhatsAppMessageMediaCommandOutput + | PutWhatsAppBusinessAccountEventDestinationsCommandOutput + | SendWhatsAppMessageCommandOutput + | TagResourceCommandOutput + | UntagResourceCommandOutput; + +/** + * @public + */ +export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHandlerOptions>> { + /** + * The HTTP handler to use or its constructor options. Fetch in browser and Https in Nodejs. + */ + requestHandler?: __HttpHandlerUserInput; + + /** + * A constructor for a class implementing the {@link @smithy/types#ChecksumConstructor} interface + * that computes the SHA-256 HMAC or checksum of a string or binary buffer. + * @internal + */ + sha256?: __ChecksumConstructor | __HashConstructor; + + /** + * The function that will be used to convert strings into HTTP endpoints. + * @internal + */ + urlParser?: __UrlParser; + + /** + * A function that can calculate the length of a request body. + * @internal + */ + bodyLengthChecker?: __BodyLengthCalculator; + + /** + * A function that converts a stream into an array of bytes. + * @internal + */ + streamCollector?: __StreamCollector; + + /** + * The function that will be used to convert a base64-encoded string to a byte array. + * @internal + */ + base64Decoder?: __Decoder; + + /** + * The function that will be used to convert binary data to a base64-encoded string. + * @internal + */ + base64Encoder?: __Encoder; + + /** + * The function that will be used to convert a UTF8-encoded string to a byte array. + * @internal + */ + utf8Decoder?: __Decoder; + + /** + * The function that will be used to convert binary data to a UTF-8 encoded string. + * @internal + */ + utf8Encoder?: __Encoder; + + /** + * The runtime environment. + * @internal + */ + runtime?: string; + + /** + * Disable dynamically changing the endpoint of the client based on the hostPrefix + * trait of an operation. + */ + disableHostPrefix?: boolean; + + /** + * Unique service identifier. + * @internal + */ + serviceId?: string; + + /** + * Enables IPv6/IPv4 dualstack endpoint. + */ + useDualstackEndpoint?: boolean | __Provider; + + /** + * Enables FIPS compatible endpoints. + */ + useFipsEndpoint?: boolean | __Provider; + + /** + * The AWS region to which this client will send requests + */ + region?: string | __Provider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; + + /** + * Default credentials provider; Not available in browser runtime. + * @deprecated + * @internal + */ + credentialDefaultProvider?: (input: any) => AwsCredentialIdentityProvider; + + /** + * Value for how many times a request will be made at most in case of retry. + */ + maxAttempts?: number | __Provider; + + /** + * Specifies which retry algorithm to use. + * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-smithy-util-retry/Enum/RETRY_MODES/ + * + */ + retryMode?: string | __Provider; + + /** + * Optional logger for logging debug/info/warn/error. + */ + logger?: __Logger; + + /** + * Optional extensions + */ + extensions?: RuntimeExtension[]; + + /** + * The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK. + */ + defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>; +} + +/** + * @public + */ +export type SocialMessagingClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & + ClientDefaults & + UserAgentInputConfig & + RetryInputConfig & + RegionInputConfig & + HostHeaderInputConfig & + EndpointInputConfig & + HttpAuthSchemeInputConfig & + ClientInputEndpointParameters; +/** + * @public + * + * The configuration interface of SocialMessagingClient class constructor that set the region, credentials and other options. + */ +export interface SocialMessagingClientConfig extends SocialMessagingClientConfigType {} + +/** + * @public + */ +export type SocialMessagingClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & + Required & + RuntimeExtensionsConfig & + UserAgentResolvedConfig & + RetryResolvedConfig & + RegionResolvedConfig & + HostHeaderResolvedConfig & + EndpointResolvedConfig & + HttpAuthSchemeResolvedConfig & + ClientResolvedEndpointParameters; +/** + * @public + * + * The resolved configuration interface of SocialMessagingClient class. This is resolved and normalized from the {@link SocialMessagingClientConfig | constructor configuration interface}. + */ +export interface SocialMessagingClientResolvedConfig extends SocialMessagingClientResolvedConfigType {} + +/** + *

+ * Amazon Web Services End User Messaging Social, also referred to as Social messaging, is a messaging service that enables + * application developers to incorporate WhatsApp into their existing workflows. The Amazon Web Services End User Messaging Social API provides information about the + * Amazon Web Services End User Messaging Social API resources, including supported HTTP methods, parameters, and schemas.

+ *

The Amazon Web Services End User Messaging Social API provides programmatic access to options that are unique to the WhatsApp Business Platform.

+ *

If you're new to the Amazon Web Services End User Messaging Social API, it's also helpful to review What is + * Amazon Web Services End User Messaging Social in the Amazon Web Services End User Messaging Social User Guide. The + * Amazon Web Services End User Messaging Social User Guide provides tutorials, code samples, and procedures that demonstrate how to use + * Amazon Web Services End User Messaging Social API features programmatically and how to integrate functionality into applications. + * The guide also provides key information, such as integration with other Amazon Web Services + * services, and the quotas that apply to use of the service.

+ *

+ * Regional availability + *

+ *

The Amazon Web Services End User Messaging Social API is available across several Amazon Web Services Regions and it provides a dedicated endpoint for each of these Regions. For a list of + * all the Regions and endpoints where the API is currently available, see Amazon Web Services Service Endpoints and Amazon Web Services End User Messaging endpoints and quotas in the Amazon Web Services General Reference. To learn more about Amazon Web Services Regions, see + * Managing + * Amazon Web Services Regions in the Amazon Web Services General + * Reference.

+ *

In each Region, Amazon Web Services maintains multiple Availability Zones. These + * Availability Zones are physically isolated from each other, but are united by private, + * low-latency, high-throughput, and highly redundant network connections. These Availability + * Zones enable us to provide very high levels of availability and redundancy, while also + * minimizing latency. To learn more about the number of Availability Zones that are available + * in each Region, see Amazon Web Services Global Infrastructure. + *

+ * @public + */ +export class SocialMessagingClient extends __Client< + __HttpHandlerOptions, + ServiceInputTypes, + ServiceOutputTypes, + SocialMessagingClientResolvedConfig +> { + /** + * The resolved configuration of SocialMessagingClient class. This is resolved and normalized from the {@link SocialMessagingClientConfig | constructor configuration interface}. + */ + readonly config: SocialMessagingClientResolvedConfig; + + constructor(...[configuration]: __CheckOptionalClientConfig) { + const _config_0 = __getRuntimeConfig(configuration || {}); + const _config_1 = resolveClientEndpointParameters(_config_0); + const _config_2 = resolveUserAgentConfig(_config_1); + const _config_3 = resolveRetryConfig(_config_2); + const _config_4 = resolveRegionConfig(_config_3); + const _config_5 = resolveHostHeaderConfig(_config_4); + const _config_6 = resolveEndpointConfig(_config_5); + const _config_7 = resolveHttpAuthSchemeConfig(_config_6); + const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []); + super(_config_8); + this.config = _config_8; + this.middlewareStack.use(getUserAgentPlugin(this.config)); + this.middlewareStack.use(getRetryPlugin(this.config)); + this.middlewareStack.use(getContentLengthPlugin(this.config)); + this.middlewareStack.use(getHostHeaderPlugin(this.config)); + this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getRecursionDetectionPlugin(this.config)); + this.middlewareStack.use( + getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { + httpAuthSchemeParametersProvider: defaultSocialMessagingHttpAuthSchemeParametersProvider, + identityProviderConfigProvider: async (config: SocialMessagingClientResolvedConfig) => + new DefaultIdentityProviderConfig({ + "aws.auth#sigv4": config.credentials, + }), + }) + ); + this.middlewareStack.use(getHttpSigningPlugin(this.config)); + } + + /** + * Destroy underlying resources, like sockets. It's usually not necessary to do this. + * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed. + * Otherwise, sockets might stay open for quite a long time before the server terminates them. + */ + destroy(): void { + super.destroy(); + } +} diff --git a/clients/client-socialmessaging/src/auth/httpAuthExtensionConfiguration.ts b/clients/client-socialmessaging/src/auth/httpAuthExtensionConfiguration.ts new file mode 100644 index 000000000000..fc62790ed916 --- /dev/null +++ b/clients/client-socialmessaging/src/auth/httpAuthExtensionConfiguration.ts @@ -0,0 +1,72 @@ +// smithy-typescript generated code +import { AwsCredentialIdentity, AwsCredentialIdentityProvider, HttpAuthScheme } from "@smithy/types"; + +import { SocialMessagingHttpAuthSchemeProvider } from "./httpAuthSchemeProvider"; + +/** + * @internal + */ +export interface HttpAuthExtensionConfiguration { + setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void; + httpAuthSchemes(): HttpAuthScheme[]; + setHttpAuthSchemeProvider(httpAuthSchemeProvider: SocialMessagingHttpAuthSchemeProvider): void; + httpAuthSchemeProvider(): SocialMessagingHttpAuthSchemeProvider; + setCredentials(credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider): void; + credentials(): AwsCredentialIdentity | AwsCredentialIdentityProvider | undefined; +} + +/** + * @internal + */ +export type HttpAuthRuntimeConfig = Partial<{ + httpAuthSchemes: HttpAuthScheme[]; + httpAuthSchemeProvider: SocialMessagingHttpAuthSchemeProvider; + credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider; +}>; + +/** + * @internal + */ +export const getHttpAuthExtensionConfiguration = ( + runtimeConfig: HttpAuthRuntimeConfig +): HttpAuthExtensionConfiguration => { + const _httpAuthSchemes = runtimeConfig.httpAuthSchemes!; + let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider!; + let _credentials = runtimeConfig.credentials; + return { + setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void { + const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); + if (index === -1) { + _httpAuthSchemes.push(httpAuthScheme); + } else { + _httpAuthSchemes.splice(index, 1, httpAuthScheme); + } + }, + httpAuthSchemes(): HttpAuthScheme[] { + return _httpAuthSchemes; + }, + setHttpAuthSchemeProvider(httpAuthSchemeProvider: SocialMessagingHttpAuthSchemeProvider): void { + _httpAuthSchemeProvider = httpAuthSchemeProvider; + }, + httpAuthSchemeProvider(): SocialMessagingHttpAuthSchemeProvider { + return _httpAuthSchemeProvider; + }, + setCredentials(credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider): void { + _credentials = credentials; + }, + credentials(): AwsCredentialIdentity | AwsCredentialIdentityProvider | undefined { + return _credentials; + }, + }; +}; + +/** + * @internal + */ +export const resolveHttpAuthRuntimeConfig = (config: HttpAuthExtensionConfiguration): HttpAuthRuntimeConfig => { + return { + httpAuthSchemes: config.httpAuthSchemes(), + httpAuthSchemeProvider: config.httpAuthSchemeProvider(), + credentials: config.credentials(), + }; +}; diff --git a/clients/client-socialmessaging/src/auth/httpAuthSchemeProvider.ts b/clients/client-socialmessaging/src/auth/httpAuthSchemeProvider.ts new file mode 100644 index 000000000000..90df22bc58bf --- /dev/null +++ b/clients/client-socialmessaging/src/auth/httpAuthSchemeProvider.ts @@ -0,0 +1,138 @@ +// smithy-typescript generated code +import { + AwsSdkSigV4AuthInputConfig, + AwsSdkSigV4AuthResolvedConfig, + AwsSdkSigV4PreviouslyResolved, + resolveAwsSdkSigV4Config, +} from "@aws-sdk/core"; +import { + HandlerExecutionContext, + HttpAuthOption, + HttpAuthScheme, + HttpAuthSchemeParameters, + HttpAuthSchemeParametersProvider, + HttpAuthSchemeProvider, +} from "@smithy/types"; +import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware"; + +import { SocialMessagingClientConfig, SocialMessagingClientResolvedConfig } from "../SocialMessagingClient"; + +/** + * @internal + */ +export interface SocialMessagingHttpAuthSchemeParameters extends HttpAuthSchemeParameters { + region?: string; +} + +/** + * @internal + */ +export interface SocialMessagingHttpAuthSchemeParametersProvider + extends HttpAuthSchemeParametersProvider< + SocialMessagingClientResolvedConfig, + HandlerExecutionContext, + SocialMessagingHttpAuthSchemeParameters, + object + > {} + +/** + * @internal + */ +export const defaultSocialMessagingHttpAuthSchemeParametersProvider = async ( + config: SocialMessagingClientResolvedConfig, + context: HandlerExecutionContext, + input: object +): Promise => { + return { + operation: getSmithyContext(context).operation as string, + region: + (await normalizeProvider(config.region)()) || + (() => { + throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); + })(), + }; +}; + +function createAwsAuthSigv4HttpAuthOption(authParameters: SocialMessagingHttpAuthSchemeParameters): HttpAuthOption { + return { + schemeId: "aws.auth#sigv4", + signingProperties: { + name: "social-messaging", + region: authParameters.region, + }, + propertiesExtractor: (config: Partial, context) => ({ + /** + * @internal + */ + signingProperties: { + config, + context, + }, + }), + }; +} + +/** + * @internal + */ +export interface SocialMessagingHttpAuthSchemeProvider + extends HttpAuthSchemeProvider {} + +/** + * @internal + */ +export const defaultSocialMessagingHttpAuthSchemeProvider: SocialMessagingHttpAuthSchemeProvider = (authParameters) => { + const options: HttpAuthOption[] = []; + switch (authParameters.operation) { + default: { + options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); + } + } + return options; +}; + +/** + * @internal + */ +export interface HttpAuthSchemeInputConfig extends AwsSdkSigV4AuthInputConfig { + /** + * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme. + * @internal + */ + httpAuthSchemes?: HttpAuthScheme[]; + + /** + * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use. + * @internal + */ + httpAuthSchemeProvider?: SocialMessagingHttpAuthSchemeProvider; +} + +/** + * @internal + */ +export interface HttpAuthSchemeResolvedConfig extends AwsSdkSigV4AuthResolvedConfig { + /** + * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme. + * @internal + */ + readonly httpAuthSchemes: HttpAuthScheme[]; + + /** + * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use. + * @internal + */ + readonly httpAuthSchemeProvider: SocialMessagingHttpAuthSchemeProvider; +} + +/** + * @internal + */ +export const resolveHttpAuthSchemeConfig = ( + config: T & HttpAuthSchemeInputConfig & AwsSdkSigV4PreviouslyResolved +): T & HttpAuthSchemeResolvedConfig => { + const config_0 = resolveAwsSdkSigV4Config(config); + return { + ...config_0, + } as T & HttpAuthSchemeResolvedConfig; +}; diff --git a/clients/client-socialmessaging/src/commands/AssociateWhatsAppBusinessAccountCommand.ts b/clients/client-socialmessaging/src/commands/AssociateWhatsAppBusinessAccountCommand.ts new file mode 100644 index 000000000000..81dea745cf6a --- /dev/null +++ b/clients/client-socialmessaging/src/commands/AssociateWhatsAppBusinessAccountCommand.ts @@ -0,0 +1,170 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { + AssociateWhatsAppBusinessAccountInput, + AssociateWhatsAppBusinessAccountInputFilterSensitiveLog, + AssociateWhatsAppBusinessAccountOutput, + AssociateWhatsAppBusinessAccountOutputFilterSensitiveLog, +} from "../models/models_0"; +import { + de_AssociateWhatsAppBusinessAccountCommand, + se_AssociateWhatsAppBusinessAccountCommand, +} from "../protocols/Aws_restJson1"; +import { ServiceInputTypes, ServiceOutputTypes, SocialMessagingClientResolvedConfig } from "../SocialMessagingClient"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link AssociateWhatsAppBusinessAccountCommand}. + */ +export interface AssociateWhatsAppBusinessAccountCommandInput extends AssociateWhatsAppBusinessAccountInput {} +/** + * @public + * + * The output of {@link AssociateWhatsAppBusinessAccountCommand}. + */ +export interface AssociateWhatsAppBusinessAccountCommandOutput + extends AssociateWhatsAppBusinessAccountOutput, + __MetadataBearer {} + +/** + *

This is only used through the Amazon Web Services console during sign-up to associate your WhatsApp Business Account to your Amazon Web Services account.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { SocialMessagingClient, AssociateWhatsAppBusinessAccountCommand } from "@aws-sdk/client-socialmessaging"; // ES Modules import + * // const { SocialMessagingClient, AssociateWhatsAppBusinessAccountCommand } = require("@aws-sdk/client-socialmessaging"); // CommonJS import + * const client = new SocialMessagingClient(config); + * const input = { // AssociateWhatsAppBusinessAccountInput + * signupCallback: { // WhatsAppSignupCallback + * accessToken: "STRING_VALUE", // required + * }, + * setupFinalization: { // WhatsAppSetupFinalization + * associateInProgressToken: "STRING_VALUE", // required + * phoneNumbers: [ // WabaPhoneNumberSetupFinalizationList // required + * { // WabaPhoneNumberSetupFinalization + * id: "STRING_VALUE", // required + * twoFactorPin: "STRING_VALUE", // required + * dataLocalizationRegion: "STRING_VALUE", + * tags: [ // TagList + * { // Tag + * key: "STRING_VALUE", // required + * value: "STRING_VALUE", + * }, + * ], + * }, + * ], + * phoneNumberParent: "STRING_VALUE", + * waba: { // WabaSetupFinalization + * id: "STRING_VALUE", + * eventDestinations: [ // WhatsAppBusinessAccountEventDestinations + * { // WhatsAppBusinessAccountEventDestination + * eventDestinationArn: "STRING_VALUE", // required + * }, + * ], + * tags: [ + * { + * key: "STRING_VALUE", // required + * value: "STRING_VALUE", + * }, + * ], + * }, + * }, + * }; + * const command = new AssociateWhatsAppBusinessAccountCommand(input); + * const response = await client.send(command); + * // { // AssociateWhatsAppBusinessAccountOutput + * // signupCallbackResult: { // WhatsAppSignupCallbackResult + * // associateInProgressToken: "STRING_VALUE", + * // linkedAccountsWithIncompleteSetup: { // LinkedAccountWithIncompleteSetup + * // "": { // LinkedWhatsAppBusinessAccountIdMetaData + * // accountName: "STRING_VALUE", + * // registrationStatus: "COMPLETE" || "INCOMPLETE", + * // unregisteredWhatsAppPhoneNumbers: [ // WhatsAppPhoneNumberDetailList + * // { // WhatsAppPhoneNumberDetail + * // arn: "STRING_VALUE", // required + * // phoneNumber: "STRING_VALUE", // required + * // phoneNumberId: "STRING_VALUE", // required + * // metaPhoneNumberId: "STRING_VALUE", // required + * // displayPhoneNumberName: "STRING_VALUE", // required + * // displayPhoneNumber: "STRING_VALUE", // required + * // qualityRating: "STRING_VALUE", // required + * // }, + * // ], + * // }, + * // }, + * // }, + * // statusCode: Number("int"), + * // }; + * + * ``` + * + * @param AssociateWhatsAppBusinessAccountCommandInput - {@link AssociateWhatsAppBusinessAccountCommandInput} + * @returns {@link AssociateWhatsAppBusinessAccountCommandOutput} + * @see {@link AssociateWhatsAppBusinessAccountCommandInput} for command's `input` shape. + * @see {@link AssociateWhatsAppBusinessAccountCommandOutput} for command's `response` shape. + * @see {@link SocialMessagingClientResolvedConfig | config} for SocialMessagingClient's `config` shape. + * + * @throws {@link DependencyException} (server fault) + *

Thrown when performing an action because a dependency would be broken.

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

One or more parameters provided to the action are not valid.

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

The request was denied due to request throttling.

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

You do not have sufficient access to perform this action.

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

The request contains an invalid parameter value.

+ * + * @throws {@link SocialMessagingServiceException} + *

Base exception class for all service exceptions from SocialMessaging service.

+ * + * @public + */ +export class AssociateWhatsAppBusinessAccountCommand extends $Command + .classBuilder< + AssociateWhatsAppBusinessAccountCommandInput, + AssociateWhatsAppBusinessAccountCommandOutput, + SocialMessagingClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: SocialMessagingClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("SocialMessaging", "AssociateWhatsAppBusinessAccount", {}) + .n("SocialMessagingClient", "AssociateWhatsAppBusinessAccountCommand") + .f(AssociateWhatsAppBusinessAccountInputFilterSensitiveLog, AssociateWhatsAppBusinessAccountOutputFilterSensitiveLog) + .ser(se_AssociateWhatsAppBusinessAccountCommand) + .de(de_AssociateWhatsAppBusinessAccountCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: AssociateWhatsAppBusinessAccountInput; + output: AssociateWhatsAppBusinessAccountOutput; + }; + sdk: { + input: AssociateWhatsAppBusinessAccountCommandInput; + output: AssociateWhatsAppBusinessAccountCommandOutput; + }; + }; +} diff --git a/clients/client-socialmessaging/src/commands/DeleteWhatsAppMessageMediaCommand.ts b/clients/client-socialmessaging/src/commands/DeleteWhatsAppMessageMediaCommand.ts new file mode 100644 index 000000000000..c35fb7c807e8 --- /dev/null +++ b/clients/client-socialmessaging/src/commands/DeleteWhatsAppMessageMediaCommand.ts @@ -0,0 +1,118 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { DeleteWhatsAppMessageMediaInput, DeleteWhatsAppMessageMediaOutput } from "../models/models_0"; +import { de_DeleteWhatsAppMessageMediaCommand, se_DeleteWhatsAppMessageMediaCommand } from "../protocols/Aws_restJson1"; +import { ServiceInputTypes, ServiceOutputTypes, SocialMessagingClientResolvedConfig } from "../SocialMessagingClient"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link DeleteWhatsAppMessageMediaCommand}. + */ +export interface DeleteWhatsAppMessageMediaCommandInput extends DeleteWhatsAppMessageMediaInput {} +/** + * @public + * + * The output of {@link DeleteWhatsAppMessageMediaCommand}. + */ +export interface DeleteWhatsAppMessageMediaCommandOutput extends DeleteWhatsAppMessageMediaOutput, __MetadataBearer {} + +/** + *

Delete a media object from the WhatsApp service. If the object is still in an Amazon S3 bucket you should delete it from there too.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { SocialMessagingClient, DeleteWhatsAppMessageMediaCommand } from "@aws-sdk/client-socialmessaging"; // ES Modules import + * // const { SocialMessagingClient, DeleteWhatsAppMessageMediaCommand } = require("@aws-sdk/client-socialmessaging"); // CommonJS import + * const client = new SocialMessagingClient(config); + * const input = { // DeleteWhatsAppMessageMediaInput + * mediaId: "STRING_VALUE", // required + * originationPhoneNumberId: "STRING_VALUE", // required + * }; + * const command = new DeleteWhatsAppMessageMediaCommand(input); + * const response = await client.send(command); + * // { // DeleteWhatsAppMessageMediaOutput + * // success: true || false, + * // }; + * + * ``` + * + * @param DeleteWhatsAppMessageMediaCommandInput - {@link DeleteWhatsAppMessageMediaCommandInput} + * @returns {@link DeleteWhatsAppMessageMediaCommandOutput} + * @see {@link DeleteWhatsAppMessageMediaCommandInput} for command's `input` shape. + * @see {@link DeleteWhatsAppMessageMediaCommandOutput} for command's `response` shape. + * @see {@link SocialMessagingClientResolvedConfig | config} for SocialMessagingClient's `config` shape. + * + * @throws {@link AccessDeniedByMetaException} (client fault) + *

You do not have sufficient access to perform this action.

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

Thrown when performing an action because a dependency would be broken.

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

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

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

One or more parameters provided to the action are not valid.

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

The resource was not found.

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

The request was denied due to request throttling.

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

You do not have sufficient access to perform this action.

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

The request contains an invalid parameter value.

+ * + * @throws {@link SocialMessagingServiceException} + *

Base exception class for all service exceptions from SocialMessaging service.

+ * + * @public + */ +export class DeleteWhatsAppMessageMediaCommand extends $Command + .classBuilder< + DeleteWhatsAppMessageMediaCommandInput, + DeleteWhatsAppMessageMediaCommandOutput, + SocialMessagingClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: SocialMessagingClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("SocialMessaging", "DeleteWhatsAppMessageMedia", {}) + .n("SocialMessagingClient", "DeleteWhatsAppMessageMediaCommand") + .f(void 0, void 0) + .ser(se_DeleteWhatsAppMessageMediaCommand) + .de(de_DeleteWhatsAppMessageMediaCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: DeleteWhatsAppMessageMediaInput; + output: DeleteWhatsAppMessageMediaOutput; + }; + sdk: { + input: DeleteWhatsAppMessageMediaCommandInput; + output: DeleteWhatsAppMessageMediaCommandOutput; + }; + }; +} diff --git a/clients/client-socialmessaging/src/commands/DisassociateWhatsAppBusinessAccountCommand.ts b/clients/client-socialmessaging/src/commands/DisassociateWhatsAppBusinessAccountCommand.ts new file mode 100644 index 000000000000..b14d758d1087 --- /dev/null +++ b/clients/client-socialmessaging/src/commands/DisassociateWhatsAppBusinessAccountCommand.ts @@ -0,0 +1,116 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { + DisassociateWhatsAppBusinessAccountInput, + DisassociateWhatsAppBusinessAccountOutput, +} from "../models/models_0"; +import { + de_DisassociateWhatsAppBusinessAccountCommand, + se_DisassociateWhatsAppBusinessAccountCommand, +} from "../protocols/Aws_restJson1"; +import { ServiceInputTypes, ServiceOutputTypes, SocialMessagingClientResolvedConfig } from "../SocialMessagingClient"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link DisassociateWhatsAppBusinessAccountCommand}. + */ +export interface DisassociateWhatsAppBusinessAccountCommandInput extends DisassociateWhatsAppBusinessAccountInput {} +/** + * @public + * + * The output of {@link DisassociateWhatsAppBusinessAccountCommand}. + */ +export interface DisassociateWhatsAppBusinessAccountCommandOutput + extends DisassociateWhatsAppBusinessAccountOutput, + __MetadataBearer {} + +/** + *

Disassociate a WhatsApp Business Account (WABA) from your Amazon Web Services account.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { SocialMessagingClient, DisassociateWhatsAppBusinessAccountCommand } from "@aws-sdk/client-socialmessaging"; // ES Modules import + * // const { SocialMessagingClient, DisassociateWhatsAppBusinessAccountCommand } = require("@aws-sdk/client-socialmessaging"); // CommonJS import + * const client = new SocialMessagingClient(config); + * const input = { // DisassociateWhatsAppBusinessAccountInput + * id: "STRING_VALUE", // required + * }; + * const command = new DisassociateWhatsAppBusinessAccountCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param DisassociateWhatsAppBusinessAccountCommandInput - {@link DisassociateWhatsAppBusinessAccountCommandInput} + * @returns {@link DisassociateWhatsAppBusinessAccountCommandOutput} + * @see {@link DisassociateWhatsAppBusinessAccountCommandInput} for command's `input` shape. + * @see {@link DisassociateWhatsAppBusinessAccountCommandOutput} for command's `response` shape. + * @see {@link SocialMessagingClientResolvedConfig | config} for SocialMessagingClient's `config` shape. + * + * @throws {@link DependencyException} (server fault) + *

Thrown when performing an action because a dependency would be broken.

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

One or more parameters provided to the action are not valid.

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

The resource was not found.

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

The request was denied due to request throttling.

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

You do not have sufficient access to perform this action.

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

The request contains an invalid parameter value.

+ * + * @throws {@link SocialMessagingServiceException} + *

Base exception class for all service exceptions from SocialMessaging service.

+ * + * @public + */ +export class DisassociateWhatsAppBusinessAccountCommand extends $Command + .classBuilder< + DisassociateWhatsAppBusinessAccountCommandInput, + DisassociateWhatsAppBusinessAccountCommandOutput, + SocialMessagingClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: SocialMessagingClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("SocialMessaging", "DisassociateWhatsAppBusinessAccount", {}) + .n("SocialMessagingClient", "DisassociateWhatsAppBusinessAccountCommand") + .f(void 0, void 0) + .ser(se_DisassociateWhatsAppBusinessAccountCommand) + .de(de_DisassociateWhatsAppBusinessAccountCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: DisassociateWhatsAppBusinessAccountInput; + output: {}; + }; + sdk: { + input: DisassociateWhatsAppBusinessAccountCommandInput; + output: DisassociateWhatsAppBusinessAccountCommandOutput; + }; + }; +} diff --git a/clients/client-socialmessaging/src/commands/GetLinkedWhatsAppBusinessAccountCommand.ts b/clients/client-socialmessaging/src/commands/GetLinkedWhatsAppBusinessAccountCommand.ts new file mode 100644 index 000000000000..a4bd9ded1b59 --- /dev/null +++ b/clients/client-socialmessaging/src/commands/GetLinkedWhatsAppBusinessAccountCommand.ts @@ -0,0 +1,142 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { GetLinkedWhatsAppBusinessAccountInput, GetLinkedWhatsAppBusinessAccountOutput } from "../models/models_0"; +import { + de_GetLinkedWhatsAppBusinessAccountCommand, + se_GetLinkedWhatsAppBusinessAccountCommand, +} from "../protocols/Aws_restJson1"; +import { ServiceInputTypes, ServiceOutputTypes, SocialMessagingClientResolvedConfig } from "../SocialMessagingClient"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link GetLinkedWhatsAppBusinessAccountCommand}. + */ +export interface GetLinkedWhatsAppBusinessAccountCommandInput extends GetLinkedWhatsAppBusinessAccountInput {} +/** + * @public + * + * The output of {@link GetLinkedWhatsAppBusinessAccountCommand}. + */ +export interface GetLinkedWhatsAppBusinessAccountCommandOutput + extends GetLinkedWhatsAppBusinessAccountOutput, + __MetadataBearer {} + +/** + *

Get the details of your linked WhatsApp Business Account.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { SocialMessagingClient, GetLinkedWhatsAppBusinessAccountCommand } from "@aws-sdk/client-socialmessaging"; // ES Modules import + * // const { SocialMessagingClient, GetLinkedWhatsAppBusinessAccountCommand } = require("@aws-sdk/client-socialmessaging"); // CommonJS import + * const client = new SocialMessagingClient(config); + * const input = { // GetLinkedWhatsAppBusinessAccountInput + * id: "STRING_VALUE", // required + * }; + * const command = new GetLinkedWhatsAppBusinessAccountCommand(input); + * const response = await client.send(command); + * // { // GetLinkedWhatsAppBusinessAccountOutput + * // account: { // LinkedWhatsAppBusinessAccount + * // arn: "STRING_VALUE", // required + * // id: "STRING_VALUE", // required + * // wabaId: "STRING_VALUE", // required + * // registrationStatus: "COMPLETE" || "INCOMPLETE", // required + * // linkDate: new Date("TIMESTAMP"), // required + * // wabaName: "STRING_VALUE", // required + * // eventDestinations: [ // WhatsAppBusinessAccountEventDestinations // required + * // { // WhatsAppBusinessAccountEventDestination + * // eventDestinationArn: "STRING_VALUE", // required + * // }, + * // ], + * // phoneNumbers: [ // WhatsAppPhoneNumberSummaryList // required + * // { // WhatsAppPhoneNumberSummary + * // arn: "STRING_VALUE", // required + * // phoneNumber: "STRING_VALUE", // required + * // phoneNumberId: "STRING_VALUE", // required + * // metaPhoneNumberId: "STRING_VALUE", // required + * // displayPhoneNumberName: "STRING_VALUE", // required + * // displayPhoneNumber: "STRING_VALUE", // required + * // qualityRating: "STRING_VALUE", // required + * // }, + * // ], + * // }, + * // }; + * + * ``` + * + * @param GetLinkedWhatsAppBusinessAccountCommandInput - {@link GetLinkedWhatsAppBusinessAccountCommandInput} + * @returns {@link GetLinkedWhatsAppBusinessAccountCommandOutput} + * @see {@link GetLinkedWhatsAppBusinessAccountCommandInput} for command's `input` shape. + * @see {@link GetLinkedWhatsAppBusinessAccountCommandOutput} for command's `response` shape. + * @see {@link SocialMessagingClientResolvedConfig | config} for SocialMessagingClient's `config` shape. + * + * @throws {@link DependencyException} (server fault) + *

Thrown when performing an action because a dependency would be broken.

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

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

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

One or more parameters provided to the action are not valid.

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

The resource was not found.

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

The request was denied due to request throttling.

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

You do not have sufficient access to perform this action.

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

The request contains an invalid parameter value.

+ * + * @throws {@link SocialMessagingServiceException} + *

Base exception class for all service exceptions from SocialMessaging service.

+ * + * @public + */ +export class GetLinkedWhatsAppBusinessAccountCommand extends $Command + .classBuilder< + GetLinkedWhatsAppBusinessAccountCommandInput, + GetLinkedWhatsAppBusinessAccountCommandOutput, + SocialMessagingClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: SocialMessagingClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("SocialMessaging", "GetLinkedWhatsAppBusinessAccount", {}) + .n("SocialMessagingClient", "GetLinkedWhatsAppBusinessAccountCommand") + .f(void 0, void 0) + .ser(se_GetLinkedWhatsAppBusinessAccountCommand) + .de(de_GetLinkedWhatsAppBusinessAccountCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: GetLinkedWhatsAppBusinessAccountInput; + output: GetLinkedWhatsAppBusinessAccountOutput; + }; + sdk: { + input: GetLinkedWhatsAppBusinessAccountCommandInput; + output: GetLinkedWhatsAppBusinessAccountCommandOutput; + }; + }; +} diff --git a/clients/client-socialmessaging/src/commands/GetLinkedWhatsAppBusinessAccountPhoneNumberCommand.ts b/clients/client-socialmessaging/src/commands/GetLinkedWhatsAppBusinessAccountPhoneNumberCommand.ts new file mode 100644 index 000000000000..7bdea7a5aeb2 --- /dev/null +++ b/clients/client-socialmessaging/src/commands/GetLinkedWhatsAppBusinessAccountPhoneNumberCommand.ts @@ -0,0 +1,133 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { + GetLinkedWhatsAppBusinessAccountPhoneNumberInput, + GetLinkedWhatsAppBusinessAccountPhoneNumberOutput, +} from "../models/models_0"; +import { + de_GetLinkedWhatsAppBusinessAccountPhoneNumberCommand, + se_GetLinkedWhatsAppBusinessAccountPhoneNumberCommand, +} from "../protocols/Aws_restJson1"; +import { ServiceInputTypes, ServiceOutputTypes, SocialMessagingClientResolvedConfig } from "../SocialMessagingClient"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link GetLinkedWhatsAppBusinessAccountPhoneNumberCommand}. + */ +export interface GetLinkedWhatsAppBusinessAccountPhoneNumberCommandInput + extends GetLinkedWhatsAppBusinessAccountPhoneNumberInput {} +/** + * @public + * + * The output of {@link GetLinkedWhatsAppBusinessAccountPhoneNumberCommand}. + */ +export interface GetLinkedWhatsAppBusinessAccountPhoneNumberCommandOutput + extends GetLinkedWhatsAppBusinessAccountPhoneNumberOutput, + __MetadataBearer {} + +/** + *

Use your WhatsApp phone number id to get the WABA account id and phone number + * details.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { SocialMessagingClient, GetLinkedWhatsAppBusinessAccountPhoneNumberCommand } from "@aws-sdk/client-socialmessaging"; // ES Modules import + * // const { SocialMessagingClient, GetLinkedWhatsAppBusinessAccountPhoneNumberCommand } = require("@aws-sdk/client-socialmessaging"); // CommonJS import + * const client = new SocialMessagingClient(config); + * const input = { // GetLinkedWhatsAppBusinessAccountPhoneNumberInput + * id: "STRING_VALUE", // required + * }; + * const command = new GetLinkedWhatsAppBusinessAccountPhoneNumberCommand(input); + * const response = await client.send(command); + * // { // GetLinkedWhatsAppBusinessAccountPhoneNumberOutput + * // phoneNumber: { // WhatsAppPhoneNumberDetail + * // arn: "STRING_VALUE", // required + * // phoneNumber: "STRING_VALUE", // required + * // phoneNumberId: "STRING_VALUE", // required + * // metaPhoneNumberId: "STRING_VALUE", // required + * // displayPhoneNumberName: "STRING_VALUE", // required + * // displayPhoneNumber: "STRING_VALUE", // required + * // qualityRating: "STRING_VALUE", // required + * // }, + * // linkedWhatsAppBusinessAccountId: "STRING_VALUE", + * // }; + * + * ``` + * + * @param GetLinkedWhatsAppBusinessAccountPhoneNumberCommandInput - {@link GetLinkedWhatsAppBusinessAccountPhoneNumberCommandInput} + * @returns {@link GetLinkedWhatsAppBusinessAccountPhoneNumberCommandOutput} + * @see {@link GetLinkedWhatsAppBusinessAccountPhoneNumberCommandInput} for command's `input` shape. + * @see {@link GetLinkedWhatsAppBusinessAccountPhoneNumberCommandOutput} for command's `response` shape. + * @see {@link SocialMessagingClientResolvedConfig | config} for SocialMessagingClient's `config` shape. + * + * @throws {@link DependencyException} (server fault) + *

Thrown when performing an action because a dependency would be broken.

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

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

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

One or more parameters provided to the action are not valid.

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

The resource was not found.

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

The request was denied due to request throttling.

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

You do not have sufficient access to perform this action.

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

The request contains an invalid parameter value.

+ * + * @throws {@link SocialMessagingServiceException} + *

Base exception class for all service exceptions from SocialMessaging service.

+ * + * @public + */ +export class GetLinkedWhatsAppBusinessAccountPhoneNumberCommand extends $Command + .classBuilder< + GetLinkedWhatsAppBusinessAccountPhoneNumberCommandInput, + GetLinkedWhatsAppBusinessAccountPhoneNumberCommandOutput, + SocialMessagingClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: SocialMessagingClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("SocialMessaging", "GetLinkedWhatsAppBusinessAccountPhoneNumber", {}) + .n("SocialMessagingClient", "GetLinkedWhatsAppBusinessAccountPhoneNumberCommand") + .f(void 0, void 0) + .ser(se_GetLinkedWhatsAppBusinessAccountPhoneNumberCommand) + .de(de_GetLinkedWhatsAppBusinessAccountPhoneNumberCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: GetLinkedWhatsAppBusinessAccountPhoneNumberInput; + output: GetLinkedWhatsAppBusinessAccountPhoneNumberOutput; + }; + sdk: { + input: GetLinkedWhatsAppBusinessAccountPhoneNumberCommandInput; + output: GetLinkedWhatsAppBusinessAccountPhoneNumberCommandOutput; + }; + }; +} diff --git a/clients/client-socialmessaging/src/commands/GetWhatsAppMessageMediaCommand.ts b/clients/client-socialmessaging/src/commands/GetWhatsAppMessageMediaCommand.ts new file mode 100644 index 000000000000..61dd7e2b9bda --- /dev/null +++ b/clients/client-socialmessaging/src/commands/GetWhatsAppMessageMediaCommand.ts @@ -0,0 +1,138 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { + GetWhatsAppMessageMediaInput, + GetWhatsAppMessageMediaInputFilterSensitiveLog, + GetWhatsAppMessageMediaOutput, +} from "../models/models_0"; +import { de_GetWhatsAppMessageMediaCommand, se_GetWhatsAppMessageMediaCommand } from "../protocols/Aws_restJson1"; +import { ServiceInputTypes, ServiceOutputTypes, SocialMessagingClientResolvedConfig } from "../SocialMessagingClient"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link GetWhatsAppMessageMediaCommand}. + */ +export interface GetWhatsAppMessageMediaCommandInput extends GetWhatsAppMessageMediaInput {} +/** + * @public + * + * The output of {@link GetWhatsAppMessageMediaCommand}. + */ +export interface GetWhatsAppMessageMediaCommandOutput extends GetWhatsAppMessageMediaOutput, __MetadataBearer {} + +/** + *

Get a media file from the WhatsApp service. On successful completion the media file is + * retrieved from Meta and stored in the specified Amazon S3 bucket. Use either + * destinationS3File or destinationS3PresignedUrl for the + * destination. If both are used then an InvalidParameterException is + * returned.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { SocialMessagingClient, GetWhatsAppMessageMediaCommand } from "@aws-sdk/client-socialmessaging"; // ES Modules import + * // const { SocialMessagingClient, GetWhatsAppMessageMediaCommand } = require("@aws-sdk/client-socialmessaging"); // CommonJS import + * const client = new SocialMessagingClient(config); + * const input = { // GetWhatsAppMessageMediaInput + * mediaId: "STRING_VALUE", // required + * originationPhoneNumberId: "STRING_VALUE", // required + * metadataOnly: true || false, + * destinationS3PresignedUrl: { // S3PresignedUrl + * url: "STRING_VALUE", // required + * headers: { // Headers // required + * "": "STRING_VALUE", + * }, + * }, + * destinationS3File: { // S3File + * bucketName: "STRING_VALUE", // required + * key: "STRING_VALUE", // required + * }, + * }; + * const command = new GetWhatsAppMessageMediaCommand(input); + * const response = await client.send(command); + * // { // GetWhatsAppMessageMediaOutput + * // mimeType: "STRING_VALUE", + * // fileSize: Number("long"), + * // }; + * + * ``` + * + * @param GetWhatsAppMessageMediaCommandInput - {@link GetWhatsAppMessageMediaCommandInput} + * @returns {@link GetWhatsAppMessageMediaCommandOutput} + * @see {@link GetWhatsAppMessageMediaCommandInput} for command's `input` shape. + * @see {@link GetWhatsAppMessageMediaCommandOutput} for command's `response` shape. + * @see {@link SocialMessagingClientResolvedConfig | config} for SocialMessagingClient's `config` shape. + * + * @throws {@link AccessDeniedByMetaException} (client fault) + *

You do not have sufficient access to perform this action.

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

Thrown when performing an action because a dependency would be broken.

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

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

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

One or more parameters provided to the action are not valid.

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

The resource was not found.

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

The request was denied due to request throttling.

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

You do not have sufficient access to perform this action.

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

The request contains an invalid parameter value.

+ * + * @throws {@link SocialMessagingServiceException} + *

Base exception class for all service exceptions from SocialMessaging service.

+ * + * @public + */ +export class GetWhatsAppMessageMediaCommand extends $Command + .classBuilder< + GetWhatsAppMessageMediaCommandInput, + GetWhatsAppMessageMediaCommandOutput, + SocialMessagingClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: SocialMessagingClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("SocialMessaging", "GetWhatsAppMessageMedia", {}) + .n("SocialMessagingClient", "GetWhatsAppMessageMediaCommand") + .f(GetWhatsAppMessageMediaInputFilterSensitiveLog, void 0) + .ser(se_GetWhatsAppMessageMediaCommand) + .de(de_GetWhatsAppMessageMediaCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: GetWhatsAppMessageMediaInput; + output: GetWhatsAppMessageMediaOutput; + }; + sdk: { + input: GetWhatsAppMessageMediaCommandInput; + output: GetWhatsAppMessageMediaCommandOutput; + }; + }; +} diff --git a/clients/client-socialmessaging/src/commands/ListLinkedWhatsAppBusinessAccountsCommand.ts b/clients/client-socialmessaging/src/commands/ListLinkedWhatsAppBusinessAccountsCommand.ts new file mode 100644 index 000000000000..552062f97d94 --- /dev/null +++ b/clients/client-socialmessaging/src/commands/ListLinkedWhatsAppBusinessAccountsCommand.ts @@ -0,0 +1,132 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { ListLinkedWhatsAppBusinessAccountsInput, ListLinkedWhatsAppBusinessAccountsOutput } from "../models/models_0"; +import { + de_ListLinkedWhatsAppBusinessAccountsCommand, + se_ListLinkedWhatsAppBusinessAccountsCommand, +} from "../protocols/Aws_restJson1"; +import { ServiceInputTypes, ServiceOutputTypes, SocialMessagingClientResolvedConfig } from "../SocialMessagingClient"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link ListLinkedWhatsAppBusinessAccountsCommand}. + */ +export interface ListLinkedWhatsAppBusinessAccountsCommandInput extends ListLinkedWhatsAppBusinessAccountsInput {} +/** + * @public + * + * The output of {@link ListLinkedWhatsAppBusinessAccountsCommand}. + */ +export interface ListLinkedWhatsAppBusinessAccountsCommandOutput + extends ListLinkedWhatsAppBusinessAccountsOutput, + __MetadataBearer {} + +/** + *

List all WhatsApp Business Accounts linked to your Amazon Web Services account.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { SocialMessagingClient, ListLinkedWhatsAppBusinessAccountsCommand } from "@aws-sdk/client-socialmessaging"; // ES Modules import + * // const { SocialMessagingClient, ListLinkedWhatsAppBusinessAccountsCommand } = require("@aws-sdk/client-socialmessaging"); // CommonJS import + * const client = new SocialMessagingClient(config); + * const input = { // ListLinkedWhatsAppBusinessAccountsInput + * nextToken: "STRING_VALUE", + * maxResults: Number("int"), + * }; + * const command = new ListLinkedWhatsAppBusinessAccountsCommand(input); + * const response = await client.send(command); + * // { // ListLinkedWhatsAppBusinessAccountsOutput + * // linkedAccounts: [ // LinkedWhatsAppBusinessAccountSummaryList + * // { // LinkedWhatsAppBusinessAccountSummary + * // arn: "STRING_VALUE", // required + * // id: "STRING_VALUE", // required + * // wabaId: "STRING_VALUE", // required + * // registrationStatus: "COMPLETE" || "INCOMPLETE", // required + * // linkDate: new Date("TIMESTAMP"), // required + * // wabaName: "STRING_VALUE", // required + * // eventDestinations: [ // WhatsAppBusinessAccountEventDestinations // required + * // { // WhatsAppBusinessAccountEventDestination + * // eventDestinationArn: "STRING_VALUE", // required + * // }, + * // ], + * // }, + * // ], + * // nextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListLinkedWhatsAppBusinessAccountsCommandInput - {@link ListLinkedWhatsAppBusinessAccountsCommandInput} + * @returns {@link ListLinkedWhatsAppBusinessAccountsCommandOutput} + * @see {@link ListLinkedWhatsAppBusinessAccountsCommandInput} for command's `input` shape. + * @see {@link ListLinkedWhatsAppBusinessAccountsCommandOutput} for command's `response` shape. + * @see {@link SocialMessagingClientResolvedConfig | config} for SocialMessagingClient's `config` shape. + * + * @throws {@link InternalServiceException} (server fault) + *

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

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

One or more parameters provided to the action are not valid.

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

The resource was not found.

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

The request was denied due to request throttling.

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

You do not have sufficient access to perform this action.

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

The request contains an invalid parameter value.

+ * + * @throws {@link SocialMessagingServiceException} + *

Base exception class for all service exceptions from SocialMessaging service.

+ * + * @public + */ +export class ListLinkedWhatsAppBusinessAccountsCommand extends $Command + .classBuilder< + ListLinkedWhatsAppBusinessAccountsCommandInput, + ListLinkedWhatsAppBusinessAccountsCommandOutput, + SocialMessagingClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: SocialMessagingClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("SocialMessaging", "ListLinkedWhatsAppBusinessAccounts", {}) + .n("SocialMessagingClient", "ListLinkedWhatsAppBusinessAccountsCommand") + .f(void 0, void 0) + .ser(se_ListLinkedWhatsAppBusinessAccountsCommand) + .de(de_ListLinkedWhatsAppBusinessAccountsCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: ListLinkedWhatsAppBusinessAccountsInput; + output: ListLinkedWhatsAppBusinessAccountsOutput; + }; + sdk: { + input: ListLinkedWhatsAppBusinessAccountsCommandInput; + output: ListLinkedWhatsAppBusinessAccountsCommandOutput; + }; + }; +} diff --git a/clients/client-socialmessaging/src/commands/ListTagsForResourceCommand.ts b/clients/client-socialmessaging/src/commands/ListTagsForResourceCommand.ts new file mode 100644 index 000000000000..cc5b76cdbf0d --- /dev/null +++ b/clients/client-socialmessaging/src/commands/ListTagsForResourceCommand.ts @@ -0,0 +1,114 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { ListTagsForResourceInput, ListTagsForResourceOutput } from "../models/models_0"; +import { de_ListTagsForResourceCommand, se_ListTagsForResourceCommand } from "../protocols/Aws_restJson1"; +import { ServiceInputTypes, ServiceOutputTypes, SocialMessagingClientResolvedConfig } from "../SocialMessagingClient"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link ListTagsForResourceCommand}. + */ +export interface ListTagsForResourceCommandInput extends ListTagsForResourceInput {} +/** + * @public + * + * The output of {@link ListTagsForResourceCommand}. + */ +export interface ListTagsForResourceCommandOutput extends ListTagsForResourceOutput, __MetadataBearer {} + +/** + *

List all tags associated with a resource, such as a phone number or WABA.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { SocialMessagingClient, ListTagsForResourceCommand } from "@aws-sdk/client-socialmessaging"; // ES Modules import + * // const { SocialMessagingClient, ListTagsForResourceCommand } = require("@aws-sdk/client-socialmessaging"); // CommonJS import + * const client = new SocialMessagingClient(config); + * const input = { // ListTagsForResourceInput + * resourceArn: "STRING_VALUE", // required + * }; + * const command = new ListTagsForResourceCommand(input); + * const response = await client.send(command); + * // { // ListTagsForResourceOutput + * // statusCode: Number("int"), + * // tags: [ // TagList + * // { // Tag + * // key: "STRING_VALUE", // required + * // value: "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 SocialMessagingClientResolvedConfig | config} for SocialMessagingClient's `config` shape. + * + * @throws {@link InternalServiceException} (server fault) + *

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

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

One or more parameters provided to the action are not valid.

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

The request was denied due to request throttling.

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

You do not have sufficient access to perform this action.

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

The request contains an invalid parameter value.

+ * + * @throws {@link SocialMessagingServiceException} + *

Base exception class for all service exceptions from SocialMessaging service.

+ * + * @public + */ +export class ListTagsForResourceCommand extends $Command + .classBuilder< + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, + SocialMessagingClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: SocialMessagingClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("SocialMessaging", "ListTagsForResource", {}) + .n("SocialMessagingClient", "ListTagsForResourceCommand") + .f(void 0, void 0) + .ser(se_ListTagsForResourceCommand) + .de(de_ListTagsForResourceCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: ListTagsForResourceInput; + output: ListTagsForResourceOutput; + }; + sdk: { + input: ListTagsForResourceCommandInput; + output: ListTagsForResourceCommandOutput; + }; + }; +} diff --git a/clients/client-socialmessaging/src/commands/PostWhatsAppMessageMediaCommand.ts b/clients/client-socialmessaging/src/commands/PostWhatsAppMessageMediaCommand.ts new file mode 100644 index 000000000000..d377b9c0c746 --- /dev/null +++ b/clients/client-socialmessaging/src/commands/PostWhatsAppMessageMediaCommand.ts @@ -0,0 +1,135 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { + PostWhatsAppMessageMediaInput, + PostWhatsAppMessageMediaInputFilterSensitiveLog, + PostWhatsAppMessageMediaOutput, +} from "../models/models_0"; +import { de_PostWhatsAppMessageMediaCommand, se_PostWhatsAppMessageMediaCommand } from "../protocols/Aws_restJson1"; +import { ServiceInputTypes, ServiceOutputTypes, SocialMessagingClientResolvedConfig } from "../SocialMessagingClient"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link PostWhatsAppMessageMediaCommand}. + */ +export interface PostWhatsAppMessageMediaCommandInput extends PostWhatsAppMessageMediaInput {} +/** + * @public + * + * The output of {@link PostWhatsAppMessageMediaCommand}. + */ +export interface PostWhatsAppMessageMediaCommandOutput extends PostWhatsAppMessageMediaOutput, __MetadataBearer {} + +/** + *

Upload a media file to the WhatsApp service. Only the specified + * originationPhoneNumberId has the permissions to send the media file when + * using SendWhatsAppMessage. You must use either sourceS3File + * or sourceS3PresignedUrl for the source. If both or neither are specified then an + * InvalidParameterException is returned.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { SocialMessagingClient, PostWhatsAppMessageMediaCommand } from "@aws-sdk/client-socialmessaging"; // ES Modules import + * // const { SocialMessagingClient, PostWhatsAppMessageMediaCommand } = require("@aws-sdk/client-socialmessaging"); // CommonJS import + * const client = new SocialMessagingClient(config); + * const input = { // PostWhatsAppMessageMediaInput + * originationPhoneNumberId: "STRING_VALUE", // required + * sourceS3PresignedUrl: { // S3PresignedUrl + * url: "STRING_VALUE", // required + * headers: { // Headers // required + * "": "STRING_VALUE", + * }, + * }, + * sourceS3File: { // S3File + * bucketName: "STRING_VALUE", // required + * key: "STRING_VALUE", // required + * }, + * }; + * const command = new PostWhatsAppMessageMediaCommand(input); + * const response = await client.send(command); + * // { // PostWhatsAppMessageMediaOutput + * // mediaId: "STRING_VALUE", + * // }; + * + * ``` + * + * @param PostWhatsAppMessageMediaCommandInput - {@link PostWhatsAppMessageMediaCommandInput} + * @returns {@link PostWhatsAppMessageMediaCommandOutput} + * @see {@link PostWhatsAppMessageMediaCommandInput} for command's `input` shape. + * @see {@link PostWhatsAppMessageMediaCommandOutput} for command's `response` shape. + * @see {@link SocialMessagingClientResolvedConfig | config} for SocialMessagingClient's `config` shape. + * + * @throws {@link AccessDeniedByMetaException} (client fault) + *

You do not have sufficient access to perform this action.

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

Thrown when performing an action because a dependency would be broken.

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

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

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

One or more parameters provided to the action are not valid.

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

The resource was not found.

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

The request was denied due to request throttling.

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

You do not have sufficient access to perform this action.

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

The request contains an invalid parameter value.

+ * + * @throws {@link SocialMessagingServiceException} + *

Base exception class for all service exceptions from SocialMessaging service.

+ * + * @public + */ +export class PostWhatsAppMessageMediaCommand extends $Command + .classBuilder< + PostWhatsAppMessageMediaCommandInput, + PostWhatsAppMessageMediaCommandOutput, + SocialMessagingClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: SocialMessagingClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("SocialMessaging", "PostWhatsAppMessageMedia", {}) + .n("SocialMessagingClient", "PostWhatsAppMessageMediaCommand") + .f(PostWhatsAppMessageMediaInputFilterSensitiveLog, void 0) + .ser(se_PostWhatsAppMessageMediaCommand) + .de(de_PostWhatsAppMessageMediaCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: PostWhatsAppMessageMediaInput; + output: PostWhatsAppMessageMediaOutput; + }; + sdk: { + input: PostWhatsAppMessageMediaCommandInput; + output: PostWhatsAppMessageMediaCommandOutput; + }; + }; +} diff --git a/clients/client-socialmessaging/src/commands/PutWhatsAppBusinessAccountEventDestinationsCommand.ts b/clients/client-socialmessaging/src/commands/PutWhatsAppBusinessAccountEventDestinationsCommand.ts new file mode 100644 index 000000000000..4db83bf1e831 --- /dev/null +++ b/clients/client-socialmessaging/src/commands/PutWhatsAppBusinessAccountEventDestinationsCommand.ts @@ -0,0 +1,120 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { + PutWhatsAppBusinessAccountEventDestinationsInput, + PutWhatsAppBusinessAccountEventDestinationsOutput, +} from "../models/models_0"; +import { + de_PutWhatsAppBusinessAccountEventDestinationsCommand, + se_PutWhatsAppBusinessAccountEventDestinationsCommand, +} from "../protocols/Aws_restJson1"; +import { ServiceInputTypes, ServiceOutputTypes, SocialMessagingClientResolvedConfig } from "../SocialMessagingClient"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link PutWhatsAppBusinessAccountEventDestinationsCommand}. + */ +export interface PutWhatsAppBusinessAccountEventDestinationsCommandInput + extends PutWhatsAppBusinessAccountEventDestinationsInput {} +/** + * @public + * + * The output of {@link PutWhatsAppBusinessAccountEventDestinationsCommand}. + */ +export interface PutWhatsAppBusinessAccountEventDestinationsCommandOutput + extends PutWhatsAppBusinessAccountEventDestinationsOutput, + __MetadataBearer {} + +/** + *

Add an event destination to log event data from WhatsApp for a WhatsApp Business Account (WABA). A WABA can only have one event destination at a time. All resources associated with the WABA use the same event destination.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { SocialMessagingClient, PutWhatsAppBusinessAccountEventDestinationsCommand } from "@aws-sdk/client-socialmessaging"; // ES Modules import + * // const { SocialMessagingClient, PutWhatsAppBusinessAccountEventDestinationsCommand } = require("@aws-sdk/client-socialmessaging"); // CommonJS import + * const client = new SocialMessagingClient(config); + * const input = { // PutWhatsAppBusinessAccountEventDestinationsInput + * id: "STRING_VALUE", // required + * eventDestinations: [ // WhatsAppBusinessAccountEventDestinations // required + * { // WhatsAppBusinessAccountEventDestination + * eventDestinationArn: "STRING_VALUE", // required + * }, + * ], + * }; + * const command = new PutWhatsAppBusinessAccountEventDestinationsCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param PutWhatsAppBusinessAccountEventDestinationsCommandInput - {@link PutWhatsAppBusinessAccountEventDestinationsCommandInput} + * @returns {@link PutWhatsAppBusinessAccountEventDestinationsCommandOutput} + * @see {@link PutWhatsAppBusinessAccountEventDestinationsCommandInput} for command's `input` shape. + * @see {@link PutWhatsAppBusinessAccountEventDestinationsCommandOutput} for command's `response` shape. + * @see {@link SocialMessagingClientResolvedConfig | config} for SocialMessagingClient's `config` shape. + * + * @throws {@link InternalServiceException} (server fault) + *

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

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

One or more parameters provided to the action are not valid.

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

The request was denied due to request throttling.

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

You do not have sufficient access to perform this action.

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

The request contains an invalid parameter value.

+ * + * @throws {@link SocialMessagingServiceException} + *

Base exception class for all service exceptions from SocialMessaging service.

+ * + * @public + */ +export class PutWhatsAppBusinessAccountEventDestinationsCommand extends $Command + .classBuilder< + PutWhatsAppBusinessAccountEventDestinationsCommandInput, + PutWhatsAppBusinessAccountEventDestinationsCommandOutput, + SocialMessagingClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: SocialMessagingClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("SocialMessaging", "PutWhatsAppBusinessAccountEventDestinations", {}) + .n("SocialMessagingClient", "PutWhatsAppBusinessAccountEventDestinationsCommand") + .f(void 0, void 0) + .ser(se_PutWhatsAppBusinessAccountEventDestinationsCommand) + .de(de_PutWhatsAppBusinessAccountEventDestinationsCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: PutWhatsAppBusinessAccountEventDestinationsInput; + output: {}; + }; + sdk: { + input: PutWhatsAppBusinessAccountEventDestinationsCommandInput; + output: PutWhatsAppBusinessAccountEventDestinationsCommandOutput; + }; + }; +} diff --git a/clients/client-socialmessaging/src/commands/SendWhatsAppMessageCommand.ts b/clients/client-socialmessaging/src/commands/SendWhatsAppMessageCommand.ts new file mode 100644 index 000000000000..8b816909f733 --- /dev/null +++ b/clients/client-socialmessaging/src/commands/SendWhatsAppMessageCommand.ts @@ -0,0 +1,124 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { + SendWhatsAppMessageInput, + SendWhatsAppMessageInputFilterSensitiveLog, + SendWhatsAppMessageOutput, +} from "../models/models_0"; +import { de_SendWhatsAppMessageCommand, se_SendWhatsAppMessageCommand } from "../protocols/Aws_restJson1"; +import { ServiceInputTypes, ServiceOutputTypes, SocialMessagingClientResolvedConfig } from "../SocialMessagingClient"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link SendWhatsAppMessageCommand}. + */ +export interface SendWhatsAppMessageCommandInput extends SendWhatsAppMessageInput {} +/** + * @public + * + * The output of {@link SendWhatsAppMessageCommand}. + */ +export interface SendWhatsAppMessageCommandOutput extends SendWhatsAppMessageOutput, __MetadataBearer {} + +/** + *

Send a WhatsApp message. For examples of sending a message using the Amazon Web Services + * CLI, see Sending messages in the + * + * Amazon Web Services End User Messaging Social User Guide + * .

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { SocialMessagingClient, SendWhatsAppMessageCommand } from "@aws-sdk/client-socialmessaging"; // ES Modules import + * // const { SocialMessagingClient, SendWhatsAppMessageCommand } = require("@aws-sdk/client-socialmessaging"); // CommonJS import + * const client = new SocialMessagingClient(config); + * const input = { // SendWhatsAppMessageInput + * originationPhoneNumberId: "STRING_VALUE", // required + * message: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") // required + * metaApiVersion: "STRING_VALUE", // required + * }; + * const command = new SendWhatsAppMessageCommand(input); + * const response = await client.send(command); + * // { // SendWhatsAppMessageOutput + * // messageId: "STRING_VALUE", + * // }; + * + * ``` + * + * @param SendWhatsAppMessageCommandInput - {@link SendWhatsAppMessageCommandInput} + * @returns {@link SendWhatsAppMessageCommandOutput} + * @see {@link SendWhatsAppMessageCommandInput} for command's `input` shape. + * @see {@link SendWhatsAppMessageCommandOutput} for command's `response` shape. + * @see {@link SocialMessagingClientResolvedConfig | config} for SocialMessagingClient's `config` shape. + * + * @throws {@link DependencyException} (server fault) + *

Thrown when performing an action because a dependency would be broken.

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

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

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

One or more parameters provided to the action are not valid.

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

The resource was not found.

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

The request was denied due to request throttling.

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

You do not have sufficient access to perform this action.

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

The request contains an invalid parameter value.

+ * + * @throws {@link SocialMessagingServiceException} + *

Base exception class for all service exceptions from SocialMessaging service.

+ * + * @public + */ +export class SendWhatsAppMessageCommand extends $Command + .classBuilder< + SendWhatsAppMessageCommandInput, + SendWhatsAppMessageCommandOutput, + SocialMessagingClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: SocialMessagingClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("SocialMessaging", "SendWhatsAppMessage", {}) + .n("SocialMessagingClient", "SendWhatsAppMessageCommand") + .f(SendWhatsAppMessageInputFilterSensitiveLog, void 0) + .ser(se_SendWhatsAppMessageCommand) + .de(de_SendWhatsAppMessageCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: SendWhatsAppMessageInput; + output: SendWhatsAppMessageOutput; + }; + sdk: { + input: SendWhatsAppMessageCommandInput; + output: SendWhatsAppMessageCommandOutput; + }; + }; +} diff --git a/clients/client-socialmessaging/src/commands/TagResourceCommand.ts b/clients/client-socialmessaging/src/commands/TagResourceCommand.ts new file mode 100644 index 000000000000..3f0f48c5e501 --- /dev/null +++ b/clients/client-socialmessaging/src/commands/TagResourceCommand.ts @@ -0,0 +1,115 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { TagResourceInput, TagResourceOutput } from "../models/models_0"; +import { de_TagResourceCommand, se_TagResourceCommand } from "../protocols/Aws_restJson1"; +import { ServiceInputTypes, ServiceOutputTypes, SocialMessagingClientResolvedConfig } from "../SocialMessagingClient"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link TagResourceCommand}. + */ +export interface TagResourceCommandInput extends TagResourceInput {} +/** + * @public + * + * The output of {@link TagResourceCommand}. + */ +export interface TagResourceCommandOutput extends TagResourceOutput, __MetadataBearer {} + +/** + *

Adds or overwrites only the specified tags for the specified resource. When you specify + * an existing tag key, the value is overwritten with the new value.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { SocialMessagingClient, TagResourceCommand } from "@aws-sdk/client-socialmessaging"; // ES Modules import + * // const { SocialMessagingClient, TagResourceCommand } = require("@aws-sdk/client-socialmessaging"); // CommonJS import + * const client = new SocialMessagingClient(config); + * const input = { // TagResourceInput + * resourceArn: "STRING_VALUE", // required + * tags: [ // TagList // required + * { // Tag + * key: "STRING_VALUE", // required + * value: "STRING_VALUE", + * }, + * ], + * }; + * const command = new TagResourceCommand(input); + * const response = await client.send(command); + * // { // TagResourceOutput + * // statusCode: Number("int"), + * // }; + * + * ``` + * + * @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 SocialMessagingClientResolvedConfig | config} for SocialMessagingClient's `config` shape. + * + * @throws {@link InternalServiceException} (server fault) + *

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

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

One or more parameters provided to the action are not valid.

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

The request was denied due to request throttling.

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

You do not have sufficient access to perform this action.

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

The request contains an invalid parameter value.

+ * + * @throws {@link SocialMessagingServiceException} + *

Base exception class for all service exceptions from SocialMessaging service.

+ * + * @public + */ +export class TagResourceCommand extends $Command + .classBuilder< + TagResourceCommandInput, + TagResourceCommandOutput, + SocialMessagingClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: SocialMessagingClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("SocialMessaging", "TagResource", {}) + .n("SocialMessagingClient", "TagResourceCommand") + .f(void 0, void 0) + .ser(se_TagResourceCommand) + .de(de_TagResourceCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: TagResourceInput; + output: TagResourceOutput; + }; + sdk: { + input: TagResourceCommandInput; + output: TagResourceCommandOutput; + }; + }; +} diff --git a/clients/client-socialmessaging/src/commands/UntagResourceCommand.ts b/clients/client-socialmessaging/src/commands/UntagResourceCommand.ts new file mode 100644 index 000000000000..cdfc89ca0833 --- /dev/null +++ b/clients/client-socialmessaging/src/commands/UntagResourceCommand.ts @@ -0,0 +1,111 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { UntagResourceInput, UntagResourceOutput } from "../models/models_0"; +import { de_UntagResourceCommand, se_UntagResourceCommand } from "../protocols/Aws_restJson1"; +import { ServiceInputTypes, ServiceOutputTypes, SocialMessagingClientResolvedConfig } from "../SocialMessagingClient"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link UntagResourceCommand}. + */ +export interface UntagResourceCommandInput extends UntagResourceInput {} +/** + * @public + * + * The output of {@link UntagResourceCommand}. + */ +export interface UntagResourceCommandOutput extends UntagResourceOutput, __MetadataBearer {} + +/** + *

Removes the specified tags from a resource.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { SocialMessagingClient, UntagResourceCommand } from "@aws-sdk/client-socialmessaging"; // ES Modules import + * // const { SocialMessagingClient, UntagResourceCommand } = require("@aws-sdk/client-socialmessaging"); // CommonJS import + * const client = new SocialMessagingClient(config); + * const input = { // UntagResourceInput + * resourceArn: "STRING_VALUE", // required + * tagKeys: [ // StringList // required + * "STRING_VALUE", + * ], + * }; + * const command = new UntagResourceCommand(input); + * const response = await client.send(command); + * // { // UntagResourceOutput + * // statusCode: Number("int"), + * // }; + * + * ``` + * + * @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 SocialMessagingClientResolvedConfig | config} for SocialMessagingClient's `config` shape. + * + * @throws {@link InternalServiceException} (server fault) + *

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

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

One or more parameters provided to the action are not valid.

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

The request was denied due to request throttling.

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

You do not have sufficient access to perform this action.

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

The request contains an invalid parameter value.

+ * + * @throws {@link SocialMessagingServiceException} + *

Base exception class for all service exceptions from SocialMessaging service.

+ * + * @public + */ +export class UntagResourceCommand extends $Command + .classBuilder< + UntagResourceCommandInput, + UntagResourceCommandOutput, + SocialMessagingClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: SocialMessagingClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("SocialMessaging", "UntagResource", {}) + .n("SocialMessagingClient", "UntagResourceCommand") + .f(void 0, void 0) + .ser(se_UntagResourceCommand) + .de(de_UntagResourceCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: UntagResourceInput; + output: UntagResourceOutput; + }; + sdk: { + input: UntagResourceCommandInput; + output: UntagResourceCommandOutput; + }; + }; +} diff --git a/clients/client-socialmessaging/src/commands/index.ts b/clients/client-socialmessaging/src/commands/index.ts new file mode 100644 index 000000000000..64a7b38e4f4a --- /dev/null +++ b/clients/client-socialmessaging/src/commands/index.ts @@ -0,0 +1,14 @@ +// smithy-typescript generated code +export * from "./AssociateWhatsAppBusinessAccountCommand"; +export * from "./DeleteWhatsAppMessageMediaCommand"; +export * from "./DisassociateWhatsAppBusinessAccountCommand"; +export * from "./GetLinkedWhatsAppBusinessAccountCommand"; +export * from "./GetLinkedWhatsAppBusinessAccountPhoneNumberCommand"; +export * from "./GetWhatsAppMessageMediaCommand"; +export * from "./ListLinkedWhatsAppBusinessAccountsCommand"; +export * from "./ListTagsForResourceCommand"; +export * from "./PostWhatsAppMessageMediaCommand"; +export * from "./PutWhatsAppBusinessAccountEventDestinationsCommand"; +export * from "./SendWhatsAppMessageCommand"; +export * from "./TagResourceCommand"; +export * from "./UntagResourceCommand"; diff --git a/clients/client-socialmessaging/src/endpoint/EndpointParameters.ts b/clients/client-socialmessaging/src/endpoint/EndpointParameters.ts new file mode 100644 index 000000000000..5358d406e9ee --- /dev/null +++ b/clients/client-socialmessaging/src/endpoint/EndpointParameters.ts @@ -0,0 +1,41 @@ +// smithy-typescript generated code +import { Endpoint, EndpointParameters as __EndpointParameters, EndpointV2, Provider } from "@smithy/types"; + +/** + * @public + */ +export interface ClientInputEndpointParameters { + region?: string | Provider; + useDualstackEndpoint?: boolean | Provider; + useFipsEndpoint?: boolean | Provider; + endpoint?: string | Provider | Endpoint | Provider | EndpointV2 | Provider; +} + +export type ClientResolvedEndpointParameters = ClientInputEndpointParameters & { + defaultSigningName: string; +}; + +export const resolveClientEndpointParameters = ( + options: T & ClientInputEndpointParameters +): T & ClientResolvedEndpointParameters => { + return { + ...options, + useDualstackEndpoint: options.useDualstackEndpoint ?? false, + useFipsEndpoint: options.useFipsEndpoint ?? false, + defaultSigningName: "social-messaging", + }; +}; + +export const commonParams = { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, +} as const; + +export interface EndpointParameters extends __EndpointParameters { + Region?: string; + UseDualStack?: boolean; + UseFIPS?: boolean; + Endpoint?: string; +} diff --git a/clients/client-socialmessaging/src/endpoint/endpointResolver.ts b/clients/client-socialmessaging/src/endpoint/endpointResolver.ts new file mode 100644 index 000000000000..ccee107f30d6 --- /dev/null +++ b/clients/client-socialmessaging/src/endpoint/endpointResolver.ts @@ -0,0 +1,26 @@ +// smithy-typescript generated code +import { awsEndpointFunctions } from "@aws-sdk/util-endpoints"; +import { EndpointV2, Logger } from "@smithy/types"; +import { customEndpointFunctions, EndpointCache, EndpointParams, resolveEndpoint } from "@smithy/util-endpoints"; + +import { EndpointParameters } from "./EndpointParameters"; +import { ruleSet } from "./ruleset"; + +const cache = new EndpointCache({ + size: 50, + params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"], +}); + +export const defaultEndpointResolver = ( + endpointParams: EndpointParameters, + context: { logger?: Logger } = {} +): EndpointV2 => { + return cache.get(endpointParams as EndpointParams, () => + resolveEndpoint(ruleSet, { + endpointParams: endpointParams as EndpointParams, + logger: context.logger, + }) + ); +}; + +customEndpointFunctions.aws = awsEndpointFunctions; diff --git a/clients/client-socialmessaging/src/endpoint/ruleset.ts b/clients/client-socialmessaging/src/endpoint/ruleset.ts new file mode 100644 index 000000000000..89572a6bf234 --- /dev/null +++ b/clients/client-socialmessaging/src/endpoint/ruleset.ts @@ -0,0 +1,32 @@ +// @ts-nocheck +// generated code, do not edit +import { RuleSetObject } from "@smithy/types"; + +/* This file is compressed. Log this object + or see "smithy.rules#endpointRuleSet" + in codegen/sdk-codegen/aws-models/socialmessaging.json */ + +const s="required", +t="fn", +u="argv", +v="ref"; +const a=true, +b="isSet", +c="booleanEquals", +d="error", +e="endpoint", +f="tree", +g="PartitionResult", +h={[s]:false,"type":"String"}, +i={[s]:true,"default":false,"type":"Boolean"}, +j={[v]:"Endpoint"}, +k={[t]:c,[u]:[{[v]:"UseFIPS"},true]}, +l={[t]:c,[u]:[{[v]:"UseDualStack"},true]}, +m={}, +n={[t]:"getAttr",[u]:[{[v]:g},"supportsFIPS"]}, +o={[t]:c,[u]:[true,{[t]:"getAttr",[u]:[{[v]:g},"supportsDualStack"]}]}, +p=[k], +q=[l], +r=[{[v]:"Region"}]; +const _data={version:"1.0",parameters:{Region:h,UseDualStack:i,UseFIPS:i,Endpoint:h},rules:[{conditions:[{[t]:b,[u]:[j]}],rules:[{conditions:p,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:d},{rules:[{conditions:q,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:d},{endpoint:{url:j,properties:m,headers:m},type:e}],type:f}],type:f},{rules:[{conditions:[{[t]:b,[u]:r}],rules:[{conditions:[{[t]:"aws.partition",[u]:r,assign:g}],rules:[{conditions:[k,l],rules:[{conditions:[{[t]:c,[u]:[a,n]},o],rules:[{rules:[{endpoint:{url:"https://social-messaging-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},type:e}],type:f}],type:f},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:d}],type:f},{conditions:p,rules:[{conditions:[{[t]:c,[u]:[n,a]}],rules:[{rules:[{endpoint:{url:"https://social-messaging-fips.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:e}],type:f}],type:f},{error:"FIPS is enabled but this partition does not support FIPS",type:d}],type:f},{conditions:q,rules:[{conditions:[o],rules:[{rules:[{endpoint:{url:"https://social-messaging.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},type:e}],type:f}],type:f},{error:"DualStack is enabled but this partition does not support DualStack",type:d}],type:f},{rules:[{endpoint:{url:"https://social-messaging.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:e}],type:f}],type:f}],type:f},{error:"Invalid Configuration: Missing Region",type:d}],type:f}]}; +export const ruleSet: RuleSetObject = _data; diff --git a/clients/client-socialmessaging/src/extensionConfiguration.ts b/clients/client-socialmessaging/src/extensionConfiguration.ts new file mode 100644 index 000000000000..cb7397c0c1f6 --- /dev/null +++ b/clients/client-socialmessaging/src/extensionConfiguration.ts @@ -0,0 +1,15 @@ +// smithy-typescript generated code +import { AwsRegionExtensionConfiguration } from "@aws-sdk/types"; +import { HttpHandlerExtensionConfiguration } from "@smithy/protocol-http"; +import { DefaultExtensionConfiguration } from "@smithy/types"; + +import { HttpAuthExtensionConfiguration } from "./auth/httpAuthExtensionConfiguration"; + +/** + * @internal + */ +export interface SocialMessagingExtensionConfiguration + extends HttpHandlerExtensionConfiguration, + DefaultExtensionConfiguration, + AwsRegionExtensionConfiguration, + HttpAuthExtensionConfiguration {} diff --git a/clients/client-socialmessaging/src/index.ts b/clients/client-socialmessaging/src/index.ts new file mode 100644 index 000000000000..559e7e0c52a7 --- /dev/null +++ b/clients/client-socialmessaging/src/index.ts @@ -0,0 +1,42 @@ +// smithy-typescript generated code +/* eslint-disable */ +/** + *

+ * Amazon Web Services End User Messaging Social, also referred to as Social messaging, is a messaging service that enables + * application developers to incorporate WhatsApp into their existing workflows. The Amazon Web Services End User Messaging Social API provides information about the + * Amazon Web Services End User Messaging Social API resources, including supported HTTP methods, parameters, and schemas.

+ *

The Amazon Web Services End User Messaging Social API provides programmatic access to options that are unique to the WhatsApp Business Platform.

+ *

If you're new to the Amazon Web Services End User Messaging Social API, it's also helpful to review What is + * Amazon Web Services End User Messaging Social in the Amazon Web Services End User Messaging Social User Guide. The + * Amazon Web Services End User Messaging Social User Guide provides tutorials, code samples, and procedures that demonstrate how to use + * Amazon Web Services End User Messaging Social API features programmatically and how to integrate functionality into applications. + * The guide also provides key information, such as integration with other Amazon Web Services + * services, and the quotas that apply to use of the service.

+ *

+ * Regional availability + *

+ *

The Amazon Web Services End User Messaging Social API is available across several Amazon Web Services Regions and it provides a dedicated endpoint for each of these Regions. For a list of + * all the Regions and endpoints where the API is currently available, see Amazon Web Services Service Endpoints and Amazon Web Services End User Messaging endpoints and quotas in the Amazon Web Services General Reference. To learn more about Amazon Web Services Regions, see + * Managing + * Amazon Web Services Regions in the Amazon Web Services General + * Reference.

+ *

In each Region, Amazon Web Services maintains multiple Availability Zones. These + * Availability Zones are physically isolated from each other, but are united by private, + * low-latency, high-throughput, and highly redundant network connections. These Availability + * Zones enable us to provide very high levels of availability and redundancy, while also + * minimizing latency. To learn more about the number of Availability Zones that are available + * in each Region, see Amazon Web Services Global Infrastructure. + *

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

You do not have sufficient access to perform this action.

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

You do not have sufficient access to perform this action.

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

The tag for a resource.

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

The tag key.

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

The tag value.

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

The registration details for a linked phone number.

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

The unique identifier of the originating phone number associated with the media. Phone + * number identifiers are formatted as + * phone-number-id-01234567890123456789012345678901. Use + * GetLinkedWhatsAppBusinessAccount to find a phone number's + * id.

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

The PIN to use for two-step verification. To reset your PIN follow the directions in + * Updating PIN in the WhatsApp Business Platform Cloud API + * Reference.

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

The two letter ISO region for the location of where Meta will store data.

+ *

+ * Asia–Pacific (APAC) + *

+ *
    + *
  • + *

    Australia AU + *

    + *
  • + *
  • + *

    Indonesia ID + *

    + *
  • + *
  • + *

    India IN + *

    + *
  • + *
  • + *

    Japan JP + *

    + *
  • + *
  • + *

    Singapore SG + *

    + *
  • + *
  • + *

    South Korea KR + *

    + *
  • + *
+ *

+ * Europe + *

+ *
    + *
  • + *

    Germany DE + *

    + *
  • + *
  • + *

    Switzerland CH + *

    + *
  • + *
  • + *

    United Kingdom GB + *

    + *
  • + *
+ *

+ * Latin America (LATAM) + *

+ *
    + *
  • + *

    Brazil BR + *

    + *
  • + *
+ *

+ * Middle East and Africa (MEA) + *

+ *
    + *
  • + *

    Bahrain BH + *

    + *
  • + *
  • + *

    South Africa ZA + *

    + *
  • + *
  • + *

    United Arab Emirates AE + *

    + *
  • + *
+ *

+ * North America (NORAM) + *

+ *
    + *
  • + *

    Canada CA + *

    + *
  • + *
+ * @public + */ + dataLocalizationRegion?: string; + + /** + *

An array of key and value pair tags.

+ * @public + */ + tags?: Tag[]; +} + +/** + *

Contains information on the event destination.

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

The ARN of the event destination.

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

The registration details for a linked WhatsApp Business Account.

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

The ID of the linked WhatsApp Business Account, formatted as waba-01234567890123456789012345678901.

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

The event destinations for the linked WhatsApp Business Account.

+ * @public + */ + eventDestinations?: WhatsAppBusinessAccountEventDestination[]; + + /** + *

An array of key and value pair tags.

+ * @public + */ + tags?: Tag[]; +} + +/** + *

The details of linking a WhatsApp Business Account to your Amazon Web Services account.

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

An Amazon Web Services access token generated by WhatsAppSignupCallback and used by WhatsAppSetupFinalization.

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

An array of WabaPhoneNumberSetupFinalization objects containing the details of each phone number associated with the WhatsApp Business Account.

+ * @public + */ + phoneNumbers: WabaPhoneNumberSetupFinalization[] | undefined; + + /** + *

Used to add a new phone number to an existing WhatsApp Business Account. This field can't be used when the waba field is present.

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

Used to create a new WhatsApp Business Account and add a phone number. This field can't be used when the phoneNumberParent field is present.

+ * @public + */ + waba?: WabaSetupFinalization; +} + +/** + *

Contains the accessToken provided by Meta during signup.

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

The access token for your WhatsApp Business Account. The accessToken value is provided by Meta.

+ * @public + */ + accessToken: string | undefined; +} + +/** + * @public + */ +export interface AssociateWhatsAppBusinessAccountInput { + /** + *

Contains the callback access token.

+ * @public + */ + signupCallback?: WhatsAppSignupCallback; + + /** + *

A JSON object that contains the phone numbers and WhatsApp Business Account to link to your account.

+ * @public + */ + setupFinalization?: WhatsAppSetupFinalization; +} + +/** + * @public + * @enum + */ +export const RegistrationStatus = { + COMPLETE: "COMPLETE", + INCOMPLETE: "INCOMPLETE", +} as const; + +/** + * @public + */ +export type RegistrationStatus = (typeof RegistrationStatus)[keyof typeof RegistrationStatus]; + +/** + *

The details of your WhatsApp phone number.

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

The ARN of the WhatsApp phone number.

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

The phone number for sending WhatsApp.

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

The phone number ID. Phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901.

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

The phone number ID from Meta.

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

The display name for this phone number.

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

The phone number that appears in the recipients display.

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

The quality rating of the phone number.

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

Contains your WhatsApp registration status and details of any unregistered WhatsApp + * phone number.

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

The name of your account.

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

The registration status of the linked WhatsApp Business Account.

+ * @public + */ + registrationStatus?: RegistrationStatus; + + /** + *

The details for unregistered WhatsApp phone numbers.

+ * @public + */ + unregisteredWhatsAppPhoneNumbers?: WhatsAppPhoneNumberDetail[]; +} + +/** + *

Contains the results of WhatsAppSignupCallback.

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

An Amazon Web Services access token generated by WhatsAppSignupCallback and used by WhatsAppSetupFinalization.

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

A LinkedWhatsAppBusinessAccountIdMetaData object map containing the details of any WhatsAppBusiness accounts that have incomplete setup.

+ * @public + */ + linkedAccountsWithIncompleteSetup?: Record; +} + +/** + * @public + */ +export interface AssociateWhatsAppBusinessAccountOutput { + /** + *

Contains your WhatsApp registration status.

+ * @public + */ + signupCallbackResult?: WhatsAppSignupCallbackResult; + + /** + *

The status code for the response.

+ * @public + */ + statusCode?: number; +} + +/** + *

Thrown when performing an action because a dependency would be broken.

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

One or more parameters provided to the action are not valid.

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

The request was denied due to request throttling.

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

The request contains an invalid parameter value.

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

The unique identifier of the media file to delete. Use the mediaId returned from PostWhatsAppMessageMedia.

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

The unique identifier of the originating phone number associated with the media. Phone + * number identifiers are formatted as + * phone-number-id-01234567890123456789012345678901. Use + * GetLinkedWhatsAppBusinessAccount to find a phone number's + * id.

+ * @public + */ + originationPhoneNumberId: string | undefined; +} + +/** + * @public + */ +export interface DeleteWhatsAppMessageMediaOutput { + /** + *

Success indicator for deleting the media file.

+ * @public + */ + success?: boolean; +} + +/** + *

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

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

The resource was not found.

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

The unique identifier of your WhatsApp Business Account. WABA identifiers are formatted as + * waba-01234567890123456789012345678901. Use + * ListLinkedWhatsAppBusinessAccounts to list all WABAs and their details.

+ * @public + */ + id: string | undefined; +} + +/** + * @public + */ +export interface DisassociateWhatsAppBusinessAccountOutput {} + +/** + * @public + */ +export interface GetLinkedWhatsAppBusinessAccountInput { + /** + *

The unique identifier, from Amazon Web Services, of the linked WhatsApp Business + * Account. WABA identifiers are formatted as + * waba-01234567890123456789012345678901. Use + * ListLinkedWhatsAppBusinessAccounts to list all WABAs and their details.

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

The details of a linked phone number.

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

The full Amazon Resource Name (ARN) for the phone number.

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

The phone number associated with the Linked WhatsApp Business Account.

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

The phone number ID. Phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901.

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

The phone number ID from Meta.

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

The display name for this phone number.

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

The phone number that appears in the recipients display.

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

The quality rating of the phone number. This is from Meta.

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

The details of your linked WhatsApp Business Account.

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

The ARN of the linked WhatsApp Business Account.

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

The ID of the linked WhatsApp Business Account, formatted as waba-01234567890123456789012345678901.

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

The WhatsApp Business Account ID from meta.

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

The registration status of the linked WhatsApp Business Account.

+ * @public + */ + registrationStatus: RegistrationStatus | undefined; + + /** + *

The date the WhatsApp Business Account was linked.

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

The name of the linked WhatsApp Business Account.

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

The event destinations for the linked WhatsApp Business Account.

+ * @public + */ + eventDestinations: WhatsAppBusinessAccountEventDestination[] | undefined; + + /** + *

The phone numbers associated with the Linked WhatsApp Business Account.

+ * @public + */ + phoneNumbers: WhatsAppPhoneNumberSummary[] | undefined; +} + +/** + * @public + */ +export interface GetLinkedWhatsAppBusinessAccountOutput { + /** + *

The details of the linked WhatsApp Business Account.

+ * @public + */ + account?: LinkedWhatsAppBusinessAccount; +} + +/** + * @public + */ +export interface GetLinkedWhatsAppBusinessAccountPhoneNumberInput { + /** + *

The unique identifier of the phone number. Phone number + * identifiers are formatted as phone-number-id-01234567890123456789012345678901. + * Use GetLinkedWhatsAppBusinessAccount to find a phone number's + * id.

+ * @public + */ + id: string | undefined; +} + +/** + * @public + */ +export interface GetLinkedWhatsAppBusinessAccountPhoneNumberOutput { + /** + *

The details of your WhatsApp phone number.

+ * @public + */ + phoneNumber?: WhatsAppPhoneNumberDetail; + + /** + *

The WABA identifier linked to the phone number, formatted as + * waba-01234567890123456789012345678901.

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

Contains information for the S3 bucket that contains media files.

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

The bucket name.

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

The object key of the media file.

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

You can use presigned URLs to grant time-limited access to objects in Amazon S3 without updating your bucket policy. For more information, see Working with presigned URLs in the Amazon S3 + * User Guide.

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

The presign url to the object.

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

A map of headers and their values. You must specify the Content-Type header when using PostWhatsAppMessageMedia. For a list of common headers, see Common Request Headers in the Amazon S3 + * API Reference + *

+ * @public + */ + headers: Record | undefined; +} + +/** + * @public + */ +export interface GetWhatsAppMessageMediaInput { + /** + *

The unique identifier for the media file.

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

The unique identifier of the originating phone number for the WhatsApp message media. + * The phone number identifiers are formatted as + * phone-number-id-01234567890123456789012345678901. Use + * GetLinkedWhatsAppBusinessAccount to find a phone number's + * id.

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

Set to True to get only the metadata for the file.

+ * @public + */ + metadataOnly?: boolean; + + /** + *

The presign url of the media file.

+ * @public + */ + destinationS3PresignedUrl?: S3PresignedUrl; + + /** + *

The bucketName and key of the S3 media file.

+ * @public + */ + destinationS3File?: S3File; +} + +/** + * @public + */ +export interface GetWhatsAppMessageMediaOutput { + /** + *

The MIME type of the media.

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

The file size of the media, in KB.

+ * @public + */ + fileSize?: number; +} + +/** + * @public + */ +export interface ListLinkedWhatsAppBusinessAccountsInput { + /** + *

The next token for pagination.

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

The maximum number of results to return.

+ * @public + */ + maxResults?: number; +} + +/** + *

The details of a linked WhatsApp Business Account.

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

The ARN of the linked WhatsApp Business Account.

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

The ID of the linked WhatsApp Business Account, formatted as waba-01234567890123456789012345678901.

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

The WhatsApp Business Account ID provided by Meta.

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

The registration status of the linked WhatsApp Business Account.

+ * @public + */ + registrationStatus: RegistrationStatus | undefined; + + /** + *

The date the WhatsApp Business Account was linked.

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

The name of the linked WhatsApp Business Account.

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

The event destinations for the linked WhatsApp Business Account.

+ * @public + */ + eventDestinations: WhatsAppBusinessAccountEventDestination[] | undefined; +} + +/** + * @public + */ +export interface ListLinkedWhatsAppBusinessAccountsOutput { + /** + *

A list of WhatsApp Business Accounts linked to your Amazon Web Services account.

+ * @public + */ + linkedAccounts?: LinkedWhatsAppBusinessAccountSummary[]; + + /** + *

The next token for pagination.

+ * @public + */ + nextToken?: string; +} + +/** + * @public + */ +export interface PutWhatsAppBusinessAccountEventDestinationsInput { + /** + *

The unique identifier of your WhatsApp Business Account. WABA identifiers are formatted as + * waba-01234567890123456789012345678901. Use + * ListLinkedWhatsAppBusinessAccounts to list all WABAs and their details.

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

An array of WhatsAppBusinessAccountEventDestination event destinations.

+ * @public + */ + eventDestinations: WhatsAppBusinessAccountEventDestination[] | undefined; +} + +/** + * @public + */ +export interface PutWhatsAppBusinessAccountEventDestinationsOutput {} + +/** + * @public + */ +export interface PostWhatsAppMessageMediaInput { + /** + *

The ID of the phone number to associate with the WhatsApp media file. The phone number + * identifiers are formatted as phone-number-id-01234567890123456789012345678901. + * Use GetLinkedWhatsAppBusinessAccount to find a phone number's + * id.

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

The source presign url of the media file.

+ * @public + */ + sourceS3PresignedUrl?: S3PresignedUrl; + + /** + *

The source S3 url for the media file.

+ * @public + */ + sourceS3File?: S3File; +} + +/** + * @public + */ +export interface PostWhatsAppMessageMediaOutput { + /** + *

The unique identifier of the posted WhatsApp message.

+ * @public + */ + mediaId?: string; +} + +/** + * @public + */ +export interface SendWhatsAppMessageInput { + /** + *

The ID of the phone number used to send the WhatsApp message. If you are sending a media + * file only the originationPhoneNumberId used to upload the file can be used. + * Phone number identifiers are formatted as + * phone-number-id-01234567890123456789012345678901. Use + * GetLinkedWhatsAppBusinessAccount to find a phone number's + * id.

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

The message to send through WhatsApp. The length is in KB. The message field passes through a WhatsApp + * Message object, see Messages in the WhatsApp Business Platform Cloud API + * Reference.

+ * @public + */ + message: Uint8Array | undefined; + + /** + *

The API version for the request formatted as v\{VersionNumber\}. For a list of supported API versions and Amazon Web Services Regions, see + * Amazon Web Services End User Messaging Social API Service Endpoints in the Amazon Web Services General Reference.

+ * @public + */ + metaApiVersion: string | undefined; +} + +/** + * @public + */ +export interface SendWhatsAppMessageOutput { + /** + *

The unique identifier of the message.

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

The Amazon Resource Name (ARN) of the resource to retrieve the tags from.

+ * @public + */ + resourceArn: string | undefined; +} + +/** + * @public + */ +export interface ListTagsForResourceOutput { + /** + *

The status code of the response.

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

The tags for the resource.

+ * @public + */ + tags?: Tag[]; +} + +/** + * @public + */ +export interface TagResourceInput { + /** + *

The Amazon Resource Name (ARN) of the resource to tag.

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

The tags to add to the resource.

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

The status code of the tag resource operation.

+ * @public + */ + statusCode?: number; +} + +/** + * @public + */ +export interface UntagResourceInput { + /** + *

The Amazon Resource Name (ARN) of the resource to remove tags from.

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

The keys of the tags to remove from the resource.

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

The status code of the untag resource operation.

+ * @public + */ + statusCode?: number; +} + +/** + * @internal + */ +export const WabaPhoneNumberSetupFinalizationFilterSensitiveLog = (obj: WabaPhoneNumberSetupFinalization): any => ({ + ...obj, + ...(obj.twoFactorPin && { twoFactorPin: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const WhatsAppSetupFinalizationFilterSensitiveLog = (obj: WhatsAppSetupFinalization): any => ({ + ...obj, + ...(obj.associateInProgressToken && { associateInProgressToken: SENSITIVE_STRING }), + ...(obj.phoneNumbers && { + phoneNumbers: obj.phoneNumbers.map((item) => WabaPhoneNumberSetupFinalizationFilterSensitiveLog(item)), + }), +}); + +/** + * @internal + */ +export const AssociateWhatsAppBusinessAccountInputFilterSensitiveLog = ( + obj: AssociateWhatsAppBusinessAccountInput +): any => ({ + ...obj, + ...(obj.setupFinalization && { + setupFinalization: WhatsAppSetupFinalizationFilterSensitiveLog(obj.setupFinalization), + }), +}); + +/** + * @internal + */ +export const WhatsAppSignupCallbackResultFilterSensitiveLog = (obj: WhatsAppSignupCallbackResult): any => ({ + ...obj, + ...(obj.associateInProgressToken && { associateInProgressToken: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const AssociateWhatsAppBusinessAccountOutputFilterSensitiveLog = ( + obj: AssociateWhatsAppBusinessAccountOutput +): any => ({ + ...obj, + ...(obj.signupCallbackResult && { + signupCallbackResult: WhatsAppSignupCallbackResultFilterSensitiveLog(obj.signupCallbackResult), + }), +}); + +/** + * @internal + */ +export const S3FileFilterSensitiveLog = (obj: S3File): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const S3PresignedUrlFilterSensitiveLog = (obj: S3PresignedUrl): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const GetWhatsAppMessageMediaInputFilterSensitiveLog = (obj: GetWhatsAppMessageMediaInput): any => ({ + ...obj, + ...(obj.destinationS3PresignedUrl && { destinationS3PresignedUrl: SENSITIVE_STRING }), + ...(obj.destinationS3File && { destinationS3File: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const PostWhatsAppMessageMediaInputFilterSensitiveLog = (obj: PostWhatsAppMessageMediaInput): any => ({ + ...obj, + ...(obj.sourceS3PresignedUrl && { sourceS3PresignedUrl: SENSITIVE_STRING }), + ...(obj.sourceS3File && { sourceS3File: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const SendWhatsAppMessageInputFilterSensitiveLog = (obj: SendWhatsAppMessageInput): any => ({ + ...obj, + ...(obj.message && { message: SENSITIVE_STRING }), +}); diff --git a/clients/client-socialmessaging/src/pagination/Interfaces.ts b/clients/client-socialmessaging/src/pagination/Interfaces.ts new file mode 100644 index 000000000000..a393745e75d6 --- /dev/null +++ b/clients/client-socialmessaging/src/pagination/Interfaces.ts @@ -0,0 +1,11 @@ +// smithy-typescript generated code +import { PaginationConfiguration } from "@smithy/types"; + +import { SocialMessagingClient } from "../SocialMessagingClient"; + +/** + * @public + */ +export interface SocialMessagingPaginationConfiguration extends PaginationConfiguration { + client: SocialMessagingClient; +} diff --git a/clients/client-socialmessaging/src/pagination/ListLinkedWhatsAppBusinessAccountsPaginator.ts b/clients/client-socialmessaging/src/pagination/ListLinkedWhatsAppBusinessAccountsPaginator.ts new file mode 100644 index 000000000000..757460f23912 --- /dev/null +++ b/clients/client-socialmessaging/src/pagination/ListLinkedWhatsAppBusinessAccountsPaginator.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { createPaginator } from "@smithy/core"; +import { Paginator } from "@smithy/types"; + +import { + ListLinkedWhatsAppBusinessAccountsCommand, + ListLinkedWhatsAppBusinessAccountsCommandInput, + ListLinkedWhatsAppBusinessAccountsCommandOutput, +} from "../commands/ListLinkedWhatsAppBusinessAccountsCommand"; +import { SocialMessagingClient } from "../SocialMessagingClient"; +import { SocialMessagingPaginationConfiguration } from "./Interfaces"; + +/** + * @public + */ +export const paginateListLinkedWhatsAppBusinessAccounts: ( + config: SocialMessagingPaginationConfiguration, + input: ListLinkedWhatsAppBusinessAccountsCommandInput, + ...rest: any[] +) => Paginator = createPaginator< + SocialMessagingPaginationConfiguration, + ListLinkedWhatsAppBusinessAccountsCommandInput, + ListLinkedWhatsAppBusinessAccountsCommandOutput +>(SocialMessagingClient, ListLinkedWhatsAppBusinessAccountsCommand, "nextToken", "nextToken", "maxResults"); diff --git a/clients/client-socialmessaging/src/pagination/index.ts b/clients/client-socialmessaging/src/pagination/index.ts new file mode 100644 index 000000000000..9afdaefec429 --- /dev/null +++ b/clients/client-socialmessaging/src/pagination/index.ts @@ -0,0 +1,3 @@ +// smithy-typescript generated code +export * from "./Interfaces"; +export * from "./ListLinkedWhatsAppBusinessAccountsPaginator"; diff --git a/clients/client-socialmessaging/src/protocols/Aws_restJson1.ts b/clients/client-socialmessaging/src/protocols/Aws_restJson1.ts new file mode 100644 index 000000000000..400d03d42b44 --- /dev/null +++ b/clients/client-socialmessaging/src/protocols/Aws_restJson1.ts @@ -0,0 +1,955 @@ +// smithy-typescript generated code +import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core"; +import { requestBuilder as rb } from "@smithy/core"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { + _json, + collectBody, + decorateServiceException as __decorateServiceException, + expectBoolean as __expectBoolean, + expectInt32 as __expectInt32, + expectLong as __expectLong, + expectNonNull as __expectNonNull, + expectNumber as __expectNumber, + expectObject as __expectObject, + expectString as __expectString, + extendedEncodeURIComponent as __extendedEncodeURIComponent, + map, + parseEpochTimestamp as __parseEpochTimestamp, + take, + withBaseException, +} from "@smithy/smithy-client"; +import { + Endpoint as __Endpoint, + ResponseMetadata as __ResponseMetadata, + SerdeContext as __SerdeContext, +} from "@smithy/types"; + +import { + AssociateWhatsAppBusinessAccountCommandInput, + AssociateWhatsAppBusinessAccountCommandOutput, +} from "../commands/AssociateWhatsAppBusinessAccountCommand"; +import { + DeleteWhatsAppMessageMediaCommandInput, + DeleteWhatsAppMessageMediaCommandOutput, +} from "../commands/DeleteWhatsAppMessageMediaCommand"; +import { + DisassociateWhatsAppBusinessAccountCommandInput, + DisassociateWhatsAppBusinessAccountCommandOutput, +} from "../commands/DisassociateWhatsAppBusinessAccountCommand"; +import { + GetLinkedWhatsAppBusinessAccountCommandInput, + GetLinkedWhatsAppBusinessAccountCommandOutput, +} from "../commands/GetLinkedWhatsAppBusinessAccountCommand"; +import { + GetLinkedWhatsAppBusinessAccountPhoneNumberCommandInput, + GetLinkedWhatsAppBusinessAccountPhoneNumberCommandOutput, +} from "../commands/GetLinkedWhatsAppBusinessAccountPhoneNumberCommand"; +import { + GetWhatsAppMessageMediaCommandInput, + GetWhatsAppMessageMediaCommandOutput, +} from "../commands/GetWhatsAppMessageMediaCommand"; +import { + ListLinkedWhatsAppBusinessAccountsCommandInput, + ListLinkedWhatsAppBusinessAccountsCommandOutput, +} from "../commands/ListLinkedWhatsAppBusinessAccountsCommand"; +import { + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "../commands/ListTagsForResourceCommand"; +import { + PostWhatsAppMessageMediaCommandInput, + PostWhatsAppMessageMediaCommandOutput, +} from "../commands/PostWhatsAppMessageMediaCommand"; +import { + PutWhatsAppBusinessAccountEventDestinationsCommandInput, + PutWhatsAppBusinessAccountEventDestinationsCommandOutput, +} from "../commands/PutWhatsAppBusinessAccountEventDestinationsCommand"; +import { + SendWhatsAppMessageCommandInput, + SendWhatsAppMessageCommandOutput, +} from "../commands/SendWhatsAppMessageCommand"; +import { TagResourceCommandInput, TagResourceCommandOutput } from "../commands/TagResourceCommand"; +import { UntagResourceCommandInput, UntagResourceCommandOutput } from "../commands/UntagResourceCommand"; +import { + AccessDeniedByMetaException, + AccessDeniedException, + DependencyException, + InternalServiceException, + InvalidParametersException, + LinkedWhatsAppBusinessAccount, + LinkedWhatsAppBusinessAccountSummary, + ResourceNotFoundException, + S3File, + S3PresignedUrl, + Tag, + ThrottledRequestException, + ValidationException, + WabaPhoneNumberSetupFinalization, + WabaSetupFinalization, + WhatsAppBusinessAccountEventDestination, + WhatsAppSetupFinalization, + WhatsAppSignupCallback, +} from "../models/models_0"; +import { SocialMessagingServiceException as __BaseException } from "../models/SocialMessagingServiceException"; + +/** + * serializeAws_restJson1AssociateWhatsAppBusinessAccountCommand + */ +export const se_AssociateWhatsAppBusinessAccountCommand = async ( + input: AssociateWhatsAppBusinessAccountCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/v1/whatsapp/signup"); + let body: any; + body = JSON.stringify( + take(input, { + setupFinalization: (_) => _json(_), + signupCallback: (_) => _json(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1DeleteWhatsAppMessageMediaCommand + */ +export const se_DeleteWhatsAppMessageMediaCommand = async ( + input: DeleteWhatsAppMessageMediaCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/v1/whatsapp/media"); + const query: any = map({ + [_mI]: [, __expectNonNull(input[_mI]!, `mediaId`)], + [_oPNI]: [, __expectNonNull(input[_oPNI]!, `originationPhoneNumberId`)], + }); + let body: any; + b.m("DELETE").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1DisassociateWhatsAppBusinessAccountCommand + */ +export const se_DisassociateWhatsAppBusinessAccountCommand = async ( + input: DisassociateWhatsAppBusinessAccountCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/v1/whatsapp/waba/disassociate"); + const query: any = map({ + [_i]: [, __expectNonNull(input[_i]!, `id`)], + }); + let body: any; + b.m("DELETE").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1GetLinkedWhatsAppBusinessAccountCommand + */ +export const se_GetLinkedWhatsAppBusinessAccountCommand = async ( + input: GetLinkedWhatsAppBusinessAccountCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/v1/whatsapp/waba/details"); + const query: any = map({ + [_i]: [, __expectNonNull(input[_i]!, `id`)], + }); + let body: any; + b.m("GET").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1GetLinkedWhatsAppBusinessAccountPhoneNumberCommand + */ +export const se_GetLinkedWhatsAppBusinessAccountPhoneNumberCommand = async ( + input: GetLinkedWhatsAppBusinessAccountPhoneNumberCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/v1/whatsapp/waba/phone/details"); + const query: any = map({ + [_i]: [, __expectNonNull(input[_i]!, `id`)], + }); + let body: any; + b.m("GET").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1GetWhatsAppMessageMediaCommand + */ +export const se_GetWhatsAppMessageMediaCommand = async ( + input: GetWhatsAppMessageMediaCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/v1/whatsapp/media/get"); + let body: any; + body = JSON.stringify( + take(input, { + destinationS3File: (_) => _json(_), + destinationS3PresignedUrl: (_) => _json(_), + mediaId: [], + metadataOnly: [], + originationPhoneNumberId: [], + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1ListLinkedWhatsAppBusinessAccountsCommand + */ +export const se_ListLinkedWhatsAppBusinessAccountsCommand = async ( + input: ListLinkedWhatsAppBusinessAccountsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/v1/whatsapp/waba/list"); + const query: any = map({ + [_nT]: [, input[_nT]!], + [_mR]: [() => input.maxResults !== void 0, () => input[_mR]!.toString()], + }); + let body: any; + b.m("GET").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1ListTagsForResourceCommand + */ +export const se_ListTagsForResourceCommand = async ( + input: ListTagsForResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/v1/tags/list"); + const query: any = map({ + [_rA]: [, __expectNonNull(input[_rA]!, `resourceArn`)], + }); + let body: any; + b.m("GET").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1PostWhatsAppMessageMediaCommand + */ +export const se_PostWhatsAppMessageMediaCommand = async ( + input: PostWhatsAppMessageMediaCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/v1/whatsapp/media"); + let body: any; + body = JSON.stringify( + take(input, { + originationPhoneNumberId: [], + sourceS3File: (_) => _json(_), + sourceS3PresignedUrl: (_) => _json(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1PutWhatsAppBusinessAccountEventDestinationsCommand + */ +export const se_PutWhatsAppBusinessAccountEventDestinationsCommand = async ( + input: PutWhatsAppBusinessAccountEventDestinationsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/v1/whatsapp/waba/eventdestinations"); + let body: any; + body = JSON.stringify( + take(input, { + eventDestinations: (_) => _json(_), + id: [], + }) + ); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1SendWhatsAppMessageCommand + */ +export const se_SendWhatsAppMessageCommand = async ( + input: SendWhatsAppMessageCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/v1/whatsapp/send"); + let body: any; + body = JSON.stringify( + take(input, { + message: (_) => context.base64Encoder(_), + metaApiVersion: [], + originationPhoneNumberId: [], + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1TagResourceCommand + */ +export const se_TagResourceCommand = async ( + input: TagResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/v1/tags/tag-resource"); + let body: any; + body = JSON.stringify( + take(input, { + resourceArn: [], + tags: (_) => _json(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1UntagResourceCommand + */ +export const se_UntagResourceCommand = async ( + input: UntagResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/v1/tags/untag-resource"); + let body: any; + body = JSON.stringify( + take(input, { + resourceArn: [], + tagKeys: (_) => _json(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * deserializeAws_restJson1AssociateWhatsAppBusinessAccountCommand + */ +export const de_AssociateWhatsAppBusinessAccountCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + signupCallbackResult: _json, + statusCode: __expectInt32, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1DeleteWhatsAppMessageMediaCommand + */ +export const de_DeleteWhatsAppMessageMediaCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + success: __expectBoolean, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1DisassociateWhatsAppBusinessAccountCommand + */ +export const de_DisassociateWhatsAppBusinessAccountCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1GetLinkedWhatsAppBusinessAccountCommand + */ +export const de_GetLinkedWhatsAppBusinessAccountCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + account: (_) => de_LinkedWhatsAppBusinessAccount(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1GetLinkedWhatsAppBusinessAccountPhoneNumberCommand + */ +export const de_GetLinkedWhatsAppBusinessAccountPhoneNumberCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + linkedWhatsAppBusinessAccountId: __expectString, + phoneNumber: _json, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1GetWhatsAppMessageMediaCommand + */ +export const de_GetWhatsAppMessageMediaCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + fileSize: __expectLong, + mimeType: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListLinkedWhatsAppBusinessAccountsCommand + */ +export const de_ListLinkedWhatsAppBusinessAccountsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + linkedAccounts: (_) => de_LinkedWhatsAppBusinessAccountSummaryList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListTagsForResourceCommand + */ +export const de_ListTagsForResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + statusCode: __expectInt32, + tags: _json, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1PostWhatsAppMessageMediaCommand + */ +export const de_PostWhatsAppMessageMediaCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + mediaId: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1PutWhatsAppBusinessAccountEventDestinationsCommand + */ +export const de_PutWhatsAppBusinessAccountEventDestinationsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1SendWhatsAppMessageCommand + */ +export const de_SendWhatsAppMessageCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + messageId: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1TagResourceCommand + */ +export const de_TagResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + statusCode: __expectInt32, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1UntagResourceCommand + */ +export const de_UntagResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + statusCode: __expectInt32, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserialize_Aws_restJson1CommandError + */ +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.socialmessaging#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "DependencyException": + case "com.amazonaws.socialmessaging#DependencyException": + throw await de_DependencyExceptionRes(parsedOutput, context); + case "InvalidParametersException": + case "com.amazonaws.socialmessaging#InvalidParametersException": + throw await de_InvalidParametersExceptionRes(parsedOutput, context); + case "ThrottledRequestException": + case "com.amazonaws.socialmessaging#ThrottledRequestException": + throw await de_ThrottledRequestExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.socialmessaging#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + case "AccessDeniedByMetaException": + case "com.amazonaws.socialmessaging#AccessDeniedByMetaException": + throw await de_AccessDeniedByMetaExceptionRes(parsedOutput, context); + case "InternalServiceException": + case "com.amazonaws.socialmessaging#InternalServiceException": + throw await de_InternalServiceExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.socialmessaging#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }) as never; + } +}; + +const throwDefaultError = withBaseException(__BaseException); +/** + * deserializeAws_restJson1AccessDeniedByMetaExceptionRes + */ +const de_AccessDeniedByMetaExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new AccessDeniedByMetaException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1AccessDeniedExceptionRes + */ +const de_AccessDeniedExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new AccessDeniedException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1DependencyExceptionRes + */ +const de_DependencyExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new DependencyException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1InternalServiceExceptionRes + */ +const de_InternalServiceExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new InternalServiceException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1InvalidParametersExceptionRes + */ +const de_InvalidParametersExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new InvalidParametersException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1ResourceNotFoundExceptionRes + */ +const de_ResourceNotFoundExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new ResourceNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1ThrottledRequestExceptionRes + */ +const de_ThrottledRequestExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new ThrottledRequestException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1ValidationExceptionRes + */ +const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new ValidationException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +// se_Headers omitted. + +// se_S3File omitted. + +// se_S3PresignedUrl omitted. + +// se_StringList omitted. + +// se_Tag omitted. + +// se_TagList omitted. + +// se_WabaPhoneNumberSetupFinalization omitted. + +// se_WabaPhoneNumberSetupFinalizationList omitted. + +// se_WabaSetupFinalization omitted. + +// se_WhatsAppBusinessAccountEventDestination omitted. + +// se_WhatsAppBusinessAccountEventDestinations omitted. + +// se_WhatsAppSetupFinalization omitted. + +// se_WhatsAppSignupCallback omitted. + +// de_LinkedAccountWithIncompleteSetup omitted. + +/** + * deserializeAws_restJson1LinkedWhatsAppBusinessAccount + */ +const de_LinkedWhatsAppBusinessAccount = (output: any, context: __SerdeContext): LinkedWhatsAppBusinessAccount => { + return take(output, { + arn: __expectString, + eventDestinations: _json, + id: __expectString, + linkDate: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + phoneNumbers: _json, + registrationStatus: __expectString, + wabaId: __expectString, + wabaName: __expectString, + }) as any; +}; + +// de_LinkedWhatsAppBusinessAccountIdMetaData omitted. + +/** + * deserializeAws_restJson1LinkedWhatsAppBusinessAccountSummary + */ +const de_LinkedWhatsAppBusinessAccountSummary = ( + output: any, + context: __SerdeContext +): LinkedWhatsAppBusinessAccountSummary => { + return take(output, { + arn: __expectString, + eventDestinations: _json, + id: __expectString, + linkDate: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + registrationStatus: __expectString, + wabaId: __expectString, + wabaName: __expectString, + }) as any; +}; + +/** + * deserializeAws_restJson1LinkedWhatsAppBusinessAccountSummaryList + */ +const de_LinkedWhatsAppBusinessAccountSummaryList = ( + output: any, + context: __SerdeContext +): LinkedWhatsAppBusinessAccountSummary[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_LinkedWhatsAppBusinessAccountSummary(entry, context); + }); + return retVal; +}; + +// de_Tag omitted. + +// de_TagList omitted. + +// de_WhatsAppBusinessAccountEventDestination omitted. + +// de_WhatsAppBusinessAccountEventDestinations omitted. + +// de_WhatsAppPhoneNumberDetail omitted. + +// de_WhatsAppPhoneNumberDetailList omitted. + +// de_WhatsAppPhoneNumberSummary omitted. + +// de_WhatsAppPhoneNumberSummaryList omitted. + +// de_WhatsAppSignupCallbackResult omitted. + +const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ + httpStatusCode: output.statusCode, + requestId: + output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"], +}); + +// Encode Uint8Array data into string with utf-8. +const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => + collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); + +const _i = "id"; +const _mI = "mediaId"; +const _mR = "maxResults"; +const _nT = "nextToken"; +const _oPNI = "originationPhoneNumberId"; +const _rA = "resourceArn"; diff --git a/clients/client-socialmessaging/src/runtimeConfig.browser.ts b/clients/client-socialmessaging/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..357b9538c283 --- /dev/null +++ b/clients/client-socialmessaging/src/runtimeConfig.browser.ts @@ -0,0 +1,44 @@ +// smithy-typescript generated code +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; // eslint-disable-line + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver"; +import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler"; +import { invalidProvider } from "@smithy/invalid-dependency"; +import { calculateBodyLength } from "@smithy/util-body-length-browser"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry"; +import { SocialMessagingClientConfig } from "./SocialMessagingClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@smithy/smithy-client"; +import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-browser"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SocialMessagingClientConfig) => { + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), + retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)), + useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)), + }; +}; diff --git a/clients/client-socialmessaging/src/runtimeConfig.native.ts b/clients/client-socialmessaging/src/runtimeConfig.native.ts new file mode 100644 index 000000000000..4bb0e8b40a33 --- /dev/null +++ b/clients/client-socialmessaging/src/runtimeConfig.native.ts @@ -0,0 +1,18 @@ +// smithy-typescript generated code +import { Sha256 } from "@aws-crypto/sha256-js"; + +import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser"; +import { SocialMessagingClientConfig } from "./SocialMessagingClient"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SocialMessagingClientConfig) => { + const browserDefaults = getBrowserRuntimeConfig(config); + return { + ...browserDefaults, + ...config, + runtime: "react-native", + sha256: config?.sha256 ?? Sha256, + }; +}; diff --git a/clients/client-socialmessaging/src/runtimeConfig.shared.ts b/clients/client-socialmessaging/src/runtimeConfig.shared.ts new file mode 100644 index 000000000000..8b42ee982ab4 --- /dev/null +++ b/clients/client-socialmessaging/src/runtimeConfig.shared.ts @@ -0,0 +1,38 @@ +// smithy-typescript generated code +import { AwsSdkSigV4Signer } from "@aws-sdk/core"; +import { NoOpLogger } from "@smithy/smithy-client"; +import { IdentityProviderConfig } from "@smithy/types"; +import { parseUrl } from "@smithy/url-parser"; +import { fromBase64, toBase64 } from "@smithy/util-base64"; +import { fromUtf8, toUtf8 } from "@smithy/util-utf8"; + +import { defaultSocialMessagingHttpAuthSchemeProvider } from "./auth/httpAuthSchemeProvider"; +import { defaultEndpointResolver } from "./endpoint/endpointResolver"; +import { SocialMessagingClientConfig } from "./SocialMessagingClient"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SocialMessagingClientConfig) => { + return { + apiVersion: "2024-01-01", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? defaultEndpointResolver, + extensions: config?.extensions ?? [], + httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSocialMessagingHttpAuthSchemeProvider, + httpAuthSchemes: config?.httpAuthSchemes ?? [ + { + schemeId: "aws.auth#sigv4", + identityProvider: (ipc: IdentityProviderConfig) => ipc.getIdentityProvider("aws.auth#sigv4"), + signer: new AwsSdkSigV4Signer(), + }, + ], + logger: config?.logger ?? new NoOpLogger(), + serviceId: config?.serviceId ?? "SocialMessaging", + urlParser: config?.urlParser ?? parseUrl, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-socialmessaging/src/runtimeConfig.ts b/clients/client-socialmessaging/src/runtimeConfig.ts new file mode 100644 index 000000000000..57a13a505d8e --- /dev/null +++ b/clients/client-socialmessaging/src/runtimeConfig.ts @@ -0,0 +1,60 @@ +// smithy-typescript generated code +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; // eslint-disable-line + +import { emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { NODE_APP_ID_CONFIG_OPTIONS, defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { + NODE_REGION_CONFIG_FILE_OPTIONS, + NODE_REGION_CONFIG_OPTIONS, + NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, + NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, +} from "@smithy/config-resolver"; +import { Hash } from "@smithy/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider"; +import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler"; +import { calculateBodyLength } from "@smithy/util-body-length-node"; +import { DEFAULT_RETRY_MODE } from "@smithy/util-retry"; +import { SocialMessagingClientConfig } from "./SocialMessagingClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@smithy/smithy-client"; +import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node"; +import { emitWarningIfUnsupportedVersion } from "@smithy/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SocialMessagingClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + awsCheckVersion(process.version); + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider, + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), + retryMode: + config?.retryMode ?? + loadNodeConfig({ + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + }; +}; diff --git a/clients/client-socialmessaging/src/runtimeExtensions.ts b/clients/client-socialmessaging/src/runtimeExtensions.ts new file mode 100644 index 000000000000..a5d3f1b937e3 --- /dev/null +++ b/clients/client-socialmessaging/src/runtimeExtensions.ts @@ -0,0 +1,48 @@ +// smithy-typescript generated code +import { + getAwsRegionExtensionConfiguration, + resolveAwsRegionExtensionConfiguration, +} from "@aws-sdk/region-config-resolver"; +import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http"; +import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client"; + +import { getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig } from "./auth/httpAuthExtensionConfiguration"; +import { SocialMessagingExtensionConfiguration } from "./extensionConfiguration"; + +/** + * @public + */ +export interface RuntimeExtension { + configure(extensionConfiguration: SocialMessagingExtensionConfiguration): void; +} + +/** + * @public + */ +export interface RuntimeExtensionsConfig { + extensions: RuntimeExtension[]; +} + +const asPartial = >(t: T) => t; + +/** + * @internal + */ +export const resolveRuntimeExtensions = (runtimeConfig: any, extensions: RuntimeExtension[]) => { + const extensionConfiguration: SocialMessagingExtensionConfiguration = { + ...asPartial(getAwsRegionExtensionConfiguration(runtimeConfig)), + ...asPartial(getDefaultExtensionConfiguration(runtimeConfig)), + ...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)), + ...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig)), + }; + + extensions.forEach((extension) => extension.configure(extensionConfiguration)); + + return { + ...runtimeConfig, + ...resolveAwsRegionExtensionConfiguration(extensionConfiguration), + ...resolveDefaultRuntimeConfig(extensionConfiguration), + ...resolveHttpHandlerRuntimeConfig(extensionConfiguration), + ...resolveHttpAuthRuntimeConfig(extensionConfiguration), + }; +}; diff --git a/clients/client-socialmessaging/tsconfig.cjs.json b/clients/client-socialmessaging/tsconfig.cjs.json new file mode 100644 index 000000000000..3567d85ba846 --- /dev/null +++ b/clients/client-socialmessaging/tsconfig.cjs.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "outDir": "dist-cjs" + } +} diff --git a/clients/client-socialmessaging/tsconfig.es.json b/clients/client-socialmessaging/tsconfig.es.json new file mode 100644 index 000000000000..809f57bde65e --- /dev/null +++ b/clients/client-socialmessaging/tsconfig.es.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "lib": ["dom"], + "module": "esnext", + "outDir": "dist-es" + } +} diff --git a/clients/client-socialmessaging/tsconfig.json b/clients/client-socialmessaging/tsconfig.json new file mode 100644 index 000000000000..e7f5ec56b742 --- /dev/null +++ b/clients/client-socialmessaging/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "@tsconfig/node16/tsconfig.json", + "compilerOptions": { + "downlevelIteration": true, + "importHelpers": true, + "incremental": true, + "removeComments": true, + "resolveJsonModule": true, + "rootDir": "src", + "useUnknownInCatchVariables": false + }, + "exclude": ["test/"] +} diff --git a/clients/client-socialmessaging/tsconfig.types.json b/clients/client-socialmessaging/tsconfig.types.json new file mode 100644 index 000000000000..4c3dfa7b3d25 --- /dev/null +++ b/clients/client-socialmessaging/tsconfig.types.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "removeComments": false, + "declaration": true, + "declarationDir": "dist-types", + "emitDeclarationOnly": true + }, + "exclude": ["test/**/*", "dist-types/**/*"] +} diff --git a/codegen/sdk-codegen/aws-models/socialmessaging.json b/codegen/sdk-codegen/aws-models/socialmessaging.json new file mode 100644 index 000000000000..7dd6a36ce7b4 --- /dev/null +++ b/codegen/sdk-codegen/aws-models/socialmessaging.json @@ -0,0 +1,2664 @@ +{ + "smithy": "2.0", + "shapes": { + "com.amazonaws.socialmessaging#AccessDeniedByMetaException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.socialmessaging#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

You do not have sufficient access to perform this action.

", + "smithy.api#error": "client", + "smithy.api#httpError": 403 + } + }, + "com.amazonaws.socialmessaging#AccessDeniedException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.socialmessaging#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

You do not have sufficient access to perform this action.

", + "smithy.api#error": "client", + "smithy.api#httpError": 403 + } + }, + "com.amazonaws.socialmessaging#Arn": { + "type": "string", + "traits": { + "smithy.api#length": { + "max": 2048 + }, + "smithy.api#pattern": "^arn:.*$" + } + }, + "com.amazonaws.socialmessaging#AssociateInProgressToken": { + "type": "string", + "traits": { + "smithy.api#length": { + "max": 50 + }, + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.socialmessaging#AssociateWhatsAppBusinessAccount": { + "type": "operation", + "input": { + "target": "com.amazonaws.socialmessaging#AssociateWhatsAppBusinessAccountInput" + }, + "output": { + "target": "com.amazonaws.socialmessaging#AssociateWhatsAppBusinessAccountOutput" + }, + "errors": [ + { + "target": "com.amazonaws.socialmessaging#DependencyException" + }, + { + "target": "com.amazonaws.socialmessaging#InvalidParametersException" + }, + { + "target": "com.amazonaws.socialmessaging#ThrottledRequestException" + } + ], + "traits": { + "aws.iam#conditionKeys": ["aws:RequestTag/${TagKey}", "aws:ResourceTag/${TagKey}", "aws:TagKeys"], + "smithy.api#documentation": "

This is only used through the Amazon Web Services console during sign-up to associate your WhatsApp Business Account to your Amazon Web Services account.

", + "smithy.api#http": { + "method": "POST", + "uri": "/v1/whatsapp/signup", + "code": 200 + } + } + }, + "com.amazonaws.socialmessaging#AssociateWhatsAppBusinessAccountInput": { + "type": "structure", + "members": { + "signupCallback": { + "target": "com.amazonaws.socialmessaging#WhatsAppSignupCallback", + "traits": { + "smithy.api#documentation": "

Contains the callback access token.

" + } + }, + "setupFinalization": { + "target": "com.amazonaws.socialmessaging#WhatsAppSetupFinalization", + "traits": { + "smithy.api#documentation": "

A JSON object that contains the phone numbers and WhatsApp Business Account to link to your account.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.socialmessaging#AssociateWhatsAppBusinessAccountOutput": { + "type": "structure", + "members": { + "signupCallbackResult": { + "target": "com.amazonaws.socialmessaging#WhatsAppSignupCallbackResult", + "traits": { + "smithy.api#documentation": "

Contains your WhatsApp registration status.

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

The status code for the response.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.socialmessaging#DeleteWhatsAppMessageMedia": { + "type": "operation", + "input": { + "target": "com.amazonaws.socialmessaging#DeleteWhatsAppMessageMediaInput" + }, + "output": { + "target": "com.amazonaws.socialmessaging#DeleteWhatsAppMessageMediaOutput" + }, + "errors": [ + { + "target": "com.amazonaws.socialmessaging#AccessDeniedByMetaException" + }, + { + "target": "com.amazonaws.socialmessaging#DependencyException" + }, + { + "target": "com.amazonaws.socialmessaging#InternalServiceException" + }, + { + "target": "com.amazonaws.socialmessaging#InvalidParametersException" + }, + { + "target": "com.amazonaws.socialmessaging#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.socialmessaging#ThrottledRequestException" + } + ], + "traits": { + "smithy.api#documentation": "

Delete a media object from the WhatsApp service. If the object is still in an Amazon S3 bucket you should delete it from there too.

", + "smithy.api#http": { + "method": "DELETE", + "uri": "/v1/whatsapp/media", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.socialmessaging#DeleteWhatsAppMessageMediaInput": { + "type": "structure", + "members": { + "mediaId": { + "target": "com.amazonaws.socialmessaging#WhatsAppMediaId", + "traits": { + "smithy.api#documentation": "

The unique identifier of the media file to delete. Use the mediaId returned from PostWhatsAppMessageMedia.

", + "smithy.api#httpQuery": "mediaId", + "smithy.api#required": {} + } + }, + "originationPhoneNumberId": { + "target": "com.amazonaws.socialmessaging#WhatsAppPhoneNumberId", + "traits": { + "smithy.api#documentation": "

The unique identifier of the originating phone number associated with the media. Phone\n number identifiers are formatted as\n phone-number-id-01234567890123456789012345678901. Use\n GetLinkedWhatsAppBusinessAccount to find a phone number's\n id.

", + "smithy.api#httpQuery": "originationPhoneNumberId", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "OriginationPhoneNumberId" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.socialmessaging#DeleteWhatsAppMessageMediaOutput": { + "type": "structure", + "members": { + "success": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "

Success indicator for deleting the media file.

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

Thrown when performing an action because a dependency would be broken.

", + "smithy.api#error": "server", + "smithy.api#httpError": 502, + "smithy.api#retryable": {} + } + }, + "com.amazonaws.socialmessaging#DisassociateWhatsAppBusinessAccount": { + "type": "operation", + "input": { + "target": "com.amazonaws.socialmessaging#DisassociateWhatsAppBusinessAccountInput" + }, + "output": { + "target": "com.amazonaws.socialmessaging#DisassociateWhatsAppBusinessAccountOutput" + }, + "errors": [ + { + "target": "com.amazonaws.socialmessaging#DependencyException" + }, + { + "target": "com.amazonaws.socialmessaging#InvalidParametersException" + }, + { + "target": "com.amazonaws.socialmessaging#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.socialmessaging#ThrottledRequestException" + } + ], + "traits": { + "smithy.api#documentation": "

Disassociate a WhatsApp Business Account (WABA) from your Amazon Web Services account.

", + "smithy.api#http": { + "method": "DELETE", + "uri": "/v1/whatsapp/waba/disassociate", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.socialmessaging#DisassociateWhatsAppBusinessAccountInput": { + "type": "structure", + "members": { + "id": { + "target": "com.amazonaws.socialmessaging#LinkedWhatsAppBusinessAccountId", + "traits": { + "smithy.api#documentation": "

The unique identifier of your WhatsApp Business Account. WABA identifiers are formatted as\n waba-01234567890123456789012345678901. Use\n ListLinkedWhatsAppBusinessAccounts to list all WABAs and their details.

", + "smithy.api#httpQuery": "id", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "WabaId" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.socialmessaging#DisassociateWhatsAppBusinessAccountOutput": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.socialmessaging#ErrorMessage": { + "type": "string" + }, + "com.amazonaws.socialmessaging#EventDestinationArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "max": 2048 + }, + "smithy.api#pattern": "^arn:.*:[a-z-]+([/:](.*))?$" + } + }, + "com.amazonaws.socialmessaging#GetLinkedWhatsAppBusinessAccount": { + "type": "operation", + "input": { + "target": "com.amazonaws.socialmessaging#GetLinkedWhatsAppBusinessAccountInput" + }, + "output": { + "target": "com.amazonaws.socialmessaging#GetLinkedWhatsAppBusinessAccountOutput" + }, + "errors": [ + { + "target": "com.amazonaws.socialmessaging#DependencyException" + }, + { + "target": "com.amazonaws.socialmessaging#InternalServiceException" + }, + { + "target": "com.amazonaws.socialmessaging#InvalidParametersException" + }, + { + "target": "com.amazonaws.socialmessaging#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.socialmessaging#ThrottledRequestException" + } + ], + "traits": { + "smithy.api#documentation": "

Get the details of your linked WhatsApp Business Account.

", + "smithy.api#http": { + "method": "GET", + "uri": "/v1/whatsapp/waba/details", + "code": 200 + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.socialmessaging#GetLinkedWhatsAppBusinessAccountInput": { + "type": "structure", + "members": { + "id": { + "target": "com.amazonaws.socialmessaging#LinkedWhatsAppBusinessAccountId", + "traits": { + "smithy.api#documentation": "

The unique identifier, from Amazon Web Services, of the linked WhatsApp Business\n Account. WABA identifiers are formatted as\n waba-01234567890123456789012345678901. Use\n ListLinkedWhatsAppBusinessAccounts to list all WABAs and their details.

", + "smithy.api#httpQuery": "id", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "WabaId" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.socialmessaging#GetLinkedWhatsAppBusinessAccountOutput": { + "type": "structure", + "members": { + "account": { + "target": "com.amazonaws.socialmessaging#LinkedWhatsAppBusinessAccount", + "traits": { + "smithy.api#documentation": "

The details of the linked WhatsApp Business Account.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.socialmessaging#GetLinkedWhatsAppBusinessAccountPhoneNumber": { + "type": "operation", + "input": { + "target": "com.amazonaws.socialmessaging#GetLinkedWhatsAppBusinessAccountPhoneNumberInput" + }, + "output": { + "target": "com.amazonaws.socialmessaging#GetLinkedWhatsAppBusinessAccountPhoneNumberOutput" + }, + "errors": [ + { + "target": "com.amazonaws.socialmessaging#DependencyException" + }, + { + "target": "com.amazonaws.socialmessaging#InternalServiceException" + }, + { + "target": "com.amazonaws.socialmessaging#InvalidParametersException" + }, + { + "target": "com.amazonaws.socialmessaging#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.socialmessaging#ThrottledRequestException" + } + ], + "traits": { + "smithy.api#documentation": "

Use your WhatsApp phone number id to get the WABA account id and phone number\n details.

", + "smithy.api#http": { + "method": "GET", + "uri": "/v1/whatsapp/waba/phone/details", + "code": 200 + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.socialmessaging#GetLinkedWhatsAppBusinessAccountPhoneNumberInput": { + "type": "structure", + "members": { + "id": { + "target": "com.amazonaws.socialmessaging#WhatsAppPhoneNumberId", + "traits": { + "smithy.api#documentation": "

The unique identifier of the phone number. Phone number\n identifiers are formatted as phone-number-id-01234567890123456789012345678901.\n Use GetLinkedWhatsAppBusinessAccount to find a phone number's\n id.

", + "smithy.api#httpQuery": "id", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "OriginationPhoneNumberId" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.socialmessaging#GetLinkedWhatsAppBusinessAccountPhoneNumberOutput": { + "type": "structure", + "members": { + "phoneNumber": { + "target": "com.amazonaws.socialmessaging#WhatsAppPhoneNumberDetail" + }, + "linkedWhatsAppBusinessAccountId": { + "target": "com.amazonaws.socialmessaging#LinkedWhatsAppBusinessAccountId", + "traits": { + "smithy.api#documentation": "

The WABA identifier linked to the phone number, formatted as\n waba-01234567890123456789012345678901.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.socialmessaging#GetWhatsAppMessageMedia": { + "type": "operation", + "input": { + "target": "com.amazonaws.socialmessaging#GetWhatsAppMessageMediaInput" + }, + "output": { + "target": "com.amazonaws.socialmessaging#GetWhatsAppMessageMediaOutput" + }, + "errors": [ + { + "target": "com.amazonaws.socialmessaging#AccessDeniedByMetaException" + }, + { + "target": "com.amazonaws.socialmessaging#DependencyException" + }, + { + "target": "com.amazonaws.socialmessaging#InternalServiceException" + }, + { + "target": "com.amazonaws.socialmessaging#InvalidParametersException" + }, + { + "target": "com.amazonaws.socialmessaging#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.socialmessaging#ThrottledRequestException" + } + ], + "traits": { + "smithy.api#documentation": "

Get a media file from the WhatsApp service. On successful completion the media file is\n retrieved from Meta and stored in the specified Amazon S3 bucket. Use either\n destinationS3File or destinationS3PresignedUrl for the\n destination. If both are used then an InvalidParameterException is\n returned.

", + "smithy.api#http": { + "method": "POST", + "uri": "/v1/whatsapp/media/get", + "code": 200 + } + } + }, + "com.amazonaws.socialmessaging#GetWhatsAppMessageMediaInput": { + "type": "structure", + "members": { + "mediaId": { + "target": "com.amazonaws.socialmessaging#WhatsAppMediaId", + "traits": { + "smithy.api#documentation": "

The unique identifier for the media file.

", + "smithy.api#required": {} + } + }, + "originationPhoneNumberId": { + "target": "com.amazonaws.socialmessaging#WhatsAppPhoneNumberId", + "traits": { + "smithy.api#documentation": "

The unique identifier of the originating phone number for the WhatsApp message media.\n The phone number identifiers are formatted as\n phone-number-id-01234567890123456789012345678901. Use\n GetLinkedWhatsAppBusinessAccount to find a phone number's\n id.

", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "OriginationPhoneNumberId" + } + }, + "metadataOnly": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "

Set to True to get only the metadata for the file.

" + } + }, + "destinationS3PresignedUrl": { + "target": "com.amazonaws.socialmessaging#S3PresignedUrl", + "traits": { + "smithy.api#documentation": "

The presign url of the media file.

" + } + }, + "destinationS3File": { + "target": "com.amazonaws.socialmessaging#S3File", + "traits": { + "smithy.api#documentation": "

The bucketName and key of the S3 media file.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.socialmessaging#GetWhatsAppMessageMediaOutput": { + "type": "structure", + "members": { + "mimeType": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The MIME type of the media.

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

The file size of the media, in KB.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.socialmessaging#Headers": { + "type": "map", + "key": { + "target": "smithy.api#String" + }, + "value": { + "target": "smithy.api#String" + } + }, + "com.amazonaws.socialmessaging#InternalServiceException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.socialmessaging#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

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

", + "smithy.api#error": "server", + "smithy.api#httpError": 500, + "smithy.api#retryable": {} + } + }, + "com.amazonaws.socialmessaging#InvalidParametersException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.socialmessaging#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

One or more parameters provided to the action are not valid.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.socialmessaging#IsoCountryCode": { + "type": "string", + "traits": { + "smithy.api#pattern": "^[A-Z]{2}$" + } + }, + "com.amazonaws.socialmessaging#LinkedAccountWithIncompleteSetup": { + "type": "map", + "key": { + "target": "com.amazonaws.socialmessaging#WhatsAppBusinessAccountId" + }, + "value": { + "target": "com.amazonaws.socialmessaging#LinkedWhatsAppBusinessAccountIdMetaData" + } + }, + "com.amazonaws.socialmessaging#LinkedWhatsAppBusinessAccount": { + "type": "structure", + "members": { + "arn": { + "target": "com.amazonaws.socialmessaging#LinkedWhatsAppBusinessAccountArn", + "traits": { + "smithy.api#documentation": "

The ARN of the linked WhatsApp Business Account.

", + "smithy.api#required": {} + } + }, + "id": { + "target": "com.amazonaws.socialmessaging#LinkedWhatsAppBusinessAccountId", + "traits": { + "smithy.api#documentation": "

The ID of the linked WhatsApp Business Account, formatted as waba-01234567890123456789012345678901.

", + "smithy.api#required": {} + } + }, + "wabaId": { + "target": "com.amazonaws.socialmessaging#WhatsAppBusinessAccountId", + "traits": { + "smithy.api#documentation": "

The WhatsApp Business Account ID from meta.

", + "smithy.api#required": {} + } + }, + "registrationStatus": { + "target": "com.amazonaws.socialmessaging#RegistrationStatus", + "traits": { + "smithy.api#documentation": "

The registration status of the linked WhatsApp Business Account.

", + "smithy.api#required": {} + } + }, + "linkDate": { + "target": "com.amazonaws.socialmessaging#WhatsAppBusinessAccountLinkDate", + "traits": { + "smithy.api#documentation": "

The date the WhatsApp Business Account was linked.

", + "smithy.api#required": {} + } + }, + "wabaName": { + "target": "com.amazonaws.socialmessaging#WhatsAppBusinessAccountName", + "traits": { + "smithy.api#documentation": "

The name of the linked WhatsApp Business Account.

", + "smithy.api#required": {} + } + }, + "eventDestinations": { + "target": "com.amazonaws.socialmessaging#WhatsAppBusinessAccountEventDestinations", + "traits": { + "smithy.api#documentation": "

The event destinations for the linked WhatsApp Business Account.

", + "smithy.api#required": {} + } + }, + "phoneNumbers": { + "target": "com.amazonaws.socialmessaging#WhatsAppPhoneNumberSummaryList", + "traits": { + "smithy.api#documentation": "

The phone numbers associated with the Linked WhatsApp Business Account.

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

The details of your linked WhatsApp Business Account.

" + } + }, + "com.amazonaws.socialmessaging#LinkedWhatsAppBusinessAccountArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "max": 2048 + }, + "smithy.api#pattern": "^arn:.*:waba/[0-9a-zA-Z]+$" + } + }, + "com.amazonaws.socialmessaging#LinkedWhatsAppBusinessAccountId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 100 + }, + "smithy.api#pattern": "(^waba-.*$)|(^arn:.*:waba/[0-9a-zA-Z]+$)" + } + }, + "com.amazonaws.socialmessaging#LinkedWhatsAppBusinessAccountIdMetaData": { + "type": "structure", + "members": { + "accountName": { + "target": "com.amazonaws.socialmessaging#WhatsAppBusinessAccountName", + "traits": { + "smithy.api#documentation": "

The name of your account.

" + } + }, + "registrationStatus": { + "target": "com.amazonaws.socialmessaging#RegistrationStatus", + "traits": { + "smithy.api#documentation": "

The registration status of the linked WhatsApp Business Account.

" + } + }, + "unregisteredWhatsAppPhoneNumbers": { + "target": "com.amazonaws.socialmessaging#WhatsAppPhoneNumberDetailList", + "traits": { + "smithy.api#documentation": "

The details for unregistered WhatsApp phone numbers.

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

Contains your WhatsApp registration status and details of any unregistered WhatsApp\n phone number.

" + } + }, + "com.amazonaws.socialmessaging#LinkedWhatsAppBusinessAccountResource": { + "type": "resource", + "identifiers": { + "WabaId": { + "target": "com.amazonaws.socialmessaging#LinkedWhatsAppBusinessAccountId" + } + }, + "create": { + "target": "com.amazonaws.socialmessaging#AssociateWhatsAppBusinessAccount" + }, + "read": { + "target": "com.amazonaws.socialmessaging#GetLinkedWhatsAppBusinessAccount" + }, + "delete": { + "target": "com.amazonaws.socialmessaging#DisassociateWhatsAppBusinessAccount" + }, + "list": { + "target": "com.amazonaws.socialmessaging#ListLinkedWhatsAppBusinessAccounts" + }, + "operations": [ + { + "target": "com.amazonaws.socialmessaging#PutWhatsAppBusinessAccountEventDestinations" + } + ], + "traits": { + "aws.api#arn": { + "template": "waba/{WabaId}" + }, + "aws.iam#conditionKeys": ["aws:ResourceTag/${TagKey}"], + "aws.iam#iamResource": { + "name": "waba", + "relativeDocumentation": "managing-wabas.html" + } + } + }, + "com.amazonaws.socialmessaging#LinkedWhatsAppBusinessAccountSummary": { + "type": "structure", + "members": { + "arn": { + "target": "com.amazonaws.socialmessaging#LinkedWhatsAppBusinessAccountArn", + "traits": { + "smithy.api#documentation": "

The ARN of the linked WhatsApp Business Account.

", + "smithy.api#required": {} + } + }, + "id": { + "target": "com.amazonaws.socialmessaging#LinkedWhatsAppBusinessAccountId", + "traits": { + "smithy.api#documentation": "

The ID of the linked WhatsApp Business Account, formatted as waba-01234567890123456789012345678901.

", + "smithy.api#required": {} + } + }, + "wabaId": { + "target": "com.amazonaws.socialmessaging#WhatsAppBusinessAccountId", + "traits": { + "smithy.api#documentation": "

The WhatsApp Business Account ID provided by Meta.

", + "smithy.api#required": {} + } + }, + "registrationStatus": { + "target": "com.amazonaws.socialmessaging#RegistrationStatus", + "traits": { + "smithy.api#documentation": "

The registration status of the linked WhatsApp Business Account.

", + "smithy.api#required": {} + } + }, + "linkDate": { + "target": "com.amazonaws.socialmessaging#WhatsAppBusinessAccountLinkDate", + "traits": { + "smithy.api#documentation": "

The date the WhatsApp Business Account was linked.

", + "smithy.api#required": {} + } + }, + "wabaName": { + "target": "com.amazonaws.socialmessaging#WhatsAppBusinessAccountName", + "traits": { + "smithy.api#documentation": "

The name of the linked WhatsApp Business Account.

", + "smithy.api#required": {} + } + }, + "eventDestinations": { + "target": "com.amazonaws.socialmessaging#WhatsAppBusinessAccountEventDestinations", + "traits": { + "smithy.api#documentation": "

The event destinations for the linked WhatsApp Business Account.

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

The details of a linked WhatsApp Business Account.

" + } + }, + "com.amazonaws.socialmessaging#LinkedWhatsAppBusinessAccountSummaryList": { + "type": "list", + "member": { + "target": "com.amazonaws.socialmessaging#LinkedWhatsAppBusinessAccountSummary" + } + }, + "com.amazonaws.socialmessaging#LinkedWhatsAppPhoneNumberArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "max": 2048 + }, + "smithy.api#pattern": "^arn:.*:phone-number-id/[0-9a-zA-Z]+$" + } + }, + "com.amazonaws.socialmessaging#LinkedWhatsAppPhoneNumberResource": { + "type": "resource", + "identifiers": { + "OriginationPhoneNumberId": { + "target": "com.amazonaws.socialmessaging#WhatsAppPhoneNumberId" + } + }, + "read": { + "target": "com.amazonaws.socialmessaging#GetLinkedWhatsAppBusinessAccountPhoneNumber" + }, + "operations": [ + { + "target": "com.amazonaws.socialmessaging#DeleteWhatsAppMessageMedia" + }, + { + "target": "com.amazonaws.socialmessaging#GetWhatsAppMessageMedia" + }, + { + "target": "com.amazonaws.socialmessaging#PostWhatsAppMessageMedia" + }, + { + "target": "com.amazonaws.socialmessaging#SendWhatsAppMessage" + } + ], + "traits": { + "aws.api#arn": { + "template": "phone-number-id/{OriginationPhoneNumberId}" + }, + "aws.iam#conditionKeys": ["aws:ResourceTag/${TagKey}"], + "aws.iam#iamResource": { + "name": "phone-number-id", + "relativeDocumentation": "managing-phone-numbers.html" + } + } + }, + "com.amazonaws.socialmessaging#ListLinkedWhatsAppBusinessAccounts": { + "type": "operation", + "input": { + "target": "com.amazonaws.socialmessaging#ListLinkedWhatsAppBusinessAccountsInput" + }, + "output": { + "target": "com.amazonaws.socialmessaging#ListLinkedWhatsAppBusinessAccountsOutput" + }, + "errors": [ + { + "target": "com.amazonaws.socialmessaging#InternalServiceException" + }, + { + "target": "com.amazonaws.socialmessaging#InvalidParametersException" + }, + { + "target": "com.amazonaws.socialmessaging#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.socialmessaging#ThrottledRequestException" + } + ], + "traits": { + "smithy.api#documentation": "

List all WhatsApp Business Accounts linked to your Amazon Web Services account.

", + "smithy.api#http": { + "method": "GET", + "uri": "/v1/whatsapp/waba/list", + "code": 200 + }, + "smithy.api#paginated": { + "items": "linkedAccounts" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.socialmessaging#ListLinkedWhatsAppBusinessAccountsInput": { + "type": "structure", + "members": { + "nextToken": { + "target": "com.amazonaws.socialmessaging#NextToken", + "traits": { + "smithy.api#documentation": "

The next token for pagination.

", + "smithy.api#httpQuery": "nextToken" + } + }, + "maxResults": { + "target": "com.amazonaws.socialmessaging#MaxResults", + "traits": { + "smithy.api#documentation": "

The maximum number of results to return.

", + "smithy.api#httpQuery": "maxResults" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.socialmessaging#ListLinkedWhatsAppBusinessAccountsOutput": { + "type": "structure", + "members": { + "linkedAccounts": { + "target": "com.amazonaws.socialmessaging#LinkedWhatsAppBusinessAccountSummaryList", + "traits": { + "smithy.api#documentation": "

A list of WhatsApp Business Accounts linked to your Amazon Web Services account.

" + } + }, + "nextToken": { + "target": "com.amazonaws.socialmessaging#NextToken", + "traits": { + "smithy.api#documentation": "

The next token for pagination.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.socialmessaging#ListTagsForResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.socialmessaging#ListTagsForResourceInput" + }, + "output": { + "target": "com.amazonaws.socialmessaging#ListTagsForResourceOutput" + }, + "errors": [ + { + "target": "com.amazonaws.socialmessaging#InternalServiceException" + }, + { + "target": "com.amazonaws.socialmessaging#InvalidParametersException" + }, + { + "target": "com.amazonaws.socialmessaging#ThrottledRequestException" + } + ], + "traits": { + "smithy.api#documentation": "

List all tags associated with a resource, such as a phone number or WABA.

", + "smithy.api#http": { + "method": "GET", + "uri": "/v1/tags/list", + "code": 200 + }, + "smithy.api#readonly": {}, + "smithy.test#smokeTests": [ + { + "id": "ListTagsFailure", + "params": { + "resourceArn": "arn:aws:social-messaging:us-east-1:9923825:phone-number-id/45c1973a7577" + }, + "expect": { + "failure": {} + }, + "vendorParamsShape": "aws.test#AwsVendorParams", + "vendorParams": { + "region": "us-east-1" + } + } + ] + } + }, + "com.amazonaws.socialmessaging#ListTagsForResourceInput": { + "type": "structure", + "members": { + "resourceArn": { + "target": "com.amazonaws.socialmessaging#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the resource to retrieve the tags from.

", + "smithy.api#httpQuery": "resourceArn", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.socialmessaging#ListTagsForResourceOutput": { + "type": "structure", + "members": { + "statusCode": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

The status code of the response.

" + } + }, + "tags": { + "target": "com.amazonaws.socialmessaging#TagList", + "traits": { + "smithy.api#documentation": "

The tags for the resource.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.socialmessaging#MaxResults": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.socialmessaging#NextToken": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 600 + } + } + }, + "com.amazonaws.socialmessaging#PhoneNumber": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 20 + } + } + }, + "com.amazonaws.socialmessaging#PostWhatsAppMessageMedia": { + "type": "operation", + "input": { + "target": "com.amazonaws.socialmessaging#PostWhatsAppMessageMediaInput" + }, + "output": { + "target": "com.amazonaws.socialmessaging#PostWhatsAppMessageMediaOutput" + }, + "errors": [ + { + "target": "com.amazonaws.socialmessaging#AccessDeniedByMetaException" + }, + { + "target": "com.amazonaws.socialmessaging#DependencyException" + }, + { + "target": "com.amazonaws.socialmessaging#InternalServiceException" + }, + { + "target": "com.amazonaws.socialmessaging#InvalidParametersException" + }, + { + "target": "com.amazonaws.socialmessaging#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.socialmessaging#ThrottledRequestException" + } + ], + "traits": { + "smithy.api#documentation": "

Upload a media file to the WhatsApp service. Only the specified\n originationPhoneNumberId has the permissions to send the media file when\n using SendWhatsAppMessage. You must use either sourceS3File\n or sourceS3PresignedUrl for the source. If both or neither are specified then an\n InvalidParameterException is returned.

", + "smithy.api#http": { + "method": "POST", + "uri": "/v1/whatsapp/media", + "code": 200 + } + } + }, + "com.amazonaws.socialmessaging#PostWhatsAppMessageMediaInput": { + "type": "structure", + "members": { + "originationPhoneNumberId": { + "target": "com.amazonaws.socialmessaging#WhatsAppPhoneNumberId", + "traits": { + "smithy.api#documentation": "

The ID of the phone number to associate with the WhatsApp media file. The phone number\n identifiers are formatted as phone-number-id-01234567890123456789012345678901.\n Use GetLinkedWhatsAppBusinessAccount to find a phone number's\n id.

", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "OriginationPhoneNumberId" + } + }, + "sourceS3PresignedUrl": { + "target": "com.amazonaws.socialmessaging#S3PresignedUrl", + "traits": { + "smithy.api#documentation": "

The source presign url of the media file.

" + } + }, + "sourceS3File": { + "target": "com.amazonaws.socialmessaging#S3File", + "traits": { + "smithy.api#documentation": "

The source S3 url for the media file.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.socialmessaging#PostWhatsAppMessageMediaOutput": { + "type": "structure", + "members": { + "mediaId": { + "target": "com.amazonaws.socialmessaging#WhatsAppMediaId", + "traits": { + "smithy.api#documentation": "

The unique identifier of the posted WhatsApp message.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.socialmessaging#PutWhatsAppBusinessAccountEventDestinations": { + "type": "operation", + "input": { + "target": "com.amazonaws.socialmessaging#PutWhatsAppBusinessAccountEventDestinationsInput" + }, + "output": { + "target": "com.amazonaws.socialmessaging#PutWhatsAppBusinessAccountEventDestinationsOutput" + }, + "errors": [ + { + "target": "com.amazonaws.socialmessaging#InternalServiceException" + }, + { + "target": "com.amazonaws.socialmessaging#InvalidParametersException" + }, + { + "target": "com.amazonaws.socialmessaging#ThrottledRequestException" + } + ], + "traits": { + "smithy.api#documentation": "

Add an event destination to log event data from WhatsApp for a WhatsApp Business Account (WABA). A WABA can only have one event destination at a time. All resources associated with the WABA use the same event destination.

", + "smithy.api#http": { + "method": "PUT", + "uri": "/v1/whatsapp/waba/eventdestinations", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.socialmessaging#PutWhatsAppBusinessAccountEventDestinationsInput": { + "type": "structure", + "members": { + "id": { + "target": "com.amazonaws.socialmessaging#LinkedWhatsAppBusinessAccountId", + "traits": { + "smithy.api#documentation": "

The unique identifier of your WhatsApp Business Account. WABA identifiers are formatted as\n waba-01234567890123456789012345678901. Use\n ListLinkedWhatsAppBusinessAccounts to list all WABAs and their details.

", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "WabaId" + } + }, + "eventDestinations": { + "target": "com.amazonaws.socialmessaging#WhatsAppBusinessAccountEventDestinations", + "traits": { + "smithy.api#documentation": "

An array of WhatsAppBusinessAccountEventDestination event destinations.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.socialmessaging#PutWhatsAppBusinessAccountEventDestinationsOutput": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.socialmessaging#RegistrationStatus": { + "type": "enum", + "members": { + "COMPLETE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "COMPLETE" + } + }, + "INCOMPLETE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "INCOMPLETE" + } + } + } + }, + "com.amazonaws.socialmessaging#ResourceNotFoundException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.socialmessaging#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

The resource was not found.

", + "smithy.api#error": "client", + "smithy.api#httpError": 404 + } + }, + "com.amazonaws.socialmessaging#S3File": { + "type": "structure", + "members": { + "bucketName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The bucket name.

", + "smithy.api#length": { + "min": 3, + "max": 63 + }, + "smithy.api#pattern": "^[a-z0-9][a-z0-9.-]*[a-z0-9]$", + "smithy.api#required": {} + } + }, + "key": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The object key of the media file.

", + "smithy.api#length": { + "min": 0, + "max": 1024 + }, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Contains information for the S3 bucket that contains media files.

", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.socialmessaging#S3PresignedUrl": { + "type": "structure", + "members": { + "url": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The presign url to the object.

", + "smithy.api#length": { + "min": 1, + "max": 2000 + }, + "smithy.api#pattern": "^https://(.*)s3(.*).amazonaws.com/(.*)$", + "smithy.api#required": {} + } + }, + "headers": { + "target": "com.amazonaws.socialmessaging#Headers", + "traits": { + "smithy.api#documentation": "

A map of headers and their values. You must specify the Content-Type header when using PostWhatsAppMessageMedia. For a list of common headers, see Common Request Headers in the Amazon S3\n API Reference\n

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

You can use presigned URLs to grant time-limited access to objects in Amazon S3 without updating your bucket policy. For more information, see Working with presigned URLs in the Amazon S3\n User Guide.

", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.socialmessaging#SendWhatsAppMessage": { + "type": "operation", + "input": { + "target": "com.amazonaws.socialmessaging#SendWhatsAppMessageInput" + }, + "output": { + "target": "com.amazonaws.socialmessaging#SendWhatsAppMessageOutput" + }, + "errors": [ + { + "target": "com.amazonaws.socialmessaging#DependencyException" + }, + { + "target": "com.amazonaws.socialmessaging#InternalServiceException" + }, + { + "target": "com.amazonaws.socialmessaging#InvalidParametersException" + }, + { + "target": "com.amazonaws.socialmessaging#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.socialmessaging#ThrottledRequestException" + } + ], + "traits": { + "smithy.api#documentation": "

Send a WhatsApp message. For examples of sending a message using the Amazon Web Services\n CLI, see Sending messages in the\n \n Amazon Web Services End User Messaging Social User Guide\n .

", + "smithy.api#http": { + "method": "POST", + "uri": "/v1/whatsapp/send", + "code": 200 + } + } + }, + "com.amazonaws.socialmessaging#SendWhatsAppMessageInput": { + "type": "structure", + "members": { + "originationPhoneNumberId": { + "target": "com.amazonaws.socialmessaging#WhatsAppPhoneNumberId", + "traits": { + "smithy.api#documentation": "

The ID of the phone number used to send the WhatsApp message. If you are sending a media\n file only the originationPhoneNumberId used to upload the file can be used.\n Phone number identifiers are formatted as\n phone-number-id-01234567890123456789012345678901. Use\n GetLinkedWhatsAppBusinessAccount to find a phone number's\n id.

", + "smithy.api#required": {}, + "smithy.api#resourceIdentifier": "OriginationPhoneNumberId" + } + }, + "message": { + "target": "com.amazonaws.socialmessaging#WhatsAppMessageBlob", + "traits": { + "smithy.api#documentation": "

The message to send through WhatsApp. The length is in KB. The message field passes through a WhatsApp\n Message object, see Messages in the WhatsApp Business Platform Cloud API\n Reference.

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

The API version for the request formatted as v{VersionNumber}. For a list of supported API versions and Amazon Web Services Regions, see \n Amazon Web Services End User Messaging Social API Service Endpoints in the Amazon Web Services General Reference.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.socialmessaging#SendWhatsAppMessageOutput": { + "type": "structure", + "members": { + "messageId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The unique identifier of the message.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.socialmessaging#SocialMessaging": { + "type": "service", + "version": "2024-01-01", + "operations": [ + { + "target": "com.amazonaws.socialmessaging#ListTagsForResource" + }, + { + "target": "com.amazonaws.socialmessaging#TagResource" + }, + { + "target": "com.amazonaws.socialmessaging#UntagResource" + } + ], + "resources": [ + { + "target": "com.amazonaws.socialmessaging#LinkedWhatsAppBusinessAccountResource" + }, + { + "target": "com.amazonaws.socialmessaging#LinkedWhatsAppPhoneNumberResource" + } + ], + "errors": [ + { + "target": "com.amazonaws.socialmessaging#AccessDeniedException" + }, + { + "target": "com.amazonaws.socialmessaging#ValidationException" + } + ], + "traits": { + "aws.api#service": { + "sdkId": "SocialMessaging", + "arnNamespace": "social-messaging", + "cloudTrailEventSource": "social-messaging.amazonaws.com", + "endpointPrefix": "social-messaging" + }, + "aws.auth#sigv4": { + "name": "social-messaging" + }, + "aws.iam#defineConditionKeys": { + "aws:RequestTag/${TagKey}": { + "type": "String", + "documentation": "Filters access by the tags that are passed in the request", + "externalDocumentation": "${DocHomeURL}IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-requesttag" + }, + "aws:ResourceTag/${TagKey}": { + "type": "String", + "documentation": "Filters access by the tags associated with the resource", + "externalDocumentation": "${DocHomeURL}IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-resourcetag" + }, + "aws:TagKeys": { + "type": "ArrayOfString", + "documentation": "Filters access by the tag keys that are passed in the request", + "externalDocumentation": "${DocHomeURL}IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-tagkeys" + } + }, + "aws.iam#disableConditionKeyInference": {}, + "aws.iam#supportedPrincipalTypes": ["Root", "IAMUser", "IAMRole", "FederatedUser"], + "aws.protocols#restJson1": {}, + "smithy.api#cors": { + "origin": "*", + "additionalAllowedHeaders": [ + "authorization", + "x-amz-date", + "x-amz-security-token", + "content-type", + "x-amz-content-sha256", + "x-amz-user-agent", + "x-amzn-platform-id", + "x-amzn-trace-id", + "content-length", + "x-api-key", + "amz-sdk-request", + "amz-sdk-invocation-id", + "Csrf-Token" + ], + "additionalExposedHeaders": ["x-amzn-errortype", "x-amzn-requestid", "x-amzn-trace-id", "Csrf-Token"] + }, + "smithy.api#documentation": "

\n Amazon Web Services End User Messaging Social, also referred to as Social messaging, is a messaging service that enables\n application developers to incorporate WhatsApp into their existing workflows. The Amazon Web Services End User Messaging Social API provides information about the\n Amazon Web Services End User Messaging Social API resources, including supported HTTP methods, parameters, and schemas.

\n

The Amazon Web Services End User Messaging Social API provides programmatic access to options that are unique to the WhatsApp Business Platform.

\n

If you're new to the Amazon Web Services End User Messaging Social API, it's also helpful to review What is\n Amazon Web Services End User Messaging Social in the Amazon Web Services End User Messaging Social User Guide. The\n Amazon Web Services End User Messaging Social User Guide provides tutorials, code samples, and procedures that demonstrate how to use\n Amazon Web Services End User Messaging Social API features programmatically and how to integrate functionality into applications.\n The guide also provides key information, such as integration with other Amazon Web Services\n services, and the quotas that apply to use of the service.

\n

\n Regional availability\n

\n

The Amazon Web Services End User Messaging Social API is available across several Amazon Web Services Regions and it provides a dedicated endpoint for each of these Regions. For a list of\n all the Regions and endpoints where the API is currently available, see Amazon Web Services Service Endpoints and Amazon Web Services End User Messaging endpoints and quotas in the Amazon Web Services General Reference. To learn more about Amazon Web Services Regions, see\n Managing\n Amazon Web Services Regions in the Amazon Web Services General\n Reference.

\n

In each Region, Amazon Web Services maintains multiple Availability Zones. These\n Availability Zones are physically isolated from each other, but are united by private,\n low-latency, high-throughput, and highly redundant network connections. These Availability\n Zones enable us to provide very high levels of availability and redundancy, while also\n minimizing latency. To learn more about the number of Availability Zones that are available\n in each Region, see Amazon Web Services Global Infrastructure.\n

", + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults" + }, + "smithy.api#title": "AWS End User Messaging Social", + "smithy.rules#endpointRuleSet": { + "version": "1.0", + "parameters": { + "Region": { + "builtIn": "AWS::Region", + "required": false, + "documentation": "The AWS region used to dispatch the request.", + "type": "String" + }, + "UseDualStack": { + "builtIn": "AWS::UseDualStack", + "required": true, + "default": false, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "Boolean" + }, + "UseFIPS": { + "builtIn": "AWS::UseFIPS", + "required": true, + "default": false, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "Boolean" + }, + "Endpoint": { + "builtIn": "SDK::Endpoint", + "required": false, + "documentation": "Override the endpoint used to send this request", + "type": "String" + } + }, + "rules": [ + { + "conditions": [ + { + "fn": "isSet", + "argv": [ + { + "ref": "Endpoint" + } + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + } + ], + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error" + }, + { + "conditions": [], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error" + }, + { + "conditions": [], + "endpoint": { + "url": { + "ref": "Endpoint" + }, + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "rules": [ + { + "conditions": [ + { + "fn": "isSet", + "argv": [ + { + "ref": "Region" + } + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "aws.partition", + "argv": [ + { + "ref": "Region" + } + ], + "assign": "PartitionResult" + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsFIPS" + ] + } + ] + }, + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsDualStack" + ] + } + ] + } + ], + "rules": [ + { + "conditions": [], + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://social-messaging-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error" + } + ], + "type": "tree" + }, + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsFIPS" + ] + }, + true + ] + } + ], + "rules": [ + { + "conditions": [], + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://social-messaging-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error" + } + ], + "type": "tree" + }, + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsDualStack" + ] + } + ] + } + ], + "rules": [ + { + "conditions": [], + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://social-messaging.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error" + } + ], + "type": "tree" + }, + { + "conditions": [], + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://social-messaging.{Region}.{PartitionResult#dnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "error": "Invalid Configuration: Missing Region", + "type": "error" + } + ], + "type": "tree" + } + ] + }, + "smithy.rules#endpointTests": { + "testCases": [ + { + "documentation": "For region us-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://social-messaging-fips.us-east-1.api.aws" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region us-east-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://social-messaging-fips.us-east-1.amazonaws.com" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region us-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://social-messaging.us-east-1.api.aws" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region us-east-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://social-messaging.us-east-1.amazonaws.com" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For region cn-north-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://social-messaging-fips.cn-north-1.api.amazonwebservices.com.cn" + } + }, + "params": { + "Region": "cn-north-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region cn-north-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://social-messaging-fips.cn-north-1.amazonaws.com.cn" + } + }, + "params": { + "Region": "cn-north-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region cn-north-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://social-messaging.cn-north-1.api.amazonwebservices.com.cn" + } + }, + "params": { + "Region": "cn-north-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region cn-north-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://social-messaging.cn-north-1.amazonaws.com.cn" + } + }, + "params": { + "Region": "cn-north-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://social-messaging-fips.us-gov-east-1.api.aws" + } + }, + "params": { + "Region": "us-gov-east-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://social-messaging-fips.us-gov-east-1.amazonaws.com" + } + }, + "params": { + "Region": "us-gov-east-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://social-messaging.us-gov-east-1.api.aws" + } + }, + "params": { + "Region": "us-gov-east-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://social-messaging.us-gov-east-1.amazonaws.com" + } + }, + "params": { + "Region": "us-gov-east-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "error": "FIPS and DualStack are enabled, but this partition does not support one or both" + }, + "params": { + "Region": "us-iso-east-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://social-messaging-fips.us-iso-east-1.c2s.ic.gov" + } + }, + "params": { + "Region": "us-iso-east-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "error": "DualStack is enabled but this partition does not support DualStack" + }, + "params": { + "Region": "us-iso-east-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://social-messaging.us-iso-east-1.c2s.ic.gov" + } + }, + "params": { + "Region": "us-iso-east-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "error": "FIPS and DualStack are enabled, but this partition does not support one or both" + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://social-messaging-fips.us-isob-east-1.sc2s.sgov.gov" + } + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "error": "DualStack is enabled but this partition does not support DualStack" + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://social-messaging.us-isob-east-1.sc2s.sgov.gov" + } + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For custom endpoint with region set and fips disabled and dualstack disabled", + "expect": { + "endpoint": { + "url": "https://example.com" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": false, + "UseDualStack": false, + "Endpoint": "https://example.com" + } + }, + { + "documentation": "For custom endpoint with region not set and fips disabled and dualstack disabled", + "expect": { + "endpoint": { + "url": "https://example.com" + } + }, + "params": { + "UseFIPS": false, + "UseDualStack": false, + "Endpoint": "https://example.com" + } + }, + { + "documentation": "For custom endpoint with fips enabled and dualstack disabled", + "expect": { + "error": "Invalid Configuration: FIPS and custom endpoint are not supported" + }, + "params": { + "Region": "us-east-1", + "UseFIPS": true, + "UseDualStack": false, + "Endpoint": "https://example.com" + } + }, + { + "documentation": "For custom endpoint with fips disabled and dualstack enabled", + "expect": { + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported" + }, + "params": { + "Region": "us-east-1", + "UseFIPS": false, + "UseDualStack": true, + "Endpoint": "https://example.com" + } + }, + { + "documentation": "Missing region", + "expect": { + "error": "Invalid Configuration: Missing Region" + } + } + ], + "version": "1.0" + } + } + }, + "com.amazonaws.socialmessaging#StringList": { + "type": "list", + "member": { + "target": "smithy.api#String" + } + }, + "com.amazonaws.socialmessaging#Tag": { + "type": "structure", + "members": { + "key": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The tag key.

", + "smithy.api#length": { + "min": 1, + "max": 128 + }, + "smithy.api#required": {} + } + }, + "value": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The tag value.

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

The tag for a resource.

" + } + }, + "com.amazonaws.socialmessaging#TagList": { + "type": "list", + "member": { + "target": "com.amazonaws.socialmessaging#Tag" + } + }, + "com.amazonaws.socialmessaging#TagResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.socialmessaging#TagResourceInput" + }, + "output": { + "target": "com.amazonaws.socialmessaging#TagResourceOutput" + }, + "errors": [ + { + "target": "com.amazonaws.socialmessaging#InternalServiceException" + }, + { + "target": "com.amazonaws.socialmessaging#InvalidParametersException" + }, + { + "target": "com.amazonaws.socialmessaging#ThrottledRequestException" + } + ], + "traits": { + "aws.iam#conditionKeys": ["aws:RequestTag/${TagKey}", "aws:ResourceTag/${TagKey}", "aws:TagKeys"], + "smithy.api#documentation": "

Adds or overwrites only the specified tags for the specified resource. When you specify\n an existing tag key, the value is overwritten with the new value.

", + "smithy.api#http": { + "method": "POST", + "uri": "/v1/tags/tag-resource", + "code": 200 + } + } + }, + "com.amazonaws.socialmessaging#TagResourceInput": { + "type": "structure", + "members": { + "resourceArn": { + "target": "com.amazonaws.socialmessaging#Arn", + "traits": { + "aws.api#data": "tagging", + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the resource to tag.

", + "smithy.api#required": {} + } + }, + "tags": { + "target": "com.amazonaws.socialmessaging#TagList", + "traits": { + "smithy.api#documentation": "

The tags to add to the resource.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {}, + "smithy.api#references": [ + { + "resource": "com.amazonaws.socialmessaging#LinkedWhatsAppPhoneNumberResource", + "ids": { + "OriginationPhoneNumberId": "resourceArn" + } + }, + { + "resource": "com.amazonaws.socialmessaging#LinkedWhatsAppBusinessAccountResource", + "ids": { + "WabaId": "resourceArn" + } + } + ] + } + }, + "com.amazonaws.socialmessaging#TagResourceOutput": { + "type": "structure", + "members": { + "statusCode": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

The status code of the tag resource operation.

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

The request was denied due to request throttling.

", + "smithy.api#error": "client", + "smithy.api#httpError": 429, + "smithy.api#retryable": {} + } + }, + "com.amazonaws.socialmessaging#TwoFactorPin": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 6 + }, + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.socialmessaging#UntagResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.socialmessaging#UntagResourceInput" + }, + "output": { + "target": "com.amazonaws.socialmessaging#UntagResourceOutput" + }, + "errors": [ + { + "target": "com.amazonaws.socialmessaging#InternalServiceException" + }, + { + "target": "com.amazonaws.socialmessaging#InvalidParametersException" + }, + { + "target": "com.amazonaws.socialmessaging#ThrottledRequestException" + } + ], + "traits": { + "aws.iam#conditionKeys": ["aws:ResourceTag/${TagKey}", "aws:TagKeys"], + "smithy.api#documentation": "

Removes the specified tags from a resource.

", + "smithy.api#http": { + "method": "POST", + "uri": "/v1/tags/untag-resource", + "code": 200 + } + } + }, + "com.amazonaws.socialmessaging#UntagResourceInput": { + "type": "structure", + "members": { + "resourceArn": { + "target": "com.amazonaws.socialmessaging#Arn", + "traits": { + "aws.api#data": "tagging", + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the resource to remove tags from.

", + "smithy.api#required": {} + } + }, + "tagKeys": { + "target": "com.amazonaws.socialmessaging#StringList", + "traits": { + "smithy.api#documentation": "

The keys of the tags to remove from the resource.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {}, + "smithy.api#references": [ + { + "resource": "com.amazonaws.socialmessaging#LinkedWhatsAppPhoneNumberResource", + "ids": { + "OriginationPhoneNumberId": "resourceArn" + } + }, + { + "resource": "com.amazonaws.socialmessaging#LinkedWhatsAppBusinessAccountResource", + "ids": { + "WabaId": "resourceArn" + } + } + ] + } + }, + "com.amazonaws.socialmessaging#UntagResourceOutput": { + "type": "structure", + "members": { + "statusCode": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

The status code of the untag resource operation.

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

The request contains an invalid parameter value.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.socialmessaging#WabaPhoneNumberSetupFinalization": { + "type": "structure", + "members": { + "id": { + "target": "com.amazonaws.socialmessaging#WhatsAppPhoneNumber", + "traits": { + "smithy.api#documentation": "

The unique identifier of the originating phone number associated with the media. Phone\n number identifiers are formatted as\n phone-number-id-01234567890123456789012345678901. Use\n GetLinkedWhatsAppBusinessAccount to find a phone number's\n id.

", + "smithy.api#required": {} + } + }, + "twoFactorPin": { + "target": "com.amazonaws.socialmessaging#TwoFactorPin", + "traits": { + "smithy.api#documentation": "

The PIN to use for two-step verification. To reset your PIN follow the directions in\n Updating PIN in the WhatsApp Business Platform Cloud API\n Reference.

", + "smithy.api#required": {} + } + }, + "dataLocalizationRegion": { + "target": "com.amazonaws.socialmessaging#IsoCountryCode", + "traits": { + "smithy.api#documentation": "

The two letter ISO region for the location of where Meta will store data.

\n

\n Asia–Pacific (APAC)\n

\n
    \n
  • \n

    Australia AU\n

    \n
  • \n
  • \n

    Indonesia ID\n

    \n
  • \n
  • \n

    India IN\n

    \n
  • \n
  • \n

    Japan JP\n

    \n
  • \n
  • \n

    Singapore SG\n

    \n
  • \n
  • \n

    South Korea KR\n

    \n
  • \n
\n

\n Europe\n

\n
    \n
  • \n

    Germany DE\n

    \n
  • \n
  • \n

    Switzerland CH\n

    \n
  • \n
  • \n

    United Kingdom GB\n

    \n
  • \n
\n

\n Latin America (LATAM)\n

\n
    \n
  • \n

    Brazil BR\n

    \n
  • \n
\n

\n Middle East and Africa (MEA)\n

\n
    \n
  • \n

    Bahrain BH\n

    \n
  • \n
  • \n

    South Africa ZA\n

    \n
  • \n
  • \n

    United Arab Emirates AE\n

    \n
  • \n
\n

\n North America (NORAM)\n

\n
    \n
  • \n

    Canada CA\n

    \n
  • \n
" + } + }, + "tags": { + "target": "com.amazonaws.socialmessaging#TagList", + "traits": { + "smithy.api#documentation": "

An array of key and value pair tags.

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

The registration details for a linked phone number.

" + } + }, + "com.amazonaws.socialmessaging#WabaPhoneNumberSetupFinalizationList": { + "type": "list", + "member": { + "target": "com.amazonaws.socialmessaging#WabaPhoneNumberSetupFinalization" + } + }, + "com.amazonaws.socialmessaging#WabaSetupFinalization": { + "type": "structure", + "members": { + "id": { + "target": "com.amazonaws.socialmessaging#WhatsAppBusinessAccountId", + "traits": { + "smithy.api#documentation": "

The ID of the linked WhatsApp Business Account, formatted as waba-01234567890123456789012345678901.

" + } + }, + "eventDestinations": { + "target": "com.amazonaws.socialmessaging#WhatsAppBusinessAccountEventDestinations", + "traits": { + "smithy.api#documentation": "

The event destinations for the linked WhatsApp Business Account.

" + } + }, + "tags": { + "target": "com.amazonaws.socialmessaging#TagList", + "traits": { + "smithy.api#documentation": "

An array of key and value pair tags.

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

The registration details for a linked WhatsApp Business Account.

" + } + }, + "com.amazonaws.socialmessaging#WhatsAppBusinessAccountEventDestination": { + "type": "structure", + "members": { + "eventDestinationArn": { + "target": "com.amazonaws.socialmessaging#EventDestinationArn", + "traits": { + "smithy.api#documentation": "

The ARN of the event destination.

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

Contains information on the event destination.

" + } + }, + "com.amazonaws.socialmessaging#WhatsAppBusinessAccountEventDestinations": { + "type": "list", + "member": { + "target": "com.amazonaws.socialmessaging#WhatsAppBusinessAccountEventDestination" + }, + "traits": { + "smithy.api#length": { + "max": 1 + } + } + }, + "com.amazonaws.socialmessaging#WhatsAppBusinessAccountId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.socialmessaging#WhatsAppBusinessAccountLinkDate": { + "type": "timestamp" + }, + "com.amazonaws.socialmessaging#WhatsAppBusinessAccountName": { + "type": "string", + "traits": { + "smithy.api#length": { + "max": 200 + } + } + }, + "com.amazonaws.socialmessaging#WhatsAppDisplayPhoneNumber": { + "type": "string", + "traits": { + "smithy.api#length": { + "max": 20 + } + } + }, + "com.amazonaws.socialmessaging#WhatsAppMediaId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 100 + }, + "smithy.api#pattern": "^[A-Za-z0-9]+$" + } + }, + "com.amazonaws.socialmessaging#WhatsAppMessageBlob": { + "type": "blob", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 2048000 + }, + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.socialmessaging#WhatsAppPhoneNumber": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.socialmessaging#WhatsAppPhoneNumberDetail": { + "type": "structure", + "members": { + "arn": { + "target": "com.amazonaws.socialmessaging#LinkedWhatsAppPhoneNumberArn", + "traits": { + "smithy.api#documentation": "

The ARN of the WhatsApp phone number.

", + "smithy.api#required": {} + } + }, + "phoneNumber": { + "target": "com.amazonaws.socialmessaging#PhoneNumber", + "traits": { + "smithy.api#documentation": "

The phone number for sending WhatsApp.

", + "smithy.api#required": {} + } + }, + "phoneNumberId": { + "target": "com.amazonaws.socialmessaging#WhatsAppPhoneNumberId", + "traits": { + "smithy.api#documentation": "

The phone number ID. Phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901.

", + "smithy.api#required": {} + } + }, + "metaPhoneNumberId": { + "target": "com.amazonaws.socialmessaging#WhatsAppPhoneNumber", + "traits": { + "smithy.api#documentation": "

The phone number ID from Meta.

", + "smithy.api#required": {} + } + }, + "displayPhoneNumberName": { + "target": "com.amazonaws.socialmessaging#WhatsAppPhoneNumberName", + "traits": { + "smithy.api#documentation": "

The display name for this phone number.

", + "smithy.api#required": {} + } + }, + "displayPhoneNumber": { + "target": "com.amazonaws.socialmessaging#WhatsAppDisplayPhoneNumber", + "traits": { + "smithy.api#documentation": "

The phone number that appears in the recipients display.

", + "smithy.api#required": {} + } + }, + "qualityRating": { + "target": "com.amazonaws.socialmessaging#WhatsAppPhoneNumberQualityRating", + "traits": { + "smithy.api#documentation": "

The quality rating of the phone number.

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

The details of your WhatsApp phone number.

" + } + }, + "com.amazonaws.socialmessaging#WhatsAppPhoneNumberDetailList": { + "type": "list", + "member": { + "target": "com.amazonaws.socialmessaging#WhatsAppPhoneNumberDetail" + } + }, + "com.amazonaws.socialmessaging#WhatsAppPhoneNumberId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 100 + }, + "smithy.api#pattern": "(^phone-number-id-.*$)|(^arn:.*:phone-number-id/[0-9a-zA-Z]+$)" + } + }, + "com.amazonaws.socialmessaging#WhatsAppPhoneNumberName": { + "type": "string", + "traits": { + "smithy.api#length": { + "max": 200 + } + } + }, + "com.amazonaws.socialmessaging#WhatsAppPhoneNumberQualityRating": { + "type": "string", + "traits": { + "smithy.api#length": { + "max": 10 + } + } + }, + "com.amazonaws.socialmessaging#WhatsAppPhoneNumberSummary": { + "type": "structure", + "members": { + "arn": { + "target": "com.amazonaws.socialmessaging#LinkedWhatsAppPhoneNumberArn", + "traits": { + "smithy.api#documentation": "

The full Amazon Resource Name (ARN) for the phone number.

", + "smithy.api#required": {} + } + }, + "phoneNumber": { + "target": "com.amazonaws.socialmessaging#PhoneNumber", + "traits": { + "smithy.api#documentation": "

The phone number associated with the Linked WhatsApp Business Account.

", + "smithy.api#required": {} + } + }, + "phoneNumberId": { + "target": "com.amazonaws.socialmessaging#WhatsAppPhoneNumberId", + "traits": { + "smithy.api#documentation": "

The phone number ID. Phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901.

", + "smithy.api#required": {} + } + }, + "metaPhoneNumberId": { + "target": "com.amazonaws.socialmessaging#WhatsAppPhoneNumber", + "traits": { + "smithy.api#documentation": "

The phone number ID from Meta.

", + "smithy.api#required": {} + } + }, + "displayPhoneNumberName": { + "target": "com.amazonaws.socialmessaging#WhatsAppPhoneNumberName", + "traits": { + "smithy.api#documentation": "

The display name for this phone number.

", + "smithy.api#required": {} + } + }, + "displayPhoneNumber": { + "target": "com.amazonaws.socialmessaging#WhatsAppDisplayPhoneNumber", + "traits": { + "smithy.api#documentation": "

The phone number that appears in the recipients display.

", + "smithy.api#required": {} + } + }, + "qualityRating": { + "target": "com.amazonaws.socialmessaging#WhatsAppPhoneNumberQualityRating", + "traits": { + "smithy.api#documentation": "

The quality rating of the phone number. This is from Meta.

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

The details of a linked phone number.

" + } + }, + "com.amazonaws.socialmessaging#WhatsAppPhoneNumberSummaryList": { + "type": "list", + "member": { + "target": "com.amazonaws.socialmessaging#WhatsAppPhoneNumberSummary" + } + }, + "com.amazonaws.socialmessaging#WhatsAppSetupFinalization": { + "type": "structure", + "members": { + "associateInProgressToken": { + "target": "com.amazonaws.socialmessaging#AssociateInProgressToken", + "traits": { + "smithy.api#documentation": "

An Amazon Web Services access token generated by WhatsAppSignupCallback and used by WhatsAppSetupFinalization.

", + "smithy.api#required": {} + } + }, + "phoneNumbers": { + "target": "com.amazonaws.socialmessaging#WabaPhoneNumberSetupFinalizationList", + "traits": { + "smithy.api#documentation": "

An array of WabaPhoneNumberSetupFinalization objects containing the details of each phone number associated with the WhatsApp Business Account.

", + "smithy.api#required": {} + } + }, + "phoneNumberParent": { + "target": "com.amazonaws.socialmessaging#LinkedWhatsAppBusinessAccountId", + "traits": { + "smithy.api#documentation": "

Used to add a new phone number to an existing WhatsApp Business Account. This field can't be used when the waba field is present.

" + } + }, + "waba": { + "target": "com.amazonaws.socialmessaging#WabaSetupFinalization", + "traits": { + "smithy.api#documentation": "

Used to create a new WhatsApp Business Account and add a phone number. This field can't be used when the phoneNumberParent field is present.

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

The details of linking a WhatsApp Business Account to your Amazon Web Services account.

" + } + }, + "com.amazonaws.socialmessaging#WhatsAppSignupCallback": { + "type": "structure", + "members": { + "accessToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The access token for your WhatsApp Business Account. The accessToken value is provided by Meta.

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

Contains the accessToken provided by Meta during signup.

" + } + }, + "com.amazonaws.socialmessaging#WhatsAppSignupCallbackResult": { + "type": "structure", + "members": { + "associateInProgressToken": { + "target": "com.amazonaws.socialmessaging#AssociateInProgressToken", + "traits": { + "smithy.api#documentation": "

An Amazon Web Services access token generated by WhatsAppSignupCallback and used by WhatsAppSetupFinalization.

" + } + }, + "linkedAccountsWithIncompleteSetup": { + "target": "com.amazonaws.socialmessaging#LinkedAccountWithIncompleteSetup", + "traits": { + "smithy.api#documentation": "

A LinkedWhatsAppBusinessAccountIdMetaData object map containing the details of any WhatsAppBusiness accounts that have incomplete setup.

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

Contains the results of WhatsAppSignupCallback.

" + } + } + } +}