@aws-sdk/client-socialmessaging 3.848.0 → 3.855.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/README.md +64 -0
  2. package/dist-cjs/SocialMessaging.js +16 -0
  3. package/dist-cjs/commands/CreateWhatsAppMessageTemplateCommand.js +26 -0
  4. package/dist-cjs/commands/CreateWhatsAppMessageTemplateFromLibraryCommand.js +26 -0
  5. package/dist-cjs/commands/CreateWhatsAppMessageTemplateMediaCommand.js +27 -0
  6. package/dist-cjs/commands/DeleteWhatsAppMessageTemplateCommand.js +26 -0
  7. package/dist-cjs/commands/GetWhatsAppMessageTemplateCommand.js +26 -0
  8. package/dist-cjs/commands/ListWhatsAppMessageTemplatesCommand.js +26 -0
  9. package/dist-cjs/commands/ListWhatsAppTemplateLibraryCommand.js +26 -0
  10. package/dist-cjs/commands/UpdateWhatsAppMessageTemplateCommand.js +26 -0
  11. package/dist-cjs/commands/index.js +8 -0
  12. package/dist-cjs/models/models_0.js +19 -1
  13. package/dist-cjs/pagination/ListWhatsAppMessageTemplatesPaginator.js +7 -0
  14. package/dist-cjs/pagination/ListWhatsAppTemplateLibraryPaginator.js +7 -0
  15. package/dist-cjs/pagination/index.js +2 -0
  16. package/dist-cjs/protocols/Aws_restJson1.js +265 -4
  17. package/dist-es/SocialMessaging.js +16 -0
  18. package/dist-es/commands/CreateWhatsAppMessageTemplateCommand.js +22 -0
  19. package/dist-es/commands/CreateWhatsAppMessageTemplateFromLibraryCommand.js +22 -0
  20. package/dist-es/commands/CreateWhatsAppMessageTemplateMediaCommand.js +23 -0
  21. package/dist-es/commands/DeleteWhatsAppMessageTemplateCommand.js +22 -0
  22. package/dist-es/commands/GetWhatsAppMessageTemplateCommand.js +22 -0
  23. package/dist-es/commands/ListWhatsAppMessageTemplatesCommand.js +22 -0
  24. package/dist-es/commands/ListWhatsAppTemplateLibraryCommand.js +22 -0
  25. package/dist-es/commands/UpdateWhatsAppMessageTemplateCommand.js +22 -0
  26. package/dist-es/commands/index.js +8 -0
  27. package/dist-es/models/models_0.js +16 -0
  28. package/dist-es/pagination/ListWhatsAppMessageTemplatesPaginator.js +4 -0
  29. package/dist-es/pagination/ListWhatsAppTemplateLibraryPaginator.js +4 -0
  30. package/dist-es/pagination/index.js +2 -0
  31. package/dist-es/protocols/Aws_restJson1.js +249 -4
  32. package/dist-types/SocialMessaging.d.ts +56 -0
  33. package/dist-types/SocialMessagingClient.d.ts +10 -2
  34. package/dist-types/commands/AssociateWhatsAppBusinessAccountCommand.d.ts +5 -0
  35. package/dist-types/commands/CreateWhatsAppMessageTemplateCommand.d.ts +97 -0
  36. package/dist-types/commands/CreateWhatsAppMessageTemplateFromLibraryCommand.d.ts +125 -0
  37. package/dist-types/commands/CreateWhatsAppMessageTemplateMediaCommand.d.ts +98 -0
  38. package/dist-types/commands/DeleteWhatsAppMessageTemplateCommand.d.ts +95 -0
  39. package/dist-types/commands/GetLinkedWhatsAppBusinessAccountCommand.d.ts +1 -0
  40. package/dist-types/commands/GetLinkedWhatsAppBusinessAccountPhoneNumberCommand.d.ts +1 -0
  41. package/dist-types/commands/GetWhatsAppMessageTemplateCommand.d.ts +95 -0
  42. package/dist-types/commands/ListWhatsAppMessageTemplatesCommand.d.ts +106 -0
  43. package/dist-types/commands/ListWhatsAppTemplateLibraryCommand.d.ts +129 -0
  44. package/dist-types/commands/UpdateWhatsAppMessageTemplateCommand.d.ts +95 -0
  45. package/dist-types/commands/index.d.ts +8 -0
  46. package/dist-types/models/models_0.d.ts +550 -28
  47. package/dist-types/pagination/ListWhatsAppMessageTemplatesPaginator.d.ts +7 -0
  48. package/dist-types/pagination/ListWhatsAppTemplateLibraryPaginator.d.ts +7 -0
  49. package/dist-types/pagination/index.d.ts +2 -0
  50. package/dist-types/protocols/Aws_restJson1.d.ts +72 -0
  51. package/dist-types/ts3.4/SocialMessaging.d.ts +148 -0
  52. package/dist-types/ts3.4/SocialMessagingClient.d.ts +50 -2
  53. package/dist-types/ts3.4/commands/CreateWhatsAppMessageTemplateCommand.d.ts +51 -0
  54. package/dist-types/ts3.4/commands/CreateWhatsAppMessageTemplateFromLibraryCommand.d.ts +51 -0
  55. package/dist-types/ts3.4/commands/CreateWhatsAppMessageTemplateMediaCommand.d.ts +51 -0
  56. package/dist-types/ts3.4/commands/DeleteWhatsAppMessageTemplateCommand.d.ts +51 -0
  57. package/dist-types/ts3.4/commands/GetWhatsAppMessageTemplateCommand.d.ts +51 -0
  58. package/dist-types/ts3.4/commands/ListWhatsAppMessageTemplatesCommand.d.ts +51 -0
  59. package/dist-types/ts3.4/commands/ListWhatsAppTemplateLibraryCommand.d.ts +51 -0
  60. package/dist-types/ts3.4/commands/UpdateWhatsAppMessageTemplateCommand.d.ts +51 -0
  61. package/dist-types/ts3.4/commands/index.d.ts +8 -0
  62. package/dist-types/ts3.4/models/models_0.d.ts +139 -9
  63. package/dist-types/ts3.4/pagination/ListWhatsAppMessageTemplatesPaginator.d.ts +11 -0
  64. package/dist-types/ts3.4/pagination/ListWhatsAppTemplateLibraryPaginator.d.ts +11 -0
  65. package/dist-types/ts3.4/pagination/index.d.ts +2 -0
  66. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +96 -0
  67. package/package.json +5 -5
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_SendWhatsAppMessageCommand = exports.de_PutWhatsAppBusinessAccountEventDestinationsCommand = exports.de_PostWhatsAppMessageMediaCommand = exports.de_ListTagsForResourceCommand = exports.de_ListLinkedWhatsAppBusinessAccountsCommand = exports.de_GetWhatsAppMessageMediaCommand = exports.de_GetLinkedWhatsAppBusinessAccountPhoneNumberCommand = exports.de_GetLinkedWhatsAppBusinessAccountCommand = exports.de_DisassociateWhatsAppBusinessAccountCommand = exports.de_DeleteWhatsAppMessageMediaCommand = exports.de_AssociateWhatsAppBusinessAccountCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_SendWhatsAppMessageCommand = exports.se_PutWhatsAppBusinessAccountEventDestinationsCommand = exports.se_PostWhatsAppMessageMediaCommand = exports.se_ListTagsForResourceCommand = exports.se_ListLinkedWhatsAppBusinessAccountsCommand = exports.se_GetWhatsAppMessageMediaCommand = exports.se_GetLinkedWhatsAppBusinessAccountPhoneNumberCommand = exports.se_GetLinkedWhatsAppBusinessAccountCommand = exports.se_DisassociateWhatsAppBusinessAccountCommand = exports.se_DeleteWhatsAppMessageMediaCommand = exports.se_AssociateWhatsAppBusinessAccountCommand = void 0;
3
+ exports.de_UpdateWhatsAppMessageTemplateCommand = exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_SendWhatsAppMessageCommand = exports.de_PutWhatsAppBusinessAccountEventDestinationsCommand = exports.de_PostWhatsAppMessageMediaCommand = exports.de_ListWhatsAppTemplateLibraryCommand = exports.de_ListWhatsAppMessageTemplatesCommand = exports.de_ListTagsForResourceCommand = exports.de_ListLinkedWhatsAppBusinessAccountsCommand = exports.de_GetWhatsAppMessageTemplateCommand = exports.de_GetWhatsAppMessageMediaCommand = exports.de_GetLinkedWhatsAppBusinessAccountPhoneNumberCommand = exports.de_GetLinkedWhatsAppBusinessAccountCommand = exports.de_DisassociateWhatsAppBusinessAccountCommand = exports.de_DeleteWhatsAppMessageTemplateCommand = exports.de_DeleteWhatsAppMessageMediaCommand = exports.de_CreateWhatsAppMessageTemplateMediaCommand = exports.de_CreateWhatsAppMessageTemplateFromLibraryCommand = exports.de_CreateWhatsAppMessageTemplateCommand = exports.de_AssociateWhatsAppBusinessAccountCommand = exports.se_UpdateWhatsAppMessageTemplateCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_SendWhatsAppMessageCommand = exports.se_PutWhatsAppBusinessAccountEventDestinationsCommand = exports.se_PostWhatsAppMessageMediaCommand = exports.se_ListWhatsAppTemplateLibraryCommand = exports.se_ListWhatsAppMessageTemplatesCommand = exports.se_ListTagsForResourceCommand = exports.se_ListLinkedWhatsAppBusinessAccountsCommand = exports.se_GetWhatsAppMessageTemplateCommand = exports.se_GetWhatsAppMessageMediaCommand = exports.se_GetLinkedWhatsAppBusinessAccountPhoneNumberCommand = exports.se_GetLinkedWhatsAppBusinessAccountCommand = exports.se_DisassociateWhatsAppBusinessAccountCommand = exports.se_DeleteWhatsAppMessageTemplateCommand = exports.se_DeleteWhatsAppMessageMediaCommand = exports.se_CreateWhatsAppMessageTemplateMediaCommand = exports.se_CreateWhatsAppMessageTemplateFromLibraryCommand = exports.se_CreateWhatsAppMessageTemplateCommand = exports.se_AssociateWhatsAppBusinessAccountCommand = void 0;
4
4
  const core_1 = require("@aws-sdk/core");
