@wildix/xbees-users-client 1.0.7 → 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 +7 -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 +7 -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 +18 -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 +3 -4
  63. package/dist-types/runtimeConfig.d.ts +3 -4
  64. package/dist-types/runtimeConfig.native.d.ts +3 -4
  65. package/package.json +32 -31
@@ -1,241 +1,244 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
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;
3
+ exports.de_VerifyBotSecretKeyCommand = exports.de_UpdateBotCallbackCommand = exports.de_UpdateBotCommand = exports.de_ListBotsCommand = exports.de_ListBotApiKeysCommand = exports.de_GetBotCallbackCommand = exports.de_GetBotCommand = exports.de_DeleteBotApiKeyCommand = exports.de_DeleteBotCommand = exports.de_CreateBotApiKeyCommand = exports.de_CreateBotCommand = exports.de_BatchGetUsersStreamLinkDataCommand = exports.de_BatchGetUsersPbxLinkDataCommand = exports.se_VerifyBotSecretKeyCommand = exports.se_UpdateBotCallbackCommand = exports.se_UpdateBotCommand = exports.se_ListBotsCommand = exports.se_ListBotApiKeysCommand = exports.se_GetBotCallbackCommand = exports.se_GetBotCommand = 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
- const protocol_http_1 = require("@smithy/protocol-http");
6
+ const core_1 = require("@smithy/core");
7
7
  const smithy_client_1 = require("@smithy/smithy-client");
8
8
  const se_BatchGetUsersPbxLinkDataCommand = async (input, context) => {
9
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
9
+ const b = (0, core_1.requestBuilder)(input, context);
10
10
  const headers = {
11
11
  'content-type': 'application/json',
12
12
  };
13
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/BatchGetUsersPbxLinkData";
13
+ b.bp("/v2/users/BatchGetUsersPbxLinkData");
14
14
  let body;
15
15
  body = JSON.stringify((0, smithy_client_1.take)(input, {
16
16
  'id': _ => (0, smithy_client_1._json)(_),
17
17
  }));
18
- return new protocol_http_1.HttpRequest({
19
- protocol,
20
- hostname,
21
- port,
22
- method: "POST",
23
- headers,
24
- path: resolvedPath,
25
- body,
26
- });
18
+ b.m("POST")
19
+ .h(headers)
20
+ .b(body);
21
+ return b.build();
27
22
  };
28
23
  exports.se_BatchGetUsersPbxLinkDataCommand = se_BatchGetUsersPbxLinkDataCommand;
29
24
  const se_BatchGetUsersStreamLinkDataCommand = async (input, context) => {
30
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
25
+ const b = (0, core_1.requestBuilder)(input, context);
31
26
  const headers = {
32
27
  'content-type': 'application/json',
33
28
  };
34
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v1/users/BatchGetUsersStreamLinkData";
29
+ b.bp("/v1/users/BatchGetUsersStreamLinkData");
35
30
  let body;
36
31
  body = JSON.stringify((0, smithy_client_1.take)(input, {
37
32
  'id': _ => (0, smithy_client_1._json)(_),
38
33
  }));
39
- return new protocol_http_1.HttpRequest({
40
- protocol,
41
- hostname,
42
- port,
43
- method: "POST",
44
- headers,
45
- path: resolvedPath,
46
- body,
47
- });
34
+ b.m("POST")
35
+ .h(headers)
36
+ .b(body);
37
+ return b.build();
48
38
  };
49
39
  exports.se_BatchGetUsersStreamLinkDataCommand = se_BatchGetUsersStreamLinkDataCommand;
