@wildix/wms-api-client 1.0.3 → 1.0.5

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 (33) hide show
  1. package/dist-cjs/WmsApi.js +8 -0
  2. package/dist-cjs/commands/CreatePbxOAuth2ClientCommand.js +41 -0
  3. package/dist-cjs/commands/DeletePbxOAuth2ClientCommand.js +41 -0
  4. package/dist-cjs/commands/GetPbxOAuth2ClientsCommand.js +41 -0
  5. package/dist-cjs/commands/UpdatePbxOAuth2ClientCommand.js +41 -0
  6. package/dist-cjs/commands/index.js +4 -0
  7. package/dist-cjs/models/models_0.js +48 -1
  8. package/dist-cjs/protocols/Aws_restJson1.js +317 -20
  9. package/dist-es/WmsApi.js +8 -0
  10. package/dist-es/commands/CreatePbxOAuth2ClientCommand.js +37 -0
  11. package/dist-es/commands/DeletePbxOAuth2ClientCommand.js +37 -0
  12. package/dist-es/commands/GetPbxOAuth2ClientsCommand.js +37 -0
  13. package/dist-es/commands/UpdatePbxOAuth2ClientCommand.js +37 -0
  14. package/dist-es/commands/index.js +4 -0
  15. package/dist-es/models/models_0.js +44 -0
  16. package/dist-es/protocols/Aws_restJson1.js +309 -20
  17. package/dist-types/WmsApi.d.ts +28 -0
  18. package/dist-types/WmsApiClient.d.ts +6 -2
  19. package/dist-types/commands/CreatePbxOAuth2ClientCommand.d.ts +91 -0
  20. package/dist-types/commands/DeletePbxOAuth2ClientCommand.d.ts +76 -0
  21. package/dist-types/commands/GetPbxAclGroupsPermissionsCommand.d.ts +8 -3
  22. package/dist-types/commands/GetPbxCallGroupsCommand.d.ts +2 -0
  23. package/dist-types/commands/GetPbxColleaguesCommand.d.ts +2 -0
  24. package/dist-types/commands/GetPbxOAuth2ClientsCommand.d.ts +84 -0
  25. package/dist-types/commands/UpdatePbxOAuth2ClientCommand.d.ts +94 -0
  26. package/dist-types/commands/index.d.ts +4 -0
  27. package/dist-types/models/models_0.d.ts +165 -0
  28. package/dist-types/protocols/Aws_restJson1.d.ts +36 -0
  29. package/dist-types/runtimeConfig.browser.d.ts +3 -3
  30. package/dist-types/runtimeConfig.d.ts +3 -3
  31. package/dist-types/runtimeConfig.native.d.ts +3 -3
  32. package/dist-types/runtimeConfig.shared.d.ts +2 -2
  33. package/package.json +1 -1
