@wildix/xbees-users-client 1.0.1 → 1.0.3

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 +548 -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 +533 -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 +113 -0
  30. package/dist-types/commands/CreateBotCommand.d.ts +132 -0
  31. package/dist-types/commands/DeleteBotApiKeyCommand.d.ts +79 -0
  32. package/dist-types/commands/DeleteBotCommand.d.ts +76 -0
  33. package/dist-types/commands/ListBotApiKeysCommand.d.ts +82 -0
  34. package/dist-types/commands/ListBotsCommand.d.ts +108 -0
  35. package/dist-types/commands/UpdateBotCommand.d.ts +133 -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 +247 -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,192 @@ 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
+ const query = (0, smithy_client_1.map)({
57
+ "company": [, input.company],
58
+ });
59
+ let body;
60
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
61
+ 'callback': _ => (0, smithy_client_1._json)(_),
62
+ 'name': [],
63
+ 'visibility': _ => (0, smithy_client_1._json)(_),
64
+ }));
65
+ return new protocol_http_1.HttpRequest({
66
+ protocol,
67
+ hostname,
68
+ port,
69
+ method: "POST",
70
+ headers,
71
+ path: resolvedPath,
72
+ query,
73
+ body,
74
+ });
75
+ };
76
+ exports.se_CreateBotCommand = se_CreateBotCommand;
77
+ const se_CreateBotApiKeyCommand = async (input, context) => {
78
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
79
+ const headers = {
80
+ 'content-type': 'application/json',
81
+ };
82
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots/{botId}/keys";
83
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'botId', () => input.botId, '{botId}', false);
84
+ const query = (0, smithy_client_1.map)({
85
+ "company": [, input.company],
86
+ });
87
+ let body;
88
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
89
+ 'name': [],
90
+ }));
91
+ return new protocol_http_1.HttpRequest({
92
+ protocol,
93
+ hostname,
94
+ port,
95
+ method: "POST",
96
+ headers,
97
+ path: resolvedPath,
98
+ query,
99
+ body,
100
+ });
101
+ };
102
+ exports.se_CreateBotApiKeyCommand = se_CreateBotApiKeyCommand;
103
+ const se_DeleteBotCommand = async (input, context) => {
104
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
105
+ const headers = {};
106
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots/{botId}";
107
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'botId', () => input.botId, '{botId}', false);
108
+ const query = (0, smithy_client_1.map)({
109
+ "company": [, input.company],
110
+ });
111
+ let body;
112
+ return new protocol_http_1.HttpRequest({
113
+ protocol,
114
+ hostname,
115
+ port,
116
+ method: "DELETE",
117
+ headers,
118
+ path: resolvedPath,
119
+ query,
120
+ body,
121
+ });
122
+ };
123
+ exports.se_DeleteBotCommand = se_DeleteBotCommand;
124
+ const se_DeleteBotApiKeyCommand = async (input, context) => {
125
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
126
+ const headers = {};
127
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots/{botId}/keys/{apiKeySecret}";
128
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'botId', () => input.botId, '{botId}', false);
129
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'apiKeySecret', () => input.apiKeySecret, '{apiKeySecret}', false);
130
+ const query = (0, smithy_client_1.map)({
131
+ "company": [, input.company],
132
+ });
133
+ let body;
134
+ return new protocol_http_1.HttpRequest({
135
+ protocol,
136
+ hostname,
137
+ port,
138
+ method: "DELETE",
139
+ headers,
140
+ path: resolvedPath,
141
+ query,
142
+ body,
143
+ });
144
+ };
145
+ exports.se_DeleteBotApiKeyCommand = se_DeleteBotApiKeyCommand;
146
+ const se_ListBotApiKeysCommand = async (input, context) => {
147
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
148
+ const headers = {};
149
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots/{botId}";
150
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'botId', () => input.botId, '{botId}', false);
151
+ const query = (0, smithy_client_1.map)({
152
+ "company": [, input.company],
153
+ });
154
+ let body;
155
+ return new protocol_http_1.HttpRequest({
156
+ protocol,
157
+ hostname,
158
+ port,
159
+ method: "GET",
160
+ headers,
161
+ path: resolvedPath,
162
+ query,
163
+ body,
164
+ });
165
+ };
166
+ exports.se_ListBotApiKeysCommand = se_ListBotApiKeysCommand;
167
+ const se_ListBotsCommand = async (input, context) => {
168
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
169
+ const headers = {};
170
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots";
171
+ const query = (0, smithy_client_1.map)({
172
+ "company": [, input.company],
173
+ });
174
+ let body;
175
+ return new protocol_http_1.HttpRequest({
176
+ protocol,
177
+ hostname,
178
+ port,
179
+ method: "GET",
180
+ headers,
181
+ path: resolvedPath,
182
+ query,
183
+ body,
184
+ });
185
+ };
186
+ exports.se_ListBotsCommand = se_ListBotsCommand;
187
+ const se_UpdateBotCommand = async (input, context) => {
188
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
189
+ const headers = {
190
+ 'content-type': 'application/json',
191
+ };
192
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots/{botId}";
193
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'botId', () => input.botId, '{botId}', false);
194
+ const query = (0, smithy_client_1.map)({
195
+ "company": [, input.company],
196
+ });
197
+ let body;
198
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
199
+ 'callback': _ => (0, smithy_client_1._json)(_),
200
+ 'name': [],
201
+ 'visibility': _ => (0, smithy_client_1._json)(_),
202
+ }));
203
+ return new protocol_http_1.HttpRequest({
204
+ protocol,
205
+ hostname,
206
+ port,
207
+ method: "POST",
208
+ headers,
209
+ path: resolvedPath,
210
+ query,
211
+ body,
212
+ });
213
+ };
214
+ exports.se_UpdateBotCommand = se_UpdateBotCommand;
215
+ const se_VerifyBotSecretKeyCommand = async (input, context) => {
216
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
217
+ const headers = {
218
+ 'content-type': 'application/json',
219
+ };
220
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/auth/VerifyBotSecretKey";
221
+ let body;
222
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
223
+ 'secret': [],
224
+ }));
225
+ return new protocol_http_1.HttpRequest({
226
+ protocol,
227
+ hostname,
228
+ port,
229
+ method: "POST",
230
+ headers,
231
+ path: resolvedPath,
232
+ body,
233
+ });
234
+ };
235
+ exports.se_VerifyBotSecretKeyCommand = se_VerifyBotSecretKeyCommand;
50
236
  const de_BatchGetUsersPbxLinkDataCommand = async (output, context) => {
51
237
  if (output.statusCode !== 200 && output.statusCode >= 300) {
52
238
  return de_BatchGetUsersPbxLinkDataCommandError(output, context);
@@ -69,6 +255,9 @@ const de_BatchGetUsersPbxLinkDataCommandError = async (output, context) => {
69
255
  };
70
256
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
71
257
  switch (errorCode) {
258
+ case "ForbiddenException":
259
+ case "smithy.framework#ForbiddenException":
260
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
72
261
  case "ValidationException":
73
262
  case "smithy.framework#ValidationException":
74
263
  throw await de_ValidationExceptionRes(parsedOutput, context);
@@ -103,6 +292,312 @@ const de_BatchGetUsersStreamLinkDataCommandError = async (output, context) => {
103
292
  };
104
293
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
105
294
  switch (errorCode) {
295
+ case "ForbiddenException":
296
+ case "smithy.framework#ForbiddenException":
297
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
298
+ case "ValidationException":
299
+ case "smithy.framework#ValidationException":
300
+ throw await de_ValidationExceptionRes(parsedOutput, context);
301
+ default:
302
+ const parsedBody = parsedOutput.body;
303
+ return throwDefaultError({
304
+ output,
305
+ parsedBody,
306
+ errorCode
307
+ });
308
+ }
309
+ };
310
+ const de_CreateBotCommand = async (output, context) => {
311
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
312
+ return de_CreateBotCommandError(output, context);
313
+ }
314
+ const contents = (0, smithy_client_1.map)({
315
+ $metadata: deserializeMetadata(output),
316
+ });
317
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
318
+ const doc = (0, smithy_client_1.take)(data, {
319
+ 'bot': smithy_client_1._json,
320
+ });
321
+ Object.assign(contents, doc);
322
+ return contents;
323
+ };
324
+ exports.de_CreateBotCommand = de_CreateBotCommand;
325
+ const de_CreateBotCommandError = async (output, context) => {
326
+ const parsedOutput = {
327
+ ...output,
328
+ body: await parseErrorBody(output.body, context)
329
+ };
330
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
331
+ switch (errorCode) {
332
+ case "ForbiddenException":
333
+ case "smithy.framework#ForbiddenException":
334
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
335
+ case "ValidationException":
336
+ case "smithy.framework#ValidationException":
337
+ throw await de_ValidationExceptionRes(parsedOutput, context);
338
+ default:
339
+ const parsedBody = parsedOutput.body;
340
+ return throwDefaultError({
341
+ output,
342
+ parsedBody,
343
+ errorCode
344
+ });
345
+ }
346
+ };
347
+ const de_CreateBotApiKeyCommand = async (output, context) => {
348
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
349
+ return de_CreateBotApiKeyCommandError(output, context);
350
+ }
351
+ const contents = (0, smithy_client_1.map)({
352
+ $metadata: deserializeMetadata(output),
353
+ });
354
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
355
+ const doc = (0, smithy_client_1.take)(data, {
356
+ 'bot': smithy_client_1._json,
357
+ 'key': smithy_client_1._json,
358
+ });
359
+ Object.assign(contents, doc);
360
+ return contents;
361
+ };
362
+ exports.de_CreateBotApiKeyCommand = de_CreateBotApiKeyCommand;
363
+ const de_CreateBotApiKeyCommandError = async (output, context) => {
364
+ const parsedOutput = {
365
+ ...output,
366
+ body: await parseErrorBody(output.body, context)
367
+ };
368
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
369
+ switch (errorCode) {
370
+ case "ForbiddenException":
371
+ case "smithy.framework#ForbiddenException":
372
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
373
+ case "ValidationException":
374
+ case "smithy.framework#ValidationException":
375
+ throw await de_ValidationExceptionRes(parsedOutput, context);
376
+ default:
377
+ const parsedBody = parsedOutput.body;
378
+ return throwDefaultError({
379
+ output,
380
+ parsedBody,
381
+ errorCode
382
+ });
383
+ }
384
+ };
385
+ const de_DeleteBotCommand = async (output, context) => {
386
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
387
+ return de_DeleteBotCommandError(output, context);
388
+ }
389
+ const contents = (0, smithy_client_1.map)({
390
+ $metadata: deserializeMetadata(output),
391
+ });
392
+ await (0, smithy_client_1.collectBody)(output.body, context);
393
+ return contents;
394
+ };
395
+ exports.de_DeleteBotCommand = de_DeleteBotCommand;
396
+ const de_DeleteBotCommandError = async (output, context) => {
397
+ const parsedOutput = {
398
+ ...output,
399
+ body: await parseErrorBody(output.body, context)
400
+ };
401
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
402
+ switch (errorCode) {
403
+ case "BotNotFoundException":
404
+ case "wildix.xbees.users#BotNotFoundException":
405
+ throw await de_BotNotFoundExceptionRes(parsedOutput, context);
406
+ case "ForbiddenException":
407
+ case "smithy.framework#ForbiddenException":
408
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
409
+ case "ValidationException":
410
+ case "smithy.framework#ValidationException":
411
+ throw await de_ValidationExceptionRes(parsedOutput, context);
412
+ default:
413
+ const parsedBody = parsedOutput.body;
414
+ return throwDefaultError({
415
+ output,
416
+ parsedBody,
417
+ errorCode
418
+ });
419
+ }
420
+ };
421
+ const de_DeleteBotApiKeyCommand = async (output, context) => {
422
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
423
+ return de_DeleteBotApiKeyCommandError(output, context);
424
+ }
425
+ const contents = (0, smithy_client_1.map)({
426
+ $metadata: deserializeMetadata(output),
427
+ });
428
+ await (0, smithy_client_1.collectBody)(output.body, context);
429
+ return contents;
430
+ };
431
+ exports.de_DeleteBotApiKeyCommand = de_DeleteBotApiKeyCommand;
432
+ const de_DeleteBotApiKeyCommandError = async (output, context) => {
433
+ const parsedOutput = {
434
+ ...output,
435
+ body: await parseErrorBody(output.body, context)
436
+ };
437
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
438
+ switch (errorCode) {
439
+ case "BotApiKeyNotFoundException":
440
+ case "wildix.xbees.users#BotApiKeyNotFoundException":
441
+ throw await de_BotApiKeyNotFoundExceptionRes(parsedOutput, context);
442
+ case "BotNotFoundException":
443
+ case "wildix.xbees.users#BotNotFoundException":
444
+ throw await de_BotNotFoundExceptionRes(parsedOutput, context);
445
+ case "ForbiddenException":
446
+ case "smithy.framework#ForbiddenException":
447
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
448
+ case "ValidationException":
449
+ case "smithy.framework#ValidationException":
450
+ throw await de_ValidationExceptionRes(parsedOutput, context);
451
+ default:
452
+ const parsedBody = parsedOutput.body;
453
+ return throwDefaultError({
454
+ output,
455
+ parsedBody,
456
+ errorCode
457
+ });
458
+ }
459
+ };
460
+ const de_ListBotApiKeysCommand = async (output, context) => {
461
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
462
+ return de_ListBotApiKeysCommandError(output, context);
463
+ }
464
+ const contents = (0, smithy_client_1.map)({
465
+ $metadata: deserializeMetadata(output),
466
+ });
467
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
468
+ const doc = (0, smithy_client_1.take)(data, {
469
+ 'keys': smithy_client_1._json,
470
+ });
471
+ Object.assign(contents, doc);
472
+ return contents;
473
+ };
474
+ exports.de_ListBotApiKeysCommand = de_ListBotApiKeysCommand;
475
+ const de_ListBotApiKeysCommandError = async (output, context) => {
476
+ const parsedOutput = {
477
+ ...output,
478
+ body: await parseErrorBody(output.body, context)
479
+ };
480
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
481
+ switch (errorCode) {
482
+ case "ForbiddenException":
483
+ case "smithy.framework#ForbiddenException":
484
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
485
+ case "ValidationException":
486
+ case "smithy.framework#ValidationException":
487
+ throw await de_ValidationExceptionRes(parsedOutput, context);
488
+ default:
489
+ const parsedBody = parsedOutput.body;
490
+ return throwDefaultError({
491
+ output,
492
+ parsedBody,
493
+ errorCode
494
+ });
495
+ }
496
+ };
497
+ const de_ListBotsCommand = async (output, context) => {
498
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
499
+ return de_ListBotsCommandError(output, context);
500
+ }
501
+ const contents = (0, smithy_client_1.map)({
502
+ $metadata: deserializeMetadata(output),
503
+ });
504
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
505
+ const doc = (0, smithy_client_1.take)(data, {
506
+ 'bots': smithy_client_1._json,
507
+ });
508
+ Object.assign(contents, doc);
509
+ return contents;
510
+ };
511
+ exports.de_ListBotsCommand = de_ListBotsCommand;
512
+ const de_ListBotsCommandError = async (output, context) => {
513
+ const parsedOutput = {
514
+ ...output,
515
+ body: await parseErrorBody(output.body, context)
516
+ };
517
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
518
+ switch (errorCode) {
519
+ case "ForbiddenException":
520
+ case "smithy.framework#ForbiddenException":
521
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
522
+ case "ValidationException":
523
+ case "smithy.framework#ValidationException":
524
+ throw await de_ValidationExceptionRes(parsedOutput, context);
525
+ default:
526
+ const parsedBody = parsedOutput.body;
527
+ return throwDefaultError({
528
+ output,
529
+ parsedBody,
530
+ errorCode
531
+ });
532
+ }
533
+ };
534
+ const de_UpdateBotCommand = async (output, context) => {
535
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
536
+ return de_UpdateBotCommandError(output, context);
537
+ }
538
+ const contents = (0, smithy_client_1.map)({
539
+ $metadata: deserializeMetadata(output),
540
+ });
541
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
542
+ const doc = (0, smithy_client_1.take)(data, {
543
+ 'bot': smithy_client_1._json,
544
+ });
545
+ Object.assign(contents, doc);
546
+ return contents;
547
+ };
548
+ exports.de_UpdateBotCommand = de_UpdateBotCommand;
549
+ const de_UpdateBotCommandError = async (output, context) => {
550
+ const parsedOutput = {
551
+ ...output,
552
+ body: await parseErrorBody(output.body, context)
553
+ };
554
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
555
+ switch (errorCode) {
556
+ case "ForbiddenException":
557
+ case "smithy.framework#ForbiddenException":
558
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
559
+ case "ValidationException":
560
+ case "smithy.framework#ValidationException":
561
+ throw await de_ValidationExceptionRes(parsedOutput, context);
562
+ default:
563
+ const parsedBody = parsedOutput.body;
564
+ return throwDefaultError({
565
+ output,
566
+ parsedBody,
567
+ errorCode
568
+ });
569
+ }
570
+ };
571
+ const de_VerifyBotSecretKeyCommand = async (output, context) => {
572
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
573
+ return de_VerifyBotSecretKeyCommandError(output, context);
574
+ }
575
+ const contents = (0, smithy_client_1.map)({
576
+ $metadata: deserializeMetadata(output),
577
+ });
578
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
579
+ const doc = (0, smithy_client_1.take)(data, {
580
+ 'company': smithy_client_1.expectString,
581
+ 'id': smithy_client_1.expectString,
582
+ 'name': smithy_client_1.expectString,
583
+ });
584
+ Object.assign(contents, doc);
585
+ return contents;
586
+ };
587
+ exports.de_VerifyBotSecretKeyCommand = de_VerifyBotSecretKeyCommand;
588
+ const de_VerifyBotSecretKeyCommandError = async (output, context) => {
589
+ const parsedOutput = {
590
+ ...output,
591
+ body: await parseErrorBody(output.body, context)
592
+ };
593
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
594
+ switch (errorCode) {
595
+ case "BotSecretKeyNotValidException":
596
+ case "wildix.xbees.users#BotSecretKeyNotValidException":
597
+ throw await de_BotSecretKeyNotValidExceptionRes(parsedOutput, context);
598
+ case "ForbiddenException":
599
+ case "smithy.framework#ForbiddenException":
600
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
106
601
  case "ValidationException":
107
602
  case "smithy.framework#ValidationException":
108
603
  throw await de_ValidationExceptionRes(parsedOutput, context);
@@ -116,6 +611,19 @@ const de_BatchGetUsersStreamLinkDataCommandError = async (output, context) => {
116
611
  }
117
612
  };
118
613
  const throwDefaultError = (0, smithy_client_1.withBaseException)(UsersServiceException_1.UsersServiceException);
614
+ const de_ForbiddenExceptionRes = async (parsedOutput, context) => {
615
+ const contents = (0, smithy_client_1.map)({});
616
+ const data = parsedOutput.body;
617
+ const doc = (0, smithy_client_1.take)(data, {
618
+ 'message': smithy_client_1.expectString,
619
+ });
620
+ Object.assign(contents, doc);
621
+ const exception = new models_0_1.ForbiddenException({
622
+ $metadata: deserializeMetadata(parsedOutput),
623
+ ...contents
624
+ });
625
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
626
+ };
119
627
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
120
628
  const contents = (0, smithy_client_1.map)({});
121
629
  const data = parsedOutput.body;
@@ -129,6 +637,45 @@ const de_ValidationExceptionRes = async (parsedOutput, context) => {
129
637
  });
