@wildix/wms-api-client 1.0.3 → 1.0.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 (29) 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 +313 -18
  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 +305 -18
  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 +2 -0
  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 +150 -0
  28. package/dist-types/protocols/Aws_restJson1.d.ts +36 -0
  29. package/package.json +1 -1
@@ -2,14 +2,22 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WmsApi = void 0;
4
4
  const WmsApiClient_1 = require("./WmsApiClient");
5
+ const CreatePbxOAuth2ClientCommand_1 = require("./commands/CreatePbxOAuth2ClientCommand");
6
+ const DeletePbxOAuth2ClientCommand_1 = require("./commands/DeletePbxOAuth2ClientCommand");
5
7
  const GetPbxAclGroupsPermissionsCommand_1 = require("./commands/GetPbxAclGroupsPermissionsCommand");
6
8
  const GetPbxCallGroupsCommand_1 = require("./commands/GetPbxCallGroupsCommand");
7
9
  const GetPbxColleaguesCommand_1 = require("./commands/GetPbxColleaguesCommand");
10
+ const GetPbxOAuth2ClientsCommand_1 = require("./commands/GetPbxOAuth2ClientsCommand");
11
+ const UpdatePbxOAuth2ClientCommand_1 = require("./commands/UpdatePbxOAuth2ClientCommand");
8
12
  const smithy_client_1 = require("@smithy/smithy-client");
9
13
  const commands = {
14
+ CreatePbxOAuth2ClientCommand: CreatePbxOAuth2ClientCommand_1.CreatePbxOAuth2ClientCommand,
15
+ DeletePbxOAuth2ClientCommand: DeletePbxOAuth2ClientCommand_1.DeletePbxOAuth2ClientCommand,
10
16
  GetPbxAclGroupsPermissionsCommand: GetPbxAclGroupsPermissionsCommand_1.GetPbxAclGroupsPermissionsCommand,
11
17
  GetPbxCallGroupsCommand: GetPbxCallGroupsCommand_1.GetPbxCallGroupsCommand,
12
18
  GetPbxColleaguesCommand: GetPbxColleaguesCommand_1.GetPbxColleaguesCommand,
19
+ GetPbxOAuth2ClientsCommand: GetPbxOAuth2ClientsCommand_1.GetPbxOAuth2ClientsCommand,
20
+ UpdatePbxOAuth2ClientCommand: UpdatePbxOAuth2ClientCommand_1.UpdatePbxOAuth2ClientCommand,
13
21
  };
14
22
  class WmsApi extends WmsApiClient_1.WmsApiClient {
15
23
  }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreatePbxOAuth2ClientCommand = exports.$Command = void 0;