@@ -0,0 +1,37 @@
1
+ import { de_CreatePbxOAuth2ClientCommand, se_CreatePbxOAuth2ClientCommand, } from "../protocols/Aws_restJson1";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
5
+ export { $Command };
6
+ export class CreatePbxOAuth2ClientCommand extends $Command {
7
+ constructor(input) {
8
+ super();
9
+ this.input = input;
10
+ }
11
+ resolveMiddleware(clientStack, configuration, options) {
12
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
13
+ const stack = clientStack.concat(this.middlewareStack);
14
+ const { logger } = configuration;
15
+ const clientName = "WmsApiClient";
16
+ const commandName = "CreatePbxOAuth2ClientCommand";
17
+ const handlerExecutionContext = {
18
+ logger,
19
+ clientName,
20
+ commandName,
21
+ inputFilterSensitiveLog: (_) => _,
22
+ outputFilterSensitiveLog: (_) => _,
23
+ [SMITHY_CONTEXT_KEY]: {
24
+ service: "WmsApi",
25
+ operation: "CreatePbxOAuth2Client",
26
+ },
27
+ };
28
+ const { requestHandler } = configuration;
29
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
30
+ }
31
+ serialize(input, context) {
32
+ return se_CreatePbxOAuth2ClientCommand(input, context);
33
+ }
34
+ deserialize(output, context) {
35
+ return de_CreatePbxOAuth2ClientCommand(output, context);
36
+ }
37
+ }
@@ -0,0 +1,37 @@
1
+ import { de_DeletePbxOAuth2ClientCommand, se_DeletePbxOAuth2ClientCommand, } from "../protocols/Aws_restJson1";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
5
+ export { $Command };
6
+ export class DeletePbxOAuth2ClientCommand extends $Command {
7
+ constructor(input) {
8
+ super();
9
+ this.input = input;
10
+ }
11
+ resolveMiddleware(clientStack, configuration, options) {
12
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
13
+ const stack = clientStack.concat(this.middlewareStack);
14
+ const { logger } = configuration;
15
+ const clientName = "WmsApiClient";
16
+ const commandName = "DeletePbxOAuth2ClientCommand";
17
+ const handlerExecutionContext = {
18
+ logger,
19
+ clientName,
20
+ commandName,
21
+ inputFilterSensitiveLog: (_) => _,
22
+ outputFilterSensitiveLog: (_) => _,
23
+ [SMITHY_CONTEXT_KEY]: {
24
+ service: "WmsApi",
25
+ operation: "DeletePbxOAuth2Client",
26
+ },
27
+ };
28
+ const { requestHandler } = configuration;
29
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
30
+ }
31
+ serialize(input, context) {
32
+ return se_DeletePbxOAuth2ClientCommand(input, context);
33
+ }
34
+ deserialize(output, context) {
35
+ return de_DeletePbxOAuth2ClientCommand(output, context);
36
+ }
37
+ }
@@ -0,0 +1,37 @@
1
+ import { de_GetPbxOAuth2ClientsCommand, se_GetPbxOAuth2ClientsCommand, } from "../protocols/Aws_restJson1";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
5
+ export { $Command };
6
+ export class GetPbxOAuth2ClientsCommand extends $Command {
7
+ constructor(input) {
8
+ super();
9
+ this.input = input;
10
+ }
11
+ resolveMiddleware(clientStack, configuration, options) {
12
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
13
+ const stack = clientStack.concat(this.middlewareStack);
14
+ const { logger } = configuration;
15
+ const clientName = "WmsApiClient";
16
+ const commandName = "GetPbxOAuth2ClientsCommand";
17
+ const handlerExecutionContext = {
18
+ logger,
19
+ clientName,
20
+ commandName,
21
+ inputFilterSensitiveLog: (_) => _,
22
+ outputFilterSensitiveLog: (_) => _,
23
+ [SMITHY_CONTEXT_KEY]: {
24
+ service: "WmsApi",
25
+ operation: "GetPbxOAuth2Clients",
26
+ },
27
+ };
28
+ const { requestHandler } = configuration;
29
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
30
+ }
31
+ serialize(input, context) {
32
+ return se_GetPbxOAuth2ClientsCommand(input, context);
33
+ }
34
+ deserialize(output, context) {
35
+ return de_GetPbxOAuth2ClientsCommand(output, context);
36
+ }
37
+ }
@@ -0,0 +1,37 @@
1
+ import { de_UpdatePbxOAuth2ClientCommand, se_UpdatePbxOAuth2ClientCommand, } from "../protocols/Aws_restJson1";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
5
+ export { $Command };
6
+ export class UpdatePbxOAuth2ClientCommand extends $Command {
7
+ constructor(input) {
8
+ super();
9
+ this.input = input;
10
+ }
11
+ resolveMiddleware(clientStack, configuration, options) {
12
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
13
+ const stack = clientStack.concat(this.middlewareStack);
14
+ const { logger } = configuration;
15
+ const clientName = "WmsApiClient";
16
+ const commandName = "UpdatePbxOAuth2ClientCommand";
17
+ const handlerExecutionContext = {
18
+ logger,
19
+ clientName,
20
+ commandName,
21
+ inputFilterSensitiveLog: (_) => _,
22
+ outputFilterSensitiveLog: (_) => _,
23
+ [SMITHY_CONTEXT_KEY]: {
24
+ service: "WmsApi",
25
+ operation: "UpdatePbxOAuth2Client",
26
+ },
27
+ };
28
+ const { requestHandler } = configuration;
29
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
30
+ }
31
+ serialize(input, context) {
32
+ return se_UpdatePbxOAuth2ClientCommand(input, context);
33
+ }
34
+ deserialize(output, context) {
35
+ return de_UpdatePbxOAuth2ClientCommand(output, context);
36
+ }
37
+ }
@@ -1,3 +1,7 @@
1
+ export * from "./CreatePbxOAuth2ClientCommand";
2
+ export * from "./DeletePbxOAuth2ClientCommand";
1
3
  export * from "./GetPbxAclGroupsPermissionsCommand";
