@aws-sdk/client-cloudhsm-v2 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/CloudHSMV2.js +1 -41
- package/dist-cjs/CloudHSMV2Client.js +1 -43
- package/dist-cjs/commands/CopyBackupToRegionCommand.js +1 -28
- package/dist-cjs/commands/CreateClusterCommand.js +1 -28
- package/dist-cjs/commands/CreateHsmCommand.js +1 -28
- package/dist-cjs/commands/DeleteBackupCommand.js +1 -28
- package/dist-cjs/commands/DeleteClusterCommand.js +1 -28
- package/dist-cjs/commands/DeleteHsmCommand.js +1 -28
- package/dist-cjs/commands/DescribeBackupsCommand.js +1 -28
- package/dist-cjs/commands/DescribeClustersCommand.js +1 -28
- package/dist-cjs/commands/InitializeClusterCommand.js +1 -28
- package/dist-cjs/commands/ListTagsCommand.js +1 -28
- package/dist-cjs/commands/ModifyBackupAttributesCommand.js +1 -28
- package/dist-cjs/commands/ModifyClusterCommand.js +1 -28
- package/dist-cjs/commands/RestoreBackupCommand.js +1 -28
- package/dist-cjs/commands/TagResourceCommand.js +1 -28
- package/dist-cjs/commands/UntagResourceCommand.js +1 -28
- package/dist-cjs/commands/index.js +1 -18
- package/dist-cjs/endpoint/EndpointParameters.js +1 -18
- package/dist-cjs/extensionConfiguration.js +1 -2
- package/dist-cjs/index.js +1638 -11
- package/dist-cjs/models/CloudHSMV2ServiceException.js +1 -12
- package/dist-cjs/models/index.js +1 -4
- package/dist-cjs/models/models_0.js +1 -118
- package/dist-cjs/pagination/DescribeBackupsPaginator.js +1 -7
- package/dist-cjs/pagination/DescribeClustersPaginator.js +1 -7
- package/dist-cjs/pagination/Interfaces.js +1 -2
- 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 -1039
- package/dist-cjs/runtimeExtensions.js +1 -22
- package/package.json +40 -40
|
@@ -1,1039 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_RestoreBackupCommand = exports.de_ModifyClusterCommand = exports.de_ModifyBackupAttributesCommand = exports.de_ListTagsCommand = exports.de_InitializeClusterCommand = exports.de_DescribeClustersCommand = exports.de_DescribeBackupsCommand = exports.de_DeleteHsmCommand = exports.de_DeleteClusterCommand = exports.de_DeleteBackupCommand = exports.de_CreateHsmCommand = exports.de_CreateClusterCommand = exports.de_CopyBackupToRegionCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_RestoreBackupCommand = exports.se_ModifyClusterCommand = exports.se_ModifyBackupAttributesCommand = exports.se_ListTagsCommand = exports.se_InitializeClusterCommand = exports.se_DescribeClustersCommand = exports.se_DescribeBackupsCommand = exports.se_DeleteHsmCommand = exports.se_DeleteClusterCommand = exports.se_DeleteBackupCommand = exports.se_CreateHsmCommand = exports.se_CreateClusterCommand = exports.se_CopyBackupToRegionCommand = void 0;
|
|
4
|
-
const protocol_http_1 = require("@smithy/protocol-http");
|
|
5
|
-
const smithy_client_1 = require("@smithy/smithy-client");
|
|
6
|
-
const CloudHSMV2ServiceException_1 = require("../models/CloudHSMV2ServiceException");
|
|
7
|
-
const models_0_1 = require("../models/models_0");
|
|
8
|
-
const se_CopyBackupToRegionCommand = async (input, context) => {
|
|
9
|
-
const headers = sharedHeaders("CopyBackupToRegion");
|
|
10
|
-
let body;
|
|
11
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
12
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
13
|
-
};
|
|
14
|
-
exports.se_CopyBackupToRegionCommand = se_CopyBackupToRegionCommand;
|
|
15
|
-
const se_CreateClusterCommand = async (input, context) => {
|
|
16
|
-
const headers = sharedHeaders("CreateCluster");
|
|
17
|
-
let body;
|
|
18
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
19
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
20
|
-
};
|
|
21
|
-
exports.se_CreateClusterCommand = se_CreateClusterCommand;
|
|
22
|
-
const se_CreateHsmCommand = async (input, context) => {
|
|
23
|
-
const headers = sharedHeaders("CreateHsm");
|
|
24
|
-
let body;
|
|
25
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
26
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
27
|
-
};
|
|
28
|
-
exports.se_CreateHsmCommand = se_CreateHsmCommand;
|
|
29
|
-
const se_DeleteBackupCommand = async (input, context) => {
|
|
30
|
-
const headers = sharedHeaders("DeleteBackup");
|
|
31
|
-
let body;
|
|
32
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
33
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
34
|
-
};
|
|
35
|
-
exports.se_DeleteBackupCommand = se_DeleteBackupCommand;
|
|
36
|
-
const se_DeleteClusterCommand = async (input, context) => {
|
|
37
|
-
const headers = sharedHeaders("DeleteCluster");
|
|
38
|
-
let body;
|
|
39
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
40
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
41
|
-
};
|
|
42
|
-
exports.se_DeleteClusterCommand = se_DeleteClusterCommand;
|
|
43
|
-
const se_DeleteHsmCommand = async (input, context) => {
|
|
44
|
-
const headers = sharedHeaders("DeleteHsm");
|
|
45
|
-
let body;
|
|
46
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
47
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
48
|
-
};
|
|
49
|
-
exports.se_DeleteHsmCommand = se_DeleteHsmCommand;
|
|
50
|
-
const se_DescribeBackupsCommand = async (input, context) => {
|
|
51
|
-
const headers = sharedHeaders("DescribeBackups");
|
|
52
|
-
let body;
|
|
53
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
54
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
55
|
-
};
|
|
56
|
-
exports.se_DescribeBackupsCommand = se_DescribeBackupsCommand;
|
|
57
|
-
const se_DescribeClustersCommand = async (input, context) => {
|
|
58
|
-
const headers = sharedHeaders("DescribeClusters");
|
|
59
|
-
let body;
|
|
60
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
61
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
62
|
-
};
|
|
63
|
-
exports.se_DescribeClustersCommand = se_DescribeClustersCommand;
|
|
64
|
-
const se_InitializeClusterCommand = async (input, context) => {
|
|
65
|
-
const headers = sharedHeaders("InitializeCluster");
|
|
66
|
-
let body;
|
|
67
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
68
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
69
|
-
};
|
|
70
|
-
exports.se_InitializeClusterCommand = se_InitializeClusterCommand;
|
|
71
|
-
const se_ListTagsCommand = async (input, context) => {
|
|
72
|
-
const headers = sharedHeaders("ListTags");
|
|
73
|
-
let body;
|
|
74
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
75
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
76
|
-
};
|
|
77
|
-
exports.se_ListTagsCommand = se_ListTagsCommand;
|
|
78
|
-
const se_ModifyBackupAttributesCommand = async (input, context) => {
|
|
79
|
-
const headers = sharedHeaders("ModifyBackupAttributes");
|
|
80
|
-
let body;
|
|
81
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
82
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
83
|
-
};
|
|
84
|
-
exports.se_ModifyBackupAttributesCommand = se_ModifyBackupAttributesCommand;
|
|
85
|
-
const se_ModifyClusterCommand = async (input, context) => {
|
|
86
|
-
const headers = sharedHeaders("ModifyCluster");
|
|
87
|
-
let body;
|
|
88
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
89
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
90
|
-
};
|
|
91
|
-
exports.se_ModifyClusterCommand = se_ModifyClusterCommand;
|
|
92
|
-
const se_RestoreBackupCommand = async (input, context) => {
|
|
93
|
-
const headers = sharedHeaders("RestoreBackup");
|
|
94
|
-
let body;
|
|
95
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
96
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
97
|
-
};
|
|
98
|
-
exports.se_RestoreBackupCommand = se_RestoreBackupCommand;
|
|
99
|
-
const se_TagResourceCommand = async (input, context) => {
|
|
100
|
-
const headers = sharedHeaders("TagResource");
|
|
101
|
-
let body;
|
|
102
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
103
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
104
|
-
};
|
|
105
|
-
exports.se_TagResourceCommand = se_TagResourceCommand;
|
|
106
|
-
const se_UntagResourceCommand = async (input, context) => {
|
|
107
|
-
const headers = sharedHeaders("UntagResource");
|
|
108
|
-
let body;
|
|
109
|
-
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
110
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
111
|
-
};
|
|
112
|
-
exports.se_UntagResourceCommand = se_UntagResourceCommand;
|
|
113
|
-
const de_CopyBackupToRegionCommand = async (output, context) => {
|
|
114
|
-
if (output.statusCode >= 300) {
|
|
115
|
-
return de_CopyBackupToRegionCommandError(output, context);
|
|
116
|
-
}
|
|
117
|
-
const data = await parseBody(output.body, context);
|
|
118
|
-
let contents = {};
|
|
119
|
-
contents = de_CopyBackupToRegionResponse(data, context);
|
|
120
|
-
const response = {
|
|
121
|
-
$metadata: deserializeMetadata(output),
|
|
122
|
-
...contents,
|
|
123
|
-
};
|
|
124
|
-
return response;
|
|
125
|
-
};
|
|
126
|
-
exports.de_CopyBackupToRegionCommand = de_CopyBackupToRegionCommand;
|
|
127
|
-
const de_CopyBackupToRegionCommandError = async (output, context) => {
|
|
128
|
-
const parsedOutput = {
|
|
129
|
-
...output,
|
|
130
|
-
body: await parseErrorBody(output.body, context),
|
|
131
|
-
};
|
|
132
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
133
|
-
switch (errorCode) {
|
|
134
|
-
case "CloudHsmAccessDeniedException":
|
|
135
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
|
|
136
|
-
throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
|
|
137
|
-
case "CloudHsmInternalFailureException":
|
|
138
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
|
|
139
|
-
throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
|
|
140
|
-
case "CloudHsmInvalidRequestException":
|
|
141
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
|
|
142
|
-
throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
|
|
143
|
-
case "CloudHsmResourceNotFoundException":
|
|
144
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException":
|
|
145
|
-
throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context);
|
|
146
|
-
case "CloudHsmServiceException":
|
|
147
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
|
|
148
|
-
throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
|
|
149
|
-
case "CloudHsmTagException":
|
|
150
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmTagException":
|
|
151
|
-
throw await de_CloudHsmTagExceptionRes(parsedOutput, context);
|
|
152
|
-
default:
|
|
153
|
-
const parsedBody = parsedOutput.body;
|
|
154
|
-
return throwDefaultError({
|
|
155
|
-
output,
|
|
156
|
-
parsedBody,
|
|
157
|
-
errorCode,
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
const de_CreateClusterCommand = async (output, context) => {
|
|
162
|
-
if (output.statusCode >= 300) {
|
|
163
|
-
return de_CreateClusterCommandError(output, context);
|
|
164
|
-
}
|
|
165
|
-
const data = await parseBody(output.body, context);
|
|
166
|
-
let contents = {};
|
|
167
|
-
contents = de_CreateClusterResponse(data, context);
|
|
168
|
-
const response = {
|
|
169
|
-
$metadata: deserializeMetadata(output),
|
|
170
|
-
...contents,
|
|
171
|
-
};
|
|
172
|
-
return response;
|
|
173
|
-
};
|
|
174
|
-
exports.de_CreateClusterCommand = de_CreateClusterCommand;
|
|
175
|
-
const de_CreateClusterCommandError = async (output, context) => {
|
|
176
|
-
const parsedOutput = {
|
|
177
|
-
...output,
|
|
178
|
-
body: await parseErrorBody(output.body, context),
|
|
179
|
-
};
|
|
180
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
181
|
-
switch (errorCode) {
|
|
182
|
-
case "CloudHsmAccessDeniedException":
|
|
183
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
|
|
184
|
-
throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
|
|
185
|
-
case "CloudHsmInternalFailureException":
|
|
186
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
|
|
187
|
-
throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
|
|
188
|
-
case "CloudHsmInvalidRequestException":
|
|
189
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
|
|
190
|
-
throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
|
|
191
|
-
case "CloudHsmResourceNotFoundException":
|
|
192
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException":
|
|
193
|
-
throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context);
|
|
194
|
-
case "CloudHsmServiceException":
|
|
195
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
|
|
196
|
-
throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
|
|
197
|
-
case "CloudHsmTagException":
|
|
198
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmTagException":
|
|
199
|
-
throw await de_CloudHsmTagExceptionRes(parsedOutput, context);
|
|
200
|
-
default:
|
|
201
|
-
const parsedBody = parsedOutput.body;
|
|
202
|
-
return throwDefaultError({
|
|
203
|
-
output,
|
|
204
|
-
parsedBody,
|
|
205
|
-
errorCode,
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
};
|
|
209
|
-
const de_CreateHsmCommand = async (output, context) => {
|
|
210
|
-
if (output.statusCode >= 300) {
|
|
211
|
-
return de_CreateHsmCommandError(output, context);
|
|
212
|
-
}
|
|
213
|
-
const data = await parseBody(output.body, context);
|
|
214
|
-
let contents = {};
|
|
215
|
-
contents = (0, smithy_client_1._json)(data);
|
|
216
|
-
const response = {
|
|
217
|
-
$metadata: deserializeMetadata(output),
|
|
218
|
-
...contents,
|
|
219
|
-
};
|
|
220
|
-
return response;
|
|
221
|
-
};
|
|
222
|
-
exports.de_CreateHsmCommand = de_CreateHsmCommand;
|
|
223
|
-
const de_CreateHsmCommandError = async (output, context) => {
|
|
224
|
-
const parsedOutput = {
|
|
225
|
-
...output,
|
|
226
|
-
body: await parseErrorBody(output.body, context),
|
|
227
|
-
};
|
|
228
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
229
|
-
switch (errorCode) {
|
|
230
|
-
case "CloudHsmAccessDeniedException":
|
|
231
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
|
|
232
|
-
throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
|
|
233
|
-
case "CloudHsmInternalFailureException":
|
|
234
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
|
|
235
|
-
throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
|
|
236
|
-
case "CloudHsmInvalidRequestException":
|
|
237
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
|
|
238
|
-
throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
|
|
239
|
-
case "CloudHsmResourceNotFoundException":
|
|
240
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException":
|
|
241
|
-
throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context);
|
|
242
|
-
case "CloudHsmServiceException":
|
|
243
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
|
|
244
|
-
throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
|
|
245
|
-
default:
|
|
246
|
-
const parsedBody = parsedOutput.body;
|
|
247
|
-
return throwDefaultError({
|
|
248
|
-
output,
|
|
249
|
-
parsedBody,
|
|
250
|
-
errorCode,
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
};
|
|
254
|
-
const de_DeleteBackupCommand = async (output, context) => {
|
|
255
|
-
if (output.statusCode >= 300) {
|
|
256
|
-
return de_DeleteBackupCommandError(output, context);
|
|
257
|
-
}
|
|
258
|
-
const data = await parseBody(output.body, context);
|
|
259
|
-
let contents = {};
|
|
260
|
-
contents = de_DeleteBackupResponse(data, context);
|
|
261
|
-
const response = {
|
|
262
|
-
$metadata: deserializeMetadata(output),
|
|
263
|
-
...contents,
|
|
264
|
-
};
|
|
265
|
-
return response;
|
|
266
|
-
};
|
|
267
|
-
exports.de_DeleteBackupCommand = de_DeleteBackupCommand;
|
|
268
|
-
const de_DeleteBackupCommandError = async (output, context) => {
|
|
269
|
-
const parsedOutput = {
|
|
270
|
-
...output,
|
|
271
|
-
body: await parseErrorBody(output.body, context),
|
|
272
|
-
};
|
|
273
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
274
|
-
switch (errorCode) {
|
|
275
|
-
case "CloudHsmAccessDeniedException":
|
|
276
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
|
|
277
|
-
throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
|
|
278
|
-
case "CloudHsmInternalFailureException":
|
|
279
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
|
|
280
|
-
throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
|
|
281
|
-
case "CloudHsmInvalidRequestException":
|
|
282
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
|
|
283
|
-
throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
|
|
284
|
-
case "CloudHsmResourceNotFoundException":
|
|
285
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException":
|
|
286
|
-
throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context);
|
|
287
|
-
case "CloudHsmServiceException":
|
|
288
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
|
|
289
|
-
throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
|
|
290
|
-
default:
|
|
291
|
-
const parsedBody = parsedOutput.body;
|
|
292
|
-
return throwDefaultError({
|
|
293
|
-
output,
|
|
294
|
-
parsedBody,
|
|
295
|
-
errorCode,
|
|
296
|
-
});
|
|
297
|
-
}
|
|
298
|
-
};
|
|
299
|
-
const de_DeleteClusterCommand = async (output, context) => {
|
|
300
|
-
if (output.statusCode >= 300) {
|
|
301
|
-
return de_DeleteClusterCommandError(output, context);
|
|
302
|
-
}
|
|
303
|
-
const data = await parseBody(output.body, context);
|
|
304
|
-
let contents = {};
|
|
305
|
-
contents = de_DeleteClusterResponse(data, context);
|
|
306
|
-
const response = {
|
|
307
|
-
$metadata: deserializeMetadata(output),
|
|
308
|
-
...contents,
|
|
309
|
-
};
|
|
310
|
-
return response;
|
|
311
|
-
};
|
|
312
|
-
exports.de_DeleteClusterCommand = de_DeleteClusterCommand;
|
|
313
|
-
const de_DeleteClusterCommandError = async (output, context) => {
|
|
314
|
-
const parsedOutput = {
|
|
315
|
-
...output,
|
|
316
|
-
body: await parseErrorBody(output.body, context),
|
|
317
|
-
};
|
|
318
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
319
|
-
switch (errorCode) {
|
|
320
|
-
case "CloudHsmAccessDeniedException":
|
|
321
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
|
|
322
|
-
throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
|
|
323
|
-
case "CloudHsmInternalFailureException":
|
|
324
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
|
|
325
|
-
throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
|
|
326
|
-
case "CloudHsmInvalidRequestException":
|
|
327
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
|
|
328
|
-
throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
|
|
329
|
-
case "CloudHsmResourceNotFoundException":
|
|
330
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException":
|
|
331
|
-
throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context);
|
|
332
|
-
case "CloudHsmServiceException":
|
|
333
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
|
|
334
|
-
throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
|
|
335
|
-
case "CloudHsmTagException":
|
|
336
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmTagException":
|
|
337
|
-
throw await de_CloudHsmTagExceptionRes(parsedOutput, context);
|
|
338
|
-
default:
|
|
339
|
-
const parsedBody = parsedOutput.body;
|
|
340
|
-
return throwDefaultError({
|
|
341
|
-
output,
|
|
342
|
-
parsedBody,
|
|
343
|
-
errorCode,
|
|
344
|
-
});
|
|
345
|
-
}
|
|
346
|
-
};
|
|
347
|
-
const de_DeleteHsmCommand = async (output, context) => {
|
|
348
|
-
if (output.statusCode >= 300) {
|
|
349
|
-
return de_DeleteHsmCommandError(output, context);
|
|
350
|
-
}
|
|
351
|
-
const data = await parseBody(output.body, context);
|
|
352
|
-
let contents = {};
|
|
353
|
-
contents = (0, smithy_client_1._json)(data);
|
|
354
|
-
const response = {
|
|
355
|
-
$metadata: deserializeMetadata(output),
|
|
356
|
-
...contents,
|
|
357
|
-
};
|
|
358
|
-
return response;
|
|
359
|
-
};
|
|
360
|
-
exports.de_DeleteHsmCommand = de_DeleteHsmCommand;
|
|
361
|
-
const de_DeleteHsmCommandError = async (output, context) => {
|
|
362
|
-
const parsedOutput = {
|
|
363
|
-
...output,
|
|
364
|
-
body: await parseErrorBody(output.body, context),
|
|
365
|
-
};
|
|
366
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
367
|
-
switch (errorCode) {
|
|
368
|
-
case "CloudHsmAccessDeniedException":
|
|
369
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
|
|
370
|
-
throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
|
|
371
|
-
case "CloudHsmInternalFailureException":
|
|
372
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
|
|
373
|
-
throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
|
|
374
|
-
case "CloudHsmInvalidRequestException":
|
|
375
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
|
|
376
|
-
throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
|
|
377
|
-
case "CloudHsmResourceNotFoundException":
|
|
378
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException":
|
|
379
|
-
throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context);
|
|
380
|
-
case "CloudHsmServiceException":
|
|
381
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
|
|
382
|
-
throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
|
|
383
|
-
default:
|
|
384
|
-
const parsedBody = parsedOutput.body;
|
|
385
|
-
return throwDefaultError({
|
|
386
|
-
output,
|
|
387
|
-
parsedBody,
|
|
388
|
-
errorCode,
|
|
389
|
-
});
|
|
390
|
-
}
|
|
391
|
-
};
|
|
392
|
-
const de_DescribeBackupsCommand = async (output, context) => {
|
|
393
|
-
if (output.statusCode >= 300) {
|
|
394
|
-
return de_DescribeBackupsCommandError(output, context);
|
|
395
|
-
}
|
|
396
|
-
const data = await parseBody(output.body, context);
|
|
397
|
-
let contents = {};
|
|
398
|
-
contents = de_DescribeBackupsResponse(data, context);
|
|
399
|
-
const response = {
|
|
400
|
-
$metadata: deserializeMetadata(output),
|
|
401
|
-
...contents,
|
|
402
|
-
};
|
|
403
|
-
return response;
|
|
404
|
-
};
|
|
405
|
-
exports.de_DescribeBackupsCommand = de_DescribeBackupsCommand;
|
|
406
|
-
const de_DescribeBackupsCommandError = async (output, context) => {
|
|
407
|
-
const parsedOutput = {
|
|
408
|
-
...output,
|
|
409
|
-
body: await parseErrorBody(output.body, context),
|
|
410
|
-
};
|
|
411
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
412
|
-
switch (errorCode) {
|
|
413
|
-
case "CloudHsmAccessDeniedException":
|
|
414
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
|
|
415
|
-
throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
|
|
416
|
-
case "CloudHsmInternalFailureException":
|
|
417
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
|
|
418
|
-
throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
|
|
419
|
-
case "CloudHsmInvalidRequestException":
|
|
420
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
|
|
421
|
-
throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
|
|
422
|
-
case "CloudHsmResourceNotFoundException":
|
|
423
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException":
|
|
424
|
-
throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context);
|
|
425
|
-
case "CloudHsmServiceException":
|
|
426
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
|
|
427
|
-
throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
|
|
428
|
-
case "CloudHsmTagException":
|
|
429
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmTagException":
|
|
430
|
-
throw await de_CloudHsmTagExceptionRes(parsedOutput, context);
|
|
431
|
-
default:
|
|
432
|
-
const parsedBody = parsedOutput.body;
|
|
433
|
-
return throwDefaultError({
|
|
434
|
-
output,
|
|
435
|
-
parsedBody,
|
|
436
|
-
errorCode,
|
|
437
|
-
});
|
|
438
|
-
}
|
|
439
|
-
};
|
|
440
|
-
const de_DescribeClustersCommand = async (output, context) => {
|
|
441
|
-
if (output.statusCode >= 300) {
|
|
442
|
-
return de_DescribeClustersCommandError(output, context);
|
|
443
|
-
}
|
|
444
|
-
const data = await parseBody(output.body, context);
|
|
445
|
-
let contents = {};
|
|
446
|
-
contents = de_DescribeClustersResponse(data, context);
|
|
447
|
-
const response = {
|
|
448
|
-
$metadata: deserializeMetadata(output),
|
|
449
|
-
...contents,
|
|
450
|
-
};
|
|
451
|
-
return response;
|
|
452
|
-
};
|
|
453
|
-
exports.de_DescribeClustersCommand = de_DescribeClustersCommand;
|
|
454
|
-
const de_DescribeClustersCommandError = async (output, context) => {
|
|
455
|
-
const parsedOutput = {
|
|
456
|
-
...output,
|
|
457
|
-
body: await parseErrorBody(output.body, context),
|
|
458
|
-
};
|
|
459
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
460
|
-
switch (errorCode) {
|
|
461
|
-
case "CloudHsmAccessDeniedException":
|
|
462
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
|
|
463
|
-
throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
|
|
464
|
-
case "CloudHsmInternalFailureException":
|
|
465
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
|
|
466
|
-
throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
|
|
467
|
-
case "CloudHsmInvalidRequestException":
|
|
468
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
|
|
469
|
-
throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
|
|
470
|
-
case "CloudHsmServiceException":
|
|
471
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
|
|
472
|
-
throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
|
|
473
|
-
case "CloudHsmTagException":
|
|
474
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmTagException":
|
|
475
|
-
throw await de_CloudHsmTagExceptionRes(parsedOutput, context);
|
|
476
|
-
default:
|
|
477
|
-
const parsedBody = parsedOutput.body;
|
|
478
|
-
return throwDefaultError({
|
|
479
|
-
output,
|
|
480
|
-
parsedBody,
|
|
481
|
-
errorCode,
|
|
482
|
-
});
|
|
483
|
-
}
|
|
484
|
-
};
|
|
485
|
-
const de_InitializeClusterCommand = async (output, context) => {
|
|
486
|
-
if (output.statusCode >= 300) {
|
|
487
|
-
return de_InitializeClusterCommandError(output, context);
|
|
488
|
-
}
|
|
489
|
-
const data = await parseBody(output.body, context);
|
|
490
|
-
let contents = {};
|
|
491
|
-
contents = (0, smithy_client_1._json)(data);
|
|
492
|
-
const response = {
|
|
493
|
-
$metadata: deserializeMetadata(output),
|
|
494
|
-
...contents,
|
|
495
|
-
};
|
|
496
|
-
return response;
|
|
497
|
-
};
|
|
498
|
-
exports.de_InitializeClusterCommand = de_InitializeClusterCommand;
|
|
499
|
-
const de_InitializeClusterCommandError = async (output, context) => {
|
|
500
|
-
const parsedOutput = {
|
|
501
|
-
...output,
|
|
502
|
-
body: await parseErrorBody(output.body, context),
|
|
503
|
-
};
|
|
504
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
505
|
-
switch (errorCode) {
|
|
506
|
-
case "CloudHsmAccessDeniedException":
|
|
507
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
|
|
508
|
-
throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
|
|
509
|
-
case "CloudHsmInternalFailureException":
|
|
510
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
|
|
511
|
-
throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
|
|
512
|
-
case "CloudHsmInvalidRequestException":
|
|
513
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
|
|
514
|
-
throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
|
|
515
|
-
case "CloudHsmResourceNotFoundException":
|
|
516
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException":
|
|
517
|
-
throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context);
|
|
518
|
-
case "CloudHsmServiceException":
|
|
519
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
|
|
520
|
-
throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
|
|
521
|
-
default:
|
|
522
|
-
const parsedBody = parsedOutput.body;
|
|
523
|
-
return throwDefaultError({
|
|
524
|
-
output,
|
|
525
|
-
parsedBody,
|
|
526
|
-
errorCode,
|
|
527
|
-
});
|
|
528
|
-
}
|
|
529
|
-
};
|
|
530
|
-
const de_ListTagsCommand = async (output, context) => {
|
|
531
|
-
if (output.statusCode >= 300) {
|
|
532
|
-
return de_ListTagsCommandError(output, context);
|
|
533
|
-
}
|
|
534
|
-
const data = await parseBody(output.body, context);
|
|
535
|
-
let contents = {};
|
|
536
|
-
contents = (0, smithy_client_1._json)(data);
|
|
537
|
-
const response = {
|
|
538
|
-
$metadata: deserializeMetadata(output),
|
|
539
|
-
...contents,
|
|
540
|
-
};
|
|
541
|
-
return response;
|
|
542
|
-
};
|
|
543
|
-
exports.de_ListTagsCommand = de_ListTagsCommand;
|
|
544
|
-
const de_ListTagsCommandError = async (output, context) => {
|
|
545
|
-
const parsedOutput = {
|
|
546
|
-
...output,
|
|
547
|
-
body: await parseErrorBody(output.body, context),
|
|
548
|
-
};
|
|
549
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
550
|
-
switch (errorCode) {
|
|
551
|
-
case "CloudHsmAccessDeniedException":
|
|
552
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
|
|
553
|
-
throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
|
|
554
|
-
case "CloudHsmInternalFailureException":
|
|
555
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
|
|
556
|
-
throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
|
|
557
|
-
case "CloudHsmInvalidRequestException":
|
|
558
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
|
|
559
|
-
throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
|
|
560
|
-
case "CloudHsmResourceNotFoundException":
|
|
561
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException":
|
|
562
|
-
throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context);
|
|
563
|
-
case "CloudHsmServiceException":
|
|
564
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
|
|
565
|
-
throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
|
|
566
|
-
case "CloudHsmTagException":
|
|
567
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmTagException":
|
|
568
|
-
throw await de_CloudHsmTagExceptionRes(parsedOutput, context);
|
|
569
|
-
default:
|
|
570
|
-
const parsedBody = parsedOutput.body;
|
|
571
|
-
return throwDefaultError({
|
|
572
|
-
output,
|
|
573
|
-
parsedBody,
|
|
574
|
-
errorCode,
|
|
575
|
-
});
|
|
576
|
-
}
|
|
577
|
-
};
|
|
578
|
-
const de_ModifyBackupAttributesCommand = async (output, context) => {
|
|
579
|
-
if (output.statusCode >= 300) {
|
|
580
|
-
return de_ModifyBackupAttributesCommandError(output, context);
|
|
581
|
-
}
|
|
582
|
-
const data = await parseBody(output.body, context);
|
|
583
|
-
let contents = {};
|
|
584
|
-
contents = de_ModifyBackupAttributesResponse(data, context);
|
|
585
|
-
const response = {
|
|
586
|
-
$metadata: deserializeMetadata(output),
|
|
587
|
-
...contents,
|
|
588
|
-
};
|
|
589
|
-
return response;
|
|
590
|
-
};
|
|
591
|
-
exports.de_ModifyBackupAttributesCommand = de_ModifyBackupAttributesCommand;
|
|
592
|
-
const de_ModifyBackupAttributesCommandError = async (output, context) => {
|
|
593
|
-
const parsedOutput = {
|
|
594
|
-
...output,
|
|
595
|
-
body: await parseErrorBody(output.body, context),
|
|
596
|
-
};
|
|
597
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
598
|
-
switch (errorCode) {
|
|
599
|
-
case "CloudHsmAccessDeniedException":
|
|
600
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
|
|
601
|
-
throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
|
|
602
|
-
case "CloudHsmInternalFailureException":
|
|
603
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
|
|
604
|
-
throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
|
|
605
|
-
case "CloudHsmInvalidRequestException":
|
|
606
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
|
|
607
|
-
throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
|
|
608
|
-
case "CloudHsmResourceNotFoundException":
|
|
609
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException":
|
|
610
|
-
throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context);
|
|
611
|
-
case "CloudHsmServiceException":
|
|
612
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
|
|
613
|
-
throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
|
|
614
|
-
default:
|
|
615
|
-
const parsedBody = parsedOutput.body;
|
|
616
|
-
return throwDefaultError({
|
|
617
|
-
output,
|
|
618
|
-
parsedBody,
|
|
619
|
-
errorCode,
|
|
620
|
-
});
|
|
621
|
-
}
|
|
622
|
-
};
|
|
623
|
-
const de_ModifyClusterCommand = async (output, context) => {
|
|
624
|
-
if (output.statusCode >= 300) {
|
|
625
|
-
return de_ModifyClusterCommandError(output, context);
|
|
626
|
-
}
|
|
627
|
-
const data = await parseBody(output.body, context);
|
|
628
|
-
let contents = {};
|
|
629
|
-
contents = de_ModifyClusterResponse(data, context);
|
|
630
|
-
const response = {
|
|
631
|
-
$metadata: deserializeMetadata(output),
|
|
632
|
-
...contents,
|
|
633
|
-
};
|
|
634
|
-
return response;
|
|
635
|
-
};
|
|
636
|
-
exports.de_ModifyClusterCommand = de_ModifyClusterCommand;
|
|
637
|
-
const de_ModifyClusterCommandError = async (output, context) => {
|
|
638
|
-
const parsedOutput = {
|
|
639
|
-
...output,
|
|
640
|
-
body: await parseErrorBody(output.body, context),
|
|
641
|
-
};
|
|
642
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
643
|
-
switch (errorCode) {
|
|
644
|
-
case "CloudHsmAccessDeniedException":
|
|
645
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
|
|
646
|
-
throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
|
|
647
|
-
case "CloudHsmInternalFailureException":
|
|
648
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
|
|
649
|
-
throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
|
|
650
|
-
case "CloudHsmInvalidRequestException":
|
|
651
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
|
|
652
|
-
throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
|
|
653
|
-
case "CloudHsmResourceNotFoundException":
|
|
654
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException":
|
|
655
|
-
throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context);
|
|
656
|
-
case "CloudHsmServiceException":
|
|
657
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
|
|
658
|
-
throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
|
|
659
|
-
default:
|
|
660
|
-
const parsedBody = parsedOutput.body;
|
|
661
|
-
return throwDefaultError({
|
|
662
|
-
output,
|
|
663
|
-
parsedBody,
|
|
664
|
-
errorCode,
|
|
665
|
-
});
|
|
666
|
-
}
|
|
667
|
-
};
|
|
668
|
-
const de_RestoreBackupCommand = async (output, context) => {
|
|
669
|
-
if (output.statusCode >= 300) {
|
|
670
|
-
return de_RestoreBackupCommandError(output, context);
|
|
671
|
-
}
|
|
672
|
-
const data = await parseBody(output.body, context);
|
|
673
|
-
let contents = {};
|
|
674
|
-
contents = de_RestoreBackupResponse(data, context);
|
|
675
|
-
const response = {
|
|
676
|
-
$metadata: deserializeMetadata(output),
|
|
677
|
-
...contents,
|
|
678
|
-
};
|
|
679
|
-
return response;
|
|
680
|
-
};
|
|
681
|
-
exports.de_RestoreBackupCommand = de_RestoreBackupCommand;
|
|
682
|
-
const de_RestoreBackupCommandError = async (output, context) => {
|
|
683
|
-
const parsedOutput = {
|
|
684
|
-
...output,
|
|
685
|
-
body: await parseErrorBody(output.body, context),
|
|
686
|
-
};
|
|
687
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
688
|
-
switch (errorCode) {
|
|
689
|
-
case "CloudHsmAccessDeniedException":
|
|
690
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
|
|
691
|
-
throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
|
|
692
|
-
case "CloudHsmInternalFailureException":
|
|
693
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
|
|
694
|
-
throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
|
|
695
|
-
case "CloudHsmInvalidRequestException":
|
|
696
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
|
|
697
|
-
throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
|
|
698
|
-
case "CloudHsmResourceNotFoundException":
|
|
699
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException":
|
|
700
|
-
throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context);
|
|
701
|
-
case "CloudHsmServiceException":
|
|
702
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
|
|
703
|
-
throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
|
|
704
|
-
default:
|
|
705
|
-
const parsedBody = parsedOutput.body;
|
|
706
|
-
return throwDefaultError({
|
|
707
|
-
output,
|
|
708
|
-
parsedBody,
|
|
709
|
-
errorCode,
|
|
710
|
-
});
|
|
711
|
-
}
|
|
712
|
-
};
|
|
713
|
-
const de_TagResourceCommand = async (output, context) => {
|
|
714
|
-
if (output.statusCode >= 300) {
|
|
715
|
-
return de_TagResourceCommandError(output, context);
|
|
716
|
-
}
|
|
717
|
-
const data = await parseBody(output.body, context);
|
|
718
|
-
let contents = {};
|
|
719
|
-
contents = (0, smithy_client_1._json)(data);
|
|
720
|
-
const response = {
|
|
721
|
-
$metadata: deserializeMetadata(output),
|
|
722
|
-
...contents,
|
|
723
|
-
};
|
|
724
|
-
return response;
|
|
725
|
-
};
|
|
726
|
-
exports.de_TagResourceCommand = de_TagResourceCommand;
|
|
727
|
-
const de_TagResourceCommandError = async (output, context) => {
|
|
728
|
-
const parsedOutput = {
|
|
729
|
-
...output,
|
|
730
|
-
body: await parseErrorBody(output.body, context),
|
|
731
|
-
};
|
|
732
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
733
|
-
switch (errorCode) {
|
|
734
|
-
case "CloudHsmAccessDeniedException":
|
|
735
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
|
|
736
|
-
throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
|
|
737
|
-
case "CloudHsmInternalFailureException":
|
|
738
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
|
|
739
|
-
throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
|
|
740
|
-
case "CloudHsmInvalidRequestException":
|
|
741
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
|
|
742
|
-
throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
|
|
743
|
-
case "CloudHsmResourceNotFoundException":
|
|
744
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException":
|
|
745
|
-
throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context);
|
|
746
|
-
case "CloudHsmServiceException":
|
|
747
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
|
|
748
|
-
throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
|
|
749
|
-
case "CloudHsmTagException":
|
|
750
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmTagException":
|
|
751
|
-
throw await de_CloudHsmTagExceptionRes(parsedOutput, context);
|
|
752
|
-
default:
|
|
753
|
-
const parsedBody = parsedOutput.body;
|
|
754
|
-
return throwDefaultError({
|
|
755
|
-
output,
|
|
756
|
-
parsedBody,
|
|
757
|
-
errorCode,
|
|
758
|
-
});
|
|
759
|
-
}
|
|
760
|
-
};
|
|
761
|
-
const de_UntagResourceCommand = async (output, context) => {
|
|
762
|
-
if (output.statusCode >= 300) {
|
|
763
|
-
return de_UntagResourceCommandError(output, context);
|
|
764
|
-
}
|
|
765
|
-
const data = await parseBody(output.body, context);
|
|
766
|
-
let contents = {};
|
|
767
|
-
contents = (0, smithy_client_1._json)(data);
|
|
768
|
-
const response = {
|
|
769
|
-
$metadata: deserializeMetadata(output),
|
|
770
|
-
...contents,
|
|
771
|
-
};
|
|
772
|
-
return response;
|
|
773
|
-
};
|
|
774
|
-
exports.de_UntagResourceCommand = de_UntagResourceCommand;
|
|
775
|
-
const de_UntagResourceCommandError = async (output, context) => {
|
|
776
|
-
const parsedOutput = {
|
|
777
|
-
...output,
|
|
778
|
-
body: await parseErrorBody(output.body, context),
|
|
779
|
-
};
|
|
780
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
781
|
-
switch (errorCode) {
|
|
782
|
-
case "CloudHsmAccessDeniedException":
|
|
783
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
|
|
784
|
-
throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
|
|
785
|
-
case "CloudHsmInternalFailureException":
|
|
786
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
|
|
787
|
-
throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
|
|
788
|
-
case "CloudHsmInvalidRequestException":
|
|
789
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
|
|
790
|
-
throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
|
|
791
|
-
case "CloudHsmResourceNotFoundException":
|
|
792
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException":
|
|
793
|
-
throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context);
|
|
794
|
-
case "CloudHsmServiceException":
|
|
795
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
|
|
796
|
-
throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
|
|
797
|
-
case "CloudHsmTagException":
|
|
798
|
-
case "com.amazonaws.cloudhsmv2#CloudHsmTagException":
|
|
799
|
-
throw await de_CloudHsmTagExceptionRes(parsedOutput, context);
|
|
800
|
-
default:
|
|
801
|
-
const parsedBody = parsedOutput.body;
|
|
802
|
-
return throwDefaultError({
|
|
803
|
-
output,
|
|
804
|
-
parsedBody,
|
|
805
|
-
errorCode,
|
|
806
|
-
});
|
|
807
|
-
}
|
|
808
|
-
};
|
|
809
|
-
const de_CloudHsmAccessDeniedExceptionRes = async (parsedOutput, context) => {
|
|
810
|
-
const body = parsedOutput.body;
|
|
811
|
-
const deserialized = (0, smithy_client_1._json)(body);
|
|
812
|
-
const exception = new models_0_1.CloudHsmAccessDeniedException({
|
|
813
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
814
|
-
...deserialized,
|
|
815
|
-
});
|
|
816
|
-
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
817
|
-
};
|
|
818
|
-
const de_CloudHsmInternalFailureExceptionRes = async (parsedOutput, context) => {
|
|
819
|
-
const body = parsedOutput.body;
|
|
820
|
-
const deserialized = (0, smithy_client_1._json)(body);
|
|
821
|
-
const exception = new models_0_1.CloudHsmInternalFailureException({
|
|
822
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
823
|
-
...deserialized,
|
|
824
|
-
});
|
|
825
|
-
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
826
|
-
};
|
|
827
|
-
const de_CloudHsmInvalidRequestExceptionRes = async (parsedOutput, context) => {
|
|
828
|
-
const body = parsedOutput.body;
|
|
829
|
-
const deserialized = (0, smithy_client_1._json)(body);
|
|
830
|
-
const exception = new models_0_1.CloudHsmInvalidRequestException({
|
|
831
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
832
|
-
...deserialized,
|
|
833
|
-
});
|
|
834
|
-
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
835
|
-
};
|
|
836
|
-
const de_CloudHsmResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
837
|
-
const body = parsedOutput.body;
|
|
838
|
-
const deserialized = (0, smithy_client_1._json)(body);
|
|
839
|
-
const exception = new models_0_1.CloudHsmResourceNotFoundException({
|
|
840
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
841
|
-
...deserialized,
|
|
842
|
-
});
|
|
843
|
-
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
844
|
-
};
|
|
845
|
-
const de_CloudHsmServiceExceptionRes = async (parsedOutput, context) => {
|
|
846
|
-
const body = parsedOutput.body;
|
|
847
|
-
const deserialized = (0, smithy_client_1._json)(body);
|
|
848
|
-
const exception = new models_0_1.CloudHsmServiceException({
|
|
849
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
850
|
-
...deserialized,
|
|
851
|
-
});
|
|
852
|
-
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
853
|
-
};
|
|
854
|
-
const de_CloudHsmTagExceptionRes = async (parsedOutput, context) => {
|
|
855
|
-
const body = parsedOutput.body;
|
|
856
|
-
const deserialized = (0, smithy_client_1._json)(body);
|
|
857
|
-
const exception = new models_0_1.CloudHsmTagException({
|
|
858
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
859
|
-
...deserialized,
|
|
860
|
-
});
|
|
861
|
-
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
862
|
-
};
|
|
863
|
-
const de_Backup = (output, context) => {
|
|
864
|
-
return (0, smithy_client_1.take)(output, {
|
|
865
|
-
BackupId: smithy_client_1.expectString,
|
|
866
|
-
BackupState: smithy_client_1.expectString,
|
|
867
|
-
ClusterId: smithy_client_1.expectString,
|
|
868
|
-
CopyTimestamp: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
869
|
-
CreateTimestamp: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
870
|
-
DeleteTimestamp: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
871
|
-
NeverExpires: smithy_client_1.expectBoolean,
|
|
872
|
-
SourceBackup: smithy_client_1.expectString,
|
|
873
|
-
SourceCluster: smithy_client_1.expectString,
|
|
874
|
-
SourceRegion: smithy_client_1.expectString,
|
|
875
|
-
TagList: smithy_client_1._json,
|
|
876
|
-
});
|
|
877
|
-
};
|
|
878
|
-
const de_Backups = (output, context) => {
|
|
879
|
-
const retVal = (output || [])
|
|
880
|
-
.filter((e) => e != null)
|
|
881
|
-
.map((entry) => {
|
|
882
|
-
return de_Backup(entry, context);
|
|
883
|
-
});
|
|
884
|
-
return retVal;
|
|
885
|
-
};
|
|
886
|
-
const de_Cluster = (output, context) => {
|
|
887
|
-
return (0, smithy_client_1.take)(output, {
|
|
888
|
-
BackupPolicy: smithy_client_1.expectString,
|
|
889
|
-
BackupRetentionPolicy: smithy_client_1._json,
|
|
890
|
-
Certificates: smithy_client_1._json,
|
|
891
|
-
ClusterId: smithy_client_1.expectString,
|
|
892
|
-
CreateTimestamp: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
893
|
-
HsmType: smithy_client_1.expectString,
|
|
894
|
-
Hsms: smithy_client_1._json,
|
|
895
|
-
PreCoPassword: smithy_client_1.expectString,
|
|
896
|
-
SecurityGroup: smithy_client_1.expectString,
|
|
897
|
-
SourceBackupId: smithy_client_1.expectString,
|
|
898
|
-
State: smithy_client_1.expectString,
|
|
899
|
-
StateMessage: smithy_client_1.expectString,
|
|
900
|
-
SubnetMapping: smithy_client_1._json,
|
|
901
|
-
TagList: smithy_client_1._json,
|
|
902
|
-
VpcId: smithy_client_1.expectString,
|
|
903
|
-
});
|
|
904
|
-
};
|
|
905
|
-
const de_Clusters = (output, context) => {
|
|
906
|
-
const retVal = (output || [])
|
|
907
|
-
.filter((e) => e != null)
|
|
908
|
-
.map((entry) => {
|
|
909
|
-
return de_Cluster(entry, context);
|
|
910
|
-
});
|
|
911
|
-
return retVal;
|
|
912
|
-
};
|
|
913
|
-
const de_CopyBackupToRegionResponse = (output, context) => {
|
|
914
|
-
return (0, smithy_client_1.take)(output, {
|
|
915
|
-
DestinationBackup: (_) => de_DestinationBackup(_, context),
|
|
916
|
-
});
|
|
917
|
-
};
|
|
918
|
-
const de_CreateClusterResponse = (output, context) => {
|
|
919
|
-
return (0, smithy_client_1.take)(output, {
|
|
920
|
-
Cluster: (_) => de_Cluster(_, context),
|
|
921
|
-
});
|
|
922
|
-
};
|
|
923
|
-
const de_DeleteBackupResponse = (output, context) => {
|
|
924
|
-
return (0, smithy_client_1.take)(output, {
|
|
925
|
-
Backup: (_) => de_Backup(_, context),
|
|
926
|
-
});
|
|
927
|
-
};
|
|
928
|
-
const de_DeleteClusterResponse = (output, context) => {
|
|
929
|
-
return (0, smithy_client_1.take)(output, {
|
|
930
|
-
Cluster: (_) => de_Cluster(_, context),
|
|
931
|
-
});
|
|
932
|
-
};
|
|
933
|
-
const de_DescribeBackupsResponse = (output, context) => {
|
|
934
|
-
return (0, smithy_client_1.take)(output, {
|
|
935
|
-
Backups: (_) => de_Backups(_, context),
|
|
936
|
-
NextToken: smithy_client_1.expectString,
|
|
937
|
-
});
|
|
938
|
-
};
|
|
939
|
-
const de_DescribeClustersResponse = (output, context) => {
|
|
940
|
-
return (0, smithy_client_1.take)(output, {
|
|
941
|
-
Clusters: (_) => de_Clusters(_, context),
|
|
942
|
-
NextToken: smithy_client_1.expectString,
|
|
943
|
-
});
|
|
944
|
-
};
|
|
945
|
-
const de_DestinationBackup = (output, context) => {
|
|
946
|
-
return (0, smithy_client_1.take)(output, {
|
|
947
|
-
CreateTimestamp: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
948
|
-
SourceBackup: smithy_client_1.expectString,
|
|
949
|
-
SourceCluster: smithy_client_1.expectString,
|
|
950
|
-
SourceRegion: smithy_client_1.expectString,
|
|
951
|
-
});
|
|
952
|
-
};
|
|
953
|
-
const de_ModifyBackupAttributesResponse = (output, context) => {
|
|
954
|
-
return (0, smithy_client_1.take)(output, {
|
|
955
|
-
Backup: (_) => de_Backup(_, context),
|
|
956
|
-
});
|
|
957
|
-
};
|
|
958
|
-
const de_ModifyClusterResponse = (output, context) => {
|
|
959
|
-
return (0, smithy_client_1.take)(output, {
|
|
960
|
-
Cluster: (_) => de_Cluster(_, context),
|
|
961
|
-
});
|
|
962
|
-
};
|
|
963
|
-
const de_RestoreBackupResponse = (output, context) => {
|
|
964
|
-
return (0, smithy_client_1.take)(output, {
|
|
965
|
-
Backup: (_) => de_Backup(_, context),
|
|
966
|
-
});
|
|
967
|
-
};
|
|
968
|
-
const deserializeMetadata = (output) => ({
|
|
969
|
-
httpStatusCode: output.statusCode,
|
|
970
|
-
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
971
|
-
extendedRequestId: output.headers["x-amz-id-2"],
|
|
972
|
-
cfId: output.headers["x-amz-cf-id"],
|
|
973
|
-
});
|
|
974
|
-
const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
975
|
-
const throwDefaultError = (0, smithy_client_1.withBaseException)(CloudHSMV2ServiceException_1.CloudHSMV2ServiceException);
|
|
976
|
-
const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
|
|
977
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
978
|
-
const contents = {
|
|
979
|
-
protocol,
|
|
980
|
-
hostname,
|
|
981
|
-
port,
|
|
982
|
-
method: "POST",
|
|
983
|
-
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
|
|
984
|
-
headers,
|
|
985
|
-
};
|
|
986
|
-
if (resolvedHostname !== undefined) {
|
|
987
|
-
contents.hostname = resolvedHostname;
|
|
988
|
-
}
|
|
989
|
-
if (body !== undefined) {
|
|
990
|
-
contents.body = body;
|
|
991
|
-
}
|
|
992
|
-
return new protocol_http_1.HttpRequest(contents);
|
|
993
|
-
};
|
|
994
|
-
function sharedHeaders(operation) {
|
|
995
|
-
return {
|
|
996
|
-
"content-type": "application/x-amz-json-1.1",
|
|
997
|
-
"x-amz-target": `BaldrApiService.${operation}`,
|
|
998
|
-
};
|
|
999
|
-
}
|
|
1000
|
-
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
1001
|
-
if (encoded.length) {
|
|
1002
|
-
return JSON.parse(encoded);
|
|
1003
|
-
}
|
|
1004
|
-
return {};
|
|
1005
|
-
});
|
|
1006
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
1007
|
-
const value = await parseBody(errorBody, context);
|
|
1008
|
-
value.message = value.message ?? value.Message;
|
|
1009
|
-
return value;
|
|
1010
|
-
};
|
|
1011
|
-
const loadRestJsonErrorCode = (output, data) => {
|
|
1012
|
-
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
1013
|
-
const sanitizeErrorCode = (rawValue) => {
|
|
1014
|
-
let cleanValue = rawValue;
|
|
1015
|
-
if (typeof cleanValue === "number") {
|
|
1016
|
-
cleanValue = cleanValue.toString();
|
|
1017
|
-
}
|
|
1018
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
1019
|
-
cleanValue = cleanValue.split(",")[0];
|
|
1020
|
-
}
|
|
1021
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
1022
|
-
cleanValue = cleanValue.split(":")[0];
|
|
1023
|
-
}
|
|
1024
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
1025
|
-
cleanValue = cleanValue.split("#")[1];
|
|
1026
|
-
}
|
|
1027
|
-
return cleanValue;
|
|
1028
|
-
};
|
|
1029
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
1030
|
-
if (headerKey !== undefined) {
|
|
1031
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
1032
|
-
}
|
|
1033
|
-
if (data.code !== undefined) {
|
|
1034
|
-
return sanitizeErrorCode(data.code);
|
|
1035
|
-
}
|
|
1036
|
-
if (data["__type"] !== undefined) {
|
|
1037
|
-
return sanitizeErrorCode(data["__type"]);
|
|
1038
|
-
}
|
|
1039
|
-
};
|
|
1
|
+
module.exports = require("../index.js");
|