@aws-sdk/client-rolesanywhere 3.180.0 → 3.183.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist-cjs/protocols/Aws_restJson1.js +32 -26
  3. package/dist-es/RolesAnywhere.js +106 -113
  4. package/dist-es/RolesAnywhereClient.js +22 -28
  5. package/dist-es/commands/CreateProfileCommand.js +21 -28
  6. package/dist-es/commands/CreateTrustAnchorCommand.js +21 -28
  7. package/dist-es/commands/DeleteCrlCommand.js +21 -28
  8. package/dist-es/commands/DeleteProfileCommand.js +21 -28
  9. package/dist-es/commands/DeleteTrustAnchorCommand.js +21 -28
  10. package/dist-es/commands/DisableCrlCommand.js +21 -28
  11. package/dist-es/commands/DisableProfileCommand.js +21 -28
  12. package/dist-es/commands/DisableTrustAnchorCommand.js +21 -28
  13. package/dist-es/commands/EnableCrlCommand.js +21 -28
  14. package/dist-es/commands/EnableProfileCommand.js +21 -28
  15. package/dist-es/commands/EnableTrustAnchorCommand.js +21 -28
  16. package/dist-es/commands/GetCrlCommand.js +21 -28
  17. package/dist-es/commands/GetProfileCommand.js +21 -28
  18. package/dist-es/commands/GetSubjectCommand.js +21 -28
  19. package/dist-es/commands/GetTrustAnchorCommand.js +21 -28
  20. package/dist-es/commands/ImportCrlCommand.js +21 -28
  21. package/dist-es/commands/ListCrlsCommand.js +21 -28
  22. package/dist-es/commands/ListProfilesCommand.js +21 -28
  23. package/dist-es/commands/ListSubjectsCommand.js +21 -28
  24. package/dist-es/commands/ListTagsForResourceCommand.js +21 -28
  25. package/dist-es/commands/ListTrustAnchorsCommand.js +21 -28
  26. package/dist-es/commands/TagResourceCommand.js +21 -28
  27. package/dist-es/commands/UntagResourceCommand.js +21 -28
  28. package/dist-es/commands/UpdateCrlCommand.js +21 -28
  29. package/dist-es/commands/UpdateProfileCommand.js +21 -28
  30. package/dist-es/commands/UpdateTrustAnchorCommand.js +21 -28
  31. package/dist-es/endpoints.js +8 -8
  32. package/dist-es/models/RolesAnywhereServiceException.js +5 -10
  33. package/dist-es/models/models_0.js +163 -83
  34. package/dist-es/pagination/ListCrlsPaginator.js +24 -67
  35. package/dist-es/pagination/ListProfilesPaginator.js +24 -67
  36. package/dist-es/pagination/ListSubjectsPaginator.js +24 -67
  37. package/dist-es/pagination/ListTrustAnchorsPaginator.js +24 -67
  38. package/dist-es/protocols/Aws_restJson1.js +1558 -2302
  39. package/dist-es/runtimeConfig.browser.js +26 -12
  40. package/dist-es/runtimeConfig.js +30 -12
  41. package/dist-es/runtimeConfig.native.js +8 -5
  42. package/dist-es/runtimeConfig.shared.js +8 -11
  43. package/package.json +33 -33
@@ -1,2306 +1,1566 @@
1
- import { __assign, __awaiter, __generator, __read } from "tslib";
2
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
2
  import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, map as __map, parseRfc3339DateTime as __parseRfc3339DateTime, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
3
  import { AccessDeniedException, ResourceNotFoundException, SourceData, TooManyTagsException, ValidationException, } from "../models/models_0";
5
4
  import { RolesAnywhereServiceException as __BaseException } from "../models/RolesAnywhereServiceException";