2
4
  export * from "./GetPbxCallGroupsCommand";
3
5
  export * from "./GetPbxColleaguesCommand";
6
+ export * from "./GetPbxOAuth2ClientsCommand";
7
+ export * from "./UpdatePbxOAuth2ClientCommand";
@@ -1,3 +1,4 @@
1
+ import { WmsApiServiceException as __BaseException } from "./WmsApiServiceException";
1
2
  export const AclGroupPermissionAbility = {
2
3
  CAN: "can",
3
4
  CANNOT: "cannot",
@@ -15,6 +16,49 @@ export const ResponseType = {
15
16
  ERROR: "error",
16
17
  RESULT: "result",
17
18
  };
19
+ export class WmsUnauthorizedException extends __BaseException {
20
+ constructor(opts) {
21
+ super({
22
+ name: "WmsUnauthorizedException",
23
+ $fault: "client",
24
+ ...opts
25
+ });
26
+ this.name = "WmsUnauthorizedException";
27
+ this.$fault = "client";
28
+ Object.setPrototypeOf(this, WmsUnauthorizedException.prototype);
29
+ this.type = opts.type;
30
+ this.reason = opts.reason;
31
+ }
32
+ }
33
+ export class WmsValidationException extends __BaseException {
34
+ constructor(opts) {
35
+ super({
36
+ name: "WmsValidationException",
37
+ $fault: "client",
38
+ ...opts
39
+ });
40
+ this.name = "WmsValidationException";
41
+ this.$fault = "client";
42
+ Object.setPrototypeOf(this, WmsValidationException.prototype);
43
+ this.type = opts.type;
44
+ this.reason = opts.reason;
45
+ this.errors = opts.errors;
46
+ }
47
+ }
48
+ export class WmsNotFoundException extends __BaseException {
49
+ constructor(opts) {
50
+ super({
51
+ name: "WmsNotFoundException",
52
+ $fault: "client",
53
+ ...opts
54
+ });
55
+ this.name = "WmsNotFoundException";
56
+ this.$fault = "client";
57
+ Object.setPrototypeOf(this, WmsNotFoundException.prototype);
58
+ this.type = opts.type;
59
+ this.reason = opts.reason;
60
+ }
61
+ }
18
62
  export const GetPbxColleaguesDir = {
19
63
  ASC: "asc",
20
64
  DESC: "desc",
@@ -1,14 +1,53 @@
1
1
  import { WmsApiServiceException as __BaseException } from "../models/WmsApiServiceException";
2
+ import { WmsNotFoundException, WmsUnauthorizedException, WmsValidationException, } from "../models/models_0";
2
3
  import { HttpRequest as __HttpRequest, } from "@smithy/protocol-http";
3
- import { expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, _json, collectBody, map, take, withBaseException, } from "@smithy/smithy-client";
4
- export const se_GetPbxAclGroupsPermissionsCommand = async (input, context) => {
4
+ import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, resolvedPath as __resolvedPath, _json, collectBody, map, take, withBaseException, } from "@smithy/smithy-client";
5
+ export const se_CreatePbxOAuth2ClientCommand = async (input, context) => {
5
6
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
6
7
  const headers = {
7
8
  'content-type': 'application/json',
8
9
  };
10
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/api/v1/pbx/applications/oauth2";
11
+ let body;
12
+ body = JSON.stringify(take(input, {
13
+ 'name': [],
14
+ 'redirectUri': _ => _json(_),
15
+ }));
16
+ return new __HttpRequest({
17
+ protocol,
18
+ hostname,
19
+ port,
20
+ method: "POST",
21
+ headers,
22
+ path: resolvedPath,
23
+ body,
24
+ });
25
+ };
26
+ export const se_DeletePbxOAuth2ClientCommand = async (input, context) => {
27
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
28
+ 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);
31
+ let body;
32
+ return new __HttpRequest({
33
+ protocol,
34
+ hostname,
35
+ port,
36
+ method: "DELETE",
37
+ headers,
38
+ path: resolvedPath,
39
+ body,
40
+ });
41
+ };
42
+ export const se_GetPbxAclGroupsPermissionsCommand = async (input, context) => {
43
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
44
+ const headers = {};
9
45
  let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/api/v1/pbx/aclgroups/permissions";
46
+ const query = map({
47
+ "groups": [, input.groups],
48
+ "permissions": [, input.permissions],
49
+ });
10
50
  let body;
11
- body = "";
12
51
  return new __HttpRequest({
13
52
  protocol,
14
53
  hostname,
@@ -16,6 +55,7 @@ export const se_GetPbxAclGroupsPermissionsCommand = async (input, context) => {
16
55
  method: "GET",
17
56
  headers,
18
57
  path: resolvedPath,
58
+ query,
19
59
  body,
20
60
  });
21
61
  };
@@ -77,6 +117,120 @@ export const se_GetPbxColleaguesCommand = async (input, context) => {
77
117
  body,
78
118
  });
79
119
  };