4
+ const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
5
+ const middleware_serde_1 = require("@smithy/middleware-serde");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
+ const types_1 = require("@smithy/types");
9
+ class CreatePbxOAuth2ClientCommand extends smithy_client_1.Command {
10
+ constructor(input) {
11
+ super();
12
+ this.input = input;
13
+ }
14
+ resolveMiddleware(clientStack, configuration, options) {
15
+ this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
16
+ const stack = clientStack.concat(this.middlewareStack);
17
+ const { logger } = configuration;
18
+ const clientName = "WmsApiClient";
19
+ const commandName = "CreatePbxOAuth2ClientCommand";
20
+ const handlerExecutionContext = {
21
+ logger,
22
+ clientName,
23
+ commandName,
24
+ inputFilterSensitiveLog: (_) => _,
25
+ outputFilterSensitiveLog: (_) => _,
26
+ [types_1.SMITHY_CONTEXT_KEY]: {
27
+ service: "WmsApi",
28
+ operation: "CreatePbxOAuth2Client",
29
+ },
30
+ };
31
+ const { requestHandler } = configuration;
32
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
33
+ }
34
+ serialize(input, context) {
35
+ return (0, Aws_restJson1_1.se_CreatePbxOAuth2ClientCommand)(input, context);
36
+ }
37
+ deserialize(output, context) {
38
+ return (0, Aws_restJson1_1.de_CreatePbxOAuth2ClientCommand)(output, context);
39
+ }
40
+ }
41
+ exports.CreatePbxOAuth2ClientCommand = CreatePbxOAuth2ClientCommand;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeletePbxOAuth2ClientCommand = exports.$Command = void 0;
4
+ const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
5
+ const middleware_serde_1 = require("@smithy/middleware-serde");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
+ const types_1 = require("@smithy/types");
9
+ class DeletePbxOAuth2ClientCommand extends smithy_client_1.Command {
10
+ constructor(input) {
11
+ super();
12
+ this.input = input;
13
+ }
14
+ resolveMiddleware(clientStack, configuration, options) {
15
+ this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
16
+ const stack = clientStack.concat(this.middlewareStack);
17
+ const { logger } = configuration;
18
+ const clientName = "WmsApiClient";
19
+ const commandName = "DeletePbxOAuth2ClientCommand";
20
+ const handlerExecutionContext = {
21
+ logger,
22
+ clientName,
23
+ commandName,
24
+ inputFilterSensitiveLog: (_) => _,
25
+ outputFilterSensitiveLog: (_) => _,
26
+ [types_1.SMITHY_CONTEXT_KEY]: {
27
+ service: "WmsApi",
28
+ operation: "DeletePbxOAuth2Client",
29
+ },
30
+ };
31
+ const { requestHandler } = configuration;
32
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
33
+ }
34
+ serialize(input, context) {
35
+ return (0, Aws_restJson1_1.se_DeletePbxOAuth2ClientCommand)(input, context);
36
+ }
37
+ deserialize(output, context) {
38
+ return (0, Aws_restJson1_1.de_DeletePbxOAuth2ClientCommand)(output, context);
39
+ }
40
+ }
41
+ exports.DeletePbxOAuth2ClientCommand = DeletePbxOAuth2ClientCommand;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetPbxOAuth2ClientsCommand = exports.$Command = void 0;
4
+ const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
5
+ const middleware_serde_1 = require("@smithy/middleware-serde");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
+ const types_1 = require("@smithy/types");
9
+ class GetPbxOAuth2ClientsCommand extends smithy_client_1.Command {
10
+ constructor(input) {
11
+ super();
12
+ this.input = input;
13
+ }
14
+ resolveMiddleware(clientStack, configuration, options) {
15
+ this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
16
+ const stack = clientStack.concat(this.middlewareStack);
17
+ const { logger } = configuration;
18
+ const clientName = "WmsApiClient";
19
+ const commandName = "GetPbxOAuth2ClientsCommand";
20
+ const handlerExecutionContext = {
21
+ logger,
22
+ clientName,
23
+ commandName,
24
+ inputFilterSensitiveLog: (_) => _,
25
+ outputFilterSensitiveLog: (_) => _,
26
+ [types_1.SMITHY_CONTEXT_KEY]: {
27
+ service: "WmsApi",
28
+ operation: "GetPbxOAuth2Clients",
29
+ },
30
+ };
31
+ const { requestHandler } = configuration;
32
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
33
+ }
34
+ serialize(input, context) {
35
+ return (0, Aws_restJson1_1.se_GetPbxOAuth2ClientsCommand)(input, context);
36
+ }
37
+ deserialize(output, context) {
38
+ return (0, Aws_restJson1_1.de_GetPbxOAuth2ClientsCommand)(output, context);
39
+ }
40
+ }
41
+ exports.GetPbxOAuth2ClientsCommand = GetPbxOAuth2ClientsCommand;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdatePbxOAuth2ClientCommand = exports.$Command = void 0;
4
+ const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
5
+ const middleware_serde_1 = require("@smithy/middleware-serde");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
+ const types_1 = require("@smithy/types");
9
+ class UpdatePbxOAuth2ClientCommand extends smithy_client_1.Command {
10
+ constructor(input) {
11
+ super();
12
+ this.input = input;
13
+ }
14
+ resolveMiddleware(clientStack, configuration, options) {
15
+ this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
16
+ const stack = clientStack.concat(this.middlewareStack);
17
+ const { logger } = configuration;
18
+ const clientName = "WmsApiClient";
19
+ const commandName = "UpdatePbxOAuth2ClientCommand";
20
+ const handlerExecutionContext = {
21
+ logger,
22
+ clientName,
23
+ commandName,
24
+ inputFilterSensitiveLog: (_) => _,
25
+ outputFilterSensitiveLog: (_) => _,
26
+ [types_1.SMITHY_CONTEXT_KEY]: {
27
+ service: "WmsApi",
28
+ operation: "UpdatePbxOAuth2Client",
29
+ },
30
+ };
31
+ const { requestHandler } = configuration;
32
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
33
+ }
34
+ serialize(input, context) {
35
+ return (0, Aws_restJson1_1.se_UpdatePbxOAuth2ClientCommand)(input, context);
36
+ }
37
+ deserialize(output, context) {
38
+ return (0, Aws_restJson1_1.de_UpdatePbxOAuth2ClientCommand)(output, context);
39
+ }
40
+ }
41
+ exports.UpdatePbxOAuth2ClientCommand = UpdatePbxOAuth2ClientCommand;
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./CreatePbxOAuth2ClientCommand"), exports);
5
+ tslib_1.__exportStar(require("./DeletePbxOAuth2ClientCommand"), exports);
4
6
  tslib_1.__exportStar(require("./GetPbxAclGroupsPermissionsCommand"), exports);
