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