50
40
  const se_CreateBotCommand = async (input, context) => {
51
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
41
+ const b = (0, core_1.requestBuilder)(input, context);
52
42
  const headers = {
53
43
  'content-type': 'application/json',
54
44
  };
55
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots";
45
+ b.bp("/v2/users/bots");
56
46
  const query = (0, smithy_client_1.map)({
57
- "company": [, input.company],
47
+ [_c]: [, input[_c]],
58
48
  });
59
49
  let body;
60
50
  body = JSON.stringify((0, smithy_client_1.take)(input, {
61
51
  'callback': _ => (0, smithy_client_1._json)(_),
62
52
  'name': [],
63
- 'visibility': _ => (0, smithy_client_1._json)(_),
53
+ 'picture': [],
64
54
  }));
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
- });
55
+ b.m("POST")
56
+ .h(headers)
57
+ .q(query)
58
+ .b(body);
59
+ return b.build();
75
60
  };
76
61
  exports.se_CreateBotCommand = se_CreateBotCommand;
77
62
  const se_CreateBotApiKeyCommand = async (input, context) => {
78
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
63
+ const b = (0, core_1.requestBuilder)(input, context);
79
64
  const headers = {
80
65
  'content-type': 'application/json',
81
66
  };
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);
67
+ b.bp("/v2/users/bots/{botId}/keys");
68
+ b.p('botId', () => input.botId, '{botId}', false);
84
69
  const query = (0, smithy_client_1.map)({
85
- "company": [, input.company],
70
+ [_c]: [, input[_c]],
86
71
  });
87
72
  let body;
88
73
  body = JSON.stringify((0, smithy_client_1.take)(input, {
89
74
  'name': [],
90
75
  }));
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
- });
76
+ b.m("POST")
77
+ .h(headers)
78
+ .q(query)
79
+ .b(body);
80
+ return b.build();
101
81
  };
102
82
  exports.se_CreateBotApiKeyCommand = se_CreateBotApiKeyCommand;
103
83
  const se_DeleteBotCommand = async (input, context) => {
104
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
84
+ const b = (0, core_1.requestBuilder)(input, context);
105
85
  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);
86
+ b.bp("/v2/users/bots/{botId}");
87
+ b.p('botId', () => input.botId, '{botId}', false);
108
88
  const query = (0, smithy_client_1.map)({
109
- "company": [, input.company],
89
+ [_c]: [, input[_c]],
110
90
  });
111
91
  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
- });
92
+ b.m("DELETE")
93
+ .h(headers)
94
+ .q(query)
95
+ .b(body);
96
+ return b.build();
122
97
  };
123
98
  exports.se_DeleteBotCommand = se_DeleteBotCommand;
124
99
  const se_DeleteBotApiKeyCommand = async (input, context) => {
125
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
100
+ const b = (0, core_1.requestBuilder)(input, context);
126
101
  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);
102
+ b.bp("/v2/users/bots/{botId}/keys/{apiKeySecret}");
103
+ b.p('botId', () => input.botId, '{botId}', false);
104
+ b.p('apiKeySecret', () => input.apiKeySecret, '{apiKeySecret}', false);
130
105
  const query = (0, smithy_client_1.map)({
131
- "company": [, input.company],
106
+ [_c]: [, input[_c]],
132
107
  });
133
108
  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
- });
109
+ b.m("DELETE")
110
+ .h(headers)
111
+ .q(query)
112
+ .b(body);
113
+ return b.build();
144
114
  };
145
115
  exports.se_DeleteBotApiKeyCommand = se_DeleteBotApiKeyCommand;
