@aws-sdk/client-sso 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/SSO.js +25 -18
- package/dist-es/SSOClient.js +26 -20
- package/dist-es/commands/GetRoleCredentialsCommand.js +28 -21
- package/dist-es/commands/ListAccountRolesCommand.js +28 -21
- package/dist-es/commands/ListAccountsCommand.js +28 -21
- package/dist-es/commands/LogoutCommand.js +29 -22
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/SSOServiceException.js +10 -5
- package/dist-es/models/models_0.js +55 -81
- package/dist-es/pagination/ListAccountRolesPaginator.js +68 -25
- package/dist-es/pagination/ListAccountsPaginator.js +68 -25
- package/dist-es/protocols/Aws_restJson1.js +468 -324
- 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,319 +1,445 @@
|
|
|
1
|
+
import { __assign, __awaiter, __generator } from "tslib";
|
|
1
2
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
2
3
|
import { decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
3
4
|
import { InvalidRequestException, ResourceNotFoundException, TooManyRequestsException, UnauthorizedException, } from "../models/models_0";
|
|
4
5
|
import { SSOServiceException as __BaseException } from "../models/SSOServiceException";
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
6
|
+
export var serializeAws_restJson1GetRoleCredentialsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, 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 = map({}, isSerializableHeaderValue, {
|
|
14
|
+
"x-amz-sso_bearer_token": input.accessToken,
|
|
15
|
+
});
|
|
16
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/federation/credentials";
|
|
17
|
+
query = map({
|
|
18
|
+
role_name: [, input.roleName],
|
|
19
|
+
account_id: [, input.accountId],
|
|
20
|
+
});
|
|
21
|
+
return [2, new __HttpRequest({
|
|
22
|
+
protocol: protocol,
|
|
23
|
+
hostname: hostname,
|
|
24
|
+
port: port,
|
|
25
|
+
method: "GET",
|
|
26
|
+
headers: headers,
|
|
27
|
+
path: resolvedPath,
|
|
28
|
+
query: query,
|
|
29
|
+
body: body,
|
|
30
|
+
})];
|
|
31
|
+
}
|
|
31
32
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
}); };
|
|
34
|
+
export var serializeAws_restJson1ListAccountRolesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
35
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
|
|
36
|
+
return __generator(this, function (_c) {
|
|
37
|
+
switch (_c.label) {
|
|
38
|
+
case 0: return [4, context.endpoint()];
|
|
39
|
+
case 1:
|
|
40
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
41
|
+
headers = map({}, isSerializableHeaderValue, {
|
|
42
|
+
"x-amz-sso_bearer_token": input.accessToken,
|
|
43
|
+
});
|
|
44
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/assignment/roles";
|
|
45
|
+
query = map({
|
|
46
|
+
next_token: [, input.nextToken],
|
|
47
|
+
max_result: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
|
|
48
|
+
account_id: [, input.accountId],
|
|
49
|
+
});
|
|
50
|
+
return [2, new __HttpRequest({
|
|
51
|
+
protocol: protocol,
|
|
52
|
+
hostname: hostname,
|
|
53
|
+
port: port,
|
|
54
|
+
method: "GET",
|
|
55
|
+
headers: headers,
|
|
56
|
+
path: resolvedPath,
|
|
57
|
+
query: query,
|
|
58
|
+
body: body,
|
|
59
|
+
})];
|
|
60
|
+
}
|
|
37
61
|
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
62
|
+
}); };
|
|
63
|
+
export var serializeAws_restJson1ListAccountsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
64
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
|
|
65
|
+
return __generator(this, function (_c) {
|
|
66
|
+
switch (_c.label) {
|
|
67
|
+
case 0: return [4, context.endpoint()];
|
|
68
|
+
case 1:
|
|
69
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
70
|
+
headers = map({}, isSerializableHeaderValue, {
|
|
71
|
+
"x-amz-sso_bearer_token": input.accessToken,
|
|
72
|
+
});
|
|
73
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/assignment/accounts";
|
|
74
|
+
query = map({
|
|
75
|
+
next_token: [, input.nextToken],
|
|
76
|
+
max_result: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
|
|
77
|
+
});
|
|
78
|
+
return [2, new __HttpRequest({
|
|
79
|
+
protocol: protocol,
|
|
80
|
+
hostname: hostname,
|
|
81
|
+
port: port,
|
|
82
|
+
method: "GET",
|
|
83
|
+
headers: headers,
|
|
84
|
+
path: resolvedPath,
|
|
85
|
+
query: query,
|
|
86
|
+
body: body,
|
|
87
|
+
})];
|
|
88
|
+
}
|
|
48
89
|
});
|
|
49
|
-
};
|
|
50
|
-
export
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
90
|
+
}); };
|
|
91
|
+
export var serializeAws_restJson1LogoutCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
92
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
93
|
+
return __generator(this, function (_c) {
|
|
94
|
+
switch (_c.label) {
|
|
95
|
+
case 0: return [4, context.endpoint()];
|
|
96
|
+
case 1:
|
|
97
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
98
|
+
headers = map({}, isSerializableHeaderValue, {
|
|
99
|
+
"x-amz-sso_bearer_token": input.accessToken,
|
|
100
|
+
});
|
|
101
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/logout";
|
|
102
|
+
return [2, new __HttpRequest({
|
|
103
|
+
protocol: protocol,
|
|
104
|
+
hostname: hostname,
|
|
105
|
+
port: port,
|
|
106
|
+
method: "POST",
|
|
107
|
+
headers: headers,
|
|
108
|
+
path: resolvedPath,
|
|
109
|
+
body: body,
|
|
110
|
+
})];
|
|
111
|
+
}
|
|
54
112
|
});
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
113
|
+
}); };
|
|
114
|
+
export var deserializeAws_restJson1GetRoleCredentialsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
115
|
+
var contents, data, _a, _b;
|
|
116
|
+
return __generator(this, function (_c) {
|
|
117
|
+
switch (_c.label) {
|
|
118
|
+
case 0:
|
|
119
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
120
|
+
return [2, deserializeAws_restJson1GetRoleCredentialsCommandError(output, context)];
|
|
121
|
+
}
|
|
122
|
+
contents = map({
|
|
123
|
+
$metadata: deserializeMetadata(output),
|
|
124
|
+
});
|
|
125
|
+
_a = __expectNonNull;
|
|
126
|
+
_b = __expectObject;
|
|
127
|
+
return [4, parseBody(output.body, context)];
|
|
128
|
+
case 1:
|
|
129
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
130
|
+
if (data.roleCredentials != null) {
|
|
131
|
+
contents.roleCredentials = deserializeAws_restJson1RoleCredentials(data.roleCredentials, context);
|
|
132
|
+
}
|
|
133
|
+
return [2, contents];
|
|
134
|
+
}
|
|
59
135
|
});
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
136
|
+
}); };
|
|
137
|
+
var deserializeAws_restJson1GetRoleCredentialsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
138
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
139
|
+
var _c;
|
|
140
|
+
return __generator(this, function (_d) {
|
|
141
|
+
switch (_d.label) {
|
|
142
|
+
case 0:
|
|
143
|
+
_a = [__assign({}, output)];
|
|
144
|
+
_c = {};
|
|
145
|
+
return [4, parseErrorBody(output.body, context)];
|
|
146
|
+
case 1:
|
|
147
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
148
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
149
|
+
_b = errorCode;
|
|
150
|
+
switch (_b) {
|
|
151
|
+
case "InvalidRequestException": return [3, 2];
|
|
152
|
+
case "com.amazonaws.sso#InvalidRequestException": return [3, 2];
|
|
153
|
+
case "ResourceNotFoundException": return [3, 4];
|
|
154
|
+
case "com.amazonaws.sso#ResourceNotFoundException": return [3, 4];
|
|
155
|
+
case "TooManyRequestsException": return [3, 6];
|
|
156
|
+
case "com.amazonaws.sso#TooManyRequestsException": return [3, 6];
|
|
157
|
+
case "UnauthorizedException": return [3, 8];
|
|
158
|
+
case "com.amazonaws.sso#UnauthorizedException": return [3, 8];
|
|
159
|
+
}
|
|
160
|
+
return [3, 10];
|
|
161
|
+
case 2: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
|
|
162
|
+
case 3: throw _d.sent();
|
|
163
|
+
case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
164
|
+
case 5: throw _d.sent();
|
|
165
|
+
case 6: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
|
|
166
|
+
case 7: throw _d.sent();
|
|
167
|
+
case 8: return [4, deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)];
|
|
168
|
+
case 9: throw _d.sent();
|
|
169
|
+
case 10:
|
|
170
|
+
parsedBody = parsedOutput.body;
|
|
171
|
+
throwDefaultError({
|
|
172
|
+
output: output,
|
|
173
|
+
parsedBody: parsedBody,
|
|
174
|
+
exceptionCtor: __BaseException,
|
|
175
|
+
errorCode: errorCode,
|
|
176
|
+
});
|
|
177
|
+
_d.label = 11;
|
|
178
|
+
case 11: return [2];
|
|
179
|
+
}
|
|
70
180
|
});
|
|
71
|
-
};
|
|
72
|
-
export
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
181
|
+
}); };
|
|
182
|
+
export var deserializeAws_restJson1ListAccountRolesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
183
|
+
var contents, data, _a, _b;
|
|
184
|
+
return __generator(this, function (_c) {
|
|
185
|
+
switch (_c.label) {
|
|
186
|
+
case 0:
|
|
187
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
188
|
+
return [2, deserializeAws_restJson1ListAccountRolesCommandError(output, context)];
|
|
189
|
+
}
|
|
190
|
+
contents = map({
|
|
191
|
+
$metadata: deserializeMetadata(output),
|
|
192
|
+
});
|
|
193
|
+
_a = __expectNonNull;
|
|
194
|
+
_b = __expectObject;
|
|
195
|
+
return [4, parseBody(output.body, context)];
|
|
196
|
+
case 1:
|
|
197
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
198
|
+
if (data.nextToken != null) {
|
|
199
|
+
contents.nextToken = __expectString(data.nextToken);
|
|
200
|
+
}
|
|
201
|
+
if (data.roleList != null) {
|
|
202
|
+
contents.roleList = deserializeAws_restJson1RoleListType(data.roleList, context);
|
|
203
|
+
}
|
|
204
|
+
return [2, contents];
|
|
205
|
+
}
|
|
76
206
|
});
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
207
|
+
}); };
|
|
208
|
+
var deserializeAws_restJson1ListAccountRolesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
209
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
210
|
+
var _c;
|
|
211
|
+
return __generator(this, function (_d) {
|
|
212
|
+
switch (_d.label) {
|
|
213
|
+
case 0:
|
|
214
|
+
_a = [__assign({}, output)];
|
|
215
|
+
_c = {};
|
|
216
|
+
return [4, parseErrorBody(output.body, context)];
|
|
217
|
+
case 1:
|
|
218
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
219
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
220
|
+
_b = errorCode;
|
|
221
|
+
switch (_b) {
|
|
222
|
+
case "InvalidRequestException": return [3, 2];
|
|
223
|
+
case "com.amazonaws.sso#InvalidRequestException": return [3, 2];
|
|
224
|
+
case "ResourceNotFoundException": return [3, 4];
|
|
225
|
+
case "com.amazonaws.sso#ResourceNotFoundException": return [3, 4];
|
|
226
|
+
case "TooManyRequestsException": return [3, 6];
|
|
227
|
+
case "com.amazonaws.sso#TooManyRequestsException": return [3, 6];
|
|
228
|
+
case "UnauthorizedException": return [3, 8];
|
|
229
|
+
case "com.amazonaws.sso#UnauthorizedException": return [3, 8];
|
|
230
|
+
}
|
|
231
|
+
return [3, 10];
|
|
232
|
+
case 2: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
|
|
233
|
+
case 3: throw _d.sent();
|
|
234
|
+
case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
235
|
+
case 5: throw _d.sent();
|
|
236
|
+
case 6: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
|
|
237
|
+
case 7: throw _d.sent();
|
|
238
|
+
case 8: return [4, deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)];
|
|
239
|
+
case 9: throw _d.sent();
|
|
240
|
+
case 10:
|
|
241
|
+
parsedBody = parsedOutput.body;
|
|
242
|
+
throwDefaultError({
|
|
243
|
+
output: output,
|
|
244
|
+
parsedBody: parsedBody,
|
|
245
|
+
exceptionCtor: __BaseException,
|
|
246
|
+
errorCode: errorCode,
|
|
247
|
+
});
|
|
248
|
+
_d.label = 11;
|
|
249
|
+
case 11: return [2];
|
|
250
|
+
}
|
|
87
251
|
});
|
|
88
|
-
};
|
|
89
|
-
export
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
252
|
+
}); };
|
|
253
|
+
export var deserializeAws_restJson1ListAccountsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
254
|
+
var contents, data, _a, _b;
|
|
255
|
+
return __generator(this, function (_c) {
|
|
256
|
+
switch (_c.label) {
|
|
257
|
+
case 0:
|
|
258
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
259
|
+
return [2, deserializeAws_restJson1ListAccountsCommandError(output, context)];
|
|
260
|
+
}
|
|
261
|
+
contents = map({
|
|
262
|
+
$metadata: deserializeMetadata(output),
|
|
263
|
+
});
|
|
264
|
+
_a = __expectNonNull;
|
|
265
|
+
_b = __expectObject;
|
|
266
|
+
return [4, parseBody(output.body, context)];
|
|
267
|
+
case 1:
|
|
268
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
269
|
+
if (data.accountList != null) {
|
|
270
|
+
contents.accountList = deserializeAws_restJson1AccountListType(data.accountList, context);
|
|
271
|
+
}
|
|
272
|
+
if (data.nextToken != null) {
|
|
273
|
+
contents.nextToken = __expectString(data.nextToken);
|
|
274
|
+
}
|
|
275
|
+
return [2, contents];
|
|
276
|
+
}
|
|
95
277
|
});
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
return
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
278
|
+
}); };
|
|
279
|
+
var deserializeAws_restJson1ListAccountsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
280
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
281
|
+
var _c;
|
|
282
|
+
return __generator(this, function (_d) {
|
|
283
|
+
switch (_d.label) {
|
|
284
|
+
case 0:
|
|
285
|
+
_a = [__assign({}, output)];
|
|
286
|
+
_c = {};
|
|
287
|
+
return [4, parseErrorBody(output.body, context)];
|
|
288
|
+
case 1:
|
|
289
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
290
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
291
|
+
_b = errorCode;
|
|
292
|
+
switch (_b) {
|
|
293
|
+
case "InvalidRequestException": return [3, 2];
|
|
294
|
+
case "com.amazonaws.sso#InvalidRequestException": return [3, 2];
|
|
295
|
+
case "ResourceNotFoundException": return [3, 4];
|
|
296
|
+
case "com.amazonaws.sso#ResourceNotFoundException": return [3, 4];
|
|
297
|
+
case "TooManyRequestsException": return [3, 6];
|
|
298
|
+
case "com.amazonaws.sso#TooManyRequestsException": return [3, 6];
|
|
299
|
+
case "UnauthorizedException": return [3, 8];
|
|
300
|
+
case "com.amazonaws.sso#UnauthorizedException": return [3, 8];
|
|
301
|
+
}
|
|
302
|
+
return [3, 10];
|
|
303
|
+
case 2: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
|
|
304
|
+
case 3: throw _d.sent();
|
|
305
|
+
case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
306
|
+
case 5: throw _d.sent();
|
|
307
|
+
case 6: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
|
|
308
|
+
case 7: throw _d.sent();
|
|
309
|
+
case 8: return [4, deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)];
|
|
310
|
+
case 9: throw _d.sent();
|
|
311
|
+
case 10:
|
|
312
|
+
parsedBody = parsedOutput.body;
|
|
313
|
+
throwDefaultError({
|
|
314
|
+
output: output,
|
|
315
|
+
parsedBody: parsedBody,
|
|
316
|
+
exceptionCtor: __BaseException,
|
|
317
|
+
errorCode: errorCode,
|
|
318
|
+
});
|
|
319
|
+
_d.label = 11;
|
|
320
|
+
case 11: return [2];
|
|
321
|
+
}
|
|
137
322
|
});
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
case "com.amazonaws.sso#InvalidRequestException":
|
|
156
|
-
throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
|
|
157
|
-
case "ResourceNotFoundException":
|
|
158
|
-
case "com.amazonaws.sso#ResourceNotFoundException":
|
|
159
|
-
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
160
|
-
case "TooManyRequestsException":
|
|
161
|
-
case "com.amazonaws.sso#TooManyRequestsException":
|
|
162
|
-
throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
|
|
163
|
-
case "UnauthorizedException":
|
|
164
|
-
case "com.amazonaws.sso#UnauthorizedException":
|
|
165
|
-
throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
|
|
166
|
-
default:
|
|
167
|
-
const parsedBody = parsedOutput.body;
|
|
168
|
-
throwDefaultError({
|
|
169
|
-
output,
|
|
170
|
-
parsedBody,
|
|
171
|
-
exceptionCtor: __BaseException,
|
|
172
|
-
errorCode,
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
export const deserializeAws_restJson1ListAccountsCommand = async (output, context) => {
|
|
177
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
178
|
-
return deserializeAws_restJson1ListAccountsCommandError(output, context);
|
|
179
|
-
}
|
|
180
|
-
const contents = map({
|
|
181
|
-
$metadata: deserializeMetadata(output),
|
|
323
|
+
}); };
|
|
324
|
+
export var deserializeAws_restJson1LogoutCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
325
|
+
var contents;
|
|
326
|
+
return __generator(this, function (_a) {
|
|
327
|
+
switch (_a.label) {
|
|
328
|
+
case 0:
|
|
329
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
330
|
+
return [2, deserializeAws_restJson1LogoutCommandError(output, context)];
|
|
331
|
+
}
|
|
332
|
+
contents = map({
|
|
333
|
+
$metadata: deserializeMetadata(output),
|
|
334
|
+
});
|
|
335
|
+
return [4, collectBody(output.body, context)];
|
|
336
|
+
case 1:
|
|
337
|
+
_a.sent();
|
|
338
|
+
return [2, contents];
|
|
339
|
+
}
|
|
182
340
|
});
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
throw
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
return deserializeAws_restJson1LogoutCommandError(output, context);
|
|
224
|
-
}
|
|
225
|
-
const contents = map({
|
|
226
|
-
$metadata: deserializeMetadata(output),
|
|
341
|
+
}); };
|
|
342
|
+
var deserializeAws_restJson1LogoutCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
343
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
344
|
+
var _c;
|
|
345
|
+
return __generator(this, function (_d) {
|
|
346
|
+
switch (_d.label) {
|
|
347
|
+
case 0:
|
|
348
|
+
_a = [__assign({}, output)];
|
|
349
|
+
_c = {};
|
|
350
|
+
return [4, parseErrorBody(output.body, context)];
|
|
351
|
+
case 1:
|
|
352
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
353
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
354
|
+
_b = errorCode;
|
|
355
|
+
switch (_b) {
|
|
356
|
+
case "InvalidRequestException": return [3, 2];
|
|
357
|
+
case "com.amazonaws.sso#InvalidRequestException": return [3, 2];
|
|
358
|
+
case "TooManyRequestsException": return [3, 4];
|
|
359
|
+
case "com.amazonaws.sso#TooManyRequestsException": return [3, 4];
|
|
360
|
+
case "UnauthorizedException": return [3, 6];
|
|
361
|
+
case "com.amazonaws.sso#UnauthorizedException": return [3, 6];
|
|
362
|
+
}
|
|
363
|
+
return [3, 8];
|
|
364
|
+
case 2: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
|
|
365
|
+
case 3: throw _d.sent();
|
|
366
|
+
case 4: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
|
|
367
|
+
case 5: throw _d.sent();
|
|
368
|
+
case 6: return [4, deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)];
|
|
369
|
+
case 7: throw _d.sent();
|
|
370
|
+
case 8:
|
|
371
|
+
parsedBody = parsedOutput.body;
|
|
372
|
+
throwDefaultError({
|
|
373
|
+
output: output,
|
|
374
|
+
parsedBody: parsedBody,
|
|
375
|
+
exceptionCtor: __BaseException,
|
|
376
|
+
errorCode: errorCode,
|
|
377
|
+
});
|
|
378
|
+
_d.label = 9;
|
|
379
|
+
case 9: return [2];
|
|
380
|
+
}
|
|
227
381
|
});
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
|
|
241
|
-
case "TooManyRequestsException":
|
|
242
|
-
case "com.amazonaws.sso#TooManyRequestsException":
|
|
243
|
-
throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
|
|
244
|
-
case "UnauthorizedException":
|
|
245
|
-
case "com.amazonaws.sso#UnauthorizedException":
|
|
246
|
-
throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
|
|
247
|
-
default:
|
|
248
|
-
const parsedBody = parsedOutput.body;
|
|
249
|
-
throwDefaultError({
|
|
250
|
-
output,
|
|
251
|
-
parsedBody,
|
|
252
|
-
exceptionCtor: __BaseException,
|
|
253
|
-
errorCode,
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
};
|
|
257
|
-
const map = __map;
|
|
258
|
-
const deserializeAws_restJson1InvalidRequestExceptionResponse = async (parsedOutput, context) => {
|
|
259
|
-
const contents = map({});
|
|
260
|
-
const data = parsedOutput.body;
|
|
261
|
-
if (data.message != null) {
|
|
262
|
-
contents.message = __expectString(data.message);
|
|
263
|
-
}
|
|
264
|
-
const exception = new InvalidRequestException({
|
|
265
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
266
|
-
...contents,
|
|
382
|
+
}); };
|
|
383
|
+
var map = __map;
|
|
384
|
+
var deserializeAws_restJson1InvalidRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
385
|
+
var contents, data, exception;
|
|
386
|
+
return __generator(this, function (_a) {
|
|
387
|
+
contents = map({});
|
|
388
|
+
data = parsedOutput.body;
|
|
389
|
+
if (data.message != null) {
|
|
390
|
+
contents.message = __expectString(data.message);
|
|
391
|
+
}
|
|
392
|
+
exception = new InvalidRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
393
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
267
394
|
});
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
278
|
-
|
|
395
|
+
}); };
|
|
396
|
+
var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
397
|
+
var contents, data, exception;
|
|
398
|
+
return __generator(this, function (_a) {
|
|
399
|
+
contents = map({});
|
|
400
|
+
data = parsedOutput.body;
|
|
401
|
+
if (data.message != null) {
|
|
402
|
+
contents.message = __expectString(data.message);
|
|
403
|
+
}
|
|
404
|
+
exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
405
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
279
406
|
});
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
290
|
-
|
|
407
|
+
}); };
|
|
408
|
+
var deserializeAws_restJson1TooManyRequestsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
409
|
+
var contents, data, exception;
|
|
410
|
+
return __generator(this, function (_a) {
|
|
411
|
+
contents = map({});
|
|
412
|
+
data = parsedOutput.body;
|
|
413
|
+
if (data.message != null) {
|
|
414
|
+
contents.message = __expectString(data.message);
|
|
415
|
+
}
|
|
416
|
+
exception = new TooManyRequestsException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
417
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
291
418
|
});
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
302
|
-
|
|
419
|
+
}); };
|
|
420
|
+
var deserializeAws_restJson1UnauthorizedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
421
|
+
var contents, data, exception;
|
|
422
|
+
return __generator(this, function (_a) {
|
|
423
|
+
contents = map({});
|
|
424
|
+
data = parsedOutput.body;
|
|
425
|
+
if (data.message != null) {
|
|
426
|
+
contents.message = __expectString(data.message);
|
|
427
|
+
}
|
|
428
|
+
exception = new UnauthorizedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
429
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
303
430
|
});
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
const deserializeAws_restJson1AccountInfo = (output, context) => {
|
|
431
|
+
}); };
|
|
432
|
+
var deserializeAws_restJson1AccountInfo = function (output, context) {
|
|
307
433
|
return {
|
|
308
434
|
accountId: __expectString(output.accountId),
|
|
309
435
|
accountName: __expectString(output.accountName),
|
|
310
436
|
emailAddress: __expectString(output.emailAddress),
|
|
311
437
|
};
|
|
312
438
|
};
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
.filter((e)
|
|
316
|
-
.map((entry)
|
|
439
|
+
var deserializeAws_restJson1AccountListType = function (output, context) {
|
|
440
|
+
var retVal = (output || [])
|
|
441
|
+
.filter(function (e) { return e != null; })
|
|
442
|
+
.map(function (entry) {
|
|
317
443
|
if (entry === null) {
|
|
318
444
|
return null;
|
|
319
445
|
}
|
|
@@ -321,7 +447,7 @@ const deserializeAws_restJson1AccountListType = (output, context) => {
|
|
|
321
447
|
});
|
|
322
448
|
return retVal;
|
|
323
449
|
};
|
|
324
|
-
|
|
450
|
+
var deserializeAws_restJson1RoleCredentials = function (output, context) {
|
|
325
451
|
return {
|
|
326
452
|
accessKeyId: __expectString(output.accessKeyId),
|
|
327
453
|
expiration: __expectLong(output.expiration),
|
|
@@ -329,16 +455,16 @@ const deserializeAws_restJson1RoleCredentials = (output, context) => {
|
|
|
329
455
|
sessionToken: __expectString(output.sessionToken),
|
|
330
456
|
};
|
|
331
457
|
};
|
|
332
|
-
|
|
458
|
+
var deserializeAws_restJson1RoleInfo = function (output, context) {
|
|
333
459
|
return {
|
|
334
460
|
accountId: __expectString(output.accountId),
|
|
335
461
|
roleName: __expectString(output.roleName),
|
|
336
462
|
};
|
|
337
463
|
};
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
.filter((e)
|
|
341
|
-
.map((entry)
|
|
464
|
+
var deserializeAws_restJson1RoleListType = function (output, context) {
|
|
465
|
+
var retVal = (output || [])
|
|
466
|
+
.filter(function (e) { return e != null; })
|
|
467
|
+
.map(function (entry) {
|
|
342
468
|
if (entry === null) {
|
|
343
469
|
return null;
|
|
344
470
|
}
|
|
@@ -346,39 +472,57 @@ const deserializeAws_restJson1RoleListType = (output, context) => {
|
|
|
346
472
|
});
|
|
347
473
|
return retVal;
|
|
348
474
|
};
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
475
|
+
var deserializeMetadata = function (output) {
|
|
476
|
+
var _a, _b;
|
|
477
|
+
return ({
|
|
478
|
+
httpStatusCode: output.statusCode,
|
|
479
|
+
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"],
|
|
480
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
481
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
482
|
+
});
|
|
483
|
+
};
|
|
484
|
+
var collectBody = function (streamBody, context) {
|
|
485
|
+
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
356
486
|
if (streamBody instanceof Uint8Array) {
|
|
357
487
|
return Promise.resolve(streamBody);
|
|
358
488
|
}
|
|
359
489
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
360
490
|
};
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
491
|
+
var collectBodyString = function (streamBody, context) {
|
|
492
|
+
return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
|
|
493
|
+
};
|
|
494
|
+
var isSerializableHeaderValue = function (value) {
|
|
495
|
+
return value !== undefined &&
|
|
496
|
+
value !== null &&
|
|
497
|
+
value !== "" &&
|
|
498
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
499
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
500
|
+
};
|
|
501
|
+
var parseBody = function (streamBody, context) {
|
|
502
|
+
return collectBodyString(streamBody, context).then(function (encoded) {
|
|
503
|
+
if (encoded.length) {
|
|
504
|
+
return JSON.parse(encoded);
|
|
505
|
+
}
|
|
506
|
+
return {};
|
|
507
|
+
});
|
|
377
508
|
};
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
509
|
+
var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
510
|
+
var value;
|
|
511
|
+
var _a;
|
|
512
|
+
return __generator(this, function (_b) {
|
|
513
|
+
switch (_b.label) {
|
|
514
|
+
case 0: return [4, parseBody(errorBody, context)];
|
|
515
|
+
case 1:
|
|
516
|
+
value = _b.sent();
|
|
517
|
+
value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
|
|
518
|
+
return [2, value];
|
|
519
|
+
}
|
|
520
|
+
});
|
|
521
|
+
}); };
|
|
522
|
+
var loadRestJsonErrorCode = function (output, data) {
|
|
523
|
+
var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
|
|
524
|
+
var sanitizeErrorCode = function (rawValue) {
|
|
525
|
+
var cleanValue = rawValue;
|
|
382
526
|
if (typeof cleanValue === "number") {
|
|
383
527
|
cleanValue = cleanValue.toString();
|
|
384
528
|
}
|
|
@@ -393,7 +537,7 @@ const loadRestJsonErrorCode = (output, data) => {
|
|
|
393
537
|
}
|
|
394
538
|
return cleanValue;
|
|
395
539
|
};
|
|
396
|
-
|
|
540
|
+
var headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
397
541
|
if (headerKey !== undefined) {
|
|
398
542
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
399
543
|
}
|