@wildix/xbees-kite-client 1.4.1 → 3.1.1

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 (128) hide show
  1. package/dist-cjs/Kite.js +3 -3
  2. package/dist-cjs/KiteClient.js +34 -28
  3. package/dist-cjs/auth/httpAuthExtensionConfiguration.js +43 -0
  4. package/dist-cjs/auth/httpAuthSchemeProvider.js +40 -0
  5. package/dist-cjs/commands/CancelCalendarEventCommand.js +10 -11
  6. package/dist-cjs/commands/CreateOrUpdateWidgetPreviewCommand.js +10 -11
  7. package/dist-cjs/commands/CreateWidgetCommand.js +10 -11
  8. package/dist-cjs/commands/DeleteWidgetCommand.js +10 -11
  9. package/dist-cjs/commands/GetCalendarSlotsCommand.js +10 -11
  10. package/dist-cjs/commands/GetConfigCommand.js +10 -11
  11. package/dist-cjs/commands/GetSmsNumberConfigurationCommand.js +10 -11
  12. package/dist-cjs/commands/GetWhatsAppNumberConfigurationCommand.js +10 -11
  13. package/dist-cjs/commands/GetWidgetCommand.js +10 -11
  14. package/dist-cjs/commands/ListAgentsCommand.js +10 -11
  15. package/dist-cjs/commands/ListServicesCommand.js +10 -11
  16. package/dist-cjs/commands/ListSmsConfigurationsCommand.js +10 -11
  17. package/dist-cjs/commands/ListSmsNumbersCommand.js +10 -11
  18. package/dist-cjs/commands/ListWhatsAppConfigurationsCommand.js +10 -11
  19. package/dist-cjs/commands/ListWhatsAppNumbersCommand.js +10 -11
  20. package/dist-cjs/commands/ListWhatsAppTemplatesCommand.js +10 -11
  21. package/dist-cjs/commands/ListWidgetsCommand.js +10 -11
  22. package/dist-cjs/commands/PutSmsNumberConfigurationCommand.js +10 -11
  23. package/dist-cjs/commands/PutWhatsAppNumberConfigurationCommand.js +10 -11
  24. package/dist-cjs/commands/RescheduleCalendarEventCommand.js +10 -11
  25. package/dist-cjs/commands/ScheduleCalendarEventCommand.js +10 -11
  26. package/dist-cjs/commands/UpdateWidgetCommand.js +10 -11
  27. package/dist-cjs/endpoint/EndpointParameters.js +16 -0
  28. package/dist-cjs/endpoint/bdd.js +28 -0
  29. package/dist-cjs/endpoint/endpointResolver.js +16 -0
  30. package/dist-cjs/index.js +7 -4
  31. package/dist-cjs/models/KiteSyntheticServiceException.js +12 -0
  32. package/dist-cjs/models/enums.js +80 -0
  33. package/dist-cjs/models/errors.js +116 -0
  34. package/dist-cjs/models/models_0.js +0 -303
  35. package/dist-cjs/runtimeConfig.browser.js +11 -11
  36. package/dist-cjs/runtimeConfig.js +22 -18
  37. package/dist-cjs/runtimeConfig.shared.js +30 -10
  38. package/dist-cjs/runtimeExtensions.js +6 -5
  39. package/dist-cjs/schemas/schemas_0.js +1160 -0
  40. package/dist-es/Kite.js +4 -4
  41. package/dist-es/KiteClient.js +30 -24
  42. package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
  43. package/dist-es/auth/httpAuthSchemeProvider.js +34 -0
  44. package/dist-es/commands/CancelCalendarEventCommand.js +9 -10
  45. package/dist-es/commands/CreateOrUpdateWidgetPreviewCommand.js +9 -10
  46. package/dist-es/commands/CreateWidgetCommand.js +9 -10
  47. package/dist-es/commands/DeleteWidgetCommand.js +9 -10
  48. package/dist-es/commands/GetCalendarSlotsCommand.js +9 -10
  49. package/dist-es/commands/GetConfigCommand.js +9 -10
  50. package/dist-es/commands/GetSmsNumberConfigurationCommand.js +9 -10
  51. package/dist-es/commands/GetWhatsAppNumberConfigurationCommand.js +9 -10
  52. package/dist-es/commands/GetWidgetCommand.js +9 -10
  53. package/dist-es/commands/ListAgentsCommand.js +9 -10
  54. package/dist-es/commands/ListServicesCommand.js +9 -10
  55. package/dist-es/commands/ListSmsConfigurationsCommand.js +9 -10
  56. package/dist-es/commands/ListSmsNumbersCommand.js +9 -10
  57. package/dist-es/commands/ListWhatsAppConfigurationsCommand.js +9 -10
  58. package/dist-es/commands/ListWhatsAppNumbersCommand.js +9 -10
  59. package/dist-es/commands/ListWhatsAppTemplatesCommand.js +9 -10
  60. package/dist-es/commands/ListWidgetsCommand.js +9 -10
  61. package/dist-es/commands/PutSmsNumberConfigurationCommand.js +9 -10
  62. package/dist-es/commands/PutWhatsAppNumberConfigurationCommand.js +9 -10
  63. package/dist-es/commands/RescheduleCalendarEventCommand.js +9 -10
  64. package/dist-es/commands/ScheduleCalendarEventCommand.js +9 -10
  65. package/dist-es/commands/UpdateWidgetCommand.js +9 -10
  66. package/dist-es/endpoint/EndpointParameters.js +12 -0
  67. package/dist-es/endpoint/bdd.js +25 -0
  68. package/dist-es/endpoint/endpointResolver.js +12 -0
  69. package/dist-es/index.js +5 -2
  70. package/dist-es/models/KiteSyntheticServiceException.js +8 -0
  71. package/dist-es/models/enums.js +77 -0
  72. package/dist-es/models/errors.js +105 -0
  73. package/dist-es/models/models_0.js +1 -294
  74. package/dist-es/runtimeConfig.browser.js +7 -7
  75. package/dist-es/runtimeConfig.js +17 -13
  76. package/dist-es/runtimeConfig.shared.js +24 -4
  77. package/dist-es/runtimeExtensions.js +6 -5
  78. package/dist-es/schemas/schemas_0.js +1155 -0
  79. package/dist-types/Kite.d.ts +23 -23
  80. package/dist-types/KiteClient.d.ts +52 -34
  81. package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
  82. package/dist-types/auth/httpAuthSchemeProvider.d.ts +81 -0
  83. package/dist-types/commands/CancelCalendarEventCommand.d.ts +12 -8
  84. package/dist-types/commands/CreateOrUpdateWidgetPreviewCommand.d.ts +12 -8
  85. package/dist-types/commands/CreateWidgetCommand.d.ts +12 -8
  86. package/dist-types/commands/DeleteWidgetCommand.d.ts +12 -8
  87. package/dist-types/commands/GetCalendarSlotsCommand.d.ts +12 -8
  88. package/dist-types/commands/GetConfigCommand.d.ts +12 -8
  89. package/dist-types/commands/GetSmsNumberConfigurationCommand.d.ts +12 -8
  90. package/dist-types/commands/GetWhatsAppNumberConfigurationCommand.d.ts +12 -8
  91. package/dist-types/commands/GetWidgetCommand.d.ts +12 -8
  92. package/dist-types/commands/ListAgentsCommand.d.ts +12 -8
  93. package/dist-types/commands/ListServicesCommand.d.ts +12 -8
  94. package/dist-types/commands/ListSmsConfigurationsCommand.d.ts +12 -8
  95. package/dist-types/commands/ListSmsNumbersCommand.d.ts +12 -8
  96. package/dist-types/commands/ListWhatsAppConfigurationsCommand.d.ts +12 -8
  97. package/dist-types/commands/ListWhatsAppNumbersCommand.d.ts +12 -8
  98. package/dist-types/commands/ListWhatsAppTemplatesCommand.d.ts +12 -8
  99. package/dist-types/commands/ListWidgetsCommand.d.ts +12 -8
  100. package/dist-types/commands/PutSmsNumberConfigurationCommand.d.ts +12 -8
  101. package/dist-types/commands/PutWhatsAppNumberConfigurationCommand.d.ts +12 -8
  102. package/dist-types/commands/RescheduleCalendarEventCommand.d.ts +12 -8
  103. package/dist-types/commands/ScheduleCalendarEventCommand.d.ts +12 -8
  104. package/dist-types/commands/UpdateWidgetCommand.d.ts +12 -8
  105. package/dist-types/endpoint/EndpointParameters.d.ts +41 -0
  106. package/dist-types/endpoint/bdd.d.ts +2 -0
  107. package/dist-types/endpoint/endpointResolver.d.ts +8 -0
  108. package/dist-types/extensionConfiguration.d.ts +4 -3
  109. package/dist-types/index.d.ts +6 -2
  110. package/dist-types/models/{KiteServiceException.d.ts → KiteSyntheticServiceException.d.ts} +2 -2
  111. package/dist-types/models/enums.d.ts +197 -0
  112. package/dist-types/models/errors.d.ts +110 -0
  113. package/dist-types/models/models_0.d.ts +105 -381
  114. package/dist-types/runtimeConfig.browser.d.ts +35 -16
  115. package/dist-types/runtimeConfig.d.ts +34 -15
  116. package/dist-types/runtimeConfig.native.d.ts +36 -17
  117. package/dist-types/runtimeConfig.shared.d.ts +20 -3
  118. package/dist-types/runtimeExtensions.d.ts +1 -1
  119. package/dist-types/schemas/schemas_0.d.ts +153 -0
  120. package/package.json +14 -40
  121. package/dist-cjs/models/KiteServiceException.js +0 -12
  122. package/dist-cjs/models/index.js +0 -4
  123. package/dist-cjs/protocols/Aws_restJson1.js +0 -963
  124. package/dist-es/models/KiteServiceException.js +0 -8
  125. package/dist-es/models/index.js +0 -1
  126. package/dist-es/protocols/Aws_restJson1.js +0 -916
  127. package/dist-types/models/index.d.ts +0 -1
  128. package/dist-types/protocols/Aws_restJson1.d.ts +0 -200