146
- const se_ListBotApiKeysCommand = async (input, context) => {
147
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
116
+ const se_GetBotCommand = async (input, context) => {
117
+ const b = (0, core_1.requestBuilder)(input, context);
148
118
  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);
119
+ b.bp("/v2/users/bots/{id}");
120
+ b.p('id', () => input.id, '{id}', false);
151
121
  const query = (0, smithy_client_1.map)({
152
- "company": [, input.company],
122
+ [_c]: [, input[_c]],
153
123
  });
154
124
  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,
125
+ b.m("GET")
126
+ .h(headers)
127
+ .q(query)
128
+ .b(body);
129
+ return b.build();
130
+ };
131
+ exports.se_GetBotCommand = se_GetBotCommand;
132
+ const se_GetBotCallbackCommand = async (input, context) => {
133
+ const b = (0, core_1.requestBuilder)(input, context);
134
+ const headers = {};
135
+ b.bp("/v2/users/bots/{id}/callback");
136
+ b.p('id', () => input.id, '{id}', false);
137
+ const query = (0, smithy_client_1.map)({
138
+ [_c]: [, input[_c]],
164
139
  });
140
+ let body;
141
+ b.m("GET")
142
+ .h(headers)
143
+ .q(query)
144
+ .b(body);
145
+ return b.build();
146
+ };
147
+ exports.se_GetBotCallbackCommand = se_GetBotCallbackCommand;
148
+ const se_ListBotApiKeysCommand = async (input, context) => {
149
+ const b = (0, core_1.requestBuilder)(input, context);
150
+ const headers = {};
151
+ b.bp("/v2/users/bots/{botId}/keys");
152
+ b.p('botId', () => input.botId, '{botId}', false);
153
+ const query = (0, smithy_client_1.map)({
154
+ [_c]: [, input[_c]],
155
+ });
156
+ let body;
157
+ b.m("GET")
158
+ .h(headers)
159
+ .q(query)
160
+ .b(body);
161
+ return b.build();
165
162
  };
166
163
  exports.se_ListBotApiKeysCommand = se_ListBotApiKeysCommand;
167
164
  const se_ListBotsCommand = async (input, context) => {
168
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
165
+ const b = (0, core_1.requestBuilder)(input, context);
169
166
  const headers = {};
170
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/bots";
167
+ b.bp("/v2/users/bots");
171
168
  const query = (0, smithy_client_1.map)({
172
- "company": [, input.company],
169
+ [_c]: [, input[_c]],
173
170
  });
174
171
  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
- });
172
+ b.m("GET")
173
+ .h(headers)
174
+ .q(query)
175
+ .b(body);
176
+ return b.build();
185
177
  };
186
178
  exports.se_ListBotsCommand = se_ListBotsCommand;
187
179
  const se_UpdateBotCommand = async (input, context) => {
188
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
180
+ const b = (0, core_1.requestBuilder)(input, context);
189
181
  const headers = {
190
182
  'content-type': 'application/json',
191
183
  };
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);
184
+ b.bp("/v2/users/bots/{id}");
185
+ b.p('id', () => input.id, '{id}', false);
194
186
  const query = (0, smithy_client_1.map)({
195
- "company": [, input.company],
187
+ [_c]: [, input[_c]],
196
188
  });
197
189
  let body;
198
190
  body = JSON.stringify((0, smithy_client_1.take)(input, {
199
- 'callback': _ => (0, smithy_client_1._json)(_),
200
191
  'name': [],
201
- 'visibility': _ => (0, smithy_client_1._json)(_),
192
+ 'picture': [],
193
+ 'searchable': [],
202
194
  }));
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
- });
195
+ b.m("PUT")
196
+ .h(headers)
197
+ .q(query)
198
+ .b(body);
199
+ return b.build();
213
200
  };
214
201
  exports.se_UpdateBotCommand = se_UpdateBotCommand;
