@wildix/xbees-users-client 1.0.6 → 1.0.8

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 (65) hide show
  1. package/dist-cjs/Users.js +6 -0
  2. package/dist-cjs/UsersClient.js +21 -3
  3. package/dist-cjs/commands/BatchGetUsersPbxLinkDataCommand.js +12 -32
  4. package/dist-cjs/commands/BatchGetUsersStreamLinkDataCommand.js +12 -32
  5. package/dist-cjs/commands/CreateBotApiKeyCommand.js +12 -32
  6. package/dist-cjs/commands/CreateBotCommand.js +12 -32
  7. package/dist-cjs/commands/DeleteBotApiKeyCommand.js +12 -32
  8. package/dist-cjs/commands/DeleteBotCommand.js +12 -32
  9. package/dist-cjs/commands/GetBotCallbackCommand.js +21 -0
  10. package/dist-cjs/commands/GetBotCommand.js +21 -0
  11. package/dist-cjs/commands/ListBotApiKeysCommand.js +12 -32
  12. package/dist-cjs/commands/ListBotsCommand.js +12 -32
  13. package/dist-cjs/commands/UpdateBotCallbackCommand.js +21 -0
  14. package/dist-cjs/commands/UpdateBotCommand.js +12 -32
  15. package/dist-cjs/commands/VerifyBotSecretKeyCommand.js +12 -32
  16. package/dist-cjs/commands/index.js +3 -0
  17. package/dist-cjs/models/models_0.js +25 -21
  18. package/dist-cjs/protocols/Aws_restJson1.js +200 -352
  19. package/dist-cjs/runtimeConfig.browser.js +5 -1
  20. package/dist-cjs/runtimeConfig.js +5 -1
  21. package/dist-cjs/runtimeConfig.shared.js +13 -11
  22. package/dist-es/Users.js +6 -0
  23. package/dist-es/UsersClient.js +21 -3
  24. package/dist-es/commands/BatchGetUsersPbxLinkDataCommand.js +12 -32
  25. package/dist-es/commands/BatchGetUsersStreamLinkDataCommand.js +12 -32
  26. package/dist-es/commands/CreateBotApiKeyCommand.js +12 -32
  27. package/dist-es/commands/CreateBotCommand.js +12 -32
  28. package/dist-es/commands/DeleteBotApiKeyCommand.js +12 -32
  29. package/dist-es/commands/DeleteBotCommand.js +12 -32
  30. package/dist-es/commands/GetBotCallbackCommand.js +17 -0
  31. package/dist-es/commands/GetBotCommand.js +17 -0
  32. package/dist-es/commands/ListBotApiKeysCommand.js +12 -32
  33. package/dist-es/commands/ListBotsCommand.js +12 -32
  34. package/dist-es/commands/UpdateBotCallbackCommand.js +17 -0
  35. package/dist-es/commands/UpdateBotCommand.js +12 -32
  36. package/dist-es/commands/VerifyBotSecretKeyCommand.js +12 -32
  37. package/dist-es/commands/index.js +3 -0
  38. package/dist-es/models/models_0.js +22 -18
  39. package/dist-es/protocols/Aws_restJson1.js +192 -350
  40. package/dist-es/runtimeConfig.browser.js +4 -1
  41. package/dist-es/runtimeConfig.js +4 -1
  42. package/dist-es/runtimeConfig.shared.js +13 -11
  43. package/dist-types/Users.d.ts +22 -0
  44. package/dist-types/UsersClient.d.ts +21 -9
  45. package/dist-types/commands/BatchGetUsersPbxLinkDataCommand.d.ts +7 -19
  46. package/dist-types/commands/BatchGetUsersStreamLinkDataCommand.d.ts +7 -19
  47. package/dist-types/commands/CreateBotApiKeyCommand.d.ts +11 -45
  48. package/dist-types/commands/CreateBotCommand.d.ts +32 -66
  49. package/dist-types/commands/DeleteBotApiKeyCommand.d.ts +7 -19
  50. package/dist-types/commands/DeleteBotCommand.d.ts +7 -19
  51. package/dist-types/commands/GetBotCallbackCommand.d.ts +91 -0
  52. package/dist-types/commands/GetBotCommand.d.ts +73 -0
  53. package/dist-types/commands/ListBotApiKeysCommand.d.ts +7 -19
  54. package/dist-types/commands/ListBotsCommand.d.ts +9 -45
  55. package/dist-types/commands/UpdateBotCallbackCommand.d.ts +115 -0
  56. package/dist-types/commands/UpdateBotCommand.d.ts +12 -71
  57. package/dist-types/commands/VerifyBotSecretKeyCommand.d.ts +7 -19
  58. package/dist-types/commands/index.d.ts +3 -0
  59. package/dist-types/index.d.ts +2 -0
  60. package/dist-types/models/models_0.d.ts +155 -62
  61. package/dist-types/protocols/Aws_restJson1.d.ts +27 -0
  62. package/dist-types/runtimeConfig.browser.d.ts +5 -4
  63. package/dist-types/runtimeConfig.d.ts +5 -4
  64. package/dist-types/runtimeConfig.native.d.ts +5 -4
  65. package/package.json +32 -30