@@ -1,963 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_UpdateWidgetCommand = exports.de_ScheduleCalendarEventCommand = exports.de_RescheduleCalendarEventCommand = exports.de_PutWhatsAppNumberConfigurationCommand = exports.de_PutSmsNumberConfigurationCommand = exports.de_ListWidgetsCommand = exports.de_ListWhatsAppTemplatesCommand = exports.de_ListWhatsAppNumbersCommand = exports.de_ListWhatsAppConfigurationsCommand = exports.de_ListSmsNumbersCommand = exports.de_ListSmsConfigurationsCommand = exports.de_ListServicesCommand = exports.de_ListAgentsCommand = exports.de_GetWidgetCommand = exports.de_GetWhatsAppNumberConfigurationCommand = exports.de_GetSmsNumberConfigurationCommand = exports.de_GetConfigCommand = exports.de_GetCalendarSlotsCommand = exports.de_DeleteWidgetCommand = exports.de_CreateWidgetCommand = exports.de_CreateOrUpdateWidgetPreviewCommand = exports.de_CancelCalendarEventCommand = exports.se_UpdateWidgetCommand = exports.se_ScheduleCalendarEventCommand = exports.se_RescheduleCalendarEventCommand = exports.se_PutWhatsAppNumberConfigurationCommand = exports.se_PutSmsNumberConfigurationCommand = exports.se_ListWidgetsCommand = exports.se_ListWhatsAppTemplatesCommand = exports.se_ListWhatsAppNumbersCommand = exports.se_ListWhatsAppConfigurationsCommand = exports.se_ListSmsNumbersCommand = exports.se_ListSmsConfigurationsCommand = exports.se_ListServicesCommand = exports.se_ListAgentsCommand = exports.se_GetWidgetCommand = exports.se_GetWhatsAppNumberConfigurationCommand = exports.se_GetSmsNumberConfigurationCommand = exports.se_GetConfigCommand = exports.se_GetCalendarSlotsCommand = exports.se_DeleteWidgetCommand = exports.se_CreateWidgetCommand = exports.se_CreateOrUpdateWidgetPreviewCommand = exports.se_CancelCalendarEventCommand = void 0;
4
- const KiteServiceException_1 = require("../models/KiteServiceException");
5
- const models_0_1 = require("../models/models_0");
6
- const core_1 = require("@aws-sdk/core");
7
- const core_2 = require("@smithy/core");
8
- const smithy_client_1 = require("@smithy/smithy-client");
9
- const se_CancelCalendarEventCommand = async (input, context) => {
10
- const b = (0, core_2.requestBuilder)(input, context);
11
- const headers = {};
12
- b.bp("/v2/kite/calendar/channels/{channelId}/events/{eventOwner}/{eventId}");
13
- b.p('channelId', () => input.channelId, '{channelId}', false);
14
- b.p('eventId', () => input.eventId, '{eventId}', false);
15
- b.p('eventOwner', () => input.eventOwner, '{eventOwner}', false);
16
- const query = (0, smithy_client_1.map)({
17
- [_r]: [, input[_r]],
18
- });
19
- let body;
20
- b.m("DELETE")
21
- .h(headers)
22
- .q(query)
23
- .b(body);
24
- return b.build();
25
- };
26
- exports.se_CancelCalendarEventCommand = se_CancelCalendarEventCommand;
27
- const se_CreateOrUpdateWidgetPreviewCommand = async (input, context) => {
28
- const b = (0, core_2.requestBuilder)(input, context);
29
- const headers = {
30
- 'content-type': 'application/json',
31
- };
32
- b.bp("/v2/kite/widgets/preview");
33
- const query = (0, smithy_client_1.map)({
34
- [_c]: [, input[_cI]],
35
- });
36
- let body;
37
- body = JSON.stringify((0, smithy_client_1.take)(input, {
38
- 'actions': _ => (0, smithy_client_1._json)(_),
39
- 'anonymousSessionsEnabled': [],
40
- 'anonymousSessionsOnly': [],
41
- 'anonymousSessionsRandomNameEnabled': [],
42
- 'appearance': _ => (0, smithy_client_1._json)(_),
43
- 'name': [],
44
- 'routes': _ => se_WidgetRoutesList(_, context),
45
- 'target': _ => (0, smithy_client_1._json)(_),
46
- 'temporaryWidgetId': [],
47
- 'welcomeMessages': _ => (0, smithy_client_1._json)(_),
48
- }));
49
- b.m("POST")
50
- .h(headers)
51
- .q(query)
52
- .b(body);
53
- return b.build();
54
- };
55
- exports.se_CreateOrUpdateWidgetPreviewCommand = se_CreateOrUpdateWidgetPreviewCommand;
56
- const se_CreateWidgetCommand = async (input, context) => {
57
- const b = (0, core_2.requestBuilder)(input, context);
58
- const headers = {
59
- 'content-type': 'application/json',
60
- };
61
- b.bp("/v2/kite/widgets");
62
- const query = (0, smithy_client_1.map)({
63
- [_c]: [, input[_cI]],
64
- });
65
- let body;
66
- body = JSON.stringify((0, smithy_client_1.take)(input, {
67
- 'actions': _ => (0, smithy_client_1._json)(_),
68
- 'anonymousSessionsEnabled': [],
69
- 'anonymousSessionsOnly': [],
70
- 'anonymousSessionsRandomNameEnabled': [],
71
- 'appearance': _ => (0, smithy_client_1._json)(_),
72
- 'name': [],
73
- 'routes': _ => se_WidgetRoutesList(_, context),
74
- 'target': _ => (0, smithy_client_1._json)(_),
75
- 'welcomeMessages': _ => (0, smithy_client_1._json)(_),
76
- }));
77
- b.m("POST")
78
- .h(headers)
79
- .q(query)
80
- .b(body);
81
- return b.build();
82
- };
83
- exports.se_CreateWidgetCommand = se_CreateWidgetCommand;
84
- const se_DeleteWidgetCommand = async (input, context) => {
85
- const b = (0, core_2.requestBuilder)(input, context);
86
- const headers = {};
87
- b.bp("/v2/kite/widgets/{widgetId}");
88
- b.p('widgetId', () => input.widgetId, '{widgetId}', false);
89
- let body;
90
- b.m("DELETE")
91
- .h(headers)
92
- .b(body);
93
- return b.build();
94
- };
95
- exports.se_DeleteWidgetCommand = se_DeleteWidgetCommand;
96
- const se_GetCalendarSlotsCommand = async (input, context) => {
97
- const b = (0, core_2.requestBuilder)(input, context);
98
- const headers = {};
99
- b.bp("/v2/kite/calendar/widgets/{targetId}/slots");
100
- b.p('targetId', () => input.targetId, '{targetId}', false);
101
- const query = (0, smithy_client_1.map)({
102
- [_f]: [, (0, smithy_client_1.expectNonNull)(input[_f], `from`)],
103
- [_t]: [, (0, smithy_client_1.expectNonNull)(input[_t], `till`)],
104
- [_d]: [, input[_d]],
105
- [_tZ]: [, (0, smithy_client_1.expectNonNull)(input[_tZ], `timeZone`)],
106
- [_e]: [, input[_e]],
107
- });
108
- let body;
109
- b.m("GET")
110
- .h(headers)
111
- .q(query)
112
- .b(body);
113
- return b.build();
114
- };
115
- exports.se_GetCalendarSlotsCommand = se_GetCalendarSlotsCommand;
116
- const se_GetConfigCommand = async (input, context) => {
117
- const b = (0, core_2.requestBuilder)(input, context);
118
- const headers = {};
119
- b.bp("/v2/kite/config/{targetId}");
120
- b.p('targetId', () => input.targetId, '{targetId}', false);
121
- const query = (0, smithy_client_1.map)({
122
- [_ro]: [, input[_tRI]],
123
- });
124
- let body;
125
- b.m("GET")
126
- .h(headers)
127
- .q(query)
128
- .b(body);
129
- return b.build();
130
- };
131
- exports.se_GetConfigCommand = se_GetConfigCommand;
132
- const se_GetSmsNumberConfigurationCommand = async (input, context) => {
133
- const b = (0, core_2.requestBuilder)(input, context);
134
- const headers = {};
135
- b.bp("/v2/kite/sms/configurations/{serviceNumber}");
136
- b.p('serviceNumber', () => input.serviceNumber, '{serviceNumber}', false);
137
- const query = (0, smithy_client_1.map)({
138
- [_c]: [, input[_cI]],
139
- });
140
- let body;
141
- b.m("GET")
142
- .h(headers)
143
- .q(query)
144
- .b(body);
145
- return b.build();
146
- };
147
- exports.se_GetSmsNumberConfigurationCommand = se_GetSmsNumberConfigurationCommand;
148
- const se_GetWhatsAppNumberConfigurationCommand = async (input, context) => {
149
- const b = (0, core_2.requestBuilder)(input, context);
150
- const headers = {};
151
- b.bp("/v2/kite/whatsapp/configurations/{serviceNumber}");
152
- b.p('serviceNumber', () => input.serviceNumber, '{serviceNumber}', false);
153
- const query = (0, smithy_client_1.map)({
154
- [_c]: [, input[_cI]],
155
- });
156
- let body;
157
- b.m("GET")
158
- .h(headers)
159
- .q(query)
160
- .b(body);
161
- return b.build();
162
- };
163
- exports.se_GetWhatsAppNumberConfigurationCommand = se_GetWhatsAppNumberConfigurationCommand;
164
- const se_GetWidgetCommand = async (input, context) => {
165
- const b = (0, core_2.requestBuilder)(input, context);
166
- const headers = {};
167
- b.bp("/v2/kite/widgets/{widgetId}");
168
- b.p('widgetId', () => input.widgetId, '{widgetId}', false);
169
- let body;
170
- b.m("GET")
171
- .h(headers)
172
- .b(body);
173
- return b.build();
174
- };
175
- exports.se_GetWidgetCommand = se_GetWidgetCommand;
176
- const se_ListAgentsCommand = async (input, context) => {
177
- const b = (0, core_2.requestBuilder)(input, context);
178
- const headers = {
179
- 'content-type': 'application/json',
180
- };
181
- b.bp("/v2/kite/agents");
182
- const query = (0, smithy_client_1.map)({
183
- [_c]: [, input[_cI]],
184
- });
185
- let body;
186
- body = JSON.stringify((0, smithy_client_1.take)(input, {
187
- 'filter': _ => (0, smithy_client_1._json)(_),
188
- }));
189
- b.m("POST")
190
- .h(headers)
191
- .q(query)
192
- .b(body);
193
- return b.build();
194
- };
195
- exports.se_ListAgentsCommand = se_ListAgentsCommand;
196
- const se_ListServicesCommand = async (input, context) => {
197
- const b = (0, core_2.requestBuilder)(input, context);
198
- const headers = {};
199
- b.bp("/v2/kite/services");
200
- const query = (0, smithy_client_1.map)({
201
- [_c]: [, input[_cI]],
202
- });
203
- let body;
204
- b.m("GET")
205
- .h(headers)
206
- .q(query)
207
- .b(body);
208
- return b.build();
209
- };
210
- exports.se_ListServicesCommand = se_ListServicesCommand;
211
- const se_ListSmsConfigurationsCommand = async (input, context) => {
212
- const b = (0, core_2.requestBuilder)(input, context);
213
- const headers = {};
214
- b.bp("/v2/kite/sms/configurations");
215
- const query = (0, smithy_client_1.map)({
216
- [_c]: [, input[_cI]],
217
- });
218
- let body;
219
- b.m("GET")
220
- .h(headers)
221
- .q(query)
222
- .b(body);
223
- return b.build();
224
- };
225
- exports.se_ListSmsConfigurationsCommand = se_ListSmsConfigurationsCommand;
226
- const se_ListSmsNumbersCommand = async (input, context) => {
227
- const b = (0, core_2.requestBuilder)(input, context);
228
- const headers = {};
229
- b.bp("/v2/kite/sms/numbers");
230
- const query = (0, smithy_client_1.map)({
231
- [_c]: [, input[_cI]],
232
- });
233
- let body;
234
- b.m("GET")
235
- .h(headers)
236
- .q(query)
237
- .b(body);
238
- return b.build();
239
- };
240
- exports.se_ListSmsNumbersCommand = se_ListSmsNumbersCommand;
241
- const se_ListWhatsAppConfigurationsCommand = async (input, context) => {
242
- const b = (0, core_2.requestBuilder)(input, context);
243
- const headers = {};
244
- b.bp("/v2/kite/whatsapp/configurations");
245
- const query = (0, smithy_client_1.map)({
246
- [_c]: [, input[_cI]],
247
- });
248
- let body;
249
- b.m("GET")
250
- .h(headers)
251
- .q(query)
252
- .b(body);
253
- return b.build();
254
- };
255
- exports.se_ListWhatsAppConfigurationsCommand = se_ListWhatsAppConfigurationsCommand;
256
- const se_ListWhatsAppNumbersCommand = async (input, context) => {
257
- const b = (0, core_2.requestBuilder)(input, context);
258
- const headers = {};
259
- b.bp("/v2/kite/whatsapp/numbers");
260
- const query = (0, smithy_client_1.map)({
261
- [_c]: [, input[_cI]],
262
- });
263
- let body;
264
- b.m("GET")
265
- .h(headers)
266
- .q(query)
267
- .b(body);
268
- return b.build();
269
- };
270
- exports.se_ListWhatsAppNumbersCommand = se_ListWhatsAppNumbersCommand;
271
- const se_ListWhatsAppTemplatesCommand = async (input, context) => {
272
- const b = (0, core_2.requestBuilder)(input, context);
273
- const headers = {};
274
- b.bp("/v2/kite/whatsapp/templates/{serviceNumber}");
275
- b.p('serviceNumber', () => input.serviceNumber, '{serviceNumber}', false);
276
- const query = (0, smithy_client_1.map)({
277
- [_c]: [, input[_cI]],
278
- });
279
- let body;
280
- b.m("GET")
281
- .h(headers)
282
- .q(query)
283
- .b(body);
284
- return b.build();
285
- };
286
- exports.se_ListWhatsAppTemplatesCommand = se_ListWhatsAppTemplatesCommand;
287
- const se_ListWidgetsCommand = async (input, context) => {
288
- const b = (0, core_2.requestBuilder)(input, context);
289
- const headers = {};
290
- b.bp("/v2/kite/widgets");
291
- const query = (0, smithy_client_1.map)({
292
- [_c]: [, input[_cI]],
293
- });
294
- let body;
295
- b.m("GET")
296
- .h(headers)
297
- .q(query)
298
- .b(body);
299
- return b.build();
300
- };
301
- exports.se_ListWidgetsCommand = se_ListWidgetsCommand;
302
- const se_PutSmsNumberConfigurationCommand = async (input, context) => {
303
- const b = (0, core_2.requestBuilder)(input, context);
304
- const headers = {
305
- 'content-type': 'application/json',
306
- };
307
- b.bp("/v2/kite/sms/configurations/{serviceNumber}");
308
- b.p('serviceNumber', () => input.serviceNumber, '{serviceNumber}', false);
309
- const query = (0, smithy_client_1.map)({
310
- [_c]: [, input[_cI]],
311
- });
312
- let body;
313
- body = JSON.stringify((0, smithy_client_1.take)(input, {
314
- 'actions': _ => (0, smithy_client_1._json)(_),
315
- 'routes': _ => (0, smithy_client_1._json)(_),
316
- 'serviceUri': [],
317
- 'target': _ => (0, smithy_client_1._json)(_),
318
- }));
319
- b.m("PUT")
320
- .h(headers)
321
- .q(query)
322
- .b(body);
323
- return b.build();
324
- };
325
- exports.se_PutSmsNumberConfigurationCommand = se_PutSmsNumberConfigurationCommand;
326
- const se_PutWhatsAppNumberConfigurationCommand = async (input, context) => {
327
- const b = (0, core_2.requestBuilder)(input, context);
328
- const headers = {
329
- 'content-type': 'application/json',
330
- };
331
- b.bp("/v2/kite/whatsapp/configurations/{serviceNumber}");
332
- b.p('serviceNumber', () => input.serviceNumber, '{serviceNumber}', false);
333
- const query = (0, smithy_client_1.map)({
334
- [_c]: [, input[_cI]],
335
- });
336
- let body;
337
- body = JSON.stringify((0, smithy_client_1.take)(input, {
338
- 'actions': _ => (0, smithy_client_1._json)(_),
339
- 'routes': _ => (0, smithy_client_1._json)(_),
340
- 'serviceUri': [],
341
- 'target': _ => (0, smithy_client_1._json)(_),
342
- }));
343
- b.m("PUT")
344
- .h(headers)
345
- .q(query)
346
- .b(body);
347
- return b.build();
348
- };
349
- exports.se_PutWhatsAppNumberConfigurationCommand = se_PutWhatsAppNumberConfigurationCommand;
350
- const se_RescheduleCalendarEventCommand = async (input, context) => {
351
- const b = (0, core_2.requestBuilder)(input, context);
352
- const headers = {
353
- 'content-type': 'application/json',
354
- };
355
- b.bp("/v2/kite/calendar/channels/{channelId}/events/{eventOwner}/{eventId}");
356
- b.p('channelId', () => input.channelId, '{channelId}', false);
357
- b.p('eventId', () => input.eventId, '{eventId}', false);
358
- b.p('eventOwner', () => input.eventOwner, '{eventOwner}', false);
359
- let body;
360
- body = JSON.stringify((0, smithy_client_1.take)(input, {
361
- 'attendees': _ => (0, smithy_client_1._json)(_),
362
- 'changed': _ => (0, smithy_client_1._json)(_),
363
- 'duration': [],
364
- 'reason': [],
365
- 'start': [],
366
- 'summary': [],
367
- }));
368
- b.m("PATCH")
369
- .h(headers)
370
- .b(body);
371
- return b.build();
372
- };
373
- exports.se_RescheduleCalendarEventCommand = se_RescheduleCalendarEventCommand;
374
- const se_ScheduleCalendarEventCommand = async (input, context) => {
375
- const b = (0, core_2.requestBuilder)(input, context);
376
- const headers = {
377
- 'content-type': 'application/json',
378
- };
379
- b.bp("/v2/kite/calendar/widgets/{targetId}");
380
- b.p('targetId', () => input.targetId, '{targetId}', false);
381
- let body;
382
- body = JSON.stringify((0, smithy_client_1.take)(input, {
383
- 'attendees': _ => (0, smithy_client_1._json)(_),
384
- 'channelId': [],
385
- 'duration': [],
386
- 'language': [],
387
- 'start': [],
388
- 'summary': [],
389
- 'timeZone': [],
390
- }));
391
- b.m("POST")
392
- .h(headers)
393
- .b(body);
394
- return b.build();
395
- };
396
- exports.se_ScheduleCalendarEventCommand = se_ScheduleCalendarEventCommand;
397
- const se_UpdateWidgetCommand = async (input, context) => {
398
- const b = (0, core_2.requestBuilder)(input, context);
399
- const headers = {
400
- 'content-type': 'application/json',
401
- };
402
- b.bp("/v2/kite/widgets/{widgetId}");
403
- b.p('widgetId', () => input.widgetId, '{widgetId}', false);
404
- const query = (0, smithy_client_1.map)({
405
- [_c]: [, input[_cI]],
406
- });
407
- let body;
408
- body = JSON.stringify((0, smithy_client_1.take)(input, {
409
- 'actions': _ => (0, smithy_client_1._json)(_),
410
- 'anonymousSessionsEnabled': [],
411
- 'anonymousSessionsOnly': [],
412
- 'anonymousSessionsRandomNameEnabled': [],
413
- 'appearance': _ => (0, smithy_client_1._json)(_),
414
- 'name': [],
415
- 'routes': _ => se_WidgetRoutesList(_, context),
416
- 'target': _ => (0, smithy_client_1._json)(_),
417
- 'welcomeMessages': _ => (0, smithy_client_1._json)(_),
418
- }));
419
- b.m("PUT")
420
- .h(headers)
421
- .q(query)
422
- .b(body);
423
- return b.build();
424
- };
425
- exports.se_UpdateWidgetCommand = se_UpdateWidgetCommand;
426
- const de_CancelCalendarEventCommand = async (output, context) => {
427
- if (output.statusCode !== 200 && output.statusCode >= 300) {
428
- return de_CommandError(output, context);
429
- }
430
- const contents = (0, smithy_client_1.map)({
431
- $metadata: deserializeMetadata(output),
432
- });
433
- const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
434
- const doc = (0, smithy_client_1.take)(data, {
435
- 'channel': smithy_client_1._json,
436
- 'event': smithy_client_1._json,
437
- });
438
- Object.assign(contents, doc);
439
- return contents;
440
- };
441
- exports.de_CancelCalendarEventCommand = de_CancelCalendarEventCommand;
442
- const de_CreateOrUpdateWidgetPreviewCommand = async (output, context) => {
443
- if (output.statusCode !== 200 && output.statusCode >= 300) {
444
- return de_CommandError(output, context);
445
- }
446
- const contents = (0, smithy_client_1.map)({
447
- $metadata: deserializeMetadata(output),
448
- });
449
- const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
450
- const doc = (0, smithy_client_1.take)(data, {
451
- 'widget': _ => de_Widget(_, context),
452
- });
453
- Object.assign(contents, doc);
454
- return contents;
455
- };
456
- exports.de_CreateOrUpdateWidgetPreviewCommand = de_CreateOrUpdateWidgetPreviewCommand;
457
- const de_CreateWidgetCommand = async (output, context) => {
458
- if (output.statusCode !== 200 && output.statusCode >= 300) {
459
- return de_CommandError(output, context);
460
- }
461
- const contents = (0, smithy_client_1.map)({
462
- $metadata: deserializeMetadata(output),
463
- });
464
- const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
465
- const doc = (0, smithy_client_1.take)(data, {
466
- 'widget': _ => de_Widget(_, context),
467
- });
468
- Object.assign(contents, doc);
469
- return contents;
470
- };
471
- exports.de_CreateWidgetCommand = de_CreateWidgetCommand;
472
- const de_DeleteWidgetCommand = async (output, context) => {
473
- if (output.statusCode !== 200 && output.statusCode >= 300) {
474
- return de_CommandError(output, context);
475
- }
476
- const contents = (0, smithy_client_1.map)({
477
- $metadata: deserializeMetadata(output),
478
- });
479
- await (0, smithy_client_1.collectBody)(output.body, context);
480
- return contents;
481
- };
482
- exports.de_DeleteWidgetCommand = de_DeleteWidgetCommand;
483
- const de_GetCalendarSlotsCommand = async (output, context) => {
484
- if (output.statusCode !== 200 && output.statusCode >= 300) {
485
- return de_CommandError(output, context);
486
- }
487
- const contents = (0, smithy_client_1.map)({
488
- $metadata: deserializeMetadata(output),
489
- });
490
- const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
491
- const doc = (0, smithy_client_1.take)(data, {
492
- 'calendar': smithy_client_1._json,
493
- });
494
- Object.assign(contents, doc);
495
- return contents;
496
- };
497
- exports.de_GetCalendarSlotsCommand = de_GetCalendarSlotsCommand;
498
- const de_GetConfigCommand = async (output, context) => {
499
- if (output.statusCode !== 200 && output.statusCode >= 300) {
500
- return de_CommandError(output, context);
501
- }
502
- const contents = (0, smithy_client_1.map)({
503
- $metadata: deserializeMetadata(output),
504
- });
505
- const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
506
- const doc = (0, smithy_client_1.take)(data, {
507
- 'config': smithy_client_1._json,
508
- });
509
- Object.assign(contents, doc);
510
- return contents;
511
- };
512
- exports.de_GetConfigCommand = de_GetConfigCommand;
513
- const de_GetSmsNumberConfigurationCommand = async (output, context) => {
514
- if (output.statusCode !== 200 && output.statusCode >= 300) {
515
- return de_CommandError(output, context);
516
- }
517
- const contents = (0, smithy_client_1.map)({
518
- $metadata: deserializeMetadata(output),
519
- });
520
- const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
521
- const doc = (0, smithy_client_1.take)(data, {
522
- 'configuration': smithy_client_1._json,
523
- });
524
- Object.assign(contents, doc);
525
- return contents;
526
- };
527
- exports.de_GetSmsNumberConfigurationCommand = de_GetSmsNumberConfigurationCommand;
528
- const de_GetWhatsAppNumberConfigurationCommand = 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
- 'configuration': smithy_client_1._json,
538
- });
539
- Object.assign(contents, doc);
540
- return contents;
541
- };
542
- exports.de_GetWhatsAppNumberConfigurationCommand = de_GetWhatsAppNumberConfigurationCommand;
543
- const de_GetWidgetCommand = async (output, context) => {
544
- if (output.statusCode !== 200 && output.statusCode >= 300) {
545
- return de_CommandError(output, context);
546
- }
547
- const contents = (0, smithy_client_1.map)({
548
- $metadata: deserializeMetadata(output),
549
- });
550
- const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
551
- const doc = (0, smithy_client_1.take)(data, {
552
- 'widget': _ => de_Widget(_, context),
553
- });
554
- Object.assign(contents, doc);
555
- return contents;
556
- };
557
- exports.de_GetWidgetCommand = de_GetWidgetCommand;
558
- const de_ListAgentsCommand = async (output, context) => {
559
- if (output.statusCode !== 200 && output.statusCode >= 300) {
560
- return de_CommandError(output, context);
561
- }
562
- const contents = (0, smithy_client_1.map)({
563
- $metadata: deserializeMetadata(output),
564
- });
565
- const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
566
- const doc = (0, smithy_client_1.take)(data, {
567
- 'users': smithy_client_1._json,
568
- });
569
- Object.assign(contents, doc);
570
- return contents;
571
- };
572
- exports.de_ListAgentsCommand = de_ListAgentsCommand;
573
- const de_ListServicesCommand = async (output, context) => {
574
- if (output.statusCode !== 200 && output.statusCode >= 300) {
575
- return de_CommandError(output, context);
576
- }
577
- const contents = (0, smithy_client_1.map)({
578
- $metadata: deserializeMetadata(output),
579
- });
580
- const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
581
- const doc = (0, smithy_client_1.take)(data, {
582
- 'services': smithy_client_1._json,
583
- });
584
- Object.assign(contents, doc);
585
- return contents;
586
- };
587
- exports.de_ListServicesCommand = de_ListServicesCommand;
588
- const de_ListSmsConfigurationsCommand = async (output, context) => {
589
- if (output.statusCode !== 200 && output.statusCode >= 300) {
590
- return de_CommandError(output, context);
591
- }
592
- const contents = (0, smithy_client_1.map)({
593
- $metadata: deserializeMetadata(output),
594
- });
595
- const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
596
- const doc = (0, smithy_client_1.take)(data, {
597
- 'configurations': smithy_client_1._json,
598
- });
599
- Object.assign(contents, doc);
600
- return contents;
601
- };
602
- exports.de_ListSmsConfigurationsCommand = de_ListSmsConfigurationsCommand;
603
- const de_ListSmsNumbersCommand = async (output, context) => {
604
- if (output.statusCode !== 200 && output.statusCode >= 300) {
605
- return de_CommandError(output, context);
606
- }
607
- const contents = (0, smithy_client_1.map)({
608
- $metadata: deserializeMetadata(output),
609
- });
610
- const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
611
- const doc = (0, smithy_client_1.take)(data, {
612
- 'numbers': smithy_client_1._json,
613
- });
614
- Object.assign(contents, doc);
615
- return contents;
616
- };
617
- exports.de_ListSmsNumbersCommand = de_ListSmsNumbersCommand;
618
- const de_ListWhatsAppConfigurationsCommand = async (output, context) => {
619
- if (output.statusCode !== 200 && output.statusCode >= 300) {
620
- return de_CommandError(output, context);
621
- }
622
- const contents = (0, smithy_client_1.map)({
623
- $metadata: deserializeMetadata(output),
624
- });
625
- const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
626
- const doc = (0, smithy_client_1.take)(data, {
627
- 'configurations': smithy_client_1._json,
628
- });
629
- Object.assign(contents, doc);
630
- return contents;
631
- };
632
- exports.de_ListWhatsAppConfigurationsCommand = de_ListWhatsAppConfigurationsCommand;
633
- const de_ListWhatsAppNumbersCommand = async (output, context) => {
634
- if (output.statusCode !== 200 && output.statusCode >= 300) {
635
- return de_CommandError(output, context);
636
- }
637
- const contents = (0, smithy_client_1.map)({
638
- $metadata: deserializeMetadata(output),
639
- });
640
- const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
641
- const doc = (0, smithy_client_1.take)(data, {
642
- 'numbers': smithy_client_1._json,
643
- });
644
- Object.assign(contents, doc);
645
- return contents;
646
- };
647
- exports.de_ListWhatsAppNumbersCommand = de_ListWhatsAppNumbersCommand;
648
- const de_ListWhatsAppTemplatesCommand = async (output, context) => {
649
- if (output.statusCode !== 200 && output.statusCode >= 300) {
650
- return de_CommandError(output, context);
651
- }
652
- const contents = (0, smithy_client_1.map)({
653
- $metadata: deserializeMetadata(output),
654
- });
655
- const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
656
- const doc = (0, smithy_client_1.take)(data, {
657
- 'templates': smithy_client_1._json,
658
- });
659
- Object.assign(contents, doc);
660
- return contents;
661
- };
662
- exports.de_ListWhatsAppTemplatesCommand = de_ListWhatsAppTemplatesCommand;
663
- const de_ListWidgetsCommand = async (output, context) => {
664
- if (output.statusCode !== 200 && output.statusCode >= 300) {
665
- return de_CommandError(output, context);
666
- }
667
- const contents = (0, smithy_client_1.map)({
668
- $metadata: deserializeMetadata(output),
669
- });
670
- const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
671
- const doc = (0, smithy_client_1.take)(data, {
672
- 'widgets': _ => de_WidgetsList(_, context),
673
- });
674
- Object.assign(contents, doc);
675
- return contents;
676
- };
677
- exports.de_ListWidgetsCommand = de_ListWidgetsCommand;
678
- const de_PutSmsNumberConfigurationCommand = async (output, context) => {
679
- if (output.statusCode !== 200 && output.statusCode >= 300) {
680
- return de_CommandError(output, context);
681
- }
682
- const contents = (0, smithy_client_1.map)({
683
- $metadata: deserializeMetadata(output),
684
- });
685
- const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
686
- const doc = (0, smithy_client_1.take)(data, {
687
- 'configuration': smithy_client_1._json,
688
- });
689
- Object.assign(contents, doc);
690
- return contents;
691
- };
692
- exports.de_PutSmsNumberConfigurationCommand = de_PutSmsNumberConfigurationCommand;
693
- const de_PutWhatsAppNumberConfigurationCommand = async (output, context) => {
694
- if (output.statusCode !== 200 && output.statusCode >= 300) {
695
- return de_CommandError(output, context);
696
- }
697
- const contents = (0, smithy_client_1.map)({
698
- $metadata: deserializeMetadata(output),
699
- });
700
- const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
701
- const doc = (0, smithy_client_1.take)(data, {
702
- 'configuration': smithy_client_1._json,
703
- });
704
- Object.assign(contents, doc);
705
- return contents;
706
- };
707
- exports.de_PutWhatsAppNumberConfigurationCommand = de_PutWhatsAppNumberConfigurationCommand;
708
- const de_RescheduleCalendarEventCommand = async (output, context) => {
709
- if (output.statusCode !== 200 && output.statusCode >= 300) {
710
- return de_CommandError(output, context);
711
- }
712
- const contents = (0, smithy_client_1.map)({
713
- $metadata: deserializeMetadata(output),
714
- });
715
- const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
716
- const doc = (0, smithy_client_1.take)(data, {
717
- 'channel': smithy_client_1._json,
718
- 'event': smithy_client_1._json,
719
- });
720
- Object.assign(contents, doc);
721
- return contents;
722
- };
723
- exports.de_RescheduleCalendarEventCommand = de_RescheduleCalendarEventCommand;
724
- const de_ScheduleCalendarEventCommand = async (output, context) => {
725
- if (output.statusCode !== 200 && output.statusCode >= 300) {
726
- return de_CommandError(output, context);
727
- }
728
- const contents = (0, smithy_client_1.map)({
729
- $metadata: deserializeMetadata(output),
730
- });
731
- const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
732
- const doc = (0, smithy_client_1.take)(data, {
733
- 'channel': smithy_client_1._json,
734
- 'event': smithy_client_1._json,
735
- });
736
- Object.assign(contents, doc);
737
- return contents;
738
- };
739
- exports.de_ScheduleCalendarEventCommand = de_ScheduleCalendarEventCommand;
740
- const de_UpdateWidgetCommand = async (output, context) => {
741
- if (output.statusCode !== 200 && output.statusCode >= 300) {
742
- return de_CommandError(output, context);
743
- }
744
- const contents = (0, smithy_client_1.map)({
745
- $metadata: deserializeMetadata(output),
746
- });
747
- const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
748
- const doc = (0, smithy_client_1.take)(data, {
749
- 'widget': _ => de_Widget(_, context),
750
- });
751
- Object.assign(contents, doc);
752
- return contents;
753
- };
754
- exports.de_UpdateWidgetCommand = de_UpdateWidgetCommand;
755
- const de_CommandError = async (output, context) => {
756
- const parsedOutput = {
757
- ...output,
758
- body: await (0, core_1.parseJsonErrorBody)(output.body, context)
759
- };
760
- const errorCode = (0, core_1.loadRestJsonErrorCode)(output, parsedOutput.body);
761
- switch (errorCode) {
762
- case "ChannelNotFoundException":
763
- case "wildix.xbees.conversations#ChannelNotFoundException":
764
- throw await de_ChannelNotFoundExceptionRes(parsedOutput, context);
765
- case "ForbiddenException":
766
- case "smithy.framework#ForbiddenException":
767
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
768
- case "NotFoundException":
769
- case "smithy.framework#NotFoundException":
770
- throw await de_NotFoundExceptionRes(parsedOutput, context);
771
- case "RateLimitExceededException":
772
- case "smithy.framework#RateLimitExceededException":
773
- throw await de_RateLimitExceededExceptionRes(parsedOutput, context);
774
- case "ValidationException":
775
- case "smithy.framework#ValidationException":
776
- throw await de_ValidationExceptionRes(parsedOutput, context);
777
- case "TargetNotFoundException":
778
- case "wildix.xbees.kite#TargetNotFoundException":
779
- throw await de_TargetNotFoundExceptionRes(parsedOutput, context);
780
- case "WidgetNotFoundException":
781
- case "wildix.xbees.kite#WidgetNotFoundException":
782
- throw await de_WidgetNotFoundExceptionRes(parsedOutput, context);
783
- case "EventNotFoundException":
784
- case "wildix.xbees.kite#EventNotFoundException":
785
- throw await de_EventNotFoundExceptionRes(parsedOutput, context);
786
- default:
787
- const parsedBody = parsedOutput.body;
788
- return throwDefaultError({
789
- output,
790
- parsedBody,
791
- errorCode
792
- });
793
- }
794
- };
795
- const throwDefaultError = (0, smithy_client_1.withBaseException)(KiteServiceException_1.KiteServiceException);
796
- const de_ForbiddenExceptionRes = async (parsedOutput, context) => {
797
- const contents = (0, smithy_client_1.map)({});
798
- const data = parsedOutput.body;
799
- const doc = (0, smithy_client_1.take)(data, {
800
- 'message': smithy_client_1.expectString,
801
- });
802
- Object.assign(contents, doc);
803
- const exception = new models_0_1.ForbiddenException({
804
- $metadata: deserializeMetadata(parsedOutput),
805
- ...contents
806
- });
807
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
808
- };
809
- const de_NotFoundExceptionRes = async (parsedOutput, context) => {
810
- const contents = (0, smithy_client_1.map)({});
811
- const data = parsedOutput.body;
812
- const doc = (0, smithy_client_1.take)(data, {
813
- 'message': smithy_client_1.expectString,
814
- });
815
- Object.assign(contents, doc);
816
- const exception = new models_0_1.NotFoundException({
817
- $metadata: deserializeMetadata(parsedOutput),
818
- ...contents
819
- });
820
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
821
- };
822
- const de_RateLimitExceededExceptionRes = async (parsedOutput, context) => {
823
- const contents = (0, smithy_client_1.map)({
824
- [_rL]: [, parsedOutput.headers[_xrl]],
825
- [_rLR]: [() => void 0 !== parsedOutput.headers[_xrr], () => (0, smithy_client_1.strictParseInt32)(parsedOutput.headers[_xrr])],
826
- [_rLRa]: [() => void 0 !== parsedOutput.headers[_xrr_], () => (0, smithy_client_1.strictParseInt32)(parsedOutput.headers[_xrr_])],
827
- [_rA]: [() => void 0 !== parsedOutput.headers[_ra], () => (0, smithy_client_1.strictParseInt32)(parsedOutput.headers[_ra])],
828
- });
829
- const data = parsedOutput.body;
830
- const doc = (0, smithy_client_1.take)(data, {
831
- 'message': smithy_client_1.expectString,
832
- });
833
- Object.assign(contents, doc);
834
- const exception = new models_0_1.RateLimitExceededException({
835
- $metadata: deserializeMetadata(parsedOutput),
836
- ...contents
837
- });
838
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
839
- };
840
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
841
- const contents = (0, smithy_client_1.map)({});
842
- const data = parsedOutput.body;
843
- const doc = (0, smithy_client_1.take)(data, {
844
- 'message': smithy_client_1.expectString,
845
- });
846
- Object.assign(contents, doc);
847
- const exception = new models_0_1.ValidationException({
848
- $metadata: deserializeMetadata(parsedOutput),
849
- ...contents
850
- });
851
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
852
- };
853
- const de_ChannelNotFoundExceptionRes = async (parsedOutput, context) => {
854
- const contents = (0, smithy_client_1.map)({});
855
- const data = parsedOutput.body;
856
- const doc = (0, smithy_client_1.take)(data, {
857
- 'message': smithy_client_1.expectString,
858
- });
859
- Object.assign(contents, doc);
860
- const exception = new models_0_1.ChannelNotFoundException({
861
- $metadata: deserializeMetadata(parsedOutput),
862
- ...contents
863
- });
864
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
865
- };
866
- const de_EventNotFoundExceptionRes = async (parsedOutput, context) => {
867
- const contents = (0, smithy_client_1.map)({});
868
- const data = parsedOutput.body;
869
- const doc = (0, smithy_client_1.take)(data, {
870
- 'message': smithy_client_1.expectString,
871
- });
872
- Object.assign(contents, doc);
873
- const exception = new models_0_1.EventNotFoundException({
874
- $metadata: deserializeMetadata(parsedOutput),
875
- ...contents
876
- });
877
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
878
- };
879
- const de_TargetNotFoundExceptionRes = async (parsedOutput, context) => {
880
- const contents = (0, smithy_client_1.map)({});
881
- const data = parsedOutput.body;
882
- const doc = (0, smithy_client_1.take)(data, {
883
- 'message': smithy_client_1.expectString,
884
- });
885
- Object.assign(contents, doc);
886
- const exception = new models_0_1.TargetNotFoundException({
887
- $metadata: deserializeMetadata(parsedOutput),
888
- ...contents
889
- });
890
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
891
- };
892
- const de_WidgetNotFoundExceptionRes = async (parsedOutput, context) => {
893
- const contents = (0, smithy_client_1.map)({});
894
- const data = parsedOutput.body;
895
- const doc = (0, smithy_client_1.take)(data, {
896
- 'message': smithy_client_1.expectString,
897
- });
898
- Object.assign(contents, doc);
899
- const exception = new models_0_1.WidgetNotFoundException({
900
- $metadata: deserializeMetadata(parsedOutput),
901
- ...contents
902
- });
903
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
904
- };
905
- const se_WidgetRoutesList = (input, context) => {
906
- return input.filter((e) => e != null).map(entry => {
907
- return (0, smithy_client_1._json)(entry);
908
- });
909
- };
910
- const de_Widget = (output, context) => {
911
- return (0, smithy_client_1.take)(output, {
912
- 'actions': smithy_client_1._json,
913
- 'anonymousSessionsEnabled': smithy_client_1.expectBoolean,
914
- 'anonymousSessionsOnly': smithy_client_1.expectBoolean,
915
- 'anonymousSessionsRandomNameEnabled': smithy_client_1.expectBoolean,
916
- 'appearance': smithy_client_1._json,
917
- 'company': smithy_client_1.expectString,
918
- 'createdAt': smithy_client_1.expectString,
919
- 'id': smithy_client_1.expectString,
920
- 'name': smithy_client_1.expectString,
921
- 'routes': (_) => de_WidgetRoutesList(_, context),
922
- 'target': (_) => (0, smithy_client_1._json)((0, core_1.awsExpectUnion)(_)),
923
- 'updatedAt': smithy_client_1.expectString,
924
- 'welcomeMessages': smithy_client_1._json,
925
- });
926
- };
927
- const de_WidgetRoutesList = (output, context) => {
928
- const retVal = (output || []).filter((e) => e != null).map((entry) => {
929
- return (0, smithy_client_1._json)(entry);
930
- });
931
- return retVal;
932
- };
933
- const de_WidgetsList = (output, context) => {
934
- const retVal = (output || []).filter((e) => e != null).map((entry) => {
935
- return de_Widget(entry, context);
936
- });
937
- return retVal;
938
- };
939
- const deserializeMetadata = (output) => ({
940
- httpStatusCode: output.statusCode,
941
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
942
- extendedRequestId: output.headers["x-amz-id-2"],
943
- cfId: output.headers["x-amz-cf-id"],
944
- });
945
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then(body => context.utf8Encoder(body));
946
- const _c = "company";
947
- const _cI = "companyId";
948
- const _d = "duration";
949
- const _e = "excluded";
950
- const _f = "from";
951
- const _r = "reason";
952
- const _rA = "retryAfter";
953
- const _rL = "rateLimit";
954
- const _rLR = "rateLimitRemaining";
955
- const _rLRa = "rateLimitReset";
956
- const _ra = "retry-after";
957
- const _ro = "route";
958
- const _t = "till";
959
- const _tRI = "targetRouteId";
960
- const _tZ = "timeZone";
961
- const _xrl = "x-ratelimit-limit";
962
- const _xrr = "x-ratelimit-remaining";
963
- const _xrr_ = "x-ratelimit-reset";