@wildix/xbees-users-client 1.0.1 → 1.0.2

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 (44) hide show
  1. package/dist-cjs/Users.js +16 -0
  2. package/dist-cjs/commands/CreateBotApiKeyCommand.js +41 -0
  3. package/dist-cjs/commands/CreateBotCommand.js +41 -0
  4. package/dist-cjs/commands/DeleteBotApiKeyCommand.js +41 -0
  5. package/dist-cjs/commands/DeleteBotCommand.js +41 -0
  6. package/dist-cjs/commands/ListBotApiKeysCommand.js +41 -0
  7. package/dist-cjs/commands/ListBotsCommand.js +41 -0
  8. package/dist-cjs/commands/UpdateBotCommand.js +41 -0
  9. package/dist-cjs/commands/VerifyBotSecretKeyCommand.js +41 -0
  10. package/dist-cjs/commands/index.js +8 -0
  11. package/dist-cjs/models/models_0.js +63 -1
  12. package/dist-cjs/protocols/Aws_restJson1.js +523 -1
  13. package/dist-es/Users.js +16 -0
  14. package/dist-es/commands/CreateBotApiKeyCommand.js +37 -0
  15. package/dist-es/commands/CreateBotCommand.js +37 -0
  16. package/dist-es/commands/DeleteBotApiKeyCommand.js +37 -0
  17. package/dist-es/commands/DeleteBotCommand.js +37 -0
  18. package/dist-es/commands/ListBotApiKeysCommand.js +37 -0
  19. package/dist-es/commands/ListBotsCommand.js +37 -0
  20. package/dist-es/commands/UpdateBotCommand.js +37 -0
  21. package/dist-es/commands/VerifyBotSecretKeyCommand.js +37 -0
  22. package/dist-es/commands/index.js +8 -0
  23. package/dist-es/models/models_0.js +58 -0
  24. package/dist-es/protocols/Aws_restJson1.js +508 -2
  25. package/dist-types/Users.d.ts +56 -0
  26. package/dist-types/UsersClient.d.ts +10 -2
  27. package/dist-types/commands/BatchGetUsersPbxLinkDataCommand.d.ts +2 -0
  28. package/dist-types/commands/BatchGetUsersStreamLinkDataCommand.d.ts +2 -0
  29. package/dist-types/commands/CreateBotApiKeyCommand.d.ts +111 -0
  30. package/dist-types/commands/CreateBotCommand.d.ts +130 -0
  31. package/dist-types/commands/DeleteBotApiKeyCommand.d.ts +78 -0
  32. package/dist-types/commands/DeleteBotCommand.d.ts +75 -0
  33. package/dist-types/commands/ListBotApiKeysCommand.d.ts +81 -0
  34. package/dist-types/commands/ListBotsCommand.d.ts +105 -0
  35. package/dist-types/commands/UpdateBotCommand.d.ts +131 -0
  36. package/dist-types/commands/VerifyBotSecretKeyCommand.d.ts +79 -0
  37. package/dist-types/commands/index.d.ts +8 -0
  38. package/dist-types/models/models_0.d.ts +239 -0
  39. package/dist-types/protocols/Aws_restJson1.d.ts +72 -0
  40. package/dist-types/runtimeConfig.browser.d.ts +3 -3
  41. package/dist-types/runtimeConfig.d.ts +3 -3
  42. package/dist-types/runtimeConfig.native.d.ts +3 -3
  43. package/dist-types/runtimeConfig.shared.d.ts +2 -2
  44. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_BatchGetUsersStreamLinkDataCommand = exports.de_BatchGetUsersPbxLinkDataCommand = exports.se_BatchGetUsersStreamLinkDataCommand = exports.se_BatchGetUsersPbxLinkDataCommand = void 0;
3
+ exports.de_VerifyBotSecretKeyCommand = exports.de_UpdateBotCommand = exports.de_ListBotsCommand = exports.de_ListBotApiKeysCommand = exports.de_DeleteBotApiKeyCommand = exports.de_DeleteBotCommand = exports.de_CreateBotApiKeyCommand = exports.de_CreateBotCommand = exports.de_BatchGetUsersStreamLinkDataCommand = exports.de_BatchGetUsersPbxLinkDataCommand = exports.se_VerifyBotSecretKeyCommand = exports.se_UpdateBotCommand = exports.se_ListBotsCommand = exports.se_ListBotApiKeysCommand = exports.se_DeleteBotApiKeyCommand = exports.se_DeleteBotCommand = exports.se_CreateBotApiKeyCommand = exports.se_CreateBotCommand = exports.se_BatchGetUsersStreamLinkDataCommand = exports.se_BatchGetUsersPbxLinkDataCommand = void 0;
4
4
  const UsersServiceException_1 = require("../models/UsersServiceException");