5
7
  tslib_1.__exportStar(require("./GetPbxCallGroupsCommand"), exports);
6
8
  tslib_1.__exportStar(require("./GetPbxColleaguesCommand"), exports);
9
+ tslib_1.__exportStar(require("./GetPbxOAuth2ClientsCommand"), exports);
10
+ tslib_1.__exportStar(require("./UpdatePbxOAuth2ClientCommand"), exports);
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PbxColleagueRole = exports.PbxColleaguesSearchStrategy = exports.PbxColleaguesQueryField = exports.GetPbxColleaguesDir = exports.ResponseType = exports.PbxLicenseType = exports.AclGroupPermissionAbility = void 0;
3
+ exports.PbxColleagueRole = exports.PbxColleaguesSearchStrategy = exports.PbxColleaguesQueryField = exports.GetPbxColleaguesDir = exports.WmsNotFoundException = exports.WmsValidationException = exports.WmsUnauthorizedException = exports.ResponseType = exports.PbxLicenseType = exports.AclGroupPermissionAbility = void 0;
4
+ const WmsApiServiceException_1 = require("./WmsApiServiceException");
4
5
  exports.AclGroupPermissionAbility = {
5
6
  CAN: "can",
6
7
  CANNOT: "cannot",
@@ -18,6 +19,52 @@ exports.ResponseType = {
18
19
  ERROR: "error",
19
20
  RESULT: "result",
20
21
  };
22
+ class WmsUnauthorizedException extends WmsApiServiceException_1.WmsApiServiceException {
23
+ constructor(opts) {
24
+ super({
25
+ name: "WmsUnauthorizedException",
26
+ $fault: "client",
27
+ ...opts
28
+ });
29
+ this.name = "WmsUnauthorizedException";
30
+ this.$fault = "client";
31
+ Object.setPrototypeOf(this, WmsUnauthorizedException.prototype);
32
+ this.type = opts.type;
33
+ this.reason = opts.reason;
34
+ }
35
+ }
36
+ exports.WmsUnauthorizedException = WmsUnauthorizedException;
37
+ class WmsValidationException extends WmsApiServiceException_1.WmsApiServiceException {
38
+ constructor(opts) {
39
+ super({
40
+ name: "WmsValidationException",
41
+ $fault: "client",
42
+ ...opts
43
+ });
44
+ this.name = "WmsValidationException";
45
+ this.$fault = "client";
46
+ Object.setPrototypeOf(this, WmsValidationException.prototype);
47
+ this.type = opts.type;
48
+ this.reason = opts.reason;
49
+ this.errors = opts.errors;
50
+ }
51
+ }
52
+ exports.WmsValidationException = WmsValidationException;
53
+ class WmsNotFoundException extends WmsApiServiceException_1.WmsApiServiceException {
54
+ constructor(opts) {
55
+ super({
56
+ name: "WmsNotFoundException",
57
+ $fault: "client",
58
+ ...opts
59
+ });
60
+ this.name = "WmsNotFoundException";
61
+ this.$fault = "client";
62
+ Object.setPrototypeOf(this, WmsNotFoundException.prototype);
63
+ this.type = opts.type;
64
+ this.reason = opts.reason;
65
+ }
66
+ }
67
+ exports.WmsNotFoundException = WmsNotFoundException;
21
68
  exports.GetPbxColleaguesDir = {
22
69
  ASC: "asc",
23
70
  DESC: "desc",
@@ -1,9 +1,49 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_GetPbxColleaguesCommand = exports.de_GetPbxCallGroupsCommand = exports.de_GetPbxAclGroupsPermissionsCommand = exports.se_GetPbxColleaguesCommand = exports.se_GetPbxCallGroupsCommand = exports.se_GetPbxAclGroupsPermissionsCommand = void 0;
3
+ exports.de_UpdatePbxOAuth2ClientCommand = exports.de_GetPbxOAuth2ClientsCommand = exports.de_GetPbxColleaguesCommand = exports.de_GetPbxCallGroupsCommand = exports.de_GetPbxAclGroupsPermissionsCommand = exports.de_DeletePbxOAuth2ClientCommand = exports.de_CreatePbxOAuth2ClientCommand = exports.se_UpdatePbxOAuth2ClientCommand = exports.se_GetPbxOAuth2ClientsCommand = exports.se_GetPbxColleaguesCommand = exports.se_GetPbxCallGroupsCommand = exports.se_GetPbxAclGroupsPermissionsCommand = exports.se_DeletePbxOAuth2ClientCommand = exports.se_CreatePbxOAuth2ClientCommand = void 0;
4
4
  const WmsApiServiceException_1 = require("../models/WmsApiServiceException");
5
+ const models_0_1 = require("../models/models_0");
5
6
  const protocol_http_1 = require("@smithy/protocol-http");
6
7
  const smithy_client_1 = require("@smithy/smithy-client");
8
+ const se_CreatePbxOAuth2ClientCommand = async (input, context) => {
9
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
10
+ const headers = {
11
+ 'content-type': 'application/json',
12
+ };
13
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/api/v1/pbx/applications/oauth2";
14
+ let body;
15
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
16
+ 'name': [],
17
+ 'redirectUri': _ => (0, smithy_client_1._json)(_),
18
+ }));
19
+ return new protocol_http_1.HttpRequest({
20
+ protocol,
21
+ hostname,
22
+ port,
23
+ method: "POST",
24
+ headers,
25
+ path: resolvedPath,
26
+ body,
27
+ });
28
+ };
29
+ exports.se_CreatePbxOAuth2ClientCommand = se_CreatePbxOAuth2ClientCommand;
30
+ const se_DeletePbxOAuth2ClientCommand = async (input, context) => {
31
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
32
+ const headers = {};
33
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/api/v1/pbx/applications/oauth2/{id}";
34
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'id', () => input.id, '{id}', false);
35
+ let body;
36
+ return new protocol_http_1.HttpRequest({
37
+ protocol,
38
+ hostname,
39
+ port,
40
+ method: "DELETE",
41
+ headers,
42
+ path: resolvedPath,
43
+ body,
44
+ });
45
+ };
46
+ exports.se_DeletePbxOAuth2ClientCommand = se_DeletePbxOAuth2ClientCommand;
7
47
  const se_GetPbxAclGroupsPermissionsCommand = async (input, context) => {
8
48
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
9
49
  const headers = {
@@ -83,6 +123,124 @@ const se_GetPbxColleaguesCommand = async (input, context) => {
83
123
  });
84
124
  };