130
638
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
131
639
  };
640
+ const de_BotApiKeyNotFoundExceptionRes = async (parsedOutput, context) => {
641
+ const contents = (0, smithy_client_1.map)({});
642
+ const data = parsedOutput.body;
643
+ const doc = (0, smithy_client_1.take)(data, {
644
+ 'message': smithy_client_1.expectString,
645
+ });
646
+ Object.assign(contents, doc);
647
+ const exception = new models_0_1.BotApiKeyNotFoundException({
648
+ $metadata: deserializeMetadata(parsedOutput),
649
+ ...contents
650
+ });
651
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
652
+ };
653
+ const de_BotNotFoundExceptionRes = async (parsedOutput, context) => {
654
+ const contents = (0, smithy_client_1.map)({});
655
+ const data = parsedOutput.body;
656
+ const doc = (0, smithy_client_1.take)(data, {
657
+ 'message': smithy_client_1.expectString,
658
+ });
659
+ Object.assign(contents, doc);
660
+ const exception = new models_0_1.BotNotFoundException({
661
+ $metadata: deserializeMetadata(parsedOutput),
662
+ ...contents
663
+ });
664
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
665
+ };
666
+ const de_BotSecretKeyNotValidExceptionRes = async (parsedOutput, context) => {
667
+ const contents = (0, smithy_client_1.map)({});
668
+ const data = parsedOutput.body;
669
+ const doc = (0, smithy_client_1.take)(data, {
670
+ 'message': smithy_client_1.expectString,
671
+ });
672
+ Object.assign(contents, doc);
673
+ const exception = new models_0_1.BotSecretKeyNotValidException({
674
+ $metadata: deserializeMetadata(parsedOutput),
675
+ ...contents
676
+ });
677
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
678
+ };
132
679
  const deserializeMetadata = (output) => ({
133
680
  httpStatusCode: output.statusCode,
134
681
  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
+ }