@aws-sdk/client-acm-pca 3.490.0 → 3.496.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/dist-cjs/ACMPCA.js +1 -57
- package/dist-cjs/ACMPCAClient.js +1 -43
- package/dist-cjs/commands/CreateCertificateAuthorityAuditReportCommand.js +1 -28
- package/dist-cjs/commands/CreateCertificateAuthorityCommand.js +1 -28
- package/dist-cjs/commands/CreatePermissionCommand.js +1 -28
- package/dist-cjs/commands/DeleteCertificateAuthorityCommand.js +1 -28
- package/dist-cjs/commands/DeletePermissionCommand.js +1 -28
- package/dist-cjs/commands/DeletePolicyCommand.js +1 -28
- package/dist-cjs/commands/DescribeCertificateAuthorityAuditReportCommand.js +1 -28
- package/dist-cjs/commands/DescribeCertificateAuthorityCommand.js +1 -28
- package/dist-cjs/commands/GetCertificateAuthorityCertificateCommand.js +1 -28
- package/dist-cjs/commands/GetCertificateAuthorityCsrCommand.js +1 -28
- package/dist-cjs/commands/GetCertificateCommand.js +1 -28
- package/dist-cjs/commands/GetPolicyCommand.js +1 -28
- package/dist-cjs/commands/ImportCertificateAuthorityCertificateCommand.js +1 -28
- package/dist-cjs/commands/IssueCertificateCommand.js +1 -28
- package/dist-cjs/commands/ListCertificateAuthoritiesCommand.js +1 -28
- package/dist-cjs/commands/ListPermissionsCommand.js +1 -28
- package/dist-cjs/commands/ListTagsCommand.js +1 -28
- package/dist-cjs/commands/PutPolicyCommand.js +1 -28
- package/dist-cjs/commands/RestoreCertificateAuthorityCommand.js +1 -28
- package/dist-cjs/commands/RevokeCertificateCommand.js +1 -28
- package/dist-cjs/commands/TagCertificateAuthorityCommand.js +1 -28
- package/dist-cjs/commands/UntagCertificateAuthorityCommand.js +1 -28
- package/dist-cjs/commands/UpdateCertificateAuthorityCommand.js +1 -28
- package/dist-cjs/commands/index.js +1 -26
- package/dist-cjs/endpoint/EndpointParameters.js +1 -18
- package/dist-cjs/extensionConfiguration.js +1 -2
- package/dist-cjs/index.js +2667 -12
- package/dist-cjs/models/ACMPCAServiceException.js +1 -12
- package/dist-cjs/models/index.js +1 -4
- package/dist-cjs/models/models_0.js +1 -349
- package/dist-cjs/pagination/Interfaces.js +1 -2
- package/dist-cjs/pagination/ListCertificateAuthoritiesPaginator.js +1 -7
- package/dist-cjs/pagination/ListPermissionsPaginator.js +1 -7
- package/dist-cjs/pagination/ListTagsPaginator.js +1 -7
- package/dist-cjs/pagination/index.js +1 -7
- package/dist-cjs/protocols/Aws_json1_1.js +1 -1487
- package/dist-cjs/runtimeExtensions.js +1 -22
- package/dist-cjs/waiters/index.js +1 -6
- package/dist-cjs/waiters/waitForAuditReportCreated.js +1 -45
- package/dist-cjs/waiters/waitForCertificateAuthorityCSRCreated.js +1 -31
- package/dist-cjs/waiters/waitForCertificateIssued.js +1 -31
- package/package.json +41 -41
|
@@ -1,1487 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.de_UpdateCertificateAuthorityCommand = exports.de_UntagCertificateAuthorityCommand = exports.de_TagCertificateAuthorityCommand = exports.de_RevokeCertificateCommand = exports.de_RestoreCertificateAuthorityCommand = exports.de_PutPolicyCommand = exports.de_ListTagsCommand = exports.de_ListPermissionsCommand = exports.de_ListCertificateAuthoritiesCommand = exports.de_IssueCertificateCommand = exports.de_ImportCertificateAuthorityCertificateCommand = exports.de_GetPolicyCommand = exports.de_GetCertificateAuthorityCsrCommand = exports.de_GetCertificateAuthorityCertificateCommand = exports.de_GetCertificateCommand = exports.de_DescribeCertificateAuthorityAuditReportCommand = exports.de_DescribeCertificateAuthorityCommand = exports.de_DeletePolicyCommand = exports.de_DeletePermissionCommand = exports.de_DeleteCertificateAuthorityCommand = exports.de_CreatePermissionCommand = exports.de_CreateCertificateAuthorityAuditReportCommand = exports.de_CreateCertificateAuthorityCommand = exports.se_UpdateCertificateAuthorityCommand = exports.se_UntagCertificateAuthorityCommand = exports.se_TagCertificateAuthorityCommand = exports.se_RevokeCertificateCommand = exports.se_RestoreCertificateAuthorityCommand = exports.se_PutPolicyCommand = exports.se_ListTagsCommand = exports.se_ListPermissionsCommand = exports.se_ListCertificateAuthoritiesCommand = exports.se_IssueCertificateCommand = exports.se_ImportCertificateAuthorityCertificateCommand = exports.se_GetPolicyCommand = exports.se_GetCertificateAuthorityCsrCommand = exports.se_GetCertificateAuthorityCertificateCommand = exports.se_GetCertificateCommand = exports.se_DescribeCertificateAuthorityAuditReportCommand = exports.se_DescribeCertificateAuthorityCommand = exports.se_DeletePolicyCommand = exports.se_DeletePermissionCommand = exports.se_DeleteCertificateAuthorityCommand = exports.se_CreatePermissionCommand = exports.se_CreateCertificateAuthorityAuditReportCommand = exports.se_CreateCertificateAuthorityCommand = void 0;
|
|
4
|
-
const protocol_http_1 = require("@smithy/protocol-http");
|
|
5
|
-
const smithy_client_1 = require("@smithy/smithy-client");
|
|
6
|
-
const ACMPCAServiceException_1 = require("../models/ACMPCAServiceException");
|
|
7
|
-
const models_0_1 = require("../models/models_0");
|
|
8
|
-
const se_CreateCertificateAuthorityCommand = async (input, context) => {
|
|
9
|
-
const headers = sharedHeaders("CreateCertificateAuthority");
|
|
10
|
-
let body;
|
|
11
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
12
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
13
|
-
};
|
|
14
|
-
exports.se_CreateCertificateAuthorityCommand = se_CreateCertificateAuthorityCommand;
|
|
15
|
-
const se_CreateCertificateAuthorityAuditReportCommand = async (input, context) => {
|
|
16
|
-
const headers = sharedHeaders("CreateCertificateAuthorityAuditReport");
|
|
17
|
-
let body;
|
|
18
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
19
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
20
|
-
};
|
|
21
|
-
exports.se_CreateCertificateAuthorityAuditReportCommand = se_CreateCertificateAuthorityAuditReportCommand;
|
|
22
|
-
const se_CreatePermissionCommand = async (input, context) => {
|
|
23
|
-
const headers = sharedHeaders("CreatePermission");
|
|
24
|
-
let body;
|
|
25
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
26
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
27
|
-
};
|
|
28
|
-
exports.se_CreatePermissionCommand = se_CreatePermissionCommand;
|
|
29
|
-
const se_DeleteCertificateAuthorityCommand = async (input, context) => {
|
|
30
|
-
const headers = sharedHeaders("DeleteCertificateAuthority");
|
|
31
|
-
let body;
|
|
32
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
33
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
34
|
-
};
|
|
35
|
-
exports.se_DeleteCertificateAuthorityCommand = se_DeleteCertificateAuthorityCommand;
|
|
36
|
-
const se_DeletePermissionCommand = async (input, context) => {
|
|
37
|
-
const headers = sharedHeaders("DeletePermission");
|
|
38
|
-
let body;
|
|
39
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
40
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
41
|
-
};
|
|
42
|
-
exports.se_DeletePermissionCommand = se_DeletePermissionCommand;
|
|
43
|
-
const se_DeletePolicyCommand = async (input, context) => {
|
|
44
|
-
const headers = sharedHeaders("DeletePolicy");
|
|
45
|
-
let body;
|
|
46
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
47
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
48
|
-
};
|
|
49
|
-
exports.se_DeletePolicyCommand = se_DeletePolicyCommand;
|
|
50
|
-
const se_DescribeCertificateAuthorityCommand = async (input, context) => {
|
|
51
|
-
const headers = sharedHeaders("DescribeCertificateAuthority");
|
|
52
|
-
let body;
|
|
53
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
54
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
55
|
-
};
|
|
56
|
-
exports.se_DescribeCertificateAuthorityCommand = se_DescribeCertificateAuthorityCommand;
|
|
57
|
-
const se_DescribeCertificateAuthorityAuditReportCommand = async (input, context) => {
|
|
58
|
-
const headers = sharedHeaders("DescribeCertificateAuthorityAuditReport");
|
|
59
|
-
let body;
|
|
60
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
61
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
62
|
-
};
|
|
63
|
-
exports.se_DescribeCertificateAuthorityAuditReportCommand = se_DescribeCertificateAuthorityAuditReportCommand;
|
|
64
|
-
const se_GetCertificateCommand = async (input, context) => {
|
|
65
|
-
const headers = sharedHeaders("GetCertificate");
|
|
66
|
-
let body;
|
|
67
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
68
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
69
|
-
};
|
|
70
|
-
exports.se_GetCertificateCommand = se_GetCertificateCommand;
|
|
71
|
-
const se_GetCertificateAuthorityCertificateCommand = async (input, context) => {
|
|
72
|
-
const headers = sharedHeaders("GetCertificateAuthorityCertificate");
|
|
73
|
-
let body;
|
|
74
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
75
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
76
|
-
};
|
|
77
|
-
exports.se_GetCertificateAuthorityCertificateCommand = se_GetCertificateAuthorityCertificateCommand;
|
|
78
|
-
const se_GetCertificateAuthorityCsrCommand = async (input, context) => {
|
|
79
|
-
const headers = sharedHeaders("GetCertificateAuthorityCsr");
|
|
80
|
-
let body;
|
|
81
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
82
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
83
|
-
};
|
|
84
|
-
exports.se_GetCertificateAuthorityCsrCommand = se_GetCertificateAuthorityCsrCommand;
|
|
85
|
-
const se_GetPolicyCommand = async (input, context) => {
|
|
86
|
-
const headers = sharedHeaders("GetPolicy");
|
|
87
|
-
let body;
|
|
88
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
89
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
90
|
-
};
|
|
91
|
-
exports.se_GetPolicyCommand = se_GetPolicyCommand;
|
|
92
|
-
const se_ImportCertificateAuthorityCertificateCommand = async (input, context) => {
|
|
93
|
-
const headers = sharedHeaders("ImportCertificateAuthorityCertificate");
|
|
94
|
-
let body;
|
|
95
|
-
body = JSON.stringify(se_ImportCertificateAuthorityCertificateRequest(input, context));
|
|
96
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
97
|
-
};
|
|
98
|
-
exports.se_ImportCertificateAuthorityCertificateCommand = se_ImportCertificateAuthorityCertificateCommand;
|
|
99
|
-
const se_IssueCertificateCommand = async (input, context) => {
|
|
100
|
-
const headers = sharedHeaders("IssueCertificate");
|
|
101
|
-
let body;
|
|
102
|
-
body = JSON.stringify(se_IssueCertificateRequest(input, context));
|
|
103
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
104
|
-
};
|
|
105
|
-
exports.se_IssueCertificateCommand = se_IssueCertificateCommand;
|
|
106
|
-
const se_ListCertificateAuthoritiesCommand = async (input, context) => {
|
|
107
|
-
const headers = sharedHeaders("ListCertificateAuthorities");
|
|
108
|
-
let body;
|
|
109
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
110
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
111
|
-
};
|
|
112
|
-
exports.se_ListCertificateAuthoritiesCommand = se_ListCertificateAuthoritiesCommand;
|
|
113
|
-
const se_ListPermissionsCommand = async (input, context) => {
|
|
114
|
-
const headers = sharedHeaders("ListPermissions");
|
|
115
|
-
let body;
|
|
116
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
117
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
118
|
-
};
|
|
119
|
-
exports.se_ListPermissionsCommand = se_ListPermissionsCommand;
|
|
120
|
-
const se_ListTagsCommand = async (input, context) => {
|
|
121
|
-
const headers = sharedHeaders("ListTags");
|
|
122
|
-
let body;
|
|
123
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
124
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
125
|
-
};
|
|
126
|
-
exports.se_ListTagsCommand = se_ListTagsCommand;
|
|
127
|
-
const se_PutPolicyCommand = async (input, context) => {
|
|
128
|
-
const headers = sharedHeaders("PutPolicy");
|
|
129
|
-
let body;
|
|
130
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
131
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
132
|
-
};
|
|
133
|
-
exports.se_PutPolicyCommand = se_PutPolicyCommand;
|
|
134
|
-
const se_RestoreCertificateAuthorityCommand = async (input, context) => {
|
|
135
|
-
const headers = sharedHeaders("RestoreCertificateAuthority");
|
|
136
|
-
let body;
|
|
137
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
138
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
139
|
-
};
|
|
140
|
-
exports.se_RestoreCertificateAuthorityCommand = se_RestoreCertificateAuthorityCommand;
|
|
141
|
-
const se_RevokeCertificateCommand = async (input, context) => {
|
|
142
|
-
const headers = sharedHeaders("RevokeCertificate");
|
|
143
|
-
let body;
|
|
144
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
145
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
146
|
-
};
|
|
147
|
-
exports.se_RevokeCertificateCommand = se_RevokeCertificateCommand;
|
|
148
|
-
const se_TagCertificateAuthorityCommand = async (input, context) => {
|
|
149
|
-
const headers = sharedHeaders("TagCertificateAuthority");
|
|
150
|
-
let body;
|
|
151
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
152
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
153
|
-
};
|
|
154
|
-
exports.se_TagCertificateAuthorityCommand = se_TagCertificateAuthorityCommand;
|
|
155
|
-
const se_UntagCertificateAuthorityCommand = async (input, context) => {
|
|
156
|
-
const headers = sharedHeaders("UntagCertificateAuthority");
|
|
157
|
-
let body;
|
|
158
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
159
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
160
|
-
};
|
|
161
|
-
exports.se_UntagCertificateAuthorityCommand = se_UntagCertificateAuthorityCommand;
|
|
162
|
-
const se_UpdateCertificateAuthorityCommand = async (input, context) => {
|
|
163
|
-
const headers = sharedHeaders("UpdateCertificateAuthority");
|
|
164
|
-
let body;
|
|
165
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
166
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
167
|
-
};
|
|
168
|
-
exports.se_UpdateCertificateAuthorityCommand = se_UpdateCertificateAuthorityCommand;
|
|
169
|
-
const de_CreateCertificateAuthorityCommand = async (output, context) => {
|
|
170
|
-
if (output.statusCode >= 300) {
|
|
171
|
-
return de_CreateCertificateAuthorityCommandError(output, context);
|
|
172
|
-
}
|
|
173
|
-
const data = await parseBody(output.body, context);
|
|
174
|
-
let contents = {};
|
|
175
|
-
contents = (0, smithy_client_1._json)(data);
|
|
176
|
-
const response = {
|
|
177
|
-
$metadata: deserializeMetadata(output),
|
|
178
|
-
...contents,
|
|
179
|
-
};
|
|
180
|
-
return response;
|
|
181
|
-
};
|
|
182
|
-
exports.de_CreateCertificateAuthorityCommand = de_CreateCertificateAuthorityCommand;
|
|
183
|
-
const de_CreateCertificateAuthorityCommandError = async (output, context) => {
|
|
184
|
-
const parsedOutput = {
|
|
185
|
-
...output,
|
|
186
|
-
body: await parseErrorBody(output.body, context),
|
|
187
|
-
};
|
|
188
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
189
|
-
switch (errorCode) {
|
|
190
|
-
case "InvalidArgsException":
|
|
191
|
-
case "com.amazonaws.acmpca#InvalidArgsException":
|
|
192
|
-
throw await de_InvalidArgsExceptionRes(parsedOutput, context);
|
|
193
|
-
case "InvalidPolicyException":
|
|
194
|
-
case "com.amazonaws.acmpca#InvalidPolicyException":
|
|
195
|
-
throw await de_InvalidPolicyExceptionRes(parsedOutput, context);
|
|
196
|
-
case "InvalidTagException":
|
|
197
|
-
case "com.amazonaws.acmpca#InvalidTagException":
|
|
198
|
-
throw await de_InvalidTagExceptionRes(parsedOutput, context);
|
|
199
|
-
case "LimitExceededException":
|
|
200
|
-
case "com.amazonaws.acmpca#LimitExceededException":
|
|
201
|
-
throw await de_LimitExceededExceptionRes(parsedOutput, context);
|
|
202
|
-
default:
|
|
203
|
-
const parsedBody = parsedOutput.body;
|
|
204
|
-
return throwDefaultError({
|
|
205
|
-
output,
|
|
206
|
-
parsedBody,
|
|
207
|
-
errorCode,
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
};
|
|
211
|
-
const de_CreateCertificateAuthorityAuditReportCommand = async (output, context) => {
|
|
212
|
-
if (output.statusCode >= 300) {
|
|
213
|
-
return de_CreateCertificateAuthorityAuditReportCommandError(output, context);
|
|
214
|
-
}
|
|
215
|
-
const data = await parseBody(output.body, context);
|
|
216
|
-
let contents = {};
|
|
217
|
-
contents = (0, smithy_client_1._json)(data);
|
|
218
|
-
const response = {
|
|
219
|
-
$metadata: deserializeMetadata(output),
|
|
220
|
-
...contents,
|
|
221
|
-
};
|
|
222
|
-
return response;
|
|
223
|
-
};
|
|
224
|
-
exports.de_CreateCertificateAuthorityAuditReportCommand = de_CreateCertificateAuthorityAuditReportCommand;
|
|
225
|
-
const de_CreateCertificateAuthorityAuditReportCommandError = async (output, context) => {
|
|
226
|
-
const parsedOutput = {
|
|
227
|
-
...output,
|
|
228
|
-
body: await parseErrorBody(output.body, context),
|
|
229
|
-
};
|
|
230
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
231
|
-
switch (errorCode) {
|
|
232
|
-
case "InvalidArgsException":
|
|
233
|
-
case "com.amazonaws.acmpca#InvalidArgsException":
|
|
234
|
-
throw await de_InvalidArgsExceptionRes(parsedOutput, context);
|
|
235
|
-
case "InvalidArnException":
|
|
236
|
-
case "com.amazonaws.acmpca#InvalidArnException":
|
|
237
|
-
throw await de_InvalidArnExceptionRes(parsedOutput, context);
|
|
238
|
-
case "InvalidStateException":
|
|
239
|
-
case "com.amazonaws.acmpca#InvalidStateException":
|
|
240
|
-
throw await de_InvalidStateExceptionRes(parsedOutput, context);
|
|
241
|
-
case "RequestFailedException":
|
|
242
|
-
case "com.amazonaws.acmpca#RequestFailedException":
|
|
243
|
-
throw await de_RequestFailedExceptionRes(parsedOutput, context);
|
|
244
|
-
case "RequestInProgressException":
|
|
245
|
-
case "com.amazonaws.acmpca#RequestInProgressException":
|
|
246
|
-
throw await de_RequestInProgressExceptionRes(parsedOutput, context);
|
|
247
|
-
case "ResourceNotFoundException":
|
|
248
|
-
case "com.amazonaws.acmpca#ResourceNotFoundException":
|
|
249
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
250
|
-
default:
|
|
251
|
-
const parsedBody = parsedOutput.body;
|
|
252
|
-
return throwDefaultError({
|
|
253
|
-
output,
|
|
254
|
-
parsedBody,
|
|
255
|
-
errorCode,
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
};
|
|
259
|
-
const de_CreatePermissionCommand = async (output, context) => {
|
|
260
|
-
if (output.statusCode >= 300) {
|
|
261
|
-
return de_CreatePermissionCommandError(output, context);
|
|
262
|
-
}
|
|
263
|
-
await (0, smithy_client_1.collectBody)(output.body, context);
|
|
264
|
-
const response = {
|
|
265
|
-
$metadata: deserializeMetadata(output),
|
|
266
|
-
};
|
|
267
|
-
return response;
|
|
268
|
-
};
|
|
269
|
-
exports.de_CreatePermissionCommand = de_CreatePermissionCommand;
|
|
270
|
-
const de_CreatePermissionCommandError = async (output, context) => {
|
|
271
|
-
const parsedOutput = {
|
|
272
|
-
...output,
|
|
273
|
-
body: await parseErrorBody(output.body, context),
|
|
274
|
-
};
|
|
275
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
276
|
-
switch (errorCode) {
|
|
277
|
-
case "InvalidArnException":
|
|
278
|
-
case "com.amazonaws.acmpca#InvalidArnException":
|
|
279
|
-
throw await de_InvalidArnExceptionRes(parsedOutput, context);
|
|
280
|
-
case "InvalidStateException":
|
|
281
|
-
case "com.amazonaws.acmpca#InvalidStateException":
|
|
282
|
-
throw await de_InvalidStateExceptionRes(parsedOutput, context);
|
|
283
|
-
case "LimitExceededException":
|
|
284
|
-
case "com.amazonaws.acmpca#LimitExceededException":
|
|
285
|
-
throw await de_LimitExceededExceptionRes(parsedOutput, context);
|
|
286
|
-
case "PermissionAlreadyExistsException":
|
|
287
|
-
case "com.amazonaws.acmpca#PermissionAlreadyExistsException":
|
|
288
|
-
throw await de_PermissionAlreadyExistsExceptionRes(parsedOutput, context);
|
|
289
|
-
case "RequestFailedException":
|
|
290
|
-
case "com.amazonaws.acmpca#RequestFailedException":
|
|
291
|
-
throw await de_RequestFailedExceptionRes(parsedOutput, context);
|
|
292
|
-
case "ResourceNotFoundException":
|
|
293
|
-
case "com.amazonaws.acmpca#ResourceNotFoundException":
|
|
294
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
295
|
-
default:
|
|
296
|
-
const parsedBody = parsedOutput.body;
|
|
297
|
-
return throwDefaultError({
|
|
298
|
-
output,
|
|
299
|
-
parsedBody,
|
|
300
|
-
errorCode,
|
|
301
|
-
});
|
|
302
|
-
}
|
|
303
|
-
};
|
|
304
|
-
const de_DeleteCertificateAuthorityCommand = async (output, context) => {
|
|
305
|
-
if (output.statusCode >= 300) {
|
|
306
|
-
return de_DeleteCertificateAuthorityCommandError(output, context);
|
|
307
|
-
}
|
|
308
|
-
await (0, smithy_client_1.collectBody)(output.body, context);
|
|
309
|
-
const response = {
|
|
310
|
-
$metadata: deserializeMetadata(output),
|
|
311
|
-
};
|
|
312
|
-
return response;
|
|
313
|
-
};
|
|
314
|
-
exports.de_DeleteCertificateAuthorityCommand = de_DeleteCertificateAuthorityCommand;
|
|
315
|
-
const de_DeleteCertificateAuthorityCommandError = async (output, context) => {
|
|
316
|
-
const parsedOutput = {
|
|
317
|
-
...output,
|
|
318
|
-
body: await parseErrorBody(output.body, context),
|
|
319
|
-
};
|
|
320
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
321
|
-
switch (errorCode) {
|
|
322
|
-
case "ConcurrentModificationException":
|
|
323
|
-
case "com.amazonaws.acmpca#ConcurrentModificationException":
|
|
324
|
-
throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
|
|
325
|
-
case "InvalidArnException":
|
|
326
|
-
case "com.amazonaws.acmpca#InvalidArnException":
|
|
327
|
-
throw await de_InvalidArnExceptionRes(parsedOutput, context);
|
|
328
|
-
case "InvalidStateException":
|
|
329
|
-
case "com.amazonaws.acmpca#InvalidStateException":
|
|
330
|
-
throw await de_InvalidStateExceptionRes(parsedOutput, context);
|
|
331
|
-
case "ResourceNotFoundException":
|
|
332
|
-
case "com.amazonaws.acmpca#ResourceNotFoundException":
|
|
333
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
334
|
-
default:
|
|
335
|
-
const parsedBody = parsedOutput.body;
|
|
336
|
-
return throwDefaultError({
|
|
337
|
-
output,
|
|
338
|
-
parsedBody,
|
|
339
|
-
errorCode,
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
};
|
|
343
|
-
const de_DeletePermissionCommand = async (output, context) => {
|
|
344
|
-
if (output.statusCode >= 300) {
|
|
345
|
-
return de_DeletePermissionCommandError(output, context);
|
|
346
|
-
}
|
|
347
|
-
await (0, smithy_client_1.collectBody)(output.body, context);
|
|
348
|
-
const response = {
|
|
349
|
-
$metadata: deserializeMetadata(output),
|
|
350
|
-
};
|
|
351
|
-
return response;
|
|
352
|
-
};
|
|
353
|
-
exports.de_DeletePermissionCommand = de_DeletePermissionCommand;
|
|
354
|
-
const de_DeletePermissionCommandError = async (output, context) => {
|
|
355
|
-
const parsedOutput = {
|
|
356
|
-
...output,
|
|
357
|
-
body: await parseErrorBody(output.body, context),
|
|
358
|
-
};
|
|
359
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
360
|
-
switch (errorCode) {
|
|
361
|
-
case "InvalidArnException":
|
|
362
|
-
case "com.amazonaws.acmpca#InvalidArnException":
|
|
363
|
-
throw await de_InvalidArnExceptionRes(parsedOutput, context);
|
|
364
|
-
case "InvalidStateException":
|
|
365
|
-
case "com.amazonaws.acmpca#InvalidStateException":
|
|
366
|
-
throw await de_InvalidStateExceptionRes(parsedOutput, context);
|
|
367
|
-
case "RequestFailedException":
|
|
368
|
-
case "com.amazonaws.acmpca#RequestFailedException":
|
|
369
|
-
throw await de_RequestFailedExceptionRes(parsedOutput, context);
|
|
370
|
-
case "ResourceNotFoundException":
|
|
371
|
-
case "com.amazonaws.acmpca#ResourceNotFoundException":
|
|
372
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
373
|
-
default:
|
|
374
|
-
const parsedBody = parsedOutput.body;
|
|
375
|
-
return throwDefaultError({
|
|
376
|
-
output,
|
|
377
|
-
parsedBody,
|
|
378
|
-
errorCode,
|
|
379
|
-
});
|
|
380
|
-
}
|
|
381
|
-
};
|
|
382
|
-
const de_DeletePolicyCommand = async (output, context) => {
|
|
383
|
-
if (output.statusCode >= 300) {
|
|
384
|
-
return de_DeletePolicyCommandError(output, context);
|
|
385
|
-
}
|
|
386
|
-
await (0, smithy_client_1.collectBody)(output.body, context);
|
|
387
|
-
const response = {
|
|
388
|
-
$metadata: deserializeMetadata(output),
|
|
389
|
-
};
|
|
390
|
-
return response;
|
|
391
|
-
};
|
|
392
|
-
exports.de_DeletePolicyCommand = de_DeletePolicyCommand;
|
|
393
|
-
const de_DeletePolicyCommandError = async (output, context) => {
|
|
394
|
-
const parsedOutput = {
|
|
395
|
-
...output,
|
|
396
|
-
body: await parseErrorBody(output.body, context),
|
|
397
|
-
};
|
|
398
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
399
|
-
switch (errorCode) {
|
|
400
|
-
case "ConcurrentModificationException":
|
|
401
|
-
case "com.amazonaws.acmpca#ConcurrentModificationException":
|
|
402
|
-
throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
|
|
403
|
-
case "InvalidArnException":
|
|
404
|
-
case "com.amazonaws.acmpca#InvalidArnException":
|
|
405
|
-
throw await de_InvalidArnExceptionRes(parsedOutput, context);
|
|
406
|
-
case "InvalidStateException":
|
|
407
|
-
case "com.amazonaws.acmpca#InvalidStateException":
|
|
408
|
-
throw await de_InvalidStateExceptionRes(parsedOutput, context);
|
|
409
|
-
case "LockoutPreventedException":
|
|
410
|
-
case "com.amazonaws.acmpca#LockoutPreventedException":
|
|
411
|
-
throw await de_LockoutPreventedExceptionRes(parsedOutput, context);
|
|
412
|
-
case "RequestFailedException":
|
|
413
|
-
case "com.amazonaws.acmpca#RequestFailedException":
|
|
414
|
-
throw await de_RequestFailedExceptionRes(parsedOutput, context);
|
|
415
|
-
case "ResourceNotFoundException":
|
|
416
|
-
case "com.amazonaws.acmpca#ResourceNotFoundException":
|
|
417
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
418
|
-
default:
|
|
419
|
-
const parsedBody = parsedOutput.body;
|
|
420
|
-
return throwDefaultError({
|
|
421
|
-
output,
|
|
422
|
-
parsedBody,
|
|
423
|
-
errorCode,
|
|
424
|
-
});
|
|
425
|
-
}
|
|
426
|
-
};
|
|
427
|
-
const de_DescribeCertificateAuthorityCommand = async (output, context) => {
|
|
428
|
-
if (output.statusCode >= 300) {
|
|
429
|
-
return de_DescribeCertificateAuthorityCommandError(output, context);
|
|
430
|
-
}
|
|
431
|
-
const data = await parseBody(output.body, context);
|
|
432
|
-
let contents = {};
|
|
433
|
-
contents = de_DescribeCertificateAuthorityResponse(data, context);
|
|
434
|
-
const response = {
|
|
435
|
-
$metadata: deserializeMetadata(output),
|
|
436
|
-
...contents,
|
|
437
|
-
};
|
|
438
|
-
return response;
|
|
439
|
-
};
|
|
440
|
-
exports.de_DescribeCertificateAuthorityCommand = de_DescribeCertificateAuthorityCommand;
|
|
441
|
-
const de_DescribeCertificateAuthorityCommandError = async (output, context) => {
|
|
442
|
-
const parsedOutput = {
|
|
443
|
-
...output,
|
|
444
|
-
body: await parseErrorBody(output.body, context),
|
|
445
|
-
};
|
|
446
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
447
|
-
switch (errorCode) {
|
|
448
|
-
case "InvalidArnException":
|
|
449
|
-
case "com.amazonaws.acmpca#InvalidArnException":
|
|
450
|
-
throw await de_InvalidArnExceptionRes(parsedOutput, context);
|
|
451
|
-
case "ResourceNotFoundException":
|
|
452
|
-
case "com.amazonaws.acmpca#ResourceNotFoundException":
|
|
453
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
454
|
-
default:
|
|
455
|
-
const parsedBody = parsedOutput.body;
|
|
456
|
-
return throwDefaultError({
|
|
457
|
-
output,
|
|
458
|
-
parsedBody,
|
|
459
|
-
errorCode,
|
|
460
|
-
});
|
|
461
|
-
}
|
|
462
|
-
};
|
|
463
|
-
const de_DescribeCertificateAuthorityAuditReportCommand = async (output, context) => {
|
|
464
|
-
if (output.statusCode >= 300) {
|
|
465
|
-
return de_DescribeCertificateAuthorityAuditReportCommandError(output, context);
|
|
466
|
-
}
|
|
467
|
-
const data = await parseBody(output.body, context);
|
|
468
|
-
let contents = {};
|
|
469
|
-
contents = de_DescribeCertificateAuthorityAuditReportResponse(data, context);
|
|
470
|
-
const response = {
|
|
471
|
-
$metadata: deserializeMetadata(output),
|
|
472
|
-
...contents,
|
|
473
|
-
};
|
|
474
|
-
return response;
|
|
475
|
-
};
|
|
476
|
-
exports.de_DescribeCertificateAuthorityAuditReportCommand = de_DescribeCertificateAuthorityAuditReportCommand;
|
|
477
|
-
const de_DescribeCertificateAuthorityAuditReportCommandError = async (output, context) => {
|
|
478
|
-
const parsedOutput = {
|
|
479
|
-
...output,
|
|
480
|
-
body: await parseErrorBody(output.body, context),
|
|
481
|
-
};
|
|
482
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
483
|
-
switch (errorCode) {
|
|
484
|
-
case "InvalidArgsException":
|
|
485
|
-
case "com.amazonaws.acmpca#InvalidArgsException":
|
|
486
|
-
throw await de_InvalidArgsExceptionRes(parsedOutput, context);
|
|
487
|
-
case "InvalidArnException":
|
|
488
|
-
case "com.amazonaws.acmpca#InvalidArnException":
|
|
489
|
-
throw await de_InvalidArnExceptionRes(parsedOutput, context);
|
|
490
|
-
case "ResourceNotFoundException":
|
|
491
|
-
case "com.amazonaws.acmpca#ResourceNotFoundException":
|
|
492
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
493
|
-
default:
|
|
494
|
-
const parsedBody = parsedOutput.body;
|
|
495
|
-
return throwDefaultError({
|
|
496
|
-
output,
|
|
497
|
-
parsedBody,
|
|
498
|
-
errorCode,
|
|
499
|
-
});
|
|
500
|
-
}
|
|
501
|
-
};
|
|
502
|
-
const de_GetCertificateCommand = async (output, context) => {
|
|
503
|
-
if (output.statusCode >= 300) {
|
|
504
|
-
return de_GetCertificateCommandError(output, context);
|
|
505
|
-
}
|
|
506
|
-
const data = await parseBody(output.body, context);
|
|
507
|
-
let contents = {};
|
|
508
|
-
contents = (0, smithy_client_1._json)(data);
|
|
509
|
-
const response = {
|
|
510
|
-
$metadata: deserializeMetadata(output),
|
|
511
|
-
...contents,
|
|
512
|
-
};
|
|
513
|
-
return response;
|
|
514
|
-
};
|
|
515
|
-
exports.de_GetCertificateCommand = de_GetCertificateCommand;
|
|
516
|
-
const de_GetCertificateCommandError = async (output, context) => {
|
|
517
|
-
const parsedOutput = {
|
|
518
|
-
...output,
|
|
519
|
-
body: await parseErrorBody(output.body, context),
|
|
520
|
-
};
|
|
521
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
522
|
-
switch (errorCode) {
|
|
523
|
-
case "InvalidArnException":
|
|
524
|
-
case "com.amazonaws.acmpca#InvalidArnException":
|
|
525
|
-
throw await de_InvalidArnExceptionRes(parsedOutput, context);
|
|
526
|
-
case "InvalidStateException":
|
|
527
|
-
case "com.amazonaws.acmpca#InvalidStateException":
|
|
528
|
-
throw await de_InvalidStateExceptionRes(parsedOutput, context);
|
|
529
|
-
case "RequestFailedException":
|
|
530
|
-
case "com.amazonaws.acmpca#RequestFailedException":
|
|
531
|
-
throw await de_RequestFailedExceptionRes(parsedOutput, context);
|
|
532
|
-
case "RequestInProgressException":
|
|
533
|
-
case "com.amazonaws.acmpca#RequestInProgressException":
|
|
534
|
-
throw await de_RequestInProgressExceptionRes(parsedOutput, context);
|
|
535
|
-
case "ResourceNotFoundException":
|
|
536
|
-
case "com.amazonaws.acmpca#ResourceNotFoundException":
|
|
537
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
538
|
-
default:
|
|
539
|
-
const parsedBody = parsedOutput.body;
|
|
540
|
-
return throwDefaultError({
|
|
541
|
-
output,
|
|
542
|
-
parsedBody,
|
|
543
|
-
errorCode,
|
|
544
|
-
});
|
|
545
|
-
}
|
|
546
|
-
};
|
|
547
|
-
const de_GetCertificateAuthorityCertificateCommand = async (output, context) => {
|
|
548
|
-
if (output.statusCode >= 300) {
|
|
549
|
-
return de_GetCertificateAuthorityCertificateCommandError(output, context);
|
|
550
|
-
}
|
|
551
|
-
const data = await parseBody(output.body, context);
|
|
552
|
-
let contents = {};
|
|
553
|
-
contents = (0, smithy_client_1._json)(data);
|
|
554
|
-
const response = {
|
|
555
|
-
$metadata: deserializeMetadata(output),
|
|
556
|
-
...contents,
|
|
557
|
-
};
|
|
558
|
-
return response;
|
|
559
|
-
};
|
|
560
|
-
exports.de_GetCertificateAuthorityCertificateCommand = de_GetCertificateAuthorityCertificateCommand;
|
|
561
|
-
const de_GetCertificateAuthorityCertificateCommandError = async (output, context) => {
|
|
562
|
-
const parsedOutput = {
|
|
563
|
-
...output,
|
|
564
|
-
body: await parseErrorBody(output.body, context),
|
|
565
|
-
};
|
|
566
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
567
|
-
switch (errorCode) {
|
|
568
|
-
case "InvalidArnException":
|
|
569
|
-
case "com.amazonaws.acmpca#InvalidArnException":
|
|
570
|
-
throw await de_InvalidArnExceptionRes(parsedOutput, context);
|
|
571
|
-
case "InvalidStateException":
|
|
572
|
-
case "com.amazonaws.acmpca#InvalidStateException":
|
|
573
|
-
throw await de_InvalidStateExceptionRes(parsedOutput, context);
|
|
574
|
-
case "ResourceNotFoundException":
|
|
575
|
-
case "com.amazonaws.acmpca#ResourceNotFoundException":
|
|
576
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
577
|
-
default:
|
|
578
|
-
const parsedBody = parsedOutput.body;
|
|
579
|
-
return throwDefaultError({
|
|
580
|
-
output,
|
|
581
|
-
parsedBody,
|
|
582
|
-
errorCode,
|
|
583
|
-
});
|
|
584
|
-
}
|
|
585
|
-
};
|
|
586
|
-
const de_GetCertificateAuthorityCsrCommand = async (output, context) => {
|
|
587
|
-
if (output.statusCode >= 300) {
|
|
588
|
-
return de_GetCertificateAuthorityCsrCommandError(output, context);
|
|
589
|
-
}
|
|
590
|
-
const data = await parseBody(output.body, context);
|
|
591
|
-
let contents = {};
|
|
592
|
-
contents = (0, smithy_client_1._json)(data);
|
|
593
|
-
const response = {
|
|
594
|
-
$metadata: deserializeMetadata(output),
|
|
595
|
-
...contents,
|
|
596
|
-
};
|
|
597
|
-
return response;
|
|
598
|
-
};
|
|
599
|
-
exports.de_GetCertificateAuthorityCsrCommand = de_GetCertificateAuthorityCsrCommand;
|
|
600
|
-
const de_GetCertificateAuthorityCsrCommandError = async (output, context) => {
|
|
601
|
-
const parsedOutput = {
|
|
602
|
-
...output,
|
|
603
|
-
body: await parseErrorBody(output.body, context),
|
|
604
|
-
};
|
|
605
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
606
|
-
switch (errorCode) {
|
|
607
|
-
case "InvalidArnException":
|
|
608
|
-
case "com.amazonaws.acmpca#InvalidArnException":
|
|
609
|
-
throw await de_InvalidArnExceptionRes(parsedOutput, context);
|
|
610
|
-
case "InvalidStateException":
|
|
611
|
-
case "com.amazonaws.acmpca#InvalidStateException":
|
|
612
|
-
throw await de_InvalidStateExceptionRes(parsedOutput, context);
|
|
613
|
-
case "RequestFailedException":
|
|
614
|
-
case "com.amazonaws.acmpca#RequestFailedException":
|
|
615
|
-
throw await de_RequestFailedExceptionRes(parsedOutput, context);
|
|
616
|
-
case "RequestInProgressException":
|
|
617
|
-
case "com.amazonaws.acmpca#RequestInProgressException":
|
|
618
|
-
throw await de_RequestInProgressExceptionRes(parsedOutput, context);
|
|
619
|
-
case "ResourceNotFoundException":
|
|
620
|
-
case "com.amazonaws.acmpca#ResourceNotFoundException":
|
|
621
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
622
|
-
default:
|
|
623
|
-
const parsedBody = parsedOutput.body;
|
|
624
|
-
return throwDefaultError({
|
|
625
|
-
output,
|
|
626
|
-
parsedBody,
|
|
627
|
-
errorCode,
|
|
628
|
-
});
|
|
629
|
-
}
|
|
630
|
-
};
|
|
631
|
-
const de_GetPolicyCommand = async (output, context) => {
|
|
632
|
-
if (output.statusCode >= 300) {
|
|
633
|
-
return de_GetPolicyCommandError(output, context);
|
|
634
|
-
}
|
|
635
|
-
const data = await parseBody(output.body, context);
|
|
636
|
-
let contents = {};
|
|
637
|
-
contents = (0, smithy_client_1._json)(data);
|
|
638
|
-
const response = {
|
|
639
|
-
$metadata: deserializeMetadata(output),
|
|
640
|
-
...contents,
|
|
641
|
-
};
|
|
642
|
-
return response;
|
|
643
|
-
};
|
|
644
|
-
exports.de_GetPolicyCommand = de_GetPolicyCommand;
|
|
645
|
-
const de_GetPolicyCommandError = async (output, context) => {
|
|
646
|
-
const parsedOutput = {
|
|
647
|
-
...output,
|
|
648
|
-
body: await parseErrorBody(output.body, context),
|
|
649
|
-
};
|
|
650
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
651
|
-
switch (errorCode) {
|
|
652
|
-
case "InvalidArnException":
|
|
653
|
-
case "com.amazonaws.acmpca#InvalidArnException":
|
|
654
|
-
throw await de_InvalidArnExceptionRes(parsedOutput, context);
|
|
655
|
-
case "InvalidStateException":
|
|
656
|
-
case "com.amazonaws.acmpca#InvalidStateException":
|
|
657
|
-
throw await de_InvalidStateExceptionRes(parsedOutput, context);
|
|
658
|
-
case "RequestFailedException":
|
|
659
|
-
case "com.amazonaws.acmpca#RequestFailedException":
|
|
660
|
-
throw await de_RequestFailedExceptionRes(parsedOutput, context);
|
|
661
|
-
case "ResourceNotFoundException":
|
|
662
|
-
case "com.amazonaws.acmpca#ResourceNotFoundException":
|
|
663
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
664
|
-
default:
|
|
665
|
-
const parsedBody = parsedOutput.body;
|
|
666
|
-
return throwDefaultError({
|
|
667
|
-
output,
|
|
668
|
-
parsedBody,
|
|
669
|
-
errorCode,
|
|
670
|
-
});
|
|
671
|
-
}
|
|
672
|
-
};
|
|
673
|
-
const de_ImportCertificateAuthorityCertificateCommand = async (output, context) => {
|
|
674
|
-
if (output.statusCode >= 300) {
|
|
675
|
-
return de_ImportCertificateAuthorityCertificateCommandError(output, context);
|
|
676
|
-
}
|
|
677
|
-
await (0, smithy_client_1.collectBody)(output.body, context);
|
|
678
|
-
const response = {
|
|
679
|
-
$metadata: deserializeMetadata(output),
|
|
680
|
-
};
|
|
681
|
-
return response;
|
|
682
|
-
};
|
|
683
|
-
exports.de_ImportCertificateAuthorityCertificateCommand = de_ImportCertificateAuthorityCertificateCommand;
|
|
684
|
-
const de_ImportCertificateAuthorityCertificateCommandError = async (output, context) => {
|
|
685
|
-
const parsedOutput = {
|
|
686
|
-
...output,
|
|
687
|
-
body: await parseErrorBody(output.body, context),
|
|
688
|
-
};
|
|
689
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
690
|
-
switch (errorCode) {
|
|
691
|
-
case "CertificateMismatchException":
|
|
692
|
-
case "com.amazonaws.acmpca#CertificateMismatchException":
|
|
693
|
-
throw await de_CertificateMismatchExceptionRes(parsedOutput, context);
|
|
694
|
-
case "ConcurrentModificationException":
|
|
695
|
-
case "com.amazonaws.acmpca#ConcurrentModificationException":
|
|
696
|
-
throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
|
|
697
|
-
case "InvalidArnException":
|
|
698
|
-
case "com.amazonaws.acmpca#InvalidArnException":
|
|
699
|
-
throw await de_InvalidArnExceptionRes(parsedOutput, context);
|
|
700
|
-
case "InvalidRequestException":
|
|
701
|
-
case "com.amazonaws.acmpca#InvalidRequestException":
|
|
702
|
-
throw await de_InvalidRequestExceptionRes(parsedOutput, context);
|
|
703
|
-
case "InvalidStateException":
|
|
704
|
-
case "com.amazonaws.acmpca#InvalidStateException":
|
|
705
|
-
throw await de_InvalidStateExceptionRes(parsedOutput, context);
|
|
706
|
-
case "MalformedCertificateException":
|
|
707
|
-
case "com.amazonaws.acmpca#MalformedCertificateException":
|
|
708
|
-
throw await de_MalformedCertificateExceptionRes(parsedOutput, context);
|
|
709
|
-
case "RequestFailedException":
|
|
710
|
-
case "com.amazonaws.acmpca#RequestFailedException":
|
|
711
|
-
throw await de_RequestFailedExceptionRes(parsedOutput, context);
|
|
712
|
-
case "RequestInProgressException":
|
|
713
|
-
case "com.amazonaws.acmpca#RequestInProgressException":
|
|
714
|
-
throw await de_RequestInProgressExceptionRes(parsedOutput, context);
|
|
715
|
-
case "ResourceNotFoundException":
|
|
716
|
-
case "com.amazonaws.acmpca#ResourceNotFoundException":
|
|
717
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
718
|
-
default:
|
|
719
|
-
const parsedBody = parsedOutput.body;
|
|
720
|
-
return throwDefaultError({
|
|
721
|
-
output,
|
|
722
|
-
parsedBody,
|
|
723
|
-
errorCode,
|
|
724
|
-
});
|
|
725
|
-
}
|
|
726
|
-
};
|
|
727
|
-
const de_IssueCertificateCommand = async (output, context) => {
|
|
728
|
-
if (output.statusCode >= 300) {
|
|
729
|
-
return de_IssueCertificateCommandError(output, context);
|
|
730
|
-
}
|
|
731
|
-
const data = await parseBody(output.body, context);
|
|
732
|
-
let contents = {};
|
|
733
|
-
contents = (0, smithy_client_1._json)(data);
|
|
734
|
-
const response = {
|
|
735
|
-
$metadata: deserializeMetadata(output),
|
|
736
|
-
...contents,
|
|
737
|
-
};
|
|
738
|
-
return response;
|
|
739
|
-
};
|
|
740
|
-
exports.de_IssueCertificateCommand = de_IssueCertificateCommand;
|
|
741
|
-
const de_IssueCertificateCommandError = async (output, context) => {
|
|
742
|
-
const parsedOutput = {
|
|
743
|
-
...output,
|
|
744
|
-
body: await parseErrorBody(output.body, context),
|
|
745
|
-
};
|
|
746
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
747
|
-
switch (errorCode) {
|
|
748
|
-
case "InvalidArgsException":
|
|
749
|
-
case "com.amazonaws.acmpca#InvalidArgsException":
|
|
750
|
-
throw await de_InvalidArgsExceptionRes(parsedOutput, context);
|
|
751
|
-
case "InvalidArnException":
|
|
752
|
-
case "com.amazonaws.acmpca#InvalidArnException":
|
|
753
|
-
throw await de_InvalidArnExceptionRes(parsedOutput, context);
|
|
754
|
-
case "InvalidStateException":
|
|
755
|
-
case "com.amazonaws.acmpca#InvalidStateException":
|
|
756
|
-
throw await de_InvalidStateExceptionRes(parsedOutput, context);
|
|
757
|
-
case "LimitExceededException":
|
|
758
|
-
case "com.amazonaws.acmpca#LimitExceededException":
|
|
759
|
-
throw await de_LimitExceededExceptionRes(parsedOutput, context);
|
|
760
|
-
case "MalformedCSRException":
|
|
761
|
-
case "com.amazonaws.acmpca#MalformedCSRException":
|
|
762
|
-
throw await de_MalformedCSRExceptionRes(parsedOutput, context);
|
|
763
|
-
case "ResourceNotFoundException":
|
|
764
|
-
case "com.amazonaws.acmpca#ResourceNotFoundException":
|
|
765
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
766
|
-
default:
|
|
767
|
-
const parsedBody = parsedOutput.body;
|
|
768
|
-
return throwDefaultError({
|
|
769
|
-
output,
|
|
770
|
-
parsedBody,
|
|
771
|
-
errorCode,
|
|
772
|
-
});
|
|
773
|
-
}
|
|
774
|
-
};
|
|
775
|
-
const de_ListCertificateAuthoritiesCommand = async (output, context) => {
|
|
776
|
-
if (output.statusCode >= 300) {
|
|
777
|
-
return de_ListCertificateAuthoritiesCommandError(output, context);
|
|
778
|
-
}
|
|
779
|
-
const data = await parseBody(output.body, context);
|
|
780
|
-
let contents = {};
|
|
781
|
-
contents = de_ListCertificateAuthoritiesResponse(data, context);
|
|
782
|
-
const response = {
|
|
783
|
-
$metadata: deserializeMetadata(output),
|
|
784
|
-
...contents,
|
|
785
|
-
};
|
|
786
|
-
return response;
|
|
787
|
-
};
|
|
788
|
-
exports.de_ListCertificateAuthoritiesCommand = de_ListCertificateAuthoritiesCommand;
|
|
789
|
-
const de_ListCertificateAuthoritiesCommandError = async (output, context) => {
|
|
790
|
-
const parsedOutput = {
|
|
791
|
-
...output,
|
|
792
|
-
body: await parseErrorBody(output.body, context),
|
|
793
|
-
};
|
|
794
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
795
|
-
switch (errorCode) {
|
|
796
|
-
case "InvalidNextTokenException":
|
|
797
|
-
case "com.amazonaws.acmpca#InvalidNextTokenException":
|
|
798
|
-
throw await de_InvalidNextTokenExceptionRes(parsedOutput, context);
|
|
799
|
-
default:
|
|
800
|
-
const parsedBody = parsedOutput.body;
|
|
801
|
-
return throwDefaultError({
|
|
802
|
-
output,
|
|
803
|
-
parsedBody,
|
|
804
|
-
errorCode,
|
|
805
|
-
});
|
|
806
|
-
}
|
|
807
|
-
};
|
|
808
|
-
const de_ListPermissionsCommand = async (output, context) => {
|
|
809
|
-
if (output.statusCode >= 300) {
|
|
810
|
-
return de_ListPermissionsCommandError(output, context);
|
|
811
|
-
}
|
|
812
|
-
const data = await parseBody(output.body, context);
|
|
813
|
-
let contents = {};
|
|
814
|
-
contents = de_ListPermissionsResponse(data, context);
|
|
815
|
-
const response = {
|
|
816
|
-
$metadata: deserializeMetadata(output),
|
|
817
|
-
...contents,
|
|
818
|
-
};
|
|
819
|
-
return response;
|
|
820
|
-
};
|
|
821
|
-
exports.de_ListPermissionsCommand = de_ListPermissionsCommand;
|
|
822
|
-
const de_ListPermissionsCommandError = async (output, context) => {
|
|
823
|
-
const parsedOutput = {
|
|
824
|
-
...output,
|
|
825
|
-
body: await parseErrorBody(output.body, context),
|
|
826
|
-
};
|
|
827
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
828
|
-
switch (errorCode) {
|
|
829
|
-
case "InvalidArnException":
|
|
830
|
-
case "com.amazonaws.acmpca#InvalidArnException":
|
|
831
|
-
throw await de_InvalidArnExceptionRes(parsedOutput, context);
|
|
832
|
-
case "InvalidNextTokenException":
|
|
833
|
-
case "com.amazonaws.acmpca#InvalidNextTokenException":
|
|
834
|
-
throw await de_InvalidNextTokenExceptionRes(parsedOutput, context);
|
|
835
|
-
case "InvalidStateException":
|
|
836
|
-
case "com.amazonaws.acmpca#InvalidStateException":
|
|
837
|
-
throw await de_InvalidStateExceptionRes(parsedOutput, context);
|
|
838
|
-
case "RequestFailedException":
|
|
839
|
-
case "com.amazonaws.acmpca#RequestFailedException":
|
|
840
|
-
throw await de_RequestFailedExceptionRes(parsedOutput, context);
|
|
841
|
-
case "ResourceNotFoundException":
|
|
842
|
-
case "com.amazonaws.acmpca#ResourceNotFoundException":
|
|
843
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
844
|
-
default:
|
|
845
|
-
const parsedBody = parsedOutput.body;
|
|
846
|
-
return throwDefaultError({
|
|
847
|
-
output,
|
|
848
|
-
parsedBody,
|
|
849
|
-
errorCode,
|
|
850
|
-
});
|
|
851
|
-
}
|
|
852
|
-
};
|
|
853
|
-
const de_ListTagsCommand = async (output, context) => {
|
|
854
|
-
if (output.statusCode >= 300) {
|
|
855
|
-
return de_ListTagsCommandError(output, context);
|
|
856
|
-
}
|
|
857
|
-
const data = await parseBody(output.body, context);
|
|
858
|
-
let contents = {};
|
|
859
|
-
contents = (0, smithy_client_1._json)(data);
|
|
860
|
-
const response = {
|
|
861
|
-
$metadata: deserializeMetadata(output),
|
|
862
|
-
...contents,
|
|
863
|
-
};
|
|
864
|
-
return response;
|
|
865
|
-
};
|
|
866
|
-
exports.de_ListTagsCommand = de_ListTagsCommand;
|
|
867
|
-
const de_ListTagsCommandError = async (output, context) => {
|
|
868
|
-
const parsedOutput = {
|
|
869
|
-
...output,
|
|
870
|
-
body: await parseErrorBody(output.body, context),
|
|
871
|
-
};
|
|
872
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
873
|
-
switch (errorCode) {
|
|
874
|
-
case "InvalidArnException":
|
|
875
|
-
case "com.amazonaws.acmpca#InvalidArnException":
|
|
876
|
-
throw await de_InvalidArnExceptionRes(parsedOutput, context);
|
|
877
|
-
case "InvalidStateException":
|
|
878
|
-
case "com.amazonaws.acmpca#InvalidStateException":
|
|
879
|
-
throw await de_InvalidStateExceptionRes(parsedOutput, context);
|
|
880
|
-
case "ResourceNotFoundException":
|
|
881
|
-
case "com.amazonaws.acmpca#ResourceNotFoundException":
|
|
882
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
883
|
-
default:
|
|
884
|
-
const parsedBody = parsedOutput.body;
|
|
885
|
-
return throwDefaultError({
|
|
886
|
-
output,
|
|
887
|
-
parsedBody,
|
|
888
|
-
errorCode,
|
|
889
|
-
});
|
|
890
|
-
}
|
|
891
|
-
};
|
|
892
|
-
const de_PutPolicyCommand = async (output, context) => {
|
|
893
|
-
if (output.statusCode >= 300) {
|
|
894
|
-
return de_PutPolicyCommandError(output, context);
|
|
895
|
-
}
|
|
896
|
-
await (0, smithy_client_1.collectBody)(output.body, context);
|
|
897
|
-
const response = {
|
|
898
|
-
$metadata: deserializeMetadata(output),
|
|
899
|
-
};
|
|
900
|
-
return response;
|
|
901
|
-
};
|
|
902
|
-
exports.de_PutPolicyCommand = de_PutPolicyCommand;
|
|
903
|
-
const de_PutPolicyCommandError = async (output, context) => {
|
|
904
|
-
const parsedOutput = {
|
|
905
|
-
...output,
|
|
906
|
-
body: await parseErrorBody(output.body, context),
|
|
907
|
-
};
|
|
908
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
909
|
-
switch (errorCode) {
|
|
910
|
-
case "ConcurrentModificationException":
|
|
911
|
-
case "com.amazonaws.acmpca#ConcurrentModificationException":
|
|
912
|
-
throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
|
|
913
|
-
case "InvalidArnException":
|
|
914
|
-
case "com.amazonaws.acmpca#InvalidArnException":
|
|
915
|
-
throw await de_InvalidArnExceptionRes(parsedOutput, context);
|
|
916
|
-
case "InvalidPolicyException":
|
|
917
|
-
case "com.amazonaws.acmpca#InvalidPolicyException":
|
|
918
|
-
throw await de_InvalidPolicyExceptionRes(parsedOutput, context);
|
|
919
|
-
case "InvalidStateException":
|
|
920
|
-
case "com.amazonaws.acmpca#InvalidStateException":
|
|
921
|
-
throw await de_InvalidStateExceptionRes(parsedOutput, context);
|
|
922
|
-
case "LockoutPreventedException":
|
|
923
|
-
case "com.amazonaws.acmpca#LockoutPreventedException":
|
|
924
|
-
throw await de_LockoutPreventedExceptionRes(parsedOutput, context);
|
|
925
|
-
case "RequestFailedException":
|
|
926
|
-
case "com.amazonaws.acmpca#RequestFailedException":
|
|
927
|
-
throw await de_RequestFailedExceptionRes(parsedOutput, context);
|
|
928
|
-
case "ResourceNotFoundException":
|
|
929
|
-
case "com.amazonaws.acmpca#ResourceNotFoundException":
|
|
930
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
931
|
-
default:
|
|
932
|
-
const parsedBody = parsedOutput.body;
|
|
933
|
-
return throwDefaultError({
|
|
934
|
-
output,
|
|
935
|
-
parsedBody,
|
|
936
|
-
errorCode,
|
|
937
|
-
});
|
|
938
|
-
}
|
|
939
|
-
};
|
|
940
|
-
const de_RestoreCertificateAuthorityCommand = async (output, context) => {
|
|
941
|
-
if (output.statusCode >= 300) {
|
|
942
|
-
return de_RestoreCertificateAuthorityCommandError(output, context);
|
|
943
|
-
}
|
|
944
|
-
await (0, smithy_client_1.collectBody)(output.body, context);
|
|
945
|
-
const response = {
|
|
946
|
-
$metadata: deserializeMetadata(output),
|
|
947
|
-
};
|
|
948
|
-
return response;
|
|
949
|
-
};
|
|
950
|
-
exports.de_RestoreCertificateAuthorityCommand = de_RestoreCertificateAuthorityCommand;
|
|
951
|
-
const de_RestoreCertificateAuthorityCommandError = async (output, context) => {
|
|
952
|
-
const parsedOutput = {
|
|
953
|
-
...output,
|
|
954
|
-
body: await parseErrorBody(output.body, context),
|
|
955
|
-
};
|
|
956
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
957
|
-
switch (errorCode) {
|
|
958
|
-
case "InvalidArnException":
|
|
959
|
-
case "com.amazonaws.acmpca#InvalidArnException":
|
|
960
|
-
throw await de_InvalidArnExceptionRes(parsedOutput, context);
|
|
961
|
-
case "InvalidStateException":
|
|
962
|
-
case "com.amazonaws.acmpca#InvalidStateException":
|
|
963
|
-
throw await de_InvalidStateExceptionRes(parsedOutput, context);
|
|
964
|
-
case "ResourceNotFoundException":
|
|
965
|
-
case "com.amazonaws.acmpca#ResourceNotFoundException":
|
|
966
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
967
|
-
default:
|
|
968
|
-
const parsedBody = parsedOutput.body;
|
|
969
|
-
return throwDefaultError({
|
|
970
|
-
output,
|
|
971
|
-
parsedBody,
|
|
972
|
-
errorCode,
|
|
973
|
-
});
|
|
974
|
-
}
|
|
975
|
-
};
|
|
976
|
-
const de_RevokeCertificateCommand = async (output, context) => {
|
|
977
|
-
if (output.statusCode >= 300) {
|
|
978
|
-
return de_RevokeCertificateCommandError(output, context);
|
|
979
|
-
}
|
|
980
|
-
await (0, smithy_client_1.collectBody)(output.body, context);
|
|
981
|
-
const response = {
|
|
982
|
-
$metadata: deserializeMetadata(output),
|
|
983
|
-
};
|
|
984
|
-
return response;
|
|
985
|
-
};
|
|
986
|
-
exports.de_RevokeCertificateCommand = de_RevokeCertificateCommand;
|
|
987
|
-
const de_RevokeCertificateCommandError = async (output, context) => {
|
|
988
|
-
const parsedOutput = {
|
|
989
|
-
...output,
|
|
990
|
-
body: await parseErrorBody(output.body, context),
|
|
991
|
-
};
|
|
992
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
993
|
-
switch (errorCode) {
|
|
994
|
-
case "ConcurrentModificationException":
|
|
995
|
-
case "com.amazonaws.acmpca#ConcurrentModificationException":
|
|
996
|
-
throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
|
|
997
|
-
case "InvalidArnException":
|
|
998
|
-
case "com.amazonaws.acmpca#InvalidArnException":
|
|
999
|
-
throw await de_InvalidArnExceptionRes(parsedOutput, context);
|
|
1000
|
-
case "InvalidRequestException":
|
|
1001
|
-
case "com.amazonaws.acmpca#InvalidRequestException":
|
|
1002
|
-
throw await de_InvalidRequestExceptionRes(parsedOutput, context);
|
|
1003
|
-
case "InvalidStateException":
|
|
1004
|
-
case "com.amazonaws.acmpca#InvalidStateException":
|
|
1005
|
-
throw await de_InvalidStateExceptionRes(parsedOutput, context);
|
|
1006
|
-
case "LimitExceededException":
|
|
1007
|
-
case "com.amazonaws.acmpca#LimitExceededException":
|
|
1008
|
-
throw await de_LimitExceededExceptionRes(parsedOutput, context);
|
|
1009
|
-
case "RequestAlreadyProcessedException":
|
|
1010
|
-
case "com.amazonaws.acmpca#RequestAlreadyProcessedException":
|
|
1011
|
-
throw await de_RequestAlreadyProcessedExceptionRes(parsedOutput, context);
|
|
1012
|
-
case "RequestFailedException":
|
|
1013
|
-
case "com.amazonaws.acmpca#RequestFailedException":
|
|
1014
|
-
throw await de_RequestFailedExceptionRes(parsedOutput, context);
|
|
1015
|
-
case "RequestInProgressException":
|
|
1016
|
-
case "com.amazonaws.acmpca#RequestInProgressException":
|
|
1017
|
-
throw await de_RequestInProgressExceptionRes(parsedOutput, context);
|
|
1018
|
-
case "ResourceNotFoundException":
|
|
1019
|
-
case "com.amazonaws.acmpca#ResourceNotFoundException":
|
|
1020
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1021
|
-
default:
|
|
1022
|
-
const parsedBody = parsedOutput.body;
|
|
1023
|
-
return throwDefaultError({
|
|
1024
|
-
output,
|
|
1025
|
-
parsedBody,
|
|
1026
|
-
errorCode,
|
|
1027
|
-
});
|
|
1028
|
-
}
|
|
1029
|
-
};
|
|
1030
|
-
const de_TagCertificateAuthorityCommand = async (output, context) => {
|
|
1031
|
-
if (output.statusCode >= 300) {
|
|
1032
|
-
return de_TagCertificateAuthorityCommandError(output, context);
|
|
1033
|
-
}
|
|
1034
|
-
await (0, smithy_client_1.collectBody)(output.body, context);
|
|
1035
|
-
const response = {
|
|
1036
|
-
$metadata: deserializeMetadata(output),
|
|
1037
|
-
};
|
|
1038
|
-
return response;
|
|
1039
|
-
};
|
|
1040
|
-
exports.de_TagCertificateAuthorityCommand = de_TagCertificateAuthorityCommand;
|
|
1041
|
-
const de_TagCertificateAuthorityCommandError = async (output, context) => {
|
|
1042
|
-
const parsedOutput = {
|
|
1043
|
-
...output,
|
|
1044
|
-
body: await parseErrorBody(output.body, context),
|
|
1045
|
-
};
|
|
1046
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1047
|
-
switch (errorCode) {
|
|
1048
|
-
case "InvalidArnException":
|
|
1049
|
-
case "com.amazonaws.acmpca#InvalidArnException":
|
|
1050
|
-
throw await de_InvalidArnExceptionRes(parsedOutput, context);
|
|
1051
|
-
case "InvalidStateException":
|
|
1052
|
-
case "com.amazonaws.acmpca#InvalidStateException":
|
|
1053
|
-
throw await de_InvalidStateExceptionRes(parsedOutput, context);
|
|
1054
|
-
case "InvalidTagException":
|
|
1055
|
-
case "com.amazonaws.acmpca#InvalidTagException":
|
|
1056
|
-
throw await de_InvalidTagExceptionRes(parsedOutput, context);
|
|
1057
|
-
case "ResourceNotFoundException":
|
|
1058
|
-
case "com.amazonaws.acmpca#ResourceNotFoundException":
|
|
1059
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1060
|
-
case "TooManyTagsException":
|
|
1061
|
-
case "com.amazonaws.acmpca#TooManyTagsException":
|
|
1062
|
-
throw await de_TooManyTagsExceptionRes(parsedOutput, context);
|
|
1063
|
-
default:
|
|
1064
|
-
const parsedBody = parsedOutput.body;
|
|
1065
|
-
return throwDefaultError({
|
|
1066
|
-
output,
|
|
1067
|
-
parsedBody,
|
|
1068
|
-
errorCode,
|
|
1069
|
-
});
|
|
1070
|
-
}
|
|
1071
|
-
};
|
|
1072
|
-
const de_UntagCertificateAuthorityCommand = async (output, context) => {
|
|
1073
|
-
if (output.statusCode >= 300) {
|
|
1074
|
-
return de_UntagCertificateAuthorityCommandError(output, context);
|
|
1075
|
-
}
|
|
1076
|
-
await (0, smithy_client_1.collectBody)(output.body, context);
|
|
1077
|
-
const response = {
|
|
1078
|
-
$metadata: deserializeMetadata(output),
|
|
1079
|
-
};
|
|
1080
|
-
return response;
|
|
1081
|
-
};
|
|
1082
|
-
exports.de_UntagCertificateAuthorityCommand = de_UntagCertificateAuthorityCommand;
|
|
1083
|
-
const de_UntagCertificateAuthorityCommandError = async (output, context) => {
|
|
1084
|
-
const parsedOutput = {
|
|
1085
|
-
...output,
|
|
1086
|
-
body: await parseErrorBody(output.body, context),
|
|
1087
|
-
};
|
|
1088
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1089
|
-
switch (errorCode) {
|
|
1090
|
-
case "InvalidArnException":
|
|
1091
|
-
case "com.amazonaws.acmpca#InvalidArnException":
|
|
1092
|
-
throw await de_InvalidArnExceptionRes(parsedOutput, context);
|
|
1093
|
-
case "InvalidStateException":
|
|
1094
|
-
case "com.amazonaws.acmpca#InvalidStateException":
|
|
1095
|
-
throw await de_InvalidStateExceptionRes(parsedOutput, context);
|
|
1096
|
-
case "InvalidTagException":
|
|
1097
|
-
case "com.amazonaws.acmpca#InvalidTagException":
|
|
1098
|
-
throw await de_InvalidTagExceptionRes(parsedOutput, context);
|
|
1099
|
-
case "ResourceNotFoundException":
|
|
1100
|
-
case "com.amazonaws.acmpca#ResourceNotFoundException":
|
|
1101
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1102
|
-
default:
|
|
1103
|
-
const parsedBody = parsedOutput.body;
|
|
1104
|
-
return throwDefaultError({
|
|
1105
|
-
output,
|
|
1106
|
-
parsedBody,
|
|
1107
|
-
errorCode,
|
|
1108
|
-
});
|
|
1109
|
-
}
|
|
1110
|
-
};
|
|
1111
|
-
const de_UpdateCertificateAuthorityCommand = async (output, context) => {
|
|
1112
|
-
if (output.statusCode >= 300) {
|
|
1113
|
-
return de_UpdateCertificateAuthorityCommandError(output, context);
|
|
1114
|
-
}
|
|
1115
|
-
await (0, smithy_client_1.collectBody)(output.body, context);
|
|
1116
|
-
const response = {
|
|
1117
|
-
$metadata: deserializeMetadata(output),
|
|
1118
|
-
};
|
|
1119
|
-
return response;
|
|
1120
|
-
};
|
|
1121
|
-
exports.de_UpdateCertificateAuthorityCommand = de_UpdateCertificateAuthorityCommand;
|
|
1122
|
-
const de_UpdateCertificateAuthorityCommandError = async (output, context) => {
|
|
1123
|
-
const parsedOutput = {
|
|
1124
|
-
...output,
|
|
1125
|
-
body: await parseErrorBody(output.body, context),
|
|
1126
|
-
};
|
|
1127
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1128
|
-
switch (errorCode) {
|
|
1129
|
-
case "ConcurrentModificationException":
|
|
1130
|
-
case "com.amazonaws.acmpca#ConcurrentModificationException":
|
|
1131
|
-
throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
|
|
1132
|
-
case "InvalidArgsException":
|
|
1133
|
-
case "com.amazonaws.acmpca#InvalidArgsException":
|
|
1134
|
-
throw await de_InvalidArgsExceptionRes(parsedOutput, context);
|
|
1135
|
-
case "InvalidArnException":
|
|
1136
|
-
case "com.amazonaws.acmpca#InvalidArnException":
|
|
1137
|
-
throw await de_InvalidArnExceptionRes(parsedOutput, context);
|
|
1138
|
-
case "InvalidPolicyException":
|
|
1139
|
-
case "com.amazonaws.acmpca#InvalidPolicyException":
|
|
1140
|
-
throw await de_InvalidPolicyExceptionRes(parsedOutput, context);
|
|
1141
|
-
case "InvalidStateException":
|
|
1142
|
-
case "com.amazonaws.acmpca#InvalidStateException":
|
|
1143
|
-
throw await de_InvalidStateExceptionRes(parsedOutput, context);
|
|
1144
|
-
case "ResourceNotFoundException":
|
|
1145
|
-
case "com.amazonaws.acmpca#ResourceNotFoundException":
|
|
1146
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1147
|
-
default:
|
|
1148
|
-
const parsedBody = parsedOutput.body;
|
|
1149
|
-
return throwDefaultError({
|
|
1150
|
-
output,
|
|
1151
|
-
parsedBody,
|
|
1152
|
-
errorCode,
|
|
1153
|
-
});
|
|
1154
|
-
}
|
|
1155
|
-
};
|
|
1156
|
-
const de_CertificateMismatchExceptionRes = async (parsedOutput, context) => {
|
|
1157
|
-
const body = parsedOutput.body;
|
|
1158
|
-
const deserialized = (0, smithy_client_1._json)(body);
|
|
1159
|
-
const exception = new models_0_1.CertificateMismatchException({
|
|
1160
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1161
|
-
...deserialized,
|
|
1162
|
-
});
|
|
1163
|
-
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
1164
|
-
};
|
|
1165
|
-
const de_ConcurrentModificationExceptionRes = async (parsedOutput, context) => {
|
|
1166
|
-
const body = parsedOutput.body;
|
|
1167
|
-
const deserialized = (0, smithy_client_1._json)(body);
|
|
1168
|
-
const exception = new models_0_1.ConcurrentModificationException({
|
|
1169
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1170
|
-
...deserialized,
|
|
1171
|
-
});
|
|
1172
|
-
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
1173
|
-
};
|
|
1174
|
-
const de_InvalidArgsExceptionRes = async (parsedOutput, context) => {
|
|
1175
|
-
const body = parsedOutput.body;
|
|
1176
|
-
const deserialized = (0, smithy_client_1._json)(body);
|
|
1177
|
-
const exception = new models_0_1.InvalidArgsException({
|
|
1178
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1179
|
-
...deserialized,
|
|
1180
|
-
});
|
|
1181
|
-
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
1182
|
-
};
|
|
1183
|
-
const de_InvalidArnExceptionRes = async (parsedOutput, context) => {
|
|
1184
|
-
const body = parsedOutput.body;
|
|
1185
|
-
const deserialized = (0, smithy_client_1._json)(body);
|
|
1186
|
-
const exception = new models_0_1.InvalidArnException({
|
|
1187
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1188
|
-
...deserialized,
|
|
1189
|
-
});
|
|
1190
|
-
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
1191
|
-
};
|
|
1192
|
-
const de_InvalidNextTokenExceptionRes = async (parsedOutput, context) => {
|
|
1193
|
-
const body = parsedOutput.body;
|
|
1194
|
-
const deserialized = (0, smithy_client_1._json)(body);
|
|
1195
|
-
const exception = new models_0_1.InvalidNextTokenException({
|
|
1196
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1197
|
-
...deserialized,
|
|
1198
|
-
});
|
|
1199
|
-
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
1200
|
-
};
|
|
1201
|
-
const de_InvalidPolicyExceptionRes = async (parsedOutput, context) => {
|
|
1202
|
-
const body = parsedOutput.body;
|
|
1203
|
-
const deserialized = (0, smithy_client_1._json)(body);
|
|
1204
|
-
const exception = new models_0_1.InvalidPolicyException({
|
|
1205
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1206
|
-
...deserialized,
|
|
1207
|
-
});
|
|
1208
|
-
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
1209
|
-
};
|
|
1210
|
-
const de_InvalidRequestExceptionRes = async (parsedOutput, context) => {
|
|
1211
|
-
const body = parsedOutput.body;
|
|
1212
|
-
const deserialized = (0, smithy_client_1._json)(body);
|
|
1213
|
-
const exception = new models_0_1.InvalidRequestException({
|
|
1214
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1215
|
-
...deserialized,
|
|
1216
|
-
});
|
|
1217
|
-
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
1218
|
-
};
|
|
1219
|
-
const de_InvalidStateExceptionRes = async (parsedOutput, context) => {
|
|
1220
|
-
const body = parsedOutput.body;
|
|
1221
|
-
const deserialized = (0, smithy_client_1._json)(body);
|
|
1222
|
-
const exception = new models_0_1.InvalidStateException({
|
|
1223
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1224
|
-
...deserialized,
|
|
1225
|
-
});
|
|
1226
|
-
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
1227
|
-
};
|
|
1228
|
-
const de_InvalidTagExceptionRes = async (parsedOutput, context) => {
|
|
1229
|
-
const body = parsedOutput.body;
|
|
1230
|
-
const deserialized = (0, smithy_client_1._json)(body);
|
|
1231
|
-
const exception = new models_0_1.InvalidTagException({
|
|
1232
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1233
|
-
...deserialized,
|
|
1234
|
-
});
|
|
1235
|
-
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
1236
|
-
};
|
|
1237
|
-
const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
|
|
1238
|
-
const body = parsedOutput.body;
|
|
1239
|
-
const deserialized = (0, smithy_client_1._json)(body);
|
|
1240
|
-
const exception = new models_0_1.LimitExceededException({
|
|
1241
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1242
|
-
...deserialized,
|
|
1243
|
-
});
|
|
1244
|
-
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
1245
|
-
};
|
|
1246
|
-
const de_LockoutPreventedExceptionRes = async (parsedOutput, context) => {
|
|
1247
|
-
const body = parsedOutput.body;
|
|
1248
|
-
const deserialized = (0, smithy_client_1._json)(body);
|
|
1249
|
-
const exception = new models_0_1.LockoutPreventedException({
|
|
1250
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1251
|
-
...deserialized,
|
|
1252
|
-
});
|
|
1253
|
-
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
1254
|
-
};
|
|
1255
|
-
const de_MalformedCertificateExceptionRes = async (parsedOutput, context) => {
|
|
1256
|
-
const body = parsedOutput.body;
|
|
1257
|
-
const deserialized = (0, smithy_client_1._json)(body);
|
|
1258
|
-
const exception = new models_0_1.MalformedCertificateException({
|
|
1259
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1260
|
-
...deserialized,
|
|
1261
|
-
});
|
|
1262
|
-
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
1263
|
-
};
|
|
1264
|
-
const de_MalformedCSRExceptionRes = async (parsedOutput, context) => {
|
|
1265
|
-
const body = parsedOutput.body;
|
|
1266
|
-
const deserialized = (0, smithy_client_1._json)(body);
|
|
1267
|
-
const exception = new models_0_1.MalformedCSRException({
|
|
1268
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1269
|
-
...deserialized,
|
|
1270
|
-
});
|
|
1271
|
-
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
1272
|
-
};
|
|
1273
|
-
const de_PermissionAlreadyExistsExceptionRes = async (parsedOutput, context) => {
|
|
1274
|
-
const body = parsedOutput.body;
|
|
1275
|
-
const deserialized = (0, smithy_client_1._json)(body);
|
|
1276
|
-
const exception = new models_0_1.PermissionAlreadyExistsException({
|
|
1277
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1278
|
-
...deserialized,
|
|
1279
|
-
});
|
|
1280
|
-
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
1281
|
-
};
|
|
1282
|
-
const de_RequestAlreadyProcessedExceptionRes = async (parsedOutput, context) => {
|
|
1283
|
-
const body = parsedOutput.body;
|
|
1284
|
-
const deserialized = (0, smithy_client_1._json)(body);
|
|
1285
|
-
const exception = new models_0_1.RequestAlreadyProcessedException({
|
|
1286
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1287
|
-
...deserialized,
|
|
1288
|
-
});
|
|
1289
|
-
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
1290
|
-
};
|
|
1291
|
-
const de_RequestFailedExceptionRes = async (parsedOutput, context) => {
|
|
1292
|
-
const body = parsedOutput.body;
|
|
1293
|
-
const deserialized = (0, smithy_client_1._json)(body);
|
|
1294
|
-
const exception = new models_0_1.RequestFailedException({
|
|
1295
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1296
|
-
...deserialized,
|
|
1297
|
-
});
|
|
1298
|
-
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
1299
|
-
};
|
|
1300
|
-
const de_RequestInProgressExceptionRes = async (parsedOutput, context) => {
|
|
1301
|
-
const body = parsedOutput.body;
|
|
1302
|
-
const deserialized = (0, smithy_client_1._json)(body);
|
|
1303
|
-
const exception = new models_0_1.RequestInProgressException({
|
|
1304
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1305
|
-
...deserialized,
|
|
1306
|
-
});
|
|
1307
|
-
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
1308
|
-
};
|
|
1309
|
-
const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
1310
|
-
const body = parsedOutput.body;
|
|
1311
|
-
const deserialized = (0, smithy_client_1._json)(body);
|
|
1312
|
-
const exception = new models_0_1.ResourceNotFoundException({
|
|
1313
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1314
|
-
...deserialized,
|
|
1315
|
-
});
|
|
1316
|
-
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
1317
|
-
};
|
|
1318
|
-
const de_TooManyTagsExceptionRes = async (parsedOutput, context) => {
|
|
1319
|
-
const body = parsedOutput.body;
|
|
1320
|
-
const deserialized = (0, smithy_client_1._json)(body);
|
|
1321
|
-
const exception = new models_0_1.TooManyTagsException({
|
|
1322
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1323
|
-
...deserialized,
|
|
1324
|
-
});
|
|
1325
|
-
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
1326
|
-
};
|
|
1327
|
-
const se_ImportCertificateAuthorityCertificateRequest = (input, context) => {
|
|
1328
|
-
return (0, smithy_client_1.take)(input, {
|
|
1329
|
-
Certificate: context.base64Encoder,
|
|
1330
|
-
CertificateAuthorityArn: [],
|
|
1331
|
-
CertificateChain: context.base64Encoder,
|
|
1332
|
-
});
|
|
1333
|
-
};
|
|
1334
|
-
const se_IssueCertificateRequest = (input, context) => {
|
|
1335
|
-
return (0, smithy_client_1.take)(input, {
|
|
1336
|
-
ApiPassthrough: smithy_client_1._json,
|
|
1337
|
-
CertificateAuthorityArn: [],
|
|
1338
|
-
Csr: context.base64Encoder,
|
|
1339
|
-
IdempotencyToken: [],
|
|
1340
|
-
SigningAlgorithm: [],
|
|
1341
|
-
TemplateArn: [],
|
|
1342
|
-
Validity: smithy_client_1._json,
|
|
1343
|
-
ValidityNotBefore: smithy_client_1._json,
|
|
1344
|
-
});
|
|
1345
|
-
};
|
|
1346
|
-
const de_CertificateAuthorities = (output, context) => {
|
|
1347
|
-
const retVal = (output || [])
|
|
1348
|
-
.filter((e) => e != null)
|
|
1349
|
-
.map((entry) => {
|
|
1350
|
-
return de_CertificateAuthority(entry, context);
|
|
1351
|
-
});
|
|
1352
|
-
return retVal;
|
|
1353
|
-
};
|
|
1354
|
-
const de_CertificateAuthority = (output, context) => {
|
|
1355
|
-
return (0, smithy_client_1.take)(output, {
|
|
1356
|
-
Arn: smithy_client_1.expectString,
|
|
1357
|
-
CertificateAuthorityConfiguration: smithy_client_1._json,
|
|
1358
|
-
CreatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
1359
|
-
FailureReason: smithy_client_1.expectString,
|
|
1360
|
-
KeyStorageSecurityStandard: smithy_client_1.expectString,
|
|
1361
|
-
LastStateChangeAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
1362
|
-
NotAfter: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
1363
|
-
NotBefore: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
1364
|
-
OwnerAccount: smithy_client_1.expectString,
|
|
1365
|
-
RestorableUntil: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
1366
|
-
RevocationConfiguration: smithy_client_1._json,
|
|
1367
|
-
Serial: smithy_client_1.expectString,
|
|
1368
|
-
Status: smithy_client_1.expectString,
|
|
1369
|
-
Type: smithy_client_1.expectString,
|
|
1370
|
-
UsageMode: smithy_client_1.expectString,
|
|
1371
|
-
});
|
|
1372
|
-
};
|
|
1373
|
-
const de_DescribeCertificateAuthorityAuditReportResponse = (output, context) => {
|
|
1374
|
-
return (0, smithy_client_1.take)(output, {
|
|
1375
|
-
AuditReportStatus: smithy_client_1.expectString,
|
|
1376
|
-
CreatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
1377
|
-
S3BucketName: smithy_client_1.expectString,
|
|
1378
|
-
S3Key: smithy_client_1.expectString,
|
|
1379
|
-
});
|
|
1380
|
-
};
|
|
1381
|
-
const de_DescribeCertificateAuthorityResponse = (output, context) => {
|
|
1382
|
-
return (0, smithy_client_1.take)(output, {
|
|
1383
|
-
CertificateAuthority: (_) => de_CertificateAuthority(_, context),
|
|
1384
|
-
});
|
|
1385
|
-
};
|
|
1386
|
-
const de_ListCertificateAuthoritiesResponse = (output, context) => {
|
|
1387
|
-
return (0, smithy_client_1.take)(output, {
|
|
1388
|
-
CertificateAuthorities: (_) => de_CertificateAuthorities(_, context),
|
|
1389
|
-
NextToken: smithy_client_1.expectString,
|
|
1390
|
-
});
|
|
1391
|
-
};
|
|
1392
|
-
const de_ListPermissionsResponse = (output, context) => {
|
|
1393
|
-
return (0, smithy_client_1.take)(output, {
|
|
1394
|
-
NextToken: smithy_client_1.expectString,
|
|
1395
|
-
Permissions: (_) => de_PermissionList(_, context),
|
|
1396
|
-
});
|
|
1397
|
-
};
|
|
1398
|
-
const de_Permission = (output, context) => {
|
|
1399
|
-
return (0, smithy_client_1.take)(output, {
|
|
1400
|
-
Actions: smithy_client_1._json,
|
|
1401
|
-
CertificateAuthorityArn: smithy_client_1.expectString,
|
|
1402
|
-
CreatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
1403
|
-
Policy: smithy_client_1.expectString,
|
|
1404
|
-
Principal: smithy_client_1.expectString,
|
|
1405
|
-
SourceAccount: smithy_client_1.expectString,
|
|
1406
|
-
});
|
|
1407
|
-
};
|
|
1408
|
-
const de_PermissionList = (output, context) => {
|
|
1409
|
-
const retVal = (output || [])
|
|
1410
|
-
.filter((e) => e != null)
|
|
1411
|
-
.map((entry) => {
|
|
1412
|
-
return de_Permission(entry, context);
|
|
1413
|
-
});
|
|
1414
|
-
return retVal;
|
|
1415
|
-
};
|
|
1416
|
-
const deserializeMetadata = (output) => ({
|
|
1417
|
-
httpStatusCode: output.statusCode,
|
|
1418
|
-
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
1419
|
-
extendedRequestId: output.headers["x-amz-id-2"],
|
|
1420
|
-
cfId: output.headers["x-amz-cf-id"],
|
|
1421
|
-
});
|
|
1422
|
-
const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
1423
|
-
const throwDefaultError = (0, smithy_client_1.withBaseException)(ACMPCAServiceException_1.ACMPCAServiceException);
|
|
1424
|
-
const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
|
|
1425
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
1426
|
-
const contents = {
|
|
1427
|
-
protocol,
|
|
1428
|
-
hostname,
|
|
1429
|
-
port,
|
|
1430
|
-
method: "POST",
|
|
1431
|
-
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
|
|
1432
|
-
headers,
|
|
1433
|
-
};
|
|
1434
|
-
if (resolvedHostname !== undefined) {
|
|
1435
|
-
contents.hostname = resolvedHostname;
|
|
1436
|
-
}
|
|
1437
|
-
if (body !== undefined) {
|
|
1438
|
-
contents.body = body;
|
|
1439
|
-
}
|
|
1440
|
-
return new protocol_http_1.HttpRequest(contents);
|
|
1441
|
-
};
|
|
1442
|
-
function sharedHeaders(operation) {
|
|
1443
|
-
return {
|
|
1444
|
-
"content-type": "application/x-amz-json-1.1",
|
|
1445
|
-
"x-amz-target": `ACMPrivateCA.${operation}`,
|
|
1446
|
-
};
|
|
1447
|
-
}
|
|
1448
|
-
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
1449
|
-
if (encoded.length) {
|
|
1450
|
-
return JSON.parse(encoded);
|
|
1451
|
-
}
|
|
1452
|
-
return {};
|
|
1453
|
-
});
|
|
1454
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
1455
|
-
const value = await parseBody(errorBody, context);
|
|
1456
|
-
value.message = value.message ?? value.Message;
|
|
1457
|
-
return value;
|
|
1458
|
-
};
|
|
1459
|
-
const loadRestJsonErrorCode = (output, data) => {
|
|
1460
|
-
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
1461
|
-
const sanitizeErrorCode = (rawValue) => {
|
|
1462
|
-
let cleanValue = rawValue;
|
|
1463
|
-
if (typeof cleanValue === "number") {
|
|
1464
|
-
cleanValue = cleanValue.toString();
|
|
1465
|
-
}
|
|
1466
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
1467
|
-
cleanValue = cleanValue.split(",")[0];
|
|
1468
|
-
}
|
|
1469
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
1470
|
-
cleanValue = cleanValue.split(":")[0];
|
|
1471
|
-
}
|
|
1472
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
1473
|
-
cleanValue = cleanValue.split("#")[1];
|
|
1474
|
-
}
|
|
1475
|
-
return cleanValue;
|
|
1476
|
-
};
|
|
1477
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
1478
|
-
if (headerKey !== undefined) {
|
|
1479
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
1480
|
-
}
|
|
1481
|
-
if (data.code !== undefined) {
|
|
1482
|
-
return sanitizeErrorCode(data.code);
|
|
1483
|
-
}
|
|
1484
|
-
if (data["__type"] !== undefined) {
|
|
1485
|
-
return sanitizeErrorCode(data["__type"]);
|
|
1486
|
-
}
|
|
1487
|
-
};
|
|
1
|
+
module.exports = require("../index.js");
|