85
125
  exports.se_GetPbxColleaguesCommand = se_GetPbxColleaguesCommand;
126
+ const se_GetPbxOAuth2ClientsCommand = async (input, context) => {
127
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
128
+ const headers = {
129
+ 'content-type': 'application/json',
130
+ };
131
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/api/v1/pbx/applications/oauth2";
132
+ let body;
133
+ body = "";
134
+ return new protocol_http_1.HttpRequest({
135
+ protocol,
136
+ hostname,
137
+ port,
138
+ method: "GET",
139
+ headers,
140
+ path: resolvedPath,
141
+ body,
142
+ });
143
+ };
144
+ exports.se_GetPbxOAuth2ClientsCommand = se_GetPbxOAuth2ClientsCommand;
145
+ const se_UpdatePbxOAuth2ClientCommand = async (input, context) => {
146
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
147
+ const headers = {
148
+ 'content-type': 'application/json',
149
+ };
150
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/api/v1/pbx/applications/oauth2/{id}";
151
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, 'id', () => input.id, '{id}', false);
152
+ let body;
153
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
154
+ 'name': [],
155
+ 'redirectUri': _ => (0, smithy_client_1._json)(_),
156
+ }));
157
+ return new protocol_http_1.HttpRequest({
158
+ protocol,
159
+ hostname,
160
+ port,
161
+ method: "PUT",
162
+ headers,
163
+ path: resolvedPath,
164
+ body,
165
+ });
166
+ };
167
+ exports.se_UpdatePbxOAuth2ClientCommand = se_UpdatePbxOAuth2ClientCommand;
168
+ const de_CreatePbxOAuth2ClientCommand = async (output, context) => {
169
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
170
+ return de_CreatePbxOAuth2ClientCommandError(output, context);
171
+ }
172
+ const contents = (0, smithy_client_1.map)({
173
+ $metadata: deserializeMetadata(output),
174
+ });
175
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
176
+ const doc = (0, smithy_client_1.take)(data, {
177
+ 'result': smithy_client_1._json,
178
+ 'type': smithy_client_1.expectString,
179
+ });
180
+ Object.assign(contents, doc);
181
+ return contents;
182
+ };
183
+ exports.de_CreatePbxOAuth2ClientCommand = de_CreatePbxOAuth2ClientCommand;
184
+ const de_CreatePbxOAuth2ClientCommandError = async (output, context) => {
185
+ const parsedOutput = {
186
+ ...output,
187
+ body: await parseErrorBody(output.body, context)
188
+ };
189
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
190
+ switch (errorCode) {
191
+ case "WmsUnauthorizedException":
192
+ case "wildix.wms.api#WmsUnauthorizedException":
193
+ throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
194
+ case "WmsValidationException":
195
+ case "wildix.wms.api#WmsValidationException":
196
+ throw await de_WmsValidationExceptionRes(parsedOutput, context);
197
+ default:
198
+ const parsedBody = parsedOutput.body;
199
+ return throwDefaultError({
200
+ output,
201
+ parsedBody,
202
+ errorCode
203
+ });
204
+ }
205
+ };
206
+ const de_DeletePbxOAuth2ClientCommand = async (output, context) => {
207
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
208
+ return de_DeletePbxOAuth2ClientCommandError(output, context);
209
+ }
210
+ const contents = (0, smithy_client_1.map)({
211
+ $metadata: deserializeMetadata(output),
212
+ });
213
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
214
+ const doc = (0, smithy_client_1.take)(data, {
215
+ 'result': smithy_client_1.expectString,
216
+ 'type': smithy_client_1.expectString,
217
+ });
218
+ Object.assign(contents, doc);
219
+ return contents;
220
+ };
221
+ exports.de_DeletePbxOAuth2ClientCommand = de_DeletePbxOAuth2ClientCommand;
222
+ const de_DeletePbxOAuth2ClientCommandError = async (output, context) => {
223
+ const parsedOutput = {
224
+ ...output,
225
+ body: await parseErrorBody(output.body, context)
226
+ };
227
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
228
+ switch (errorCode) {
229
+ case "WmsNotFoundException":
230
+ case "wildix.wms.api#WmsNotFoundException":
231
+ throw await de_WmsNotFoundExceptionRes(parsedOutput, context);
232
+ case "WmsUnauthorizedException":
233
+ case "wildix.wms.api#WmsUnauthorizedException":
234
+ throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
235
+ default:
236
+ const parsedBody = parsedOutput.body;
237
+ return throwDefaultError({
238
+ output,
239
+ parsedBody,
240
+ errorCode
241
+ });
242
+ }
243
+ };
86
244
  const de_GetPbxAclGroupsPermissionsCommand = async (output, context) => {
87
245
  if (output.statusCode !== 200 && output.statusCode >= 300) {
88
246
  return de_GetPbxAclGroupsPermissionsCommandError(output, context);
@@ -105,12 +263,18 @@ const de_GetPbxAclGroupsPermissionsCommandError = async (output, context) => {
105
263
  body: await parseErrorBody(output.body, context)
106
264
  };
107
265
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
108
- const parsedBody = parsedOutput.body;
109
- return throwDefaultError({
110
- output,
111
- parsedBody,
112
- errorCode
113
- });
266
+ switch (errorCode) {
267
+ case "WmsUnauthorizedException":
268
+ case "wildix.wms.api#WmsUnauthorizedException":
269
+ throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
270
+ default:
271
+ const parsedBody = parsedOutput.body;
272
+ return throwDefaultError({
273
+ output,
274
+ parsedBody,
275
+ errorCode
276
+ });
277
+ }
114
278
  };
115
279
  const de_GetPbxCallGroupsCommand = async (output, context) => {
116
280
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -134,12 +298,18 @@ const de_GetPbxCallGroupsCommandError = async (output, context) => {
134
298
  body: await parseErrorBody(output.body, context)
135
299
  };
136
300
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
137
- const parsedBody = parsedOutput.body;
138
- return throwDefaultError({
139
- output,
140
- parsedBody,
141
- errorCode
142
- });
301
+ switch (errorCode) {
302
+ case "WmsUnauthorizedException":
303
+ case "wildix.wms.api#WmsUnauthorizedException":
304
+ throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
305
+ default:
306
+ const parsedBody = parsedOutput.body;
307
+ return throwDefaultError({
308
+ output,
309
+ parsedBody,
310
+ errorCode
311
+ });
312
+ }
143
313
  };
144
314
  const de_GetPbxColleaguesCommand = async (output, context) => {
145
315
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -163,14 +333,139 @@ const de_GetPbxColleaguesCommandError = async (output, context) => {
163
333
  body: await parseErrorBody(output.body, context)
164
334
  };
165
335
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
166
- const parsedBody = parsedOutput.body;
167
- return throwDefaultError({
168
- output,
169
- parsedBody,
170
- errorCode
336
+ switch (errorCode) {
337
+ case "WmsUnauthorizedException":
338
+ case "wildix.wms.api#WmsUnauthorizedException":
339
+ throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
340
+ default:
341
+ const parsedBody = parsedOutput.body;
342
+ return throwDefaultError({
343
+ output,
344
+ parsedBody,
345
+ errorCode
346
+ });
347
+ }
348
+ };
349
+ const de_GetPbxOAuth2ClientsCommand = async (output, context) => {
350
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
351
+ return de_GetPbxOAuth2ClientsCommandError(output, context);
352
+ }
353
+ const contents = (0, smithy_client_1.map)({
354
+ $metadata: deserializeMetadata(output),
355
+ });
356
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
357
+ const doc = (0, smithy_client_1.take)(data, {
358
+ 'result': smithy_client_1._json,
359
+ 'type': smithy_client_1.expectString,
360
+ });
361
+ Object.assign(contents, doc);
362
+ return contents;
363
+ };
364
+ exports.de_GetPbxOAuth2ClientsCommand = de_GetPbxOAuth2ClientsCommand;
365
+ const de_GetPbxOAuth2ClientsCommandError = async (output, context) => {
366
+ const parsedOutput = {
367
+ ...output,
368
+ body: await parseErrorBody(output.body, context)
369
+ };
370
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
371
+ switch (errorCode) {
372
+ case "WmsUnauthorizedException":
373
+ case "wildix.wms.api#WmsUnauthorizedException":
374
+ throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
375
+ default:
376
+ const parsedBody = parsedOutput.body;
377
+ return throwDefaultError({
378
+ output,
379
+ parsedBody,
380
+ errorCode
381
+ });
382
+ }
383
+ };
384
+ const de_UpdatePbxOAuth2ClientCommand = async (output, context) => {
385
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
386
+ return de_UpdatePbxOAuth2ClientCommandError(output, context);
387
+ }
388
+ const contents = (0, smithy_client_1.map)({
389
+ $metadata: deserializeMetadata(output),
390
+ });
391
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
392
+ const doc = (0, smithy_client_1.take)(data, {
393
+ 'result': smithy_client_1._json,
394
+ 'type': smithy_client_1.expectString,
171
395
  });
396
+ Object.assign(contents, doc);
397
+ return contents;
398
+ };
399
+ exports.de_UpdatePbxOAuth2ClientCommand = de_UpdatePbxOAuth2ClientCommand;
400
+ const de_UpdatePbxOAuth2ClientCommandError = async (output, context) => {
401
+ const parsedOutput = {
402
+ ...output,
403
+ body: await parseErrorBody(output.body, context)
404
+ };
405
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
406
+ switch (errorCode) {
407
+ case "WmsNotFoundException":
408
+ case "wildix.wms.api#WmsNotFoundException":
409
+ throw await de_WmsNotFoundExceptionRes(parsedOutput, context);
410
+ case "WmsUnauthorizedException":
411
+ case "wildix.wms.api#WmsUnauthorizedException":
412
+ throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
413
+ case "WmsValidationException":
414
+ case "wildix.wms.api#WmsValidationException":
415
+ throw await de_WmsValidationExceptionRes(parsedOutput, context);
416
+ default:
417
+ const parsedBody = parsedOutput.body;
418
+ return throwDefaultError({
419
+ output,
420
+ parsedBody,
421
+ errorCode
422
+ });
423
+ }
172
424
  };
173
425
  const throwDefaultError = (0, smithy_client_1.withBaseException)(WmsApiServiceException_1.WmsApiServiceException);
426
+ const de_WmsNotFoundExceptionRes = async (parsedOutput, context) => {
427
+ const contents = (0, smithy_client_1.map)({});
428
+ const data = parsedOutput.body;
429
+ const doc = (0, smithy_client_1.take)(data, {
430
+ 'reason': smithy_client_1.expectString,
431
+ 'type': smithy_client_1.expectString,
432
+ });
433
+ Object.assign(contents, doc);
434
+ const exception = new models_0_1.WmsNotFoundException({
435
+ $metadata: deserializeMetadata(parsedOutput),
436
+ ...contents
437
+ });
438
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
439
+ };
440
+ const de_WmsUnauthorizedExceptionRes = async (parsedOutput, context) => {
441
+ const contents = (0, smithy_client_1.map)({});
442
+ const data = parsedOutput.body;
443
+ const doc = (0, smithy_client_1.take)(data, {
444
+ 'reason': smithy_client_1.expectString,
445
+ 'type': smithy_client_1.expectString,
446
+ });
447
+ Object.assign(contents, doc);
448
+ const exception = new models_0_1.WmsUnauthorizedException({
449
+ $metadata: deserializeMetadata(parsedOutput),
450
+ ...contents
451
+ });
452
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
453
+ };
454
+ const de_WmsValidationExceptionRes = async (parsedOutput, context) => {
455
+ const contents = (0, smithy_client_1.map)({});
456
+ const data = parsedOutput.body;
457
+ const doc = (0, smithy_client_1.take)(data, {
458
+ 'errors': smithy_client_1._json,
459
+ 'reason': smithy_client_1.expectString,
460
+ 'type': smithy_client_1.expectString,
461
+ });
462
+ Object.assign(contents, doc);
463
+ const exception = new models_0_1.WmsValidationException({
464
+ $metadata: deserializeMetadata(parsedOutput),
465
+ ...contents
466
+ });
467
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
468
+ };
174
469
  const deserializeMetadata = (output) => ({
175
470
  httpStatusCode: output.statusCode,
176
471
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
package/dist-es/WmsApi.js CHANGED
@@ -1,12 +1,20 @@
1
1
  import { WmsApiClient, } from "./WmsApiClient";
2
+ import { CreatePbxOAuth2ClientCommand, } from "./commands/CreatePbxOAuth2ClientCommand";
3
+ import { DeletePbxOAuth2ClientCommand, } from "./commands/DeletePbxOAuth2ClientCommand";
2
4
  import { GetPbxAclGroupsPermissionsCommand, } from "./commands/GetPbxAclGroupsPermissionsCommand";
3
5
  import { GetPbxCallGroupsCommand, } from "./commands/GetPbxCallGroupsCommand";
4
6
  import { GetPbxColleaguesCommand, } from "./commands/GetPbxColleaguesCommand";
7
+ import { GetPbxOAuth2ClientsCommand, } from "./commands/GetPbxOAuth2ClientsCommand";
8
+ import { UpdatePbxOAuth2ClientCommand, } from "./commands/UpdatePbxOAuth2ClientCommand";
5
9
  import { createAggregatedClient } from "@smithy/smithy-client";
6
10
  const commands = {
11
+ CreatePbxOAuth2ClientCommand,
12
+ DeletePbxOAuth2ClientCommand,
7
13
  GetPbxAclGroupsPermissionsCommand,
8
14
  GetPbxCallGroupsCommand,
9
15
  GetPbxColleaguesCommand,
16
+ GetPbxOAuth2ClientsCommand,
17
+ UpdatePbxOAuth2ClientCommand,
10
18
  };
11
19
  export class WmsApi extends WmsApiClient {
12
20
  }