@aws-sdk/client-sso-oidc 3.183.0 → 3.185.0
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/CHANGELOG.md +11 -0
- package/dist-cjs/protocols/Aws_restJson1.js +2 -2
- package/dist-es/SSOOIDC.js +21 -14
- package/dist-es/SSOOIDCClient.js +26 -20
- package/dist-es/commands/CreateTokenCommand.js +28 -21
- package/dist-es/commands/RegisterClientCommand.js +28 -21
- package/dist-es/commands/StartDeviceAuthorizationCommand.js +28 -21
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/SSOOIDCServiceException.js +10 -5
- package/dist-es/models/models_0.js +163 -174
- package/dist-es/protocols/Aws_restJson1.js +560 -454
- package/dist-es/runtimeConfig.browser.js +12 -25
- package/dist-es/runtimeConfig.js +12 -29
- package/dist-es/runtimeConfig.native.js +5 -8
- package/dist-es/runtimeConfig.shared.js +11 -8
- package/package.json +3 -3
|
@@ -1,491 +1,597 @@
|
|
|
1
|
+
import { __assign, __awaiter, __generator } from "tslib";
|
|
1
2
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
2
3
|
import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
3
4
|
import { AccessDeniedException, AuthorizationPendingException, ExpiredTokenException, InternalServerException, InvalidClientException, InvalidClientMetadataException, InvalidGrantException, InvalidRequestException, InvalidScopeException, SlowDownException, UnauthorizedClientException, UnsupportedGrantTypeException, } from "../models/models_0";
|
|
4
5
|
import { SSOOIDCServiceException as __BaseException } from "../models/SSOOIDCServiceException";
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
6
|
+
export var serializeAws_restJson1CreateTokenCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
8
|
+
return __generator(this, function (_c) {
|
|
9
|
+
switch (_c.label) {
|
|
10
|
+
case 0: return [4, context.endpoint()];
|
|
11
|
+
case 1:
|
|
12
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
13
|
+
headers = {
|
|
14
|
+
"content-type": "application/json",
|
|
15
|
+
};
|
|
16
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/token";
|
|
17
|
+
body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.clientId != null && { clientId: input.clientId })), (input.clientSecret != null && { clientSecret: input.clientSecret })), (input.code != null && { code: input.code })), (input.deviceCode != null && { deviceCode: input.deviceCode })), (input.grantType != null && { grantType: input.grantType })), (input.redirectUri != null && { redirectUri: input.redirectUri })), (input.refreshToken != null && { refreshToken: input.refreshToken })), (input.scope != null && { scope: serializeAws_restJson1Scopes(input.scope, context) })));
|
|
18
|
+
return [2, new __HttpRequest({
|
|
19
|
+
protocol: protocol,
|
|
20
|
+
hostname: hostname,
|
|
21
|
+
port: port,
|
|
22
|
+
method: "POST",
|
|
23
|
+
headers: headers,
|
|
24
|
+
path: resolvedPath,
|
|
25
|
+
body: body,
|
|
26
|
+
})];
|
|
27
|
+
}
|
|
21
28
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
}); };
|
|
30
|
+
export var serializeAws_restJson1RegisterClientCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
31
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
32
|
+
return __generator(this, function (_c) {
|
|
33
|
+
switch (_c.label) {
|
|
34
|
+
case 0: return [4, context.endpoint()];
|
|
35
|
+
case 1:
|
|
36
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
37
|
+
headers = {
|
|
38
|
+
"content-type": "application/json",
|
|
39
|
+
};
|
|
40
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/client/register";
|
|
41
|
+
body = JSON.stringify(__assign(__assign(__assign({}, (input.clientName != null && { clientName: input.clientName })), (input.clientType != null && { clientType: input.clientType })), (input.scopes != null && { scopes: serializeAws_restJson1Scopes(input.scopes, context) })));
|
|
42
|
+
return [2, new __HttpRequest({
|
|
43
|
+
protocol: protocol,
|
|
44
|
+
hostname: hostname,
|
|
45
|
+
port: port,
|
|
46
|
+
method: "POST",
|
|
47
|
+
headers: headers,
|
|
48
|
+
path: resolvedPath,
|
|
49
|
+
body: body,
|
|
50
|
+
})];
|
|
51
|
+
}
|
|
30
52
|
});
|
|
31
|
-
};
|
|
32
|
-
export
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
53
|
+
}); };
|
|
54
|
+
export var serializeAws_restJson1StartDeviceAuthorizationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
55
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
56
|
+
return __generator(this, function (_c) {
|
|
57
|
+
switch (_c.label) {
|
|
58
|
+
case 0: return [4, context.endpoint()];
|
|
59
|
+
case 1:
|
|
60
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
61
|
+
headers = {
|
|
62
|
+
"content-type": "application/json",
|
|
63
|
+
};
|
|
64
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/device_authorization";
|
|
65
|
+
body = JSON.stringify(__assign(__assign(__assign({}, (input.clientId != null && { clientId: input.clientId })), (input.clientSecret != null && { clientSecret: input.clientSecret })), (input.startUrl != null && { startUrl: input.startUrl })));
|
|
66
|
+
return [2, new __HttpRequest({
|
|
67
|
+
protocol: protocol,
|
|
68
|
+
hostname: hostname,
|
|
69
|
+
port: port,
|
|
70
|
+
method: "POST",
|
|
71
|
+
headers: headers,
|
|
72
|
+
path: resolvedPath,
|
|
73
|
+
body: body,
|
|
74
|
+
})];
|
|
75
|
+
}
|
|
43
76
|
});
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
77
|
+
}); };
|
|
78
|
+
export var deserializeAws_restJson1CreateTokenCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
79
|
+
var contents, data, _a, _b;
|
|
80
|
+
return __generator(this, function (_c) {
|
|
81
|
+
switch (_c.label) {
|
|
82
|
+
case 0:
|
|
83
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
84
|
+
return [2, deserializeAws_restJson1CreateTokenCommandError(output, context)];
|
|
85
|
+
}
|
|
86
|
+
contents = map({
|
|
87
|
+
$metadata: deserializeMetadata(output),
|
|
88
|
+
});
|
|
89
|
+
_a = __expectNonNull;
|
|
90
|
+
_b = __expectObject;
|
|
91
|
+
return [4, parseBody(output.body, context)];
|
|
92
|
+
case 1:
|
|
93
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
94
|
+
if (data.accessToken != null) {
|
|
95
|
+
contents.accessToken = __expectString(data.accessToken);
|
|
96
|
+
}
|
|
97
|
+
if (data.expiresIn != null) {
|
|
98
|
+
contents.expiresIn = __expectInt32(data.expiresIn);
|
|
99
|
+
}
|
|
100
|
+
if (data.idToken != null) {
|
|
101
|
+
contents.idToken = __expectString(data.idToken);
|
|
102
|
+
}
|
|
103
|
+
if (data.refreshToken != null) {
|
|
104
|
+
contents.refreshToken = __expectString(data.refreshToken);
|
|
105
|
+
}
|
|
106
|
+
if (data.tokenType != null) {
|
|
107
|
+
contents.tokenType = __expectString(data.tokenType);
|
|
108
|
+
}
|
|
109
|
+
return [2, contents];
|
|
110
|
+
}
|
|
52
111
|
});
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
112
|
+
}); };
|
|
113
|
+
var deserializeAws_restJson1CreateTokenCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
114
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
115
|
+
var _c;
|
|
116
|
+
return __generator(this, function (_d) {
|
|
117
|
+
switch (_d.label) {
|
|
118
|
+
case 0:
|
|
119
|
+
_a = [__assign({}, output)];
|
|
120
|
+
_c = {};
|
|
121
|
+
return [4, parseErrorBody(output.body, context)];
|
|
122
|
+
case 1:
|
|
123
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
124
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
125
|
+
_b = errorCode;
|
|
126
|
+
switch (_b) {
|
|
127
|
+
case "AccessDeniedException": return [3, 2];
|
|
128
|
+
case "com.amazonaws.ssooidc#AccessDeniedException": return [3, 2];
|
|
129
|
+
case "AuthorizationPendingException": return [3, 4];
|
|
130
|
+
case "com.amazonaws.ssooidc#AuthorizationPendingException": return [3, 4];
|
|
131
|
+
case "ExpiredTokenException": return [3, 6];
|
|
132
|
+
case "com.amazonaws.ssooidc#ExpiredTokenException": return [3, 6];
|
|
133
|
+
case "InternalServerException": return [3, 8];
|
|
134
|
+
case "com.amazonaws.ssooidc#InternalServerException": return [3, 8];
|
|
135
|
+
case "InvalidClientException": return [3, 10];
|
|
136
|
+
case "com.amazonaws.ssooidc#InvalidClientException": return [3, 10];
|
|
137
|
+
case "InvalidGrantException": return [3, 12];
|
|
138
|
+
case "com.amazonaws.ssooidc#InvalidGrantException": return [3, 12];
|
|
139
|
+
case "InvalidRequestException": return [3, 14];
|
|
140
|
+
case "com.amazonaws.ssooidc#InvalidRequestException": return [3, 14];
|
|
141
|
+
case "InvalidScopeException": return [3, 16];
|
|
142
|
+
case "com.amazonaws.ssooidc#InvalidScopeException": return [3, 16];
|
|
143
|
+
case "SlowDownException": return [3, 18];
|
|
144
|
+
case "com.amazonaws.ssooidc#SlowDownException": return [3, 18];
|
|
145
|
+
case "UnauthorizedClientException": return [3, 20];
|
|
146
|
+
case "com.amazonaws.ssooidc#UnauthorizedClientException": return [3, 20];
|
|
147
|
+
case "UnsupportedGrantTypeException": return [3, 22];
|
|
148
|
+
case "com.amazonaws.ssooidc#UnsupportedGrantTypeException": return [3, 22];
|
|
149
|
+
}
|
|
150
|
+
return [3, 24];
|
|
151
|
+
case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
152
|
+
case 3: throw _d.sent();
|
|
153
|
+
case 4: return [4, deserializeAws_restJson1AuthorizationPendingExceptionResponse(parsedOutput, context)];
|
|
154
|
+
case 5: throw _d.sent();
|
|
155
|
+
case 6: return [4, deserializeAws_restJson1ExpiredTokenExceptionResponse(parsedOutput, context)];
|
|
156
|
+
case 7: throw _d.sent();
|
|
157
|
+
case 8: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
158
|
+
case 9: throw _d.sent();
|
|
159
|
+
case 10: return [4, deserializeAws_restJson1InvalidClientExceptionResponse(parsedOutput, context)];
|
|
160
|
+
case 11: throw _d.sent();
|
|
161
|
+
case 12: return [4, deserializeAws_restJson1InvalidGrantExceptionResponse(parsedOutput, context)];
|
|
162
|
+
case 13: throw _d.sent();
|
|
163
|
+
case 14: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
|
|
164
|
+
case 15: throw _d.sent();
|
|
165
|
+
case 16: return [4, deserializeAws_restJson1InvalidScopeExceptionResponse(parsedOutput, context)];
|
|
166
|
+
case 17: throw _d.sent();
|
|
167
|
+
case 18: return [4, deserializeAws_restJson1SlowDownExceptionResponse(parsedOutput, context)];
|
|
168
|
+
case 19: throw _d.sent();
|
|
169
|
+
case 20: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
|
|
170
|
+
case 21: throw _d.sent();
|
|
171
|
+
case 22: return [4, deserializeAws_restJson1UnsupportedGrantTypeExceptionResponse(parsedOutput, context)];
|
|
172
|
+
case 23: throw _d.sent();
|
|
173
|
+
case 24:
|
|
174
|
+
parsedBody = parsedOutput.body;
|
|
175
|
+
throwDefaultError({
|
|
176
|
+
output: output,
|
|
177
|
+
parsedBody: parsedBody,
|
|
178
|
+
exceptionCtor: __BaseException,
|
|
179
|
+
errorCode: errorCode,
|
|
180
|
+
});
|
|
181
|
+
_d.label = 25;
|
|
182
|
+
case 25: return [2];
|
|
183
|
+
}
|
|
65
184
|
});
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
185
|
+
}); };
|
|
186
|
+
export var deserializeAws_restJson1RegisterClientCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
187
|
+
var contents, data, _a, _b;
|
|
188
|
+
return __generator(this, function (_c) {
|
|
189
|
+
switch (_c.label) {
|
|
190
|
+
case 0:
|
|
191
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
192
|
+
return [2, deserializeAws_restJson1RegisterClientCommandError(output, context)];
|
|
193
|
+
}
|
|
194
|
+
contents = map({
|
|
195
|
+
$metadata: deserializeMetadata(output),
|
|
196
|
+
});
|
|
197
|
+
_a = __expectNonNull;
|
|
198
|
+
_b = __expectObject;
|
|
199
|
+
return [4, parseBody(output.body, context)];
|
|
200
|
+
case 1:
|
|
201
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
202
|
+
if (data.authorizationEndpoint != null) {
|
|
203
|
+
contents.authorizationEndpoint = __expectString(data.authorizationEndpoint);
|
|
204
|
+
}
|
|
205
|
+
if (data.clientId != null) {
|
|
206
|
+
contents.clientId = __expectString(data.clientId);
|
|
207
|
+
}
|
|
208
|
+
if (data.clientIdIssuedAt != null) {
|
|
209
|
+
contents.clientIdIssuedAt = __expectLong(data.clientIdIssuedAt);
|
|
210
|
+
}
|
|
211
|
+
if (data.clientSecret != null) {
|
|
212
|
+
contents.clientSecret = __expectString(data.clientSecret);
|
|
213
|
+
}
|
|
214
|
+
if (data.clientSecretExpiresAt != null) {
|
|
215
|
+
contents.clientSecretExpiresAt = __expectLong(data.clientSecretExpiresAt);
|
|
216
|
+
}
|
|
217
|
+
if (data.tokenEndpoint != null) {
|
|
218
|
+
contents.tokenEndpoint = __expectString(data.tokenEndpoint);
|
|
219
|
+
}
|
|
220
|
+
return [2, contents];
|
|
221
|
+
}
|
|
74
222
|
});
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
223
|
+
}); };
|
|
224
|
+
var deserializeAws_restJson1RegisterClientCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
225
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
226
|
+
var _c;
|
|
227
|
+
return __generator(this, function (_d) {
|
|
228
|
+
switch (_d.label) {
|
|
229
|
+
case 0:
|
|
230
|
+
_a = [__assign({}, output)];
|
|
231
|
+
_c = {};
|
|
232
|
+
return [4, parseErrorBody(output.body, context)];
|
|
233
|
+
case 1:
|
|
234
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
235
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
236
|
+
_b = errorCode;
|
|
237
|
+
switch (_b) {
|
|
238
|
+
case "InternalServerException": return [3, 2];
|
|
239
|
+
case "com.amazonaws.ssooidc#InternalServerException": return [3, 2];
|
|
240
|
+
case "InvalidClientMetadataException": return [3, 4];
|
|
241
|
+
case "com.amazonaws.ssooidc#InvalidClientMetadataException": return [3, 4];
|
|
242
|
+
case "InvalidRequestException": return [3, 6];
|
|
243
|
+
case "com.amazonaws.ssooidc#InvalidRequestException": return [3, 6];
|
|
244
|
+
case "InvalidScopeException": return [3, 8];
|
|
245
|
+
case "com.amazonaws.ssooidc#InvalidScopeException": return [3, 8];
|
|
246
|
+
}
|
|
247
|
+
return [3, 10];
|
|
248
|
+
case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
249
|
+
case 3: throw _d.sent();
|
|
250
|
+
case 4: return [4, deserializeAws_restJson1InvalidClientMetadataExceptionResponse(parsedOutput, context)];
|
|
251
|
+
case 5: throw _d.sent();
|
|
252
|
+
case 6: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
|
|
253
|
+
case 7: throw _d.sent();
|
|
254
|
+
case 8: return [4, deserializeAws_restJson1InvalidScopeExceptionResponse(parsedOutput, context)];
|
|
255
|
+
case 9: throw _d.sent();
|
|
256
|
+
case 10:
|
|
257
|
+
parsedBody = parsedOutput.body;
|
|
258
|
+
throwDefaultError({
|
|
259
|
+
output: output,
|
|
260
|
+
parsedBody: parsedBody,
|
|
261
|
+
exceptionCtor: __BaseException,
|
|
262
|
+
errorCode: errorCode,
|
|
263
|
+
});
|
|
264
|
+
_d.label = 11;
|
|
265
|
+
case 11: return [2];
|
|
266
|
+
}
|
|
82
267
|
});
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
case "InvalidClientException":
|
|
121
|
-
case "com.amazonaws.ssooidc#InvalidClientException":
|
|
122
|
-
throw await deserializeAws_restJson1InvalidClientExceptionResponse(parsedOutput, context);
|
|
123
|
-
case "InvalidGrantException":
|
|
124
|
-
case "com.amazonaws.ssooidc#InvalidGrantException":
|
|
125
|
-
throw await deserializeAws_restJson1InvalidGrantExceptionResponse(parsedOutput, context);
|
|
126
|
-
case "InvalidRequestException":
|
|
127
|
-
case "com.amazonaws.ssooidc#InvalidRequestException":
|
|
128
|
-
throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
|
|
129
|
-
case "InvalidScopeException":
|
|
130
|
-
case "com.amazonaws.ssooidc#InvalidScopeException":
|
|
131
|
-
throw await deserializeAws_restJson1InvalidScopeExceptionResponse(parsedOutput, context);
|
|
132
|
-
case "SlowDownException":
|
|
133
|
-
case "com.amazonaws.ssooidc#SlowDownException":
|
|
134
|
-
throw await deserializeAws_restJson1SlowDownExceptionResponse(parsedOutput, context);
|
|
135
|
-
case "UnauthorizedClientException":
|
|
136
|
-
case "com.amazonaws.ssooidc#UnauthorizedClientException":
|
|
137
|
-
throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
|
|
138
|
-
case "UnsupportedGrantTypeException":
|
|
139
|
-
case "com.amazonaws.ssooidc#UnsupportedGrantTypeException":
|
|
140
|
-
throw await deserializeAws_restJson1UnsupportedGrantTypeExceptionResponse(parsedOutput, context);
|
|
141
|
-
default:
|
|
142
|
-
const parsedBody = parsedOutput.body;
|
|
143
|
-
throwDefaultError({
|
|
144
|
-
output,
|
|
145
|
-
parsedBody,
|
|
146
|
-
exceptionCtor: __BaseException,
|
|
147
|
-
errorCode,
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
export const deserializeAws_restJson1RegisterClientCommand = async (output, context) => {
|
|
152
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
153
|
-
return deserializeAws_restJson1RegisterClientCommandError(output, context);
|
|
154
|
-
}
|
|
155
|
-
const contents = map({
|
|
156
|
-
$metadata: deserializeMetadata(output),
|
|
268
|
+
}); };
|
|
269
|
+
export var deserializeAws_restJson1StartDeviceAuthorizationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
270
|
+
var contents, data, _a, _b;
|
|
271
|
+
return __generator(this, function (_c) {
|
|
272
|
+
switch (_c.label) {
|
|
273
|
+
case 0:
|
|
274
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
275
|
+
return [2, deserializeAws_restJson1StartDeviceAuthorizationCommandError(output, context)];
|
|
276
|
+
}
|
|
277
|
+
contents = map({
|
|
278
|
+
$metadata: deserializeMetadata(output),
|
|
279
|
+
});
|
|
280
|
+
_a = __expectNonNull;
|
|
281
|
+
_b = __expectObject;
|
|
282
|
+
return [4, parseBody(output.body, context)];
|
|
283
|
+
case 1:
|
|
284
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
285
|
+
if (data.deviceCode != null) {
|
|
286
|
+
contents.deviceCode = __expectString(data.deviceCode);
|
|
287
|
+
}
|
|
288
|
+
if (data.expiresIn != null) {
|
|
289
|
+
contents.expiresIn = __expectInt32(data.expiresIn);
|
|
290
|
+
}
|
|
291
|
+
if (data.interval != null) {
|
|
292
|
+
contents.interval = __expectInt32(data.interval);
|
|
293
|
+
}
|
|
294
|
+
if (data.userCode != null) {
|
|
295
|
+
contents.userCode = __expectString(data.userCode);
|
|
296
|
+
}
|
|
297
|
+
if (data.verificationUri != null) {
|
|
298
|
+
contents.verificationUri = __expectString(data.verificationUri);
|
|
299
|
+
}
|
|
300
|
+
if (data.verificationUriComplete != null) {
|
|
301
|
+
contents.verificationUriComplete = __expectString(data.verificationUriComplete);
|
|
302
|
+
}
|
|
303
|
+
return [2, contents];
|
|
304
|
+
}
|
|
157
305
|
});
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
throw
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
throw
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
export const deserializeAws_restJson1StartDeviceAuthorizationCommand = async (output, context) => {
|
|
209
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
210
|
-
return deserializeAws_restJson1StartDeviceAuthorizationCommandError(output, context);
|
|
211
|
-
}
|
|
212
|
-
const contents = map({
|
|
213
|
-
$metadata: deserializeMetadata(output),
|
|
306
|
+
}); };
|
|
307
|
+
var deserializeAws_restJson1StartDeviceAuthorizationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
308
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
309
|
+
var _c;
|
|
310
|
+
return __generator(this, function (_d) {
|
|
311
|
+
switch (_d.label) {
|
|
312
|
+
case 0:
|
|
313
|
+
_a = [__assign({}, output)];
|
|
314
|
+
_c = {};
|
|
315
|
+
return [4, parseErrorBody(output.body, context)];
|
|
316
|
+
case 1:
|
|
317
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
318
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
319
|
+
_b = errorCode;
|
|
320
|
+
switch (_b) {
|
|
321
|
+
case "InternalServerException": return [3, 2];
|
|
322
|
+
case "com.amazonaws.ssooidc#InternalServerException": return [3, 2];
|
|
323
|
+
case "InvalidClientException": return [3, 4];
|
|
324
|
+
case "com.amazonaws.ssooidc#InvalidClientException": return [3, 4];
|
|
325
|
+
case "InvalidRequestException": return [3, 6];
|
|
326
|
+
case "com.amazonaws.ssooidc#InvalidRequestException": return [3, 6];
|
|
327
|
+
case "SlowDownException": return [3, 8];
|
|
328
|
+
case "com.amazonaws.ssooidc#SlowDownException": return [3, 8];
|
|
329
|
+
case "UnauthorizedClientException": return [3, 10];
|
|
330
|
+
case "com.amazonaws.ssooidc#UnauthorizedClientException": return [3, 10];
|
|
331
|
+
}
|
|
332
|
+
return [3, 12];
|
|
333
|
+
case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
334
|
+
case 3: throw _d.sent();
|
|
335
|
+
case 4: return [4, deserializeAws_restJson1InvalidClientExceptionResponse(parsedOutput, context)];
|
|
336
|
+
case 5: throw _d.sent();
|
|
337
|
+
case 6: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
|
|
338
|
+
case 7: throw _d.sent();
|
|
339
|
+
case 8: return [4, deserializeAws_restJson1SlowDownExceptionResponse(parsedOutput, context)];
|
|
340
|
+
case 9: throw _d.sent();
|
|
341
|
+
case 10: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
|
|
342
|
+
case 11: throw _d.sent();
|
|
343
|
+
case 12:
|
|
344
|
+
parsedBody = parsedOutput.body;
|
|
345
|
+
throwDefaultError({
|
|
346
|
+
output: output,
|
|
347
|
+
parsedBody: parsedBody,
|
|
348
|
+
exceptionCtor: __BaseException,
|
|
349
|
+
errorCode: errorCode,
|
|
350
|
+
});
|
|
351
|
+
_d.label = 13;
|
|
352
|
+
case 13: return [2];
|
|
353
|
+
}
|
|
214
354
|
});
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
contents
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}
|
|
231
|
-
if (data.verificationUriComplete != null) {
|
|
232
|
-
contents.verificationUriComplete = __expectString(data.verificationUriComplete);
|
|
233
|
-
}
|
|
234
|
-
return contents;
|
|
235
|
-
};
|
|
236
|
-
const deserializeAws_restJson1StartDeviceAuthorizationCommandError = async (output, context) => {
|
|
237
|
-
const parsedOutput = {
|
|
238
|
-
...output,
|
|
239
|
-
body: await parseErrorBody(output.body, context),
|
|
240
|
-
};
|
|
241
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
242
|
-
switch (errorCode) {
|
|
243
|
-
case "InternalServerException":
|
|
244
|
-
case "com.amazonaws.ssooidc#InternalServerException":
|
|
245
|
-
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
246
|
-
case "InvalidClientException":
|
|
247
|
-
case "com.amazonaws.ssooidc#InvalidClientException":
|
|
248
|
-
throw await deserializeAws_restJson1InvalidClientExceptionResponse(parsedOutput, context);
|
|
249
|
-
case "InvalidRequestException":
|
|
250
|
-
case "com.amazonaws.ssooidc#InvalidRequestException":
|
|
251
|
-
throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
|
|
252
|
-
case "SlowDownException":
|
|
253
|
-
case "com.amazonaws.ssooidc#SlowDownException":
|
|
254
|
-
throw await deserializeAws_restJson1SlowDownExceptionResponse(parsedOutput, context);
|
|
255
|
-
case "UnauthorizedClientException":
|
|
256
|
-
case "com.amazonaws.ssooidc#UnauthorizedClientException":
|
|
257
|
-
throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
|
|
258
|
-
default:
|
|
259
|
-
const parsedBody = parsedOutput.body;
|
|
260
|
-
throwDefaultError({
|
|
261
|
-
output,
|
|
262
|
-
parsedBody,
|
|
263
|
-
exceptionCtor: __BaseException,
|
|
264
|
-
errorCode,
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
};
|
|
268
|
-
const map = __map;
|
|
269
|
-
const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
|
|
270
|
-
const contents = map({});
|
|
271
|
-
const data = parsedOutput.body;
|
|
272
|
-
if (data.error != null) {
|
|
273
|
-
contents.error = __expectString(data.error);
|
|
274
|
-
}
|
|
275
|
-
if (data.error_description != null) {
|
|
276
|
-
contents.error_description = __expectString(data.error_description);
|
|
277
|
-
}
|
|
278
|
-
const exception = new AccessDeniedException({
|
|
279
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
280
|
-
...contents,
|
|
355
|
+
}); };
|
|
356
|
+
var map = __map;
|
|
357
|
+
var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
358
|
+
var contents, data, exception;
|
|
359
|
+
return __generator(this, function (_a) {
|
|
360
|
+
contents = map({});
|
|
361
|
+
data = parsedOutput.body;
|
|
362
|
+
if (data.error != null) {
|
|
363
|
+
contents.error = __expectString(data.error);
|
|
364
|
+
}
|
|
365
|
+
if (data.error_description != null) {
|
|
366
|
+
contents.error_description = __expectString(data.error_description);
|
|
367
|
+
}
|
|
368
|
+
exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
369
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
281
370
|
});
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
295
|
-
|
|
371
|
+
}); };
|
|
372
|
+
var deserializeAws_restJson1AuthorizationPendingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
373
|
+
var contents, data, exception;
|
|
374
|
+
return __generator(this, function (_a) {
|
|
375
|
+
contents = map({});
|
|
376
|
+
data = parsedOutput.body;
|
|
377
|
+
if (data.error != null) {
|
|
378
|
+
contents.error = __expectString(data.error);
|
|
379
|
+
}
|
|
380
|
+
if (data.error_description != null) {
|
|
381
|
+
contents.error_description = __expectString(data.error_description);
|
|
382
|
+
}
|
|
383
|
+
exception = new AuthorizationPendingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
384
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
296
385
|
});
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
310
|
-
|
|
386
|
+
}); };
|
|
387
|
+
var deserializeAws_restJson1ExpiredTokenExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
388
|
+
var contents, data, exception;
|
|
389
|
+
return __generator(this, function (_a) {
|
|
390
|
+
contents = map({});
|
|
391
|
+
data = parsedOutput.body;
|
|
392
|
+
if (data.error != null) {
|
|
393
|
+
contents.error = __expectString(data.error);
|
|
394
|
+
}
|
|
395
|
+
if (data.error_description != null) {
|
|
396
|
+
contents.error_description = __expectString(data.error_description);
|
|
397
|
+
}
|
|
398
|
+
exception = new ExpiredTokenException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
399
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
311
400
|
});
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
325
|
-
|
|
401
|
+
}); };
|
|
402
|
+
var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
403
|
+
var contents, data, exception;
|
|
404
|
+
return __generator(this, function (_a) {
|
|
405
|
+
contents = map({});
|
|
406
|
+
data = parsedOutput.body;
|
|
407
|
+
if (data.error != null) {
|
|
408
|
+
contents.error = __expectString(data.error);
|
|
409
|
+
}
|
|
410
|
+
if (data.error_description != null) {
|
|
411
|
+
contents.error_description = __expectString(data.error_description);
|
|
412
|
+
}
|
|
413
|
+
exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
414
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
326
415
|
});
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
340
|
-
|
|
416
|
+
}); };
|
|
417
|
+
var deserializeAws_restJson1InvalidClientExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
418
|
+
var contents, data, exception;
|
|
419
|
+
return __generator(this, function (_a) {
|
|
420
|
+
contents = map({});
|
|
421
|
+
data = parsedOutput.body;
|
|
422
|
+
if (data.error != null) {
|
|
423
|
+
contents.error = __expectString(data.error);
|
|
424
|
+
}
|
|
425
|
+
if (data.error_description != null) {
|
|
426
|
+
contents.error_description = __expectString(data.error_description);
|
|
427
|
+
}
|
|
428
|
+
exception = new InvalidClientException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
429
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
341
430
|
});
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
355
|
-
|
|
431
|
+
}); };
|
|
432
|
+
var deserializeAws_restJson1InvalidClientMetadataExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
433
|
+
var contents, data, exception;
|
|
434
|
+
return __generator(this, function (_a) {
|
|
435
|
+
contents = map({});
|
|
436
|
+
data = parsedOutput.body;
|
|
437
|
+
if (data.error != null) {
|
|
438
|
+
contents.error = __expectString(data.error);
|
|
439
|
+
}
|
|
440
|
+
if (data.error_description != null) {
|
|
441
|
+
contents.error_description = __expectString(data.error_description);
|
|
442
|
+
}
|
|
443
|
+
exception = new InvalidClientMetadataException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
444
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
356
445
|
});
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
370
|
-
|
|
446
|
+
}); };
|
|
447
|
+
var deserializeAws_restJson1InvalidGrantExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
448
|
+
var contents, data, exception;
|
|
449
|
+
return __generator(this, function (_a) {
|
|
450
|
+
contents = map({});
|
|
451
|
+
data = parsedOutput.body;
|
|
452
|
+
if (data.error != null) {
|
|
453
|
+
contents.error = __expectString(data.error);
|
|
454
|
+
}
|
|
455
|
+
if (data.error_description != null) {
|
|
456
|
+
contents.error_description = __expectString(data.error_description);
|
|
457
|
+
}
|
|
458
|
+
exception = new InvalidGrantException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
459
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
371
460
|
});
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
385
|
-
|
|
461
|
+
}); };
|
|
462
|
+
var deserializeAws_restJson1InvalidRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
463
|
+
var contents, data, exception;
|
|
464
|
+
return __generator(this, function (_a) {
|
|
465
|
+
contents = map({});
|
|
466
|
+
data = parsedOutput.body;
|
|
467
|
+
if (data.error != null) {
|
|
468
|
+
contents.error = __expectString(data.error);
|
|
469
|
+
}
|
|
470
|
+
if (data.error_description != null) {
|
|
471
|
+
contents.error_description = __expectString(data.error_description);
|
|
472
|
+
}
|
|
473
|
+
exception = new InvalidRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
474
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
386
475
|
});
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
400
|
-
|
|
476
|
+
}); };
|
|
477
|
+
var deserializeAws_restJson1InvalidScopeExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
478
|
+
var contents, data, exception;
|
|
479
|
+
return __generator(this, function (_a) {
|
|
480
|
+
contents = map({});
|
|
481
|
+
data = parsedOutput.body;
|
|
482
|
+
if (data.error != null) {
|
|
483
|
+
contents.error = __expectString(data.error);
|
|
484
|
+
}
|
|
485
|
+
if (data.error_description != null) {
|
|
486
|
+
contents.error_description = __expectString(data.error_description);
|
|
487
|
+
}
|
|
488
|
+
exception = new InvalidScopeException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
489
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
401
490
|
});
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
415
|
-
|
|
491
|
+
}); };
|
|
492
|
+
var deserializeAws_restJson1SlowDownExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
493
|
+
var contents, data, exception;
|
|
494
|
+
return __generator(this, function (_a) {
|
|
495
|
+
contents = map({});
|
|
496
|
+
data = parsedOutput.body;
|
|
497
|
+
if (data.error != null) {
|
|
498
|
+
contents.error = __expectString(data.error);
|
|
499
|
+
}
|
|
500
|
+
if (data.error_description != null) {
|
|
501
|
+
contents.error_description = __expectString(data.error_description);
|
|
502
|
+
}
|
|
503
|
+
exception = new SlowDownException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
504
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
416
505
|
});
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
430
|
-
|
|
506
|
+
}); };
|
|
507
|
+
var deserializeAws_restJson1UnauthorizedClientExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
508
|
+
var contents, data, exception;
|
|
509
|
+
return __generator(this, function (_a) {
|
|
510
|
+
contents = map({});
|
|
511
|
+
data = parsedOutput.body;
|
|
512
|
+
if (data.error != null) {
|
|
513
|
+
contents.error = __expectString(data.error);
|
|
514
|
+
}
|
|
515
|
+
if (data.error_description != null) {
|
|
516
|
+
contents.error_description = __expectString(data.error_description);
|
|
517
|
+
}
|
|
518
|
+
exception = new UnauthorizedClientException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
519
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
431
520
|
});
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
445
|
-
|
|
521
|
+
}); };
|
|
522
|
+
var deserializeAws_restJson1UnsupportedGrantTypeExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
523
|
+
var contents, data, exception;
|
|
524
|
+
return __generator(this, function (_a) {
|
|
525
|
+
contents = map({});
|
|
526
|
+
data = parsedOutput.body;
|
|
527
|
+
if (data.error != null) {
|
|
528
|
+
contents.error = __expectString(data.error);
|
|
529
|
+
}
|
|
530
|
+
if (data.error_description != null) {
|
|
531
|
+
contents.error_description = __expectString(data.error_description);
|
|
532
|
+
}
|
|
533
|
+
exception = new UnsupportedGrantTypeException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
534
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
446
535
|
});
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
const serializeAws_restJson1Scopes = (input, context) => {
|
|
536
|
+
}); };
|
|
537
|
+
var serializeAws_restJson1Scopes = function (input, context) {
|
|
450
538
|
return input
|
|
451
|
-
.filter((e)
|
|
452
|
-
.map((entry)
|
|
539
|
+
.filter(function (e) { return e != null; })
|
|
540
|
+
.map(function (entry) {
|
|
453
541
|
return entry;
|
|
454
542
|
});
|
|
455
543
|
};
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
544
|
+
var deserializeMetadata = function (output) {
|
|
545
|
+
var _a, _b;
|
|
546
|
+
return ({
|
|
547
|
+
httpStatusCode: output.statusCode,
|
|
548
|
+
requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"],
|
|
549
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
550
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
551
|
+
});
|
|
552
|
+
};
|
|
553
|
+
var collectBody = function (streamBody, context) {
|
|
554
|
+
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
463
555
|
if (streamBody instanceof Uint8Array) {
|
|
464
556
|
return Promise.resolve(streamBody);
|
|
465
557
|
}
|
|
466
558
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
467
559
|
};
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
}
|
|
478
|
-
return {};
|
|
479
|
-
});
|
|
480
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
481
|
-
const value = await parseBody(errorBody, context);
|
|
482
|
-
value.message = value.message ?? value.Message;
|
|
483
|
-
return value;
|
|
560
|
+
var collectBodyString = function (streamBody, context) {
|
|
561
|
+
return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
|
|
562
|
+
};
|
|
563
|
+
var isSerializableHeaderValue = function (value) {
|
|
564
|
+
return value !== undefined &&
|
|
565
|
+
value !== null &&
|
|
566
|
+
value !== "" &&
|
|
567
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
568
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
484
569
|
};
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
570
|
+
var parseBody = function (streamBody, context) {
|
|
571
|
+
return collectBodyString(streamBody, context).then(function (encoded) {
|
|
572
|
+
if (encoded.length) {
|
|
573
|
+
return JSON.parse(encoded);
|
|
574
|
+
}
|
|
575
|
+
return {};
|
|
576
|
+
});
|
|
577
|
+
};
|
|
578
|
+
var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
579
|
+
var value;
|
|
580
|
+
var _a;
|
|
581
|
+
return __generator(this, function (_b) {
|
|
582
|
+
switch (_b.label) {
|
|
583
|
+
case 0: return [4, parseBody(errorBody, context)];
|
|
584
|
+
case 1:
|
|
585
|
+
value = _b.sent();
|
|
586
|
+
value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
|
|
587
|
+
return [2, value];
|
|
588
|
+
}
|
|
589
|
+
});
|
|
590
|
+
}); };
|
|
591
|
+
var loadRestJsonErrorCode = function (output, data) {
|
|
592
|
+
var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
|
|
593
|
+
var sanitizeErrorCode = function (rawValue) {
|
|
594
|
+
var cleanValue = rawValue;
|
|
489
595
|
if (typeof cleanValue === "number") {
|
|
490
596
|
cleanValue = cleanValue.toString();
|
|
491
597
|
}
|
|
@@ -500,7 +606,7 @@ const loadRestJsonErrorCode = (output, data) => {
|
|
|
500
606
|
}
|
|
501
607
|
return cleanValue;
|
|
502
608
|
};
|
|
503
|
-
|
|
609
|
+
var headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
504
610
|
if (headerKey !== undefined) {
|
|
505
611
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
506
612
|
}
|