@wildix/wms-api-client 1.1.2 → 1.1.4

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 (53) hide show
  1. package/dist-cjs/WmsApi.js +4 -0
  2. package/dist-cjs/WmsApiClient.js +6 -3
  3. package/dist-cjs/commands/CreatePbxColleagueCommand.js +21 -0
  4. package/dist-cjs/commands/CreatePbxOAuth2ClientCommand.js +12 -32
  5. package/dist-cjs/commands/DeletePbxColleagueCommand.js +21 -0
  6. package/dist-cjs/commands/DeletePbxOAuth2ClientCommand.js +12 -32
  7. package/dist-cjs/commands/GetPbxAclGroupsPermissionsCommand.js +12 -32
  8. package/dist-cjs/commands/GetPbxCallGroupsCommand.js +12 -32
  9. package/dist-cjs/commands/GetPbxColleaguesCommand.js +12 -32
  10. package/dist-cjs/commands/GetPbxOAuth2ClientsCommand.js +12 -32
  11. package/dist-cjs/commands/UpdatePbxOAuth2ClientCommand.js +12 -32
  12. package/dist-cjs/commands/index.js +2 -0
  13. package/dist-cjs/models/models_0.js +29 -14
  14. package/dist-cjs/protocols/Aws_restJson1.js +220 -236
  15. package/dist-cjs/runtimeConfig.browser.js +5 -1
  16. package/dist-cjs/runtimeConfig.js +5 -1
  17. package/dist-cjs/runtimeConfig.shared.js +13 -11
  18. package/dist-es/WmsApi.js +4 -0
  19. package/dist-es/WmsApiClient.js +6 -3
  20. package/dist-es/commands/CreatePbxColleagueCommand.js +17 -0
  21. package/dist-es/commands/CreatePbxOAuth2ClientCommand.js +12 -32
  22. package/dist-es/commands/DeletePbxColleagueCommand.js +17 -0
  23. package/dist-es/commands/DeletePbxOAuth2ClientCommand.js +12 -32
  24. package/dist-es/commands/GetPbxAclGroupsPermissionsCommand.js +12 -32
  25. package/dist-es/commands/GetPbxCallGroupsCommand.js +12 -32
  26. package/dist-es/commands/GetPbxColleaguesCommand.js +12 -32
  27. package/dist-es/commands/GetPbxOAuth2ClientsCommand.js +12 -32
  28. package/dist-es/commands/UpdatePbxOAuth2ClientCommand.js +12 -32
  29. package/dist-es/commands/index.js +2 -0
  30. package/dist-es/models/models_0.js +28 -13
  31. package/dist-es/protocols/Aws_restJson1.js +214 -234
  32. package/dist-es/runtimeConfig.browser.js +4 -1
  33. package/dist-es/runtimeConfig.js +4 -1
  34. package/dist-es/runtimeConfig.shared.js +13 -11
  35. package/dist-types/WmsApi.d.ts +18 -0
  36. package/dist-types/WmsApiClient.d.ts +17 -9
  37. package/dist-types/commands/CreatePbxColleagueCommand.d.ts +96 -0
  38. package/dist-types/commands/CreatePbxOAuth2ClientCommand.d.ts +8 -20
  39. package/dist-types/commands/DeletePbxColleagueCommand.d.ts +65 -0
  40. package/dist-types/commands/DeletePbxOAuth2ClientCommand.d.ts +8 -20
  41. package/dist-types/commands/GetPbxAclGroupsPermissionsCommand.d.ts +7 -19
  42. package/dist-types/commands/GetPbxCallGroupsCommand.d.ts +8 -20
  43. package/dist-types/commands/GetPbxColleaguesCommand.d.ts +7 -19
  44. package/dist-types/commands/GetPbxOAuth2ClientsCommand.d.ts +8 -20
  45. package/dist-types/commands/UpdatePbxOAuth2ClientCommand.d.ts +8 -20
  46. package/dist-types/commands/index.d.ts +2 -0
  47. package/dist-types/index.d.ts +2 -0
  48. package/dist-types/models/models_0.d.ts +154 -70
  49. package/dist-types/protocols/Aws_restJson1.d.ts +18 -0
  50. package/dist-types/runtimeConfig.browser.d.ts +3 -4
  51. package/dist-types/runtimeConfig.d.ts +3 -4
  52. package/dist-types/runtimeConfig.native.d.ts +3 -4
  53. package/package.json +31 -30
