@aws-sdk/client-cloudhsm-v2 3.490.0 → 3.495.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist-cjs/CloudHSMV2.js +1 -41
  2. package/dist-cjs/CloudHSMV2Client.js +1 -43
  3. package/dist-cjs/commands/CopyBackupToRegionCommand.js +1 -28
  4. package/dist-cjs/commands/CreateClusterCommand.js +1 -28
  5. package/dist-cjs/commands/CreateHsmCommand.js +1 -28
  6. package/dist-cjs/commands/DeleteBackupCommand.js +1 -28
  7. package/dist-cjs/commands/DeleteClusterCommand.js +1 -28
  8. package/dist-cjs/commands/DeleteHsmCommand.js +1 -28
  9. package/dist-cjs/commands/DescribeBackupsCommand.js +1 -28
  10. package/dist-cjs/commands/DescribeClustersCommand.js +1 -28
  11. package/dist-cjs/commands/InitializeClusterCommand.js +1 -28
  12. package/dist-cjs/commands/ListTagsCommand.js +1 -28
  13. package/dist-cjs/commands/ModifyBackupAttributesCommand.js +1 -28
  14. package/dist-cjs/commands/ModifyClusterCommand.js +1 -28
  15. package/dist-cjs/commands/RestoreBackupCommand.js +1 -28
  16. package/dist-cjs/commands/TagResourceCommand.js +1 -28
  17. package/dist-cjs/commands/UntagResourceCommand.js +1 -28
  18. package/dist-cjs/commands/index.js +1 -18
  19. package/dist-cjs/endpoint/EndpointParameters.js +1 -18
  20. package/dist-cjs/extensionConfiguration.js +1 -2
  21. package/dist-cjs/index.js +1636 -11
  22. package/dist-cjs/models/CloudHSMV2ServiceException.js +1 -12
  23. package/dist-cjs/models/index.js +1 -4
  24. package/dist-cjs/models/models_0.js +1 -118
  25. package/dist-cjs/pagination/DescribeBackupsPaginator.js +1 -7
  26. package/dist-cjs/pagination/DescribeClustersPaginator.js +1 -7
  27. package/dist-cjs/pagination/Interfaces.js +1 -2
  28. package/dist-cjs/pagination/ListTagsPaginator.js +1 -7
  29. package/dist-cjs/pagination/index.js +1 -7
  30. package/dist-cjs/protocols/Aws_json1_1.js +1 -1039
  31. package/dist-cjs/runtimeExtensions.js +1 -22
  32. package/package.json +40 -40
