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