@@ -1,165 +1,209 @@
1
1
  import { WmsApiServiceException as __BaseException } from "../models/WmsApiServiceException";
2
2
  import { WmsNotFoundException, WmsUnauthorizedException, WmsValidationException, } 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
+ export const se_CreatePbxColleagueCommand = async (input, context) => {
6
+ const b = rb(input, context);
7
+ const headers = {
8
+ 'content-type': 'application/json',
9
+ };
10
+ b.bp("/api/v1/PBX/Colleagues");
11
+ let body;
12
+ body = JSON.stringify(take(input, {
13
+ 'department': [],
14
+ 'dialplan': [],
15
+ 'email': [],
16
+ 'extension': [],
17
+ 'faxDialplan': [],
18
+ 'faxNumber': [],
19
+ 'groupDn': [],
20
+ 'language': [],
21
+ 'licenseType': [],
22
+ 'login': [],
23
+ 'mobilePhone': [],
24
+ 'name': [],
25
+ 'officePhone': [],
26
+ 'password': [],
27
+ 'role': [],
28
+ 'sipPassword': [],
29
+ }));
30
+ b.m("POST")
31
+ .h(headers)
32
+ .b(body);
33
+ return b.build();
34
+ };
5
35
  export const se_CreatePbxOAuth2ClientCommand = async (input, context) => {
6
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
36
+ const b = rb(input, context);
7
37
  const headers = {
8
38
  'content-type': 'application/json',
9
39
  };
10
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/api/v1/pbx/applications/oauth2";
40
+ b.bp("/api/v1/pbx/applications/oauth2");
11
41
  let body;
12
42
  body = JSON.stringify(take(input, {
13
43
  'name': [],
14
44
  'redirectUri': _ => _json(_),
15
45
  }));
16
- return new __HttpRequest({
17
- protocol,
18
- hostname,
19
- port,
20
- method: "POST",
21
- headers,
22
- path: resolvedPath,
23
- body,
46
+ b.m("POST")
47
+ .h(headers)
48
+ .b(body);
49
+ return b.build();
50
+ };
51
+ export const se_DeletePbxColleagueCommand = async (input, context) => {
52
+ const b = rb(input, context);
53
+ const headers = {};
54
+ b.bp("/api/v1/PBX/Colleagues/{colleagueId}");
55
+ b.p('colleagueId', () => input.colleagueId.toString(), '{colleagueId}', false);
56
+ const query = map({
57
+ [_d]: [() => input.data !== void 0, () => ((input[_d] || []).map(_entry => _entry))],
24
58
  });
59
+ let body;
60
+ b.m("DELETE")
61
+ .h(headers)
62
+ .q(query)
63
+ .b(body);
64
+ return b.build();
25
65
  };
26
66
  export const se_DeletePbxOAuth2ClientCommand = async (input, context) => {
27
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
67
+ const b = rb(input, context);
28
68
  const headers = {};
29
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/api/v1/pbx/applications/oauth2/{id}";
30
- resolvedPath = __resolvedPath(resolvedPath, input, 'id', () => input.id, '{id}', false);
69
+ b.bp("/api/v1/pbx/applications/oauth2/{id}");
70
+ b.p('id', () => input.id, '{id}', false);
31
71
  let body;
32
- return new __HttpRequest({
33
- protocol,
34
- hostname,
35
- port,
36
- method: "DELETE",
37
- headers,
38
- path: resolvedPath,
39
- body,
40
- });
72
+ b.m("DELETE")
73
+ .h(headers)
74
+ .b(body);
75
+ return b.build();
41
76
  };
42
77
  export const se_GetPbxAclGroupsPermissionsCommand = async (input, context) => {
43
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
78
+ const b = rb(input, context);
44
79
  const headers = {};
45
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/api/v1/pbx/aclgroups/permissions";
80
+ b.bp("/api/v1/pbx/aclgroups/permissions");
46
81
  const query = map({
47
- "groups[]": [() => input.groups !== void 0, () => ((input.groups || []).map(_entry => _entry))],
48
- "permissions[]": [() => input.permissions !== void 0, () => ((input.permissions || []).map(_entry => _entry))],
82
+ [_gr]: [() => input.groups !== void 0, () => ((input[_g] || []).map(_entry => _entry))],
83
+ [_pe]: [() => input.permissions !== void 0, () => ((input[_p] || []).map(_entry => _entry))],
49
84
  });
50
85
  let body;
51
- return new __HttpRequest({
52
- protocol,
53
- hostname,
54
- port,
55
- method: "GET",
56
- headers,
57
- path: resolvedPath,
58
- query,
59
- body,
60
- });
86
+ b.m("GET")
87
+ .h(headers)
88
+ .q(query)
89
+ .b(body);
90
+ return b.build();
61
91
  };
62
92
  export const se_GetPbxCallGroupsCommand = async (input, context) => {
63
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
93
+ const b = rb(input, context);
64
94
  const headers = {
65
95
  'content-type': 'application/json',
66
96
  };
67
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/api/v1/Dialplan/CallGroups";
97
+ b.bp("/api/v1/Dialplan/CallGroups");
68
98
  let body;
69
99
  body = "";
70
- return new __HttpRequest({
71
- protocol,
72
- hostname,
73
- port,
74
- method: "GET",
75
- headers,
76
- path: resolvedPath,
77
- body,
78
- });
100
+ b.m("GET")
101
+ .h(headers)
102
+ .b(body);
103
+ return b.build();
79
104
  };
80
105
  export const se_GetPbxColleaguesCommand = async (input, context) => {
81
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
106
+ const b = rb(input, context);
82
107
  const headers = {};
83
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/api/v1/PBX/Colleagues";
108
+ b.bp("/api/v1/PBX/Colleagues");
84
109
  const query = map({
85
- "filter[extension][]": [() => input.extension !== void 0, () => ((input.extension || []).map(_entry => _entry))],
86
- "filter[id][]": [() => input.id !== void 0, () => ((input.id || []).map(_entry => _entry))],
87
- "filter[officePhone][]": [() => input.officePhone !== void 0, () => ((input.officePhone || []).map(_entry => _entry))],
88
- "filter[mobilePhone][]": [() => input.mobilePhone !== void 0, () => ((input.mobilePhone || []).map(_entry => _entry))],
89
- "filter[name][]": [() => input.name !== void 0, () => ((input.name || []).map(_entry => _entry))],
90
- "filter[email][]": [() => input.email !== void 0, () => ((input.email || []).map(_entry => _entry))],
91
- "filter[role][]": [() => input.role !== void 0, () => ((input.role || []).map(_entry => _entry))],
92
- "filter[dialplan][]": [() => input.dialplan !== void 0, () => ((input.dialplan || []).map(_entry => _entry))],
93
- "filter[faxDialplan][]": [() => input.faxDialplan !== void 0, () => ((input.faxDialplan || []).map(_entry => _entry))],
94
- "filter[department][]": [() => input.department !== void 0, () => ((input.department || []).map(_entry => _entry))],
95
- "filter[login][]": [() => input.login !== void 0, () => ((input.login || []).map(_entry => _entry))],
96
- "filter[groupDn][]": [() => input.groupDn !== void 0, () => ((input.groupDn || []).map(_entry => _entry))],
97
- "filter[pbxDn][]": [() => input.pbxDn !== void 0, () => ((input.pbxDn || []).map(_entry => _entry))],
98
- "filter[licenseType][]": [() => input.licenseType !== void 0, () => ((input.licenseType || []).map(_entry => _entry))],
99
- "fields": [() => input.fields !== void 0, () => ((input.fields || []).join(','))],
100
- "searchFields": [() => input.searchFields !== void 0, () => ((input.searchFields || []).join(','))],
101
- "search": [, input.search],
102
- "sort": [() => input.sort !== void 0, () => ((input.sort || []).map(_entry => _entry))],
103
- "start": [() => input.start !== void 0, () => (input.start.toString())],
104
- "count": [() => input.count !== void 0, () => (input.count.toString())],
105
- "dir": [, input.dir],
106
- "searchStrategy": [, input.searchStrategy],
110
+ [_f]: [() => input.extension !== void 0, () => ((input[_e] || []).map(_entry => _entry))],
111
+ [_fi]: [() => input.id !== void 0, () => ((input[_i] || []).map(_entry => _entry))],
112
+ [_fP]: [() => input.officePhone !== void 0, () => ((input[_oP] || []).map(_entry => _entry))],
113
+ [_fPi]: [() => input.mobilePhone !== void 0, () => ((input[_mP] || []).map(_entry => _entry))],
114
+ [_fil]: [() => input.name !== void 0, () => ((input[_n] || []).map(_entry => _entry))],
115
+ [_filt]: [() => input.email !== void 0, () => ((input[_em] || []).map(_entry => _entry))],
116
+ [_filte]: [() => input.role !== void 0, () => ((input[_r] || []).map(_entry => _entry))],
117
+ [_filter]: [() => input.dialplan !== void 0, () => ((input[_di] || []).map(_entry => _entry))],
118
+ [_fDi]: [() => input.faxDialplan !== void 0, () => ((input[_fD] || []).map(_entry => _entry))],
119
+ [_filterd]: [() => input.department !== void 0, () => ((input[_de] || []).map(_entry => _entry))],
120
+ [_filterl]: [() => input.login !== void 0, () => ((input[_l] || []).map(_entry => _entry))],
121
+ [_fDil]: [() => input.groupDn !== void 0, () => ((input[_gD] || []).map(_entry => _entry))],
122
+ [_fDilt]: [() => input.pbxDn !== void 0, () => ((input[_pD] || []).map(_entry => _entry))],
123
+ [_fT]: [() => input.licenseType !== void 0, () => ((input[_lT] || []).map(_entry => _entry))],
124
+ [_fie]: [() => input.fields !== void 0, () => ((input[_fie] || []).join(','))],
125
+ [_sF]: [() => input.searchFields !== void 0, () => ((input[_sF] || []).join(','))],
126
+ [_s]: [, input[_s]],
127
+ [_so]: [() => input.sort !== void 0, () => ((input[_so] || []).map(_entry => _entry))],
128
+ [_st]: [() => input.start !== void 0, () => (input[_st].toString())],
129
+ [_c]: [() => input.count !== void 0, () => (input[_c].toString())],
130
+ [_dir]: [, input[_dir]],
131
+ [_sS]: [, input[_sS]],
107
132
  });
108
133
  let body;
109
- return new __HttpRequest({
110
- protocol,
111
- hostname,
112
- port,
113
- method: "GET",
114
- headers,
115
- path: resolvedPath,
116
- query,
117
- body,
118
- });
134
+ b.m("GET")
135
+ .h(headers)
136
+ .q(query)
137
+ .b(body);
138
+ return b.build();
119
139
  };
120
140
  export const se_GetPbxOAuth2ClientsCommand = async (input, context) => {
121
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
141
+ const b = rb(input, context);
122
142
  const headers = {
123
143
  'content-type': 'application/json',
124
144
  };
125
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/api/v1/pbx/applications/oauth2";
145
+ b.bp("/api/v1/pbx/applications/oauth2");
126
146
  let body;
127
147
  body = "";
128
- return new __HttpRequest({
129
- protocol,
130
- hostname,
131
- port,
132
- method: "GET",
133
- headers,
134
- path: resolvedPath,
135
- body,
136
- });
148
+ b.m("GET")
149
+ .h(headers)
150
+ .b(body);
151
+ return b.build();
137
152
  };
138
153
  export const se_UpdatePbxOAuth2ClientCommand = async (input, context) => {
139
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
154
+ const b = rb(input, context);
140
155
  const headers = {
141
156
  'content-type': 'application/json',
142
157
  };
143
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/api/v1/pbx/applications/oauth2/{id}";
144
- resolvedPath = __resolvedPath(resolvedPath, input, 'id', () => input.id, '{id}', false);
158
+ b.bp("/api/v1/pbx/applications/oauth2/{id}");
159
+ b.p('id', () => input.id, '{id}', false);
145
160
  let body;
146
161
  body = JSON.stringify(take(input, {
147
162
  'name': [],
148
163
  'redirectUri': _ => _json(_),
149
164
  }));
150
- return new __HttpRequest({
151
- protocol,
152
- hostname,
153
- port,
154
- method: "PUT",
155
- headers,
156
- path: resolvedPath,
157
- body,
165
+ b.m("PUT")
166
+ .h(headers)
167
+ .b(body);
168
+ return b.build();
169
+ };
170
+ export const de_CreatePbxColleagueCommand = async (output, context) => {
171
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
172
+ return de_CommandError(output, context);
173
+ }
174
+ const contents = map({
175
+ $metadata: deserializeMetadata(output),
176
+ });
177
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
178
+ const doc = take(data, {
179
+ 'department': __expectString,
180
+ 'dialplan': __expectString,
181
+ 'email': __expectString,
182
+ 'extension': __expectString,
183
+ 'faxDialplan': __expectString,
184
+ 'faxNumber': __expectString,
185
+ 'groupDn': __expectString,
186
+ 'groupName': __expectString,
187
+ 'id': __expectString,
188
+ 'jid': __expectString,
189
+ 'language': __expectString,
190
+ 'licenseType': __expectString,
191
+ 'login': __expectString,
192
+ 'mobilePhone': __expectString,
193
+ 'name': __expectString,
194
+ 'officePhone': __expectString,
195
+ 'pbx': __expectString,
196
+ 'pbxDn': __expectString,
197
+ 'picture': __expectString,
198
+ 'role': __expectString,
199
+ 'sourceId': __expectString,
158
200
  });
201
+ Object.assign(contents, doc);
202
+ return contents;
159
203
  };
160
204
  export const de_CreatePbxOAuth2ClientCommand = async (output, context) => {
161
205
  if (output.statusCode !== 200 && output.statusCode >= 300) {
162
- return de_CreatePbxOAuth2ClientCommandError(output, context);
206
+ return de_CommandError(output, context);
163
207
  }
164
208
  const contents = map({
165
209
  $metadata: deserializeMetadata(output),
@@ -172,31 +216,24 @@ export const de_CreatePbxOAuth2ClientCommand = async (output, context) => {
172
216
  Object.assign(contents, doc);
173
217
  return contents;
174
218
  };
175
- const de_CreatePbxOAuth2ClientCommandError = async (output, context) => {
176
- const parsedOutput = {
177
- ...output,
178
- body: await parseErrorBody(output.body, context)
179
- };
180
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
181
- switch (errorCode) {
182
- case "WmsUnauthorizedException":
183
- case "wildix.wms.api#WmsUnauthorizedException":
184
- throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
185
- case "WmsValidationException":
186
- case "wildix.wms.api#WmsValidationException":
187
- throw await de_WmsValidationExceptionRes(parsedOutput, context);
188
- default:
189
- const parsedBody = parsedOutput.body;
190
- return throwDefaultError({
191
- output,
192
- parsedBody,
193
- errorCode
194
- });
219
+ export const de_DeletePbxColleagueCommand = async (output, context) => {
220
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
221
+ return de_CommandError(output, context);
195
222
  }
223
+ const contents = map({
224
+ $metadata: deserializeMetadata(output),
225
+ });
226
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
227
+ const doc = take(data, {
228
+ 'result': __expectString,
229
+ 'type': __expectString,
230
+ });
231
+ Object.assign(contents, doc);
232
+ return contents;
196
233
  };
197
234
  export const de_DeletePbxOAuth2ClientCommand = async (output, context) => {
198
235
  if (output.statusCode !== 200 && output.statusCode >= 300) {
199
- return de_DeletePbxOAuth2ClientCommandError(output, context);
236
+ return de_CommandError(output, context);
200
237
  }
201
238
  const contents = map({
202
239
  $metadata: deserializeMetadata(output),
@@ -209,31 +246,9 @@ export const de_DeletePbxOAuth2ClientCommand = async (output, context) => {
209
246
  Object.assign(contents, doc);
210
247
  return contents;
211
248
  };
212
- const de_DeletePbxOAuth2ClientCommandError = async (output, context) => {
213
- const parsedOutput = {
214
- ...output,
215
- body: await parseErrorBody(output.body, context)
216
- };
217
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
218
- switch (errorCode) {
219
- case "WmsNotFoundException":
220
- case "wildix.wms.api#WmsNotFoundException":
221
- throw await de_WmsNotFoundExceptionRes(parsedOutput, context);
222
- case "WmsUnauthorizedException":
223
- case "wildix.wms.api#WmsUnauthorizedException":
224
- throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
225
- default:
226
- const parsedBody = parsedOutput.body;
227
- return throwDefaultError({
228
- output,
229
- parsedBody,
230
- errorCode
231
- });
232
- }
233
- };
234
249
  export const de_GetPbxAclGroupsPermissionsCommand = async (output, context) => {
235
250
  if (output.statusCode !== 200 && output.statusCode >= 300) {
236
- return de_GetPbxAclGroupsPermissionsCommandError(output, context);
251
+ return de_CommandError(output, context);
237
252
  }
238
253
  const contents = map({
239
254
  $metadata: deserializeMetadata(output),
@@ -246,28 +261,9 @@ export const de_GetPbxAclGroupsPermissionsCommand = async (output, context) => {
246
261
  Object.assign(contents, doc);
247
262
  return contents;
248
263
  };
249
- const de_GetPbxAclGroupsPermissionsCommandError = async (output, context) => {
250
- const parsedOutput = {
251
- ...output,
252
- body: await parseErrorBody(output.body, context)
253
- };
254
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
255
- switch (errorCode) {
256
- case "WmsUnauthorizedException":
257
- case "wildix.wms.api#WmsUnauthorizedException":
258
- throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
259
- default:
260
- const parsedBody = parsedOutput.body;
261
- return throwDefaultError({
262
- output,
263
- parsedBody,
264
- errorCode
265
- });
266
- }
267
- };
268
264
  export const de_GetPbxCallGroupsCommand = async (output, context) => {
269
265
  if (output.statusCode !== 200 && output.statusCode >= 300) {
270
- return de_GetPbxCallGroupsCommandError(output, context);
266
+ return de_CommandError(output, context);
271
267
  }
272
268
  const contents = map({
273
269
  $metadata: deserializeMetadata(output),
@@ -280,28 +276,9 @@ export const de_GetPbxCallGroupsCommand = async (output, context) => {
280
276
  Object.assign(contents, doc);
281
277
  return contents;
282
278
  };
283
- const de_GetPbxCallGroupsCommandError = async (output, context) => {
284
- const parsedOutput = {
285
- ...output,
286
- body: await parseErrorBody(output.body, context)
287
- };
288
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
289
- switch (errorCode) {
290
- case "WmsUnauthorizedException":
291
- case "wildix.wms.api#WmsUnauthorizedException":
292
- throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
293
- default:
294
- const parsedBody = parsedOutput.body;
295
- return throwDefaultError({
296
- output,
297
- parsedBody,
298
- errorCode
299
- });
300
- }
301
- };
302
279
  export const de_GetPbxColleaguesCommand = async (output, context) => {
303
280
  if (output.statusCode !== 200 && output.statusCode >= 300) {
304
- return de_GetPbxColleaguesCommandError(output, context);
281
+ return de_CommandError(output, context);
305
282
  }
306
283
  const contents = map({
307
284
  $metadata: deserializeMetadata(output),
@@ -314,28 +291,9 @@ export const de_GetPbxColleaguesCommand = async (output, context) => {
314
291
  Object.assign(contents, doc);
315
292
  return contents;
316
293
  };
317
- const de_GetPbxColleaguesCommandError = async (output, context) => {
318
- const parsedOutput = {
319
- ...output,
320
- body: await parseErrorBody(output.body, context)
321
- };
322
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
323
- switch (errorCode) {
324
- case "WmsUnauthorizedException":
325
- case "wildix.wms.api#WmsUnauthorizedException":
326
- throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
327
- default:
328
- const parsedBody = parsedOutput.body;
329
- return throwDefaultError({
330
- output,
331
- parsedBody,
332
- errorCode
333
- });
334
- }
335
- };
336
294
  export const de_GetPbxOAuth2ClientsCommand = async (output, context) => {
337
295
  if (output.statusCode !== 200 && output.statusCode >= 300) {
338
- return de_GetPbxOAuth2ClientsCommandError(output, context);
296
+ return de_CommandError(output, context);
339
297
  }
340
298
  const contents = map({
341
299
  $metadata: deserializeMetadata(output),
@@ -348,28 +306,9 @@ export const de_GetPbxOAuth2ClientsCommand = async (output, context) => {
348
306
  Object.assign(contents, doc);
349
307
  return contents;
350
308
  };
351
- const de_GetPbxOAuth2ClientsCommandError = async (output, context) => {
352
- const parsedOutput = {
353
- ...output,
354
- body: await parseErrorBody(output.body, context)
355
- };
356
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
357
- switch (errorCode) {
358
- case "WmsUnauthorizedException":
359
- case "wildix.wms.api#WmsUnauthorizedException":
360
- throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
361
- default:
362
- const parsedBody = parsedOutput.body;
363
- return throwDefaultError({
364
- output,
365
- parsedBody,
366
- errorCode
367
- });
368
- }
369
- };
370
309
  export const de_UpdatePbxOAuth2ClientCommand = async (output, context) => {
371
310
  if (output.statusCode !== 200 && output.statusCode >= 300) {
372
- return de_UpdatePbxOAuth2ClientCommandError(output, context);
311
+ return de_CommandError(output, context);
373
312
  }
374
313
  const contents = map({
375
314
  $metadata: deserializeMetadata(output),
@@ -382,22 +321,22 @@ export const de_UpdatePbxOAuth2ClientCommand = async (output, context) => {
382
321
  Object.assign(contents, doc);
383
322
  return contents;
384
323
  };
385
- const de_UpdatePbxOAuth2ClientCommandError = async (output, context) => {
324
+ const de_CommandError = async (output, context) => {
386
325
  const parsedOutput = {
387
326
  ...output,
388
327
  body: await parseErrorBody(output.body, context)
389
328
  };
390
329
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
391
330
  switch (errorCode) {
392
- case "WmsNotFoundException":
393
- case "wildix.wms.api#WmsNotFoundException":
394
- throw await de_WmsNotFoundExceptionRes(parsedOutput, context);
395
331
  case "WmsUnauthorizedException":
396
332
  case "wildix.wms.api#WmsUnauthorizedException":
397
333
  throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
398
334
  case "WmsValidationException":
399
335
  case "wildix.wms.api#WmsValidationException":
400
336
  throw await de_WmsValidationExceptionRes(parsedOutput, context);
337
+ case "WmsNotFoundException":
338
+ case "wildix.wms.api#WmsNotFoundException":
339
+ throw await de_WmsNotFoundExceptionRes(parsedOutput, context);
401
340
  default:
402
341
  const parsedBody = parsedOutput.body;
403
342
  return throwDefaultError({
@@ -464,6 +403,47 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
464
403
  (!Object.getOwnPropertyNames(value).includes("length") ||
465
404
  value.length != 0) &&
466
405
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
406
+ const _c = "count";
407
+ const _d = "data";
408
+ const _de = "department";
409
+ const _di = "dialplan";
410
+ const _dir = "dir";
411
+ const _e = "extension";
412
+ const _em = "email";
413
+ const _f = "filter[extension][]";
414
+ const _fD = "faxDialplan";
415
+ const _fDi = "filter[faxDialplan][]";
416
+ const _fDil = "filter[groupDn][]";
417
+ const _fDilt = "filter[pbxDn][]";
418
+ const _fP = "filter[officePhone][]";
419
+ const _fPi = "filter[mobilePhone][]";
420
+ const _fT = "filter[licenseType][]";
421
+ const _fi = "filter[id][]";
422
+ const _fie = "fields";
423
+ const _fil = "filter[name][]";
424
+ const _filt = "filter[email][]";
425
+ const _filte = "filter[role][]";
426
+ const _filter = "filter[dialplan][]";
427
+ const _filterd = "filter[department][]";
428
+ const _filterl = "filter[login][]";
429
+ const _g = "groups";
430
+ const _gD = "groupDn";
431
+ const _gr = "groups[]";
432
+ const _i = "id";
433
+ const _l = "login";
434
+ const _lT = "licenseType";
435
+ const _mP = "mobilePhone";
436
+ const _n = "name";
437
+ const _oP = "officePhone";
438
+ const _p = "permissions";
439
+ const _pD = "pbxDn";
440
+ const _pe = "permissions[]";
441
+ const _r = "role";
442
+ const _s = "search";
443
+ const _sF = "searchFields";
444
+ const _sS = "searchStrategy";
445
+ const _so = "sort";
446
+ const _st = "start";
467
447
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then(encoded => {
468
448
  if (encoded.length) {
469
449
  return JSON.parse(encoded);
@@ -1,4 +1,6 @@
1
+ import packageInfo from "../package.json";
1
2
  import { Sha256 } from "@aws-crypto/sha256-browser";
3
+ import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser";
2
4
  import { FetchHttpHandler as RequestHandler, streamCollector, } from "@smithy/fetch-http-handler";
3
5
  import { calculateBodyLength } from "@smithy/util-body-length-browser";
4
6
  import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE, } from "@smithy/util-retry";
@@ -15,8 +17,9 @@ export const getRuntimeConfig = (config) => {
15
17
  runtime: "browser",
16
18
  defaultsMode,
17
19
  bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
20
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ?? defaultUserAgent({ serviceId: packageInfo.name, clientVersion: packageInfo.version }),
18
21
  maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
19
- requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
22
+ requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
20
23
  retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
21
24
  sha256: config?.sha256 ?? Sha256,
22
25
  streamCollector: config?.streamCollector ?? streamCollector,
@@ -1,3 +1,5 @@
1
+ import packageInfo from "../package.json";
2
+ import { defaultUserAgent } from "@aws-sdk/util-user-agent-node";
1
3
  import { Hash } from "@smithy/hash-node";
2
4
  import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS, } from "@smithy/middleware-retry";
3
5
  import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider";
@@ -19,8 +21,9 @@ export const getRuntimeConfig = (config) => {
19
21
  runtime: "node",
20
22
  defaultsMode,
21
23
  bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
24
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ?? defaultUserAgent({ serviceId: packageInfo.name, clientVersion: packageInfo.version }),
22
25
  maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
23
- requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
26
+ requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
24
27
  retryMode: config?.retryMode ?? loadNodeConfig({ ...NODE_RETRY_MODE_CONFIG_OPTIONS, default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, }),
25
28
  sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
26
29
  streamCollector: config?.streamCollector ?? streamCollector,
@@ -2,14 +2,16 @@ import { NoOpLogger } from "@smithy/smithy-client";
2
2
  import { parseUrl } from "@smithy/url-parser";
3
3
  import { fromBase64, toBase64, } from "@smithy/util-base64";
4
4
  import { fromUtf8, toUtf8, } from "@smithy/util-utf8";
5
- export const getRuntimeConfig = (config) => ({
6
- apiVersion: "",
7
- base64Decoder: config?.base64Decoder ?? fromBase64,
8
- base64Encoder: config?.base64Encoder ?? toBase64,
9
- disableHostPrefix: config?.disableHostPrefix ?? false,
10
- extensions: config?.extensions ?? [],
11
- logger: config?.logger ?? new NoOpLogger(),
12
- urlParser: config?.urlParser ?? parseUrl,
13
- utf8Decoder: config?.utf8Decoder ?? fromUtf8,
14
- utf8Encoder: config?.utf8Encoder ?? toUtf8,
15
- });
5
+ export const getRuntimeConfig = (config) => {
6
+ return {
7
+ apiVersion: "",
8
+ base64Decoder: config?.base64Decoder ?? fromBase64,
9
+ base64Encoder: config?.base64Encoder ?? toBase64,
10
+ disableHostPrefix: config?.disableHostPrefix ?? false,
11
+ extensions: config?.extensions ?? [],
12
+ logger: config?.logger ?? new NoOpLogger(),
13
+ urlParser: config?.urlParser ?? parseUrl,
14
+ utf8Decoder: config?.utf8Decoder ?? fromUtf8,
15
+ utf8Encoder: config?.utf8Encoder ?? toUtf8,
16
+ };
17
+ };