120
+ export const se_GetPbxOAuth2ClientsCommand = async (input, context) => {
121
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
122
+ const headers = {
123
+ 'content-type': 'application/json',
124
+ };
125
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/api/v1/pbx/applications/oauth2";
126
+ let body;
127
+ body = "";
128
+ return new __HttpRequest({
129
+ protocol,
130
+ hostname,
131
+ port,
132
+ method: "GET",
133
+ headers,
134
+ path: resolvedPath,
135
+ body,
136
+ });
137
+ };
138
+ export const se_UpdatePbxOAuth2ClientCommand = async (input, context) => {
139
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
140
+ const headers = {
141
+ 'content-type': 'application/json',
142
+ };
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);
145
+ let body;
146
+ body = JSON.stringify(take(input, {
147
+ 'name': [],
148
+ 'redirectUri': _ => _json(_),
149
+ }));
150
+ return new __HttpRequest({
151
+ protocol,
152
+ hostname,
153
+ port,
154
+ method: "PUT",
155
+ headers,
156
+ path: resolvedPath,
157
+ body,
158
+ });
159
+ };
160
+ export const de_CreatePbxOAuth2ClientCommand = async (output, context) => {
161
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
162
+ return de_CreatePbxOAuth2ClientCommandError(output, context);
163
+ }
164
+ const contents = map({
165
+ $metadata: deserializeMetadata(output),
166
+ });
167
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
168
+ const doc = take(data, {
169
+ 'result': _json,
170
+ 'type': __expectString,
171
+ });
172
+ Object.assign(contents, doc);
173
+ return contents;
174
+ };
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
+ });
195
+ }
196
+ };
197
+ export const de_DeletePbxOAuth2ClientCommand = async (output, context) => {
198
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
199
+ return de_DeletePbxOAuth2ClientCommandError(output, context);
200
+ }
201
+ const contents = map({
202
+ $metadata: deserializeMetadata(output),
203
+ });
204
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
205
+ const doc = take(data, {
206
+ 'result': __expectString,
207
+ 'type': __expectString,
208
+ });
209
+ Object.assign(contents, doc);
210
+ return contents;
211
+ };
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
+ };
80
234
  export const de_GetPbxAclGroupsPermissionsCommand = async (output, context) => {
81
235
  if (output.statusCode !== 200 && output.statusCode >= 300) {
82
236
  return de_GetPbxAclGroupsPermissionsCommandError(output, context);
@@ -98,12 +252,18 @@ const de_GetPbxAclGroupsPermissionsCommandError = async (output, context) => {
98
252
  body: await parseErrorBody(output.body, context)
99
253
  };
100
254
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
101
- const parsedBody = parsedOutput.body;
102
- return throwDefaultError({
103
- output,
104
- parsedBody,
105
- errorCode
106
- });
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
+ }
107
267
  };