@@ -1,228 +1,228 @@
1
1
  import { UsersServiceException as __BaseException } from "../models/UsersServiceException";
2
2
  import { BotApiKeyNotFoundException, BotNotFoundException, BotSecretKeyNotValidException, ForbiddenException, ValidationException, } from "../models/models_0";
3
- import { HttpRequest as __HttpRequest, } from "@smithy/protocol-http";
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";
3
+ import { requestBuilder as rb } from "@smithy/core";
4
+ import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, _json, collectBody, map, take, withBaseException, } from "@smithy/smithy-client";
5
5
  export const se_BatchGetUsersPbxLinkDataCommand = async (input, context) => {
6
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
6
+ const b = rb(input, context);
7
7
  const headers = {
8
8
  'content-type': 'application/json',
9
9
  };
10
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/BatchGetUsersPbxLinkData";
10
+ b.bp("/v2/users/BatchGetUsersPbxLinkData");
11
11
  let body;
12
12
  body = JSON.stringify(take(input, {
13
13
  'id': _ => _json(_),
14
14
  }));
15
- return new __HttpRequest({
16
- protocol,
17
- hostname,
18
- port,
19
- method: "POST",
20
- headers,
21
- path: resolvedPath,
22
- body,
23
- });
15
+ b.m("POST")
16
+ .h(headers)
17
+ .b(body);
18
+ return b.build();
24
19
  };
25
20
  export const se_BatchGetUsersStreamLinkDataCommand = async (input, context) => {
26
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
21
+ const b = rb(input, context);
27
22
  const headers = {
28
23
  'content-type': 'application/json',
29
24
  };
30
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v1/users/BatchGetUsersStreamLinkData";
25
+ b.bp("/v1/users/BatchGetUsersStreamLinkData");
31
26
  let body;
32
27
  body = JSON.stringify(take(input, {
33
28
  'id': _ => _json(_),
34
29
  }));
35
- return new __HttpRequest({
36
- protocol,
37
- hostname,
38
- port,
39
- method: "POST",
40
- headers,
41
- path: resolvedPath,
42
- body,
43
- });
30
+ b.m("POST")
31
+ .h(headers)
32
+ .b(body);
33
+ return b.build();
44
34
  };
45
35
  export const se_CreateBotCommand = async (input, context) => {
46
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
36
+ const b = rb(input, context);
47
37
  const headers = {
48
38
  'content-type': 'application/json',
49
39
  };
50
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots";
40
+ b.bp("/v2/users/bots");
51
41
  const query = map({
52
- "company": [, input.company],
42
+ [_c]: [, input[_c]],
53
43
  });
54
44
  let body;
55
45
  body = JSON.stringify(take(input, {
56
46
  'callback': _ => _json(_),
57
47
  'name': [],
58
- 'visibility': _ => _json(_),
48
+ 'picture': [],
59
49
  }));
60
- return new __HttpRequest({
61
- protocol,
62
- hostname,
63
- port,
64
- method: "POST",
65
- headers,
66
- path: resolvedPath,
67
- query,
68
- body,
69
- });
50
+ b.m("POST")
51
+ .h(headers)
52
+ .q(query)
53
+ .b(body);
54
+ return b.build();
70
55
  };