202
+ const se_UpdateBotCallbackCommand = async (input, context) => {
203
+ const b = (0, core_1.requestBuilder)(input, context);
204
+ const headers = {
205
+ 'content-type': 'application/json',
206
+ };
207
+ b.bp("/v2/users/bots/{id}/callback");
208
+ b.p('id', () => input.id, '{id}', false);
209
+ const query = (0, smithy_client_1.map)({
210
+ [_c]: [, input[_c]],
211
+ });
212
+ let body;
213
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
214
+ 'callback': _ => (0, smithy_client_1._json)(_),
215
+ }));
216
+ b.m("PUT")
217
+ .h(headers)
218
+ .q(query)
219
+ .b(body);
220
+ return b.build();
221
+ };
222
+ exports.se_UpdateBotCallbackCommand = se_UpdateBotCallbackCommand;
215
223
  const se_VerifyBotSecretKeyCommand = async (input, context) => {
216
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
224
+ const b = (0, core_1.requestBuilder)(input, context);
217
225
  const headers = {
218
226
  'content-type': 'application/json',
219
227
  };
220
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v2/users/auth/VerifyBotSecretKey";
228
+ b.bp("/v2/users/auth/VerifyBotSecretKey");
221
229
  let body;
222
230
  body = JSON.stringify((0, smithy_client_1.take)(input, {
223
231
  'secret': [],
224
232
  }));
225
- return new protocol_http_1.HttpRequest({
226
- protocol,
227
- hostname,
228
- port,
229
- method: "POST",
230
- headers,
231
- path: resolvedPath,
232
- body,
233
- });
233
+ b.m("POST")
234
+ .h(headers)
235
+ .b(body);
236
+ return b.build();
234
237
  };
235
238
  exports.se_VerifyBotSecretKeyCommand = se_VerifyBotSecretKeyCommand;
