@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.
- package/dist-cjs/WmsApi.js +8 -0
- package/dist-cjs/commands/CreatePbxOAuth2ClientCommand.js +41 -0
- package/dist-cjs/commands/DeletePbxOAuth2ClientCommand.js +41 -0
- package/dist-cjs/commands/GetPbxOAuth2ClientsCommand.js +41 -0
- package/dist-cjs/commands/UpdatePbxOAuth2ClientCommand.js +41 -0
- package/dist-cjs/commands/index.js +4 -0
- package/dist-cjs/models/models_0.js +48 -1
- package/dist-cjs/protocols/Aws_restJson1.js +313 -18
- package/dist-es/WmsApi.js +8 -0
- package/dist-es/commands/CreatePbxOAuth2ClientCommand.js +37 -0
- package/dist-es/commands/DeletePbxOAuth2ClientCommand.js +37 -0
- package/dist-es/commands/GetPbxOAuth2ClientsCommand.js +37 -0
- package/dist-es/commands/UpdatePbxOAuth2ClientCommand.js +37 -0
- package/dist-es/commands/index.js +4 -0
- package/dist-es/models/models_0.js +44 -0
- package/dist-es/protocols/Aws_restJson1.js +305 -18
- package/dist-types/WmsApi.d.ts +28 -0
- package/dist-types/WmsApiClient.d.ts +6 -2
- package/dist-types/commands/CreatePbxOAuth2ClientCommand.d.ts +91 -0
- package/dist-types/commands/DeletePbxOAuth2ClientCommand.d.ts +76 -0
- package/dist-types/commands/GetPbxAclGroupsPermissionsCommand.d.ts +2 -0
- package/dist-types/commands/GetPbxCallGroupsCommand.d.ts +2 -0
- package/dist-types/commands/GetPbxColleaguesCommand.d.ts +2 -0
- package/dist-types/commands/GetPbxOAuth2ClientsCommand.d.ts +84 -0
- package/dist-types/commands/UpdatePbxOAuth2ClientCommand.d.ts +94 -0
- package/dist-types/commands/index.d.ts +4 -0
- package/dist-types/models/models_0.d.ts +150 -0
- package/dist-types/protocols/Aws_restJson1.d.ts +36 -0
- 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,6 +1,44 @@
|
|
|
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
|
+
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) => {
|
|
6
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
7
|
+
const headers = {
|
|
8
|
+
'content-type': 'application/json',
|
|
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
|
+
};
|
|
4
42
|
export const se_GetPbxAclGroupsPermissionsCommand = async (input, context) => {
|
|
5
43
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
6
44
|
const headers = {
|
|
@@ -77,6 +115,120 @@ export const se_GetPbxColleaguesCommand = async (input, context) => {
|
|
|
77
115
|
body,
|
|
78
116
|
});
|
|
79
117
|
};
|
|
118
|
+
export const se_GetPbxOAuth2ClientsCommand = async (input, context) => {
|
|
119
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
120
|
+
const headers = {
|
|
121
|
+
'content-type': 'application/json',
|
|
122
|
+
};
|
|
123
|
+
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/api/v1/pbx/applications/oauth2";
|
|
124
|
+
let body;
|
|
125
|
+
body = "";
|
|
126
|
+
return new __HttpRequest({
|
|
127
|
+
protocol,
|
|
128
|
+
hostname,
|
|
129
|
+
port,
|
|
130
|
+
method: "GET",
|
|
131
|
+
headers,
|
|
132
|
+
path: resolvedPath,
|
|
133
|
+
body,
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
export const se_UpdatePbxOAuth2ClientCommand = async (input, context) => {
|
|
137
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
138
|
+
const headers = {
|
|
139
|
+
'content-type': 'application/json',
|
|
140
|
+
};
|
|
141
|
+
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/api/v1/pbx/applications/oauth2/{id}";
|
|
142
|
+
resolvedPath = __resolvedPath(resolvedPath, input, 'id', () => input.id, '{id}', false);
|
|
143
|
+
let body;
|
|
144
|
+
body = JSON.stringify(take(input, {
|
|
145
|
+
'name': [],
|
|
146
|
+
'redirectUri': _ => _json(_),
|
|
147
|
+
}));
|
|
148
|
+
return new __HttpRequest({
|
|
149
|
+
protocol,
|
|
150
|
+
hostname,
|
|
151
|
+
port,
|
|
152
|
+
method: "PUT",
|
|
153
|
+
headers,
|
|
154
|
+
path: resolvedPath,
|
|
155
|
+
body,
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
export const de_CreatePbxOAuth2ClientCommand = async (output, context) => {
|
|
159
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
160
|
+
return de_CreatePbxOAuth2ClientCommandError(output, context);
|
|
161
|
+
}
|
|
162
|
+
const contents = map({
|
|
163
|
+
$metadata: deserializeMetadata(output),
|
|
164
|
+
});
|
|
165
|
+
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
166
|
+
const doc = take(data, {
|
|
167
|
+
'result': _json,
|
|
168
|
+
'type': __expectString,
|
|
169
|
+
});
|
|
170
|
+
Object.assign(contents, doc);
|
|
171
|
+
return contents;
|
|
172
|
+
};
|
|
173
|
+
const de_CreatePbxOAuth2ClientCommandError = async (output, context) => {
|
|
174
|
+
const parsedOutput = {
|
|
175
|
+
...output,
|
|
176
|
+
body: await parseErrorBody(output.body, context)
|
|
177
|
+
};
|
|
178
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
179
|
+
switch (errorCode) {
|
|
180
|
+
case "WmsUnauthorizedException":
|
|
181
|
+
case "wildix.wms.api#WmsUnauthorizedException":
|
|
182
|
+
throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
|
|
183
|
+
case "WmsValidationException":
|
|
184
|
+
case "wildix.wms.api#WmsValidationException":
|
|
185
|
+
throw await de_WmsValidationExceptionRes(parsedOutput, context);
|
|
186
|
+
default:
|
|
187
|
+
const parsedBody = parsedOutput.body;
|
|
188
|
+
return throwDefaultError({
|
|
189
|
+
output,
|
|
190
|
+
parsedBody,
|
|
191
|
+
errorCode
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
export const de_DeletePbxOAuth2ClientCommand = async (output, context) => {
|
|
196
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
197
|
+
return de_DeletePbxOAuth2ClientCommandError(output, context);
|
|
198
|
+
}
|
|
199
|
+
const contents = map({
|
|
200
|
+
$metadata: deserializeMetadata(output),
|
|
201
|
+
});
|
|
202
|
+
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
203
|
+
const doc = take(data, {
|
|
204
|
+
'result': __expectString,
|
|
205
|
+
'type': __expectString,
|
|
206
|
+
});
|
|
207
|
+
Object.assign(contents, doc);
|
|
208
|
+
return contents;
|
|
209
|
+
};
|
|
210
|
+
const de_DeletePbxOAuth2ClientCommandError = async (output, context) => {
|
|
211
|
+
const parsedOutput = {
|
|
212
|
+
...output,
|
|
213
|
+
body: await parseErrorBody(output.body, context)
|
|
214
|
+
};
|
|
215
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
216
|
+
switch (errorCode) {
|
|
217
|
+
case "WmsNotFoundException":
|
|
218
|
+
case "wildix.wms.api#WmsNotFoundException":
|
|
219
|
+
throw await de_WmsNotFoundExceptionRes(parsedOutput, context);
|
|
220
|
+
case "WmsUnauthorizedException":
|
|
221
|
+
case "wildix.wms.api#WmsUnauthorizedException":
|
|
222
|
+
throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
|
|
223
|
+
default:
|
|
224
|
+
const parsedBody = parsedOutput.body;
|
|
225
|
+
return throwDefaultError({
|
|
226
|
+
output,
|
|
227
|
+
parsedBody,
|
|
228
|
+
errorCode
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
};
|
|
80
232
|
export const de_GetPbxAclGroupsPermissionsCommand = async (output, context) => {
|
|
81
233
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
82
234
|
return de_GetPbxAclGroupsPermissionsCommandError(output, context);
|
|
@@ -98,12 +250,18 @@ const de_GetPbxAclGroupsPermissionsCommandError = async (output, context) => {
|
|
|
98
250
|
body: await parseErrorBody(output.body, context)
|
|
99
251
|
};
|
|
100
252
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
253
|
+
switch (errorCode) {
|
|
254
|
+
case "WmsUnauthorizedException":
|
|
255
|
+
case "wildix.wms.api#WmsUnauthorizedException":
|
|
256
|
+
throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
|
|
257
|
+
default:
|
|
258
|
+
const parsedBody = parsedOutput.body;
|
|
259
|
+
return throwDefaultError({
|
|
260
|
+
output,
|
|
261
|
+
parsedBody,
|
|
262
|
+
errorCode
|
|
263
|
+
});
|
|
264
|
+
}
|
|
107
265
|
};
|
|
108
266
|
export const de_GetPbxCallGroupsCommand = async (output, context) => {
|
|
109
267
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
@@ -126,12 +284,18 @@ const de_GetPbxCallGroupsCommandError = async (output, context) => {
|
|
|
126
284
|
body: await parseErrorBody(output.body, context)
|
|
127
285
|
};
|
|
128
286
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
287
|
+
switch (errorCode) {
|
|
288
|
+
case "WmsUnauthorizedException":
|
|
289
|
+
case "wildix.wms.api#WmsUnauthorizedException":
|
|
290
|
+
throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
|
|
291
|
+
default:
|
|
292
|
+
const parsedBody = parsedOutput.body;
|
|
293
|
+
return throwDefaultError({
|
|
294
|
+
output,
|
|
295
|
+
parsedBody,
|
|
296
|
+
errorCode
|
|
297
|
+
});
|
|
298
|
+
}
|
|
135
299
|
};
|
|
136
300
|
export const de_GetPbxColleaguesCommand = async (output, context) => {
|
|
137
301
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
@@ -154,14 +318,137 @@ const de_GetPbxColleaguesCommandError = async (output, context) => {
|
|
|
154
318
|
body: await parseErrorBody(output.body, context)
|
|
155
319
|
};
|
|
156
320
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
321
|
+
switch (errorCode) {
|
|
322
|
+
case "WmsUnauthorizedException":
|
|
323
|
+
case "wildix.wms.api#WmsUnauthorizedException":
|
|
324
|
+
throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
|
|
325
|
+
default:
|
|
326
|
+
const parsedBody = parsedOutput.body;
|
|
327
|
+
return throwDefaultError({
|
|
328
|
+
output,
|
|
329
|
+
parsedBody,
|
|
330
|
+
errorCode
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
export const de_GetPbxOAuth2ClientsCommand = async (output, context) => {
|
|
335
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
336
|
+
return de_GetPbxOAuth2ClientsCommandError(output, context);
|
|
337
|
+
}
|
|
338
|
+
const contents = map({
|
|
339
|
+
$metadata: deserializeMetadata(output),
|
|
340
|
+
});
|
|
341
|
+
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
342
|
+
const doc = take(data, {
|
|
343
|
+
'result': _json,
|
|
344
|
+
'type': __expectString,
|
|
345
|
+
});
|
|
346
|
+
Object.assign(contents, doc);
|
|
347
|
+
return contents;
|
|
348
|
+
};
|
|
349
|
+
const de_GetPbxOAuth2ClientsCommandError = async (output, context) => {
|
|
350
|
+
const parsedOutput = {
|
|
351
|
+
...output,
|
|
352
|
+
body: await parseErrorBody(output.body, context)
|
|
353
|
+
};
|
|
354
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
355
|
+
switch (errorCode) {
|
|
356
|
+
case "WmsUnauthorizedException":
|
|
357
|
+
case "wildix.wms.api#WmsUnauthorizedException":
|
|
358
|
+
throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
|
|
359
|
+
default:
|
|
360
|
+
const parsedBody = parsedOutput.body;
|
|
361
|
+
return throwDefaultError({
|
|
362
|
+
output,
|
|
363
|
+
parsedBody,
|
|
364
|
+
errorCode
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
export const de_UpdatePbxOAuth2ClientCommand = async (output, context) => {
|
|
369
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
370
|
+
return de_UpdatePbxOAuth2ClientCommandError(output, context);
|
|
371
|
+
}
|
|
372
|
+
const contents = map({
|
|
373
|
+
$metadata: deserializeMetadata(output),
|
|
374
|
+
});
|
|
375
|
+
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
376
|
+
const doc = take(data, {
|
|
377
|
+
'result': _json,
|
|
378
|
+
'type': __expectString,
|
|
162
379
|
});
|
|
380
|
+
Object.assign(contents, doc);
|
|
381
|
+
return contents;
|
|
382
|
+
};
|
|
383
|
+
const de_UpdatePbxOAuth2ClientCommandError = async (output, context) => {
|
|
384
|
+
const parsedOutput = {
|
|
385
|
+
...output,
|
|
386
|
+
body: await parseErrorBody(output.body, context)
|
|
387
|
+
};
|
|
388
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
389
|
+
switch (errorCode) {
|
|
390
|
+
case "WmsNotFoundException":
|
|
391
|
+
case "wildix.wms.api#WmsNotFoundException":
|
|
392
|
+
throw await de_WmsNotFoundExceptionRes(parsedOutput, context);
|
|
393
|
+
case "WmsUnauthorizedException":
|
|
394
|
+
case "wildix.wms.api#WmsUnauthorizedException":
|
|
395
|
+
throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
|
|
396
|
+
case "WmsValidationException":
|
|
397
|
+
case "wildix.wms.api#WmsValidationException":
|
|
398
|
+
throw await de_WmsValidationExceptionRes(parsedOutput, context);
|
|
399
|
+
default:
|
|
400
|
+
const parsedBody = parsedOutput.body;
|
|
401
|
+
return throwDefaultError({
|
|
402
|
+
output,
|
|
403
|
+
parsedBody,
|
|
404
|
+
errorCode
|
|
405
|
+
});
|
|
406
|
+
}
|
|
163
407
|
};
|
|
164
408
|
const throwDefaultError = withBaseException(__BaseException);
|
|
409
|
+
const de_WmsNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
410
|
+
const contents = map({});
|
|
411
|
+
const data = parsedOutput.body;
|
|
412
|
+
const doc = take(data, {
|
|
413
|
+
'reason': __expectString,
|
|
414
|
+
'type': __expectString,
|
|
415
|
+
});
|
|
416
|
+
Object.assign(contents, doc);
|
|
417
|
+
const exception = new WmsNotFoundException({
|
|
418
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
419
|
+
...contents
|
|
420
|
+
});
|
|
421
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
422
|
+
};
|
|
423
|
+
const de_WmsUnauthorizedExceptionRes = async (parsedOutput, context) => {
|
|
424
|
+
const contents = map({});
|
|
425
|
+
const data = parsedOutput.body;
|
|
426
|
+
const doc = take(data, {
|
|
427
|
+
'reason': __expectString,
|
|
428
|
+
'type': __expectString,
|
|
429
|
+
});
|
|
430
|
+
Object.assign(contents, doc);
|
|
431
|
+
const exception = new WmsUnauthorizedException({
|
|
432
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
433
|
+
...contents
|
|
434
|
+
});
|
|
435
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
436
|
+
};
|
|
437
|
+
const de_WmsValidationExceptionRes = async (parsedOutput, context) => {
|
|
438
|
+
const contents = map({});
|
|
439
|
+
const data = parsedOutput.body;
|
|
440
|
+
const doc = take(data, {
|
|
441
|
+
'errors': _json,
|
|
442
|
+
'reason': __expectString,
|
|
443
|
+
'type': __expectString,
|
|
444
|
+
});
|
|
445
|
+
Object.assign(contents, doc);
|
|
446
|
+
const exception = new WmsValidationException({
|
|
447
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
448
|
+
...contents
|
|
449
|
+
});
|
|
450
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
451
|
+
};
|
|
165
452
|
const deserializeMetadata = (output) => ({
|
|
166
453
|
httpStatusCode: output.statusCode,
|
|
167
454
|
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
package/dist-types/WmsApi.d.ts
CHANGED
|
@@ -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
|
*/
|