71
56
  export const se_CreateBotApiKeyCommand = async (input, context) => {
72
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
57
+ const b = rb(input, context);
73
58
  const headers = {
74
59
  'content-type': 'application/json',
75
60
  };
76
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots/{botId}/keys";
77
- resolvedPath = __resolvedPath(resolvedPath, input, 'botId', () => input.botId, '{botId}', false);
61
+ b.bp("/v2/users/bots/{botId}/keys");
62
+ b.p('botId', () => input.botId, '{botId}', false);
78
63
  const query = map({
79
- "company": [, input.company],
64
+ [_c]: [, input[_c]],
80
65
  });
81
66
  let body;
82
67
  body = JSON.stringify(take(input, {
83
68
  'name': [],
84
69
  }));
85
- return new __HttpRequest({
86
- protocol,
87
- hostname,
88
- port,
89
- method: "POST",
90
- headers,
91
- path: resolvedPath,
92
- query,
93
- body,
94
- });
70
+ b.m("POST")
71
+ .h(headers)
72
+ .q(query)
73
+ .b(body);
74
+ return b.build();
95
75
  };
96
76
  export const se_DeleteBotCommand = async (input, context) => {
97
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
77
+ const b = rb(input, context);
98
78
  const headers = {};
99
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots/{botId}";
100
- resolvedPath = __resolvedPath(resolvedPath, input, 'botId', () => input.botId, '{botId}', false);
79
+ b.bp("/v2/users/bots/{botId}");
80
+ b.p('botId', () => input.botId, '{botId}', false);
101
81
  const query = map({
102
- "company": [, input.company],
82
+ [_c]: [, input[_c]],
103
83
  });
104
84
  let body;
105
- return new __HttpRequest({
106
- protocol,
107
- hostname,
108
- port,
109
- method: "DELETE",
110
- headers,
111
- path: resolvedPath,
112
- query,
113
- body,
114
- });
85
+ b.m("DELETE")
86
+ .h(headers)
87
+ .q(query)
88
+ .b(body);
89
+ return b.build();
115
90
  };