5
5
  const models_0_1 = require("../models/models_0");
6
6
  const protocol_http_1 = require("@smithy/protocol-http");
@@ -47,6 +47,167 @@ const se_BatchGetUsersStreamLinkDataCommand = async (input, context) => {
47
47
  });
48
48
  };
49
49
  exports.se_BatchGetUsersStreamLinkDataCommand = se_BatchGetUsersStreamLinkDataCommand;
50
+ const se_CreateBotCommand = async (input, context) => {
51
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
52
+ const headers = {
53
+ 'content-type': 'application/json',
54
+ };
55
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots";
56
+ let body;
57
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
58
+ 'callback': _ => (0, smithy_client_1._json)(_),
59
+ 'name': [],
60
+ 'visibility': _ => (0, smithy_client_1._json)(_),
61
+ }));
62
+ return new protocol_http_1.HttpRequest({
63
+ protocol,
64
+ hostname,
65
+ port,
66
+ method: "POST",
67
+ headers,
68
+ path: resolvedPath,
69
+ body,
70
+ });
71
+ };
72
+ exports.se_CreateBotCommand = se_CreateBotCommand;
73
+ const se_CreateBotApiKeyCommand = async (input, context) => {
74
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
75
+ const headers = {
76
+ 'content-type': 'application/json',
77
+ };
78
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots/{botId}/keys";
79
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'botId', () => input.botId, '{botId}', false);
80
+ let body;
81
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
82
+ 'name': [],
83
+ }));
84
+ return new protocol_http_1.HttpRequest({
85
+ protocol,
86
+ hostname,
87
+ port,
88
+ method: "POST",
89
+ headers,
90
+ path: resolvedPath,
91
+ body,
92
+ });
93
+ };
94
+ exports.se_CreateBotApiKeyCommand = se_CreateBotApiKeyCommand;
95
+ const se_DeleteBotCommand = async (input, context) => {
96
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
97
+ const headers = {};
98
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots/{botId}";
99
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'botId', () => input.botId, '{botId}', false);
100
+ let body;
101
+ return new protocol_http_1.HttpRequest({
102
+ protocol,
103
+ hostname,
104
+ port,
105
+ method: "DELETE",
106
+ headers,
107
+ path: resolvedPath,
108
+ body,
109
+ });
110
+ };
111
+ exports.se_DeleteBotCommand = se_DeleteBotCommand;
112
+ const se_DeleteBotApiKeyCommand = async (input, context) => {
113
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
114
+ const headers = {};
115
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots/{botId}/keys/{apiKeySecret}";
116
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'botId', () => input.botId, '{botId}', false);
117
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'apiKeySecret', () => input.apiKeySecret, '{apiKeySecret}', false);
118
+ let body;
119
+ return new protocol_http_1.HttpRequest({
120
+ protocol,
121
+ hostname,
122
+ port,
123
+ method: "DELETE",
124
+ headers,
125
+ path: resolvedPath,
126
+ body,
127
+ });
128
+ };
129
+ exports.se_DeleteBotApiKeyCommand = se_DeleteBotApiKeyCommand;
130
+ const se_ListBotApiKeysCommand = async (input, context) => {
131
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
132
+ const headers = {};
133
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots/{botId}";
134
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'botId', () => input.botId, '{botId}', false);
135
+ let body;
136
+ return new protocol_http_1.HttpRequest({
137
+ protocol,
138
+ hostname,
139
+ port,
140
+ method: "GET",
141
+ headers,
142
+ path: resolvedPath,
143
+ body,
144
+ });
145
+ };
146
+ exports.se_ListBotApiKeysCommand = se_ListBotApiKeysCommand;
147
+ const se_ListBotsCommand = async (input, context) => {
148
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
149
+ const headers = {
150
+ 'content-type': 'application/json',
151
+ };
152
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots";
153
+ let body;
154
+ body = "";
155
+ return new protocol_http_1.HttpRequest({
156
+ protocol,
157
+ hostname,
158
+ port,
159
+ method: "GET",
160
+ headers,
161
+ path: resolvedPath,
162
+ body,
163
+ });
164
+ };
165
+ exports.se_ListBotsCommand = se_ListBotsCommand;
166
+ const se_UpdateBotCommand = async (input, context) => {
167
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
168
+ const headers = {
169
+ 'content-type': 'application/json',
170
+ };
171
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots/{botId}";
172
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'botId', () => input.botId, '{botId}', false);
173
+ let body;
174
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
175
+ 'callback': _ => (0, smithy_client_1._json)(_),
176
+ 'name': [],
177
+ 'visibility': _ => (0, smithy_client_1._json)(_),
178
+ }));
179
+ return new protocol_http_1.HttpRequest({
180
+ protocol,
181
+ hostname,
182
+ port,
183
+ method: "POST",
184
+ headers,
185
+ path: resolvedPath,
186
+ body,
187
+ });
188
+ };
189
+ exports.se_UpdateBotCommand = se_UpdateBotCommand;
190
+ const se_VerifyBotSecretKeyCommand = async (input, context) => {
191
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
192
+ const headers = {
193
+ 'content-type': 'application/json',
194
+ };
195
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/auth/VerifyBotSecretKey";
196
+ let body;
197
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
198
+ 'secret': [],
199
+ }));
200
+ return new protocol_http_1.HttpRequest({
201
+ protocol,
202
+ hostname,
203
+ port,
204
+ method: "POST",
205
+ headers,
206
+ path: resolvedPath,
207
+ body,
208
+ });
209
+ };
210
+ exports.se_VerifyBotSecretKeyCommand = se_VerifyBotSecretKeyCommand;
50
211
  const de_BatchGetUsersPbxLinkDataCommand = async (output, context) => {
51
212
  if (output.statusCode !== 200 && output.statusCode >= 300) {
52
213
  return de_BatchGetUsersPbxLinkDataCommandError(output, context);
@@ -69,6 +230,9 @@ const de_BatchGetUsersPbxLinkDataCommandError = async (output, context) => {
69
230
  };
70
231
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
71
232
  switch (errorCode) {
233
+ case "ForbiddenException":
234
+ case "smithy.framework#ForbiddenException":
235
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
72
236
  case "ValidationException":
73
237
  case "smithy.framework#ValidationException":
74
238
  throw await de_ValidationExceptionRes(parsedOutput, context);
@@ -103,6 +267,312 @@ const de_BatchGetUsersStreamLinkDataCommandError = async (output, context) => {
103
267
  };
104
268
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
105
269
  switch (errorCode) {
270
+ case "ForbiddenException":
271
+ case "smithy.framework#ForbiddenException":
272
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
273
+ case "ValidationException":
274
+ case "smithy.framework#ValidationException":
275
+ throw await de_ValidationExceptionRes(parsedOutput, context);
276
+ default:
277
+ const parsedBody = parsedOutput.body;
278
+ return throwDefaultError({
279
+ output,
280
+ parsedBody,
281
+ errorCode
282
+ });
283
+ }
284
+ };
285
+ const de_CreateBotCommand = async (output, context) => {
286
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
287
+ return de_CreateBotCommandError(output, context);
288
+ }
289
+ const contents = (0, smithy_client_1.map)({
290
+ $metadata: deserializeMetadata(output),
291
+ });
292
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
293
+ const doc = (0, smithy_client_1.take)(data, {
294
+ 'bot': smithy_client_1._json,
295
+ });
296
+ Object.assign(contents, doc);
297
+ return contents;
298
+ };
299
+ exports.de_CreateBotCommand = de_CreateBotCommand;
300
+ const de_CreateBotCommandError = async (output, context) => {
301
+ const parsedOutput = {
302
+ ...output,
303
+ body: await parseErrorBody(output.body, context)
304
+ };
305
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
306
+ switch (errorCode) {
307
+ case "ForbiddenException":
308
+ case "smithy.framework#ForbiddenException":
309
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
310
+ case "ValidationException":
311
+ case "smithy.framework#ValidationException":
312
+ throw await de_ValidationExceptionRes(parsedOutput, context);
313
+ default:
314
+ const parsedBody = parsedOutput.body;
315
+ return throwDefaultError({
316
+ output,
317
+ parsedBody,
318
+ errorCode
319
+ });
320
+ }
321
+ };
322
+ const de_CreateBotApiKeyCommand = async (output, context) => {
323
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
324
+ return de_CreateBotApiKeyCommandError(output, context);
325
+ }
326
+ const contents = (0, smithy_client_1.map)({
327
+ $metadata: deserializeMetadata(output),
328
+ });
329
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
330
+ const doc = (0, smithy_client_1.take)(data, {
331
+ 'bot': smithy_client_1._json,
332
+ 'key': smithy_client_1._json,
333
+ });
334
+ Object.assign(contents, doc);
335
+ return contents;
336
+ };
337
+ exports.de_CreateBotApiKeyCommand = de_CreateBotApiKeyCommand;
338
+ const de_CreateBotApiKeyCommandError = async (output, context) => {
339
+ const parsedOutput = {
340
+ ...output,
341
+ body: await parseErrorBody(output.body, context)
342
+ };
343
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
344
+ switch (errorCode) {
345
+ case "ForbiddenException":
346
+ case "smithy.framework#ForbiddenException":
347
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
348
+ case "ValidationException":
349
+ case "smithy.framework#ValidationException":
350
+ throw await de_ValidationExceptionRes(parsedOutput, context);
351
+ default:
352
+ const parsedBody = parsedOutput.body;
353
+ return throwDefaultError({
354
+ output,
355
+ parsedBody,
356
+ errorCode
357
+ });
358
+ }
359
+ };
360
+ const de_DeleteBotCommand = async (output, context) => {
361
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
362
+ return de_DeleteBotCommandError(output, context);
363
+ }
364
+ const contents = (0, smithy_client_1.map)({
365
+ $metadata: deserializeMetadata(output),
366
+ });
367
+ await (0, smithy_client_1.collectBody)(output.body, context);
368
+ return contents;
369
+ };
370
+ exports.de_DeleteBotCommand = de_DeleteBotCommand;
371
+ const de_DeleteBotCommandError = async (output, context) => {
372
+ const parsedOutput = {
373
+ ...output,
374
+ body: await parseErrorBody(output.body, context)
375
+ };
376
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
377
+ switch (errorCode) {
378
+ case "BotNotFoundException":
379
+ case "wildix.xbees.users#BotNotFoundException":
380
+ throw await de_BotNotFoundExceptionRes(parsedOutput, context);
381
+ case "ForbiddenException":
382
+ case "smithy.framework#ForbiddenException":
383
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
384
+ case "ValidationException":
385
+ case "smithy.framework#ValidationException":
386
+ throw await de_ValidationExceptionRes(parsedOutput, context);
387
+ default:
388
+ const parsedBody = parsedOutput.body;
389
+ return throwDefaultError({
390
+ output,
391
+ parsedBody,
392
+ errorCode
393
+ });
394
+ }
395
+ };
396
+ const de_DeleteBotApiKeyCommand = async (output, context) => {
397
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
398
+ return de_DeleteBotApiKeyCommandError(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_DeleteBotApiKeyCommand = de_DeleteBotApiKeyCommand;
407
+ const de_DeleteBotApiKeyCommandError = async (output, context) => {
408
+ const parsedOutput = {
409
+ ...output,
410
+ body: await parseErrorBody(output.body, context)
411
+ };
412
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
413
+ switch (errorCode) {
414
+ case "BotApiKeyNotFoundException":
415
+ case "wildix.xbees.users#BotApiKeyNotFoundException":
416
+ throw await de_BotApiKeyNotFoundExceptionRes(parsedOutput, context);
417
+ case "BotNotFoundException":
418
+ case "wildix.xbees.users#BotNotFoundException":
419
+ throw await de_BotNotFoundExceptionRes(parsedOutput, context);
420
+ case "ForbiddenException":
421
+ case "smithy.framework#ForbiddenException":
422
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
423
+ case "ValidationException":
424
+ case "smithy.framework#ValidationException":
425
+ throw await de_ValidationExceptionRes(parsedOutput, context);
426
+ default:
427
+ const parsedBody = parsedOutput.body;
428
+ return throwDefaultError({
429
+ output,
430
+ parsedBody,
431
+ errorCode
432
+ });
433
+ }
434
+ };
435
+ const de_ListBotApiKeysCommand = async (output, context) => {
436
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
437
+ return de_ListBotApiKeysCommandError(output, context);
438
+ }
439
+ const contents = (0, smithy_client_1.map)({
440
+ $metadata: deserializeMetadata(output),
441
+ });
442
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
443
+ const doc = (0, smithy_client_1.take)(data, {
444
+ 'keys': smithy_client_1._json,
445
+ });
446
+ Object.assign(contents, doc);
447
+ return contents;
448
+ };
449
+ exports.de_ListBotApiKeysCommand = de_ListBotApiKeysCommand;
450
+ const de_ListBotApiKeysCommandError = async (output, context) => {
451
+ const parsedOutput = {
452
+ ...output,
453
+ body: await parseErrorBody(output.body, context)
454
+ };
455
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
456
+ switch (errorCode) {
457
+ case "ForbiddenException":
458
+ case "smithy.framework#ForbiddenException":
459
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
460
+ case "ValidationException":
461
+ case "smithy.framework#ValidationException":
462
+ throw await de_ValidationExceptionRes(parsedOutput, context);
463
+ default:
464
+ const parsedBody = parsedOutput.body;
465
+ return throwDefaultError({
466
+ output,
467
+ parsedBody,
468
+ errorCode
469
+ });
470
+ }
471
+ };
472
+ const de_ListBotsCommand = async (output, context) => {
473
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
474
+ return de_ListBotsCommandError(output, context);
475
+ }
476
+ const contents = (0, smithy_client_1.map)({
477
+ $metadata: deserializeMetadata(output),
478
+ });
479
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
480
+ const doc = (0, smithy_client_1.take)(data, {
481
+ 'bots': smithy_client_1._json,
482
+ });
483
+ Object.assign(contents, doc);
484
+ return contents;
485
+ };
486
+ exports.de_ListBotsCommand = de_ListBotsCommand;
487
+ const de_ListBotsCommandError = async (output, context) => {
488
+ const parsedOutput = {
489
+ ...output,
490
+ body: await parseErrorBody(output.body, context)
491
+ };
492
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
493
+ switch (errorCode) {
494
+ case "ForbiddenException":
495
+ case "smithy.framework#ForbiddenException":
496
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
497
+ case "ValidationException":
498
+ case "smithy.framework#ValidationException":
499
+ throw await de_ValidationExceptionRes(parsedOutput, context);
500
+ default:
501
+ const parsedBody = parsedOutput.body;
502
+ return throwDefaultError({
503
+ output,
504
+ parsedBody,
505
+ errorCode
506
+ });
507
+ }
508
+ };
509
+ const de_UpdateBotCommand = async (output, context) => {
510
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
511
+ return de_UpdateBotCommandError(output, context);
512
+ }
513
+ const contents = (0, smithy_client_1.map)({
514
+ $metadata: deserializeMetadata(output),
515
+ });
516
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
517
+ const doc = (0, smithy_client_1.take)(data, {
518
+ 'bot': smithy_client_1._json,
519
+ });
520
+ Object.assign(contents, doc);
521
+ return contents;
522
+ };
523
+ exports.de_UpdateBotCommand = de_UpdateBotCommand;
524
+ const de_UpdateBotCommandError = async (output, context) => {
525
+ const parsedOutput = {
526
+ ...output,
527
+ body: await parseErrorBody(output.body, context)
528
+ };
529
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
530
+ switch (errorCode) {
531
+ case "ForbiddenException":
532
+ case "smithy.framework#ForbiddenException":
533
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
534
+ case "ValidationException":
535
+ case "smithy.framework#ValidationException":
536
+ throw await de_ValidationExceptionRes(parsedOutput, context);
537
+ default:
538
+ const parsedBody = parsedOutput.body;
539
+ return throwDefaultError({
540
+ output,
541
+ parsedBody,
542
+ errorCode
543
+ });
544
+ }
545
+ };
546
+ const de_VerifyBotSecretKeyCommand = async (output, context) => {
547
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
548
+ return de_VerifyBotSecretKeyCommandError(output, context);
549
+ }
550
+ const contents = (0, smithy_client_1.map)({
551
+ $metadata: deserializeMetadata(output),
552
+ });
553
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
554
+ const doc = (0, smithy_client_1.take)(data, {
555
+ 'company': smithy_client_1.expectString,
556
+ 'id': smithy_client_1.expectString,
557
+ 'name': smithy_client_1.expectString,
558
+ });
559
+ Object.assign(contents, doc);
560
+ return contents;
561
+ };
562
+ exports.de_VerifyBotSecretKeyCommand = de_VerifyBotSecretKeyCommand;
563
+ const de_VerifyBotSecretKeyCommandError = async (output, context) => {
564
+ const parsedOutput = {
565
+ ...output,
566
+ body: await parseErrorBody(output.body, context)
567
+ };
568
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
569
+ switch (errorCode) {
570
+ case "BotSecretKeyNotValidException":
571
+ case "wildix.xbees.users#BotSecretKeyNotValidException":
572
+ throw await de_BotSecretKeyNotValidExceptionRes(parsedOutput, context);
573
+ case "ForbiddenException":
574
+ case "smithy.framework#ForbiddenException":
575
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
106
576
  case "ValidationException":
107
577
  case "smithy.framework#ValidationException":
108
578
  throw await de_ValidationExceptionRes(parsedOutput, context);
@@ -116,6 +586,19 @@ const de_BatchGetUsersStreamLinkDataCommandError = async (output, context) => {
116
586
  }
117
587
  };
118
588
  const throwDefaultError = (0, smithy_client_1.withBaseException)(UsersServiceException_1.UsersServiceException);
589
+ const de_ForbiddenExceptionRes = async (parsedOutput, context) => {
590
+ const contents = (0, smithy_client_1.map)({});
591
+ const data = parsedOutput.body;
592
+ const doc = (0, smithy_client_1.take)(data, {
593
+ 'message': smithy_client_1.expectString,
594
+ });
595
+ Object.assign(contents, doc);
596
+ const exception = new models_0_1.ForbiddenException({
597
+ $metadata: deserializeMetadata(parsedOutput),
598
+ ...contents
599
+ });
600
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
601
+ };
119
602
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
120
603
  const contents = (0, smithy_client_1.map)({});
121
604
  const data = parsedOutput.body;
@@ -129,6 +612,45 @@ const de_ValidationExceptionRes = async (parsedOutput, context) => {
129
612
  });
