@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.
- package/dist-cjs/Users.js +16 -0
- package/dist-cjs/commands/CreateBotApiKeyCommand.js +41 -0
- package/dist-cjs/commands/CreateBotCommand.js +41 -0
- package/dist-cjs/commands/DeleteBotApiKeyCommand.js +41 -0
- package/dist-cjs/commands/DeleteBotCommand.js +41 -0
- package/dist-cjs/commands/ListBotApiKeysCommand.js +41 -0
- package/dist-cjs/commands/ListBotsCommand.js +41 -0
- package/dist-cjs/commands/UpdateBotCommand.js +41 -0
- package/dist-cjs/commands/VerifyBotSecretKeyCommand.js +41 -0
- package/dist-cjs/commands/index.js +8 -0
- package/dist-cjs/models/models_0.js +63 -1
- package/dist-cjs/protocols/Aws_restJson1.js +523 -1
- package/dist-es/Users.js +16 -0
- package/dist-es/commands/CreateBotApiKeyCommand.js +37 -0
- package/dist-es/commands/CreateBotCommand.js +37 -0
- package/dist-es/commands/DeleteBotApiKeyCommand.js +37 -0
- package/dist-es/commands/DeleteBotCommand.js +37 -0
- package/dist-es/commands/ListBotApiKeysCommand.js +37 -0
- package/dist-es/commands/ListBotsCommand.js +37 -0
- package/dist-es/commands/UpdateBotCommand.js +37 -0
- package/dist-es/commands/VerifyBotSecretKeyCommand.js +37 -0
- package/dist-es/commands/index.js +8 -0
- package/dist-es/models/models_0.js +58 -0
- package/dist-es/protocols/Aws_restJson1.js +508 -2
- package/dist-types/Users.d.ts +56 -0
- package/dist-types/UsersClient.d.ts +10 -2
- package/dist-types/commands/BatchGetUsersPbxLinkDataCommand.d.ts +2 -0
- package/dist-types/commands/BatchGetUsersStreamLinkDataCommand.d.ts +2 -0
- package/dist-types/commands/CreateBotApiKeyCommand.d.ts +111 -0
- package/dist-types/commands/CreateBotCommand.d.ts +130 -0
- package/dist-types/commands/DeleteBotApiKeyCommand.d.ts +78 -0
- package/dist-types/commands/DeleteBotCommand.d.ts +75 -0
- package/dist-types/commands/ListBotApiKeysCommand.d.ts +81 -0
- package/dist-types/commands/ListBotsCommand.d.ts +105 -0
- package/dist-types/commands/UpdateBotCommand.d.ts +131 -0
- package/dist-types/commands/VerifyBotSecretKeyCommand.d.ts +79 -0
- package/dist-types/commands/index.d.ts +8 -0
- package/dist-types/models/models_0.d.ts +239 -0
- package/dist-types/protocols/Aws_restJson1.d.ts +72 -0
- package/dist-types/runtimeConfig.browser.d.ts +3 -3
- package/dist-types/runtimeConfig.d.ts +3 -3
- package/dist-types/runtimeConfig.native.d.ts +3 -3
- package/dist-types/runtimeConfig.shared.d.ts +2 -2
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UsersServiceException as __BaseException } from "../models/UsersServiceException";
|
|
2
|
-
import { ValidationException } from "../models/models_0";
|
|
2
|
+
import { BotApiKeyNotFoundException, BotNotFoundException, BotSecretKeyNotValidException, ForbiddenException, ValidationException, } from "../models/models_0";
|
|
3
3
|
import { HttpRequest as __HttpRequest, } from "@smithy/protocol-http";
|
|
4
|
-
import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, _json, collectBody, map, take, withBaseException, } from "@smithy/smithy-client";
|
|
4
|
+
import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, resolvedPath as __resolvedPath, _json, collectBody, map, take, withBaseException, } from "@smithy/smithy-client";
|
|
5
5
|
export const se_BatchGetUsersPbxLinkDataCommand = async (input, context) => {
|
|
6
6
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
7
7
|
const headers = {
|
|
@@ -42,6 +42,159 @@ export const se_BatchGetUsersStreamLinkDataCommand = async (input, context) => {
|
|
|
42
42
|
body,
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
|
+
export const se_CreateBotCommand = async (input, context) => {
|
|
46
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
47
|
+
const headers = {
|
|
48
|
+
'content-type': 'application/json',
|
|
49
|
+
};
|
|
50
|
+
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots";
|
|
51
|
+
let body;
|
|
52
|
+
body = JSON.stringify(take(input, {
|
|
53
|
+
'callback': _ => _json(_),
|
|
54
|
+
'name': [],
|
|
55
|
+
'visibility': _ => _json(_),
|
|
56
|
+
}));
|
|
57
|
+
return new __HttpRequest({
|
|
58
|
+
protocol,
|
|
59
|
+
hostname,
|
|
60
|
+
port,
|
|
61
|
+
method: "POST",
|
|
62
|
+
headers,
|
|
63
|
+
path: resolvedPath,
|
|
64
|
+
body,
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
export const se_CreateBotApiKeyCommand = async (input, context) => {
|
|
68
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
69
|
+
const headers = {
|
|
70
|
+
'content-type': 'application/json',
|
|
71
|
+
};
|
|
72
|
+
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots/{botId}/keys";
|
|
73
|
+
resolvedPath = __resolvedPath(resolvedPath, input, 'botId', () => input.botId, '{botId}', false);
|
|
74
|
+
let body;
|
|
75
|
+
body = JSON.stringify(take(input, {
|
|
76
|
+
'name': [],
|
|
77
|
+
}));
|
|
78
|
+
return new __HttpRequest({
|
|
79
|
+
protocol,
|
|
80
|
+
hostname,
|
|
81
|
+
port,
|
|
82
|
+
method: "POST",
|
|
83
|
+
headers,
|
|
84
|
+
path: resolvedPath,
|
|
85
|
+
body,
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
export const se_DeleteBotCommand = async (input, context) => {
|
|
89
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
90
|
+
const headers = {};
|
|
91
|
+
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots/{botId}";
|
|
92
|
+
resolvedPath = __resolvedPath(resolvedPath, input, 'botId', () => input.botId, '{botId}', false);
|
|
93
|
+
let body;
|
|
94
|
+
return new __HttpRequest({
|
|
95
|
+
protocol,
|
|
96
|
+
hostname,
|
|
97
|
+
port,
|
|
98
|
+
method: "DELETE",
|
|
99
|
+
headers,
|
|
100
|
+
path: resolvedPath,
|
|
101
|
+
body,
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
export const se_DeleteBotApiKeyCommand = async (input, context) => {
|
|
105
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
106
|
+
const headers = {};
|
|
107
|
+
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots/{botId}/keys/{apiKeySecret}";
|
|
108
|
+
resolvedPath = __resolvedPath(resolvedPath, input, 'botId', () => input.botId, '{botId}', false);
|
|
109
|
+
resolvedPath = __resolvedPath(resolvedPath, input, 'apiKeySecret', () => input.apiKeySecret, '{apiKeySecret}', false);
|
|
110
|
+
let body;
|
|
111
|
+
return new __HttpRequest({
|
|
112
|
+
protocol,
|
|
113
|
+
hostname,
|
|
114
|
+
port,
|
|
115
|
+
method: "DELETE",
|
|
116
|
+
headers,
|
|
117
|
+
path: resolvedPath,
|
|
118
|
+
body,
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
export const se_ListBotApiKeysCommand = async (input, context) => {
|
|
122
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
123
|
+
const headers = {};
|
|
124
|
+
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots/{botId}";
|
|
125
|
+
resolvedPath = __resolvedPath(resolvedPath, input, 'botId', () => input.botId, '{botId}', false);
|
|
126
|
+
let body;
|
|
127
|
+
return new __HttpRequest({
|
|
128
|
+
protocol,
|
|
129
|
+
hostname,
|
|
130
|
+
port,
|
|
131
|
+
method: "GET",
|
|
132
|
+
headers,
|
|
133
|
+
path: resolvedPath,
|
|
134
|
+
body,
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
export const se_ListBotsCommand = async (input, context) => {
|
|
138
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
139
|
+
const headers = {
|
|
140
|
+
'content-type': 'application/json',
|
|
141
|
+
};
|
|
142
|
+
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots";
|
|
143
|
+
let body;
|
|
144
|
+
body = "";
|
|
145
|
+
return new __HttpRequest({
|
|
146
|
+
protocol,
|
|
147
|
+
hostname,
|
|
148
|
+
port,
|
|
149
|
+
method: "GET",
|
|
150
|
+
headers,
|
|
151
|
+
path: resolvedPath,
|
|
152
|
+
body,
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
export const se_UpdateBotCommand = async (input, context) => {
|
|
156
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
157
|
+
const headers = {
|
|
158
|
+
'content-type': 'application/json',
|
|
159
|
+
};
|
|
160
|
+
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots/{botId}";
|
|
161
|
+
resolvedPath = __resolvedPath(resolvedPath, input, 'botId', () => input.botId, '{botId}', false);
|
|
162
|
+
let body;
|
|
163
|
+
body = JSON.stringify(take(input, {
|
|
164
|
+
'callback': _ => _json(_),
|
|
165
|
+
'name': [],
|
|
166
|
+
'visibility': _ => _json(_),
|
|
167
|
+
}));
|
|
168
|
+
return new __HttpRequest({
|
|
169
|
+
protocol,
|
|
170
|
+
hostname,
|
|
171
|
+
port,
|
|
172
|
+
method: "POST",
|
|
173
|
+
headers,
|
|
174
|
+
path: resolvedPath,
|
|
175
|
+
body,
|
|
176
|
+
});
|
|
177
|
+
};
|
|
178
|
+
export const se_VerifyBotSecretKeyCommand = async (input, context) => {
|
|
179
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
180
|
+
const headers = {
|
|
181
|
+
'content-type': 'application/json',
|
|
182
|
+
};
|
|
183
|
+
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/auth/VerifyBotSecretKey";
|
|
184
|
+
let body;
|
|
185
|
+
body = JSON.stringify(take(input, {
|
|
186
|
+
'secret': [],
|
|
187
|
+
}));
|
|
188
|
+
return new __HttpRequest({
|
|
189
|
+
protocol,
|
|
190
|
+
hostname,
|
|
191
|
+
port,
|
|
192
|
+
method: "POST",
|
|
193
|
+
headers,
|
|
194
|
+
path: resolvedPath,
|
|
195
|
+
body,
|
|
196
|
+
});
|
|
197
|
+
};
|
|
45
198
|
export const de_BatchGetUsersPbxLinkDataCommand = async (output, context) => {
|
|
46
199
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
47
200
|
return de_BatchGetUsersPbxLinkDataCommandError(output, context);
|
|
@@ -63,6 +216,9 @@ const de_BatchGetUsersPbxLinkDataCommandError = async (output, context) => {
|
|
|
63
216
|
};
|
|
64
217
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
65
218
|
switch (errorCode) {
|
|
219
|
+
case "ForbiddenException":
|
|
220
|
+
case "smithy.framework#ForbiddenException":
|
|
221
|
+
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
66
222
|
case "ValidationException":
|
|
67
223
|
case "smithy.framework#ValidationException":
|
|
68
224
|
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
@@ -96,6 +252,304 @@ const de_BatchGetUsersStreamLinkDataCommandError = async (output, context) => {
|
|
|
96
252
|
};
|
|
97
253
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
98
254
|
switch (errorCode) {
|
|
255
|
+
case "ForbiddenException":
|
|
256
|
+
case "smithy.framework#ForbiddenException":
|
|
257
|
+
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
258
|
+
case "ValidationException":
|
|
259
|
+
case "smithy.framework#ValidationException":
|
|
260
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
261
|
+
default:
|
|
262
|
+
const parsedBody = parsedOutput.body;
|
|
263
|
+
return throwDefaultError({
|
|
264
|
+
output,
|
|
265
|
+
parsedBody,
|
|
266
|
+
errorCode
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
export const de_CreateBotCommand = async (output, context) => {
|
|
271
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
272
|
+
return de_CreateBotCommandError(output, context);
|
|
273
|
+
}
|
|
274
|
+
const contents = map({
|
|
275
|
+
$metadata: deserializeMetadata(output),
|
|
276
|
+
});
|
|
277
|
+
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
278
|
+
const doc = take(data, {
|
|
279
|
+
'bot': _json,
|
|
280
|
+
});
|
|
281
|
+
Object.assign(contents, doc);
|
|
282
|
+
return contents;
|
|
283
|
+
};
|
|
284
|
+
const de_CreateBotCommandError = async (output, context) => {
|
|
285
|
+
const parsedOutput = {
|
|
286
|
+
...output,
|
|
287
|
+
body: await parseErrorBody(output.body, context)
|
|
288
|
+
};
|
|
289
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
290
|
+
switch (errorCode) {
|
|
291
|
+
case "ForbiddenException":
|
|
292
|
+
case "smithy.framework#ForbiddenException":
|
|
293
|
+
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
294
|
+
case "ValidationException":
|
|
295
|
+
case "smithy.framework#ValidationException":
|
|
296
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
297
|
+
default:
|
|
298
|
+
const parsedBody = parsedOutput.body;
|
|
299
|
+
return throwDefaultError({
|
|
300
|
+
output,
|
|
301
|
+
parsedBody,
|
|
302
|
+
errorCode
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
export const de_CreateBotApiKeyCommand = async (output, context) => {
|
|
307
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
308
|
+
return de_CreateBotApiKeyCommandError(output, context);
|
|
309
|
+
}
|
|
310
|
+
const contents = map({
|
|
311
|
+
$metadata: deserializeMetadata(output),
|
|
312
|
+
});
|
|
313
|
+
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
314
|
+
const doc = take(data, {
|
|
315
|
+
'bot': _json,
|
|
316
|
+
'key': _json,
|
|
317
|
+
});
|
|
318
|
+
Object.assign(contents, doc);
|
|
319
|
+
return contents;
|
|
320
|
+
};
|
|
321
|
+
const de_CreateBotApiKeyCommandError = async (output, context) => {
|
|
322
|
+
const parsedOutput = {
|
|
323
|
+
...output,
|
|
324
|
+
body: await parseErrorBody(output.body, context)
|
|
325
|
+
};
|
|
326
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
327
|
+
switch (errorCode) {
|
|
328
|
+
case "ForbiddenException":
|
|
329
|
+
case "smithy.framework#ForbiddenException":
|
|
330
|
+
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
331
|
+
case "ValidationException":
|
|
332
|
+
case "smithy.framework#ValidationException":
|
|
333
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
334
|
+
default:
|
|
335
|
+
const parsedBody = parsedOutput.body;
|
|
336
|
+
return throwDefaultError({
|
|
337
|
+
output,
|
|
338
|
+
parsedBody,
|
|
339
|
+
errorCode
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
};
|
|
343
|
+
export const de_DeleteBotCommand = async (output, context) => {
|
|
344
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
345
|
+
return de_DeleteBotCommandError(output, context);
|
|
346
|
+
}
|
|
347
|
+
const contents = map({
|
|
348
|
+
$metadata: deserializeMetadata(output),
|
|
349
|
+
});
|
|
350
|
+
await collectBody(output.body, context);
|
|
351
|
+
return contents;
|
|
352
|
+
};
|
|
353
|
+
const de_DeleteBotCommandError = async (output, context) => {
|
|
354
|
+
const parsedOutput = {
|
|
355
|
+
...output,
|
|
356
|
+
body: await parseErrorBody(output.body, context)
|
|
357
|
+
};
|
|
358
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
359
|
+
switch (errorCode) {
|
|
360
|
+
case "BotNotFoundException":
|
|
361
|
+
case "wildix.xbees.users#BotNotFoundException":
|
|
362
|
+
throw await de_BotNotFoundExceptionRes(parsedOutput, context);
|
|
363
|
+
case "ForbiddenException":
|
|
364
|
+
case "smithy.framework#ForbiddenException":
|
|
365
|
+
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
366
|
+
case "ValidationException":
|
|
367
|
+
case "smithy.framework#ValidationException":
|
|
368
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
369
|
+
default:
|
|
370
|
+
const parsedBody = parsedOutput.body;
|
|
371
|
+
return throwDefaultError({
|
|
372
|
+
output,
|
|
373
|
+
parsedBody,
|
|
374
|
+
errorCode
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
};
|
|
378
|
+
export const de_DeleteBotApiKeyCommand = async (output, context) => {
|
|
379
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
380
|
+
return de_DeleteBotApiKeyCommandError(output, context);
|
|
381
|
+
}
|
|
382
|
+
const contents = map({
|
|
383
|
+
$metadata: deserializeMetadata(output),
|
|
384
|
+
});
|
|
385
|
+
await collectBody(output.body, context);
|
|
386
|
+
return contents;
|
|
387
|
+
};
|
|
388
|
+
const de_DeleteBotApiKeyCommandError = async (output, context) => {
|
|
389
|
+
const parsedOutput = {
|
|
390
|
+
...output,
|
|
391
|
+
body: await parseErrorBody(output.body, context)
|
|
392
|
+
};
|
|
393
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
394
|
+
switch (errorCode) {
|
|
395
|
+
case "BotApiKeyNotFoundException":
|
|
396
|
+
case "wildix.xbees.users#BotApiKeyNotFoundException":
|
|
397
|
+
throw await de_BotApiKeyNotFoundExceptionRes(parsedOutput, context);
|
|
398
|
+
case "BotNotFoundException":
|
|
399
|
+
case "wildix.xbees.users#BotNotFoundException":
|
|
400
|
+
throw await de_BotNotFoundExceptionRes(parsedOutput, context);
|
|
401
|
+
case "ForbiddenException":
|
|
402
|
+
case "smithy.framework#ForbiddenException":
|
|
403
|
+
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
404
|
+
case "ValidationException":
|
|
405
|
+
case "smithy.framework#ValidationException":
|
|
406
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
407
|
+
default:
|
|
408
|
+
const parsedBody = parsedOutput.body;
|
|
409
|
+
return throwDefaultError({
|
|
410
|
+
output,
|
|
411
|
+
parsedBody,
|
|
412
|
+
errorCode
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
};
|
|
416
|
+
export const de_ListBotApiKeysCommand = async (output, context) => {
|
|
417
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
418
|
+
return de_ListBotApiKeysCommandError(output, context);
|
|
419
|
+
}
|
|
420
|
+
const contents = map({
|
|
421
|
+
$metadata: deserializeMetadata(output),
|
|
422
|
+
});
|
|
423
|
+
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
424
|
+
const doc = take(data, {
|
|
425
|
+
'keys': _json,
|
|
426
|
+
});
|
|
427
|
+
Object.assign(contents, doc);
|
|
428
|
+
return contents;
|
|
429
|
+
};
|
|
430
|
+
const de_ListBotApiKeysCommandError = async (output, context) => {
|
|
431
|
+
const parsedOutput = {
|
|
432
|
+
...output,
|
|
433
|
+
body: await parseErrorBody(output.body, context)
|
|
434
|
+
};
|
|
435
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
436
|
+
switch (errorCode) {
|
|
437
|
+
case "ForbiddenException":
|
|
438
|
+
case "smithy.framework#ForbiddenException":
|
|
439
|
+
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
440
|
+
case "ValidationException":
|
|
441
|
+
case "smithy.framework#ValidationException":
|
|
442
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
443
|
+
default:
|
|
444
|
+
const parsedBody = parsedOutput.body;
|
|
445
|
+
return throwDefaultError({
|
|
446
|
+
output,
|
|
447
|
+
parsedBody,
|
|
448
|
+
errorCode
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
export const de_ListBotsCommand = async (output, context) => {
|
|
453
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
454
|
+
return de_ListBotsCommandError(output, context);
|
|
455
|
+
}
|
|
456
|
+
const contents = map({
|
|
457
|
+
$metadata: deserializeMetadata(output),
|
|
458
|
+
});
|
|
459
|
+
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
460
|
+
const doc = take(data, {
|
|
461
|
+
'bots': _json,
|
|
462
|
+
});
|
|
463
|
+
Object.assign(contents, doc);
|
|
464
|
+
return contents;
|
|
465
|
+
};
|
|
466
|
+
const de_ListBotsCommandError = async (output, context) => {
|
|
467
|
+
const parsedOutput = {
|
|
468
|
+
...output,
|
|
469
|
+
body: await parseErrorBody(output.body, context)
|
|
470
|
+
};
|
|
471
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
472
|
+
switch (errorCode) {
|
|
473
|
+
case "ForbiddenException":
|
|
474
|
+
case "smithy.framework#ForbiddenException":
|
|
475
|
+
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
476
|
+
case "ValidationException":
|
|
477
|
+
case "smithy.framework#ValidationException":
|
|
478
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
479
|
+
default:
|
|
480
|
+
const parsedBody = parsedOutput.body;
|
|
481
|
+
return throwDefaultError({
|
|
482
|
+
output,
|
|
483
|
+
parsedBody,
|
|
484
|
+
errorCode
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
export const de_UpdateBotCommand = async (output, context) => {
|
|
489
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
490
|
+
return de_UpdateBotCommandError(output, context);
|
|
491
|
+
}
|
|
492
|
+
const contents = map({
|
|
493
|
+
$metadata: deserializeMetadata(output),
|
|
494
|
+
});
|
|
495
|
+
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
496
|
+
const doc = take(data, {
|
|
497
|
+
'bot': _json,
|
|
498
|
+
});
|
|
499
|
+
Object.assign(contents, doc);
|
|
500
|
+
return contents;
|
|
501
|
+
};
|
|
502
|
+
const de_UpdateBotCommandError = async (output, context) => {
|
|
503
|
+
const parsedOutput = {
|
|
504
|
+
...output,
|
|
505
|
+
body: await parseErrorBody(output.body, context)
|
|
506
|
+
};
|
|
507
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
508
|
+
switch (errorCode) {
|
|
509
|
+
case "ForbiddenException":
|
|
510
|
+
case "smithy.framework#ForbiddenException":
|
|
511
|
+
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
512
|
+
case "ValidationException":
|
|
513
|
+
case "smithy.framework#ValidationException":
|
|
514
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
515
|
+
default:
|
|
516
|
+
const parsedBody = parsedOutput.body;
|
|
517
|
+
return throwDefaultError({
|
|
518
|
+
output,
|
|
519
|
+
parsedBody,
|
|
520
|
+
errorCode
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
};
|
|
524
|
+
export const de_VerifyBotSecretKeyCommand = async (output, context) => {
|
|
525
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
526
|
+
return de_VerifyBotSecretKeyCommandError(output, context);
|
|
527
|
+
}
|
|
528
|
+
const contents = map({
|
|
529
|
+
$metadata: deserializeMetadata(output),
|
|
530
|
+
});
|
|
531
|
+
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
532
|
+
const doc = take(data, {
|
|
533
|
+
'company': __expectString,
|
|
534
|
+
'id': __expectString,
|
|
535
|
+
'name': __expectString,
|
|
536
|
+
});
|
|
537
|
+
Object.assign(contents, doc);
|
|
538
|
+
return contents;
|
|
539
|
+
};
|
|
540
|
+
const de_VerifyBotSecretKeyCommandError = async (output, context) => {
|
|
541
|
+
const parsedOutput = {
|
|
542
|
+
...output,
|
|
543
|
+
body: await parseErrorBody(output.body, context)
|
|
544
|
+
};
|
|
545
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
546
|
+
switch (errorCode) {
|
|
547
|
+
case "BotSecretKeyNotValidException":
|
|
548
|
+
case "wildix.xbees.users#BotSecretKeyNotValidException":
|
|
549
|
+
throw await de_BotSecretKeyNotValidExceptionRes(parsedOutput, context);
|
|
550
|
+
case "ForbiddenException":
|
|
551
|
+
case "smithy.framework#ForbiddenException":
|
|
552
|
+
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
99
553
|
case "ValidationException":
|
|
100
554
|
case "smithy.framework#ValidationException":
|
|
101
555
|
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
@@ -109,6 +563,19 @@ const de_BatchGetUsersStreamLinkDataCommandError = async (output, context) => {
|
|
|
109
563
|
}
|
|
110
564
|
};
|
|
111
565
|
const throwDefaultError = withBaseException(__BaseException);
|
|
566
|
+
const de_ForbiddenExceptionRes = async (parsedOutput, context) => {
|
|
567
|
+
const contents = map({});
|
|
568
|
+
const data = parsedOutput.body;
|
|
569
|
+
const doc = take(data, {
|
|
570
|
+
'message': __expectString,
|
|
571
|
+
});
|
|
572
|
+
Object.assign(contents, doc);
|
|
573
|
+
const exception = new ForbiddenException({
|
|
574
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
575
|
+
...contents
|
|
576
|
+
});
|
|
577
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
578
|
+
};
|
|
112
579
|
const de_ValidationExceptionRes = async (parsedOutput, context) => {
|
|
113
580
|
const contents = map({});
|
|
114
581
|
const data = parsedOutput.body;
|
|
@@ -122,6 +589,45 @@ const de_ValidationExceptionRes = async (parsedOutput, context) => {
|
|
|
122
589
|
});
|
|
123
590
|
return __decorateServiceException(exception, parsedOutput.body);
|
|
124
591
|
};
|
|
592
|
+
const de_BotApiKeyNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
593
|
+
const contents = map({});
|
|
594
|
+
const data = parsedOutput.body;
|
|
595
|
+
const doc = take(data, {
|
|
596
|
+
'message': __expectString,
|
|
597
|
+
});
|
|
598
|
+
Object.assign(contents, doc);
|
|
599
|
+
const exception = new BotApiKeyNotFoundException({
|
|
600
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
601
|
+
...contents
|
|
602
|
+
});
|
|
603
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
604
|
+
};
|
|
605
|
+
const de_BotNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
606
|
+
const contents = map({});
|
|
607
|
+
const data = parsedOutput.body;
|
|
608
|
+
const doc = take(data, {
|
|
609
|
+
'message': __expectString,
|
|
610
|
+
});
|
|
611
|
+
Object.assign(contents, doc);
|
|
612
|
+
const exception = new BotNotFoundException({
|
|
613
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
614
|
+
...contents
|
|
615
|
+
});
|
|
616
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
617
|
+
};
|
|
618
|
+
const de_BotSecretKeyNotValidExceptionRes = async (parsedOutput, context) => {
|
|
619
|
+
const contents = map({});
|
|
620
|
+
const data = parsedOutput.body;
|
|
621
|
+
const doc = take(data, {
|
|
622
|
+
'message': __expectString,
|
|
623
|
+
});
|
|
624
|
+
Object.assign(contents, doc);
|
|
625
|
+
const exception = new BotSecretKeyNotValidException({
|
|
626
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
627
|
+
...contents
|
|
628
|
+
});
|
|
629
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
630
|
+
};
|
|
125
631
|
const deserializeMetadata = (output) => ({
|
|
126
632
|
httpStatusCode: output.statusCode,
|
|
127
633
|
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
package/dist-types/Users.d.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { UsersClient } from "./UsersClient";
|
|
2
2
|
import { BatchGetUsersPbxLinkDataCommandInput, BatchGetUsersPbxLinkDataCommandOutput } from "./commands/BatchGetUsersPbxLinkDataCommand";
|
|
3
3
|
import { BatchGetUsersStreamLinkDataCommandInput, BatchGetUsersStreamLinkDataCommandOutput } from "./commands/BatchGetUsersStreamLinkDataCommand";
|
|
4
|
+
import { CreateBotApiKeyCommandInput, CreateBotApiKeyCommandOutput } from "./commands/CreateBotApiKeyCommand";
|
|
5
|
+
import { CreateBotCommandInput, CreateBotCommandOutput } from "./commands/CreateBotCommand";
|
|
6
|
+
import { DeleteBotApiKeyCommandInput, DeleteBotApiKeyCommandOutput } from "./commands/DeleteBotApiKeyCommand";
|
|
7
|
+
import { DeleteBotCommandInput, DeleteBotCommandOutput } from "./commands/DeleteBotCommand";
|
|
8
|
+
import { ListBotApiKeysCommandInput, ListBotApiKeysCommandOutput } from "./commands/ListBotApiKeysCommand";
|
|
9
|
+
import { ListBotsCommandInput, ListBotsCommandOutput } from "./commands/ListBotsCommand";
|
|
10
|
+
import { UpdateBotCommandInput, UpdateBotCommandOutput } from "./commands/UpdateBotCommand";
|
|
11
|
+
import { VerifyBotSecretKeyCommandInput, VerifyBotSecretKeyCommandOutput } from "./commands/VerifyBotSecretKeyCommand";
|
|
4
12
|
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
|
|
5
13
|
export interface Users {
|
|
6
14
|
/**
|
|
@@ -15,6 +23,54 @@ export interface Users {
|
|
|
15
23
|
batchGetUsersStreamLinkData(args: BatchGetUsersStreamLinkDataCommandInput, options?: __HttpHandlerOptions): Promise<BatchGetUsersStreamLinkDataCommandOutput>;
|
|
16
24
|
batchGetUsersStreamLinkData(args: BatchGetUsersStreamLinkDataCommandInput, cb: (err: any, data?: BatchGetUsersStreamLinkDataCommandOutput) => void): void;
|
|
17
25
|
batchGetUsersStreamLinkData(args: BatchGetUsersStreamLinkDataCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: BatchGetUsersStreamLinkDataCommandOutput) => void): void;
|
|
26
|
+
/**
|
|
27
|
+
* @see {@link CreateBotCommand}
|
|
28
|
+
*/
|
|
29
|
+
createBot(args: CreateBotCommandInput, options?: __HttpHandlerOptions): Promise<CreateBotCommandOutput>;
|
|
30
|
+
createBot(args: CreateBotCommandInput, cb: (err: any, data?: CreateBotCommandOutput) => void): void;
|
|
31
|
+
createBot(args: CreateBotCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: CreateBotCommandOutput) => void): void;
|
|
32
|
+
/**
|
|
33
|
+
* @see {@link CreateBotApiKeyCommand}
|
|
34
|
+
*/
|
|
35
|
+
createBotApiKey(args: CreateBotApiKeyCommandInput, options?: __HttpHandlerOptions): Promise<CreateBotApiKeyCommandOutput>;
|
|
36
|
+
createBotApiKey(args: CreateBotApiKeyCommandInput, cb: (err: any, data?: CreateBotApiKeyCommandOutput) => void): void;
|
|
37
|
+
createBotApiKey(args: CreateBotApiKeyCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: CreateBotApiKeyCommandOutput) => void): void;
|
|
38
|
+
/**
|
|
39
|
+
* @see {@link DeleteBotCommand}
|
|
40
|
+
*/
|
|
41
|
+
deleteBot(args: DeleteBotCommandInput, options?: __HttpHandlerOptions): Promise<DeleteBotCommandOutput>;
|
|
42
|
+
deleteBot(args: DeleteBotCommandInput, cb: (err: any, data?: DeleteBotCommandOutput) => void): void;
|
|
43
|
+
deleteBot(args: DeleteBotCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DeleteBotCommandOutput) => void): void;
|
|
44
|
+
/**
|
|
45
|
+
* @see {@link DeleteBotApiKeyCommand}
|
|
46
|
+
*/
|
|
47
|
+
deleteBotApiKey(args: DeleteBotApiKeyCommandInput, options?: __HttpHandlerOptions): Promise<DeleteBotApiKeyCommandOutput>;
|
|
48
|
+
deleteBotApiKey(args: DeleteBotApiKeyCommandInput, cb: (err: any, data?: DeleteBotApiKeyCommandOutput) => void): void;
|
|
49
|
+
deleteBotApiKey(args: DeleteBotApiKeyCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DeleteBotApiKeyCommandOutput) => void): void;
|
|
50
|
+
/**
|
|
51
|
+
* @see {@link ListBotApiKeysCommand}
|
|
52
|
+
*/
|
|
53
|
+
listBotApiKeys(args: ListBotApiKeysCommandInput, options?: __HttpHandlerOptions): Promise<ListBotApiKeysCommandOutput>;
|
|
54
|
+
listBotApiKeys(args: ListBotApiKeysCommandInput, cb: (err: any, data?: ListBotApiKeysCommandOutput) => void): void;
|
|
55
|
+
listBotApiKeys(args: ListBotApiKeysCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListBotApiKeysCommandOutput) => void): void;
|
|
56
|
+
/**
|
|
57
|
+
* @see {@link ListBotsCommand}
|
|
58
|
+
*/
|
|
59
|
+
listBots(args: ListBotsCommandInput, options?: __HttpHandlerOptions): Promise<ListBotsCommandOutput>;
|
|
60
|
+
listBots(args: ListBotsCommandInput, cb: (err: any, data?: ListBotsCommandOutput) => void): void;
|
|
61
|
+
listBots(args: ListBotsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListBotsCommandOutput) => void): void;
|
|
62
|
+
/**
|
|
63
|
+
* @see {@link UpdateBotCommand}
|
|
64
|
+
*/
|
|
65
|
+
updateBot(args: UpdateBotCommandInput, options?: __HttpHandlerOptions): Promise<UpdateBotCommandOutput>;
|
|
66
|
+
updateBot(args: UpdateBotCommandInput, cb: (err: any, data?: UpdateBotCommandOutput) => void): void;
|
|
67
|
+
updateBot(args: UpdateBotCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: UpdateBotCommandOutput) => void): void;
|
|
68
|
+
/**
|
|
69
|
+
* @see {@link VerifyBotSecretKeyCommand}
|
|
70
|
+
*/
|
|
71
|
+
verifyBotSecretKey(args: VerifyBotSecretKeyCommandInput, options?: __HttpHandlerOptions): Promise<VerifyBotSecretKeyCommandOutput>;
|
|
72
|
+
verifyBotSecretKey(args: VerifyBotSecretKeyCommandInput, cb: (err: any, data?: VerifyBotSecretKeyCommandOutput) => void): void;
|
|
73
|
+
verifyBotSecretKey(args: VerifyBotSecretKeyCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: VerifyBotSecretKeyCommandOutput) => void): void;
|
|
18
74
|
}
|
|
19
75
|
/**
|
|
20
76
|
* @public
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { BatchGetUsersPbxLinkDataCommandInput, BatchGetUsersPbxLinkDataCommandOutput } from "./commands/BatchGetUsersPbxLinkDataCommand";
|
|
2
2
|
import { BatchGetUsersStreamLinkDataCommandInput, BatchGetUsersStreamLinkDataCommandOutput } from "./commands/BatchGetUsersStreamLinkDataCommand";
|
|
3
|
+
import { CreateBotApiKeyCommandInput, CreateBotApiKeyCommandOutput } from "./commands/CreateBotApiKeyCommand";
|
|
4
|
+
import { CreateBotCommandInput, CreateBotCommandOutput } from "./commands/CreateBotCommand";
|
|
5
|
+
import { DeleteBotApiKeyCommandInput, DeleteBotApiKeyCommandOutput } from "./commands/DeleteBotApiKeyCommand";
|
|
6
|
+
import { DeleteBotCommandInput, DeleteBotCommandOutput } from "./commands/DeleteBotCommand";
|
|
7
|
+
import { ListBotApiKeysCommandInput, ListBotApiKeysCommandOutput } from "./commands/ListBotApiKeysCommand";
|
|
8
|
+
import { ListBotsCommandInput, ListBotsCommandOutput } from "./commands/ListBotsCommand";
|
|
9
|
+
import { UpdateBotCommandInput, UpdateBotCommandOutput } from "./commands/UpdateBotCommand";
|
|
10
|
+
import { VerifyBotSecretKeyCommandInput, VerifyBotSecretKeyCommandOutput } from "./commands/VerifyBotSecretKeyCommand";
|
|
3
11
|
import { RuntimeExtension, RuntimeExtensionsConfig } from "./runtimeExtensions";
|
|
4
12
|
import { HttpHandler as __HttpHandler } from "@smithy/protocol-http";
|
|
5
13
|
import { Client as __Client, DefaultsMode as __DefaultsMode, SmithyConfiguration as __SmithyConfiguration, SmithyResolvedConfiguration as __SmithyResolvedConfiguration } from "@smithy/smithy-client";
|
|
@@ -8,11 +16,11 @@ export { __Client };
|
|
|
8
16
|
/**
|
|
9
17
|
* @public
|
|
10
18
|
*/
|
|
11
|
-
export type ServiceInputTypes = BatchGetUsersPbxLinkDataCommandInput | BatchGetUsersStreamLinkDataCommandInput;
|
|
19
|
+
export type ServiceInputTypes = BatchGetUsersPbxLinkDataCommandInput | BatchGetUsersStreamLinkDataCommandInput | CreateBotApiKeyCommandInput | CreateBotCommandInput | DeleteBotApiKeyCommandInput | DeleteBotCommandInput | ListBotApiKeysCommandInput | ListBotsCommandInput | UpdateBotCommandInput | VerifyBotSecretKeyCommandInput;
|
|
12
20
|
/**
|
|
13
21
|
* @public
|
|
14
22
|
*/
|
|
15
|
-
export type ServiceOutputTypes = BatchGetUsersPbxLinkDataCommandOutput | BatchGetUsersStreamLinkDataCommandOutput;
|
|
23
|
+
export type ServiceOutputTypes = BatchGetUsersPbxLinkDataCommandOutput | BatchGetUsersStreamLinkDataCommandOutput | CreateBotApiKeyCommandOutput | CreateBotCommandOutput | DeleteBotApiKeyCommandOutput | DeleteBotCommandOutput | ListBotApiKeysCommandOutput | ListBotsCommandOutput | UpdateBotCommandOutput | VerifyBotSecretKeyCommandOutput;
|
|
16
24
|
/**
|
|
17
25
|
* @public
|
|
18
26
|
*/
|
|
@@ -55,6 +55,8 @@ export interface BatchGetUsersPbxLinkDataCommandOutput extends BatchGetUsersPbxL
|
|
|
55
55
|
* @see {@link BatchGetUsersPbxLinkDataCommandOutput} for command's `response` shape.
|
|
56
56
|
* @see {@link UsersClientResolvedConfig | config} for UsersClient's `config` shape.
|
|
57
57
|
*
|
|
58
|
+
* @throws {@link ForbiddenException} (client fault)
|
|
59
|
+
*
|
|
58
60
|
* @throws {@link ValidationException} (client fault)
|
|
59
61
|
*
|
|
60
62
|
* @throws {@link UsersServiceException}
|
|
@@ -65,6 +65,8 @@ export interface BatchGetUsersStreamLinkDataCommandOutput extends BatchGetUsersS
|
|
|
65
65
|
* @see {@link BatchGetUsersStreamLinkDataCommandOutput} for command's `response` shape.
|
|
66
66
|
* @see {@link UsersClientResolvedConfig | config} for UsersClient's `config` shape.
|
|
67
67
|
*
|
|
68
|
+
* @throws {@link ForbiddenException} (client fault)
|
|
69
|
+
*
|
|
68
70
|
* @throws {@link ValidationException} (client fault)
|
|
69
71
|
*
|
|
70
72
|
* @throws {@link UsersServiceException}
|