116
91
  export const se_DeleteBotApiKeyCommand = async (input, context) => {
117
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
92
+ const b = rb(input, context);
118
93
  const headers = {};
119
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots/{botId}/keys/{apiKeySecret}";
120
- resolvedPath = __resolvedPath(resolvedPath, input, 'botId', () => input.botId, '{botId}', false);
121
- resolvedPath = __resolvedPath(resolvedPath, input, 'apiKeySecret', () => input.apiKeySecret, '{apiKeySecret}', false);
94
+ b.bp("/v2/users/bots/{botId}/keys/{apiKeySecret}");
95
+ b.p('botId', () => input.botId, '{botId}', false);
96
+ b.p('apiKeySecret', () => input.apiKeySecret, '{apiKeySecret}', false);
122
97
  const query = map({
123
- "company": [, input.company],
98
+ [_c]: [, input[_c]],
124
99
  });
125
100
  let body;
126
- return new __HttpRequest({
127
- protocol,
128
- hostname,
129
- port,
130
- method: "DELETE",
131
- headers,
132
- path: resolvedPath,
133
- query,
134
- body,
101
+ b.m("DELETE")
102
+ .h(headers)
103
+ .q(query)
104
+ .b(body);
105
+ return b.build();
106
+ };
107
+ export const se_GetBotCommand = async (input, context) => {
108
+ const b = rb(input, context);
109
+ const headers = {};
110
+ b.bp("/v2/users/bots/{id}");
111
+ b.p('id', () => input.id, '{id}', false);
112
+ const query = map({
113
+ [_c]: [, input[_c]],
135
114
  });
115
+ let body;
116
+ b.m("GET")
117
+ .h(headers)
118
+ .q(query)
119
+ .b(body);
120
+ return b.build();
121
+ };
122
+ export const se_GetBotCallbackCommand = async (input, context) => {
123
+ const b = rb(input, context);
124
+ const headers = {};
125
+ b.bp("/v2/users/bots/{id}/callback");
126
+ b.p('id', () => input.id, '{id}', false);
127
+ const query = map({
128
+ [_c]: [, input[_c]],
129
+ });
130
+ let body;
131
+ b.m("GET")
132
+ .h(headers)
133
+ .q(query)
134
+ .b(body);
135
+ return b.build();
136
136
  };
137
137
  export const se_ListBotApiKeysCommand = async (input, context) => {
138
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
138
+ const b = rb(input, context);
139
139
  const headers = {};
140
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots/{botId}";
141
- resolvedPath = __resolvedPath(resolvedPath, input, 'botId', () => input.botId, '{botId}', false);
140
+ b.bp("/v2/users/bots/{botId}/keys");
141
+ b.p('botId', () => input.botId, '{botId}', false);
142
142
  const query = map({
143
- "company": [, input.company],
143
+ [_c]: [, input[_c]],
144
144
  });
145
145
  let body;
146
- return new __HttpRequest({
147
- protocol,
148
- hostname,
149
- port,
150
- method: "GET",
151
- headers,
152
- path: resolvedPath,
153
- query,
154
- body,
155
- });
146
+ b.m("GET")
147
+ .h(headers)
148
+ .q(query)
149
+ .b(body);
150
+ return b.build();
156
151
  };
157
152
  export const se_ListBotsCommand = async (input, context) => {
158
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
153
+ const b = rb(input, context);
159
154
  const headers = {};
160
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots";
155
+ b.bp("/v2/users/bots");
161
156
  const query = map({
162
- "company": [, input.company],
157
+ [_c]: [, input[_c]],
163
158
  });
164
159
  let body;
165
- return new __HttpRequest({
166
- protocol,
167
- hostname,
168
- port,
169
- method: "GET",
170
- headers,
171
- path: resolvedPath,
172
- query,
173
- body,
174
- });
160
+ b.m("GET")
161
+ .h(headers)
162
+ .q(query)
163
+ .b(body);
164
+ return b.build();
175
165
  };
176
166
  export const se_UpdateBotCommand = async (input, context) => {
177
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
167
+ const b = rb(input, context);
178
168
  const headers = {
179
169
  'content-type': 'application/json',
180
170
  };
181
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots/{botId}";
182
- resolvedPath = __resolvedPath(resolvedPath, input, 'botId', () => input.botId, '{botId}', false);
171
+ b.bp("/v2/users/bots/{id}");
172
+ b.p('id', () => input.id, '{id}', false);
183
173
  const query = map({
184
- "company": [, input.company],
174
+ [_c]: [, input[_c]],
185
175
  });
186
176
  let body;
187
177
  body = JSON.stringify(take(input, {
188
- 'callback': _ => _json(_),
189
178
  'name': [],
190
- 'visibility': _ => _json(_),
179
+ 'picture': [],
180
+ 'searchable': [],
191
181
  }));
192
- return new __HttpRequest({
193
- protocol,
194
- hostname,
195
- port,
196
- method: "POST",
197
- headers,
198
- path: resolvedPath,
199
- query,
200
- body,
182
+ b.m("PUT")
183
+ .h(headers)
184
+ .q(query)
185
+ .b(body);
186
+ return b.build();
187
+ };
188
+ export const se_UpdateBotCallbackCommand = async (input, context) => {
189
+ const b = rb(input, context);
190
+ const headers = {
191
+ 'content-type': 'application/json',
192
+ };
193
+ b.bp("/v2/users/bots/{id}/callback");
194
+ b.p('id', () => input.id, '{id}', false);
195
+ const query = map({
196
+ [_c]: [, input[_c]],
201
197
  });
198
+ let body;
199
+ body = JSON.stringify(take(input, {
200
+ 'callback': _ => _json(_),
201
+ }));
202
+ b.m("PUT")
203
+ .h(headers)
204
+ .q(query)
205
+ .b(body);
206
+ return b.build();
202
207
  };
203
208
  export const se_VerifyBotSecretKeyCommand = async (input, context) => {
204
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
209
+ const b = rb(input, context);
205
210
  const headers = {
206
211
  'content-type': 'application/json',
207
212
  };
208
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/auth/VerifyBotSecretKey";
213
+ b.bp("/v2/users/auth/VerifyBotSecretKey");
209
214
  let body;
210
215
  body = JSON.stringify(take(input, {
211
216
  'secret': [],
212
217
  }));
213
- return new __HttpRequest({
214
- protocol,
215
- hostname,
216
- port,
217
- method: "POST",
218
- headers,
219
- path: resolvedPath,
220
- body,
221
- });
218
+ b.m("POST")
219
+ .h(headers)
220
+ .b(body);
221
+ return b.build();
222
222
  };
223
223
  export const de_BatchGetUsersPbxLinkDataCommand = async (output, context) => {
224
224
  if (output.statusCode !== 200 && output.statusCode >= 300) {
225
- return de_BatchGetUsersPbxLinkDataCommandError(output, context);
225
+ return de_CommandError(output, context);
226
226
  }
227
227
  const contents = map({
228
228
  $metadata: deserializeMetadata(output),
@@ -234,31 +234,9 @@ export const de_BatchGetUsersPbxLinkDataCommand = async (output, context) => {
234
234
  Object.assign(contents, doc);
235
235
  return contents;
236
236
  };
237
- const de_BatchGetUsersPbxLinkDataCommandError = async (output, context) => {
238
- const parsedOutput = {
239
- ...output,
240
- body: await parseErrorBody(output.body, context)
241
- };
242
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
243
- switch (errorCode) {
244
- case "ForbiddenException":
245
- case "smithy.framework#ForbiddenException":
246
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
247
- case "ValidationException":
248
- case "smithy.framework#ValidationException":
249
- throw await de_ValidationExceptionRes(parsedOutput, context);
250
- default:
251
- const parsedBody = parsedOutput.body;
252
- return throwDefaultError({
253
- output,
254
- parsedBody,
255
- errorCode
256
- });
257
- }
258
- };
259
237
  export const de_BatchGetUsersStreamLinkDataCommand = async (output, context) => {
260
238
  if (output.statusCode !== 200 && output.statusCode >= 300) {
261
- return de_BatchGetUsersStreamLinkDataCommandError(output, context);
239
+ return de_CommandError(output, context);
262
240
  }
263
241
  const contents = map({
264
242
  $metadata: deserializeMetadata(output),
@@ -270,31 +248,9 @@ export const de_BatchGetUsersStreamLinkDataCommand = async (output, context) =>
270
248
  Object.assign(contents, doc);
271
249
  return contents;
272
250
  };
273
- const de_BatchGetUsersStreamLinkDataCommandError = async (output, context) => {
274
- const parsedOutput = {
275
- ...output,
276
- body: await parseErrorBody(output.body, context)
277
- };
278
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
279
- switch (errorCode) {
280
- case "ForbiddenException":
281
- case "smithy.framework#ForbiddenException":
282
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
283
- case "ValidationException":
284
- case "smithy.framework#ValidationException":
285
- throw await de_ValidationExceptionRes(parsedOutput, context);
286
- default:
287
- const parsedBody = parsedOutput.body;
288
- return throwDefaultError({
289
- output,
290
- parsedBody,
291
- errorCode
292
- });
293
- }
294
- };
295
251
  export const de_CreateBotCommand = async (output, context) => {
296
252
  if (output.statusCode !== 200 && output.statusCode >= 300) {
297
- return de_CreateBotCommandError(output, context);
253
+ return de_CommandError(output, context);
298
254
  }
299
255
  const contents = map({
300
256
  $metadata: deserializeMetadata(output),
@@ -306,31 +262,9 @@ export const de_CreateBotCommand = async (output, context) => {
306
262
  Object.assign(contents, doc);
307
263
  return contents;
308
264
  };
309
- const de_CreateBotCommandError = async (output, context) => {
310
- const parsedOutput = {
311
- ...output,
312
- body: await parseErrorBody(output.body, context)
313
- };
314
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
315
- switch (errorCode) {
316
- case "ForbiddenException":
317
- case "smithy.framework#ForbiddenException":
318
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
319
- case "ValidationException":
320
- case "smithy.framework#ValidationException":
321
- throw await de_ValidationExceptionRes(parsedOutput, context);
322
- default:
323
- const parsedBody = parsedOutput.body;
324
- return throwDefaultError({
325
- output,
326
- parsedBody,
327
- errorCode
328
- });
329
- }
330
- };
331
265
  export const de_CreateBotApiKeyCommand = async (output, context) => {
332
266
  if (output.statusCode !== 200 && output.statusCode >= 300) {
333
- return de_CreateBotApiKeyCommandError(output, context);
267
+ return de_CommandError(output, context);
334
268
  }
335
269
  const contents = map({
336
270
  $metadata: deserializeMetadata(output),
@@ -343,31 +277,9 @@ export const de_CreateBotApiKeyCommand = async (output, context) => {
343
277
  Object.assign(contents, doc);
344
278
  return contents;
345
279
  };
346
- const de_CreateBotApiKeyCommandError = async (output, context) => {
347
- const parsedOutput = {
348
- ...output,
349
- body: await parseErrorBody(output.body, context)
350
- };
351
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
352
- switch (errorCode) {
353
- case "ForbiddenException":
354
- case "smithy.framework#ForbiddenException":
355
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
356
- case "ValidationException":
357
- case "smithy.framework#ValidationException":
358
- throw await de_ValidationExceptionRes(parsedOutput, context);
359
- default:
360
- const parsedBody = parsedOutput.body;
361
- return throwDefaultError({
362
- output,
363
- parsedBody,
364
- errorCode
365
- });
366
- }
367
- };
368
280
  export const de_DeleteBotCommand = async (output, context) => {
369
281
  if (output.statusCode !== 200 && output.statusCode >= 300) {
370
- return de_DeleteBotCommandError(output, context);
282
+ return de_CommandError(output, context);
371
283
  }
372
284
  const contents = map({
373
285
  $metadata: deserializeMetadata(output),
@@ -375,34 +287,9 @@ export const de_DeleteBotCommand = async (output, context) => {
375
287
  await collectBody(output.body, context);
376
288
  return contents;
377
289
  };
378
- const de_DeleteBotCommandError = async (output, context) => {
379
- const parsedOutput = {
380
- ...output,
381
- body: await parseErrorBody(output.body, context)
382
- };
383
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
384
- switch (errorCode) {
385
- case "BotNotFoundException":
386
- case "wildix.xbees.users#BotNotFoundException":
387
- throw await de_BotNotFoundExceptionRes(parsedOutput, context);
388
- case "ForbiddenException":
389
- case "smithy.framework#ForbiddenException":
390
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
391
- case "ValidationException":
392
- case "smithy.framework#ValidationException":
393
- throw await de_ValidationExceptionRes(parsedOutput, context);
394
- default:
395
- const parsedBody = parsedOutput.body;
396
- return throwDefaultError({
397
- output,
398
- parsedBody,
399
- errorCode
400
- });
401
- }
402
- };
403
290
  export const de_DeleteBotApiKeyCommand = async (output, context) => {
404
291
  if (output.statusCode !== 200 && output.statusCode >= 300) {
405
- return de_DeleteBotApiKeyCommandError(output, context);
292
+ return de_CommandError(output, context);
406
293
  }
407
294
  const contents = map({
408
295
  $metadata: deserializeMetadata(output),
@@ -410,73 +297,51 @@ export const de_DeleteBotApiKeyCommand = async (output, context) => {
410
297
  await collectBody(output.body, context);
411
298
  return contents;
412
299
  };
413
- const de_DeleteBotApiKeyCommandError = async (output, context) => {
414
- const parsedOutput = {
415
- ...output,
416
- body: await parseErrorBody(output.body, context)
417
- };
418
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
419
- switch (errorCode) {
420
- case "BotApiKeyNotFoundException":
421
- case "wildix.xbees.users#BotApiKeyNotFoundException":
422
- throw await de_BotApiKeyNotFoundExceptionRes(parsedOutput, context);
423
- case "BotNotFoundException":
424
- case "wildix.xbees.users#BotNotFoundException":
425
- throw await de_BotNotFoundExceptionRes(parsedOutput, context);
426
- case "ForbiddenException":
427
- case "smithy.framework#ForbiddenException":
428
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
429
- case "ValidationException":
430
- case "smithy.framework#ValidationException":
431
- throw await de_ValidationExceptionRes(parsedOutput, context);
432
- default:
433
- const parsedBody = parsedOutput.body;
434
- return throwDefaultError({
435
- output,
436
- parsedBody,
437
- errorCode
438
- });
300
+ export const de_GetBotCommand = async (output, context) => {
301
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
302
+ return de_CommandError(output, context);
439
303
  }
304
+ const contents = map({
305
+ $metadata: deserializeMetadata(output),
306
+ });
307
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
308
+ const doc = take(data, {
309
+ 'bot': _json,
310
+ });
311
+ Object.assign(contents, doc);
312
+ return contents;
440
313
  };
441
- export const de_ListBotApiKeysCommand = async (output, context) => {
314
+ export const de_GetBotCallbackCommand = async (output, context) => {
442
315
  if (output.statusCode !== 200 && output.statusCode >= 300) {
443
- return de_ListBotApiKeysCommandError(output, context);
316
+ return de_CommandError(output, context);
444
317
  }
445
318
  const contents = map({
446
319
  $metadata: deserializeMetadata(output),
447
320
  });
448
321
  const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
449
322
  const doc = take(data, {
450
- 'keys': _json,
323
+ 'callback': _json,
451
324
  });
452
325
  Object.assign(contents, doc);
453
326
  return contents;
454
327
  };
455
- const de_ListBotApiKeysCommandError = async (output, context) => {
456
- const parsedOutput = {
457
- ...output,
458
- body: await parseErrorBody(output.body, context)
459
- };
460
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
461
- switch (errorCode) {
462
- case "ForbiddenException":
463
- case "smithy.framework#ForbiddenException":
464
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
465
- case "ValidationException":
466
- case "smithy.framework#ValidationException":
467
- throw await de_ValidationExceptionRes(parsedOutput, context);
468
- default:
469
- const parsedBody = parsedOutput.body;
470
- return throwDefaultError({
471
- output,
472
- parsedBody,
473
- errorCode
474
- });
328
+ export const de_ListBotApiKeysCommand = async (output, context) => {
329
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
330
+ return de_CommandError(output, context);
475
331
  }
332
+ const contents = map({
333
+ $metadata: deserializeMetadata(output),
334
+ });
335
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
336
+ const doc = take(data, {
337
+ 'keys': _json,
338
+ });
339
+ Object.assign(contents, doc);
340
+ return contents;
476
341
  };
477
342
  export const de_ListBotsCommand = async (output, context) => {
478
343
  if (output.statusCode !== 200 && output.statusCode >= 300) {
479
- return de_ListBotsCommandError(output, context);
344
+ return de_CommandError(output, context);
480
345
  }
481
346
  const contents = map({
482
347
  $metadata: deserializeMetadata(output),
@@ -488,31 +353,9 @@ export const de_ListBotsCommand = async (output, context) => {
488
353
  Object.assign(contents, doc);
489
354
  return contents;
490
355
  };
491
- const de_ListBotsCommandError = async (output, context) => {
492
- const parsedOutput = {
493
- ...output,
494
- body: await parseErrorBody(output.body, context)
495
- };
496
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
497
- switch (errorCode) {
498
- case "ForbiddenException":
499
- case "smithy.framework#ForbiddenException":
500
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
501
- case "ValidationException":
502
- case "smithy.framework#ValidationException":
503
- throw await de_ValidationExceptionRes(parsedOutput, context);
504
- default:
505
- const parsedBody = parsedOutput.body;
506
- return throwDefaultError({
507
- output,
508
- parsedBody,
509
- errorCode
510
- });
511
- }
512
- };
513
356
  export const de_UpdateBotCommand = async (output, context) => {
514
357
  if (output.statusCode !== 200 && output.statusCode >= 300) {
515
- return de_UpdateBotCommandError(output, context);
358
+ return de_CommandError(output, context);
516
359
  }
517
360
  const contents = map({
518
361
  $metadata: deserializeMetadata(output),
@@ -524,31 +367,23 @@ export const de_UpdateBotCommand = async (output, context) => {
524
367
  Object.assign(contents, doc);
525
368
  return contents;
526
369
  };
527
- const de_UpdateBotCommandError = async (output, context) => {
528
- const parsedOutput = {
529
- ...output,
530
- body: await parseErrorBody(output.body, context)
531
- };
532
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
533
- switch (errorCode) {
534
- case "ForbiddenException":
535
- case "smithy.framework#ForbiddenException":
536
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
537
- case "ValidationException":
538
- case "smithy.framework#ValidationException":
539
- throw await de_ValidationExceptionRes(parsedOutput, context);
540
- default:
541
- const parsedBody = parsedOutput.body;
542
- return throwDefaultError({
543
- output,
544
- parsedBody,
545
- errorCode
546
- });
370
+ export const de_UpdateBotCallbackCommand = async (output, context) => {
371
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
372
+ return de_CommandError(output, context);
547
373
  }
374
+ const contents = map({
375
+ $metadata: deserializeMetadata(output),
376
+ });
377
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
378
+ const doc = take(data, {
379
+ 'callback': _json,
380
+ });
381
+ Object.assign(contents, doc);
382
+ return contents;
548
383
  };
549
384
  export const de_VerifyBotSecretKeyCommand = async (output, context) => {
550
385
  if (output.statusCode !== 200 && output.statusCode >= 300) {
551
- return de_VerifyBotSecretKeyCommandError(output, context);
386
+ return de_CommandError(output, context);
552
387
  }
553
388
  const contents = map({
554
389
  $metadata: deserializeMetadata(output),
@@ -562,22 +397,28 @@ export const de_VerifyBotSecretKeyCommand = async (output, context) => {
562
397
  Object.assign(contents, doc);
563
398
  return contents;
564
399
  };
565
- const de_VerifyBotSecretKeyCommandError = async (output, context) => {
400
+ const de_CommandError = async (output, context) => {
566
401
  const parsedOutput = {
567
402
  ...output,
568
403
  body: await parseErrorBody(output.body, context)
569
404
  };
570
405
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
571
406
  switch (errorCode) {
572
- case "BotSecretKeyNotValidException":
573
- case "wildix.xbees.users#BotSecretKeyNotValidException":
574
- throw await de_BotSecretKeyNotValidExceptionRes(parsedOutput, context);
575
407
  case "ForbiddenException":
576
408
  case "smithy.framework#ForbiddenException":
577
409
  throw await de_ForbiddenExceptionRes(parsedOutput, context);
578
410
  case "ValidationException":
579
411
  case "smithy.framework#ValidationException":
580
412
  throw await de_ValidationExceptionRes(parsedOutput, context);
413
+ case "BotNotFoundException":
414
+ case "wildix.xbees.users#BotNotFoundException":
415
+ throw await de_BotNotFoundExceptionRes(parsedOutput, context);
416
+ case "BotApiKeyNotFoundException":
417
+ case "wildix.xbees.users#BotApiKeyNotFoundException":
418
+ throw await de_BotApiKeyNotFoundExceptionRes(parsedOutput, context);
419
+ case "BotSecretKeyNotValidException":
420
+ case "wildix.xbees.users#BotSecretKeyNotValidException":
421
+ throw await de_BotSecretKeyNotValidExceptionRes(parsedOutput, context);
581
422
  default:
582
423
  const parsedBody = parsedOutput.body;
583
424
  return throwDefaultError({
@@ -666,6 +507,7 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
666
507
  (!Object.getOwnPropertyNames(value).includes("length") ||
667
508
  value.length != 0) &&
668
509
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
510
+ const _c = "company";
669
511
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then(encoded => {
670
512
  if (encoded.length) {
671
513
  return JSON.parse(encoded);