package/dist-cjs/index.js CHANGED
@@ -1,12 +1,1637 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CloudHSMV2ServiceException = void 0;
4
- const tslib_1 = require("tslib");
5
- tslib_1.__exportStar(require("./CloudHSMV2Client"), exports);
6
- tslib_1.__exportStar(require("./CloudHSMV2"), exports);
7
- tslib_1.__exportStar(require("./commands"), exports);
8
- tslib_1.__exportStar(require("./pagination"), exports);
9
- tslib_1.__exportStar(require("./models"), exports);
10
- require("@aws-sdk/util-endpoints");
11
- var CloudHSMV2ServiceException_1 = require("./models/CloudHSMV2ServiceException");
12
- Object.defineProperty(exports, "CloudHSMV2ServiceException", { enumerable: true, get: function () { return CloudHSMV2ServiceException_1.CloudHSMV2ServiceException; } });
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/index.ts
22
+ var src_exports = {};
23
+ __export(src_exports, {
24
+ BackupPolicy: () => BackupPolicy,
25
+ BackupRetentionType: () => BackupRetentionType,
26
+ BackupState: () => BackupState,
27
+ CloudHSMV2: () => CloudHSMV2,
28
+ CloudHSMV2Client: () => CloudHSMV2Client,
29
+ CloudHSMV2ServiceException: () => CloudHSMV2ServiceException,
30
+ CloudHsmAccessDeniedException: () => CloudHsmAccessDeniedException,
31
+ CloudHsmInternalFailureException: () => CloudHsmInternalFailureException,
32
+ CloudHsmInvalidRequestException: () => CloudHsmInvalidRequestException,
33
+ CloudHsmResourceNotFoundException: () => CloudHsmResourceNotFoundException,
34
+ CloudHsmServiceException: () => CloudHsmServiceException,
35
+ CloudHsmTagException: () => CloudHsmTagException,
36
+ ClusterState: () => ClusterState,
37
+ CopyBackupToRegionCommand: () => CopyBackupToRegionCommand,
38
+ CreateClusterCommand: () => CreateClusterCommand,
39
+ CreateHsmCommand: () => CreateHsmCommand,
40
+ DeleteBackupCommand: () => DeleteBackupCommand,
41
+ DeleteClusterCommand: () => DeleteClusterCommand,
42
+ DeleteHsmCommand: () => DeleteHsmCommand,
43
+ DescribeBackupsCommand: () => DescribeBackupsCommand,
44
+ DescribeClustersCommand: () => DescribeClustersCommand,
45
+ HsmState: () => HsmState,
46
+ InitializeClusterCommand: () => InitializeClusterCommand,
47
+ ListTagsCommand: () => ListTagsCommand,
48
+ ModifyBackupAttributesCommand: () => ModifyBackupAttributesCommand,
49
+ ModifyClusterCommand: () => ModifyClusterCommand,
50
+ RestoreBackupCommand: () => RestoreBackupCommand,
51
+ TagResourceCommand: () => TagResourceCommand,
52
+ UntagResourceCommand: () => UntagResourceCommand,
53
+ __Client: () => import_smithy_client.Client,
54
+ paginateDescribeBackups: () => paginateDescribeBackups,
55
+ paginateDescribeClusters: () => paginateDescribeClusters,
56
+ paginateListTags: () => paginateListTags
57
+ });
58
+ module.exports = __toCommonJS(src_exports);
59
+
60
+ // src/CloudHSMV2Client.ts
61
+ var import_middleware_host_header = require("@aws-sdk/middleware-host-header");
62
+ var import_middleware_logger = require("@aws-sdk/middleware-logger");
63
+ var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
64
+ var import_middleware_signing = require("@aws-sdk/middleware-signing");
65
+ var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
66
+ var import_config_resolver = require("@smithy/config-resolver");
67
+ var import_middleware_content_length = require("@smithy/middleware-content-length");
68
+ var import_middleware_endpoint = require("@smithy/middleware-endpoint");
69
+ var import_middleware_retry = require("@smithy/middleware-retry");
70
+
71
+
72
+ // src/endpoint/EndpointParameters.ts
73
+ var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
74
+ return {
75
+ ...options,
76
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
77
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
78
+ defaultSigningName: "cloudhsm"
79
+ };
80
+ }, "resolveClientEndpointParameters");
81
+ var commonParams = {
82
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
83
+ Endpoint: { type: "builtInParams", name: "endpoint" },
84
+ Region: { type: "builtInParams", name: "region" },
85
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
86
+ };
87
+
88
+ // src/CloudHSMV2Client.ts
89
+ var import_runtimeConfig = require("././runtimeConfig");
90
+
91
+ // src/runtimeExtensions.ts
92
+ var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
93
+ var import_protocol_http = require("@smithy/protocol-http");
94
+ var import_smithy_client = require("@smithy/smithy-client");
95
+ var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial");
96
+ var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
97
+ const extensionConfiguration = {
98
+ ...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)),
99
+ ...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)),
100
+ ...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig))
101
+ };
102
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
103
+ return {
104
+ ...runtimeConfig,
105
+ ...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
106
+ ...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
107
+ ...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration)
108
+ };
109
+ }, "resolveRuntimeExtensions");
110
+
111
+ // src/CloudHSMV2Client.ts
112
+ var _CloudHSMV2Client = class _CloudHSMV2Client extends import_smithy_client.Client {
113
+ constructor(...[configuration]) {
114
+ const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
115
+ const _config_1 = resolveClientEndpointParameters(_config_0);
116
+ const _config_2 = (0, import_config_resolver.resolveRegionConfig)(_config_1);
117
+ const _config_3 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_2);
118
+ const _config_4 = (0, import_middleware_retry.resolveRetryConfig)(_config_3);
119
+ const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
120
+ const _config_6 = (0, import_middleware_signing.resolveAwsAuthConfig)(_config_5);
121
+ const _config_7 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_6);
122
+ const _config_8 = resolveRuntimeExtensions(_config_7, (configuration == null ? void 0 : configuration.extensions) || []);
123
+ super(_config_8);
124
+ this.config = _config_8;
125
+ this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
126
+ this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
127
+ this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
128
+ this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
129
+ this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
130
+ this.middlewareStack.use((0, import_middleware_signing.getAwsAuthPlugin)(this.config));
131
+ this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
132
+ }
133
+ /**
134
+ * Destroy underlying resources, like sockets. It's usually not necessary to do this.
135
+ * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
136
+ * Otherwise, sockets might stay open for quite a long time before the server terminates them.
137
+ */
138
+ destroy() {
139
+ super.destroy();
140
+ }
141
+ };
142
+ __name(_CloudHSMV2Client, "CloudHSMV2Client");
143
+ var CloudHSMV2Client = _CloudHSMV2Client;
144
+
145
+ // src/CloudHSMV2.ts
146
+
147
+
148
+ // src/commands/CopyBackupToRegionCommand.ts
149
+
150
+ var import_middleware_serde = require("@smithy/middleware-serde");
151
+
152
+ var import_types = require("@smithy/types");
153
+
154
+ // src/protocols/Aws_json1_1.ts
155
+
156
+
157
+
158
+ // src/models/CloudHSMV2ServiceException.ts
159
+
160
+ var _CloudHSMV2ServiceException = class _CloudHSMV2ServiceException extends import_smithy_client.ServiceException {
161
+ /**
162
+ * @internal
163
+ */
164
+ constructor(options) {
165
+ super(options);
166
+ Object.setPrototypeOf(this, _CloudHSMV2ServiceException.prototype);
167
+ }
168
+ };
169
+ __name(_CloudHSMV2ServiceException, "CloudHSMV2ServiceException");
170
+ var CloudHSMV2ServiceException = _CloudHSMV2ServiceException;
171
+
172
+ // src/models/models_0.ts
173
+ var BackupState = {
174
+ CREATE_IN_PROGRESS: "CREATE_IN_PROGRESS",
175
+ DELETED: "DELETED",
176
+ PENDING_DELETION: "PENDING_DELETION",
177
+ READY: "READY"
178
+ };
179
+ var BackupPolicy = {
180
+ DEFAULT: "DEFAULT"
181
+ };
182
+ var BackupRetentionType = {
183
+ DAYS: "DAYS"
184
+ };
185
+ var _CloudHsmAccessDeniedException = class _CloudHsmAccessDeniedException extends CloudHSMV2ServiceException {
186
+ /**
187
+ * @internal
188
+ */
189
+ constructor(opts) {
190
+ super({
191
+ name: "CloudHsmAccessDeniedException",
192
+ $fault: "client",
193
+ ...opts
194
+ });
195
+ this.name = "CloudHsmAccessDeniedException";
196
+ this.$fault = "client";
197
+ Object.setPrototypeOf(this, _CloudHsmAccessDeniedException.prototype);
198
+ this.Message = opts.Message;
199
+ }
200
+ };
201
+ __name(_CloudHsmAccessDeniedException, "CloudHsmAccessDeniedException");
202
+ var CloudHsmAccessDeniedException = _CloudHsmAccessDeniedException;
203
+ var _CloudHsmInternalFailureException = class _CloudHsmInternalFailureException extends CloudHSMV2ServiceException {
204
+ /**
205
+ * @internal
206
+ */
207
+ constructor(opts) {
208
+ super({
209
+ name: "CloudHsmInternalFailureException",
210
+ $fault: "server",
211
+ ...opts
212
+ });
213
+ this.name = "CloudHsmInternalFailureException";
214
+ this.$fault = "server";
215
+ Object.setPrototypeOf(this, _CloudHsmInternalFailureException.prototype);
216
+ this.Message = opts.Message;
217
+ }
218
+ };
219
+ __name(_CloudHsmInternalFailureException, "CloudHsmInternalFailureException");
220
+ var CloudHsmInternalFailureException = _CloudHsmInternalFailureException;
221
+ var _CloudHsmInvalidRequestException = class _CloudHsmInvalidRequestException extends CloudHSMV2ServiceException {
222
+ /**
223
+ * @internal
224
+ */
225
+ constructor(opts) {
226
+ super({
227
+ name: "CloudHsmInvalidRequestException",
228
+ $fault: "client",
229
+ ...opts
230
+ });
231
+ this.name = "CloudHsmInvalidRequestException";
232
+ this.$fault = "client";
233
+ Object.setPrototypeOf(this, _CloudHsmInvalidRequestException.prototype);
234
+ this.Message = opts.Message;
235
+ }
236
+ };
237
+ __name(_CloudHsmInvalidRequestException, "CloudHsmInvalidRequestException");
238
+ var CloudHsmInvalidRequestException = _CloudHsmInvalidRequestException;
239
+ var _CloudHsmResourceNotFoundException = class _CloudHsmResourceNotFoundException extends CloudHSMV2ServiceException {
240
+ /**
241
+ * @internal
242
+ */
243
+ constructor(opts) {
244
+ super({
245
+ name: "CloudHsmResourceNotFoundException",
246
+ $fault: "client",
247
+ ...opts
248
+ });
249
+ this.name = "CloudHsmResourceNotFoundException";
250
+ this.$fault = "client";
251
+ Object.setPrototypeOf(this, _CloudHsmResourceNotFoundException.prototype);
252
+ this.Message = opts.Message;
253
+ }
254
+ };
255
+ __name(_CloudHsmResourceNotFoundException, "CloudHsmResourceNotFoundException");
256
+ var CloudHsmResourceNotFoundException = _CloudHsmResourceNotFoundException;
257
+ var _CloudHsmServiceException = class _CloudHsmServiceException extends CloudHSMV2ServiceException {
258
+ /**
259
+ * @internal
260
+ */
261
+ constructor(opts) {
262
+ super({
263
+ name: "CloudHsmServiceException",
264
+ $fault: "client",
265
+ ...opts
266
+ });
267
+ this.name = "CloudHsmServiceException";
268
+ this.$fault = "client";
269
+ Object.setPrototypeOf(this, _CloudHsmServiceException.prototype);
270
+ this.Message = opts.Message;
271
+ }
272
+ };
273
+ __name(_CloudHsmServiceException, "CloudHsmServiceException");
274
+ var CloudHsmServiceException = _CloudHsmServiceException;
275
+ var _CloudHsmTagException = class _CloudHsmTagException extends CloudHSMV2ServiceException {
276
+ /**
277
+ * @internal
278
+ */
279
+ constructor(opts) {
280
+ super({
281
+ name: "CloudHsmTagException",
282
+ $fault: "client",
283
+ ...opts
284
+ });
285
+ this.name = "CloudHsmTagException";
286
+ this.$fault = "client";
287
+ Object.setPrototypeOf(this, _CloudHsmTagException.prototype);
288
+ this.Message = opts.Message;
289
+ }
290
+ };
291
+ __name(_CloudHsmTagException, "CloudHsmTagException");
292
+ var CloudHsmTagException = _CloudHsmTagException;
293
+ var HsmState = {
294
+ ACTIVE: "ACTIVE",
295
+ CREATE_IN_PROGRESS: "CREATE_IN_PROGRESS",
296
+ DEGRADED: "DEGRADED",
297
+ DELETED: "DELETED",
298
+ DELETE_IN_PROGRESS: "DELETE_IN_PROGRESS"
299
+ };
300
+ var ClusterState = {
301
+ ACTIVE: "ACTIVE",
302
+ CREATE_IN_PROGRESS: "CREATE_IN_PROGRESS",
303
+ DEGRADED: "DEGRADED",
304
+ DELETED: "DELETED",
305
+ DELETE_IN_PROGRESS: "DELETE_IN_PROGRESS",
306
+ INITIALIZED: "INITIALIZED",
307
+ INITIALIZE_IN_PROGRESS: "INITIALIZE_IN_PROGRESS",
308
+ UNINITIALIZED: "UNINITIALIZED",
309
+ UPDATE_IN_PROGRESS: "UPDATE_IN_PROGRESS"
310
+ };
311
+
312
+ // src/protocols/Aws_json1_1.ts
313
+ var se_CopyBackupToRegionCommand = /* @__PURE__ */ __name(async (input, context) => {
314
+ const headers = sharedHeaders("CopyBackupToRegion");
315
+ let body;
316
+ body = JSON.stringify((0, import_smithy_client._json)(input));
317
+ return buildHttpRpcRequest(context, headers, "/", void 0, body);
318
+ }, "se_CopyBackupToRegionCommand");
319
+ var se_CreateClusterCommand = /* @__PURE__ */ __name(async (input, context) => {
320
+ const headers = sharedHeaders("CreateCluster");
321
+ let body;
322
+ body = JSON.stringify((0, import_smithy_client._json)(input));
323
+ return buildHttpRpcRequest(context, headers, "/", void 0, body);
324
+ }, "se_CreateClusterCommand");
325
+ var se_CreateHsmCommand = /* @__PURE__ */ __name(async (input, context) => {
326
+ const headers = sharedHeaders("CreateHsm");
327
+ let body;
328
+ body = JSON.stringify((0, import_smithy_client._json)(input));
329
+ return buildHttpRpcRequest(context, headers, "/", void 0, body);
330
+ }, "se_CreateHsmCommand");
331
+ var se_DeleteBackupCommand = /* @__PURE__ */ __name(async (input, context) => {
332
+ const headers = sharedHeaders("DeleteBackup");
333
+ let body;
334
+ body = JSON.stringify((0, import_smithy_client._json)(input));
335
+ return buildHttpRpcRequest(context, headers, "/", void 0, body);
336
+ }, "se_DeleteBackupCommand");
337
+ var se_DeleteClusterCommand = /* @__PURE__ */ __name(async (input, context) => {
338
+ const headers = sharedHeaders("DeleteCluster");
339
+ let body;
340
+ body = JSON.stringify((0, import_smithy_client._json)(input));
341
+ return buildHttpRpcRequest(context, headers, "/", void 0, body);
342
+ }, "se_DeleteClusterCommand");
343
+ var se_DeleteHsmCommand = /* @__PURE__ */ __name(async (input, context) => {
344
+ const headers = sharedHeaders("DeleteHsm");
345
+ let body;
346
+ body = JSON.stringify((0, import_smithy_client._json)(input));
347
+ return buildHttpRpcRequest(context, headers, "/", void 0, body);
348
+ }, "se_DeleteHsmCommand");
349
+ var se_DescribeBackupsCommand = /* @__PURE__ */ __name(async (input, context) => {
350
+ const headers = sharedHeaders("DescribeBackups");
351
+ let body;
352
+ body = JSON.stringify((0, import_smithy_client._json)(input));
353
+ return buildHttpRpcRequest(context, headers, "/", void 0, body);
354
+ }, "se_DescribeBackupsCommand");
355
+ var se_DescribeClustersCommand = /* @__PURE__ */ __name(async (input, context) => {
356
+ const headers = sharedHeaders("DescribeClusters");
357
+ let body;
358
+ body = JSON.stringify((0, import_smithy_client._json)(input));
359
+ return buildHttpRpcRequest(context, headers, "/", void 0, body);
360
+ }, "se_DescribeClustersCommand");
361
+ var se_InitializeClusterCommand = /* @__PURE__ */ __name(async (input, context) => {
362
+ const headers = sharedHeaders("InitializeCluster");
363
+ let body;
364
+ body = JSON.stringify((0, import_smithy_client._json)(input));
365
+ return buildHttpRpcRequest(context, headers, "/", void 0, body);
366
+ }, "se_InitializeClusterCommand");
367
+ var se_ListTagsCommand = /* @__PURE__ */ __name(async (input, context) => {
368
+ const headers = sharedHeaders("ListTags");
369
+ let body;
370
+ body = JSON.stringify((0, import_smithy_client._json)(input));
371
+ return buildHttpRpcRequest(context, headers, "/", void 0, body);
372
+ }, "se_ListTagsCommand");
373
+ var se_ModifyBackupAttributesCommand = /* @__PURE__ */ __name(async (input, context) => {
374
+ const headers = sharedHeaders("ModifyBackupAttributes");
375
+ let body;
376
+ body = JSON.stringify((0, import_smithy_client._json)(input));
377
+ return buildHttpRpcRequest(context, headers, "/", void 0, body);
378
+ }, "se_ModifyBackupAttributesCommand");
379
+ var se_ModifyClusterCommand = /* @__PURE__ */ __name(async (input, context) => {
380
+ const headers = sharedHeaders("ModifyCluster");
381
+ let body;
382
+ body = JSON.stringify((0, import_smithy_client._json)(input));
383
+ return buildHttpRpcRequest(context, headers, "/", void 0, body);
384
+ }, "se_ModifyClusterCommand");
385
+ var se_RestoreBackupCommand = /* @__PURE__ */ __name(async (input, context) => {
386
+ const headers = sharedHeaders("RestoreBackup");
387
+ let body;
388
+ body = JSON.stringify((0, import_smithy_client._json)(input));
389
+ return buildHttpRpcRequest(context, headers, "/", void 0, body);
390
+ }, "se_RestoreBackupCommand");
391
+ var se_TagResourceCommand = /* @__PURE__ */ __name(async (input, context) => {
392
+ const headers = sharedHeaders("TagResource");
393
+ let body;
394
+ body = JSON.stringify((0, import_smithy_client._json)(input));
395
+ return buildHttpRpcRequest(context, headers, "/", void 0, body);
396
+ }, "se_TagResourceCommand");
397
+ var se_UntagResourceCommand = /* @__PURE__ */ __name(async (input, context) => {
398
+ const headers = sharedHeaders("UntagResource");
399
+ let body;
400
+ body = JSON.stringify((0, import_smithy_client._json)(input));
401
+ return buildHttpRpcRequest(context, headers, "/", void 0, body);
402
+ }, "se_UntagResourceCommand");
403
+ var de_CopyBackupToRegionCommand = /* @__PURE__ */ __name(async (output, context) => {
404
+ if (output.statusCode >= 300) {
405
+ return de_CopyBackupToRegionCommandError(output, context);
406
+ }
407
+ const data = await parseBody(output.body, context);
408
+ let contents = {};
409
+ contents = de_CopyBackupToRegionResponse(data, context);
410
+ const response = {
411
+ $metadata: deserializeMetadata(output),
412
+ ...contents
413
+ };
414
+ return response;
415
+ }, "de_CopyBackupToRegionCommand");
416
+ var de_CopyBackupToRegionCommandError = /* @__PURE__ */ __name(async (output, context) => {
417
+ const parsedOutput = {
418
+ ...output,
419
+ body: await parseErrorBody(output.body, context)
420
+ };
421
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
422
+ switch (errorCode) {
423
+ case "CloudHsmAccessDeniedException":
424
+ case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
425
+ throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
426
+ case "CloudHsmInternalFailureException":
427
+ case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
428
+ throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
429
+ case "CloudHsmInvalidRequestException":
430
+ case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
431
+ throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
432
+ case "CloudHsmResourceNotFoundException":
433
+ case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException":
434
+ throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context);
435
+ case "CloudHsmServiceException":
436
+ case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
437
+ throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
438
+ case "CloudHsmTagException":
439
+ case "com.amazonaws.cloudhsmv2#CloudHsmTagException":
440
+ throw await de_CloudHsmTagExceptionRes(parsedOutput, context);
441
+ default:
442
+ const parsedBody = parsedOutput.body;
443
+ return throwDefaultError({
444
+ output,
445
+ parsedBody,
446
+ errorCode
447
+ });
448
+ }
449
+ }, "de_CopyBackupToRegionCommandError");
450
+ var de_CreateClusterCommand = /* @__PURE__ */ __name(async (output, context) => {
451
+ if (output.statusCode >= 300) {
452
+ return de_CreateClusterCommandError(output, context);
453
+ }
454
+ const data = await parseBody(output.body, context);
455
+ let contents = {};
456
+ contents = de_CreateClusterResponse(data, context);
457
+ const response = {
458
+ $metadata: deserializeMetadata(output),
459
+ ...contents
460
+ };
461
+ return response;
462
+ }, "de_CreateClusterCommand");
463
+ var de_CreateClusterCommandError = /* @__PURE__ */ __name(async (output, context) => {
464
+ const parsedOutput = {
465
+ ...output,
466
+ body: await parseErrorBody(output.body, context)
467
+ };
468
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
469
+ switch (errorCode) {
470
+ case "CloudHsmAccessDeniedException":
471
+ case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
472
+ throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
473
+ case "CloudHsmInternalFailureException":
474
+ case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
475
+ throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
476
+ case "CloudHsmInvalidRequestException":
477
+ case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
478
+ throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
479
+ case "CloudHsmResourceNotFoundException":
480
+ case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException":
481
+ throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context);
482
+ case "CloudHsmServiceException":
483
+ case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
484
+ throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
485
+ case "CloudHsmTagException":
486
+ case "com.amazonaws.cloudhsmv2#CloudHsmTagException":
487
+ throw await de_CloudHsmTagExceptionRes(parsedOutput, context);
488
+ default:
489
+ const parsedBody = parsedOutput.body;
490
+ return throwDefaultError({
491
+ output,
492
+ parsedBody,
493
+ errorCode
494
+ });
495
+ }
496
+ }, "de_CreateClusterCommandError");
497
+ var de_CreateHsmCommand = /* @__PURE__ */ __name(async (output, context) => {
498
+ if (output.statusCode >= 300) {
499
+ return de_CreateHsmCommandError(output, context);
500
+ }
501
+ const data = await parseBody(output.body, context);
502
+ let contents = {};
503
+ contents = (0, import_smithy_client._json)(data);
504
+ const response = {
505
+ $metadata: deserializeMetadata(output),
506
+ ...contents
507
+ };
508
+ return response;
509
+ }, "de_CreateHsmCommand");
510
+ var de_CreateHsmCommandError = /* @__PURE__ */ __name(async (output, context) => {
511
+ const parsedOutput = {
512
+ ...output,
513
+ body: await parseErrorBody(output.body, context)
514
+ };
515
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
516
+ switch (errorCode) {
517
+ case "CloudHsmAccessDeniedException":
518
+ case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
519
+ throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
520
+ case "CloudHsmInternalFailureException":
521
+ case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
522
+ throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
523
+ case "CloudHsmInvalidRequestException":
524
+ case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
525
+ throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
526
+ case "CloudHsmResourceNotFoundException":
527
+ case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException":
528
+ throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context);
529
+ case "CloudHsmServiceException":
530
+ case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
531
+ throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
532
+ default:
533
+ const parsedBody = parsedOutput.body;
534
+ return throwDefaultError({
535
+ output,
536
+ parsedBody,
537
+ errorCode
538
+ });
539
+ }
540
+ }, "de_CreateHsmCommandError");
541
+ var de_DeleteBackupCommand = /* @__PURE__ */ __name(async (output, context) => {
542
+ if (output.statusCode >= 300) {
543
+ return de_DeleteBackupCommandError(output, context);
544
+ }
545
+ const data = await parseBody(output.body, context);
546
+ let contents = {};
547
+ contents = de_DeleteBackupResponse(data, context);
548
+ const response = {
549
+ $metadata: deserializeMetadata(output),
550
+ ...contents
551
+ };
552
+ return response;
553
+ }, "de_DeleteBackupCommand");
554
+ var de_DeleteBackupCommandError = /* @__PURE__ */ __name(async (output, context) => {
555
+ const parsedOutput = {
556
+ ...output,
557
+ body: await parseErrorBody(output.body, context)
558
+ };
559
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
560
+ switch (errorCode) {
561
+ case "CloudHsmAccessDeniedException":
562
+ case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
563
+ throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
564
+ case "CloudHsmInternalFailureException":
565
+ case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
566
+ throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
567
+ case "CloudHsmInvalidRequestException":
568
+ case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
569
+ throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
570
+ case "CloudHsmResourceNotFoundException":
571
+ case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException":
572
+ throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context);
573
+ case "CloudHsmServiceException":
574
+ case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
575
+ throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
576
+ default:
577
+ const parsedBody = parsedOutput.body;
578
+ return throwDefaultError({
579
+ output,
580
+ parsedBody,
581
+ errorCode
582
+ });
583
+ }
584
+ }, "de_DeleteBackupCommandError");
585
+ var de_DeleteClusterCommand = /* @__PURE__ */ __name(async (output, context) => {
586
+ if (output.statusCode >= 300) {
587
+ return de_DeleteClusterCommandError(output, context);
588
+ }
589
+ const data = await parseBody(output.body, context);
590
+ let contents = {};
591
+ contents = de_DeleteClusterResponse(data, context);
592
+ const response = {
593
+ $metadata: deserializeMetadata(output),
594
+ ...contents
595
+ };
596
+ return response;
597
+ }, "de_DeleteClusterCommand");
598
+ var de_DeleteClusterCommandError = /* @__PURE__ */ __name(async (output, context) => {
599
+ const parsedOutput = {
600
+ ...output,
601
+ body: await parseErrorBody(output.body, context)
602
+ };
603
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
604
+ switch (errorCode) {
605
+ case "CloudHsmAccessDeniedException":
606
+ case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
607
+ throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
608
+ case "CloudHsmInternalFailureException":
609
+ case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
610
+ throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
611
+ case "CloudHsmInvalidRequestException":
612
+ case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
613
+ throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
614
+ case "CloudHsmResourceNotFoundException":
615
+ case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException":
616
+ throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context);
617
+ case "CloudHsmServiceException":
618
+ case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
619
+ throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
620
+ case "CloudHsmTagException":
621
+ case "com.amazonaws.cloudhsmv2#CloudHsmTagException":
622
+ throw await de_CloudHsmTagExceptionRes(parsedOutput, context);
623
+ default:
624
+ const parsedBody = parsedOutput.body;
625
+ return throwDefaultError({
626
+ output,
627
+ parsedBody,
628
+ errorCode
629
+ });
630
+ }
631
+ }, "de_DeleteClusterCommandError");
632
+ var de_DeleteHsmCommand = /* @__PURE__ */ __name(async (output, context) => {
633
+ if (output.statusCode >= 300) {
634
+ return de_DeleteHsmCommandError(output, context);
635
+ }
636
+ const data = await parseBody(output.body, context);
637
+ let contents = {};
638
+ contents = (0, import_smithy_client._json)(data);
639
+ const response = {
640
+ $metadata: deserializeMetadata(output),
641
+ ...contents
642
+ };
643
+ return response;
644
+ }, "de_DeleteHsmCommand");
645
+ var de_DeleteHsmCommandError = /* @__PURE__ */ __name(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 "CloudHsmAccessDeniedException":
653
+ case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
654
+ throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
655
+ case "CloudHsmInternalFailureException":
656
+ case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
657
+ throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
658
+ case "CloudHsmInvalidRequestException":
659
+ case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
660
+ throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
661
+ case "CloudHsmResourceNotFoundException":
662
+ case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException":
663
+ throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context);
664
+ case "CloudHsmServiceException":
665
+ case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
666
+ throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
667
+ default:
668
+ const parsedBody = parsedOutput.body;
669
+ return throwDefaultError({
670
+ output,
671
+ parsedBody,
672
+ errorCode
673
+ });
674
+ }
675
+ }, "de_DeleteHsmCommandError");
676
+ var de_DescribeBackupsCommand = /* @__PURE__ */ __name(async (output, context) => {
677
+ if (output.statusCode >= 300) {
678
+ return de_DescribeBackupsCommandError(output, context);
679
+ }
680
+ const data = await parseBody(output.body, context);
681
+ let contents = {};
682
+ contents = de_DescribeBackupsResponse(data, context);
683
+ const response = {
684
+ $metadata: deserializeMetadata(output),
685
+ ...contents
686
+ };
687
+ return response;
688
+ }, "de_DescribeBackupsCommand");
689
+ var de_DescribeBackupsCommandError = /* @__PURE__ */ __name(async (output, context) => {
690
+ const parsedOutput = {
691
+ ...output,
692
+ body: await parseErrorBody(output.body, context)
693
+ };
694
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
695
+ switch (errorCode) {
696
+ case "CloudHsmAccessDeniedException":
697
+ case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
698
+ throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
699
+ case "CloudHsmInternalFailureException":
700
+ case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
701
+ throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
702
+ case "CloudHsmInvalidRequestException":
703
+ case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
704
+ throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
705
+ case "CloudHsmResourceNotFoundException":
706
+ case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException":
707
+ throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context);
708
+ case "CloudHsmServiceException":
709
+ case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
710
+ throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
711
+ case "CloudHsmTagException":
712
+ case "com.amazonaws.cloudhsmv2#CloudHsmTagException":
713
+ throw await de_CloudHsmTagExceptionRes(parsedOutput, context);
714
+ default:
715
+ const parsedBody = parsedOutput.body;
716
+ return throwDefaultError({
717
+ output,
718
+ parsedBody,
719
+ errorCode
720
+ });
721
+ }
722
+ }, "de_DescribeBackupsCommandError");
723
+ var de_DescribeClustersCommand = /* @__PURE__ */ __name(async (output, context) => {
724
+ if (output.statusCode >= 300) {
725
+ return de_DescribeClustersCommandError(output, context);
726
+ }
727
+ const data = await parseBody(output.body, context);
728
+ let contents = {};
729
+ contents = de_DescribeClustersResponse(data, context);
730
+ const response = {
731
+ $metadata: deserializeMetadata(output),
732
+ ...contents
733
+ };
734
+ return response;
735
+ }, "de_DescribeClustersCommand");
736
+ var de_DescribeClustersCommandError = /* @__PURE__ */ __name(async (output, context) => {
737
+ const parsedOutput = {
738
+ ...output,
739
+ body: await parseErrorBody(output.body, context)
740
+ };
741
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
742
+ switch (errorCode) {
743
+ case "CloudHsmAccessDeniedException":
744
+ case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
745
+ throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
746
+ case "CloudHsmInternalFailureException":
747
+ case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
748
+ throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
749
+ case "CloudHsmInvalidRequestException":
750
+ case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
751
+ throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
752
+ case "CloudHsmServiceException":
753
+ case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
754
+ throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
755
+ case "CloudHsmTagException":
756
+ case "com.amazonaws.cloudhsmv2#CloudHsmTagException":
757
+ throw await de_CloudHsmTagExceptionRes(parsedOutput, context);
758
+ default:
759
+ const parsedBody = parsedOutput.body;
760
+ return throwDefaultError({
761
+ output,
762
+ parsedBody,
763
+ errorCode
764
+ });
765
+ }
766
+ }, "de_DescribeClustersCommandError");
767
+ var de_InitializeClusterCommand = /* @__PURE__ */ __name(async (output, context) => {
768
+ if (output.statusCode >= 300) {
769
+ return de_InitializeClusterCommandError(output, context);
770
+ }
771
+ const data = await parseBody(output.body, context);
772
+ let contents = {};
773
+ contents = (0, import_smithy_client._json)(data);
774
+ const response = {
775
+ $metadata: deserializeMetadata(output),
776
+ ...contents
777
+ };
778
+ return response;
779
+ }, "de_InitializeClusterCommand");
780
+ var de_InitializeClusterCommandError = /* @__PURE__ */ __name(async (output, context) => {
781
+ const parsedOutput = {
782
+ ...output,
783
+ body: await parseErrorBody(output.body, context)
784
+ };
785
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
786
+ switch (errorCode) {
787
+ case "CloudHsmAccessDeniedException":
788
+ case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
789
+ throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
790
+ case "CloudHsmInternalFailureException":
791
+ case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
792
+ throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
793
+ case "CloudHsmInvalidRequestException":
794
+ case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
795
+ throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
796
+ case "CloudHsmResourceNotFoundException":
797
+ case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException":
798
+ throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context);
799
+ case "CloudHsmServiceException":
800
+ case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
801
+ throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
802
+ default:
803
+ const parsedBody = parsedOutput.body;
804
+ return throwDefaultError({
805
+ output,
806
+ parsedBody,
807
+ errorCode
808
+ });
809
+ }
810
+ }, "de_InitializeClusterCommandError");
811
+ var de_ListTagsCommand = /* @__PURE__ */ __name(async (output, context) => {
812
+ if (output.statusCode >= 300) {
813
+ return de_ListTagsCommandError(output, context);
814
+ }
815
+ const data = await parseBody(output.body, context);
816
+ let contents = {};
817
+ contents = (0, import_smithy_client._json)(data);
818
+ const response = {
819
+ $metadata: deserializeMetadata(output),
820
+ ...contents
821
+ };
822
+ return response;
823
+ }, "de_ListTagsCommand");
824
+ var de_ListTagsCommandError = /* @__PURE__ */ __name(async (output, context) => {
825
+ const parsedOutput = {
826
+ ...output,
827
+ body: await parseErrorBody(output.body, context)
828
+ };
829
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
830
+ switch (errorCode) {
831
+ case "CloudHsmAccessDeniedException":
832
+ case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
833
+ throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
834
+ case "CloudHsmInternalFailureException":
835
+ case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
836
+ throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
837
+ case "CloudHsmInvalidRequestException":
838
+ case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
839
+ throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
840
+ case "CloudHsmResourceNotFoundException":
841
+ case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException":
842
+ throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context);
843
+ case "CloudHsmServiceException":
844
+ case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
845
+ throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
846
+ case "CloudHsmTagException":
847
+ case "com.amazonaws.cloudhsmv2#CloudHsmTagException":
848
+ throw await de_CloudHsmTagExceptionRes(parsedOutput, context);
849
+ default:
850
+ const parsedBody = parsedOutput.body;
851
+ return throwDefaultError({
852
+ output,
853
+ parsedBody,
854
+ errorCode
855
+ });
856
+ }
857
+ }, "de_ListTagsCommandError");
858
+ var de_ModifyBackupAttributesCommand = /* @__PURE__ */ __name(async (output, context) => {
859
+ if (output.statusCode >= 300) {
860
+ return de_ModifyBackupAttributesCommandError(output, context);
861
+ }
862
+ const data = await parseBody(output.body, context);
863
+ let contents = {};
864
+ contents = de_ModifyBackupAttributesResponse(data, context);
865
+ const response = {
866
+ $metadata: deserializeMetadata(output),
867
+ ...contents
868
+ };
869
+ return response;
870
+ }, "de_ModifyBackupAttributesCommand");
871
+ var de_ModifyBackupAttributesCommandError = /* @__PURE__ */ __name(async (output, context) => {
872
+ const parsedOutput = {
873
+ ...output,
874
+ body: await parseErrorBody(output.body, context)
875
+ };
876
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
877
+ switch (errorCode) {
878
+ case "CloudHsmAccessDeniedException":
879
+ case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
880
+ throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
881
+ case "CloudHsmInternalFailureException":
882
+ case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
883
+ throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
884
+ case "CloudHsmInvalidRequestException":
885
+ case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
886
+ throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
887
+ case "CloudHsmResourceNotFoundException":
888
+ case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException":
889
+ throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context);
890
+ case "CloudHsmServiceException":
891
+ case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
892
+ throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
893
+ default:
894
+ const parsedBody = parsedOutput.body;
895
+ return throwDefaultError({
896
+ output,
897
+ parsedBody,
898
+ errorCode
899
+ });
900
+ }
901
+ }, "de_ModifyBackupAttributesCommandError");
902
+ var de_ModifyClusterCommand = /* @__PURE__ */ __name(async (output, context) => {
903
+ if (output.statusCode >= 300) {
904
+ return de_ModifyClusterCommandError(output, context);
905
+ }
906
+ const data = await parseBody(output.body, context);
907
+ let contents = {};
908
+ contents = de_ModifyClusterResponse(data, context);
909
+ const response = {
910
+ $metadata: deserializeMetadata(output),
911
+ ...contents
912
+ };
913
+ return response;
914
+ }, "de_ModifyClusterCommand");
915
+ var de_ModifyClusterCommandError = /* @__PURE__ */ __name(async (output, context) => {
916
+ const parsedOutput = {
917
+ ...output,
918
+ body: await parseErrorBody(output.body, context)
919
+ };
920
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
921
+ switch (errorCode) {
922
+ case "CloudHsmAccessDeniedException":
923
+ case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
924
+ throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
925
+ case "CloudHsmInternalFailureException":
926
+ case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
927
+ throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
928
+ case "CloudHsmInvalidRequestException":
929
+ case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
930
+ throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
931
+ case "CloudHsmResourceNotFoundException":
932
+ case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException":
933
+ throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context);
934
+ case "CloudHsmServiceException":
935
+ case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
936
+ throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
937
+ default:
938
+ const parsedBody = parsedOutput.body;
939
+ return throwDefaultError({
940
+ output,
941
+ parsedBody,
942
+ errorCode
943
+ });
944
+ }
945
+ }, "de_ModifyClusterCommandError");
946
+ var de_RestoreBackupCommand = /* @__PURE__ */ __name(async (output, context) => {
947
+ if (output.statusCode >= 300) {
948
+ return de_RestoreBackupCommandError(output, context);
949
+ }
950
+ const data = await parseBody(output.body, context);
951
+ let contents = {};
952
+ contents = de_RestoreBackupResponse(data, context);
953
+ const response = {
954
+ $metadata: deserializeMetadata(output),
955
+ ...contents
956
+ };
957
+ return response;
958
+ }, "de_RestoreBackupCommand");
959
+ var de_RestoreBackupCommandError = /* @__PURE__ */ __name(async (output, context) => {
960
+ const parsedOutput = {
961
+ ...output,
962
+ body: await parseErrorBody(output.body, context)
963
+ };
964
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
965
+ switch (errorCode) {
966
+ case "CloudHsmAccessDeniedException":
967
+ case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
968
+ throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
969
+ case "CloudHsmInternalFailureException":
970
+ case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
971
+ throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
972
+ case "CloudHsmInvalidRequestException":
973
+ case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
974
+ throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
975
+ case "CloudHsmResourceNotFoundException":
976
+ case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException":
977
+ throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context);
978
+ case "CloudHsmServiceException":
979
+ case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
980
+ throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
981
+ default:
982
+ const parsedBody = parsedOutput.body;
983
+ return throwDefaultError({
984
+ output,
985
+ parsedBody,
986
+ errorCode
987
+ });
988
+ }
989
+ }, "de_RestoreBackupCommandError");
990
+ var de_TagResourceCommand = /* @__PURE__ */ __name(async (output, context) => {
991
+ if (output.statusCode >= 300) {
992
+ return de_TagResourceCommandError(output, context);
993
+ }
994
+ const data = await parseBody(output.body, context);
995
+ let contents = {};
996
+ contents = (0, import_smithy_client._json)(data);
997
+ const response = {
998
+ $metadata: deserializeMetadata(output),
999
+ ...contents
1000
+ };
1001
+ return response;
1002
+ }, "de_TagResourceCommand");
1003
+ var de_TagResourceCommandError = /* @__PURE__ */ __name(async (output, context) => {
1004
+ const parsedOutput = {
1005
+ ...output,
1006
+ body: await parseErrorBody(output.body, context)
1007
+ };
1008
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1009
+ switch (errorCode) {
1010
+ case "CloudHsmAccessDeniedException":
1011
+ case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
1012
+ throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
1013
+ case "CloudHsmInternalFailureException":
1014
+ case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
1015
+ throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
1016
+ case "CloudHsmInvalidRequestException":
1017
+ case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
1018
+ throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
1019
+ case "CloudHsmResourceNotFoundException":
1020
+ case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException":
1021
+ throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context);
1022
+ case "CloudHsmServiceException":
1023
+ case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
1024
+ throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
1025
+ case "CloudHsmTagException":
1026
+ case "com.amazonaws.cloudhsmv2#CloudHsmTagException":
1027
+ throw await de_CloudHsmTagExceptionRes(parsedOutput, context);
1028
+ default:
1029
+ const parsedBody = parsedOutput.body;
1030
+ return throwDefaultError({
1031
+ output,
1032
+ parsedBody,
1033
+ errorCode
1034
+ });
1035
+ }
1036
+ }, "de_TagResourceCommandError");
1037
+ var de_UntagResourceCommand = /* @__PURE__ */ __name(async (output, context) => {
1038
+ if (output.statusCode >= 300) {
1039
+ return de_UntagResourceCommandError(output, context);
1040
+ }
1041
+ const data = await parseBody(output.body, context);
1042
+ let contents = {};
1043
+ contents = (0, import_smithy_client._json)(data);
1044
+ const response = {
1045
+ $metadata: deserializeMetadata(output),
1046
+ ...contents
1047
+ };
1048
+ return response;
1049
+ }, "de_UntagResourceCommand");
1050
+ var de_UntagResourceCommandError = /* @__PURE__ */ __name(async (output, context) => {
1051
+ const parsedOutput = {
1052
+ ...output,
1053
+ body: await parseErrorBody(output.body, context)
1054
+ };
1055
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1056
+ switch (errorCode) {
1057
+ case "CloudHsmAccessDeniedException":
1058
+ case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException":
1059
+ throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context);
1060
+ case "CloudHsmInternalFailureException":
1061
+ case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException":
1062
+ throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context);
1063
+ case "CloudHsmInvalidRequestException":
1064
+ case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException":
1065
+ throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context);
1066
+ case "CloudHsmResourceNotFoundException":
1067
+ case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException":
1068
+ throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context);
1069
+ case "CloudHsmServiceException":
1070
+ case "com.amazonaws.cloudhsmv2#CloudHsmServiceException":
1071
+ throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
1072
+ case "CloudHsmTagException":
1073
+ case "com.amazonaws.cloudhsmv2#CloudHsmTagException":
1074
+ throw await de_CloudHsmTagExceptionRes(parsedOutput, context);
1075
+ default:
1076
+ const parsedBody = parsedOutput.body;
1077
+ return throwDefaultError({
1078
+ output,
1079
+ parsedBody,
1080
+ errorCode
1081
+ });
1082
+ }
1083
+ }, "de_UntagResourceCommandError");
1084
+ var de_CloudHsmAccessDeniedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
1085
+ const body = parsedOutput.body;
1086
+ const deserialized = (0, import_smithy_client._json)(body);
1087
+ const exception = new CloudHsmAccessDeniedException({
1088
+ $metadata: deserializeMetadata(parsedOutput),
1089
+ ...deserialized
1090
+ });
1091
+ return (0, import_smithy_client.decorateServiceException)(exception, body);
1092
+ }, "de_CloudHsmAccessDeniedExceptionRes");
1093
+ var de_CloudHsmInternalFailureExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
1094
+ const body = parsedOutput.body;
1095
+ const deserialized = (0, import_smithy_client._json)(body);
1096
+ const exception = new CloudHsmInternalFailureException({
1097
+ $metadata: deserializeMetadata(parsedOutput),
1098
+ ...deserialized
1099
+ });
1100
+ return (0, import_smithy_client.decorateServiceException)(exception, body);
1101
+ }, "de_CloudHsmInternalFailureExceptionRes");
1102
+ var de_CloudHsmInvalidRequestExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
1103
+ const body = parsedOutput.body;
1104
+ const deserialized = (0, import_smithy_client._json)(body);
1105
+ const exception = new CloudHsmInvalidRequestException({
1106
+ $metadata: deserializeMetadata(parsedOutput),
1107
+ ...deserialized
1108
+ });
1109
+ return (0, import_smithy_client.decorateServiceException)(exception, body);
1110
+ }, "de_CloudHsmInvalidRequestExceptionRes");
1111
+ var de_CloudHsmResourceNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
1112
+ const body = parsedOutput.body;
1113
+ const deserialized = (0, import_smithy_client._json)(body);
1114
+ const exception = new CloudHsmResourceNotFoundException({
1115
+ $metadata: deserializeMetadata(parsedOutput),
1116
+ ...deserialized
1117
+ });
1118
+ return (0, import_smithy_client.decorateServiceException)(exception, body);
1119
+ }, "de_CloudHsmResourceNotFoundExceptionRes");
1120
+ var de_CloudHsmServiceExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
1121
+ const body = parsedOutput.body;
1122
+ const deserialized = (0, import_smithy_client._json)(body);
1123
+ const exception = new CloudHsmServiceException({
1124
+ $metadata: deserializeMetadata(parsedOutput),
1125
+ ...deserialized
1126
+ });
1127
+ return (0, import_smithy_client.decorateServiceException)(exception, body);
1128
+ }, "de_CloudHsmServiceExceptionRes");
1129
+ var de_CloudHsmTagExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
1130
+ const body = parsedOutput.body;
1131
+ const deserialized = (0, import_smithy_client._json)(body);
1132
+ const exception = new CloudHsmTagException({
1133
+ $metadata: deserializeMetadata(parsedOutput),
1134
+ ...deserialized
1135
+ });
1136
+ return (0, import_smithy_client.decorateServiceException)(exception, body);
1137
+ }, "de_CloudHsmTagExceptionRes");
1138
+ var de_Backup = /* @__PURE__ */ __name((output, context) => {
1139
+ return (0, import_smithy_client.take)(output, {
1140
+ BackupId: import_smithy_client.expectString,
1141
+ BackupState: import_smithy_client.expectString,
1142
+ ClusterId: import_smithy_client.expectString,
1143
+ CopyTimestamp: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))),
1144
+ CreateTimestamp: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))),
1145
+ DeleteTimestamp: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))),
1146
+ NeverExpires: import_smithy_client.expectBoolean,
1147
+ SourceBackup: import_smithy_client.expectString,
1148
+ SourceCluster: import_smithy_client.expectString,
1149
+ SourceRegion: import_smithy_client.expectString,
1150
+ TagList: import_smithy_client._json
1151
+ });
1152
+ }, "de_Backup");
1153
+ var de_Backups = /* @__PURE__ */ __name((output, context) => {
1154
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
1155
+ return de_Backup(entry, context);
1156
+ });
1157
+ return retVal;
1158
+ }, "de_Backups");
1159
+ var de_Cluster = /* @__PURE__ */ __name((output, context) => {
1160
+ return (0, import_smithy_client.take)(output, {
1161
+ BackupPolicy: import_smithy_client.expectString,
1162
+ BackupRetentionPolicy: import_smithy_client._json,
1163
+ Certificates: import_smithy_client._json,
1164
+ ClusterId: import_smithy_client.expectString,
1165
+ CreateTimestamp: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))),
1166
+ HsmType: import_smithy_client.expectString,
1167
+ Hsms: import_smithy_client._json,
1168
+ PreCoPassword: import_smithy_client.expectString,
1169
+ SecurityGroup: import_smithy_client.expectString,
1170
+ SourceBackupId: import_smithy_client.expectString,
1171
+ State: import_smithy_client.expectString,
1172
+ StateMessage: import_smithy_client.expectString,
1173
+ SubnetMapping: import_smithy_client._json,
1174
+ TagList: import_smithy_client._json,
1175
+ VpcId: import_smithy_client.expectString
1176
+ });
1177
+ }, "de_Cluster");
1178
+ var de_Clusters = /* @__PURE__ */ __name((output, context) => {
1179
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
1180
+ return de_Cluster(entry, context);
1181
+ });
1182
+ return retVal;
1183
+ }, "de_Clusters");
1184
+ var de_CopyBackupToRegionResponse = /* @__PURE__ */ __name((output, context) => {
1185
+ return (0, import_smithy_client.take)(output, {
1186
+ DestinationBackup: (_) => de_DestinationBackup(_, context)
1187
+ });
1188
+ }, "de_CopyBackupToRegionResponse");
1189
+ var de_CreateClusterResponse = /* @__PURE__ */ __name((output, context) => {
1190
+ return (0, import_smithy_client.take)(output, {
1191
+ Cluster: (_) => de_Cluster(_, context)
1192
+ });
1193
+ }, "de_CreateClusterResponse");
1194
+ var de_DeleteBackupResponse = /* @__PURE__ */ __name((output, context) => {
1195
+ return (0, import_smithy_client.take)(output, {
1196
+ Backup: (_) => de_Backup(_, context)
1197
+ });
1198
+ }, "de_DeleteBackupResponse");
1199
+ var de_DeleteClusterResponse = /* @__PURE__ */ __name((output, context) => {
1200
+ return (0, import_smithy_client.take)(output, {
1201
+ Cluster: (_) => de_Cluster(_, context)
1202
+ });
1203
+ }, "de_DeleteClusterResponse");
1204
+ var de_DescribeBackupsResponse = /* @__PURE__ */ __name((output, context) => {
1205
+ return (0, import_smithy_client.take)(output, {
1206
+ Backups: (_) => de_Backups(_, context),
1207
+ NextToken: import_smithy_client.expectString
1208
+ });
1209
+ }, "de_DescribeBackupsResponse");
1210
+ var de_DescribeClustersResponse = /* @__PURE__ */ __name((output, context) => {
1211
+ return (0, import_smithy_client.take)(output, {
1212
+ Clusters: (_) => de_Clusters(_, context),
1213
+ NextToken: import_smithy_client.expectString
1214
+ });
1215
+ }, "de_DescribeClustersResponse");
1216
+ var de_DestinationBackup = /* @__PURE__ */ __name((output, context) => {
1217
+ return (0, import_smithy_client.take)(output, {
1218
+ CreateTimestamp: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))),
1219
+ SourceBackup: import_smithy_client.expectString,
1220
+ SourceCluster: import_smithy_client.expectString,
1221
+ SourceRegion: import_smithy_client.expectString
1222
+ });
1223
+ }, "de_DestinationBackup");
1224
+ var de_ModifyBackupAttributesResponse = /* @__PURE__ */ __name((output, context) => {
1225
+ return (0, import_smithy_client.take)(output, {
1226
+ Backup: (_) => de_Backup(_, context)
1227
+ });
1228
+ }, "de_ModifyBackupAttributesResponse");
1229
+ var de_ModifyClusterResponse = /* @__PURE__ */ __name((output, context) => {
1230
+ return (0, import_smithy_client.take)(output, {
1231
+ Cluster: (_) => de_Cluster(_, context)
1232
+ });
1233
+ }, "de_ModifyClusterResponse");
1234
+ var de_RestoreBackupResponse = /* @__PURE__ */ __name((output, context) => {
1235
+ return (0, import_smithy_client.take)(output, {
1236
+ Backup: (_) => de_Backup(_, context)
1237
+ });
1238
+ }, "de_RestoreBackupResponse");
1239
+ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
1240
+ httpStatusCode: output.statusCode,
1241
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1242
+ extendedRequestId: output.headers["x-amz-id-2"],
1243
+ cfId: output.headers["x-amz-cf-id"]
1244
+ }), "deserializeMetadata");
1245
+ var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
1246
+ var throwDefaultError = (0, import_smithy_client.withBaseException)(CloudHSMV2ServiceException);
1247
+ var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
1248
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1249
+ const contents = {
1250
+ protocol,
1251
+ hostname,
1252
+ port,
1253
+ method: "POST",
1254
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1255
+ headers
1256
+ };
1257
+ if (resolvedHostname !== void 0) {
1258
+ contents.hostname = resolvedHostname;
1259
+ }
1260
+ if (body !== void 0) {
1261
+ contents.body = body;
1262
+ }
1263
+ return new import_protocol_http.HttpRequest(contents);
1264
+ }, "buildHttpRpcRequest");
1265
+ function sharedHeaders(operation) {
1266
+ return {
1267
+ "content-type": "application/x-amz-json-1.1",
1268
+ "x-amz-target": `BaldrApiService.${operation}`
1269
+ };
1270
+ }
1271
+ __name(sharedHeaders, "sharedHeaders");
1272
+ var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1273
+ if (encoded.length) {
1274
+ return JSON.parse(encoded);
1275
+ }
1276
+ return {};
1277
+ }), "parseBody");
1278
+ var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
1279
+ const value = await parseBody(errorBody, context);
1280
+ value.message = value.message ?? value.Message;
1281
+ return value;
1282
+ }, "parseErrorBody");
1283
+ var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
1284
+ const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
1285
+ const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
1286
+ let cleanValue = rawValue;
1287
+ if (typeof cleanValue === "number") {
1288
+ cleanValue = cleanValue.toString();
1289
+ }
1290
+ if (cleanValue.indexOf(",") >= 0) {
1291
+ cleanValue = cleanValue.split(",")[0];
1292
+ }
1293
+ if (cleanValue.indexOf(":") >= 0) {
1294
+ cleanValue = cleanValue.split(":")[0];
1295
+ }
1296
+ if (cleanValue.indexOf("#") >= 0) {
1297
+ cleanValue = cleanValue.split("#")[1];
1298
+ }
1299
+ return cleanValue;
1300
+ }, "sanitizeErrorCode");
1301
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
1302
+ if (headerKey !== void 0) {
1303
+ return sanitizeErrorCode(output.headers[headerKey]);
1304
+ }
1305
+ if (data.code !== void 0) {
1306
+ return sanitizeErrorCode(data.code);
1307
+ }
1308
+ if (data["__type"] !== void 0) {
1309
+ return sanitizeErrorCode(data["__type"]);
1310
+ }
1311
+ }, "loadRestJsonErrorCode");
1312
+
1313
+ // src/commands/CopyBackupToRegionCommand.ts
1314
+ var _CopyBackupToRegionCommand = class _CopyBackupToRegionCommand extends import_smithy_client.Command.classBuilder().ep({
1315
+ ...commonParams
1316
+ }).m(function(Command, cs, config, o) {
1317
+ return [
1318
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1319
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1320
+ ];
1321
+ }).s("BaldrApiService", "CopyBackupToRegion", {}).n("CloudHSMV2Client", "CopyBackupToRegionCommand").f(void 0, void 0).ser(se_CopyBackupToRegionCommand).de(de_CopyBackupToRegionCommand).build() {
1322
+ };
1323
+ __name(_CopyBackupToRegionCommand, "CopyBackupToRegionCommand");
1324
+ var CopyBackupToRegionCommand = _CopyBackupToRegionCommand;
1325
+
1326
+ // src/commands/CreateClusterCommand.ts
1327
+
1328
+
1329
+
1330
+
1331
+ var _CreateClusterCommand = class _CreateClusterCommand extends import_smithy_client.Command.classBuilder().ep({
1332
+ ...commonParams
1333
+ }).m(function(Command, cs, config, o) {
1334
+ return [
1335
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1336
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1337
+ ];
1338
+ }).s("BaldrApiService", "CreateCluster", {}).n("CloudHSMV2Client", "CreateClusterCommand").f(void 0, void 0).ser(se_CreateClusterCommand).de(de_CreateClusterCommand).build() {
1339
+ };
1340
+ __name(_CreateClusterCommand, "CreateClusterCommand");
1341
+ var CreateClusterCommand = _CreateClusterCommand;
1342
+
1343
+ // src/commands/CreateHsmCommand.ts
1344
+
1345
+
1346
+
1347
+
1348
+ var _CreateHsmCommand = class _CreateHsmCommand extends import_smithy_client.Command.classBuilder().ep({
1349
+ ...commonParams
1350
+ }).m(function(Command, cs, config, o) {
1351
+ return [
1352
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1353
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1354
+ ];
1355
+ }).s("BaldrApiService", "CreateHsm", {}).n("CloudHSMV2Client", "CreateHsmCommand").f(void 0, void 0).ser(se_CreateHsmCommand).de(de_CreateHsmCommand).build() {
1356
+ };
1357
+ __name(_CreateHsmCommand, "CreateHsmCommand");
1358
+ var CreateHsmCommand = _CreateHsmCommand;
1359
+
1360
+ // src/commands/DeleteBackupCommand.ts
1361
+
1362
+
1363
+
1364
+
1365
+ var _DeleteBackupCommand = class _DeleteBackupCommand extends import_smithy_client.Command.classBuilder().ep({
1366
+ ...commonParams
1367
+ }).m(function(Command, cs, config, o) {
1368
+ return [
1369
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1370
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1371
+ ];
1372
+ }).s("BaldrApiService", "DeleteBackup", {}).n("CloudHSMV2Client", "DeleteBackupCommand").f(void 0, void 0).ser(se_DeleteBackupCommand).de(de_DeleteBackupCommand).build() {
1373
+ };
1374
+ __name(_DeleteBackupCommand, "DeleteBackupCommand");
1375
+ var DeleteBackupCommand = _DeleteBackupCommand;
1376
+
1377
+ // src/commands/DeleteClusterCommand.ts
1378
+
1379
+
1380
+
1381
+
1382
+ var _DeleteClusterCommand = class _DeleteClusterCommand extends import_smithy_client.Command.classBuilder().ep({
1383
+ ...commonParams
1384
+ }).m(function(Command, cs, config, o) {
1385
+ return [
1386
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1387
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1388
+ ];
1389
+ }).s("BaldrApiService", "DeleteCluster", {}).n("CloudHSMV2Client", "DeleteClusterCommand").f(void 0, void 0).ser(se_DeleteClusterCommand).de(de_DeleteClusterCommand).build() {
1390
+ };
1391
+ __name(_DeleteClusterCommand, "DeleteClusterCommand");
1392
+ var DeleteClusterCommand = _DeleteClusterCommand;
1393
+
1394
+ // src/commands/DeleteHsmCommand.ts
1395
+
1396
+
1397
+
1398
+
1399
+ var _DeleteHsmCommand = class _DeleteHsmCommand extends import_smithy_client.Command.classBuilder().ep({
1400
+ ...commonParams
1401
+ }).m(function(Command, cs, config, o) {
1402
+ return [
1403
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1404
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1405
+ ];
1406
+ }).s("BaldrApiService", "DeleteHsm", {}).n("CloudHSMV2Client", "DeleteHsmCommand").f(void 0, void 0).ser(se_DeleteHsmCommand).de(de_DeleteHsmCommand).build() {
1407
+ };
1408
+ __name(_DeleteHsmCommand, "DeleteHsmCommand");
1409
+ var DeleteHsmCommand = _DeleteHsmCommand;
1410
+
1411
+ // src/commands/DescribeBackupsCommand.ts
1412
+
1413
+
1414
+
1415
+
1416
+ var _DescribeBackupsCommand = class _DescribeBackupsCommand extends import_smithy_client.Command.classBuilder().ep({
1417
+ ...commonParams
1418
+ }).m(function(Command, cs, config, o) {
1419
+ return [
1420
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1421
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1422
+ ];
1423
+ }).s("BaldrApiService", "DescribeBackups", {}).n("CloudHSMV2Client", "DescribeBackupsCommand").f(void 0, void 0).ser(se_DescribeBackupsCommand).de(de_DescribeBackupsCommand).build() {
1424
+ };
1425
+ __name(_DescribeBackupsCommand, "DescribeBackupsCommand");
1426
+ var DescribeBackupsCommand = _DescribeBackupsCommand;
1427
+
1428
+ // src/commands/DescribeClustersCommand.ts
1429
+
1430
+
1431
+
1432
+
1433
+ var _DescribeClustersCommand = class _DescribeClustersCommand extends import_smithy_client.Command.classBuilder().ep({
1434
+ ...commonParams
1435
+ }).m(function(Command, cs, config, o) {
1436
+ return [
1437
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1438
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1439
+ ];
1440
+ }).s("BaldrApiService", "DescribeClusters", {}).n("CloudHSMV2Client", "DescribeClustersCommand").f(void 0, void 0).ser(se_DescribeClustersCommand).de(de_DescribeClustersCommand).build() {
1441
+ };
1442
+ __name(_DescribeClustersCommand, "DescribeClustersCommand");
1443
+ var DescribeClustersCommand = _DescribeClustersCommand;
1444
+
1445
+ // src/commands/InitializeClusterCommand.ts
1446
+
1447
+
1448
+
1449
+
1450
+ var _InitializeClusterCommand = class _InitializeClusterCommand extends import_smithy_client.Command.classBuilder().ep({
1451
+ ...commonParams
1452
+ }).m(function(Command, cs, config, o) {
1453
+ return [
1454
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1455
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1456
+ ];
1457
+ }).s("BaldrApiService", "InitializeCluster", {}).n("CloudHSMV2Client", "InitializeClusterCommand").f(void 0, void 0).ser(se_InitializeClusterCommand).de(de_InitializeClusterCommand).build() {
1458
+ };
1459
+ __name(_InitializeClusterCommand, "InitializeClusterCommand");
1460
+ var InitializeClusterCommand = _InitializeClusterCommand;
1461
+
1462
+ // src/commands/ListTagsCommand.ts
1463
+
1464
+
1465
+
1466
+
1467
+ var _ListTagsCommand = class _ListTagsCommand extends import_smithy_client.Command.classBuilder().ep({
1468
+ ...commonParams
1469
+ }).m(function(Command, cs, config, o) {
1470
+ return [
1471
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1472
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1473
+ ];
1474
+ }).s("BaldrApiService", "ListTags", {}).n("CloudHSMV2Client", "ListTagsCommand").f(void 0, void 0).ser(se_ListTagsCommand).de(de_ListTagsCommand).build() {
1475
+ };
1476
+ __name(_ListTagsCommand, "ListTagsCommand");
1477
+ var ListTagsCommand = _ListTagsCommand;
1478
+
1479
+ // src/commands/ModifyBackupAttributesCommand.ts
1480
+
1481
+
1482
+
1483
+
1484
+ var _ModifyBackupAttributesCommand = class _ModifyBackupAttributesCommand extends import_smithy_client.Command.classBuilder().ep({
1485
+ ...commonParams
1486
+ }).m(function(Command, cs, config, o) {
1487
+ return [
1488
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1489
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1490
+ ];
1491
+ }).s("BaldrApiService", "ModifyBackupAttributes", {}).n("CloudHSMV2Client", "ModifyBackupAttributesCommand").f(void 0, void 0).ser(se_ModifyBackupAttributesCommand).de(de_ModifyBackupAttributesCommand).build() {
1492
+ };
1493
+ __name(_ModifyBackupAttributesCommand, "ModifyBackupAttributesCommand");
1494
+ var ModifyBackupAttributesCommand = _ModifyBackupAttributesCommand;
1495
+
1496
+ // src/commands/ModifyClusterCommand.ts
1497
+
1498
+
1499
+
1500
+
1501
+ var _ModifyClusterCommand = class _ModifyClusterCommand extends import_smithy_client.Command.classBuilder().ep({
1502
+ ...commonParams
1503
+ }).m(function(Command, cs, config, o) {
1504
+ return [
1505
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1506
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1507
+ ];
1508
+ }).s("BaldrApiService", "ModifyCluster", {}).n("CloudHSMV2Client", "ModifyClusterCommand").f(void 0, void 0).ser(se_ModifyClusterCommand).de(de_ModifyClusterCommand).build() {
1509
+ };
1510
+ __name(_ModifyClusterCommand, "ModifyClusterCommand");
1511
+ var ModifyClusterCommand = _ModifyClusterCommand;
1512
+
1513
+ // src/commands/RestoreBackupCommand.ts
1514
+
1515
+
1516
+
1517
+
1518
+ var _RestoreBackupCommand = class _RestoreBackupCommand extends import_smithy_client.Command.classBuilder().ep({
1519
+ ...commonParams
1520
+ }).m(function(Command, cs, config, o) {
1521
+ return [
1522
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1523
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1524
+ ];
1525
+ }).s("BaldrApiService", "RestoreBackup", {}).n("CloudHSMV2Client", "RestoreBackupCommand").f(void 0, void 0).ser(se_RestoreBackupCommand).de(de_RestoreBackupCommand).build() {
1526
+ };
1527
+ __name(_RestoreBackupCommand, "RestoreBackupCommand");
1528
+ var RestoreBackupCommand = _RestoreBackupCommand;
1529
+
1530
+ // src/commands/TagResourceCommand.ts
1531
+
1532
+
1533
+
1534
+
1535
+ var _TagResourceCommand = class _TagResourceCommand extends import_smithy_client.Command.classBuilder().ep({
1536
+ ...commonParams
1537
+ }).m(function(Command, cs, config, o) {
1538
+ return [
1539
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1540
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1541
+ ];
1542
+ }).s("BaldrApiService", "TagResource", {}).n("CloudHSMV2Client", "TagResourceCommand").f(void 0, void 0).ser(se_TagResourceCommand).de(de_TagResourceCommand).build() {
1543
+ };
1544
+ __name(_TagResourceCommand, "TagResourceCommand");
1545
+ var TagResourceCommand = _TagResourceCommand;
1546
+
1547
+ // src/commands/UntagResourceCommand.ts
1548
+
1549
+
1550
+
1551
+
1552
+ var _UntagResourceCommand = class _UntagResourceCommand extends import_smithy_client.Command.classBuilder().ep({
1553
+ ...commonParams
1554
+ }).m(function(Command, cs, config, o) {
1555
+ return [
1556
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1557
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1558
+ ];
1559
+ }).s("BaldrApiService", "UntagResource", {}).n("CloudHSMV2Client", "UntagResourceCommand").f(void 0, void 0).ser(se_UntagResourceCommand).de(de_UntagResourceCommand).build() {
1560
+ };
1561
+ __name(_UntagResourceCommand, "UntagResourceCommand");
1562
+ var UntagResourceCommand = _UntagResourceCommand;
1563
+
1564
+ // src/CloudHSMV2.ts
1565
+ var commands = {
1566
+ CopyBackupToRegionCommand,
1567
+ CreateClusterCommand,
1568
+ CreateHsmCommand,
1569
+ DeleteBackupCommand,
1570
+ DeleteClusterCommand,
1571
+ DeleteHsmCommand,
1572
+ DescribeBackupsCommand,
1573
+ DescribeClustersCommand,
1574
+ InitializeClusterCommand,
1575
+ ListTagsCommand,
1576
+ ModifyBackupAttributesCommand,
1577
+ ModifyClusterCommand,
1578
+ RestoreBackupCommand,
1579
+ TagResourceCommand,
1580
+ UntagResourceCommand
1581
+ };
1582
+ var _CloudHSMV2 = class _CloudHSMV2 extends CloudHSMV2Client {
1583
+ };
1584
+ __name(_CloudHSMV2, "CloudHSMV2");
1585
+ var CloudHSMV2 = _CloudHSMV2;
1586
+ (0, import_smithy_client.createAggregatedClient)(commands, CloudHSMV2);
1587
+
1588
+ // src/pagination/DescribeBackupsPaginator.ts
1589
+ var import_core = require("@smithy/core");
1590
+ var paginateDescribeBackups = (0, import_core.createPaginator)(CloudHSMV2Client, DescribeBackupsCommand, "NextToken", "NextToken", "MaxResults");
1591
+
1592
+ // src/pagination/DescribeClustersPaginator.ts
1593
+
1594
+ var paginateDescribeClusters = (0, import_core.createPaginator)(CloudHSMV2Client, DescribeClustersCommand, "NextToken", "NextToken", "MaxResults");
1595
+
1596
+ // src/pagination/ListTagsPaginator.ts
1597
+
1598
+ var paginateListTags = (0, import_core.createPaginator)(CloudHSMV2Client, ListTagsCommand, "NextToken", "NextToken", "MaxResults");
1599
+
1600
+ // src/index.ts
1601
+ var import_util_endpoints = require("@aws-sdk/util-endpoints");
1602
+ // Annotate the CommonJS export names for ESM import in node:
1603
+ 0 && (module.exports = {
1604
+ BackupPolicy,
1605
+ BackupRetentionType,
1606
+ BackupState,
1607
+ CloudHSMV2,
1608
+ CloudHSMV2Client,
1609
+ CloudHSMV2ServiceException,
1610
+ CloudHsmAccessDeniedException,
1611
+ CloudHsmInternalFailureException,
1612
+ CloudHsmInvalidRequestException,
1613
+ CloudHsmResourceNotFoundException,
1614
+ CloudHsmServiceException,
1615
+ CloudHsmTagException,
1616
+ ClusterState,
1617
+ CopyBackupToRegionCommand,
1618
+ CreateClusterCommand,
1619
+ CreateHsmCommand,
1620
+ DeleteBackupCommand,
1621
+ DeleteClusterCommand,
1622
+ DeleteHsmCommand,
1623
+ DescribeBackupsCommand,
1624
+ DescribeClustersCommand,
1625
+ HsmState,
1626
+ InitializeClusterCommand,
1627
+ ListTagsCommand,
1628
+ ModifyBackupAttributesCommand,
1629
+ ModifyClusterCommand,
1630
+ RestoreBackupCommand,
1631
+ TagResourceCommand,
1632
+ UntagResourceCommand,
1633
+ __Client,
1634
+ paginateDescribeBackups,
1635
+ paginateDescribeClusters,
1636
+ paginateListTags
1637
+ });