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