6
- export var serializeAws_restJson1CreateProfileCommand = 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 || "") + "/profiles";
17
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.durationSeconds != null && { durationSeconds: input.durationSeconds })), (input.enabled != null && { enabled: input.enabled })), (input.managedPolicyArns != null && {
18
- managedPolicyArns: serializeAws_restJson1ManagedPolicyList(input.managedPolicyArns, context),
19
- })), (input.name != null && { name: input.name })), (input.requireInstanceProperties != null && { requireInstanceProperties: input.requireInstanceProperties })), (input.roleArns != null && { roleArns: serializeAws_restJson1RoleArnList(input.roleArns, context) })), (input.sessionPolicy != null && { sessionPolicy: input.sessionPolicy })), (input.tags != null && { tags: serializeAws_restJson1TagList(input.tags, context) })));
20
- return [2, new __HttpRequest({
21
- protocol: protocol,
22
- hostname: hostname,
23
- port: port,
24
- method: "POST",
25
- headers: headers,
26
- path: resolvedPath,
27
- body: body,
28
- })];
29
- }
30
- });
31
- }); };
32
- export var serializeAws_restJson1CreateTrustAnchorCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
33
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
34
- return __generator(this, function (_c) {
35
- switch (_c.label) {
36
- case 0: return [4, context.endpoint()];
37
- case 1:
38
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
39
- headers = {
40
- "content-type": "application/json",
41
- };
42
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/trustanchors";
43
- body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.enabled != null && { enabled: input.enabled })), (input.name != null && { name: input.name })), (input.source != null && { source: serializeAws_restJson1Source(input.source, context) })), (input.tags != null && { tags: serializeAws_restJson1TagList(input.tags, context) })));
44
- return [2, new __HttpRequest({
45
- protocol: protocol,
46
- hostname: hostname,
47
- port: port,
48
- method: "POST",
49
- headers: headers,
50
- path: resolvedPath,
51
- body: body,
52
- })];
53
- }
54
- });
55
- }); };
56
- export var serializeAws_restJson1DeleteCrlCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
57
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
58
- return __generator(this, function (_c) {
59
- switch (_c.label) {
60
- case 0: return [4, context.endpoint()];
61
- case 1:
62
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
63
- headers = {};
64
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/crl/{crlId}";
65
- resolvedPath = __resolvedPath(resolvedPath, input, "crlId", function () { return input.crlId; }, "{crlId}", false);
66
- return [2, new __HttpRequest({
67
- protocol: protocol,
68
- hostname: hostname,
69
- port: port,
70
- method: "DELETE",
71
- headers: headers,
72
- path: resolvedPath,
73
- body: body,
74
- })];
75
- }
76
- });
77
- }); };
78
- export var serializeAws_restJson1DeleteProfileCommand = 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
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/profile/{profileId}";
87
- resolvedPath = __resolvedPath(resolvedPath, input, "profileId", function () { return input.profileId; }, "{profileId}", false);
88
- return [2, new __HttpRequest({
89
- protocol: protocol,
90
- hostname: hostname,
91
- port: port,
92
- method: "DELETE",
93
- headers: headers,
94
- path: resolvedPath,
95
- body: body,
96
- })];
97
- }
98
- });
99
- }); };
100
- export var serializeAws_restJson1DeleteTrustAnchorCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
101
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
102
- return __generator(this, function (_c) {
103
- switch (_c.label) {
104
- case 0: return [4, context.endpoint()];
105
- case 1:
106
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
107
- headers = {};
108
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/trustanchor/{trustAnchorId}";
109
- resolvedPath = __resolvedPath(resolvedPath, input, "trustAnchorId", function () { return input.trustAnchorId; }, "{trustAnchorId}", false);
110
- return [2, new __HttpRequest({
111
- protocol: protocol,
112
- hostname: hostname,
113
- port: port,
114
- method: "DELETE",
115
- headers: headers,
116
- path: resolvedPath,
117
- body: body,
118
- })];
119
- }
120
- });
121
- }); };
122
- export var serializeAws_restJson1DisableCrlCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
123
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
124
- return __generator(this, function (_c) {
125
- switch (_c.label) {
126
- case 0: return [4, context.endpoint()];
127
- case 1:
128
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
129
- headers = {};
130
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/crl/{crlId}/disable";
131
- resolvedPath = __resolvedPath(resolvedPath, input, "crlId", function () { return input.crlId; }, "{crlId}", false);
132
- return [2, new __HttpRequest({
133
- protocol: protocol,
134
- hostname: hostname,
135
- port: port,
136
- method: "POST",
137
- headers: headers,
138
- path: resolvedPath,
139
- body: body,
140
- })];
141
- }
142
- });
143
- }); };
144
- export var serializeAws_restJson1DisableProfileCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
145
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
146
- return __generator(this, function (_c) {
147
- switch (_c.label) {
148
- case 0: return [4, context.endpoint()];
149
- case 1:
150
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
151
- headers = {};
152
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/profile/{profileId}/disable";
153
- resolvedPath = __resolvedPath(resolvedPath, input, "profileId", function () { return input.profileId; }, "{profileId}", false);
154
- return [2, new __HttpRequest({
155
- protocol: protocol,
156
- hostname: hostname,
157
- port: port,
158
- method: "POST",
159
- headers: headers,
160
- path: resolvedPath,
161
- body: body,
162
- })];
163
- }
164
- });
165
- }); };
166
- export var serializeAws_restJson1DisableTrustAnchorCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
167
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
168
- return __generator(this, function (_c) {
169
- switch (_c.label) {
170
- case 0: return [4, context.endpoint()];
171
- case 1:
172
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
173
- headers = {};
174
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/trustanchor/{trustAnchorId}/disable";
175
- resolvedPath = __resolvedPath(resolvedPath, input, "trustAnchorId", function () { return input.trustAnchorId; }, "{trustAnchorId}", false);
176
- return [2, new __HttpRequest({
177
- protocol: protocol,
178
- hostname: hostname,
179
- port: port,
180
- method: "POST",
181
- headers: headers,
182
- path: resolvedPath,
183
- body: body,
184
- })];
185
- }
186
- });
187
- }); };
188
- export var serializeAws_restJson1EnableCrlCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
189
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
190
- return __generator(this, function (_c) {
191
- switch (_c.label) {
192
- case 0: return [4, context.endpoint()];
193
- case 1:
194
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
195
- headers = {};
196
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/crl/{crlId}/enable";
197
- resolvedPath = __resolvedPath(resolvedPath, input, "crlId", function () { return input.crlId; }, "{crlId}", false);
198
- return [2, new __HttpRequest({
199
- protocol: protocol,
200
- hostname: hostname,
201
- port: port,
202
- method: "POST",
203
- headers: headers,
204
- path: resolvedPath,
205
- body: body,
206
- })];
207
- }
208
- });
209
- }); };
210
- export var serializeAws_restJson1EnableProfileCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
211
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
212
- return __generator(this, function (_c) {
213
- switch (_c.label) {
214
- case 0: return [4, context.endpoint()];
215
- case 1:
216
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
217
- headers = {};
218
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/profile/{profileId}/enable";
219
- resolvedPath = __resolvedPath(resolvedPath, input, "profileId", function () { return input.profileId; }, "{profileId}", false);
220
- return [2, new __HttpRequest({
221
- protocol: protocol,
222
- hostname: hostname,
223
- port: port,
224
- method: "POST",
225
- headers: headers,
226
- path: resolvedPath,
227
- body: body,
228
- })];
229
- }
230
- });
231
- }); };
232
- export var serializeAws_restJson1EnableTrustAnchorCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
233
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
234
- return __generator(this, function (_c) {
235
- switch (_c.label) {
236
- case 0: return [4, context.endpoint()];
237
- case 1:
238
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
239
- headers = {};
240
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/trustanchor/{trustAnchorId}/enable";
241
- resolvedPath = __resolvedPath(resolvedPath, input, "trustAnchorId", function () { return input.trustAnchorId; }, "{trustAnchorId}", false);
242
- return [2, new __HttpRequest({
243
- protocol: protocol,
244
- hostname: hostname,
245
- port: port,
246
- method: "POST",
247
- headers: headers,
248
- path: resolvedPath,
249
- body: body,
250
- })];
251
- }
252
- });
253
- }); };
254
- export var serializeAws_restJson1GetCrlCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
255
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
256
- return __generator(this, function (_c) {
257
- switch (_c.label) {
258
- case 0: return [4, context.endpoint()];
259
- case 1:
260
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
261
- headers = {};
262
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/crl/{crlId}";
263
- resolvedPath = __resolvedPath(resolvedPath, input, "crlId", function () { return input.crlId; }, "{crlId}", false);
264
- return [2, new __HttpRequest({
265
- protocol: protocol,
266
- hostname: hostname,
267
- port: port,
268
- method: "GET",
269
- headers: headers,
270
- path: resolvedPath,
271
- body: body,
272
- })];
273
- }
274
- });
275
- }); };
276
- export var serializeAws_restJson1GetProfileCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
277
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
278
- return __generator(this, function (_c) {
279
- switch (_c.label) {
280
- case 0: return [4, context.endpoint()];
281
- case 1:
282
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
283
- headers = {};
284
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/profile/{profileId}";
285
- resolvedPath = __resolvedPath(resolvedPath, input, "profileId", function () { return input.profileId; }, "{profileId}", false);
286
- return [2, new __HttpRequest({
287
- protocol: protocol,
288
- hostname: hostname,
289
- port: port,
290
- method: "GET",
291
- headers: headers,
292
- path: resolvedPath,
293
- body: body,
294
- })];
295
- }
296
- });
297
- }); };
298
- export var serializeAws_restJson1GetSubjectCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
299
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
300
- return __generator(this, function (_c) {
301
- switch (_c.label) {
302
- case 0: return [4, context.endpoint()];
303
- case 1:
304
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
305
- headers = {};
306
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/subject/{subjectId}";
307
- resolvedPath = __resolvedPath(resolvedPath, input, "subjectId", function () { return input.subjectId; }, "{subjectId}", false);
308
- return [2, new __HttpRequest({
309
- protocol: protocol,
310
- hostname: hostname,
311
- port: port,
312
- method: "GET",
313
- headers: headers,
314
- path: resolvedPath,
315
- body: body,
316
- })];
317
- }
318
- });
319
- }); };
320
- export var serializeAws_restJson1GetTrustAnchorCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
321
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
322
- return __generator(this, function (_c) {
323
- switch (_c.label) {
324
- case 0: return [4, context.endpoint()];
325
- case 1:
326
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
327
- headers = {};
328
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/trustanchor/{trustAnchorId}";
329
- resolvedPath = __resolvedPath(resolvedPath, input, "trustAnchorId", function () { return input.trustAnchorId; }, "{trustAnchorId}", false);
330
- return [2, new __HttpRequest({
331
- protocol: protocol,
332
- hostname: hostname,
333
- port: port,
334
- method: "GET",
335
- headers: headers,
336
- path: resolvedPath,
337
- body: body,
338
- })];
339
- }
340
- });
341
- }); };
342
- export var serializeAws_restJson1ImportCrlCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
343
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
344
- return __generator(this, function (_c) {
345
- switch (_c.label) {
346
- case 0: return [4, context.endpoint()];
347
- case 1:
348
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
349
- headers = {
350
- "content-type": "application/json",
351
- };
352
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/crls";
353
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign({}, (input.crlData != null && { crlData: context.base64Encoder(input.crlData) })), (input.enabled != null && { enabled: input.enabled })), (input.name != null && { name: input.name })), (input.tags != null && { tags: serializeAws_restJson1TagList(input.tags, context) })), (input.trustAnchorArn != null && { trustAnchorArn: input.trustAnchorArn })));
354
- return [2, new __HttpRequest({
355
- protocol: protocol,
356
- hostname: hostname,
357
- port: port,
358
- method: "POST",
359
- headers: headers,
360
- path: resolvedPath,
361
- body: body,
362
- })];
363
- }
364
- });
365
- }); };
366
- export var serializeAws_restJson1ListCrlsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
367
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
368
- return __generator(this, function (_c) {
369
- switch (_c.label) {
370
- case 0: return [4, context.endpoint()];
371
- case 1:
372
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
373
- headers = {};
374
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/crls";
375
- query = map({
376
- nextToken: [, input.nextToken],
377
- pageSize: [function () { return input.pageSize !== void 0; }, function () { return input.pageSize.toString(); }],
378
- });
379
- return [2, new __HttpRequest({
380
- protocol: protocol,
381
- hostname: hostname,
382
- port: port,
383
- method: "GET",
384
- headers: headers,
385
- path: resolvedPath,
386
- query: query,
387
- body: body,
388
- })];
389
- }
390
- });
391
- }); };
392
- export var serializeAws_restJson1ListProfilesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
393
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
394
- return __generator(this, function (_c) {
395
- switch (_c.label) {
396
- case 0: return [4, context.endpoint()];
397
- case 1:
398
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
399
- headers = {};
400
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/profiles";
401
- query = map({
402
- nextToken: [, input.nextToken],
403
- pageSize: [function () { return input.pageSize !== void 0; }, function () { return input.pageSize.toString(); }],
404
- });
405
- return [2, new __HttpRequest({
406
- protocol: protocol,
407
- hostname: hostname,
408
- port: port,
409
- method: "GET",
410
- headers: headers,
411
- path: resolvedPath,
412
- query: query,
413
- body: body,
414
- })];
415
- }
416
- });
417
- }); };
418
- export var serializeAws_restJson1ListSubjectsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
419
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
420
- return __generator(this, function (_c) {
421
- switch (_c.label) {
422
- case 0: return [4, context.endpoint()];
423
- case 1:
424
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
425
- headers = {};
426
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/subjects";
427
- query = map({
428
- nextToken: [, input.nextToken],
429
- pageSize: [function () { return input.pageSize !== void 0; }, function () { return input.pageSize.toString(); }],
430
- });
431
- return [2, new __HttpRequest({
432
- protocol: protocol,
433
- hostname: hostname,
434
- port: port,
435
- method: "GET",
436
- headers: headers,
437
- path: resolvedPath,
438
- query: query,
439
- body: body,
440
- })];
441
- }
442
- });
443
- }); };
444
- export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
445
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
446
- return __generator(this, function (_c) {
447
- switch (_c.label) {
448
- case 0: return [4, context.endpoint()];
449
- case 1:
450
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
451
- headers = {};
452
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/ListTagsForResource";
453
- query = map({
454
- resourceArn: [, input.resourceArn],
455
- });
456
- return [2, new __HttpRequest({
457
- protocol: protocol,
458
- hostname: hostname,
459
- port: port,
460
- method: "GET",
461
- headers: headers,
462
- path: resolvedPath,
463
- query: query,
464
- body: body,
465
- })];
466
- }
467
- });
468
- }); };
469
- export var serializeAws_restJson1ListTrustAnchorsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
470
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
471
- return __generator(this, function (_c) {
472
- switch (_c.label) {
473
- case 0: return [4, context.endpoint()];
474
- case 1:
475
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
476
- headers = {};
477
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/trustanchors";
478
- query = map({
479
- nextToken: [, input.nextToken],
480
- pageSize: [function () { return input.pageSize !== void 0; }, function () { return input.pageSize.toString(); }],
481
- });
482
- return [2, new __HttpRequest({
483
- protocol: protocol,
484
- hostname: hostname,
485
- port: port,
486
- method: "GET",
487
- headers: headers,
488
- path: resolvedPath,
489
- query: query,
490
- body: body,
491
- })];
492
- }
493
- });
494
- }); };
495
- export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
496
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
497
- return __generator(this, function (_c) {
498
- switch (_c.label) {
499
- case 0: return [4, context.endpoint()];
500
- case 1:
501
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
502
- headers = {
503
- "content-type": "application/json",
504
- };
505
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/TagResource";
506
- body = JSON.stringify(__assign(__assign({}, (input.resourceArn != null && { resourceArn: input.resourceArn })), (input.tags != null && { tags: serializeAws_restJson1TagList(input.tags, context) })));
507
- return [2, new __HttpRequest({
508
- protocol: protocol,
509
- hostname: hostname,
510
- port: port,
511
- method: "POST",
512
- headers: headers,
513
- path: resolvedPath,
514
- body: body,
515
- })];
516
- }
517
- });
518
- }); };
519
- export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
520
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
521
- return __generator(this, function (_c) {
522
- switch (_c.label) {
523
- case 0: return [4, context.endpoint()];
524
- case 1:
525
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
526
- headers = {
527
- "content-type": "application/json",
528
- };
529
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/UntagResource";
530
- body = JSON.stringify(__assign(__assign({}, (input.resourceArn != null && { resourceArn: input.resourceArn })), (input.tagKeys != null && { tagKeys: serializeAws_restJson1TagKeyList(input.tagKeys, context) })));
531
- return [2, new __HttpRequest({
532
- protocol: protocol,
533
- hostname: hostname,
534
- port: port,
535
- method: "POST",
536
- headers: headers,
537
- path: resolvedPath,
538
- body: body,
539
- })];
540
- }
541
- });
542
- }); };
543
- export var serializeAws_restJson1UpdateCrlCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
544
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
545
- return __generator(this, function (_c) {
546
- switch (_c.label) {
547
- case 0: return [4, context.endpoint()];
548
- case 1:
549
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
550
- headers = {
551
- "content-type": "application/json",
552
- };
553
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/crl/{crlId}";
554
- resolvedPath = __resolvedPath(resolvedPath, input, "crlId", function () { return input.crlId; }, "{crlId}", false);
555
- body = JSON.stringify(__assign(__assign({}, (input.crlData != null && { crlData: context.base64Encoder(input.crlData) })), (input.name != null && { name: input.name })));
556
- return [2, new __HttpRequest({
557
- protocol: protocol,
558
- hostname: hostname,
559
- port: port,
560
- method: "PATCH",
561
- headers: headers,
562
- path: resolvedPath,
563
- body: body,
564
- })];
565
- }
5
+ export const serializeAws_restJson1CreateProfileCommand = 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 || ""}` + "/profiles";
11
+ let body;
12
+ body = JSON.stringify({
13
+ ...(input.durationSeconds != null && { durationSeconds: input.durationSeconds }),
14
+ ...(input.enabled != null && { enabled: input.enabled }),
15
+ ...(input.managedPolicyArns != null && {
16
+ managedPolicyArns: serializeAws_restJson1ManagedPolicyList(input.managedPolicyArns, context),
17
+ }),
18
+ ...(input.name != null && { name: input.name }),
19
+ ...(input.requireInstanceProperties != null && { requireInstanceProperties: input.requireInstanceProperties }),
20
+ ...(input.roleArns != null && { roleArns: serializeAws_restJson1RoleArnList(input.roleArns, context) }),
21
+ ...(input.sessionPolicy != null && { sessionPolicy: input.sessionPolicy }),
22
+ ...(input.tags != null && { tags: serializeAws_restJson1TagList(input.tags, context) }),
23
+ });
24
+ return new __HttpRequest({
25
+ protocol,
26
+ hostname,
27
+ port,
28
+ method: "POST",
29
+ headers,
30
+ path: resolvedPath,
31
+ body,
566
32
  });
567
- }); };
568
- export var serializeAws_restJson1UpdateProfileCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
569
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
570
- return __generator(this, function (_c) {
571
- switch (_c.label) {
572
- case 0: return [4, context.endpoint()];
573
- case 1:
574
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
575
- headers = {
576
- "content-type": "application/json",
577
- };
578
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/profile/{profileId}";
579
- resolvedPath = __resolvedPath(resolvedPath, input, "profileId", function () { return input.profileId; }, "{profileId}", false);
580
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign({}, (input.durationSeconds != null && { durationSeconds: input.durationSeconds })), (input.managedPolicyArns != null && {
581
- managedPolicyArns: serializeAws_restJson1ManagedPolicyList(input.managedPolicyArns, context),
582
- })), (input.name != null && { name: input.name })), (input.roleArns != null && { roleArns: serializeAws_restJson1RoleArnList(input.roleArns, context) })), (input.sessionPolicy != null && { sessionPolicy: input.sessionPolicy })));
583
- return [2, new __HttpRequest({
584
- protocol: protocol,
585
- hostname: hostname,
586
- port: port,
587
- method: "PATCH",
588
- headers: headers,
589
- path: resolvedPath,
590
- body: body,
591
- })];
592
- }
33
+ };
34
+ export const serializeAws_restJson1CreateTrustAnchorCommand = async (input, context) => {
35
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
36
+ const headers = {
37
+ "content-type": "application/json",
38
+ };
39
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/trustanchors";
40
+ let body;
41
+ body = JSON.stringify({
42
+ ...(input.enabled != null && { enabled: input.enabled }),
43
+ ...(input.name != null && { name: input.name }),
44
+ ...(input.source != null && { source: serializeAws_restJson1Source(input.source, context) }),
45
+ ...(input.tags != null && { tags: serializeAws_restJson1TagList(input.tags, context) }),
46
+ });
47
+ return new __HttpRequest({
48
+ protocol,
49
+ hostname,
50
+ port,
51
+ method: "POST",
52
+ headers,
53
+ path: resolvedPath,
54
+ body,
593
55
  });
594
- }); };
595
- export var serializeAws_restJson1UpdateTrustAnchorCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
596
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
597
- return __generator(this, function (_c) {
598
- switch (_c.label) {
599
- case 0: return [4, context.endpoint()];
600
- case 1:
601
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
602
- headers = {
603
- "content-type": "application/json",
604
- };
605
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/trustanchor/{trustAnchorId}";
606
- resolvedPath = __resolvedPath(resolvedPath, input, "trustAnchorId", function () { return input.trustAnchorId; }, "{trustAnchorId}", false);
607
- body = JSON.stringify(__assign(__assign({}, (input.name != null && { name: input.name })), (input.source != null && { source: serializeAws_restJson1Source(input.source, context) })));
608
- return [2, new __HttpRequest({
609
- protocol: protocol,
610
- hostname: hostname,
611
- port: port,
612
- method: "PATCH",
613
- headers: headers,
614
- path: resolvedPath,
615
- body: body,
616
- })];
617
- }
56
+ };
57
+ export const serializeAws_restJson1DeleteCrlCommand = async (input, context) => {
58
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
59
+ const headers = {};
60
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/crl/{crlId}";
61
+ resolvedPath = __resolvedPath(resolvedPath, input, "crlId", () => input.crlId, "{crlId}", false);
62
+ let body;
63
+ return new __HttpRequest({
64
+ protocol,
65
+ hostname,
66
+ port,
67
+ method: "DELETE",
68
+ headers,
69
+ path: resolvedPath,
70
+ body,
618
71
  });
619
- }); };
620
- export var deserializeAws_restJson1CreateProfileCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
621
- var contents, data, _a, _b;
622
- return __generator(this, function (_c) {
623
- switch (_c.label) {
624
- case 0:
625
- if (output.statusCode !== 201 && output.statusCode >= 300) {
626
- return [2, deserializeAws_restJson1CreateProfileCommandError(output, context)];
627
- }
628
- contents = map({
629
- $metadata: deserializeMetadata(output),
630
- });
631
- _a = __expectNonNull;
632
- _b = __expectObject;
633
- return [4, parseBody(output.body, context)];
634
- case 1:
635
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
636
- if (data.profile != null) {
637
- contents.profile = deserializeAws_restJson1ProfileDetail(data.profile, context);
638
- }
639
- return [2, contents];
640
- }
72
+ };
73
+ export const serializeAws_restJson1DeleteProfileCommand = async (input, context) => {
74
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
75
+ const headers = {};
76
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/profile/{profileId}";
77
+ resolvedPath = __resolvedPath(resolvedPath, input, "profileId", () => input.profileId, "{profileId}", false);
78
+ let body;
79
+ return new __HttpRequest({
80
+ protocol,
81
+ hostname,
82
+ port,
83
+ method: "DELETE",
84
+ headers,
85
+ path: resolvedPath,
86
+ body,
641
87
  });
642
- }); };
643
- var deserializeAws_restJson1CreateProfileCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
644
- var parsedOutput, _a, errorCode, _b, parsedBody;
645
- var _c;
646
- return __generator(this, function (_d) {
647
- switch (_d.label) {
648
- case 0:
649
- _a = [__assign({}, output)];
650
- _c = {};
651
- return [4, parseBody(output.body, context)];
652
- case 1:
653
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
654
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
655
- _b = errorCode;
656
- switch (_b) {
657
- case "AccessDeniedException": return [3, 2];
658
- case "com.amazonaws.rolesanywhere#AccessDeniedException": return [3, 2];
659
- case "ValidationException": return [3, 4];
660
- case "com.amazonaws.rolesanywhere#ValidationException": return [3, 4];
661
- }
662
- return [3, 6];
663
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
664
- case 3: throw _d.sent();
665
- case 4: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
666
- case 5: throw _d.sent();
667
- case 6:
668
- parsedBody = parsedOutput.body;
669
- throwDefaultError({
670
- output: output,
671
- parsedBody: parsedBody,
672
- exceptionCtor: __BaseException,
673
- errorCode: errorCode,
674
- });
675
- _d.label = 7;
676
- case 7: return [2];
677
- }
88
+ };
89
+ export const serializeAws_restJson1DeleteTrustAnchorCommand = async (input, context) => {
90
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
91
+ const headers = {};
92
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/trustanchor/{trustAnchorId}";
93
+ resolvedPath = __resolvedPath(resolvedPath, input, "trustAnchorId", () => input.trustAnchorId, "{trustAnchorId}", false);
94
+ let body;
95
+ return new __HttpRequest({
96
+ protocol,
97
+ hostname,
98
+ port,
99
+ method: "DELETE",
100
+ headers,
101
+ path: resolvedPath,
102
+ body,
678
103
  });
679
- }); };
680
- export var deserializeAws_restJson1CreateTrustAnchorCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
681
- var contents, data, _a, _b;
682
- return __generator(this, function (_c) {
683
- switch (_c.label) {
684
- case 0:
685
- if (output.statusCode !== 201 && output.statusCode >= 300) {
686
- return [2, deserializeAws_restJson1CreateTrustAnchorCommandError(output, context)];
687
- }
688
- contents = map({
689
- $metadata: deserializeMetadata(output),
690
- });
691
- _a = __expectNonNull;
692
- _b = __expectObject;
693
- return [4, parseBody(output.body, context)];
694
- case 1:
695
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
696
- if (data.trustAnchor != null) {
697
- contents.trustAnchor = deserializeAws_restJson1TrustAnchorDetail(data.trustAnchor, context);
698
- }
699
- return [2, contents];
700
- }
104
+ };
105
+ export const serializeAws_restJson1DisableCrlCommand = async (input, context) => {
106
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
107
+ const headers = {};
108
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/crl/{crlId}/disable";
109
+ resolvedPath = __resolvedPath(resolvedPath, input, "crlId", () => input.crlId, "{crlId}", false);
110
+ let body;
111
+ return new __HttpRequest({
112
+ protocol,
113
+ hostname,
114
+ port,
115
+ method: "POST",
116
+ headers,
117
+ path: resolvedPath,
118
+ body,
701
119
  });
702
- }); };
703
- var deserializeAws_restJson1CreateTrustAnchorCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
704
- var parsedOutput, _a, errorCode, _b, parsedBody;
705
- var _c;
706
- return __generator(this, function (_d) {
707
- switch (_d.label) {
708
- case 0:
709
- _a = [__assign({}, output)];
710
- _c = {};
711
- return [4, parseBody(output.body, context)];
712
- case 1:
713
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
714
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
715
- _b = errorCode;
716
- switch (_b) {
717
- case "AccessDeniedException": return [3, 2];
718
- case "com.amazonaws.rolesanywhere#AccessDeniedException": return [3, 2];
719
- case "ValidationException": return [3, 4];
720
- case "com.amazonaws.rolesanywhere#ValidationException": return [3, 4];
721
- }
722
- return [3, 6];
723
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
724
- case 3: throw _d.sent();
725
- case 4: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
726
- case 5: throw _d.sent();
727
- case 6:
728
- parsedBody = parsedOutput.body;
729
- throwDefaultError({
730
- output: output,
731
- parsedBody: parsedBody,
732
- exceptionCtor: __BaseException,
733
- errorCode: errorCode,
734
- });
735
- _d.label = 7;
736
- case 7: return [2];
737
- }
120
+ };
121
+ export const serializeAws_restJson1DisableProfileCommand = async (input, context) => {
122
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
123
+ const headers = {};
124
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/profile/{profileId}/disable";
125
+ resolvedPath = __resolvedPath(resolvedPath, input, "profileId", () => input.profileId, "{profileId}", false);
126
+ let body;
127
+ return new __HttpRequest({
128
+ protocol,
129
+ hostname,
130
+ port,
131
+ method: "POST",
132
+ headers,
133
+ path: resolvedPath,
134
+ body,
738
135
  });
739
- }); };
740
- export var deserializeAws_restJson1DeleteCrlCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
741
- var contents, data, _a, _b;
742
- return __generator(this, function (_c) {
743
- switch (_c.label) {
744
- case 0:
745
- if (output.statusCode !== 200 && output.statusCode >= 300) {
746
- return [2, deserializeAws_restJson1DeleteCrlCommandError(output, context)];
747
- }
748
- contents = map({
749
- $metadata: deserializeMetadata(output),
750
- });
751
- _a = __expectNonNull;
752
- _b = __expectObject;
753
- return [4, parseBody(output.body, context)];
754
- case 1:
755
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
756
- if (data.crl != null) {
757
- contents.crl = deserializeAws_restJson1CrlDetail(data.crl, context);
758
- }
759
- return [2, contents];
760
- }
136
+ };
137
+ export const serializeAws_restJson1DisableTrustAnchorCommand = async (input, context) => {
138
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
139
+ const headers = {};
140
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/trustanchor/{trustAnchorId}/disable";
141
+ resolvedPath = __resolvedPath(resolvedPath, input, "trustAnchorId", () => input.trustAnchorId, "{trustAnchorId}", false);
142
+ let body;
143
+ return new __HttpRequest({
144
+ protocol,
145
+ hostname,
146
+ port,
147
+ method: "POST",
148
+ headers,
149
+ path: resolvedPath,
150
+ body,
761
151
  });
762
- }); };
763
- var deserializeAws_restJson1DeleteCrlCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
764
- var parsedOutput, _a, errorCode, _b, parsedBody;
765
- var _c;
766
- return __generator(this, function (_d) {
767
- switch (_d.label) {
768
- case 0:
769
- _a = [__assign({}, output)];
770
- _c = {};
771
- return [4, parseBody(output.body, context)];
772
- case 1:
773
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
774
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
775
- _b = errorCode;
776
- switch (_b) {
777
- case "AccessDeniedException": return [3, 2];
778
- case "com.amazonaws.rolesanywhere#AccessDeniedException": return [3, 2];
779
- case "ResourceNotFoundException": return [3, 4];
780
- case "com.amazonaws.rolesanywhere#ResourceNotFoundException": return [3, 4];
781
- }
782
- return [3, 6];
783
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
784
- case 3: throw _d.sent();
785
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
786
- case 5: throw _d.sent();
787
- case 6:
788
- parsedBody = parsedOutput.body;
789
- throwDefaultError({
790
- output: output,
791
- parsedBody: parsedBody,
792
- exceptionCtor: __BaseException,
793
- errorCode: errorCode,
794
- });
795
- _d.label = 7;
796
- case 7: return [2];
797
- }
152
+ };
153
+ export const serializeAws_restJson1EnableCrlCommand = async (input, context) => {
154
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
155
+ const headers = {};
156
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/crl/{crlId}/enable";
157
+ resolvedPath = __resolvedPath(resolvedPath, input, "crlId", () => input.crlId, "{crlId}", false);
158
+ let body;
159
+ return new __HttpRequest({
160
+ protocol,
161
+ hostname,
162
+ port,
163
+ method: "POST",
164
+ headers,
165
+ path: resolvedPath,
166
+ body,
798
167
  });
799
- }); };
800
- export var deserializeAws_restJson1DeleteProfileCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
801
- var contents, data, _a, _b;
802
- return __generator(this, function (_c) {
803
- switch (_c.label) {
804
- case 0:
805
- if (output.statusCode !== 200 && output.statusCode >= 300) {
806
- return [2, deserializeAws_restJson1DeleteProfileCommandError(output, context)];
807
- }
808
- contents = map({
809
- $metadata: deserializeMetadata(output),
810
- });
811
- _a = __expectNonNull;
812
- _b = __expectObject;
813
- return [4, parseBody(output.body, context)];
814
- case 1:
815
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
816
- if (data.profile != null) {
817
- contents.profile = deserializeAws_restJson1ProfileDetail(data.profile, context);
818
- }
819
- return [2, contents];
820
- }
168
+ };
169
+ export const serializeAws_restJson1EnableProfileCommand = async (input, context) => {
170
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
171
+ const headers = {};
172
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/profile/{profileId}/enable";
173
+ resolvedPath = __resolvedPath(resolvedPath, input, "profileId", () => input.profileId, "{profileId}", false);
174
+ let body;
175
+ return new __HttpRequest({
176
+ protocol,
177
+ hostname,
178
+ port,
179
+ method: "POST",
180
+ headers,
181
+ path: resolvedPath,
182
+ body,
821
183
  });
822
- }); };
823
- var deserializeAws_restJson1DeleteProfileCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
824
- var parsedOutput, _a, errorCode, _b, parsedBody;
825
- var _c;
826
- return __generator(this, function (_d) {
827
- switch (_d.label) {
828
- case 0:
829
- _a = [__assign({}, output)];
830
- _c = {};
831
- return [4, parseBody(output.body, context)];
832
- case 1:
833
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
834
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
835
- _b = errorCode;
836
- switch (_b) {
837
- case "AccessDeniedException": return [3, 2];
838
- case "com.amazonaws.rolesanywhere#AccessDeniedException": return [3, 2];
839
- case "ResourceNotFoundException": return [3, 4];
840
- case "com.amazonaws.rolesanywhere#ResourceNotFoundException": return [3, 4];
841
- }
842
- return [3, 6];
843
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
844
- case 3: throw _d.sent();
845
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
846
- case 5: throw _d.sent();
847
- case 6:
848
- parsedBody = parsedOutput.body;
849
- throwDefaultError({
850
- output: output,
851
- parsedBody: parsedBody,
852
- exceptionCtor: __BaseException,
853
- errorCode: errorCode,
854
- });
855
- _d.label = 7;
856
- case 7: return [2];
857
- }
184
+ };
185
+ export const serializeAws_restJson1EnableTrustAnchorCommand = async (input, context) => {
186
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
187
+ const headers = {};
188
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/trustanchor/{trustAnchorId}/enable";
189
+ resolvedPath = __resolvedPath(resolvedPath, input, "trustAnchorId", () => input.trustAnchorId, "{trustAnchorId}", false);
190
+ let body;
191
+ return new __HttpRequest({
192
+ protocol,
193
+ hostname,
194
+ port,
195
+ method: "POST",
196
+ headers,
197
+ path: resolvedPath,
198
+ body,
858
199
  });
859
- }); };
860
- export var deserializeAws_restJson1DeleteTrustAnchorCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
861
- var contents, data, _a, _b;
862
- return __generator(this, function (_c) {
863
- switch (_c.label) {
864
- case 0:
865
- if (output.statusCode !== 200 && output.statusCode >= 300) {
866
- return [2, deserializeAws_restJson1DeleteTrustAnchorCommandError(output, context)];
867
- }
868
- contents = map({
869
- $metadata: deserializeMetadata(output),
870
- });
871
- _a = __expectNonNull;
872
- _b = __expectObject;
873
- return [4, parseBody(output.body, context)];
874
- case 1:
875
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
876
- if (data.trustAnchor != null) {
877
- contents.trustAnchor = deserializeAws_restJson1TrustAnchorDetail(data.trustAnchor, context);
878
- }
879
- return [2, contents];
880
- }
200
+ };
201
+ export const serializeAws_restJson1GetCrlCommand = async (input, context) => {
202
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
203
+ const headers = {};
204
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/crl/{crlId}";
205
+ resolvedPath = __resolvedPath(resolvedPath, input, "crlId", () => input.crlId, "{crlId}", false);
206
+ let body;
207
+ return new __HttpRequest({
208
+ protocol,
209
+ hostname,
210
+ port,
211
+ method: "GET",
212
+ headers,
213
+ path: resolvedPath,
214
+ body,
881
215
  });
882
- }); };
883
- var deserializeAws_restJson1DeleteTrustAnchorCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
884
- var parsedOutput, _a, errorCode, _b, parsedBody;
885
- var _c;
886
- return __generator(this, function (_d) {
887
- switch (_d.label) {
888
- case 0:
889
- _a = [__assign({}, output)];
890
- _c = {};
891
- return [4, parseBody(output.body, context)];
892
- case 1:
893
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
894
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
895
- _b = errorCode;
896
- switch (_b) {
897
- case "AccessDeniedException": return [3, 2];
898
- case "com.amazonaws.rolesanywhere#AccessDeniedException": return [3, 2];
899
- case "ResourceNotFoundException": return [3, 4];
900
- case "com.amazonaws.rolesanywhere#ResourceNotFoundException": return [3, 4];
901
- }
902
- return [3, 6];
903
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
904
- case 3: throw _d.sent();
905
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
906
- case 5: throw _d.sent();
907
- case 6:
908
- parsedBody = parsedOutput.body;
909
- throwDefaultError({
910
- output: output,
911
- parsedBody: parsedBody,
912
- exceptionCtor: __BaseException,
913
- errorCode: errorCode,
914
- });
915
- _d.label = 7;
916
- case 7: return [2];
917
- }
216
+ };
217
+ export const serializeAws_restJson1GetProfileCommand = async (input, context) => {
218
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
219
+ const headers = {};
220
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/profile/{profileId}";
221
+ resolvedPath = __resolvedPath(resolvedPath, input, "profileId", () => input.profileId, "{profileId}", false);
222
+ let body;
223
+ return new __HttpRequest({
224
+ protocol,
225
+ hostname,
226
+ port,
227
+ method: "GET",
228
+ headers,
229
+ path: resolvedPath,
230
+ body,
918
231
  });
919
- }); };
920
- export var deserializeAws_restJson1DisableCrlCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
921
- var contents, data, _a, _b;
922
- return __generator(this, function (_c) {
923
- switch (_c.label) {
924
- case 0:
925
- if (output.statusCode !== 200 && output.statusCode >= 300) {
926
- return [2, deserializeAws_restJson1DisableCrlCommandError(output, context)];
927
- }
928
- contents = map({
929
- $metadata: deserializeMetadata(output),
930
- });
931
- _a = __expectNonNull;
932
- _b = __expectObject;
933
- return [4, parseBody(output.body, context)];
934
- case 1:
935
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
936
- if (data.crl != null) {
937
- contents.crl = deserializeAws_restJson1CrlDetail(data.crl, context);
938
- }
939
- return [2, contents];
940
- }
232
+ };
233
+ export const serializeAws_restJson1GetSubjectCommand = async (input, context) => {
234
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
235
+ const headers = {};
236
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/subject/{subjectId}";
237
+ resolvedPath = __resolvedPath(resolvedPath, input, "subjectId", () => input.subjectId, "{subjectId}", false);
238
+ let body;
239
+ return new __HttpRequest({
240
+ protocol,
241
+ hostname,
242
+ port,
243
+ method: "GET",
244
+ headers,
245
+ path: resolvedPath,
246
+ body,
941
247
  });
942
- }); };
943
- var deserializeAws_restJson1DisableCrlCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
944
- var parsedOutput, _a, errorCode, _b, parsedBody;
945
- var _c;
946
- return __generator(this, function (_d) {
947
- switch (_d.label) {
948
- case 0:
949
- _a = [__assign({}, output)];
950
- _c = {};
951
- return [4, parseBody(output.body, context)];
952
- case 1:
953
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
954
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
955
- _b = errorCode;
956
- switch (_b) {
957
- case "AccessDeniedException": return [3, 2];
958
- case "com.amazonaws.rolesanywhere#AccessDeniedException": return [3, 2];
959
- case "ResourceNotFoundException": return [3, 4];
960
- case "com.amazonaws.rolesanywhere#ResourceNotFoundException": return [3, 4];
961
- }
962
- return [3, 6];
963
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
964
- case 3: throw _d.sent();
965
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
966
- case 5: throw _d.sent();
967
- case 6:
968
- parsedBody = parsedOutput.body;
969
- throwDefaultError({
970
- output: output,
971
- parsedBody: parsedBody,
972
- exceptionCtor: __BaseException,
973
- errorCode: errorCode,
974
- });
975
- _d.label = 7;
976
- case 7: return [2];
977
- }
248
+ };
249
+ export const serializeAws_restJson1GetTrustAnchorCommand = async (input, context) => {
250
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
251
+ const headers = {};
252
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/trustanchor/{trustAnchorId}";
253
+ resolvedPath = __resolvedPath(resolvedPath, input, "trustAnchorId", () => input.trustAnchorId, "{trustAnchorId}", false);
254
+ let body;
255
+ return new __HttpRequest({
256
+ protocol,
257
+ hostname,
258
+ port,
259
+ method: "GET",
260
+ headers,
261
+ path: resolvedPath,
262
+ body,
978
263
  });
979
- }); };
980
- export var deserializeAws_restJson1DisableProfileCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
981
- var contents, data, _a, _b;
982
- return __generator(this, function (_c) {
983
- switch (_c.label) {
984
- case 0:
985
- if (output.statusCode !== 200 && output.statusCode >= 300) {
986
- return [2, deserializeAws_restJson1DisableProfileCommandError(output, context)];
987
- }
988
- contents = map({
989
- $metadata: deserializeMetadata(output),
990
- });
991
- _a = __expectNonNull;
992
- _b = __expectObject;
993
- return [4, parseBody(output.body, context)];
994
- case 1:
995
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
996
- if (data.profile != null) {
997
- contents.profile = deserializeAws_restJson1ProfileDetail(data.profile, context);
998
- }
999
- return [2, contents];
1000
- }
264
+ };
265
+ export const serializeAws_restJson1ImportCrlCommand = async (input, context) => {
266
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
267
+ const headers = {
268
+ "content-type": "application/json",
269
+ };
270
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/crls";
271
+ let body;
272
+ body = JSON.stringify({
273
+ ...(input.crlData != null && { crlData: context.base64Encoder(input.crlData) }),
274
+ ...(input.enabled != null && { enabled: input.enabled }),
275
+ ...(input.name != null && { name: input.name }),
276
+ ...(input.tags != null && { tags: serializeAws_restJson1TagList(input.tags, context) }),
277
+ ...(input.trustAnchorArn != null && { trustAnchorArn: input.trustAnchorArn }),
278
+ });
279
+ return new __HttpRequest({
280
+ protocol,
281
+ hostname,
282
+ port,
283
+ method: "POST",
284
+ headers,
285
+ path: resolvedPath,
286
+ body,
1001
287
  });
1002
- }); };
1003
- var deserializeAws_restJson1DisableProfileCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1004
- var parsedOutput, _a, errorCode, _b, parsedBody;
1005
- var _c;
1006
- return __generator(this, function (_d) {
1007
- switch (_d.label) {
1008
- case 0:
1009
- _a = [__assign({}, output)];
1010
- _c = {};
1011
- return [4, parseBody(output.body, context)];
1012
- case 1:
1013
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1014
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1015
- _b = errorCode;
1016
- switch (_b) {
1017
- case "AccessDeniedException": return [3, 2];
1018
- case "com.amazonaws.rolesanywhere#AccessDeniedException": return [3, 2];
1019
- case "ResourceNotFoundException": return [3, 4];
1020
- case "com.amazonaws.rolesanywhere#ResourceNotFoundException": return [3, 4];
1021
- }
1022
- return [3, 6];
1023
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1024
- case 3: throw _d.sent();
1025
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1026
- case 5: throw _d.sent();
1027
- case 6:
1028
- parsedBody = parsedOutput.body;
1029
- throwDefaultError({
1030
- output: output,
1031
- parsedBody: parsedBody,
1032
- exceptionCtor: __BaseException,
1033
- errorCode: errorCode,
1034
- });
1035
- _d.label = 7;
1036
- case 7: return [2];
1037
- }
288
+ };
289
+ export const serializeAws_restJson1ListCrlsCommand = async (input, context) => {
290
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
291
+ const headers = {};
292
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/crls";
293
+ const query = map({
294
+ nextToken: [, input.nextToken],
295
+ pageSize: [() => input.pageSize !== void 0, () => input.pageSize.toString()],
296
+ });
297
+ let body;
298
+ return new __HttpRequest({
299
+ protocol,
300
+ hostname,
301
+ port,
302
+ method: "GET",
303
+ headers,
304
+ path: resolvedPath,
305
+ query,
306
+ body,
1038
307
  });
1039
- }); };
1040
- export var deserializeAws_restJson1DisableTrustAnchorCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1041
- var contents, data, _a, _b;
1042
- return __generator(this, function (_c) {
1043
- switch (_c.label) {
1044
- case 0:
1045
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1046
- return [2, deserializeAws_restJson1DisableTrustAnchorCommandError(output, context)];
1047
- }
1048
- contents = map({
1049
- $metadata: deserializeMetadata(output),
1050
- });
1051
- _a = __expectNonNull;
1052
- _b = __expectObject;
1053
- return [4, parseBody(output.body, context)];
1054
- case 1:
1055
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1056
- if (data.trustAnchor != null) {
1057
- contents.trustAnchor = deserializeAws_restJson1TrustAnchorDetail(data.trustAnchor, context);
1058
- }
1059
- return [2, contents];
1060
- }
308
+ };
309
+ export const serializeAws_restJson1ListProfilesCommand = async (input, context) => {
310
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
311
+ const headers = {};
312
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/profiles";
313
+ const query = map({
314
+ nextToken: [, input.nextToken],
315
+ pageSize: [() => input.pageSize !== void 0, () => input.pageSize.toString()],
316
+ });
317
+ let body;
318
+ return new __HttpRequest({
319
+ protocol,
320
+ hostname,
321
+ port,
322
+ method: "GET",
323
+ headers,
324
+ path: resolvedPath,
325
+ query,
326
+ body,
1061
327
  });
1062
- }); };
1063
- var deserializeAws_restJson1DisableTrustAnchorCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1064
- var parsedOutput, _a, errorCode, _b, parsedBody;
1065
- var _c;
1066
- return __generator(this, function (_d) {
1067
- switch (_d.label) {
1068
- case 0:
1069
- _a = [__assign({}, output)];
1070
- _c = {};
1071
- return [4, parseBody(output.body, context)];
1072
- case 1:
1073
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1074
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1075
- _b = errorCode;
1076
- switch (_b) {
1077
- case "AccessDeniedException": return [3, 2];
1078
- case "com.amazonaws.rolesanywhere#AccessDeniedException": return [3, 2];
1079
- case "ResourceNotFoundException": return [3, 4];
1080
- case "com.amazonaws.rolesanywhere#ResourceNotFoundException": return [3, 4];
1081
- }
1082
- return [3, 6];
1083
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1084
- case 3: throw _d.sent();
1085
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1086
- case 5: throw _d.sent();
1087
- case 6:
1088
- parsedBody = parsedOutput.body;
1089
- throwDefaultError({
1090
- output: output,
1091
- parsedBody: parsedBody,
1092
- exceptionCtor: __BaseException,
1093
- errorCode: errorCode,
1094
- });
1095
- _d.label = 7;
1096
- case 7: return [2];
1097
- }
328
+ };
329
+ export const serializeAws_restJson1ListSubjectsCommand = async (input, context) => {
330
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
331
+ const headers = {};
332
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/subjects";
333
+ const query = map({
334
+ nextToken: [, input.nextToken],
335
+ pageSize: [() => input.pageSize !== void 0, () => input.pageSize.toString()],
336
+ });
337
+ let body;
338
+ return new __HttpRequest({
339
+ protocol,
340
+ hostname,
341
+ port,
342
+ method: "GET",
343
+ headers,
344
+ path: resolvedPath,
345
+ query,
346
+ body,
1098
347
  });
1099
- }); };
1100
- export var deserializeAws_restJson1EnableCrlCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1101
- var contents, data, _a, _b;
1102
- return __generator(this, function (_c) {
1103
- switch (_c.label) {
1104
- case 0:
1105
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1106
- return [2, deserializeAws_restJson1EnableCrlCommandError(output, context)];
1107
- }
1108
- contents = map({
1109
- $metadata: deserializeMetadata(output),
1110
- });
1111
- _a = __expectNonNull;
1112
- _b = __expectObject;
1113
- return [4, parseBody(output.body, context)];
1114
- case 1:
1115
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1116
- if (data.crl != null) {
1117
- contents.crl = deserializeAws_restJson1CrlDetail(data.crl, context);
1118
- }
1119
- return [2, contents];
1120
- }
348
+ };
349
+ export const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
350
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
351
+ const headers = {};
352
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/ListTagsForResource";
353
+ const query = map({
354
+ resourceArn: [, input.resourceArn],
355
+ });
356
+ let body;
357
+ return new __HttpRequest({
358
+ protocol,
359
+ hostname,
360
+ port,
361
+ method: "GET",
362
+ headers,
363
+ path: resolvedPath,
364
+ query,
365
+ body,
1121
366
  });
1122
- }); };
1123
- var deserializeAws_restJson1EnableCrlCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1124
- var parsedOutput, _a, errorCode, _b, parsedBody;
1125
- var _c;
1126
- return __generator(this, function (_d) {
1127
- switch (_d.label) {
1128
- case 0:
1129
- _a = [__assign({}, output)];
1130
- _c = {};
1131
- return [4, parseBody(output.body, context)];
1132
- case 1:
1133
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1134
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1135
- _b = errorCode;
1136
- switch (_b) {
1137
- case "AccessDeniedException": return [3, 2];
1138
- case "com.amazonaws.rolesanywhere#AccessDeniedException": return [3, 2];
1139
- case "ResourceNotFoundException": return [3, 4];
1140
- case "com.amazonaws.rolesanywhere#ResourceNotFoundException": return [3, 4];
1141
- }
1142
- return [3, 6];
1143
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1144
- case 3: throw _d.sent();
1145
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1146
- case 5: throw _d.sent();
1147
- case 6:
1148
- parsedBody = parsedOutput.body;
1149
- throwDefaultError({
1150
- output: output,
1151
- parsedBody: parsedBody,
1152
- exceptionCtor: __BaseException,
1153
- errorCode: errorCode,
1154
- });
1155
- _d.label = 7;
1156
- case 7: return [2];
1157
- }
367
+ };
368
+ export const serializeAws_restJson1ListTrustAnchorsCommand = async (input, context) => {
369
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
370
+ const headers = {};
371
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/trustanchors";
372
+ const query = map({
373
+ nextToken: [, input.nextToken],
374
+ pageSize: [() => input.pageSize !== void 0, () => input.pageSize.toString()],
375
+ });
376
+ let body;
377
+ return new __HttpRequest({
378
+ protocol,
379
+ hostname,
380
+ port,
381
+ method: "GET",
382
+ headers,
383
+ path: resolvedPath,
384
+ query,
385
+ body,
1158
386
  });
1159
- }); };
1160
- export var deserializeAws_restJson1EnableProfileCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1161
- var contents, data, _a, _b;
1162
- return __generator(this, function (_c) {
1163
- switch (_c.label) {
1164
- case 0:
1165
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1166
- return [2, deserializeAws_restJson1EnableProfileCommandError(output, context)];
1167
- }
1168
- contents = map({
1169
- $metadata: deserializeMetadata(output),
1170
- });
1171
- _a = __expectNonNull;
1172
- _b = __expectObject;
1173
- return [4, parseBody(output.body, context)];
1174
- case 1:
1175
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1176
- if (data.profile != null) {
1177
- contents.profile = deserializeAws_restJson1ProfileDetail(data.profile, context);
1178
- }
1179
- return [2, contents];
1180
- }
387
+ };
388
+ export const serializeAws_restJson1TagResourceCommand = async (input, context) => {
389
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
390
+ const headers = {
391
+ "content-type": "application/json",
392
+ };
393
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/TagResource";
394
+ let body;
395
+ body = JSON.stringify({
396
+ ...(input.resourceArn != null && { resourceArn: input.resourceArn }),
397
+ ...(input.tags != null && { tags: serializeAws_restJson1TagList(input.tags, context) }),
398
+ });
399
+ return new __HttpRequest({
400
+ protocol,
401
+ hostname,
402
+ port,
403
+ method: "POST",
404
+ headers,
405
+ path: resolvedPath,
406
+ body,
1181
407
  });
1182
- }); };
1183
- var deserializeAws_restJson1EnableProfileCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1184
- var parsedOutput, _a, errorCode, _b, parsedBody;
1185
- var _c;
1186
- return __generator(this, function (_d) {
1187
- switch (_d.label) {
1188
- case 0:
1189
- _a = [__assign({}, output)];
1190
- _c = {};
1191
- return [4, parseBody(output.body, context)];
1192
- case 1:
1193
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1194
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1195
- _b = errorCode;
1196
- switch (_b) {
1197
- case "AccessDeniedException": return [3, 2];
1198
- case "com.amazonaws.rolesanywhere#AccessDeniedException": return [3, 2];
1199
- case "ResourceNotFoundException": return [3, 4];
1200
- case "com.amazonaws.rolesanywhere#ResourceNotFoundException": return [3, 4];
1201
- }
1202
- return [3, 6];
1203
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1204
- case 3: throw _d.sent();
1205
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1206
- case 5: throw _d.sent();
1207
- case 6:
1208
- parsedBody = parsedOutput.body;
1209
- throwDefaultError({
1210
- output: output,
1211
- parsedBody: parsedBody,
1212
- exceptionCtor: __BaseException,
1213
- errorCode: errorCode,
1214
- });
1215
- _d.label = 7;
1216
- case 7: return [2];
1217
- }
408
+ };
409
+ export const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
410
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
411
+ const headers = {
412
+ "content-type": "application/json",
413
+ };
414
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/UntagResource";
415
+ let body;
416
+ body = JSON.stringify({
417
+ ...(input.resourceArn != null && { resourceArn: input.resourceArn }),
418
+ ...(input.tagKeys != null && { tagKeys: serializeAws_restJson1TagKeyList(input.tagKeys, context) }),
419
+ });
420
+ return new __HttpRequest({
421
+ protocol,
422
+ hostname,
423
+ port,
424
+ method: "POST",
425
+ headers,
426
+ path: resolvedPath,
427
+ body,
1218
428
  });
1219
- }); };
1220
- export var deserializeAws_restJson1EnableTrustAnchorCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1221
- var contents, data, _a, _b;
1222
- return __generator(this, function (_c) {
1223
- switch (_c.label) {
1224
- case 0:
1225
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1226
- return [2, deserializeAws_restJson1EnableTrustAnchorCommandError(output, context)];
1227
- }
1228
- contents = map({
1229
- $metadata: deserializeMetadata(output),
1230
- });
1231
- _a = __expectNonNull;
1232
- _b = __expectObject;
1233
- return [4, parseBody(output.body, context)];
1234
- case 1:
1235
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1236
- if (data.trustAnchor != null) {
1237
- contents.trustAnchor = deserializeAws_restJson1TrustAnchorDetail(data.trustAnchor, context);
1238
- }
1239
- return [2, contents];
1240
- }
429
+ };
430
+ export const serializeAws_restJson1UpdateCrlCommand = async (input, context) => {
431
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
432
+ const headers = {
433
+ "content-type": "application/json",
434
+ };
435
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/crl/{crlId}";
436
+ resolvedPath = __resolvedPath(resolvedPath, input, "crlId", () => input.crlId, "{crlId}", false);
437
+ let body;
438
+ body = JSON.stringify({
439
+ ...(input.crlData != null && { crlData: context.base64Encoder(input.crlData) }),
440
+ ...(input.name != null && { name: input.name }),
441
+ });
442
+ return new __HttpRequest({
443
+ protocol,
444
+ hostname,
445
+ port,
446
+ method: "PATCH",
447
+ headers,
448
+ path: resolvedPath,
449
+ body,
1241
450
  });
1242
- }); };
1243
- var deserializeAws_restJson1EnableTrustAnchorCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1244
- var parsedOutput, _a, errorCode, _b, parsedBody;
1245
- var _c;
1246
- return __generator(this, function (_d) {
1247
- switch (_d.label) {
1248
- case 0:
1249
- _a = [__assign({}, output)];
1250
- _c = {};
1251
- return [4, parseBody(output.body, context)];
1252
- case 1:
1253
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1254
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1255
- _b = errorCode;
1256
- switch (_b) {
1257
- case "AccessDeniedException": return [3, 2];
1258
- case "com.amazonaws.rolesanywhere#AccessDeniedException": return [3, 2];
1259
- case "ResourceNotFoundException": return [3, 4];
1260
- case "com.amazonaws.rolesanywhere#ResourceNotFoundException": return [3, 4];
1261
- }
1262
- return [3, 6];
1263
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1264
- case 3: throw _d.sent();
1265
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1266
- case 5: throw _d.sent();
1267
- case 6:
1268
- parsedBody = parsedOutput.body;
1269
- throwDefaultError({
1270
- output: output,
1271
- parsedBody: parsedBody,
1272
- exceptionCtor: __BaseException,
1273
- errorCode: errorCode,
1274
- });
1275
- _d.label = 7;
1276
- case 7: return [2];
1277
- }
451
+ };
452
+ export const serializeAws_restJson1UpdateProfileCommand = async (input, context) => {
453
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
454
+ const headers = {
455
+ "content-type": "application/json",
456
+ };
457
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/profile/{profileId}";
458
+ resolvedPath = __resolvedPath(resolvedPath, input, "profileId", () => input.profileId, "{profileId}", false);
459
+ let body;
460
+ body = JSON.stringify({
461
+ ...(input.durationSeconds != null && { durationSeconds: input.durationSeconds }),
462
+ ...(input.managedPolicyArns != null && {
463
+ managedPolicyArns: serializeAws_restJson1ManagedPolicyList(input.managedPolicyArns, context),
464
+ }),
465
+ ...(input.name != null && { name: input.name }),
466
+ ...(input.roleArns != null && { roleArns: serializeAws_restJson1RoleArnList(input.roleArns, context) }),
467
+ ...(input.sessionPolicy != null && { sessionPolicy: input.sessionPolicy }),
468
+ });
469
+ return new __HttpRequest({
470
+ protocol,
471
+ hostname,
472
+ port,
473
+ method: "PATCH",
474
+ headers,
475
+ path: resolvedPath,
476
+ body,
1278
477
  });
1279
- }); };
1280
- export var deserializeAws_restJson1GetCrlCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1281
- var contents, data, _a, _b;
1282
- return __generator(this, function (_c) {
1283
- switch (_c.label) {
1284
- case 0:
1285
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1286
- return [2, deserializeAws_restJson1GetCrlCommandError(output, context)];
1287
- }
1288
- contents = map({
1289
- $metadata: deserializeMetadata(output),
1290
- });
1291
- _a = __expectNonNull;
1292
- _b = __expectObject;
1293
- return [4, parseBody(output.body, context)];
1294
- case 1:
1295
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1296
- if (data.crl != null) {
1297
- contents.crl = deserializeAws_restJson1CrlDetail(data.crl, context);
1298
- }
1299
- return [2, contents];
1300
- }
478
+ };
479
+ export const serializeAws_restJson1UpdateTrustAnchorCommand = async (input, context) => {
480
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
481
+ const headers = {
482
+ "content-type": "application/json",
483
+ };
484
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/trustanchor/{trustAnchorId}";
485
+ resolvedPath = __resolvedPath(resolvedPath, input, "trustAnchorId", () => input.trustAnchorId, "{trustAnchorId}", false);
486
+ let body;
487
+ body = JSON.stringify({
488
+ ...(input.name != null && { name: input.name }),
489
+ ...(input.source != null && { source: serializeAws_restJson1Source(input.source, context) }),
490
+ });
491
+ return new __HttpRequest({
492
+ protocol,
493
+ hostname,
494
+ port,
495
+ method: "PATCH",
496
+ headers,
497
+ path: resolvedPath,
498
+ body,
1301
499
  });
1302
- }); };
1303
- var deserializeAws_restJson1GetCrlCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1304
- var parsedOutput, _a, errorCode, _b, parsedBody;
1305
- var _c;
1306
- return __generator(this, function (_d) {
1307
- switch (_d.label) {
1308
- case 0:
1309
- _a = [__assign({}, output)];
1310
- _c = {};
1311
- return [4, parseBody(output.body, context)];
1312
- case 1:
1313
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1314
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1315
- _b = errorCode;
1316
- switch (_b) {
1317
- case "ResourceNotFoundException": return [3, 2];
1318
- case "com.amazonaws.rolesanywhere#ResourceNotFoundException": return [3, 2];
1319
- }
1320
- return [3, 4];
1321
- case 2: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1322
- case 3: throw _d.sent();
1323
- case 4:
1324
- parsedBody = parsedOutput.body;
1325
- throwDefaultError({
1326
- output: output,
1327
- parsedBody: parsedBody,
1328
- exceptionCtor: __BaseException,
1329
- errorCode: errorCode,
1330
- });
1331
- _d.label = 5;
1332
- case 5: return [2];
1333
- }
500
+ };
501
+ export const deserializeAws_restJson1CreateProfileCommand = async (output, context) => {
502
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
503
+ return deserializeAws_restJson1CreateProfileCommandError(output, context);
504
+ }
505
+ const contents = map({
506
+ $metadata: deserializeMetadata(output),
1334
507
  });
1335
- }); };
1336
- export var deserializeAws_restJson1GetProfileCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1337
- var contents, data, _a, _b;
1338
- return __generator(this, function (_c) {
1339
- switch (_c.label) {
1340
- case 0:
1341
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1342
- return [2, deserializeAws_restJson1GetProfileCommandError(output, context)];
1343
- }
1344
- contents = map({
1345
- $metadata: deserializeMetadata(output),
1346
- });
1347
- _a = __expectNonNull;
1348
- _b = __expectObject;
1349
- return [4, parseBody(output.body, context)];
1350
- case 1:
1351
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1352
- if (data.profile != null) {
1353
- contents.profile = deserializeAws_restJson1ProfileDetail(data.profile, context);
1354
- }
1355
- return [2, contents];
1356
- }
508
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
509
+ if (data.profile != null) {
510
+ contents.profile = deserializeAws_restJson1ProfileDetail(data.profile, context);
511
+ }
512
+ return contents;
513
+ };
514
+ const deserializeAws_restJson1CreateProfileCommandError = async (output, context) => {
515
+ const parsedOutput = {
516
+ ...output,
517
+ body: await parseErrorBody(output.body, context),
518
+ };
519
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
520
+ switch (errorCode) {
521
+ case "AccessDeniedException":
522
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
523
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
524
+ case "ValidationException":
525
+ case "com.amazonaws.rolesanywhere#ValidationException":
526
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
527
+ default:
528
+ const parsedBody = parsedOutput.body;
529
+ throwDefaultError({
530
+ output,
531
+ parsedBody,
532
+ exceptionCtor: __BaseException,
533
+ errorCode,
534
+ });
535
+ }
536
+ };
537
+ export const deserializeAws_restJson1CreateTrustAnchorCommand = async (output, context) => {
538
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
539
+ return deserializeAws_restJson1CreateTrustAnchorCommandError(output, context);
540
+ }
541
+ const contents = map({
542
+ $metadata: deserializeMetadata(output),
1357
543
  });
1358
- }); };
1359
- var deserializeAws_restJson1GetProfileCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1360
- var parsedOutput, _a, errorCode, _b, parsedBody;
1361
- var _c;
1362
- return __generator(this, function (_d) {
1363
- switch (_d.label) {
1364
- case 0:
1365
- _a = [__assign({}, output)];
1366
- _c = {};
1367
- return [4, parseBody(output.body, context)];
1368
- case 1:
1369
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1370
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1371
- _b = errorCode;
1372
- switch (_b) {
1373
- case "AccessDeniedException": return [3, 2];
1374
- case "com.amazonaws.rolesanywhere#AccessDeniedException": return [3, 2];
1375
- case "ResourceNotFoundException": return [3, 4];
1376
- case "com.amazonaws.rolesanywhere#ResourceNotFoundException": return [3, 4];
1377
- }
1378
- return [3, 6];
1379
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1380
- case 3: throw _d.sent();
1381
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1382
- case 5: throw _d.sent();
1383
- case 6:
1384
- parsedBody = parsedOutput.body;
1385
- throwDefaultError({
1386
- output: output,
1387
- parsedBody: parsedBody,
1388
- exceptionCtor: __BaseException,
1389
- errorCode: errorCode,
1390
- });
1391
- _d.label = 7;
1392
- case 7: return [2];
1393
- }
544
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
545
+ if (data.trustAnchor != null) {
546
+ contents.trustAnchor = deserializeAws_restJson1TrustAnchorDetail(data.trustAnchor, context);
547
+ }
548
+ return contents;
549
+ };
550
+ const deserializeAws_restJson1CreateTrustAnchorCommandError = async (output, context) => {
551
+ const parsedOutput = {
552
+ ...output,
553
+ body: await parseErrorBody(output.body, context),
554
+ };
555
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
556
+ switch (errorCode) {
557
+ case "AccessDeniedException":
558
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
559
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
560
+ case "ValidationException":
561
+ case "com.amazonaws.rolesanywhere#ValidationException":
562
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
563
+ default:
564
+ const parsedBody = parsedOutput.body;
565
+ throwDefaultError({
566
+ output,
567
+ parsedBody,
568
+ exceptionCtor: __BaseException,
569
+ errorCode,
570
+ });
571
+ }
572
+ };
573
+ export const deserializeAws_restJson1DeleteCrlCommand = async (output, context) => {
574
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
575
+ return deserializeAws_restJson1DeleteCrlCommandError(output, context);
576
+ }
577
+ const contents = map({
578
+ $metadata: deserializeMetadata(output),
1394
579
  });
1395
- }); };
1396
- export var deserializeAws_restJson1GetSubjectCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1397
- var contents, data, _a, _b;
1398
- return __generator(this, function (_c) {
1399
- switch (_c.label) {
1400
- case 0:
1401
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1402
- return [2, deserializeAws_restJson1GetSubjectCommandError(output, context)];
1403
- }
1404
- contents = map({
1405
- $metadata: deserializeMetadata(output),
1406
- });
1407
- _a = __expectNonNull;
1408
- _b = __expectObject;
1409
- return [4, parseBody(output.body, context)];
1410
- case 1:
1411
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1412
- if (data.subject != null) {
1413
- contents.subject = deserializeAws_restJson1SubjectDetail(data.subject, context);
1414
- }
1415
- return [2, contents];
1416
- }
580
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
581
+ if (data.crl != null) {
582
+ contents.crl = deserializeAws_restJson1CrlDetail(data.crl, context);
583
+ }
584
+ return contents;
585
+ };
586
+ const deserializeAws_restJson1DeleteCrlCommandError = async (output, context) => {
587
+ const parsedOutput = {
588
+ ...output,
589
+ body: await parseErrorBody(output.body, context),
590
+ };
591
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
592
+ switch (errorCode) {
593
+ case "AccessDeniedException":
594
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
595
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
596
+ case "ResourceNotFoundException":
597
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
598
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
599
+ default:
600
+ const parsedBody = parsedOutput.body;
601
+ throwDefaultError({
602
+ output,
603
+ parsedBody,
604
+ exceptionCtor: __BaseException,
605
+ errorCode,
606
+ });
607
+ }
608
+ };
609
+ export const deserializeAws_restJson1DeleteProfileCommand = async (output, context) => {
610
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
611
+ return deserializeAws_restJson1DeleteProfileCommandError(output, context);
612
+ }
613
+ const contents = map({
614
+ $metadata: deserializeMetadata(output),
1417
615
  });
1418
- }); };
1419
- var deserializeAws_restJson1GetSubjectCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1420
- var parsedOutput, _a, errorCode, _b, parsedBody;
1421
- var _c;
1422
- return __generator(this, function (_d) {
1423
- switch (_d.label) {
1424
- case 0:
1425
- _a = [__assign({}, output)];
1426
- _c = {};
1427
- return [4, parseBody(output.body, context)];
1428
- case 1:
1429
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1430
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1431
- _b = errorCode;
1432
- switch (_b) {
1433
- case "AccessDeniedException": return [3, 2];
1434
- case "com.amazonaws.rolesanywhere#AccessDeniedException": return [3, 2];
1435
- case "ResourceNotFoundException": return [3, 4];
1436
- case "com.amazonaws.rolesanywhere#ResourceNotFoundException": return [3, 4];
1437
- }
1438
- return [3, 6];
1439
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1440
- case 3: throw _d.sent();
1441
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1442
- case 5: throw _d.sent();
1443
- case 6:
1444
- parsedBody = parsedOutput.body;
1445
- throwDefaultError({
1446
- output: output,
1447
- parsedBody: parsedBody,
1448
- exceptionCtor: __BaseException,
1449
- errorCode: errorCode,
1450
- });
1451
- _d.label = 7;
1452
- case 7: return [2];
1453
- }
616
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
617
+ if (data.profile != null) {
618
+ contents.profile = deserializeAws_restJson1ProfileDetail(data.profile, context);
619
+ }
620
+ return contents;
621
+ };
622
+ const deserializeAws_restJson1DeleteProfileCommandError = async (output, context) => {
623
+ const parsedOutput = {
624
+ ...output,
625
+ body: await parseErrorBody(output.body, context),
626
+ };
627
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
628
+ switch (errorCode) {
629
+ case "AccessDeniedException":
630
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
631
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
632
+ case "ResourceNotFoundException":
633
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
634
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
635
+ default:
636
+ const parsedBody = parsedOutput.body;
637
+ throwDefaultError({
638
+ output,
639
+ parsedBody,
640
+ exceptionCtor: __BaseException,
641
+ errorCode,
642
+ });
643
+ }
644
+ };
645
+ export const deserializeAws_restJson1DeleteTrustAnchorCommand = async (output, context) => {
646
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
647
+ return deserializeAws_restJson1DeleteTrustAnchorCommandError(output, context);
648
+ }
649
+ const contents = map({
650
+ $metadata: deserializeMetadata(output),
1454
651
  });
1455
- }); };
1456
- export var deserializeAws_restJson1GetTrustAnchorCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1457
- var contents, data, _a, _b;
1458
- return __generator(this, function (_c) {
1459
- switch (_c.label) {
1460
- case 0:
1461
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1462
- return [2, deserializeAws_restJson1GetTrustAnchorCommandError(output, context)];
1463
- }
1464
- contents = map({
1465
- $metadata: deserializeMetadata(output),
1466
- });
1467
- _a = __expectNonNull;
1468
- _b = __expectObject;
1469
- return [4, parseBody(output.body, context)];
1470
- case 1:
1471
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1472
- if (data.trustAnchor != null) {
1473
- contents.trustAnchor = deserializeAws_restJson1TrustAnchorDetail(data.trustAnchor, context);
1474
- }
1475
- return [2, contents];
1476
- }
652
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
653
+ if (data.trustAnchor != null) {
654
+ contents.trustAnchor = deserializeAws_restJson1TrustAnchorDetail(data.trustAnchor, context);
655
+ }
656
+ return contents;
657
+ };
658
+ const deserializeAws_restJson1DeleteTrustAnchorCommandError = async (output, context) => {
659
+ const parsedOutput = {
660
+ ...output,
661
+ body: await parseErrorBody(output.body, context),
662
+ };
663
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
664
+ switch (errorCode) {
665
+ case "AccessDeniedException":
666
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
667
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
668
+ case "ResourceNotFoundException":
669
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
670
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
671
+ default:
672
+ const parsedBody = parsedOutput.body;
673
+ throwDefaultError({
674
+ output,
675
+ parsedBody,
676
+ exceptionCtor: __BaseException,
677
+ errorCode,
678
+ });
679
+ }
680
+ };
681
+ export const deserializeAws_restJson1DisableCrlCommand = async (output, context) => {
682
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
683
+ return deserializeAws_restJson1DisableCrlCommandError(output, context);
684
+ }
685
+ const contents = map({
686
+ $metadata: deserializeMetadata(output),
1477
687
  });
1478
- }); };
1479
- var deserializeAws_restJson1GetTrustAnchorCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1480
- var parsedOutput, _a, errorCode, _b, parsedBody;
1481
- var _c;
1482
- return __generator(this, function (_d) {
1483
- switch (_d.label) {
1484
- case 0:
1485
- _a = [__assign({}, output)];
1486
- _c = {};
1487
- return [4, parseBody(output.body, context)];
1488
- case 1:
1489
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1490
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1491
- _b = errorCode;
1492
- switch (_b) {
1493
- case "AccessDeniedException": return [3, 2];
1494
- case "com.amazonaws.rolesanywhere#AccessDeniedException": return [3, 2];
1495
- case "ResourceNotFoundException": return [3, 4];
1496
- case "com.amazonaws.rolesanywhere#ResourceNotFoundException": return [3, 4];
1497
- case "ValidationException": return [3, 6];
1498
- case "com.amazonaws.rolesanywhere#ValidationException": return [3, 6];
1499
- }
1500
- return [3, 8];
1501
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1502
- case 3: throw _d.sent();
1503
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1504
- case 5: throw _d.sent();
1505
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1506
- case 7: throw _d.sent();
1507
- case 8:
1508
- parsedBody = parsedOutput.body;
1509
- throwDefaultError({
1510
- output: output,
1511
- parsedBody: parsedBody,
1512
- exceptionCtor: __BaseException,
1513
- errorCode: errorCode,
1514
- });
1515
- _d.label = 9;
1516
- case 9: return [2];
1517
- }
688
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
689
+ if (data.crl != null) {
690
+ contents.crl = deserializeAws_restJson1CrlDetail(data.crl, context);
691
+ }
692
+ return contents;
693
+ };
694
+ const deserializeAws_restJson1DisableCrlCommandError = async (output, context) => {
695
+ const parsedOutput = {
696
+ ...output,
697
+ body: await parseErrorBody(output.body, context),
698
+ };
699
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
700
+ switch (errorCode) {
701
+ case "AccessDeniedException":
702
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
703
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
704
+ case "ResourceNotFoundException":
705
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
706
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
707
+ default:
708
+ const parsedBody = parsedOutput.body;
709
+ throwDefaultError({
710
+ output,
711
+ parsedBody,
712
+ exceptionCtor: __BaseException,
713
+ errorCode,
714
+ });
715
+ }
716
+ };
717
+ export const deserializeAws_restJson1DisableProfileCommand = async (output, context) => {
718
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
719
+ return deserializeAws_restJson1DisableProfileCommandError(output, context);
720
+ }
721
+ const contents = map({
722
+ $metadata: deserializeMetadata(output),
1518
723
  });
1519
- }); };
1520
- export var deserializeAws_restJson1ImportCrlCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1521
- var contents, data, _a, _b;
1522
- return __generator(this, function (_c) {
1523
- switch (_c.label) {
1524
- case 0:
1525
- if (output.statusCode !== 201 && output.statusCode >= 300) {
1526
- return [2, deserializeAws_restJson1ImportCrlCommandError(output, context)];
1527
- }
1528
- contents = map({
1529
- $metadata: deserializeMetadata(output),
1530
- });
1531
- _a = __expectNonNull;
1532
- _b = __expectObject;
1533
- return [4, parseBody(output.body, context)];
1534
- case 1:
1535
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1536
- if (data.crl != null) {
1537
- contents.crl = deserializeAws_restJson1CrlDetail(data.crl, context);
1538
- }
1539
- return [2, contents];
1540
- }
724
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
725
+ if (data.profile != null) {
726
+ contents.profile = deserializeAws_restJson1ProfileDetail(data.profile, context);
727
+ }
728
+ return contents;
729
+ };
730
+ const deserializeAws_restJson1DisableProfileCommandError = async (output, context) => {
731
+ const parsedOutput = {
732
+ ...output,
733
+ body: await parseErrorBody(output.body, context),
734
+ };
735
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
736
+ switch (errorCode) {
737
+ case "AccessDeniedException":
738
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
739
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
740
+ case "ResourceNotFoundException":
741
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
742
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
743
+ default:
744
+ const parsedBody = parsedOutput.body;
745
+ throwDefaultError({
746
+ output,
747
+ parsedBody,
748
+ exceptionCtor: __BaseException,
749
+ errorCode,
750
+ });
751
+ }
752
+ };
753
+ export const deserializeAws_restJson1DisableTrustAnchorCommand = async (output, context) => {
754
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
755
+ return deserializeAws_restJson1DisableTrustAnchorCommandError(output, context);
756
+ }
757
+ const contents = map({
758
+ $metadata: deserializeMetadata(output),
1541
759
  });
1542
- }); };
1543
- var deserializeAws_restJson1ImportCrlCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1544
- var parsedOutput, _a, errorCode, _b, parsedBody;
1545
- var _c;
1546
- return __generator(this, function (_d) {
1547
- switch (_d.label) {
1548
- case 0:
1549
- _a = [__assign({}, output)];
1550
- _c = {};
1551
- return [4, parseBody(output.body, context)];
1552
- case 1:
1553
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1554
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1555
- _b = errorCode;
1556
- switch (_b) {
1557
- case "AccessDeniedException": return [3, 2];
1558
- case "com.amazonaws.rolesanywhere#AccessDeniedException": return [3, 2];
1559
- case "ValidationException": return [3, 4];
1560
- case "com.amazonaws.rolesanywhere#ValidationException": return [3, 4];
1561
- }
1562
- return [3, 6];
1563
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1564
- case 3: throw _d.sent();
1565
- case 4: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1566
- case 5: throw _d.sent();
1567
- case 6:
1568
- parsedBody = parsedOutput.body;
1569
- throwDefaultError({
1570
- output: output,
1571
- parsedBody: parsedBody,
1572
- exceptionCtor: __BaseException,
1573
- errorCode: errorCode,
1574
- });
1575
- _d.label = 7;
1576
- case 7: return [2];
1577
- }
760
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
761
+ if (data.trustAnchor != null) {
762
+ contents.trustAnchor = deserializeAws_restJson1TrustAnchorDetail(data.trustAnchor, context);
763
+ }
764
+ return contents;
765
+ };
766
+ const deserializeAws_restJson1DisableTrustAnchorCommandError = async (output, context) => {
767
+ const parsedOutput = {
768
+ ...output,
769
+ body: await parseErrorBody(output.body, context),
770
+ };
771
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
772
+ switch (errorCode) {
773
+ case "AccessDeniedException":
774
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
775
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
776
+ case "ResourceNotFoundException":
777
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
778
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
779
+ default:
780
+ const parsedBody = parsedOutput.body;
781
+ throwDefaultError({
782
+ output,
783
+ parsedBody,
784
+ exceptionCtor: __BaseException,
785
+ errorCode,
786
+ });
787
+ }
788
+ };
789
+ export const deserializeAws_restJson1EnableCrlCommand = async (output, context) => {
790
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
791
+ return deserializeAws_restJson1EnableCrlCommandError(output, context);
792
+ }
793
+ const contents = map({
794
+ $metadata: deserializeMetadata(output),
1578
795
  });
1579
- }); };
1580
- export var deserializeAws_restJson1ListCrlsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1581
- var contents, data, _a, _b;
1582
- return __generator(this, function (_c) {
1583
- switch (_c.label) {
1584
- case 0:
1585
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1586
- return [2, deserializeAws_restJson1ListCrlsCommandError(output, context)];
1587
- }
1588
- contents = map({
1589
- $metadata: deserializeMetadata(output),
1590
- });
1591
- _a = __expectNonNull;
1592
- _b = __expectObject;
1593
- return [4, parseBody(output.body, context)];
1594
- case 1:
1595
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1596
- if (data.crls != null) {
1597
- contents.crls = deserializeAws_restJson1CrlDetails(data.crls, context);
1598
- }
1599
- if (data.nextToken != null) {
1600
- contents.nextToken = __expectString(data.nextToken);
1601
- }
1602
- return [2, contents];
1603
- }
796
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
797
+ if (data.crl != null) {
798
+ contents.crl = deserializeAws_restJson1CrlDetail(data.crl, context);
799
+ }
800
+ return contents;
801
+ };
802
+ const deserializeAws_restJson1EnableCrlCommandError = async (output, context) => {
803
+ const parsedOutput = {
804
+ ...output,
805
+ body: await parseErrorBody(output.body, context),
806
+ };
807
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
808
+ switch (errorCode) {
809
+ case "AccessDeniedException":
810
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
811
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
812
+ case "ResourceNotFoundException":
813
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
814
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
815
+ default:
816
+ const parsedBody = parsedOutput.body;
817
+ throwDefaultError({
818
+ output,
819
+ parsedBody,
820
+ exceptionCtor: __BaseException,
821
+ errorCode,
822
+ });
823
+ }
824
+ };
825
+ export const deserializeAws_restJson1EnableProfileCommand = async (output, context) => {
826
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
827
+ return deserializeAws_restJson1EnableProfileCommandError(output, context);
828
+ }
829
+ const contents = map({
830
+ $metadata: deserializeMetadata(output),
1604
831
  });
1605
- }); };
1606
- var deserializeAws_restJson1ListCrlsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1607
- var parsedOutput, _a, errorCode, _b, parsedBody;
1608
- var _c;
1609
- return __generator(this, function (_d) {
1610
- switch (_d.label) {
1611
- case 0:
1612
- _a = [__assign({}, output)];
1613
- _c = {};
1614
- return [4, parseBody(output.body, context)];
1615
- case 1:
1616
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1617
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1618
- _b = errorCode;
1619
- switch (_b) {
1620
- case "AccessDeniedException": return [3, 2];
1621
- case "com.amazonaws.rolesanywhere#AccessDeniedException": return [3, 2];
1622
- case "ValidationException": return [3, 4];
1623
- case "com.amazonaws.rolesanywhere#ValidationException": return [3, 4];
1624
- }
1625
- return [3, 6];
1626
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1627
- case 3: throw _d.sent();
1628
- case 4: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1629
- case 5: throw _d.sent();
1630
- case 6:
1631
- parsedBody = parsedOutput.body;
1632
- throwDefaultError({
1633
- output: output,
1634
- parsedBody: parsedBody,
1635
- exceptionCtor: __BaseException,
1636
- errorCode: errorCode,
1637
- });
1638
- _d.label = 7;
1639
- case 7: return [2];
1640
- }
832
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
833
+ if (data.profile != null) {
834
+ contents.profile = deserializeAws_restJson1ProfileDetail(data.profile, context);
835
+ }
836
+ return contents;
837
+ };
838
+ const deserializeAws_restJson1EnableProfileCommandError = async (output, context) => {
839
+ const parsedOutput = {
840
+ ...output,
841
+ body: await parseErrorBody(output.body, context),
842
+ };
843
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
844
+ switch (errorCode) {
845
+ case "AccessDeniedException":
846
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
847
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
848
+ case "ResourceNotFoundException":
849
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
850
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
851
+ default:
852
+ const parsedBody = parsedOutput.body;
853
+ throwDefaultError({
854
+ output,
855
+ parsedBody,
856
+ exceptionCtor: __BaseException,
857
+ errorCode,
858
+ });
859
+ }
860
+ };
861
+ export const deserializeAws_restJson1EnableTrustAnchorCommand = async (output, context) => {
862
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
863
+ return deserializeAws_restJson1EnableTrustAnchorCommandError(output, context);
864
+ }
865
+ const contents = map({
866
+ $metadata: deserializeMetadata(output),
1641
867
  });
1642
- }); };
1643
- export var deserializeAws_restJson1ListProfilesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1644
- var contents, data, _a, _b;
1645
- return __generator(this, function (_c) {
1646
- switch (_c.label) {
1647
- case 0:
1648
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1649
- return [2, deserializeAws_restJson1ListProfilesCommandError(output, context)];
1650
- }
1651
- contents = map({
1652
- $metadata: deserializeMetadata(output),
1653
- });
1654
- _a = __expectNonNull;
1655
- _b = __expectObject;
1656
- return [4, parseBody(output.body, context)];
1657
- case 1:
1658
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1659
- if (data.nextToken != null) {
1660
- contents.nextToken = __expectString(data.nextToken);
1661
- }
1662
- if (data.profiles != null) {
1663
- contents.profiles = deserializeAws_restJson1ProfileDetails(data.profiles, context);
1664
- }
1665
- return [2, contents];
1666
- }
868
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
869
+ if (data.trustAnchor != null) {
870
+ contents.trustAnchor = deserializeAws_restJson1TrustAnchorDetail(data.trustAnchor, context);
871
+ }
872
+ return contents;
873
+ };
874
+ const deserializeAws_restJson1EnableTrustAnchorCommandError = async (output, context) => {
875
+ const parsedOutput = {
876
+ ...output,
877
+ body: await parseErrorBody(output.body, context),
878
+ };
879
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
880
+ switch (errorCode) {
881
+ case "AccessDeniedException":
882
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
883
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
884
+ case "ResourceNotFoundException":
885
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
886
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
887
+ default:
888
+ const parsedBody = parsedOutput.body;
889
+ throwDefaultError({
890
+ output,
891
+ parsedBody,
892
+ exceptionCtor: __BaseException,
893
+ errorCode,
894
+ });
895
+ }
896
+ };
897
+ export const deserializeAws_restJson1GetCrlCommand = async (output, context) => {
898
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
899
+ return deserializeAws_restJson1GetCrlCommandError(output, context);
900
+ }
901
+ const contents = map({
902
+ $metadata: deserializeMetadata(output),
1667
903
  });
1668
- }); };
1669
- var deserializeAws_restJson1ListProfilesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1670
- var parsedOutput, _a, errorCode, _b, parsedBody;
1671
- var _c;
1672
- return __generator(this, function (_d) {
1673
- switch (_d.label) {
1674
- case 0:
1675
- _a = [__assign({}, output)];
1676
- _c = {};
1677
- return [4, parseBody(output.body, context)];
1678
- case 1:
1679
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1680
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1681
- _b = errorCode;
1682
- switch (_b) {
1683
- case "AccessDeniedException": return [3, 2];
1684
- case "com.amazonaws.rolesanywhere#AccessDeniedException": return [3, 2];
1685
- case "ValidationException": return [3, 4];
1686
- case "com.amazonaws.rolesanywhere#ValidationException": return [3, 4];
1687
- }
1688
- return [3, 6];
1689
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1690
- case 3: throw _d.sent();
1691
- case 4: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1692
- case 5: throw _d.sent();
1693
- case 6:
1694
- parsedBody = parsedOutput.body;
1695
- throwDefaultError({
1696
- output: output,
1697
- parsedBody: parsedBody,
1698
- exceptionCtor: __BaseException,
1699
- errorCode: errorCode,
1700
- });
1701
- _d.label = 7;
1702
- case 7: return [2];
1703
- }
904
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
905
+ if (data.crl != null) {
906
+ contents.crl = deserializeAws_restJson1CrlDetail(data.crl, context);
907
+ }
908
+ return contents;
909
+ };
910
+ const deserializeAws_restJson1GetCrlCommandError = async (output, context) => {
911
+ const parsedOutput = {
912
+ ...output,
913
+ body: await parseErrorBody(output.body, context),
914
+ };
915
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
916
+ switch (errorCode) {
917
+ case "ResourceNotFoundException":
918
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
919
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
920
+ default:
921
+ const parsedBody = parsedOutput.body;
922
+ throwDefaultError({
923
+ output,
924
+ parsedBody,
925
+ exceptionCtor: __BaseException,
926
+ errorCode,
927
+ });
928
+ }
929
+ };
930
+ export const deserializeAws_restJson1GetProfileCommand = async (output, context) => {
931
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
932
+ return deserializeAws_restJson1GetProfileCommandError(output, context);
933
+ }
934
+ const contents = map({
935
+ $metadata: deserializeMetadata(output),
1704
936
  });
1705
- }); };
1706
- export var deserializeAws_restJson1ListSubjectsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1707
- var contents, data, _a, _b;
1708
- return __generator(this, function (_c) {
1709
- switch (_c.label) {
1710
- case 0:
1711
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1712
- return [2, deserializeAws_restJson1ListSubjectsCommandError(output, context)];
1713
- }
1714
- contents = map({
1715
- $metadata: deserializeMetadata(output),
1716
- });
1717
- _a = __expectNonNull;
1718
- _b = __expectObject;
1719
- return [4, parseBody(output.body, context)];
1720
- case 1:
1721
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1722
- if (data.nextToken != null) {
1723
- contents.nextToken = __expectString(data.nextToken);
1724
- }
1725
- if (data.subjects != null) {
1726
- contents.subjects = deserializeAws_restJson1SubjectSummaries(data.subjects, context);
1727
- }
1728
- return [2, contents];
1729
- }
937
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
938
+ if (data.profile != null) {
939
+ contents.profile = deserializeAws_restJson1ProfileDetail(data.profile, context);
940
+ }
941
+ return contents;
942
+ };
943
+ const deserializeAws_restJson1GetProfileCommandError = async (output, context) => {
944
+ const parsedOutput = {
945
+ ...output,
946
+ body: await parseErrorBody(output.body, context),
947
+ };
948
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
949
+ switch (errorCode) {
950
+ case "AccessDeniedException":
951
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
952
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
953
+ case "ResourceNotFoundException":
954
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
955
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
956
+ default:
957
+ const parsedBody = parsedOutput.body;
958
+ throwDefaultError({
959
+ output,
960
+ parsedBody,
961
+ exceptionCtor: __BaseException,
962
+ errorCode,
963
+ });
964
+ }
965
+ };
966
+ export const deserializeAws_restJson1GetSubjectCommand = async (output, context) => {
967
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
968
+ return deserializeAws_restJson1GetSubjectCommandError(output, context);
969
+ }
970
+ const contents = map({
971
+ $metadata: deserializeMetadata(output),
1730
972
  });
1731
- }); };
1732
- var deserializeAws_restJson1ListSubjectsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1733
- var parsedOutput, _a, errorCode, _b, parsedBody;
1734
- var _c;
1735
- return __generator(this, function (_d) {
1736
- switch (_d.label) {
1737
- case 0:
1738
- _a = [__assign({}, output)];
1739
- _c = {};
1740
- return [4, parseBody(output.body, context)];
1741
- case 1:
1742
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1743
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1744
- _b = errorCode;
1745
- switch (_b) {
1746
- case "AccessDeniedException": return [3, 2];
1747
- case "com.amazonaws.rolesanywhere#AccessDeniedException": return [3, 2];
1748
- case "ValidationException": return [3, 4];
1749
- case "com.amazonaws.rolesanywhere#ValidationException": return [3, 4];
1750
- }
1751
- return [3, 6];
1752
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1753
- case 3: throw _d.sent();
1754
- case 4: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1755
- case 5: throw _d.sent();
1756
- case 6:
1757
- parsedBody = parsedOutput.body;
1758
- throwDefaultError({
1759
- output: output,
1760
- parsedBody: parsedBody,
1761
- exceptionCtor: __BaseException,
1762
- errorCode: errorCode,
1763
- });
1764
- _d.label = 7;
1765
- case 7: return [2];
1766
- }
973
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
974
+ if (data.subject != null) {
975
+ contents.subject = deserializeAws_restJson1SubjectDetail(data.subject, context);
976
+ }
977
+ return contents;
978
+ };
979
+ const deserializeAws_restJson1GetSubjectCommandError = async (output, context) => {
980
+ const parsedOutput = {
981
+ ...output,
982
+ body: await parseErrorBody(output.body, context),
983
+ };
984
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
985
+ switch (errorCode) {
986
+ case "AccessDeniedException":
987
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
988
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
989
+ case "ResourceNotFoundException":
990
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
991
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
992
+ default:
993
+ const parsedBody = parsedOutput.body;
994
+ throwDefaultError({
995
+ output,
996
+ parsedBody,
997
+ exceptionCtor: __BaseException,
998
+ errorCode,
999
+ });
1000
+ }
1001
+ };
1002
+ export const deserializeAws_restJson1GetTrustAnchorCommand = async (output, context) => {
1003
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1004
+ return deserializeAws_restJson1GetTrustAnchorCommandError(output, context);
1005
+ }
1006
+ const contents = map({
1007
+ $metadata: deserializeMetadata(output),
1767
1008
  });
1768
- }); };
1769
- export var deserializeAws_restJson1ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1770
- var contents, data, _a, _b;
1771
- return __generator(this, function (_c) {
1772
- switch (_c.label) {
1773
- case 0:
1774
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1775
- return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
1776
- }
1777
- contents = map({
1778
- $metadata: deserializeMetadata(output),
1779
- });
1780
- _a = __expectNonNull;
1781
- _b = __expectObject;
1782
- return [4, parseBody(output.body, context)];
1783
- case 1:
1784
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1785
- if (data.tags != null) {
1786
- contents.tags = deserializeAws_restJson1TagList(data.tags, context);
1787
- }
1788
- return [2, contents];
1789
- }
1009
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1010
+ if (data.trustAnchor != null) {
1011
+ contents.trustAnchor = deserializeAws_restJson1TrustAnchorDetail(data.trustAnchor, context);
1012
+ }
1013
+ return contents;
1014
+ };
1015
+ const deserializeAws_restJson1GetTrustAnchorCommandError = async (output, context) => {
1016
+ const parsedOutput = {
1017
+ ...output,
1018
+ body: await parseErrorBody(output.body, context),
1019
+ };
1020
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1021
+ switch (errorCode) {
1022
+ case "AccessDeniedException":
1023
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1024
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1025
+ case "ResourceNotFoundException":
1026
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
1027
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1028
+ case "ValidationException":
1029
+ case "com.amazonaws.rolesanywhere#ValidationException":
1030
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1031
+ default:
1032
+ const parsedBody = parsedOutput.body;
1033
+ throwDefaultError({
1034
+ output,
1035
+ parsedBody,
1036
+ exceptionCtor: __BaseException,
1037
+ errorCode,
1038
+ });
1039
+ }
1040
+ };
1041
+ export const deserializeAws_restJson1ImportCrlCommand = async (output, context) => {
1042
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
1043
+ return deserializeAws_restJson1ImportCrlCommandError(output, context);
1044
+ }
1045
+ const contents = map({
1046
+ $metadata: deserializeMetadata(output),
1790
1047
  });
1791
- }); };
1792
- var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1793
- var parsedOutput, _a, errorCode, _b, parsedBody;
1794
- var _c;
1795
- return __generator(this, function (_d) {
1796
- switch (_d.label) {
1797
- case 0:
1798
- _a = [__assign({}, output)];
1799
- _c = {};
1800
- return [4, parseBody(output.body, context)];
1801
- case 1:
1802
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1803
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1804
- _b = errorCode;
1805
- switch (_b) {
1806
- case "AccessDeniedException": return [3, 2];
1807
- case "com.amazonaws.rolesanywhere#AccessDeniedException": return [3, 2];
1808
- case "ResourceNotFoundException": return [3, 4];
1809
- case "com.amazonaws.rolesanywhere#ResourceNotFoundException": return [3, 4];
1810
- case "ValidationException": return [3, 6];
1811
- case "com.amazonaws.rolesanywhere#ValidationException": return [3, 6];
1812
- }
1813
- return [3, 8];
1814
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1815
- case 3: throw _d.sent();
1816
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1817
- case 5: throw _d.sent();
1818
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1819
- case 7: throw _d.sent();
1820
- case 8:
1821
- parsedBody = parsedOutput.body;
1822
- throwDefaultError({
1823
- output: output,
1824
- parsedBody: parsedBody,
1825
- exceptionCtor: __BaseException,
1826
- errorCode: errorCode,
1827
- });
1828
- _d.label = 9;
1829
- case 9: return [2];
1830
- }
1048
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1049
+ if (data.crl != null) {
1050
+ contents.crl = deserializeAws_restJson1CrlDetail(data.crl, context);
1051
+ }
1052
+ return contents;
1053
+ };
1054
+ const deserializeAws_restJson1ImportCrlCommandError = async (output, context) => {
1055
+ const parsedOutput = {
1056
+ ...output,
1057
+ body: await parseErrorBody(output.body, context),
1058
+ };
1059
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1060
+ switch (errorCode) {
1061
+ case "AccessDeniedException":
1062
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1063
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1064
+ case "ValidationException":
1065
+ case "com.amazonaws.rolesanywhere#ValidationException":
1066
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1067
+ default:
1068
+ const parsedBody = parsedOutput.body;
1069
+ throwDefaultError({
1070
+ output,
1071
+ parsedBody,
1072
+ exceptionCtor: __BaseException,
1073
+ errorCode,
1074
+ });
1075
+ }
1076
+ };
1077
+ export const deserializeAws_restJson1ListCrlsCommand = async (output, context) => {
1078
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1079
+ return deserializeAws_restJson1ListCrlsCommandError(output, context);
1080
+ }
1081
+ const contents = map({
1082
+ $metadata: deserializeMetadata(output),
1831
1083
  });
1832
- }); };
1833
- export var deserializeAws_restJson1ListTrustAnchorsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1834
- var contents, data, _a, _b;
1835
- return __generator(this, function (_c) {
1836
- switch (_c.label) {
1837
- case 0:
1838
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1839
- return [2, deserializeAws_restJson1ListTrustAnchorsCommandError(output, context)];
1840
- }
1841
- contents = map({
1842
- $metadata: deserializeMetadata(output),
1843
- });
1844
- _a = __expectNonNull;
1845
- _b = __expectObject;
1846
- return [4, parseBody(output.body, context)];
1847
- case 1:
1848
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1849
- if (data.nextToken != null) {
1850
- contents.nextToken = __expectString(data.nextToken);
1851
- }
1852
- if (data.trustAnchors != null) {
1853
- contents.trustAnchors = deserializeAws_restJson1TrustAnchorDetails(data.trustAnchors, context);
1854
- }
1855
- return [2, contents];
1856
- }
1084
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1085
+ if (data.crls != null) {
1086
+ contents.crls = deserializeAws_restJson1CrlDetails(data.crls, context);
1087
+ }
1088
+ if (data.nextToken != null) {
1089
+ contents.nextToken = __expectString(data.nextToken);
1090
+ }
1091
+ return contents;
1092
+ };
1093
+ const deserializeAws_restJson1ListCrlsCommandError = async (output, context) => {
1094
+ const parsedOutput = {
1095
+ ...output,
1096
+ body: await parseErrorBody(output.body, context),
1097
+ };
1098
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1099
+ switch (errorCode) {
1100
+ case "AccessDeniedException":
1101
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1102
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1103
+ case "ValidationException":
1104
+ case "com.amazonaws.rolesanywhere#ValidationException":
1105
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1106
+ default:
1107
+ const parsedBody = parsedOutput.body;
1108
+ throwDefaultError({
1109
+ output,
1110
+ parsedBody,
1111
+ exceptionCtor: __BaseException,
1112
+ errorCode,
1113
+ });
1114
+ }
1115
+ };
1116
+ export const deserializeAws_restJson1ListProfilesCommand = async (output, context) => {
1117
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1118
+ return deserializeAws_restJson1ListProfilesCommandError(output, context);
1119
+ }
1120
+ const contents = map({
1121
+ $metadata: deserializeMetadata(output),
1857
1122
  });
1858
- }); };
1859
- var deserializeAws_restJson1ListTrustAnchorsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1860
- var parsedOutput, _a, errorCode, _b, parsedBody;
1861
- var _c;
1862
- return __generator(this, function (_d) {
1863
- switch (_d.label) {
1864
- case 0:
1865
- _a = [__assign({}, output)];
1866
- _c = {};
1867
- return [4, parseBody(output.body, context)];
1868
- case 1:
1869
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1870
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1871
- _b = errorCode;
1872
- switch (_b) {
1873
- case "AccessDeniedException": return [3, 2];
1874
- case "com.amazonaws.rolesanywhere#AccessDeniedException": return [3, 2];
1875
- case "ValidationException": return [3, 4];
1876
- case "com.amazonaws.rolesanywhere#ValidationException": return [3, 4];
1877
- }
1878
- return [3, 6];
1879
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1880
- case 3: throw _d.sent();
1881
- case 4: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1882
- case 5: throw _d.sent();
1883
- case 6:
1884
- parsedBody = parsedOutput.body;
1885
- throwDefaultError({
1886
- output: output,
1887
- parsedBody: parsedBody,
1888
- exceptionCtor: __BaseException,
1889
- errorCode: errorCode,
1890
- });
1891
- _d.label = 7;
1892
- case 7: return [2];
1893
- }
1123
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1124
+ if (data.nextToken != null) {
1125
+ contents.nextToken = __expectString(data.nextToken);
1126
+ }
1127
+ if (data.profiles != null) {
1128
+ contents.profiles = deserializeAws_restJson1ProfileDetails(data.profiles, context);
1129
+ }
1130
+ return contents;
1131
+ };
1132
+ const deserializeAws_restJson1ListProfilesCommandError = async (output, context) => {
1133
+ const parsedOutput = {
1134
+ ...output,
1135
+ body: await parseErrorBody(output.body, context),
1136
+ };
1137
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1138
+ switch (errorCode) {
1139
+ case "AccessDeniedException":
1140
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1141
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1142
+ case "ValidationException":
1143
+ case "com.amazonaws.rolesanywhere#ValidationException":
1144
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1145
+ default:
1146
+ const parsedBody = parsedOutput.body;
1147
+ throwDefaultError({
1148
+ output,
1149
+ parsedBody,
1150
+ exceptionCtor: __BaseException,
1151
+ errorCode,
1152
+ });
1153
+ }
1154
+ };
1155
+ export const deserializeAws_restJson1ListSubjectsCommand = async (output, context) => {
1156
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1157
+ return deserializeAws_restJson1ListSubjectsCommandError(output, context);
1158
+ }
1159
+ const contents = map({
1160
+ $metadata: deserializeMetadata(output),
1894
1161
  });
1895
- }); };
1896
- export var deserializeAws_restJson1TagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1897
- var contents;
1898
- return __generator(this, function (_a) {
1899
- switch (_a.label) {
1900
- case 0:
1901
- if (output.statusCode !== 201 && output.statusCode >= 300) {
1902
- return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
1903
- }
1904
- contents = map({
1905
- $metadata: deserializeMetadata(output),
1906
- });
1907
- return [4, collectBody(output.body, context)];
1908
- case 1:
1909
- _a.sent();
1910
- return [2, contents];
1911
- }
1162
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1163
+ if (data.nextToken != null) {
1164
+ contents.nextToken = __expectString(data.nextToken);
1165
+ }
1166
+ if (data.subjects != null) {
1167
+ contents.subjects = deserializeAws_restJson1SubjectSummaries(data.subjects, context);
1168
+ }
1169
+ return contents;
1170
+ };
1171
+ const deserializeAws_restJson1ListSubjectsCommandError = async (output, context) => {
1172
+ const parsedOutput = {
1173
+ ...output,
1174
+ body: await parseErrorBody(output.body, context),
1175
+ };
1176
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1177
+ switch (errorCode) {
1178
+ case "AccessDeniedException":
1179
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1180
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1181
+ case "ValidationException":
1182
+ case "com.amazonaws.rolesanywhere#ValidationException":
1183
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1184
+ default:
1185
+ const parsedBody = parsedOutput.body;
1186
+ throwDefaultError({
1187
+ output,
1188
+ parsedBody,
1189
+ exceptionCtor: __BaseException,
1190
+ errorCode,
1191
+ });
1192
+ }
1193
+ };
1194
+ export const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
1195
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1196
+ return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
1197
+ }
1198
+ const contents = map({
1199
+ $metadata: deserializeMetadata(output),
1912
1200
  });
1913
- }); };
1914
- var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1915
- var parsedOutput, _a, errorCode, _b, parsedBody;
1916
- var _c;
1917
- return __generator(this, function (_d) {
1918
- switch (_d.label) {
1919
- case 0:
1920
- _a = [__assign({}, output)];
1921
- _c = {};
1922
- return [4, parseBody(output.body, context)];
1923
- case 1:
1924
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1925
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1926
- _b = errorCode;
1927
- switch (_b) {
1928
- case "AccessDeniedException": return [3, 2];
1929
- case "com.amazonaws.rolesanywhere#AccessDeniedException": return [3, 2];
1930
- case "ResourceNotFoundException": return [3, 4];
1931
- case "com.amazonaws.rolesanywhere#ResourceNotFoundException": return [3, 4];
1932
- case "TooManyTagsException": return [3, 6];
1933
- case "com.amazonaws.rolesanywhere#TooManyTagsException": return [3, 6];
1934
- case "ValidationException": return [3, 8];
1935
- case "com.amazonaws.rolesanywhere#ValidationException": return [3, 8];
1936
- }
1937
- return [3, 10];
1938
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1939
- case 3: throw _d.sent();
1940
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1941
- case 5: throw _d.sent();
1942
- case 6: return [4, deserializeAws_restJson1TooManyTagsExceptionResponse(parsedOutput, context)];
1943
- case 7: throw _d.sent();
1944
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1945
- case 9: throw _d.sent();
1946
- case 10:
1947
- parsedBody = parsedOutput.body;
1948
- throwDefaultError({
1949
- output: output,
1950
- parsedBody: parsedBody,
1951
- exceptionCtor: __BaseException,
1952
- errorCode: errorCode,
1953
- });
1954
- _d.label = 11;
1955
- case 11: return [2];
1956
- }
1201
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1202
+ if (data.tags != null) {
1203
+ contents.tags = deserializeAws_restJson1TagList(data.tags, context);
1204
+ }
1205
+ return contents;
1206
+ };
1207
+ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
1208
+ const parsedOutput = {
1209
+ ...output,
1210
+ body: await parseErrorBody(output.body, context),
1211
+ };
1212
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1213
+ switch (errorCode) {
1214
+ case "AccessDeniedException":
1215
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1216
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1217
+ case "ResourceNotFoundException":
1218
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
1219
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1220
+ case "ValidationException":
1221
+ case "com.amazonaws.rolesanywhere#ValidationException":
1222
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1223
+ default:
1224
+ const parsedBody = parsedOutput.body;
1225
+ throwDefaultError({
1226
+ output,
1227
+ parsedBody,
1228
+ exceptionCtor: __BaseException,
1229
+ errorCode,
1230
+ });
1231
+ }
1232
+ };
1233
+ export const deserializeAws_restJson1ListTrustAnchorsCommand = async (output, context) => {
1234
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1235
+ return deserializeAws_restJson1ListTrustAnchorsCommandError(output, context);
1236
+ }
1237
+ const contents = map({
1238
+ $metadata: deserializeMetadata(output),
1957
1239
  });
1958
- }); };
1959
- export var deserializeAws_restJson1UntagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1960
- var contents;
1961
- return __generator(this, function (_a) {
1962
- switch (_a.label) {
1963
- case 0:
1964
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1965
- return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
1966
- }
1967
- contents = map({
1968
- $metadata: deserializeMetadata(output),
1969
- });
1970
- return [4, collectBody(output.body, context)];
1971
- case 1:
1972
- _a.sent();
1973
- return [2, contents];
1974
- }
1240
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1241
+ if (data.nextToken != null) {
1242
+ contents.nextToken = __expectString(data.nextToken);
1243
+ }
1244
+ if (data.trustAnchors != null) {
1245
+ contents.trustAnchors = deserializeAws_restJson1TrustAnchorDetails(data.trustAnchors, context);
1246
+ }
1247
+ return contents;
1248
+ };
1249
+ const deserializeAws_restJson1ListTrustAnchorsCommandError = async (output, context) => {
1250
+ const parsedOutput = {
1251
+ ...output,
1252
+ body: await parseErrorBody(output.body, context),
1253
+ };
1254
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1255
+ switch (errorCode) {
1256
+ case "AccessDeniedException":
1257
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1258
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1259
+ case "ValidationException":
1260
+ case "com.amazonaws.rolesanywhere#ValidationException":
1261
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1262
+ default:
1263
+ const parsedBody = parsedOutput.body;
1264
+ throwDefaultError({
1265
+ output,
1266
+ parsedBody,
1267
+ exceptionCtor: __BaseException,
1268
+ errorCode,
1269
+ });
1270
+ }
1271
+ };
1272
+ export const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
1273
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
1274
+ return deserializeAws_restJson1TagResourceCommandError(output, context);
1275
+ }
1276
+ const contents = map({
1277
+ $metadata: deserializeMetadata(output),
1975
1278
  });
1976
- }); };
1977
- var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1978
- var parsedOutput, _a, errorCode, _b, parsedBody;
1979
- var _c;
1980
- return __generator(this, function (_d) {
1981
- switch (_d.label) {
1982
- case 0:
1983
- _a = [__assign({}, output)];
1984
- _c = {};
1985
- return [4, parseBody(output.body, context)];
1986
- case 1:
1987
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1988
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1989
- _b = errorCode;
1990
- switch (_b) {
1991
- case "AccessDeniedException": return [3, 2];
1992
- case "com.amazonaws.rolesanywhere#AccessDeniedException": return [3, 2];
1993
- case "ResourceNotFoundException": return [3, 4];
1994
- case "com.amazonaws.rolesanywhere#ResourceNotFoundException": return [3, 4];
1995
- case "ValidationException": return [3, 6];
1996
- case "com.amazonaws.rolesanywhere#ValidationException": return [3, 6];
1997
- }
1998
- return [3, 8];
1999
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2000
- case 3: throw _d.sent();
2001
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2002
- case 5: throw _d.sent();
2003
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2004
- case 7: throw _d.sent();
2005
- case 8:
2006
- parsedBody = parsedOutput.body;
2007
- throwDefaultError({
2008
- output: output,
2009
- parsedBody: parsedBody,
2010
- exceptionCtor: __BaseException,
2011
- errorCode: errorCode,
2012
- });
2013
- _d.label = 9;
2014
- case 9: return [2];
2015
- }
1279
+ await collectBody(output.body, context);
1280
+ return contents;
1281
+ };
1282
+ const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
1283
+ const parsedOutput = {
1284
+ ...output,
1285
+ body: await parseErrorBody(output.body, context),
1286
+ };
1287
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1288
+ switch (errorCode) {
1289
+ case "AccessDeniedException":
1290
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1291
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1292
+ case "ResourceNotFoundException":
1293
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
1294
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1295
+ case "TooManyTagsException":
1296
+ case "com.amazonaws.rolesanywhere#TooManyTagsException":
1297
+ throw await deserializeAws_restJson1TooManyTagsExceptionResponse(parsedOutput, context);
1298
+ case "ValidationException":
1299
+ case "com.amazonaws.rolesanywhere#ValidationException":
1300
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1301
+ default:
1302
+ const parsedBody = parsedOutput.body;
1303
+ throwDefaultError({
1304
+ output,
1305
+ parsedBody,
1306
+ exceptionCtor: __BaseException,
1307
+ errorCode,
1308
+ });
1309
+ }
1310
+ };
1311
+ export const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
1312
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1313
+ return deserializeAws_restJson1UntagResourceCommandError(output, context);
1314
+ }
1315
+ const contents = map({
1316
+ $metadata: deserializeMetadata(output),
2016
1317
  });
2017
- }); };
2018
- export var deserializeAws_restJson1UpdateCrlCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2019
- var contents, data, _a, _b;
2020
- return __generator(this, function (_c) {
2021
- switch (_c.label) {
2022
- case 0:
2023
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2024
- return [2, deserializeAws_restJson1UpdateCrlCommandError(output, context)];
2025
- }
2026
- contents = map({
2027
- $metadata: deserializeMetadata(output),
2028
- });
2029
- _a = __expectNonNull;
2030
- _b = __expectObject;
2031
- return [4, parseBody(output.body, context)];
2032
- case 1:
2033
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2034
- if (data.crl != null) {
2035
- contents.crl = deserializeAws_restJson1CrlDetail(data.crl, context);
2036
- }
2037
- return [2, contents];
2038
- }
1318
+ await collectBody(output.body, context);
1319
+ return contents;
1320
+ };
1321
+ const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
1322
+ const parsedOutput = {
1323
+ ...output,
1324
+ body: await parseErrorBody(output.body, context),
1325
+ };
1326
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1327
+ switch (errorCode) {
1328
+ case "AccessDeniedException":
1329
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1330
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1331
+ case "ResourceNotFoundException":
1332
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
1333
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1334
+ case "ValidationException":
1335
+ case "com.amazonaws.rolesanywhere#ValidationException":
1336
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1337
+ default:
1338
+ const parsedBody = parsedOutput.body;
1339
+ throwDefaultError({
1340
+ output,
1341
+ parsedBody,
1342
+ exceptionCtor: __BaseException,
1343
+ errorCode,
1344
+ });
1345
+ }
1346
+ };
1347
+ export const deserializeAws_restJson1UpdateCrlCommand = async (output, context) => {
1348
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1349
+ return deserializeAws_restJson1UpdateCrlCommandError(output, context);
1350
+ }
1351
+ const contents = map({
1352
+ $metadata: deserializeMetadata(output),
2039
1353
  });
2040
- }); };
2041
- var deserializeAws_restJson1UpdateCrlCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2042
- var parsedOutput, _a, errorCode, _b, parsedBody;
2043
- var _c;
2044
- return __generator(this, function (_d) {
2045
- switch (_d.label) {
2046
- case 0:
2047
- _a = [__assign({}, output)];
2048
- _c = {};
2049
- return [4, parseBody(output.body, context)];
2050
- case 1:
2051
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2052
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2053
- _b = errorCode;
2054
- switch (_b) {
2055
- case "AccessDeniedException": return [3, 2];
2056
- case "com.amazonaws.rolesanywhere#AccessDeniedException": return [3, 2];
2057
- case "ResourceNotFoundException": return [3, 4];
2058
- case "com.amazonaws.rolesanywhere#ResourceNotFoundException": return [3, 4];
2059
- case "ValidationException": return [3, 6];
2060
- case "com.amazonaws.rolesanywhere#ValidationException": return [3, 6];
2061
- }
2062
- return [3, 8];
2063
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2064
- case 3: throw _d.sent();
2065
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2066
- case 5: throw _d.sent();
2067
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2068
- case 7: throw _d.sent();
2069
- case 8:
2070
- parsedBody = parsedOutput.body;
2071
- throwDefaultError({
2072
- output: output,
2073
- parsedBody: parsedBody,
2074
- exceptionCtor: __BaseException,
2075
- errorCode: errorCode,
2076
- });
2077
- _d.label = 9;
2078
- case 9: return [2];
2079
- }
1354
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1355
+ if (data.crl != null) {
1356
+ contents.crl = deserializeAws_restJson1CrlDetail(data.crl, context);
1357
+ }
1358
+ return contents;
1359
+ };
1360
+ const deserializeAws_restJson1UpdateCrlCommandError = async (output, context) => {
1361
+ const parsedOutput = {
1362
+ ...output,
1363
+ body: await parseErrorBody(output.body, context),
1364
+ };
1365
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1366
+ switch (errorCode) {
1367
+ case "AccessDeniedException":
1368
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1369
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1370
+ case "ResourceNotFoundException":
1371
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
1372
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1373
+ case "ValidationException":
1374
+ case "com.amazonaws.rolesanywhere#ValidationException":
1375
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1376
+ default:
1377
+ const parsedBody = parsedOutput.body;
1378
+ throwDefaultError({
1379
+ output,
1380
+ parsedBody,
1381
+ exceptionCtor: __BaseException,
1382
+ errorCode,
1383
+ });
1384
+ }
1385
+ };
1386
+ export const deserializeAws_restJson1UpdateProfileCommand = async (output, context) => {
1387
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1388
+ return deserializeAws_restJson1UpdateProfileCommandError(output, context);
1389
+ }
1390
+ const contents = map({
1391
+ $metadata: deserializeMetadata(output),
2080
1392
  });
2081
- }); };
2082
- export var deserializeAws_restJson1UpdateProfileCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2083
- var contents, data, _a, _b;
2084
- return __generator(this, function (_c) {
2085
- switch (_c.label) {
2086
- case 0:
2087
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2088
- return [2, deserializeAws_restJson1UpdateProfileCommandError(output, context)];
2089
- }
2090
- contents = map({
2091
- $metadata: deserializeMetadata(output),
2092
- });
2093
- _a = __expectNonNull;
2094
- _b = __expectObject;
2095
- return [4, parseBody(output.body, context)];
2096
- case 1:
2097
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2098
- if (data.profile != null) {
2099
- contents.profile = deserializeAws_restJson1ProfileDetail(data.profile, context);
2100
- }
2101
- return [2, contents];
2102
- }
1393
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1394
+ if (data.profile != null) {
1395
+ contents.profile = deserializeAws_restJson1ProfileDetail(data.profile, context);
1396
+ }
1397
+ return contents;
1398
+ };
1399
+ const deserializeAws_restJson1UpdateProfileCommandError = async (output, context) => {
1400
+ const parsedOutput = {
1401
+ ...output,
1402
+ body: await parseErrorBody(output.body, context),
1403
+ };
1404
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1405
+ switch (errorCode) {
1406
+ case "AccessDeniedException":
1407
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1408
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1409
+ case "ResourceNotFoundException":
1410
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
1411
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1412
+ case "ValidationException":
1413
+ case "com.amazonaws.rolesanywhere#ValidationException":
1414
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1415
+ default:
1416
+ const parsedBody = parsedOutput.body;
1417
+ throwDefaultError({
1418
+ output,
1419
+ parsedBody,
1420
+ exceptionCtor: __BaseException,
1421
+ errorCode,
1422
+ });
1423
+ }
1424
+ };
1425
+ export const deserializeAws_restJson1UpdateTrustAnchorCommand = async (output, context) => {
1426
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1427
+ return deserializeAws_restJson1UpdateTrustAnchorCommandError(output, context);
1428
+ }
1429
+ const contents = map({
1430
+ $metadata: deserializeMetadata(output),
2103
1431
  });
2104
- }); };
2105
- var deserializeAws_restJson1UpdateProfileCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2106
- var parsedOutput, _a, errorCode, _b, parsedBody;
2107
- var _c;
2108
- return __generator(this, function (_d) {
2109
- switch (_d.label) {
2110
- case 0:
2111
- _a = [__assign({}, output)];
2112
- _c = {};
2113
- return [4, parseBody(output.body, context)];
2114
- case 1:
2115
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2116
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2117
- _b = errorCode;
2118
- switch (_b) {
2119
- case "AccessDeniedException": return [3, 2];
2120
- case "com.amazonaws.rolesanywhere#AccessDeniedException": return [3, 2];
2121
- case "ResourceNotFoundException": return [3, 4];
2122
- case "com.amazonaws.rolesanywhere#ResourceNotFoundException": return [3, 4];
2123
- case "ValidationException": return [3, 6];
2124
- case "com.amazonaws.rolesanywhere#ValidationException": return [3, 6];
2125
- }
2126
- return [3, 8];
2127
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2128
- case 3: throw _d.sent();
2129
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2130
- case 5: throw _d.sent();
2131
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2132
- case 7: throw _d.sent();
2133
- case 8:
2134
- parsedBody = parsedOutput.body;
2135
- throwDefaultError({
2136
- output: output,
2137
- parsedBody: parsedBody,
2138
- exceptionCtor: __BaseException,
2139
- errorCode: errorCode,
2140
- });
2141
- _d.label = 9;
2142
- case 9: return [2];
2143
- }
1432
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1433
+ if (data.trustAnchor != null) {
1434
+ contents.trustAnchor = deserializeAws_restJson1TrustAnchorDetail(data.trustAnchor, context);
1435
+ }
1436
+ return contents;
1437
+ };
1438
+ const deserializeAws_restJson1UpdateTrustAnchorCommandError = async (output, context) => {
1439
+ const parsedOutput = {
1440
+ ...output,
1441
+ body: await parseErrorBody(output.body, context),
1442
+ };
1443
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1444
+ switch (errorCode) {
1445
+ case "AccessDeniedException":
1446
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1447
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1448
+ case "ResourceNotFoundException":
1449
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
1450
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1451
+ case "ValidationException":
1452
+ case "com.amazonaws.rolesanywhere#ValidationException":
1453
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1454
+ default:
1455
+ const parsedBody = parsedOutput.body;
1456
+ throwDefaultError({
1457
+ output,
1458
+ parsedBody,
1459
+ exceptionCtor: __BaseException,
1460
+ errorCode,
1461
+ });
1462
+ }
1463
+ };
1464
+ const map = __map;
1465
+ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
1466
+ const contents = map({});
1467
+ const data = parsedOutput.body;
1468
+ if (data.message != null) {
1469
+ contents.message = __expectString(data.message);
1470
+ }
1471
+ const exception = new AccessDeniedException({
1472
+ $metadata: deserializeMetadata(parsedOutput),
1473
+ ...contents,
2144
1474
  });
2145
- }); };
2146
- export var deserializeAws_restJson1UpdateTrustAnchorCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2147
- var contents, data, _a, _b;
2148
- return __generator(this, function (_c) {
2149
- switch (_c.label) {
2150
- case 0:
2151
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2152
- return [2, deserializeAws_restJson1UpdateTrustAnchorCommandError(output, context)];
2153
- }
2154
- contents = map({
2155
- $metadata: deserializeMetadata(output),
2156
- });
2157
- _a = __expectNonNull;
2158
- _b = __expectObject;
2159
- return [4, parseBody(output.body, context)];
2160
- case 1:
2161
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2162
- if (data.trustAnchor != null) {
2163
- contents.trustAnchor = deserializeAws_restJson1TrustAnchorDetail(data.trustAnchor, context);
2164
- }
2165
- return [2, contents];
2166
- }
1475
+ return __decorateServiceException(exception, parsedOutput.body);
1476
+ };
1477
+ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
1478
+ const contents = map({});
1479
+ const data = parsedOutput.body;
1480
+ if (data.message != null) {
1481
+ contents.message = __expectString(data.message);
1482
+ }
1483
+ const exception = new ResourceNotFoundException({
1484
+ $metadata: deserializeMetadata(parsedOutput),
1485
+ ...contents,
2167
1486
  });
2168
- }); };
2169
- var deserializeAws_restJson1UpdateTrustAnchorCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2170
- var parsedOutput, _a, errorCode, _b, parsedBody;
2171
- var _c;
2172
- return __generator(this, function (_d) {
2173
- switch (_d.label) {
2174
- case 0:
2175
- _a = [__assign({}, output)];
2176
- _c = {};
2177
- return [4, parseBody(output.body, context)];
2178
- case 1:
2179
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2180
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2181
- _b = errorCode;
2182
- switch (_b) {
2183
- case "AccessDeniedException": return [3, 2];
2184
- case "com.amazonaws.rolesanywhere#AccessDeniedException": return [3, 2];
2185
- case "ResourceNotFoundException": return [3, 4];
2186
- case "com.amazonaws.rolesanywhere#ResourceNotFoundException": return [3, 4];
2187
- case "ValidationException": return [3, 6];
2188
- case "com.amazonaws.rolesanywhere#ValidationException": return [3, 6];
2189
- }
2190
- return [3, 8];
2191
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2192
- case 3: throw _d.sent();
2193
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2194
- case 5: throw _d.sent();
2195
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2196
- case 7: throw _d.sent();
2197
- case 8:
2198
- parsedBody = parsedOutput.body;
2199
- throwDefaultError({
2200
- output: output,
2201
- parsedBody: parsedBody,
2202
- exceptionCtor: __BaseException,
2203
- errorCode: errorCode,
2204
- });
2205
- _d.label = 9;
2206
- case 9: return [2];
2207
- }
1487
+ return __decorateServiceException(exception, parsedOutput.body);
1488
+ };
1489
+ const deserializeAws_restJson1TooManyTagsExceptionResponse = async (parsedOutput, context) => {
1490
+ const contents = map({});
1491
+ const data = parsedOutput.body;
1492
+ if (data.message != null) {
1493
+ contents.message = __expectString(data.message);
1494
+ }
1495
+ const exception = new TooManyTagsException({
1496
+ $metadata: deserializeMetadata(parsedOutput),
1497
+ ...contents,
2208
1498
  });
2209
- }); };
2210
- var map = __map;
2211
- var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2212
- var contents, data, exception;
2213
- return __generator(this, function (_a) {
2214
- contents = map({});
2215
- data = parsedOutput.body;
2216
- if (data.message != null) {
2217
- contents.message = __expectString(data.message);
2218
- }
2219
- exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2220
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2221
- });
2222
- }); };
2223
- var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2224
- var contents, data, exception;
2225
- return __generator(this, function (_a) {
2226
- contents = map({});
2227
- data = parsedOutput.body;
2228
- if (data.message != null) {
2229
- contents.message = __expectString(data.message);
2230
- }
2231
- exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2232
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2233
- });
2234
- }); };
2235
- var deserializeAws_restJson1TooManyTagsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2236
- var contents, data, exception;
2237
- return __generator(this, function (_a) {
2238
- contents = map({});
2239
- data = parsedOutput.body;
2240
- if (data.message != null) {
2241
- contents.message = __expectString(data.message);
2242
- }
2243
- exception = new TooManyTagsException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2244
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2245
- });
2246
- }); };
2247
- var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2248
- var contents, data, exception;
2249
- return __generator(this, function (_a) {
2250
- contents = map({});
2251
- data = parsedOutput.body;
2252
- if (data.message != null) {
2253
- contents.message = __expectString(data.message);
2254
- }
2255
- exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2256
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1499
+ return __decorateServiceException(exception, parsedOutput.body);
1500
+ };
1501
+ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
1502
+ const contents = map({});
1503
+ const data = parsedOutput.body;
1504
+ if (data.message != null) {
1505
+ contents.message = __expectString(data.message);
1506
+ }
1507
+ const exception = new ValidationException({
1508
+ $metadata: deserializeMetadata(parsedOutput),
1509
+ ...contents,
2257
1510
  });
2258
- }); };
2259
- var serializeAws_restJson1ManagedPolicyList = function (input, context) {
1511
+ return __decorateServiceException(exception, parsedOutput.body);
1512
+ };
1513
+ const serializeAws_restJson1ManagedPolicyList = (input, context) => {
2260
1514
  return input
2261
- .filter(function (e) { return e != null; })
2262
- .map(function (entry) {
1515
+ .filter((e) => e != null)
1516
+ .map((entry) => {
2263
1517
  return entry;
2264
1518
  });
2265
1519
  };
2266
- var serializeAws_restJson1RoleArnList = function (input, context) {
1520
+ const serializeAws_restJson1RoleArnList = (input, context) => {
2267
1521
  return input
2268
- .filter(function (e) { return e != null; })
2269
- .map(function (entry) {
1522
+ .filter((e) => e != null)
1523
+ .map((entry) => {
2270
1524
  return entry;
2271
1525
  });
2272
1526
  };
2273
- var serializeAws_restJson1Source = function (input, context) {
2274
- return __assign(__assign({}, (input.sourceData != null && { sourceData: serializeAws_restJson1SourceData(input.sourceData, context) })), (input.sourceType != null && { sourceType: input.sourceType }));
1527
+ const serializeAws_restJson1Source = (input, context) => {
1528
+ return {
1529
+ ...(input.sourceData != null && { sourceData: serializeAws_restJson1SourceData(input.sourceData, context) }),
1530
+ ...(input.sourceType != null && { sourceType: input.sourceType }),
1531
+ };
2275
1532
  };
2276
- var serializeAws_restJson1SourceData = function (input, context) {
1533
+ const serializeAws_restJson1SourceData = (input, context) => {
2277
1534
  return SourceData.visit(input, {
2278
- acmPcaArn: function (value) { return ({ acmPcaArn: value }); },
2279
- x509CertificateData: function (value) { return ({ x509CertificateData: value }); },
2280
- _: function (name, value) { return ({ name: value }); },
1535
+ acmPcaArn: (value) => ({ acmPcaArn: value }),
1536
+ x509CertificateData: (value) => ({ x509CertificateData: value }),
1537
+ _: (name, value) => ({ name: value }),
2281
1538
  });
2282
1539
  };
2283
- var serializeAws_restJson1Tag = function (input, context) {
2284
- return __assign(__assign({}, (input.key != null && { key: input.key })), (input.value != null && { value: input.value }));
1540
+ const serializeAws_restJson1Tag = (input, context) => {
1541
+ return {
1542
+ ...(input.key != null && { key: input.key }),
1543
+ ...(input.value != null && { value: input.value }),
1544
+ };
2285
1545
  };
2286
- var serializeAws_restJson1TagKeyList = function (input, context) {
1546
+ const serializeAws_restJson1TagKeyList = (input, context) => {
2287
1547
  return input
2288
- .filter(function (e) { return e != null; })
2289
- .map(function (entry) {
1548
+ .filter((e) => e != null)
1549
+ .map((entry) => {
2290
1550
  return entry;
2291
1551
  });
2292
1552
  };
2293
- var serializeAws_restJson1TagList = function (input, context) {
1553
+ const serializeAws_restJson1TagList = (input, context) => {
2294
1554
  return input
2295
- .filter(function (e) { return e != null; })
2296
- .map(function (entry) {
1555
+ .filter((e) => e != null)
1556
+ .map((entry) => {
2297
1557
  return serializeAws_restJson1Tag(entry, context);
2298
1558
  });
2299
1559
  };
2300
- var deserializeAws_restJson1CredentialSummaries = function (output, context) {
2301
- var retVal = (output || [])
2302
- .filter(function (e) { return e != null; })
2303
- .map(function (entry) {
1560
+ const deserializeAws_restJson1CredentialSummaries = (output, context) => {
1561
+ const retVal = (output || [])
1562
+ .filter((e) => e != null)
1563
+ .map((entry) => {
2304
1564
  if (entry === null) {
2305
1565
  return null;
2306
1566
  }
@@ -2308,7 +1568,7 @@ var deserializeAws_restJson1CredentialSummaries = function (output, context) {
2308
1568
  });
2309
1569
  return retVal;
2310
1570
  };
2311
- var deserializeAws_restJson1CredentialSummary = function (output, context) {
1571
+ const deserializeAws_restJson1CredentialSummary = (output, context) => {
2312
1572
  return {
2313
1573
  enabled: __expectBoolean(output.enabled),
2314
1574
  failed: __expectBoolean(output.failed),
@@ -2318,7 +1578,7 @@ var deserializeAws_restJson1CredentialSummary = function (output, context) {
2318
1578
  x509CertificateData: __expectString(output.x509CertificateData),
2319
1579
  };
2320
1580
  };
2321
- var deserializeAws_restJson1CrlDetail = function (output, context) {
1581
+ const deserializeAws_restJson1CrlDetail = (output, context) => {
2322
1582
  return {
2323
1583
  createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTime(output.createdAt)) : undefined,
2324
1584
  crlArn: __expectString(output.crlArn),
@@ -2330,10 +1590,10 @@ var deserializeAws_restJson1CrlDetail = function (output, context) {
2330
1590
  updatedAt: output.updatedAt != null ? __expectNonNull(__parseRfc3339DateTime(output.updatedAt)) : undefined,
2331
1591
  };
2332
1592
  };
2333
- var deserializeAws_restJson1CrlDetails = function (output, context) {
2334
- var retVal = (output || [])
2335
- .filter(function (e) { return e != null; })
2336
- .map(function (entry) {
1593
+ const deserializeAws_restJson1CrlDetails = (output, context) => {
1594
+ const retVal = (output || [])
1595
+ .filter((e) => e != null)
1596
+ .map((entry) => {
2337
1597
  if (entry === null) {
2338
1598
  return null;
2339
1599
  }
@@ -2341,10 +1601,10 @@ var deserializeAws_restJson1CrlDetails = function (output, context) {
2341
1601
  });
2342
1602
  return retVal;
2343
1603
  };
2344
- var deserializeAws_restJson1InstanceProperties = function (output, context) {
2345
- var retVal = (output || [])
2346
- .filter(function (e) { return e != null; })
2347
- .map(function (entry) {
1604
+ const deserializeAws_restJson1InstanceProperties = (output, context) => {
1605
+ const retVal = (output || [])
1606
+ .filter((e) => e != null)
1607
+ .map((entry) => {
2348
1608
  if (entry === null) {
2349
1609
  return null;
2350
1610
  }
@@ -2352,27 +1612,28 @@ var deserializeAws_restJson1InstanceProperties = function (output, context) {
2352
1612
  });
2353
1613
  return retVal;
2354
1614
  };
2355
- var deserializeAws_restJson1InstanceProperty = function (output, context) {
1615
+ const deserializeAws_restJson1InstanceProperty = (output, context) => {
2356
1616
  return {
2357
1617
  failed: __expectBoolean(output.failed),
2358
1618
  properties: output.properties != null ? deserializeAws_restJson1InstancePropertyMap(output.properties, context) : undefined,
2359
1619
  seenAt: output.seenAt != null ? __expectNonNull(__parseRfc3339DateTime(output.seenAt)) : undefined,
2360
1620
  };
2361
1621
  };
2362
- var deserializeAws_restJson1InstancePropertyMap = function (output, context) {
2363
- return Object.entries(output).reduce(function (acc, _a) {
2364
- var _b;
2365
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1622
+ const deserializeAws_restJson1InstancePropertyMap = (output, context) => {
1623
+ return Object.entries(output).reduce((acc, [key, value]) => {
2366
1624
  if (value === null) {
2367
1625
  return acc;
2368
1626
  }
2369
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1627
+ return {
1628
+ ...acc,
1629
+ [key]: __expectString(value),
1630
+ };
2370
1631
  }, {});
2371
1632
  };
2372
- var deserializeAws_restJson1ManagedPolicyList = function (output, context) {
2373
- var retVal = (output || [])
2374
- .filter(function (e) { return e != null; })
2375
- .map(function (entry) {
1633
+ const deserializeAws_restJson1ManagedPolicyList = (output, context) => {
1634
+ const retVal = (output || [])
1635
+ .filter((e) => e != null)
1636
+ .map((entry) => {
2376
1637
  if (entry === null) {
2377
1638
  return null;
2378
1639
  }
@@ -2380,7 +1641,7 @@ var deserializeAws_restJson1ManagedPolicyList = function (output, context) {
2380
1641
  });
2381
1642
  return retVal;
2382
1643
  };
2383
- var deserializeAws_restJson1ProfileDetail = function (output, context) {
1644
+ const deserializeAws_restJson1ProfileDetail = (output, context) => {
2384
1645
  return {
2385
1646
  createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTime(output.createdAt)) : undefined,
2386
1647
  createdBy: __expectString(output.createdBy),
@@ -2398,10 +1659,10 @@ var deserializeAws_restJson1ProfileDetail = function (output, context) {
2398
1659
  updatedAt: output.updatedAt != null ? __expectNonNull(__parseRfc3339DateTime(output.updatedAt)) : undefined,
2399
1660
  };
2400
1661
  };
2401
- var deserializeAws_restJson1ProfileDetails = function (output, context) {
2402
- var retVal = (output || [])
2403
- .filter(function (e) { return e != null; })
2404
- .map(function (entry) {
1662
+ const deserializeAws_restJson1ProfileDetails = (output, context) => {
1663
+ const retVal = (output || [])
1664
+ .filter((e) => e != null)
1665
+ .map((entry) => {
2405
1666
  if (entry === null) {
2406
1667
  return null;
2407
1668
  }
@@ -2409,10 +1670,10 @@ var deserializeAws_restJson1ProfileDetails = function (output, context) {
2409
1670
  });
2410
1671
  return retVal;
2411
1672
  };
2412
- var deserializeAws_restJson1RoleArnList = function (output, context) {
2413
- var retVal = (output || [])
2414
- .filter(function (e) { return e != null; })
2415
- .map(function (entry) {
1673
+ const deserializeAws_restJson1RoleArnList = (output, context) => {
1674
+ const retVal = (output || [])
1675
+ .filter((e) => e != null)
1676
+ .map((entry) => {
2416
1677
  if (entry === null) {
2417
1678
  return null;
2418
1679
  }
@@ -2420,7 +1681,7 @@ var deserializeAws_restJson1RoleArnList = function (output, context) {
2420
1681
  });
2421
1682
  return retVal;
2422
1683
  };
2423
- var deserializeAws_restJson1Source = function (output, context) {
1684
+ const deserializeAws_restJson1Source = (output, context) => {
2424
1685
  return {
2425
1686
  sourceData: output.sourceData != null
2426
1687
  ? deserializeAws_restJson1SourceData(__expectUnion(output.sourceData), context)
@@ -2428,7 +1689,7 @@ var deserializeAws_restJson1Source = function (output, context) {
2428
1689
  sourceType: __expectString(output.sourceType),
2429
1690
  };
2430
1691
  };
2431
- var deserializeAws_restJson1SourceData = function (output, context) {
1692
+ const deserializeAws_restJson1SourceData = (output, context) => {
2432
1693
  if (__expectString(output.acmPcaArn) !== undefined) {
2433
1694
  return { acmPcaArn: __expectString(output.acmPcaArn) };
2434
1695
  }
@@ -2437,7 +1698,7 @@ var deserializeAws_restJson1SourceData = function (output, context) {
2437
1698
  }
2438
1699
  return { $unknown: Object.entries(output)[0] };
2439
1700
  };
2440
- var deserializeAws_restJson1SubjectDetail = function (output, context) {
1701
+ const deserializeAws_restJson1SubjectDetail = (output, context) => {
2441
1702
  return {
2442
1703
  createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTime(output.createdAt)) : undefined,
2443
1704
  credentials: output.credentials != null ? deserializeAws_restJson1CredentialSummaries(output.credentials, context) : undefined,
@@ -2452,10 +1713,10 @@ var deserializeAws_restJson1SubjectDetail = function (output, context) {
2452
1713
  x509Subject: __expectString(output.x509Subject),
2453
1714
  };
2454
1715
  };
2455
- var deserializeAws_restJson1SubjectSummaries = function (output, context) {
2456
- var retVal = (output || [])
2457
- .filter(function (e) { return e != null; })
2458
- .map(function (entry) {
1716
+ const deserializeAws_restJson1SubjectSummaries = (output, context) => {
1717
+ const retVal = (output || [])
1718
+ .filter((e) => e != null)
1719
+ .map((entry) => {
2459
1720
  if (entry === null) {
2460
1721
  return null;
2461
1722
  }
@@ -2463,7 +1724,7 @@ var deserializeAws_restJson1SubjectSummaries = function (output, context) {
2463
1724
  });
2464
1725
  return retVal;
2465
1726
  };
2466
- var deserializeAws_restJson1SubjectSummary = function (output, context) {
1727
+ const deserializeAws_restJson1SubjectSummary = (output, context) => {
2467
1728
  return {
2468
1729
  createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTime(output.createdAt)) : undefined,
2469
1730
  enabled: __expectBoolean(output.enabled),
@@ -2474,16 +1735,16 @@ var deserializeAws_restJson1SubjectSummary = function (output, context) {
2474
1735
  x509Subject: __expectString(output.x509Subject),
2475
1736
  };
2476
1737
  };
2477
- var deserializeAws_restJson1Tag = function (output, context) {
1738
+ const deserializeAws_restJson1Tag = (output, context) => {
2478
1739
  return {
2479
1740
  key: __expectString(output.key),
2480
1741
  value: __expectString(output.value),
2481
1742
  };
2482
1743
  };
2483
- var deserializeAws_restJson1TagList = function (output, context) {
2484
- var retVal = (output || [])
2485
- .filter(function (e) { return e != null; })
2486
- .map(function (entry) {
1744
+ const deserializeAws_restJson1TagList = (output, context) => {
1745
+ const retVal = (output || [])
1746
+ .filter((e) => e != null)
1747
+ .map((entry) => {
2487
1748
  if (entry === null) {
2488
1749
  return null;
2489
1750
  }
@@ -2491,7 +1752,7 @@ var deserializeAws_restJson1TagList = function (output, context) {
2491
1752
  });
2492
1753
  return retVal;
2493
1754
  };
2494
- var deserializeAws_restJson1TrustAnchorDetail = function (output, context) {
1755
+ const deserializeAws_restJson1TrustAnchorDetail = (output, context) => {
2495
1756
  return {
2496
1757
  createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTime(output.createdAt)) : undefined,
2497
1758
  enabled: __expectBoolean(output.enabled),
@@ -2502,10 +1763,10 @@ var deserializeAws_restJson1TrustAnchorDetail = function (output, context) {
2502
1763
  updatedAt: output.updatedAt != null ? __expectNonNull(__parseRfc3339DateTime(output.updatedAt)) : undefined,
2503
1764
  };
2504
1765
  };
2505
- var deserializeAws_restJson1TrustAnchorDetails = function (output, context) {
2506
- var retVal = (output || [])
2507
- .filter(function (e) { return e != null; })
2508
- .map(function (entry) {
1766
+ const deserializeAws_restJson1TrustAnchorDetails = (output, context) => {
1767
+ const retVal = (output || [])
1768
+ .filter((e) => e != null)
1769
+ .map((entry) => {
2509
1770
  if (entry === null) {
2510
1771
  return null;
2511
1772
  }
@@ -2513,44 +1774,39 @@ var deserializeAws_restJson1TrustAnchorDetails = function (output, context) {
2513
1774
  });
2514
1775
  return retVal;
2515
1776
  };
2516
- var deserializeMetadata = function (output) {
2517
- var _a;
2518
- return ({
2519
- httpStatusCode: output.statusCode,
2520
- requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
2521
- extendedRequestId: output.headers["x-amz-id-2"],
2522
- cfId: output.headers["x-amz-cf-id"],
2523
- });
2524
- };
2525
- var collectBody = function (streamBody, context) {
2526
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
1777
+ const deserializeMetadata = (output) => ({
1778
+ httpStatusCode: output.statusCode,
1779
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
1780
+ extendedRequestId: output.headers["x-amz-id-2"],
1781
+ cfId: output.headers["x-amz-cf-id"],
1782
+ });
1783
+ const collectBody = (streamBody = new Uint8Array(), context) => {
2527
1784
  if (streamBody instanceof Uint8Array) {
2528
1785
  return Promise.resolve(streamBody);
2529
1786
  }
2530
1787
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
2531
1788
  };
2532
- var collectBodyString = function (streamBody, context) {
2533
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
2534
- };
2535
- var isSerializableHeaderValue = function (value) {
2536
- return value !== undefined &&
2537
- value !== null &&
2538
- value !== "" &&
2539
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
2540
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
2541
- };
2542
- var parseBody = function (streamBody, context) {
2543
- return collectBodyString(streamBody, context).then(function (encoded) {
2544
- if (encoded.length) {
2545
- return JSON.parse(encoded);
2546
- }
2547
- return {};
2548
- });
1789
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1790
+ const isSerializableHeaderValue = (value) => value !== undefined &&
1791
+ value !== null &&
1792
+ value !== "" &&
1793
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1794
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1795
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1796
+ if (encoded.length) {
1797
+ return JSON.parse(encoded);
1798
+ }
1799
+ return {};
1800
+ });
1801
+ const parseErrorBody = async (errorBody, context) => {
1802
+ const value = await parseBody(errorBody, context);
1803
+ value.message = value.message ?? value.Message;
1804
+ return value;
2549
1805
  };
2550
- var loadRestJsonErrorCode = function (output, data) {
2551
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
2552
- var sanitizeErrorCode = function (rawValue) {
2553
- var cleanValue = rawValue;
1806
+ const loadRestJsonErrorCode = (output, data) => {
1807
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1808
+ const sanitizeErrorCode = (rawValue) => {
1809
+ let cleanValue = rawValue;
2554
1810
  if (typeof cleanValue === "number") {
2555
1811
  cleanValue = cleanValue.toString();
2556
1812
  }
@@ -2565,7 +1821,7 @@ var loadRestJsonErrorCode = function (output, data) {
2565
1821
  }
2566
1822
  return cleanValue;
2567
1823
  };
2568
- var headerKey = findKey(output.headers, "x-amzn-errortype");
1824
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
2569
1825
  if (headerKey !== undefined) {
2570
1826
  return sanitizeErrorCode(output.headers[headerKey]);
2571
1827
  }