108
268
  export const de_GetPbxCallGroupsCommand = async (output, context) => {
109
269
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -126,12 +286,18 @@ const de_GetPbxCallGroupsCommandError = async (output, context) => {
126
286
  body: await parseErrorBody(output.body, context)
127
287
  };
128
288
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
129
- const parsedBody = parsedOutput.body;
130
- return throwDefaultError({
131
- output,
132
- parsedBody,
133
- errorCode
134
- });
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
+ }
135
301
  };
136
302
  export const de_GetPbxColleaguesCommand = async (output, context) => {
137
303
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -154,14 +320,137 @@ const de_GetPbxColleaguesCommandError = async (output, context) => {
154
320
  body: await parseErrorBody(output.body, context)
155
321
  };
156
322
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
157
- const parsedBody = parsedOutput.body;
158
- return throwDefaultError({
159
- output,
160
- parsedBody,
161
- errorCode
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
+ export const de_GetPbxOAuth2ClientsCommand = async (output, context) => {
337
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
338
+ return de_GetPbxOAuth2ClientsCommandError(output, context);
339
+ }
340
+ const contents = map({
341
+ $metadata: deserializeMetadata(output),
342
+ });
343
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
344
+ const doc = take(data, {
345
+ 'result': _json,
346
+ 'type': __expectString,
347
+ });
348
+ Object.assign(contents, doc);
349
+ return contents;
350
+ };
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
+ export const de_UpdatePbxOAuth2ClientCommand = async (output, context) => {
371
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
372
+ return de_UpdatePbxOAuth2ClientCommandError(output, context);
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
+ 'result': _json,
380
+ 'type': __expectString,
162
381
  });
382
+ Object.assign(contents, doc);
383
+ return contents;
384
+ };
385
+ const de_UpdatePbxOAuth2ClientCommandError = async (output, context) => {
386
+ const parsedOutput = {
387
+ ...output,
388
+ body: await parseErrorBody(output.body, context)
389
+ };
390
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
391
+ switch (errorCode) {
392
+ case "WmsNotFoundException":
393
+ case "wildix.wms.api#WmsNotFoundException":
394
+ throw await de_WmsNotFoundExceptionRes(parsedOutput, context);
395
+ case "WmsUnauthorizedException":
396
+ case "wildix.wms.api#WmsUnauthorizedException":
397
+ throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
398
+ case "WmsValidationException":
399
+ case "wildix.wms.api#WmsValidationException":
400
+ throw await de_WmsValidationExceptionRes(parsedOutput, context);
401
+ default:
402
+ const parsedBody = parsedOutput.body;
403
+ return throwDefaultError({
404
+ output,
405
+ parsedBody,
406
+ errorCode
407
+ });
408
+ }
163
409
  };
164
410
  const throwDefaultError = withBaseException(__BaseException);