5
5
  const core_2 = require("@smithy/core");
6
6
  const smithy_client_1 = require("@smithy/smithy-client");
@@ -21,6 +21,51 @@ const se_AssociateWhatsAppBusinessAccountCommand = async (input, context) => {
21
21
  return b.build();
22
22
  };
23
23
  exports.se_AssociateWhatsAppBusinessAccountCommand = se_AssociateWhatsAppBusinessAccountCommand;
24
+ const se_CreateWhatsAppMessageTemplateCommand = async (input, context) => {
25
+ const b = (0, core_2.requestBuilder)(input, context);
26
+ const headers = {
27
+ "content-type": "application/json",
28
+ };
29
+ b.bp("/v1/whatsapp/template/put");
30
+ let body;
31
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
32
+ id: [],
33
+ templateDefinition: (_) => context.base64Encoder(_),
34
+ }));
35
+ b.m("POST").h(headers).b(body);
36
+ return b.build();
37
+ };
38
+ exports.se_CreateWhatsAppMessageTemplateCommand = se_CreateWhatsAppMessageTemplateCommand;
39
+ const se_CreateWhatsAppMessageTemplateFromLibraryCommand = async (input, context) => {
40
+ const b = (0, core_2.requestBuilder)(input, context);
41
+ const headers = {
42
+ "content-type": "application/json",
43
+ };
44
+ b.bp("/v1/whatsapp/template/create");
45
+ let body;
46
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
47
+ id: [],
48
+ metaLibraryTemplate: (_) => (0, smithy_client_1._json)(_),
49
+ }));
50
+ b.m("POST").h(headers).b(body);
51
+ return b.build();
52
+ };
53
+ exports.se_CreateWhatsAppMessageTemplateFromLibraryCommand = se_CreateWhatsAppMessageTemplateFromLibraryCommand;
54
+ const se_CreateWhatsAppMessageTemplateMediaCommand = async (input, context) => {
55
+ const b = (0, core_2.requestBuilder)(input, context);
56
+ const headers = {
57
+ "content-type": "application/json",
58
+ };
59
+ b.bp("/v1/whatsapp/template/media");
60
+ let body;
61
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
62
+ id: [],
63
+ sourceS3File: (_) => (0, smithy_client_1._json)(_),
64
+ }));
65
+ b.m("POST").h(headers).b(body);
66
+ return b.build();
67
+ };
68
+ exports.se_CreateWhatsAppMessageTemplateMediaCommand = se_CreateWhatsAppMessageTemplateMediaCommand;
24
69
  const se_DeleteWhatsAppMessageMediaCommand = async (input, context) => {
25
70
  const b = (0, core_2.requestBuilder)(input, context);
26
71
  const headers = {};
@@ -34,6 +79,21 @@ const se_DeleteWhatsAppMessageMediaCommand = async (input, context) => {
34
79
  return b.build();
35
80
  };
36
81
  exports.se_DeleteWhatsAppMessageMediaCommand = se_DeleteWhatsAppMessageMediaCommand;
82
+ const se_DeleteWhatsAppMessageTemplateCommand = async (input, context) => {
83
+ const b = (0, core_2.requestBuilder)(input, context);
84
+ const headers = {};
85
+ b.bp("/v1/whatsapp/template");
86
+ const query = (0, smithy_client_1.map)({
87
+ [_mTI]: [, input[_mTI]],
88
+ [_dAT]: [() => input.deleteAllLanguages !== void 0, () => input[_dAL].toString()],
89
+ [_i]: [, (0, smithy_client_1.expectNonNull)(input[_i], `id`)],
90
+ [_tN]: [, (0, smithy_client_1.expectNonNull)(input[_tN], `templateName`)],
91
+ });
92
+ let body;
93
+ b.m("DELETE").h(headers).q(query).b(body);
94
+ return b.build();
95
+ };
96
+ exports.se_DeleteWhatsAppMessageTemplateCommand = se_DeleteWhatsAppMessageTemplateCommand;
37
97
  const se_DisassociateWhatsAppBusinessAccountCommand = async (input, context) => {
38
98
  const b = (0, core_2.requestBuilder)(input, context);
39
99
  const headers = {};
@@ -88,6 +148,19 @@ const se_GetWhatsAppMessageMediaCommand = async (input, context) => {
88
148
  return b.build();
89
149
  };
90
150
  exports.se_GetWhatsAppMessageMediaCommand = se_GetWhatsAppMessageMediaCommand;
151
+ const se_GetWhatsAppMessageTemplateCommand = async (input, context) => {
152
+ const b = (0, core_2.requestBuilder)(input, context);
153
+ const headers = {};
154
+ b.bp("/v1/whatsapp/template");
155
+ const query = (0, smithy_client_1.map)({
156
+ [_mTI]: [, (0, smithy_client_1.expectNonNull)(input[_mTI], `metaTemplateId`)],
157
+ [_i]: [, (0, smithy_client_1.expectNonNull)(input[_i], `id`)],
158
+ });
159
+ let body;
160
+ b.m("GET").h(headers).q(query).b(body);
161
+ return b.build();
162
+ };
163
+ exports.se_GetWhatsAppMessageTemplateCommand = se_GetWhatsAppMessageTemplateCommand;
91
164
  const se_ListLinkedWhatsAppBusinessAccountsCommand = async (input, context) => {
92
165
  const b = (0, core_2.requestBuilder)(input, context);
93
166
  const headers = {};
@@ -113,6 +186,39 @@ const se_ListTagsForResourceCommand = async (input, context) => {
113
186
  return b.build();
114
187
  };
115
188
  exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
189
+ const se_ListWhatsAppMessageTemplatesCommand = async (input, context) => {
190
+ const b = (0, core_2.requestBuilder)(input, context);
191
+ const headers = {};
192
+ b.bp("/v1/whatsapp/template/list");
193
+ const query = (0, smithy_client_1.map)({
194
+ [_i]: [, (0, smithy_client_1.expectNonNull)(input[_i], `id`)],
195
+ [_nT]: [, input[_nT]],
196
+ [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
197
+ });
198
+ let body;
199
+ b.m("GET").h(headers).q(query).b(body);
200
+ return b.build();
201
+ };
202
+ exports.se_ListWhatsAppMessageTemplatesCommand = se_ListWhatsAppMessageTemplatesCommand;
203
+ const se_ListWhatsAppTemplateLibraryCommand = async (input, context) => {
204
+ const b = (0, core_2.requestBuilder)(input, context);
205
+ const headers = {
206
+ "content-type": "application/json",
207
+ };
208
+ b.bp("/v1/whatsapp/template/library");
209
+ const query = (0, smithy_client_1.map)({
210
+ [_i]: [, (0, smithy_client_1.expectNonNull)(input[_i], `id`)],
211
+ });
212
+ let body;
213
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
214
+ filters: (_) => (0, smithy_client_1._json)(_),
215
+ maxResults: [],
216
+ nextToken: [],
217
+ }));
218
+ b.m("POST").h(headers).q(query).b(body);
219
+ return b.build();
220
+ };
221
+ exports.se_ListWhatsAppTemplateLibraryCommand = se_ListWhatsAppTemplateLibraryCommand;
116
222
  const se_PostWhatsAppMessageMediaCommand = async (input, context) => {
117
223
  const b = (0, core_2.requestBuilder)(input, context);
118
224
  const headers = {
@@ -190,6 +296,23 @@ const se_UntagResourceCommand = async (input, context) => {
190
296
  return b.build();
191
297
  };
192
298
  exports.se_UntagResourceCommand = se_UntagResourceCommand;
299
+ const se_UpdateWhatsAppMessageTemplateCommand = async (input, context) => {
300
+ const b = (0, core_2.requestBuilder)(input, context);
301
+ const headers = {
302
+ "content-type": "application/json",
303
+ };
304
+ b.bp("/v1/whatsapp/template");
305
+ let body;
306
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
307
+ id: [],
308
+ metaTemplateId: [],
309
+ templateCategory: [],
310
+ templateComponents: (_) => context.base64Encoder(_),
311
+ }));
312
+ b.m("POST").h(headers).b(body);
313
+ return b.build();
314
+ };
315
+ exports.se_UpdateWhatsAppMessageTemplateCommand = se_UpdateWhatsAppMessageTemplateCommand;
193
316
  const de_AssociateWhatsAppBusinessAccountCommand = async (output, context) => {
194
317
  if (output.statusCode !== 200 && output.statusCode >= 300) {
195
318
  return de_CommandError(output, context);
@@ -206,6 +329,55 @@ const de_AssociateWhatsAppBusinessAccountCommand = async (output, context) => {
206
329
  return contents;
207
330
  };
208
331
  exports.de_AssociateWhatsAppBusinessAccountCommand = de_AssociateWhatsAppBusinessAccountCommand;
332
+ const de_CreateWhatsAppMessageTemplateCommand = async (output, context) => {
333
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
334
+ return de_CommandError(output, context);
335
+ }
336
+ const contents = (0, smithy_client_1.map)({
337
+ $metadata: deserializeMetadata(output),
338
+ });
339
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context)), "body");
340
+ const doc = (0, smithy_client_1.take)(data, {
341
+ category: smithy_client_1.expectString,
342
+ metaTemplateId: smithy_client_1.expectString,
343
+ templateStatus: smithy_client_1.expectString,
344
+ });
345
+ Object.assign(contents, doc);
346
+ return contents;
347
+ };
348
+ exports.de_CreateWhatsAppMessageTemplateCommand = de_CreateWhatsAppMessageTemplateCommand;
349
+ const de_CreateWhatsAppMessageTemplateFromLibraryCommand = async (output, context) => {
350
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
351
+ return de_CommandError(output, context);
352
+ }
353
+ const contents = (0, smithy_client_1.map)({
354
+ $metadata: deserializeMetadata(output),
355
+ });
356
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context)), "body");
357
+ const doc = (0, smithy_client_1.take)(data, {
358
+ category: smithy_client_1.expectString,
359
+ metaTemplateId: smithy_client_1.expectString,
360
+ templateStatus: smithy_client_1.expectString,
361
+ });
362
+ Object.assign(contents, doc);
363
+ return contents;
364
+ };
365
+ exports.de_CreateWhatsAppMessageTemplateFromLibraryCommand = de_CreateWhatsAppMessageTemplateFromLibraryCommand;
366
+ const de_CreateWhatsAppMessageTemplateMediaCommand = async (output, context) => {
367
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
368
+ return de_CommandError(output, context);
369
+ }
370
+ const contents = (0, smithy_client_1.map)({
371
+ $metadata: deserializeMetadata(output),
372
+ });
373
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context)), "body");
374
+ const doc = (0, smithy_client_1.take)(data, {
375
+ metaHeaderHandle: smithy_client_1.expectString,
376
+ });
377
+ Object.assign(contents, doc);
378
+ return contents;
379
+ };
380
+ exports.de_CreateWhatsAppMessageTemplateMediaCommand = de_CreateWhatsAppMessageTemplateMediaCommand;
209
381
  const de_DeleteWhatsAppMessageMediaCommand = async (output, context) => {
210
382
  if (output.statusCode !== 200 && output.statusCode >= 300) {
211
383
  return de_CommandError(output, context);
@@ -221,6 +393,17 @@ const de_DeleteWhatsAppMessageMediaCommand = async (output, context) => {
221
393
  return contents;
222
394
  };
223
395
  exports.de_DeleteWhatsAppMessageMediaCommand = de_DeleteWhatsAppMessageMediaCommand;
396
+ const de_DeleteWhatsAppMessageTemplateCommand = async (output, context) => {
397
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
398
+ return de_CommandError(output, context);
399
+ }
400
+ const contents = (0, smithy_client_1.map)({
401
+ $metadata: deserializeMetadata(output),
402
+ });
403
+ await (0, smithy_client_1.collectBody)(output.body, context);
404
+ return contents;
405
+ };
406
+ exports.de_DeleteWhatsAppMessageTemplateCommand = de_DeleteWhatsAppMessageTemplateCommand;
224
407
  const de_DisassociateWhatsAppBusinessAccountCommand = async (output, context) => {
225
408
  if (output.statusCode !== 200 && output.statusCode >= 300) {
226
409
  return de_CommandError(output, context);
@@ -279,6 +462,21 @@ const de_GetWhatsAppMessageMediaCommand = async (output, context) => {
279
462
  return contents;
280
463
  };
281
464
  exports.de_GetWhatsAppMessageMediaCommand = de_GetWhatsAppMessageMediaCommand;
465
+ const de_GetWhatsAppMessageTemplateCommand = async (output, context) => {
466
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
467
+ return de_CommandError(output, context);
468
+ }
469
+ const contents = (0, smithy_client_1.map)({
470
+ $metadata: deserializeMetadata(output),
471
+ });
472
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context)), "body");
473
+ const doc = (0, smithy_client_1.take)(data, {
474
+ template: smithy_client_1.expectString,
475
+ });
476
+ Object.assign(contents, doc);
477
+ return contents;
478
+ };
479
+ exports.de_GetWhatsAppMessageTemplateCommand = de_GetWhatsAppMessageTemplateCommand;
282
480
  const de_ListLinkedWhatsAppBusinessAccountsCommand = async (output, context) => {
283
481
  if (output.statusCode !== 200 && output.statusCode >= 300) {
284
482
  return de_CommandError(output, context);
@@ -311,6 +509,38 @@ const de_ListTagsForResourceCommand = async (output, context) => {
311
509
  return contents;
312
510
  };
313
511
  exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
512
+ const de_ListWhatsAppMessageTemplatesCommand = async (output, context) => {
513
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
514
+ return de_CommandError(output, context);
515
+ }
516
+ const contents = (0, smithy_client_1.map)({
517
+ $metadata: deserializeMetadata(output),
518
+ });
519
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context)), "body");
520
+ const doc = (0, smithy_client_1.take)(data, {
521
+ nextToken: smithy_client_1.expectString,
522
+ templates: smithy_client_1._json,
523
+ });
524
+ Object.assign(contents, doc);
525
+ return contents;
526
+ };
527
+ exports.de_ListWhatsAppMessageTemplatesCommand = de_ListWhatsAppMessageTemplatesCommand;
528
+ const de_ListWhatsAppTemplateLibraryCommand = async (output, context) => {
529
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
530
+ return de_CommandError(output, context);
531
+ }
532
+ const contents = (0, smithy_client_1.map)({
533
+ $metadata: deserializeMetadata(output),
534
+ });
535
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context)), "body");
536
+ const doc = (0, smithy_client_1.take)(data, {
537
+ metaLibraryTemplates: smithy_client_1._json,
538
+ nextToken: smithy_client_1.expectString,
539
+ });
540
+ Object.assign(contents, doc);
541
+ return contents;
542
+ };
543
+ exports.de_ListWhatsAppTemplateLibraryCommand = de_ListWhatsAppTemplateLibraryCommand;
314
544
  const de_PostWhatsAppMessageMediaCommand = async (output, context) => {
315
545
  if (output.statusCode !== 200 && output.statusCode >= 300) {
316
546
  return de_CommandError(output, context);
@@ -382,6 +612,17 @@ const de_UntagResourceCommand = async (output, context) => {
382
612
  return contents;
383
613
  };
384
614
  exports.de_UntagResourceCommand = de_UntagResourceCommand;
615
+ const de_UpdateWhatsAppMessageTemplateCommand = async (output, context) => {
616
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
617
+ return de_CommandError(output, context);
618
+ }
619
+ const contents = (0, smithy_client_1.map)({
620
+ $metadata: deserializeMetadata(output),
621
+ });
622
+ await (0, smithy_client_1.collectBody)(output.body, context);
623
+ return contents;
624
+ };
625
+ exports.de_UpdateWhatsAppMessageTemplateCommand = de_UpdateWhatsAppMessageTemplateCommand;
385
626
  const de_CommandError = async (output, context) => {
386
627
  const parsedOutput = {
387
628
  ...output,
@@ -398,21 +639,24 @@ const de_CommandError = async (output, context) => {
398
639
  case "InvalidParametersException":
399
640
  case "com.amazonaws.socialmessaging#InvalidParametersException":
400
641
  throw await de_InvalidParametersExceptionRes(parsedOutput, context);
642
+ case "LimitExceededException":
643
+ case "com.amazonaws.socialmessaging#LimitExceededException":
644
+ throw await de_LimitExceededExceptionRes(parsedOutput, context);
401
645
  case "ThrottledRequestException":
402
646
  case "com.amazonaws.socialmessaging#ThrottledRequestException":
403
647
  throw await de_ThrottledRequestExceptionRes(parsedOutput, context);
404
648
  case "ValidationException":
405
649
  case "com.amazonaws.socialmessaging#ValidationException":
406
650
  throw await de_ValidationExceptionRes(parsedOutput, context);
407
- case "AccessDeniedByMetaException":
408
- case "com.amazonaws.socialmessaging#AccessDeniedByMetaException":
409
- throw await de_AccessDeniedByMetaExceptionRes(parsedOutput, context);
410
651
  case "InternalServiceException":
411
652
  case "com.amazonaws.socialmessaging#InternalServiceException":
412
653
  throw await de_InternalServiceExceptionRes(parsedOutput, context);
413
654
  case "ResourceNotFoundException":
414
655
  case "com.amazonaws.socialmessaging#ResourceNotFoundException":
415
656
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
657
+ case "AccessDeniedByMetaException":
658
+ case "com.amazonaws.socialmessaging#AccessDeniedByMetaException":
659
+ throw await de_AccessDeniedByMetaExceptionRes(parsedOutput, context);
416
660
  default:
417
661
  const parsedBody = parsedOutput.body;
418
662
  return throwDefaultError({
@@ -488,6 +732,19 @@ const de_InvalidParametersExceptionRes = async (parsedOutput, context) => {
488
732
  });
489
733
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
490
734
  };
735
+ const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
736
+ const contents = (0, smithy_client_1.map)({});
737
+ const data = parsedOutput.body;
738
+ const doc = (0, smithy_client_1.take)(data, {
739
+ message: smithy_client_1.expectString,
740
+ });
741
+ Object.assign(contents, doc);
742
+ const exception = new models_0_1.LimitExceededException({
743
+ $metadata: deserializeMetadata(parsedOutput),
744
+ ...contents,
745
+ });
746
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
747
+ };
491
748
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
492
749
  const contents = (0, smithy_client_1.map)({});
493
750
  const data = parsedOutput.body;
@@ -565,9 +822,13 @@ const deserializeMetadata = (output) => ({
565
822
  cfId: output.headers["x-amz-cf-id"],
566
823
  });
567
824
  const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
825
+ const _dAL = "deleteAllLanguages";
826
+ const _dAT = "deleteAllTemplates";
568
827
  const _i = "id";
569
828
  const _mI = "mediaId";
570
829
  const _mR = "maxResults";
830
+ const _mTI = "metaTemplateId";
571
831
  const _nT = "nextToken";
572
832
  const _oPNI = "originationPhoneNumberId";
573
833
  const _rA = "resourceArn";
834
+ const _tN = "templateName";
@@ -1,32 +1,48 @@
1
1
  import { createAggregatedClient } from "@smithy/smithy-client";
2
2
  import { AssociateWhatsAppBusinessAccountCommand, } from "./commands/AssociateWhatsAppBusinessAccountCommand";
3
+ import { CreateWhatsAppMessageTemplateCommand, } from "./commands/CreateWhatsAppMessageTemplateCommand";
4
+ import { CreateWhatsAppMessageTemplateFromLibraryCommand, } from "./commands/CreateWhatsAppMessageTemplateFromLibraryCommand";
5
+ import { CreateWhatsAppMessageTemplateMediaCommand, } from "./commands/CreateWhatsAppMessageTemplateMediaCommand";
3
6
  import { DeleteWhatsAppMessageMediaCommand, } from "./commands/DeleteWhatsAppMessageMediaCommand";
7
+ import { DeleteWhatsAppMessageTemplateCommand, } from "./commands/DeleteWhatsAppMessageTemplateCommand";
4
8
  import { DisassociateWhatsAppBusinessAccountCommand, } from "./commands/DisassociateWhatsAppBusinessAccountCommand";
5
9
  import { GetLinkedWhatsAppBusinessAccountCommand, } from "./commands/GetLinkedWhatsAppBusinessAccountCommand";
6
10
  import { GetLinkedWhatsAppBusinessAccountPhoneNumberCommand, } from "./commands/GetLinkedWhatsAppBusinessAccountPhoneNumberCommand";
7
11
  import { GetWhatsAppMessageMediaCommand, } from "./commands/GetWhatsAppMessageMediaCommand";
12
+ import { GetWhatsAppMessageTemplateCommand, } from "./commands/GetWhatsAppMessageTemplateCommand";
8
13
  import { ListLinkedWhatsAppBusinessAccountsCommand, } from "./commands/ListLinkedWhatsAppBusinessAccountsCommand";
9
14
  import { ListTagsForResourceCommand, } from "./commands/ListTagsForResourceCommand";
15
+ import { ListWhatsAppMessageTemplatesCommand, } from "./commands/ListWhatsAppMessageTemplatesCommand";
16
+ import { ListWhatsAppTemplateLibraryCommand, } from "./commands/ListWhatsAppTemplateLibraryCommand";
10
17
  import { PostWhatsAppMessageMediaCommand, } from "./commands/PostWhatsAppMessageMediaCommand";
11
18
  import { PutWhatsAppBusinessAccountEventDestinationsCommand, } from "./commands/PutWhatsAppBusinessAccountEventDestinationsCommand";
12
19
  import { SendWhatsAppMessageCommand, } from "./commands/SendWhatsAppMessageCommand";
13
20
  import { TagResourceCommand } from "./commands/TagResourceCommand";
14
21
  import { UntagResourceCommand, } from "./commands/UntagResourceCommand";
22
+ import { UpdateWhatsAppMessageTemplateCommand, } from "./commands/UpdateWhatsAppMessageTemplateCommand";
15
23
  import { SocialMessagingClient } from "./SocialMessagingClient";
16
24
  const commands = {
17
25
  AssociateWhatsAppBusinessAccountCommand,
26
+ CreateWhatsAppMessageTemplateCommand,
27
+ CreateWhatsAppMessageTemplateFromLibraryCommand,
28
+ CreateWhatsAppMessageTemplateMediaCommand,
18
29
  DeleteWhatsAppMessageMediaCommand,
30
+ DeleteWhatsAppMessageTemplateCommand,
19
31
  DisassociateWhatsAppBusinessAccountCommand,
20
32
  GetLinkedWhatsAppBusinessAccountCommand,
21
33
  GetLinkedWhatsAppBusinessAccountPhoneNumberCommand,
22
34
  GetWhatsAppMessageMediaCommand,
35
+ GetWhatsAppMessageTemplateCommand,
23
36
  ListLinkedWhatsAppBusinessAccountsCommand,
24
37
  ListTagsForResourceCommand,
38
+ ListWhatsAppMessageTemplatesCommand,
39
+ ListWhatsAppTemplateLibraryCommand,
25
40
  PostWhatsAppMessageMediaCommand,
26
41
  PutWhatsAppBusinessAccountEventDestinationsCommand,
27
42
  SendWhatsAppMessageCommand,
28
43
  TagResourceCommand,
29
44
  UntagResourceCommand,
45
+ UpdateWhatsAppMessageTemplateCommand,
30
46
  };
31
47
  export class SocialMessaging extends SocialMessagingClient {
32
48
  }
@@ -0,0 +1,22 @@
1
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { commonParams } from "../endpoint/EndpointParameters";
5
+ import { de_CreateWhatsAppMessageTemplateCommand, se_CreateWhatsAppMessageTemplateCommand, } from "../protocols/Aws_restJson1";
6
+ export { $Command };
7
+ export class CreateWhatsAppMessageTemplateCommand extends $Command
8
+ .classBuilder()
9
+ .ep(commonParams)
10
+ .m(function (Command, cs, config, o) {
11
+ return [
12
+ getSerdePlugin(config, this.serialize, this.deserialize),
13
+ getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
14
+ ];
15
+ })
16
+ .s("SocialMessaging", "CreateWhatsAppMessageTemplate", {})
17
+ .n("SocialMessagingClient", "CreateWhatsAppMessageTemplateCommand")
18
+ .f(void 0, void 0)
19
+ .ser(se_CreateWhatsAppMessageTemplateCommand)
20
+ .de(de_CreateWhatsAppMessageTemplateCommand)
21
+ .build() {
22
+ }
@@ -0,0 +1,22 @@
1
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { commonParams } from "../endpoint/EndpointParameters";
5
+ import { de_CreateWhatsAppMessageTemplateFromLibraryCommand, se_CreateWhatsAppMessageTemplateFromLibraryCommand, } from "../protocols/Aws_restJson1";
6
+ export { $Command };
7
+ export class CreateWhatsAppMessageTemplateFromLibraryCommand extends $Command
8
+ .classBuilder()
9
+ .ep(commonParams)
10
+ .m(function (Command, cs, config, o) {
11
+ return [
12
+ getSerdePlugin(config, this.serialize, this.deserialize),
13
+ getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
14
+ ];
15
+ })
16
+ .s("SocialMessaging", "CreateWhatsAppMessageTemplateFromLibrary", {})
17
+ .n("SocialMessagingClient", "CreateWhatsAppMessageTemplateFromLibraryCommand")
18
+ .f(void 0, void 0)
19
+ .ser(se_CreateWhatsAppMessageTemplateFromLibraryCommand)
20
+ .de(de_CreateWhatsAppMessageTemplateFromLibraryCommand)
21
+ .build() {
22
+ }
@@ -0,0 +1,23 @@
1
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { commonParams } from "../endpoint/EndpointParameters";
5
+ import { CreateWhatsAppMessageTemplateMediaInputFilterSensitiveLog, } from "../models/models_0";
6
+ import { de_CreateWhatsAppMessageTemplateMediaCommand, se_CreateWhatsAppMessageTemplateMediaCommand, } from "../protocols/Aws_restJson1";
7
+ export { $Command };
8
+ export class CreateWhatsAppMessageTemplateMediaCommand extends $Command
9
+ .classBuilder()
10
+ .ep(commonParams)
11
+ .m(function (Command, cs, config, o) {
12
+ return [
13
+ getSerdePlugin(config, this.serialize, this.deserialize),
14
+ getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
15
+ ];
16
+ })
17
+ .s("SocialMessaging", "CreateWhatsAppMessageTemplateMedia", {})
18
+ .n("SocialMessagingClient", "CreateWhatsAppMessageTemplateMediaCommand")
19
+ .f(CreateWhatsAppMessageTemplateMediaInputFilterSensitiveLog, void 0)
20
+ .ser(se_CreateWhatsAppMessageTemplateMediaCommand)
21
+ .de(de_CreateWhatsAppMessageTemplateMediaCommand)
22
+ .build() {
23
+ }
@@ -0,0 +1,22 @@
1
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { commonParams } from "../endpoint/EndpointParameters";
5
+ import { de_DeleteWhatsAppMessageTemplateCommand, se_DeleteWhatsAppMessageTemplateCommand, } from "../protocols/Aws_restJson1";
6
+ export { $Command };
7
+ export class DeleteWhatsAppMessageTemplateCommand extends $Command
8
+ .classBuilder()
9
+ .ep(commonParams)
10
+ .m(function (Command, cs, config, o) {
11
+ return [
12
+ getSerdePlugin(config, this.serialize, this.deserialize),
13
+ getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
14
+ ];
15
+ })
16
+ .s("SocialMessaging", "DeleteWhatsAppMessageTemplate", {})
17
+ .n("SocialMessagingClient", "DeleteWhatsAppMessageTemplateCommand")
18
+ .f(void 0, void 0)
19
+ .ser(se_DeleteWhatsAppMessageTemplateCommand)
20
+ .de(de_DeleteWhatsAppMessageTemplateCommand)
21
+ .build() {
22
+ }
@@ -0,0 +1,22 @@
1
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { commonParams } from "../endpoint/EndpointParameters";
5
+ import { de_GetWhatsAppMessageTemplateCommand, se_GetWhatsAppMessageTemplateCommand } from "../protocols/Aws_restJson1";
6
+ export { $Command };
7
+ export class GetWhatsAppMessageTemplateCommand extends $Command
8
+ .classBuilder()
9
+ .ep(commonParams)
10
+ .m(function (Command, cs, config, o) {
11
+ return [
12
+ getSerdePlugin(config, this.serialize, this.deserialize),
13
+ getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
14
+ ];
15
+ })
16
+ .s("SocialMessaging", "GetWhatsAppMessageTemplate", {})
17
+ .n("SocialMessagingClient", "GetWhatsAppMessageTemplateCommand")
18
+ .f(void 0, void 0)
19
+ .ser(se_GetWhatsAppMessageTemplateCommand)
20
+ .de(de_GetWhatsAppMessageTemplateCommand)
21
+ .build() {
22
+ }
@@ -0,0 +1,22 @@
1
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { commonParams } from "../endpoint/EndpointParameters";
5
+ import { de_ListWhatsAppMessageTemplatesCommand, se_ListWhatsAppMessageTemplatesCommand, } from "../protocols/Aws_restJson1";
6
+ export { $Command };
7
+ export class ListWhatsAppMessageTemplatesCommand extends $Command
8
+ .classBuilder()
9
+ .ep(commonParams)
10
+ .m(function (Command, cs, config, o) {
11
+ return [
12
+ getSerdePlugin(config, this.serialize, this.deserialize),
13
+ getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
14
+ ];
15
+ })
16
+ .s("SocialMessaging", "ListWhatsAppMessageTemplates", {})
17
+ .n("SocialMessagingClient", "ListWhatsAppMessageTemplatesCommand")
18
+ .f(void 0, void 0)
19
+ .ser(se_ListWhatsAppMessageTemplatesCommand)
20
+ .de(de_ListWhatsAppMessageTemplatesCommand)
21
+ .build() {
22
+ }
@@ -0,0 +1,22 @@
1
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { commonParams } from "../endpoint/EndpointParameters";
5
+ import { de_ListWhatsAppTemplateLibraryCommand, se_ListWhatsAppTemplateLibraryCommand, } from "../protocols/Aws_restJson1";
6
+ export { $Command };
7
+ export class ListWhatsAppTemplateLibraryCommand extends $Command
8
+ .classBuilder()
9
+ .ep(commonParams)
10
+ .m(function (Command, cs, config, o) {
11
+ return [
12
+ getSerdePlugin(config, this.serialize, this.deserialize),
13
+ getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
14
+ ];
15
+ })
16
+ .s("SocialMessaging", "ListWhatsAppTemplateLibrary", {})
17
+ .n("SocialMessagingClient", "ListWhatsAppTemplateLibraryCommand")
18
+ .f(void 0, void 0)
19
+ .ser(se_ListWhatsAppTemplateLibraryCommand)
20
+ .de(de_ListWhatsAppTemplateLibraryCommand)
21
+ .build() {
22
+ }
@@ -0,0 +1,22 @@
1
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { commonParams } from "../endpoint/EndpointParameters";
5
+ import { de_UpdateWhatsAppMessageTemplateCommand, se_UpdateWhatsAppMessageTemplateCommand, } from "../protocols/Aws_restJson1";
6
+ export { $Command };
7
+ export class UpdateWhatsAppMessageTemplateCommand extends $Command
8
+ .classBuilder()
9
+ .ep(commonParams)
10
+ .m(function (Command, cs, config, o) {
11
+ return [
12
+ getSerdePlugin(config, this.serialize, this.deserialize),
13
+ getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
14
+ ];
15
+ })
16
+ .s("SocialMessaging", "UpdateWhatsAppMessageTemplate", {})
17
+ .n("SocialMessagingClient", "UpdateWhatsAppMessageTemplateCommand")
18
+ .f(void 0, void 0)
19
+ .ser(se_UpdateWhatsAppMessageTemplateCommand)
20
+ .de(de_UpdateWhatsAppMessageTemplateCommand)
21
+ .build() {
22
+ }
@@ -1,13 +1,21 @@
1
1
  export * from "./AssociateWhatsAppBusinessAccountCommand";
2
+ export * from "./CreateWhatsAppMessageTemplateCommand";
3
+ export * from "./CreateWhatsAppMessageTemplateFromLibraryCommand";
4
+ export * from "./CreateWhatsAppMessageTemplateMediaCommand";
2
5
  export * from "./DeleteWhatsAppMessageMediaCommand";
6
+ export * from "./DeleteWhatsAppMessageTemplateCommand";
3
7
  export * from "./DisassociateWhatsAppBusinessAccountCommand";
4
8
  export * from "./GetLinkedWhatsAppBusinessAccountCommand";
5
9
  export * from "./GetLinkedWhatsAppBusinessAccountPhoneNumberCommand";
6
10
  export * from "./GetWhatsAppMessageMediaCommand";
11
+ export * from "./GetWhatsAppMessageTemplateCommand";
7
12
  export * from "./ListLinkedWhatsAppBusinessAccountsCommand";
8
13
  export * from "./ListTagsForResourceCommand";
14
+ export * from "./ListWhatsAppMessageTemplatesCommand";
15
+ export * from "./ListWhatsAppTemplateLibraryCommand";
9
16
  export * from "./PostWhatsAppMessageMediaCommand";
10
17
  export * from "./PutWhatsAppBusinessAccountEventDestinationsCommand";
11
18
  export * from "./SendWhatsAppMessageCommand";
12
19
  export * from "./TagResourceCommand";
13
20
  export * from "./UntagResourceCommand";
21
+ export * from "./UpdateWhatsAppMessageTemplateCommand";