130
613
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
131
614
  };
615
+ const de_BotApiKeyNotFoundExceptionRes = async (parsedOutput, context) => {
616
+ const contents = (0, smithy_client_1.map)({});
617
+ const data = parsedOutput.body;
618
+ const doc = (0, smithy_client_1.take)(data, {
619
+ 'message': smithy_client_1.expectString,
620
+ });
621
+ Object.assign(contents, doc);
622
+ const exception = new models_0_1.BotApiKeyNotFoundException({
623
+ $metadata: deserializeMetadata(parsedOutput),
624
+ ...contents
625
+ });
626
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
627
+ };
628
+ const de_BotNotFoundExceptionRes = async (parsedOutput, context) => {
629
+ const contents = (0, smithy_client_1.map)({});
630
+ const data = parsedOutput.body;
631
+ const doc = (0, smithy_client_1.take)(data, {
632
+ 'message': smithy_client_1.expectString,
633
+ });
634
+ Object.assign(contents, doc);
635
+ const exception = new models_0_1.BotNotFoundException({
636
+ $metadata: deserializeMetadata(parsedOutput),
637
+ ...contents
638
+ });
639
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
640
+ };
641
+ const de_BotSecretKeyNotValidExceptionRes = async (parsedOutput, context) => {
642
+ const contents = (0, smithy_client_1.map)({});
643
+ const data = parsedOutput.body;
644
+ const doc = (0, smithy_client_1.take)(data, {
645
+ 'message': smithy_client_1.expectString,
646
+ });
647
+ Object.assign(contents, doc);
648
+ const exception = new models_0_1.BotSecretKeyNotValidException({
649
+ $metadata: deserializeMetadata(parsedOutput),
650
+ ...contents
651
+ });
652
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
653
+ };
132
654
  const deserializeMetadata = (output) => ({
133
655
  httpStatusCode: output.statusCode,
134
656
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
package/dist-es/Users.js CHANGED
@@ -1,10 +1,26 @@
1
1
  import { UsersClient, } from "./UsersClient";
2
2
  import { BatchGetUsersPbxLinkDataCommand, } from "./commands/BatchGetUsersPbxLinkDataCommand";
3
3
  import { BatchGetUsersStreamLinkDataCommand, } from "./commands/BatchGetUsersStreamLinkDataCommand";
4
+ import { CreateBotApiKeyCommand, } from "./commands/CreateBotApiKeyCommand";
5
+ import { CreateBotCommand, } from "./commands/CreateBotCommand";
6
+ import { DeleteBotApiKeyCommand, } from "./commands/DeleteBotApiKeyCommand";
7
+ import { DeleteBotCommand, } from "./commands/DeleteBotCommand";
8
+ import { ListBotApiKeysCommand, } from "./commands/ListBotApiKeysCommand";
9
+ import { ListBotsCommand, } from "./commands/ListBotsCommand";
10
+ import { UpdateBotCommand, } from "./commands/UpdateBotCommand";
11
+ import { VerifyBotSecretKeyCommand, } from "./commands/VerifyBotSecretKeyCommand";
4
12
  import { createAggregatedClient } from "@smithy/smithy-client";
5
13
  const commands = {
6
14
  BatchGetUsersPbxLinkDataCommand,
7
15
  BatchGetUsersStreamLinkDataCommand,
16
+ CreateBotCommand,
17
+ CreateBotApiKeyCommand,
18
+ DeleteBotCommand,
19
+ DeleteBotApiKeyCommand,
20
+ ListBotApiKeysCommand,
21
+ ListBotsCommand,
22
+ UpdateBotCommand,
23
+ VerifyBotSecretKeyCommand,
8
24
  };
9
25
  export class Users extends UsersClient {
10
26
  }
@@ -0,0 +1,37 @@
1
+ import { de_CreateBotApiKeyCommand, se_CreateBotApiKeyCommand, } from "../protocols/Aws_restJson1";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
5
+ export { $Command };
6
+ export class CreateBotApiKeyCommand extends $Command {
7
+ constructor(input) {
8
+ super();
9
+ this.input = input;
10
+ }
11
+ resolveMiddleware(clientStack, configuration, options) {
12
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
13
+ const stack = clientStack.concat(this.middlewareStack);
14
+ const { logger } = configuration;
15
+ const clientName = "UsersClient";
16
+ const commandName = "CreateBotApiKeyCommand";
17
+ const handlerExecutionContext = {
18
+ logger,
19
+ clientName,
20
+ commandName,
21
+ inputFilterSensitiveLog: (_) => _,
22
+ outputFilterSensitiveLog: (_) => _,
23
+ [SMITHY_CONTEXT_KEY]: {
24
+ service: "Users",
25
+ operation: "CreateBotApiKey",
26
+ },
27
+ };
28
+ const { requestHandler } = configuration;
29
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
30
+ }
31
+ serialize(input, context) {
32
+ return se_CreateBotApiKeyCommand(input, context);
33
+ }
34
+ deserialize(output, context) {
35
+ return de_CreateBotApiKeyCommand(output, context);
36
+ }
37
+ }
@@ -0,0 +1,37 @@
1
+ import { de_CreateBotCommand, se_CreateBotCommand, } from "../protocols/Aws_restJson1";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
5
+ export { $Command };
6
+ export class CreateBotCommand extends $Command {
7
+ constructor(input) {
8
+ super();
9
+ this.input = input;
10
+ }
11
+ resolveMiddleware(clientStack, configuration, options) {
12
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
13
+ const stack = clientStack.concat(this.middlewareStack);
14
+ const { logger } = configuration;
15
+ const clientName = "UsersClient";
16
+ const commandName = "CreateBotCommand";
17
+ const handlerExecutionContext = {
18
+ logger,
19
+ clientName,
20
+ commandName,
21
+ inputFilterSensitiveLog: (_) => _,
22
+ outputFilterSensitiveLog: (_) => _,
23
+ [SMITHY_CONTEXT_KEY]: {
24
+ service: "Users",
25
+ operation: "CreateBot",
26
+ },
27
+ };
28
+ const { requestHandler } = configuration;
29
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
30
+ }
31
+ serialize(input, context) {
32
+ return se_CreateBotCommand(input, context);
33
+ }
34
+ deserialize(output, context) {
35
+ return de_CreateBotCommand(output, context);
36
+ }
37
+ }