411
+ const de_WmsNotFoundExceptionRes = async (parsedOutput, context) => {
412
+ const contents = map({});
413
+ const data = parsedOutput.body;
414
+ const doc = take(data, {
415
+ 'reason': __expectString,
416
+ 'type': __expectString,
417
+ });
418
+ Object.assign(contents, doc);
419
+ const exception = new WmsNotFoundException({
420
+ $metadata: deserializeMetadata(parsedOutput),
421
+ ...contents
422
+ });
423
+ return __decorateServiceException(exception, parsedOutput.body);
424
+ };
425
+ const de_WmsUnauthorizedExceptionRes = async (parsedOutput, context) => {
426
+ const contents = map({});
427
+ const data = parsedOutput.body;
428
+ const doc = take(data, {
429
+ 'reason': __expectString,
430
+ 'type': __expectString,
431
+ });
432
+ Object.assign(contents, doc);
433
+ const exception = new WmsUnauthorizedException({
434
+ $metadata: deserializeMetadata(parsedOutput),
435
+ ...contents
436
+ });
437
+ return __decorateServiceException(exception, parsedOutput.body);
438
+ };
439
+ const de_WmsValidationExceptionRes = async (parsedOutput, context) => {
440
+ const contents = map({});
441
+ const data = parsedOutput.body;
442
+ const doc = take(data, {
443
+ 'errors': _json,
444
+ 'reason': __expectString,
445
+ 'type': __expectString,
446
+ });
447
+ Object.assign(contents, doc);
448
+ const exception = new WmsValidationException({
449
+ $metadata: deserializeMetadata(parsedOutput),
450
+ ...contents
451
+ });
452
+ return __decorateServiceException(exception, parsedOutput.body);
453
+ };
165
454
  const deserializeMetadata = (output) => ({
166
455
  httpStatusCode: output.statusCode,
167
456
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -1,9 +1,25 @@
1
1
  import { WmsApiClient } from "./WmsApiClient";
2
+ import { CreatePbxOAuth2ClientCommandInput, CreatePbxOAuth2ClientCommandOutput } from "./commands/CreatePbxOAuth2ClientCommand";
3
+ import { DeletePbxOAuth2ClientCommandInput, DeletePbxOAuth2ClientCommandOutput } from "./commands/DeletePbxOAuth2ClientCommand";
2
4
  import { GetPbxAclGroupsPermissionsCommandInput, GetPbxAclGroupsPermissionsCommandOutput } from "./commands/GetPbxAclGroupsPermissionsCommand";
3
5
  import { GetPbxCallGroupsCommandInput, GetPbxCallGroupsCommandOutput } from "./commands/GetPbxCallGroupsCommand";
4
6
  import { GetPbxColleaguesCommandInput, GetPbxColleaguesCommandOutput } from "./commands/GetPbxColleaguesCommand";
7
+ import { GetPbxOAuth2ClientsCommandInput, GetPbxOAuth2ClientsCommandOutput } from "./commands/GetPbxOAuth2ClientsCommand";
8
+ import { UpdatePbxOAuth2ClientCommandInput, UpdatePbxOAuth2ClientCommandOutput } from "./commands/UpdatePbxOAuth2ClientCommand";
5
9
  import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
6
10
  export interface WmsApi {
11
+ /**
12
+ * @see {@link CreatePbxOAuth2ClientCommand}
13
+ */
14
+ createPbxOAuth2Client(args: CreatePbxOAuth2ClientCommandInput, options?: __HttpHandlerOptions): Promise<CreatePbxOAuth2ClientCommandOutput>;
15
+ createPbxOAuth2Client(args: CreatePbxOAuth2ClientCommandInput, cb: (err: any, data?: CreatePbxOAuth2ClientCommandOutput) => void): void;
16
+ createPbxOAuth2Client(args: CreatePbxOAuth2ClientCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: CreatePbxOAuth2ClientCommandOutput) => void): void;
17
+ /**
18
+ * @see {@link DeletePbxOAuth2ClientCommand}
19
+ */
20
+ deletePbxOAuth2Client(args: DeletePbxOAuth2ClientCommandInput, options?: __HttpHandlerOptions): Promise<DeletePbxOAuth2ClientCommandOutput>;
21
+ deletePbxOAuth2Client(args: DeletePbxOAuth2ClientCommandInput, cb: (err: any, data?: DeletePbxOAuth2ClientCommandOutput) => void): void;
22
+ deletePbxOAuth2Client(args: DeletePbxOAuth2ClientCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DeletePbxOAuth2ClientCommandOutput) => void): void;
7
23
  /**
8
24
  * @see {@link GetPbxAclGroupsPermissionsCommand}
9
25
  */
@@ -22,6 +38,18 @@ export interface WmsApi {
22
38
  getPbxColleagues(args: GetPbxColleaguesCommandInput, options?: __HttpHandlerOptions): Promise<GetPbxColleaguesCommandOutput>;
23
39
  getPbxColleagues(args: GetPbxColleaguesCommandInput, cb: (err: any, data?: GetPbxColleaguesCommandOutput) => void): void;
24
40
  getPbxColleagues(args: GetPbxColleaguesCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetPbxColleaguesCommandOutput) => void): void;
41
+ /**
42
+ * @see {@link GetPbxOAuth2ClientsCommand}
43
+ */
44
+ getPbxOAuth2Clients(args: GetPbxOAuth2ClientsCommandInput, options?: __HttpHandlerOptions): Promise<GetPbxOAuth2ClientsCommandOutput>;
45
+ getPbxOAuth2Clients(args: GetPbxOAuth2ClientsCommandInput, cb: (err: any, data?: GetPbxOAuth2ClientsCommandOutput) => void): void;
46
+ getPbxOAuth2Clients(args: GetPbxOAuth2ClientsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetPbxOAuth2ClientsCommandOutput) => void): void;
47
+ /**
48
+ * @see {@link UpdatePbxOAuth2ClientCommand}
49
+ */
50
+ updatePbxOAuth2Client(args: UpdatePbxOAuth2ClientCommandInput, options?: __HttpHandlerOptions): Promise<UpdatePbxOAuth2ClientCommandOutput>;
51
+ updatePbxOAuth2Client(args: UpdatePbxOAuth2ClientCommandInput, cb: (err: any, data?: UpdatePbxOAuth2ClientCommandOutput) => void): void;
52
+ updatePbxOAuth2Client(args: UpdatePbxOAuth2ClientCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: UpdatePbxOAuth2ClientCommandOutput) => void): void;
25
53
  }