236
239
  const de_BatchGetUsersPbxLinkDataCommand = async (output, context) => {
237
240
  if (output.statusCode !== 200 && output.statusCode >= 300) {
238
- return de_BatchGetUsersPbxLinkDataCommandError(output, context);
241
+ return de_CommandError(output, context);
239
242
  }
240
243
  const contents = (0, smithy_client_1.map)({
241
244
  $metadata: deserializeMetadata(output),
@@ -248,31 +251,9 @@ const de_BatchGetUsersPbxLinkDataCommand = async (output, context) => {
248
251
  return contents;
249
252
  };
250
253
  exports.de_BatchGetUsersPbxLinkDataCommand = de_BatchGetUsersPbxLinkDataCommand;
251
- const de_BatchGetUsersPbxLinkDataCommandError = async (output, context) => {
252
- const parsedOutput = {
253
- ...output,
254
- body: await parseErrorBody(output.body, context)
255
- };
256
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
257
- switch (errorCode) {
258
- case "ForbiddenException":
259
- case "smithy.framework#ForbiddenException":
260
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
261
- case "ValidationException":
262
- case "smithy.framework#ValidationException":
263
- throw await de_ValidationExceptionRes(parsedOutput, context);
264
- default:
265
- const parsedBody = parsedOutput.body;
266
- return throwDefaultError({
267
- output,
268
- parsedBody,
269
- errorCode
270
- });
271
- }
272
- };
273
254
  const de_BatchGetUsersStreamLinkDataCommand = async (output, context) => {
274
255
  if (output.statusCode !== 200 && output.statusCode >= 300) {
275
- return de_BatchGetUsersStreamLinkDataCommandError(output, context);
256
+ return de_CommandError(output, context);
276
257
  }
277
258
  const contents = (0, smithy_client_1.map)({
278
259
  $metadata: deserializeMetadata(output),
@@ -285,31 +266,9 @@ const de_BatchGetUsersStreamLinkDataCommand = async (output, context) => {
285
266
  return contents;
286
267
  };
287
268
  exports.de_BatchGetUsersStreamLinkDataCommand = de_BatchGetUsersStreamLinkDataCommand;
288
- const de_BatchGetUsersStreamLinkDataCommandError = async (output, context) => {
289
- const parsedOutput = {
290
- ...output,
291
- body: await parseErrorBody(output.body, context)
292
- };
293
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
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
269
  const de_CreateBotCommand = async (output, context) => {
311
270
  if (output.statusCode !== 200 && output.statusCode >= 300) {
312
- return de_CreateBotCommandError(output, context);
271
+ return de_CommandError(output, context);
313
272
  }
314
273
  const contents = (0, smithy_client_1.map)({
315
274
  $metadata: deserializeMetadata(output),
@@ -322,31 +281,9 @@ const de_CreateBotCommand = async (output, context) => {
322
281
  return contents;
323
282
  };
324
283
  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
284
  const de_CreateBotApiKeyCommand = async (output, context) => {
348
285
  if (output.statusCode !== 200 && output.statusCode >= 300) {
349
- return de_CreateBotApiKeyCommandError(output, context);
286
+ return de_CommandError(output, context);
350
287
  }
351
288
  const contents = (0, smithy_client_1.map)({
352
289
  $metadata: deserializeMetadata(output),
@@ -360,31 +297,9 @@ const de_CreateBotApiKeyCommand = async (output, context) => {
360
297
  return contents;
361
298
  };
362
299
  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
300
  const de_DeleteBotCommand = async (output, context) => {
386
301
  if (output.statusCode !== 200 && output.statusCode >= 300) {
387
- return de_DeleteBotCommandError(output, context);
302
+ return de_CommandError(output, context);
388
303
  }
389
304
  const contents = (0, smithy_client_1.map)({
390
305
  $metadata: deserializeMetadata(output),
@@ -393,34 +308,9 @@ const de_DeleteBotCommand = async (output, context) => {
393
308
  return contents;
394
309
  };
395
310
  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
311
  const de_DeleteBotApiKeyCommand = async (output, context) => {
422
312
  if (output.statusCode !== 200 && output.statusCode >= 300) {
423
- return de_DeleteBotApiKeyCommandError(output, context);
313
+ return de_CommandError(output, context);
424
314
  }
425
315
  const contents = (0, smithy_client_1.map)({
426
316
  $metadata: deserializeMetadata(output),
@@ -429,37 +319,39 @@ const de_DeleteBotApiKeyCommand = async (output, context) => {
429
319
  return contents;
430
320
  };
431
321
  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
- });
322
+ const de_GetBotCommand = async (output, context) => {
323
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
324
+ return de_CommandError(output, context);
458
325
  }
326
+ const contents = (0, smithy_client_1.map)({
327
+ $metadata: deserializeMetadata(output),
328
+ });
329
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
330
+ const doc = (0, smithy_client_1.take)(data, {
331
+ 'bot': smithy_client_1._json,
332
+ });
333
+ Object.assign(contents, doc);
334
+ return contents;
335
+ };
336
+ exports.de_GetBotCommand = de_GetBotCommand;
337
+ const de_GetBotCallbackCommand = async (output, context) => {
338
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
339
+ return de_CommandError(output, context);
340
+ }
341
+ const contents = (0, smithy_client_1.map)({
342
+ $metadata: deserializeMetadata(output),
343
+ });
344
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
345
+ const doc = (0, smithy_client_1.take)(data, {
346
+ 'callback': smithy_client_1._json,
347
+ });
348
+ Object.assign(contents, doc);
349
+ return contents;
459
350
  };
351
+ exports.de_GetBotCallbackCommand = de_GetBotCallbackCommand;
460
352
  const de_ListBotApiKeysCommand = async (output, context) => {
461
353
  if (output.statusCode !== 200 && output.statusCode >= 300) {
462
- return de_ListBotApiKeysCommandError(output, context);
354
+ return de_CommandError(output, context);
463
355
  }
464
356
  const contents = (0, smithy_client_1.map)({
465
357
  $metadata: deserializeMetadata(output),
@@ -472,31 +364,9 @@ const de_ListBotApiKeysCommand = async (output, context) => {
472
364
  return contents;
473
365
  };
474
366
  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
367
  const de_ListBotsCommand = async (output, context) => {
498
368
  if (output.statusCode !== 200 && output.statusCode >= 300) {
499
- return de_ListBotsCommandError(output, context);
369
+ return de_CommandError(output, context);
500
370
  }
501
371
  const contents = (0, smithy_client_1.map)({
502
372
  $metadata: deserializeMetadata(output),
@@ -509,31 +379,9 @@ const de_ListBotsCommand = async (output, context) => {
509
379
  return contents;
510
380
  };
511
381
  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
382
  const de_UpdateBotCommand = async (output, context) => {
535
383
  if (output.statusCode !== 200 && output.statusCode >= 300) {
536
- return de_UpdateBotCommandError(output, context);
384
+ return de_CommandError(output, context);
537
385
  }
538
386
  const contents = (0, smithy_client_1.map)({
539
387
  $metadata: deserializeMetadata(output),
@@ -546,31 +394,24 @@ const de_UpdateBotCommand = async (output, context) => {
546
394
  return contents;
547
395
  };
548
396
  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
- });
397
+ const de_UpdateBotCallbackCommand = async (output, context) => {
398
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
399
+ return de_CommandError(output, context);
569
400
  }
401
+ const contents = (0, smithy_client_1.map)({
402
+ $metadata: deserializeMetadata(output),
403
+ });
404
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
405
+ const doc = (0, smithy_client_1.take)(data, {
406
+ 'callback': smithy_client_1._json,
407
+ });
408
+ Object.assign(contents, doc);
409
+ return contents;
570
410
  };
411
+ exports.de_UpdateBotCallbackCommand = de_UpdateBotCallbackCommand;
571
412
  const de_VerifyBotSecretKeyCommand = async (output, context) => {
572
413
  if (output.statusCode !== 200 && output.statusCode >= 300) {
573
- return de_VerifyBotSecretKeyCommandError(output, context);
414
+ return de_CommandError(output, context);
574
415
  }
575
416
  const contents = (0, smithy_client_1.map)({
576
417
  $metadata: deserializeMetadata(output),
@@ -585,22 +426,28 @@ const de_VerifyBotSecretKeyCommand = async (output, context) => {
585
426
  return contents;
586
427
  };
587
428
  exports.de_VerifyBotSecretKeyCommand = de_VerifyBotSecretKeyCommand;
588
- const de_VerifyBotSecretKeyCommandError = async (output, context) => {
429
+ const de_CommandError = async (output, context) => {
589
430
  const parsedOutput = {
590
431
  ...output,
591
432
  body: await parseErrorBody(output.body, context)
592
433
  };
593
434
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
594
435
  switch (errorCode) {
595
- case "BotSecretKeyNotValidException":
596
- case "wildix.xbees.users#BotSecretKeyNotValidException":
597
- throw await de_BotSecretKeyNotValidExceptionRes(parsedOutput, context);
598
436
  case "ForbiddenException":
599
437
  case "smithy.framework#ForbiddenException":
600
438
  throw await de_ForbiddenExceptionRes(parsedOutput, context);
601
439
  case "ValidationException":
602
440
  case "smithy.framework#ValidationException":
603
441
  throw await de_ValidationExceptionRes(parsedOutput, context);
442
+ case "BotNotFoundException":
443
+ case "wildix.xbees.users#BotNotFoundException":
444
+ throw await de_BotNotFoundExceptionRes(parsedOutput, context);
445
+ case "BotApiKeyNotFoundException":
446
+ case "wildix.xbees.users#BotApiKeyNotFoundException":
447
+ throw await de_BotApiKeyNotFoundExceptionRes(parsedOutput, context);
448
+ case "BotSecretKeyNotValidException":
449
+ case "wildix.xbees.users#BotSecretKeyNotValidException":
450
+ throw await de_BotSecretKeyNotValidExceptionRes(parsedOutput, context);
604
451
  default:
605
452
  const parsedBody = parsedOutput.body;
606
453
  return throwDefaultError({
@@ -689,6 +536,7 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
689
536
  (!Object.getOwnPropertyNames(value).includes("length") ||
690
537
  value.length != 0) &&
691
538
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
539
+ const _c = "company";
692
540
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then(encoded => {
693
541
  if (encoded.length) {
694
542
  return JSON.parse(encoded);