26
54
  /**
27
55
  * @public
@@ -1,6 +1,10 @@
1
+ import { CreatePbxOAuth2ClientCommandInput, CreatePbxOAuth2ClientCommandOutput } from "./commands/CreatePbxOAuth2ClientCommand";
2
+ import { DeletePbxOAuth2ClientCommandInput, DeletePbxOAuth2ClientCommandOutput } from "./commands/DeletePbxOAuth2ClientCommand";
1
3
  import { GetPbxAclGroupsPermissionsCommandInput, GetPbxAclGroupsPermissionsCommandOutput } from "./commands/GetPbxAclGroupsPermissionsCommand";
2
4
  import { GetPbxCallGroupsCommandInput, GetPbxCallGroupsCommandOutput } from "./commands/GetPbxCallGroupsCommand";
3
5
  import { GetPbxColleaguesCommandInput, GetPbxColleaguesCommandOutput } from "./commands/GetPbxColleaguesCommand";
6
+ import { GetPbxOAuth2ClientsCommandInput, GetPbxOAuth2ClientsCommandOutput } from "./commands/GetPbxOAuth2ClientsCommand";
7
+ import { UpdatePbxOAuth2ClientCommandInput, UpdatePbxOAuth2ClientCommandOutput } from "./commands/UpdatePbxOAuth2ClientCommand";
4
8
  import { RuntimeExtension, RuntimeExtensionsConfig } from "./runtimeExtensions";
5
9
  import { HttpHandler as __HttpHandler } from "@smithy/protocol-http";
6
10
  import { Client as __Client, DefaultsMode as __DefaultsMode, SmithyConfiguration as __SmithyConfiguration, SmithyResolvedConfiguration as __SmithyResolvedConfiguration } from "@smithy/smithy-client";
@@ -10,11 +14,11 @@ export { __Client };
10
14
  /**
11
15
  * @public
12
16
  */
13
- export type ServiceInputTypes = GetPbxAclGroupsPermissionsCommandInput | GetPbxCallGroupsCommandInput | GetPbxColleaguesCommandInput;
17
+ export type ServiceInputTypes = CreatePbxOAuth2ClientCommandInput | DeletePbxOAuth2ClientCommandInput | GetPbxAclGroupsPermissionsCommandInput | GetPbxCallGroupsCommandInput | GetPbxColleaguesCommandInput | GetPbxOAuth2ClientsCommandInput | UpdatePbxOAuth2ClientCommandInput;
14
18
  /**
15
19
  * @public
16
20
  */
17
- export type ServiceOutputTypes = GetPbxAclGroupsPermissionsCommandOutput | GetPbxCallGroupsCommandOutput | GetPbxColleaguesCommandOutput;
21
+ export type ServiceOutputTypes = CreatePbxOAuth2ClientCommandOutput | DeletePbxOAuth2ClientCommandOutput | GetPbxAclGroupsPermissionsCommandOutput | GetPbxCallGroupsCommandOutput | GetPbxColleaguesCommandOutput | GetPbxOAuth2ClientsCommandOutput | UpdatePbxOAuth2ClientCommandOutput;
18
22
  /**
19
23
  * @public
20
24
  */