@aws-sdk/client-cloudhsm 3.183.0 → 3.185.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 (33) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist-cjs/protocols/Aws_json1_1.js +2 -2
  3. package/dist-es/CloudHSM.js +89 -82
  4. package/dist-es/CloudHSMClient.js +28 -22
  5. package/dist-es/commands/AddTagsToResourceCommand.js +28 -21
  6. package/dist-es/commands/CreateHapgCommand.js +28 -21
  7. package/dist-es/commands/CreateHsmCommand.js +28 -21
  8. package/dist-es/commands/CreateLunaClientCommand.js +28 -21
  9. package/dist-es/commands/DeleteHapgCommand.js +28 -21
  10. package/dist-es/commands/DeleteHsmCommand.js +28 -21
  11. package/dist-es/commands/DeleteLunaClientCommand.js +28 -21
  12. package/dist-es/commands/DescribeHapgCommand.js +28 -21
  13. package/dist-es/commands/DescribeHsmCommand.js +28 -21
  14. package/dist-es/commands/DescribeLunaClientCommand.js +28 -21
  15. package/dist-es/commands/GetConfigCommand.js +28 -21
  16. package/dist-es/commands/ListAvailableZonesCommand.js +28 -21
  17. package/dist-es/commands/ListHapgsCommand.js +28 -21
  18. package/dist-es/commands/ListHsmsCommand.js +28 -21
  19. package/dist-es/commands/ListLunaClientsCommand.js +28 -21
  20. package/dist-es/commands/ListTagsForResourceCommand.js +28 -21
  21. package/dist-es/commands/ModifyHapgCommand.js +28 -21
  22. package/dist-es/commands/ModifyHsmCommand.js +28 -21
  23. package/dist-es/commands/ModifyLunaClientCommand.js +28 -21
  24. package/dist-es/commands/RemoveTagsFromResourceCommand.js +28 -21
  25. package/dist-es/endpoints.js +8 -8
  26. package/dist-es/models/CloudHSMServiceException.js +10 -5
  27. package/dist-es/models/models_0.js +78 -159
  28. package/dist-es/protocols/Aws_json1_1.js +1591 -1192
  29. package/dist-es/runtimeConfig.browser.js +12 -26
  30. package/dist-es/runtimeConfig.js +12 -30
  31. package/dist-es/runtimeConfig.native.js +5 -8
  32. package/dist-es/runtimeConfig.shared.js +11 -8
  33. package/package.json +5 -5
@@ -1,1153 +1,1529 @@
1
+ import { __assign, __awaiter, __generator } from "tslib";
1
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
3
  import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectString as __expectString, throwDefaultError, } from "@aws-sdk/smithy-client";
3
4
  import { CloudHSMServiceException as __BaseException } from "../models/CloudHSMServiceException";
4
5
  import { CloudHsmInternalException, CloudHsmServiceException, InvalidRequestException, } from "../models/models_0";
5
- export const serializeAws_json1_1AddTagsToResourceCommand = async (input, context) => {
6
- const headers = {
7
- "content-type": "application/x-amz-json-1.1",
8
- "x-amz-target": "CloudHsmFrontendService.AddTagsToResource",
9
- };
10
- let body;
11
- body = JSON.stringify(serializeAws_json1_1AddTagsToResourceRequest(input, context));
12
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
- };
14
- export const serializeAws_json1_1CreateHapgCommand = async (input, context) => {
15
- const headers = {
16
- "content-type": "application/x-amz-json-1.1",
17
- "x-amz-target": "CloudHsmFrontendService.CreateHapg",
18
- };
19
- let body;
20
- body = JSON.stringify(serializeAws_json1_1CreateHapgRequest(input, context));
21
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
- };
23
- export const serializeAws_json1_1CreateHsmCommand = async (input, context) => {
24
- const headers = {
25
- "content-type": "application/x-amz-json-1.1",
26
- "x-amz-target": "CloudHsmFrontendService.CreateHsm",
27
- };
28
- let body;
29
- body = JSON.stringify(serializeAws_json1_1CreateHsmRequest(input, context));
30
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
31
- };
32
- export const serializeAws_json1_1CreateLunaClientCommand = async (input, context) => {
33
- const headers = {
34
- "content-type": "application/x-amz-json-1.1",
35
- "x-amz-target": "CloudHsmFrontendService.CreateLunaClient",
36
- };
37
- let body;
38
- body = JSON.stringify(serializeAws_json1_1CreateLunaClientRequest(input, context));
39
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
40
- };
41
- export const serializeAws_json1_1DeleteHapgCommand = async (input, context) => {
42
- const headers = {
43
- "content-type": "application/x-amz-json-1.1",
44
- "x-amz-target": "CloudHsmFrontendService.DeleteHapg",
45
- };
46
- let body;
47
- body = JSON.stringify(serializeAws_json1_1DeleteHapgRequest(input, context));
48
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
49
- };
50
- export const serializeAws_json1_1DeleteHsmCommand = async (input, context) => {
51
- const headers = {
52
- "content-type": "application/x-amz-json-1.1",
53
- "x-amz-target": "CloudHsmFrontendService.DeleteHsm",
54
- };
55
- let body;
56
- body = JSON.stringify(serializeAws_json1_1DeleteHsmRequest(input, context));
57
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
58
- };
59
- export const serializeAws_json1_1DeleteLunaClientCommand = async (input, context) => {
60
- const headers = {
61
- "content-type": "application/x-amz-json-1.1",
62
- "x-amz-target": "CloudHsmFrontendService.DeleteLunaClient",
63
- };
64
- let body;
65
- body = JSON.stringify(serializeAws_json1_1DeleteLunaClientRequest(input, context));
66
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
67
- };
68
- export const serializeAws_json1_1DescribeHapgCommand = async (input, context) => {
69
- const headers = {
70
- "content-type": "application/x-amz-json-1.1",
71
- "x-amz-target": "CloudHsmFrontendService.DescribeHapg",
72
- };
73
- let body;
74
- body = JSON.stringify(serializeAws_json1_1DescribeHapgRequest(input, context));
75
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
76
- };
77
- export const serializeAws_json1_1DescribeHsmCommand = async (input, context) => {
78
- const headers = {
79
- "content-type": "application/x-amz-json-1.1",
80
- "x-amz-target": "CloudHsmFrontendService.DescribeHsm",
81
- };
82
- let body;
83
- body = JSON.stringify(serializeAws_json1_1DescribeHsmRequest(input, context));
84
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
85
- };
86
- export const serializeAws_json1_1DescribeLunaClientCommand = async (input, context) => {
87
- const headers = {
88
- "content-type": "application/x-amz-json-1.1",
89
- "x-amz-target": "CloudHsmFrontendService.DescribeLunaClient",
90
- };
91
- let body;
92
- body = JSON.stringify(serializeAws_json1_1DescribeLunaClientRequest(input, context));
93
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
94
- };
95
- export const serializeAws_json1_1GetConfigCommand = async (input, context) => {
96
- const headers = {
97
- "content-type": "application/x-amz-json-1.1",
98
- "x-amz-target": "CloudHsmFrontendService.GetConfig",
99
- };
100
- let body;
101
- body = JSON.stringify(serializeAws_json1_1GetConfigRequest(input, context));
102
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
103
- };
104
- export const serializeAws_json1_1ListAvailableZonesCommand = async (input, context) => {
105
- const headers = {
106
- "content-type": "application/x-amz-json-1.1",
107
- "x-amz-target": "CloudHsmFrontendService.ListAvailableZones",
108
- };
109
- let body;
110
- body = JSON.stringify(serializeAws_json1_1ListAvailableZonesRequest(input, context));
111
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
112
- };
113
- export const serializeAws_json1_1ListHapgsCommand = async (input, context) => {
114
- const headers = {
115
- "content-type": "application/x-amz-json-1.1",
116
- "x-amz-target": "CloudHsmFrontendService.ListHapgs",
117
- };
118
- let body;
119
- body = JSON.stringify(serializeAws_json1_1ListHapgsRequest(input, context));
120
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
121
- };
122
- export const serializeAws_json1_1ListHsmsCommand = async (input, context) => {
123
- const headers = {
124
- "content-type": "application/x-amz-json-1.1",
125
- "x-amz-target": "CloudHsmFrontendService.ListHsms",
126
- };
127
- let body;
128
- body = JSON.stringify(serializeAws_json1_1ListHsmsRequest(input, context));
129
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
130
- };
131
- export const serializeAws_json1_1ListLunaClientsCommand = async (input, context) => {
132
- const headers = {
133
- "content-type": "application/x-amz-json-1.1",
134
- "x-amz-target": "CloudHsmFrontendService.ListLunaClients",
135
- };
136
- let body;
137
- body = JSON.stringify(serializeAws_json1_1ListLunaClientsRequest(input, context));
138
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
139
- };
140
- export const serializeAws_json1_1ListTagsForResourceCommand = async (input, context) => {
141
- const headers = {
142
- "content-type": "application/x-amz-json-1.1",
143
- "x-amz-target": "CloudHsmFrontendService.ListTagsForResource",
144
- };
145
- let body;
146
- body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context));
147
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
148
- };
149
- export const serializeAws_json1_1ModifyHapgCommand = async (input, context) => {
150
- const headers = {
151
- "content-type": "application/x-amz-json-1.1",
152
- "x-amz-target": "CloudHsmFrontendService.ModifyHapg",
153
- };
154
- let body;
155
- body = JSON.stringify(serializeAws_json1_1ModifyHapgRequest(input, context));
156
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
157
- };
158
- export const serializeAws_json1_1ModifyHsmCommand = async (input, context) => {
159
- const headers = {
160
- "content-type": "application/x-amz-json-1.1",
161
- "x-amz-target": "CloudHsmFrontendService.ModifyHsm",
162
- };
163
- let body;
164
- body = JSON.stringify(serializeAws_json1_1ModifyHsmRequest(input, context));
165
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
166
- };
167
- export const serializeAws_json1_1ModifyLunaClientCommand = async (input, context) => {
168
- const headers = {
169
- "content-type": "application/x-amz-json-1.1",
170
- "x-amz-target": "CloudHsmFrontendService.ModifyLunaClient",
171
- };
172
- let body;
173
- body = JSON.stringify(serializeAws_json1_1ModifyLunaClientRequest(input, context));
174
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
175
- };
176
- export const serializeAws_json1_1RemoveTagsFromResourceCommand = async (input, context) => {
177
- const headers = {
178
- "content-type": "application/x-amz-json-1.1",
179
- "x-amz-target": "CloudHsmFrontendService.RemoveTagsFromResource",
180
- };
181
- let body;
182
- body = JSON.stringify(serializeAws_json1_1RemoveTagsFromResourceRequest(input, context));
183
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
184
- };
185
- export const deserializeAws_json1_1AddTagsToResourceCommand = async (output, context) => {
186
- if (output.statusCode >= 300) {
187
- return deserializeAws_json1_1AddTagsToResourceCommandError(output, context);
188
- }
189
- const data = await parseBody(output.body, context);
190
- let contents = {};
191
- contents = deserializeAws_json1_1AddTagsToResourceResponse(data, context);
192
- const response = {
193
- $metadata: deserializeMetadata(output),
194
- ...contents,
195
- };
196
- return Promise.resolve(response);
197
- };
198
- const deserializeAws_json1_1AddTagsToResourceCommandError = async (output, context) => {
199
- const parsedOutput = {
200
- ...output,
201
- body: await parseErrorBody(output.body, context),
202
- };
203
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
204
- switch (errorCode) {
205
- case "CloudHsmInternalException":
206
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
207
- throw await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context);
208
- case "CloudHsmServiceException":
209
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
210
- throw await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context);
211
- case "InvalidRequestException":
212
- case "com.amazonaws.cloudhsm#InvalidRequestException":
213
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
214
- default:
215
- const parsedBody = parsedOutput.body;
216
- throwDefaultError({
217
- output,
218
- parsedBody,
219
- exceptionCtor: __BaseException,
220
- errorCode,
221
- });
222
- }
223
- };
224
- export const deserializeAws_json1_1CreateHapgCommand = async (output, context) => {
225
- if (output.statusCode >= 300) {
226
- return deserializeAws_json1_1CreateHapgCommandError(output, context);
227
- }
228
- const data = await parseBody(output.body, context);
229
- let contents = {};
230
- contents = deserializeAws_json1_1CreateHapgResponse(data, context);
231
- const response = {
232
- $metadata: deserializeMetadata(output),
233
- ...contents,
234
- };
235
- return Promise.resolve(response);
236
- };
237
- const deserializeAws_json1_1CreateHapgCommandError = async (output, context) => {
238
- const parsedOutput = {
239
- ...output,
240
- body: await parseErrorBody(output.body, context),
241
- };
242
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
243
- switch (errorCode) {
244
- case "CloudHsmInternalException":
245
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
246
- throw await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context);
247
- case "CloudHsmServiceException":
248
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
249
- throw await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context);
250
- case "InvalidRequestException":
251
- case "com.amazonaws.cloudhsm#InvalidRequestException":
252
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
253
- default:
254
- const parsedBody = parsedOutput.body;
255
- throwDefaultError({
256
- output,
257
- parsedBody,
258
- exceptionCtor: __BaseException,
259
- errorCode,
260
- });
261
- }
262
- };
263
- export const deserializeAws_json1_1CreateHsmCommand = async (output, context) => {
264
- if (output.statusCode >= 300) {
265
- return deserializeAws_json1_1CreateHsmCommandError(output, context);
266
- }
267
- const data = await parseBody(output.body, context);
268
- let contents = {};
269
- contents = deserializeAws_json1_1CreateHsmResponse(data, context);
270
- const response = {
271
- $metadata: deserializeMetadata(output),
272
- ...contents,
273
- };
274
- return Promise.resolve(response);
275
- };
276
- const deserializeAws_json1_1CreateHsmCommandError = async (output, context) => {
277
- const parsedOutput = {
278
- ...output,
279
- body: await parseErrorBody(output.body, context),
280
- };
281
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
282
- switch (errorCode) {
283
- case "CloudHsmInternalException":
284
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
285
- throw await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context);
286
- case "CloudHsmServiceException":
287
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
288
- throw await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context);
289
- case "InvalidRequestException":
290
- case "com.amazonaws.cloudhsm#InvalidRequestException":
291
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
292
- default:
293
- const parsedBody = parsedOutput.body;
294
- throwDefaultError({
295
- output,
296
- parsedBody,
297
- exceptionCtor: __BaseException,
298
- errorCode,
299
- });
300
- }
301
- };
302
- export const deserializeAws_json1_1CreateLunaClientCommand = async (output, context) => {
303
- if (output.statusCode >= 300) {
304
- return deserializeAws_json1_1CreateLunaClientCommandError(output, context);
305
- }
306
- const data = await parseBody(output.body, context);
307
- let contents = {};
308
- contents = deserializeAws_json1_1CreateLunaClientResponse(data, context);
309
- const response = {
310
- $metadata: deserializeMetadata(output),
311
- ...contents,
312
- };
313
- return Promise.resolve(response);
314
- };
315
- const deserializeAws_json1_1CreateLunaClientCommandError = async (output, context) => {
316
- const parsedOutput = {
317
- ...output,
318
- body: await parseErrorBody(output.body, context),
319
- };
320
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
321
- switch (errorCode) {
322
- case "CloudHsmInternalException":
323
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
324
- throw await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context);
325
- case "CloudHsmServiceException":
326
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
327
- throw await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context);
328
- case "InvalidRequestException":
329
- case "com.amazonaws.cloudhsm#InvalidRequestException":
330
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
331
- default:
332
- const parsedBody = parsedOutput.body;
333
- throwDefaultError({
334
- output,
335
- parsedBody,
336
- exceptionCtor: __BaseException,
337
- errorCode,
338
- });
339
- }
340
- };
341
- export const deserializeAws_json1_1DeleteHapgCommand = async (output, context) => {
342
- if (output.statusCode >= 300) {
343
- return deserializeAws_json1_1DeleteHapgCommandError(output, context);
344
- }
345
- const data = await parseBody(output.body, context);
346
- let contents = {};
347
- contents = deserializeAws_json1_1DeleteHapgResponse(data, context);
348
- const response = {
349
- $metadata: deserializeMetadata(output),
350
- ...contents,
351
- };
352
- return Promise.resolve(response);
353
- };
354
- const deserializeAws_json1_1DeleteHapgCommandError = async (output, context) => {
355
- const parsedOutput = {
356
- ...output,
357
- body: await parseErrorBody(output.body, context),
358
- };
359
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
360
- switch (errorCode) {
361
- case "CloudHsmInternalException":
362
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
363
- throw await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context);
364
- case "CloudHsmServiceException":
365
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
366
- throw await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context);
367
- case "InvalidRequestException":
368
- case "com.amazonaws.cloudhsm#InvalidRequestException":
369
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
370
- default:
371
- const parsedBody = parsedOutput.body;
372
- throwDefaultError({
373
- output,
374
- parsedBody,
375
- exceptionCtor: __BaseException,
376
- errorCode,
377
- });
378
- }
379
- };
380
- export const deserializeAws_json1_1DeleteHsmCommand = async (output, context) => {
381
- if (output.statusCode >= 300) {
382
- return deserializeAws_json1_1DeleteHsmCommandError(output, context);
383
- }
384
- const data = await parseBody(output.body, context);
385
- let contents = {};
386
- contents = deserializeAws_json1_1DeleteHsmResponse(data, context);
387
- const response = {
388
- $metadata: deserializeMetadata(output),
389
- ...contents,
390
- };
391
- return Promise.resolve(response);
392
- };
393
- const deserializeAws_json1_1DeleteHsmCommandError = async (output, context) => {
394
- const parsedOutput = {
395
- ...output,
396
- body: await parseErrorBody(output.body, context),
397
- };
398
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
399
- switch (errorCode) {
400
- case "CloudHsmInternalException":
401
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
402
- throw await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context);
403
- case "CloudHsmServiceException":
404
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
405
- throw await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context);
406
- case "InvalidRequestException":
407
- case "com.amazonaws.cloudhsm#InvalidRequestException":
408
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
409
- default:
410
- const parsedBody = parsedOutput.body;
411
- throwDefaultError({
412
- output,
413
- parsedBody,
414
- exceptionCtor: __BaseException,
415
- errorCode,
416
- });
417
- }
418
- };
419
- export const deserializeAws_json1_1DeleteLunaClientCommand = async (output, context) => {
420
- if (output.statusCode >= 300) {
421
- return deserializeAws_json1_1DeleteLunaClientCommandError(output, context);
422
- }
423
- const data = await parseBody(output.body, context);
424
- let contents = {};
425
- contents = deserializeAws_json1_1DeleteLunaClientResponse(data, context);
426
- const response = {
427
- $metadata: deserializeMetadata(output),
428
- ...contents,
429
- };
430
- return Promise.resolve(response);
431
- };
432
- const deserializeAws_json1_1DeleteLunaClientCommandError = async (output, context) => {
433
- const parsedOutput = {
434
- ...output,
435
- body: await parseErrorBody(output.body, context),
436
- };
437
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
438
- switch (errorCode) {
439
- case "CloudHsmInternalException":
440
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
441
- throw await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context);
442
- case "CloudHsmServiceException":
443
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
444
- throw await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context);
445
- case "InvalidRequestException":
446
- case "com.amazonaws.cloudhsm#InvalidRequestException":
447
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
448
- default:
449
- const parsedBody = parsedOutput.body;
450
- throwDefaultError({
451
- output,
452
- parsedBody,
453
- exceptionCtor: __BaseException,
454
- errorCode,
455
- });
456
- }
457
- };
458
- export const deserializeAws_json1_1DescribeHapgCommand = async (output, context) => {
459
- if (output.statusCode >= 300) {
460
- return deserializeAws_json1_1DescribeHapgCommandError(output, context);
461
- }
462
- const data = await parseBody(output.body, context);
463
- let contents = {};
464
- contents = deserializeAws_json1_1DescribeHapgResponse(data, context);
465
- const response = {
466
- $metadata: deserializeMetadata(output),
467
- ...contents,
468
- };
469
- return Promise.resolve(response);
470
- };
471
- const deserializeAws_json1_1DescribeHapgCommandError = async (output, context) => {
472
- const parsedOutput = {
473
- ...output,
474
- body: await parseErrorBody(output.body, context),
475
- };
476
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
477
- switch (errorCode) {
478
- case "CloudHsmInternalException":
479
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
480
- throw await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context);
481
- case "CloudHsmServiceException":
482
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
483
- throw await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context);
484
- case "InvalidRequestException":
485
- case "com.amazonaws.cloudhsm#InvalidRequestException":
486
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
487
- default:
488
- const parsedBody = parsedOutput.body;
489
- throwDefaultError({
490
- output,
491
- parsedBody,
492
- exceptionCtor: __BaseException,
493
- errorCode,
494
- });
495
- }
496
- };
497
- export const deserializeAws_json1_1DescribeHsmCommand = async (output, context) => {
498
- if (output.statusCode >= 300) {
499
- return deserializeAws_json1_1DescribeHsmCommandError(output, context);
500
- }
501
- const data = await parseBody(output.body, context);
502
- let contents = {};
503
- contents = deserializeAws_json1_1DescribeHsmResponse(data, context);
504
- const response = {
505
- $metadata: deserializeMetadata(output),
506
- ...contents,
507
- };
508
- return Promise.resolve(response);
509
- };
510
- const deserializeAws_json1_1DescribeHsmCommandError = 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 "CloudHsmInternalException":
518
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
519
- throw await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context);
520
- case "CloudHsmServiceException":
521
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
522
- throw await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context);
523
- case "InvalidRequestException":
524
- case "com.amazonaws.cloudhsm#InvalidRequestException":
525
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
526
- default:
527
- const parsedBody = parsedOutput.body;
528
- throwDefaultError({
529
- output,
530
- parsedBody,
531
- exceptionCtor: __BaseException,
532
- errorCode,
533
- });
534
- }
535
- };
536
- export const deserializeAws_json1_1DescribeLunaClientCommand = async (output, context) => {
537
- if (output.statusCode >= 300) {
538
- return deserializeAws_json1_1DescribeLunaClientCommandError(output, context);
539
- }
540
- const data = await parseBody(output.body, context);
541
- let contents = {};
542
- contents = deserializeAws_json1_1DescribeLunaClientResponse(data, context);
543
- const response = {
544
- $metadata: deserializeMetadata(output),
545
- ...contents,
546
- };
547
- return Promise.resolve(response);
548
- };
549
- const deserializeAws_json1_1DescribeLunaClientCommandError = async (output, context) => {
550
- const parsedOutput = {
551
- ...output,
552
- body: await parseErrorBody(output.body, context),
553
- };
554
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
555
- switch (errorCode) {
556
- case "CloudHsmInternalException":
557
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
558
- throw await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context);
559
- case "CloudHsmServiceException":
560
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
561
- throw await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context);
562
- case "InvalidRequestException":
563
- case "com.amazonaws.cloudhsm#InvalidRequestException":
564
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
565
- default:
566
- const parsedBody = parsedOutput.body;
567
- throwDefaultError({
568
- output,
569
- parsedBody,
570
- exceptionCtor: __BaseException,
571
- errorCode,
572
- });
573
- }
574
- };
575
- export const deserializeAws_json1_1GetConfigCommand = async (output, context) => {
576
- if (output.statusCode >= 300) {
577
- return deserializeAws_json1_1GetConfigCommandError(output, context);
578
- }
579
- const data = await parseBody(output.body, context);
580
- let contents = {};
581
- contents = deserializeAws_json1_1GetConfigResponse(data, context);
582
- const response = {
583
- $metadata: deserializeMetadata(output),
584
- ...contents,
585
- };
586
- return Promise.resolve(response);
587
- };
588
- const deserializeAws_json1_1GetConfigCommandError = async (output, context) => {
589
- const parsedOutput = {
590
- ...output,
591
- body: await parseErrorBody(output.body, context),
592
- };
593
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
594
- switch (errorCode) {
595
- case "CloudHsmInternalException":
596
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
597
- throw await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context);
598
- case "CloudHsmServiceException":
599
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
600
- throw await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context);
601
- case "InvalidRequestException":
602
- case "com.amazonaws.cloudhsm#InvalidRequestException":
603
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
604
- default:
605
- const parsedBody = parsedOutput.body;
606
- throwDefaultError({
607
- output,
608
- parsedBody,
609
- exceptionCtor: __BaseException,
610
- errorCode,
611
- });
612
- }
613
- };
614
- export const deserializeAws_json1_1ListAvailableZonesCommand = async (output, context) => {
615
- if (output.statusCode >= 300) {
616
- return deserializeAws_json1_1ListAvailableZonesCommandError(output, context);
617
- }
618
- const data = await parseBody(output.body, context);
619
- let contents = {};
620
- contents = deserializeAws_json1_1ListAvailableZonesResponse(data, context);
621
- const response = {
622
- $metadata: deserializeMetadata(output),
623
- ...contents,
624
- };
625
- return Promise.resolve(response);
626
- };
627
- const deserializeAws_json1_1ListAvailableZonesCommandError = async (output, context) => {
628
- const parsedOutput = {
629
- ...output,
630
- body: await parseErrorBody(output.body, context),
631
- };
632
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
633
- switch (errorCode) {
634
- case "CloudHsmInternalException":
635
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
636
- throw await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context);
637
- case "CloudHsmServiceException":
638
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
639
- throw await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context);
640
- case "InvalidRequestException":
641
- case "com.amazonaws.cloudhsm#InvalidRequestException":
642
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
643
- default:
644
- const parsedBody = parsedOutput.body;
645
- throwDefaultError({
646
- output,
647
- parsedBody,
648
- exceptionCtor: __BaseException,
649
- errorCode,
650
- });
651
- }
652
- };
653
- export const deserializeAws_json1_1ListHapgsCommand = async (output, context) => {
654
- if (output.statusCode >= 300) {
655
- return deserializeAws_json1_1ListHapgsCommandError(output, context);
656
- }
657
- const data = await parseBody(output.body, context);
658
- let contents = {};
659
- contents = deserializeAws_json1_1ListHapgsResponse(data, context);
660
- const response = {
661
- $metadata: deserializeMetadata(output),
662
- ...contents,
663
- };
664
- return Promise.resolve(response);
665
- };
666
- const deserializeAws_json1_1ListHapgsCommandError = async (output, context) => {
667
- const parsedOutput = {
668
- ...output,
669
- body: await parseErrorBody(output.body, context),
670
- };
671
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
672
- switch (errorCode) {
673
- case "CloudHsmInternalException":
674
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
675
- throw await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context);
676
- case "CloudHsmServiceException":
677
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
678
- throw await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context);
679
- case "InvalidRequestException":
680
- case "com.amazonaws.cloudhsm#InvalidRequestException":
681
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
682
- default:
683
- const parsedBody = parsedOutput.body;
684
- throwDefaultError({
685
- output,
686
- parsedBody,
687
- exceptionCtor: __BaseException,
688
- errorCode,
689
- });
690
- }
691
- };
692
- export const deserializeAws_json1_1ListHsmsCommand = async (output, context) => {
693
- if (output.statusCode >= 300) {
694
- return deserializeAws_json1_1ListHsmsCommandError(output, context);
695
- }
696
- const data = await parseBody(output.body, context);
697
- let contents = {};
698
- contents = deserializeAws_json1_1ListHsmsResponse(data, context);
699
- const response = {
700
- $metadata: deserializeMetadata(output),
701
- ...contents,
702
- };
703
- return Promise.resolve(response);
704
- };
705
- const deserializeAws_json1_1ListHsmsCommandError = async (output, context) => {
706
- const parsedOutput = {
707
- ...output,
708
- body: await parseErrorBody(output.body, context),
709
- };
710
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
711
- switch (errorCode) {
712
- case "CloudHsmInternalException":
713
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
714
- throw await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context);
715
- case "CloudHsmServiceException":
716
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
717
- throw await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context);
718
- case "InvalidRequestException":
719
- case "com.amazonaws.cloudhsm#InvalidRequestException":
720
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
721
- default:
722
- const parsedBody = parsedOutput.body;
723
- throwDefaultError({
724
- output,
725
- parsedBody,
726
- exceptionCtor: __BaseException,
727
- errorCode,
728
- });
729
- }
730
- };
731
- export const deserializeAws_json1_1ListLunaClientsCommand = async (output, context) => {
732
- if (output.statusCode >= 300) {
733
- return deserializeAws_json1_1ListLunaClientsCommandError(output, context);
734
- }
735
- const data = await parseBody(output.body, context);
736
- let contents = {};
737
- contents = deserializeAws_json1_1ListLunaClientsResponse(data, context);
738
- const response = {
739
- $metadata: deserializeMetadata(output),
740
- ...contents,
741
- };
742
- return Promise.resolve(response);
743
- };
744
- const deserializeAws_json1_1ListLunaClientsCommandError = async (output, context) => {
745
- const parsedOutput = {
746
- ...output,
747
- body: await parseErrorBody(output.body, context),
748
- };
749
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
750
- switch (errorCode) {
751
- case "CloudHsmInternalException":
752
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
753
- throw await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context);
754
- case "CloudHsmServiceException":
755
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
756
- throw await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context);
757
- case "InvalidRequestException":
758
- case "com.amazonaws.cloudhsm#InvalidRequestException":
759
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
760
- default:
761
- const parsedBody = parsedOutput.body;
762
- throwDefaultError({
763
- output,
764
- parsedBody,
765
- exceptionCtor: __BaseException,
766
- errorCode,
767
- });
768
- }
769
- };
770
- export const deserializeAws_json1_1ListTagsForResourceCommand = async (output, context) => {
771
- if (output.statusCode >= 300) {
772
- return deserializeAws_json1_1ListTagsForResourceCommandError(output, context);
773
- }
774
- const data = await parseBody(output.body, context);
775
- let contents = {};
776
- contents = deserializeAws_json1_1ListTagsForResourceResponse(data, context);
777
- const response = {
778
- $metadata: deserializeMetadata(output),
779
- ...contents,
780
- };
781
- return Promise.resolve(response);
782
- };
783
- const deserializeAws_json1_1ListTagsForResourceCommandError = async (output, context) => {
784
- const parsedOutput = {
785
- ...output,
786
- body: await parseErrorBody(output.body, context),
787
- };
788
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
789
- switch (errorCode) {
790
- case "CloudHsmInternalException":
791
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
792
- throw await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context);
793
- case "CloudHsmServiceException":
794
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
795
- throw await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context);
796
- case "InvalidRequestException":
797
- case "com.amazonaws.cloudhsm#InvalidRequestException":
798
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
799
- default:
800
- const parsedBody = parsedOutput.body;
801
- throwDefaultError({
802
- output,
803
- parsedBody,
804
- exceptionCtor: __BaseException,
805
- errorCode,
806
- });
807
- }
808
- };
809
- export const deserializeAws_json1_1ModifyHapgCommand = async (output, context) => {
810
- if (output.statusCode >= 300) {
811
- return deserializeAws_json1_1ModifyHapgCommandError(output, context);
812
- }
813
- const data = await parseBody(output.body, context);
814
- let contents = {};
815
- contents = deserializeAws_json1_1ModifyHapgResponse(data, context);
816
- const response = {
817
- $metadata: deserializeMetadata(output),
818
- ...contents,
819
- };
820
- return Promise.resolve(response);
821
- };
822
- const deserializeAws_json1_1ModifyHapgCommandError = async (output, context) => {
823
- const parsedOutput = {
824
- ...output,
825
- body: await parseErrorBody(output.body, context),
826
- };
827
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
828
- switch (errorCode) {
829
- case "CloudHsmInternalException":
830
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
831
- throw await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context);
832
- case "CloudHsmServiceException":
833
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
834
- throw await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context);
835
- case "InvalidRequestException":
836
- case "com.amazonaws.cloudhsm#InvalidRequestException":
837
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
838
- default:
839
- const parsedBody = parsedOutput.body;
840
- throwDefaultError({
841
- output,
842
- parsedBody,
843
- exceptionCtor: __BaseException,
844
- errorCode,
845
- });
846
- }
847
- };
848
- export const deserializeAws_json1_1ModifyHsmCommand = async (output, context) => {
849
- if (output.statusCode >= 300) {
850
- return deserializeAws_json1_1ModifyHsmCommandError(output, context);
851
- }
852
- const data = await parseBody(output.body, context);
853
- let contents = {};
854
- contents = deserializeAws_json1_1ModifyHsmResponse(data, context);
855
- const response = {
856
- $metadata: deserializeMetadata(output),
857
- ...contents,
858
- };
859
- return Promise.resolve(response);
860
- };
861
- const deserializeAws_json1_1ModifyHsmCommandError = async (output, context) => {
862
- const parsedOutput = {
863
- ...output,
864
- body: await parseErrorBody(output.body, context),
865
- };
866
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
867
- switch (errorCode) {
868
- case "CloudHsmInternalException":
869
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
870
- throw await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context);
871
- case "CloudHsmServiceException":
872
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
873
- throw await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context);
874
- case "InvalidRequestException":
875
- case "com.amazonaws.cloudhsm#InvalidRequestException":
876
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
877
- default:
878
- const parsedBody = parsedOutput.body;
879
- throwDefaultError({
880
- output,
881
- parsedBody,
882
- exceptionCtor: __BaseException,
883
- errorCode,
884
- });
885
- }
886
- };
887
- export const deserializeAws_json1_1ModifyLunaClientCommand = async (output, context) => {
888
- if (output.statusCode >= 300) {
889
- return deserializeAws_json1_1ModifyLunaClientCommandError(output, context);
890
- }
891
- const data = await parseBody(output.body, context);
892
- let contents = {};
893
- contents = deserializeAws_json1_1ModifyLunaClientResponse(data, context);
894
- const response = {
895
- $metadata: deserializeMetadata(output),
896
- ...contents,
897
- };
898
- return Promise.resolve(response);
899
- };
900
- const deserializeAws_json1_1ModifyLunaClientCommandError = async (output, context) => {
901
- const parsedOutput = {
902
- ...output,
903
- body: await parseErrorBody(output.body, context),
904
- };
905
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
906
- switch (errorCode) {
907
- case "CloudHsmServiceException":
908
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
909
- throw await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context);
910
- default:
911
- const parsedBody = parsedOutput.body;
912
- throwDefaultError({
913
- output,
914
- parsedBody,
915
- exceptionCtor: __BaseException,
916
- errorCode,
917
- });
918
- }
919
- };
920
- export const deserializeAws_json1_1RemoveTagsFromResourceCommand = async (output, context) => {
921
- if (output.statusCode >= 300) {
922
- return deserializeAws_json1_1RemoveTagsFromResourceCommandError(output, context);
923
- }
924
- const data = await parseBody(output.body, context);
925
- let contents = {};
926
- contents = deserializeAws_json1_1RemoveTagsFromResourceResponse(data, context);
927
- const response = {
928
- $metadata: deserializeMetadata(output),
929
- ...contents,
930
- };
931
- return Promise.resolve(response);
932
- };
933
- const deserializeAws_json1_1RemoveTagsFromResourceCommandError = async (output, context) => {
934
- const parsedOutput = {
935
- ...output,
936
- body: await parseErrorBody(output.body, context),
937
- };
938
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
939
- switch (errorCode) {
940
- case "CloudHsmInternalException":
941
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
942
- throw await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context);
943
- case "CloudHsmServiceException":
944
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
945
- throw await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context);
946
- case "InvalidRequestException":
947
- case "com.amazonaws.cloudhsm#InvalidRequestException":
948
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
949
- default:
950
- const parsedBody = parsedOutput.body;
951
- throwDefaultError({
952
- output,
953
- parsedBody,
954
- exceptionCtor: __BaseException,
955
- errorCode,
956
- });
957
- }
958
- };
959
- const deserializeAws_json1_1CloudHsmInternalExceptionResponse = async (parsedOutput, context) => {
960
- const body = parsedOutput.body;
961
- const deserialized = deserializeAws_json1_1CloudHsmInternalException(body, context);
962
- const exception = new CloudHsmInternalException({
963
- $metadata: deserializeMetadata(parsedOutput),
964
- ...deserialized,
965
- });
966
- return __decorateServiceException(exception, body);
967
- };
968
- const deserializeAws_json1_1CloudHsmServiceExceptionResponse = async (parsedOutput, context) => {
969
- const body = parsedOutput.body;
970
- const deserialized = deserializeAws_json1_1CloudHsmServiceException(body, context);
971
- const exception = new CloudHsmServiceException({
972
- $metadata: deserializeMetadata(parsedOutput),
973
- ...deserialized,
974
- });
975
- return __decorateServiceException(exception, body);
976
- };
977
- const deserializeAws_json1_1InvalidRequestExceptionResponse = async (parsedOutput, context) => {
978
- const body = parsedOutput.body;
979
- const deserialized = deserializeAws_json1_1InvalidRequestException(body, context);
980
- const exception = new InvalidRequestException({
981
- $metadata: deserializeMetadata(parsedOutput),
982
- ...deserialized,
983
- });
984
- return __decorateServiceException(exception, body);
985
- };
986
- const serializeAws_json1_1AddTagsToResourceRequest = (input, context) => {
987
- return {
988
- ...(input.ResourceArn != null && { ResourceArn: input.ResourceArn }),
989
- ...(input.TagList != null && { TagList: serializeAws_json1_1TagList(input.TagList, context) }),
990
- };
6
+ export var serializeAws_json1_1AddTagsToResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
+ var headers, body;
8
+ return __generator(this, function (_a) {
9
+ headers = {
10
+ "content-type": "application/x-amz-json-1.1",
11
+ "x-amz-target": "CloudHsmFrontendService.AddTagsToResource",
12
+ };
13
+ body = JSON.stringify(serializeAws_json1_1AddTagsToResourceRequest(input, context));
14
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
15
+ });
16
+ }); };
17
+ export var serializeAws_json1_1CreateHapgCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
18
+ var headers, body;
19
+ return __generator(this, function (_a) {
20
+ headers = {
21
+ "content-type": "application/x-amz-json-1.1",
22
+ "x-amz-target": "CloudHsmFrontendService.CreateHapg",
23
+ };
24
+ body = JSON.stringify(serializeAws_json1_1CreateHapgRequest(input, context));
25
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
26
+ });
27
+ }); };
28
+ export var serializeAws_json1_1CreateHsmCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
29
+ var headers, body;
30
+ return __generator(this, function (_a) {
31
+ headers = {
32
+ "content-type": "application/x-amz-json-1.1",
33
+ "x-amz-target": "CloudHsmFrontendService.CreateHsm",
34
+ };
35
+ body = JSON.stringify(serializeAws_json1_1CreateHsmRequest(input, context));
36
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
37
+ });
38
+ }); };
39
+ export var serializeAws_json1_1CreateLunaClientCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
40
+ var headers, body;
41
+ return __generator(this, function (_a) {
42
+ headers = {
43
+ "content-type": "application/x-amz-json-1.1",
44
+ "x-amz-target": "CloudHsmFrontendService.CreateLunaClient",
45
+ };
46
+ body = JSON.stringify(serializeAws_json1_1CreateLunaClientRequest(input, context));
47
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
48
+ });
49
+ }); };
50
+ export var serializeAws_json1_1DeleteHapgCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
51
+ var headers, body;
52
+ return __generator(this, function (_a) {
53
+ headers = {
54
+ "content-type": "application/x-amz-json-1.1",
55
+ "x-amz-target": "CloudHsmFrontendService.DeleteHapg",
56
+ };
57
+ body = JSON.stringify(serializeAws_json1_1DeleteHapgRequest(input, context));
58
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
59
+ });
60
+ }); };
61
+ export var serializeAws_json1_1DeleteHsmCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
62
+ var headers, body;
63
+ return __generator(this, function (_a) {
64
+ headers = {
65
+ "content-type": "application/x-amz-json-1.1",
66
+ "x-amz-target": "CloudHsmFrontendService.DeleteHsm",
67
+ };
68
+ body = JSON.stringify(serializeAws_json1_1DeleteHsmRequest(input, context));
69
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
70
+ });
71
+ }); };
72
+ export var serializeAws_json1_1DeleteLunaClientCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
73
+ var headers, body;
74
+ return __generator(this, function (_a) {
75
+ headers = {
76
+ "content-type": "application/x-amz-json-1.1",
77
+ "x-amz-target": "CloudHsmFrontendService.DeleteLunaClient",
78
+ };
79
+ body = JSON.stringify(serializeAws_json1_1DeleteLunaClientRequest(input, context));
80
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
81
+ });
82
+ }); };
83
+ export var serializeAws_json1_1DescribeHapgCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
84
+ var headers, body;
85
+ return __generator(this, function (_a) {
86
+ headers = {
87
+ "content-type": "application/x-amz-json-1.1",
88
+ "x-amz-target": "CloudHsmFrontendService.DescribeHapg",
89
+ };
90
+ body = JSON.stringify(serializeAws_json1_1DescribeHapgRequest(input, context));
91
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
92
+ });
93
+ }); };
94
+ export var serializeAws_json1_1DescribeHsmCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
95
+ var headers, body;
96
+ return __generator(this, function (_a) {
97
+ headers = {
98
+ "content-type": "application/x-amz-json-1.1",
99
+ "x-amz-target": "CloudHsmFrontendService.DescribeHsm",
100
+ };
101
+ body = JSON.stringify(serializeAws_json1_1DescribeHsmRequest(input, context));
102
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
103
+ });
104
+ }); };
105
+ export var serializeAws_json1_1DescribeLunaClientCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
106
+ var headers, body;
107
+ return __generator(this, function (_a) {
108
+ headers = {
109
+ "content-type": "application/x-amz-json-1.1",
110
+ "x-amz-target": "CloudHsmFrontendService.DescribeLunaClient",
111
+ };
112
+ body = JSON.stringify(serializeAws_json1_1DescribeLunaClientRequest(input, context));
113
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
114
+ });
115
+ }); };
116
+ export var serializeAws_json1_1GetConfigCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
117
+ var headers, body;
118
+ return __generator(this, function (_a) {
119
+ headers = {
120
+ "content-type": "application/x-amz-json-1.1",
121
+ "x-amz-target": "CloudHsmFrontendService.GetConfig",
122
+ };
123
+ body = JSON.stringify(serializeAws_json1_1GetConfigRequest(input, context));
124
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
125
+ });
126
+ }); };
127
+ export var serializeAws_json1_1ListAvailableZonesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
128
+ var headers, body;
129
+ return __generator(this, function (_a) {
130
+ headers = {
131
+ "content-type": "application/x-amz-json-1.1",
132
+ "x-amz-target": "CloudHsmFrontendService.ListAvailableZones",
133
+ };
134
+ body = JSON.stringify(serializeAws_json1_1ListAvailableZonesRequest(input, context));
135
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
136
+ });
137
+ }); };
138
+ export var serializeAws_json1_1ListHapgsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
139
+ var headers, body;
140
+ return __generator(this, function (_a) {
141
+ headers = {
142
+ "content-type": "application/x-amz-json-1.1",
143
+ "x-amz-target": "CloudHsmFrontendService.ListHapgs",
144
+ };
145
+ body = JSON.stringify(serializeAws_json1_1ListHapgsRequest(input, context));
146
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
147
+ });
148
+ }); };
149
+ export var serializeAws_json1_1ListHsmsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
150
+ var headers, body;
151
+ return __generator(this, function (_a) {
152
+ headers = {
153
+ "content-type": "application/x-amz-json-1.1",
154
+ "x-amz-target": "CloudHsmFrontendService.ListHsms",
155
+ };
156
+ body = JSON.stringify(serializeAws_json1_1ListHsmsRequest(input, context));
157
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
158
+ });
159
+ }); };
160
+ export var serializeAws_json1_1ListLunaClientsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
161
+ var headers, body;
162
+ return __generator(this, function (_a) {
163
+ headers = {
164
+ "content-type": "application/x-amz-json-1.1",
165
+ "x-amz-target": "CloudHsmFrontendService.ListLunaClients",
166
+ };
167
+ body = JSON.stringify(serializeAws_json1_1ListLunaClientsRequest(input, context));
168
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
169
+ });
170
+ }); };
171
+ export var serializeAws_json1_1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
172
+ var headers, body;
173
+ return __generator(this, function (_a) {
174
+ headers = {
175
+ "content-type": "application/x-amz-json-1.1",
176
+ "x-amz-target": "CloudHsmFrontendService.ListTagsForResource",
177
+ };
178
+ body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context));
179
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
180
+ });
181
+ }); };
182
+ export var serializeAws_json1_1ModifyHapgCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
183
+ var headers, body;
184
+ return __generator(this, function (_a) {
185
+ headers = {
186
+ "content-type": "application/x-amz-json-1.1",
187
+ "x-amz-target": "CloudHsmFrontendService.ModifyHapg",
188
+ };
189
+ body = JSON.stringify(serializeAws_json1_1ModifyHapgRequest(input, context));
190
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
191
+ });
192
+ }); };
193
+ export var serializeAws_json1_1ModifyHsmCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
194
+ var headers, body;
195
+ return __generator(this, function (_a) {
196
+ headers = {
197
+ "content-type": "application/x-amz-json-1.1",
198
+ "x-amz-target": "CloudHsmFrontendService.ModifyHsm",
199
+ };
200
+ body = JSON.stringify(serializeAws_json1_1ModifyHsmRequest(input, context));
201
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
202
+ });
203
+ }); };
204
+ export var serializeAws_json1_1ModifyLunaClientCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
205
+ var headers, body;
206
+ return __generator(this, function (_a) {
207
+ headers = {
208
+ "content-type": "application/x-amz-json-1.1",
209
+ "x-amz-target": "CloudHsmFrontendService.ModifyLunaClient",
210
+ };
211
+ body = JSON.stringify(serializeAws_json1_1ModifyLunaClientRequest(input, context));
212
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
213
+ });
214
+ }); };
215
+ export var serializeAws_json1_1RemoveTagsFromResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
216
+ var headers, body;
217
+ return __generator(this, function (_a) {
218
+ headers = {
219
+ "content-type": "application/x-amz-json-1.1",
220
+ "x-amz-target": "CloudHsmFrontendService.RemoveTagsFromResource",
221
+ };
222
+ body = JSON.stringify(serializeAws_json1_1RemoveTagsFromResourceRequest(input, context));
223
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
224
+ });
225
+ }); };
226
+ export var deserializeAws_json1_1AddTagsToResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
227
+ var data, contents, response;
228
+ return __generator(this, function (_a) {
229
+ switch (_a.label) {
230
+ case 0:
231
+ if (output.statusCode >= 300) {
232
+ return [2, deserializeAws_json1_1AddTagsToResourceCommandError(output, context)];
233
+ }
234
+ return [4, parseBody(output.body, context)];
235
+ case 1:
236
+ data = _a.sent();
237
+ contents = {};
238
+ contents = deserializeAws_json1_1AddTagsToResourceResponse(data, context);
239
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
240
+ return [2, Promise.resolve(response)];
241
+ }
242
+ });
243
+ }); };
244
+ var deserializeAws_json1_1AddTagsToResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
245
+ var parsedOutput, _a, errorCode, _b, parsedBody;
246
+ var _c;
247
+ return __generator(this, function (_d) {
248
+ switch (_d.label) {
249
+ case 0:
250
+ _a = [__assign({}, output)];
251
+ _c = {};
252
+ return [4, parseErrorBody(output.body, context)];
253
+ case 1:
254
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
255
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
256
+ _b = errorCode;
257
+ switch (_b) {
258
+ case "CloudHsmInternalException": return [3, 2];
259
+ case "com.amazonaws.cloudhsm#CloudHsmInternalException": return [3, 2];
260
+ case "CloudHsmServiceException": return [3, 4];
261
+ case "com.amazonaws.cloudhsm#CloudHsmServiceException": return [3, 4];
262
+ case "InvalidRequestException": return [3, 6];
263
+ case "com.amazonaws.cloudhsm#InvalidRequestException": return [3, 6];
264
+ }
265
+ return [3, 8];
266
+ case 2: return [4, deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)];
267
+ case 3: throw _d.sent();
268
+ case 4: return [4, deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)];
269
+ case 5: throw _d.sent();
270
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
271
+ case 7: throw _d.sent();
272
+ case 8:
273
+ parsedBody = parsedOutput.body;
274
+ throwDefaultError({
275
+ output: output,
276
+ parsedBody: parsedBody,
277
+ exceptionCtor: __BaseException,
278
+ errorCode: errorCode,
279
+ });
280
+ _d.label = 9;
281
+ case 9: return [2];
282
+ }
283
+ });
284
+ }); };
285
+ export var deserializeAws_json1_1CreateHapgCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
286
+ var data, contents, response;
287
+ return __generator(this, function (_a) {
288
+ switch (_a.label) {
289
+ case 0:
290
+ if (output.statusCode >= 300) {
291
+ return [2, deserializeAws_json1_1CreateHapgCommandError(output, context)];
292
+ }
293
+ return [4, parseBody(output.body, context)];
294
+ case 1:
295
+ data = _a.sent();
296
+ contents = {};
297
+ contents = deserializeAws_json1_1CreateHapgResponse(data, context);
298
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
299
+ return [2, Promise.resolve(response)];
300
+ }
301
+ });
302
+ }); };
303
+ var deserializeAws_json1_1CreateHapgCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
304
+ var parsedOutput, _a, errorCode, _b, parsedBody;
305
+ var _c;
306
+ return __generator(this, function (_d) {
307
+ switch (_d.label) {
308
+ case 0:
309
+ _a = [__assign({}, output)];
310
+ _c = {};
311
+ return [4, parseErrorBody(output.body, context)];
312
+ case 1:
313
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
314
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
315
+ _b = errorCode;
316
+ switch (_b) {
317
+ case "CloudHsmInternalException": return [3, 2];
318
+ case "com.amazonaws.cloudhsm#CloudHsmInternalException": return [3, 2];
319
+ case "CloudHsmServiceException": return [3, 4];
320
+ case "com.amazonaws.cloudhsm#CloudHsmServiceException": return [3, 4];
321
+ case "InvalidRequestException": return [3, 6];
322
+ case "com.amazonaws.cloudhsm#InvalidRequestException": return [3, 6];
323
+ }
324
+ return [3, 8];
325
+ case 2: return [4, deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)];
326
+ case 3: throw _d.sent();
327
+ case 4: return [4, deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)];
328
+ case 5: throw _d.sent();
329
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
330
+ case 7: throw _d.sent();
331
+ case 8:
332
+ parsedBody = parsedOutput.body;
333
+ throwDefaultError({
334
+ output: output,
335
+ parsedBody: parsedBody,
336
+ exceptionCtor: __BaseException,
337
+ errorCode: errorCode,
338
+ });
339
+ _d.label = 9;
340
+ case 9: return [2];
341
+ }
342
+ });
343
+ }); };
344
+ export var deserializeAws_json1_1CreateHsmCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
345
+ var data, contents, response;
346
+ return __generator(this, function (_a) {
347
+ switch (_a.label) {
348
+ case 0:
349
+ if (output.statusCode >= 300) {
350
+ return [2, deserializeAws_json1_1CreateHsmCommandError(output, context)];
351
+ }
352
+ return [4, parseBody(output.body, context)];
353
+ case 1:
354
+ data = _a.sent();
355
+ contents = {};
356
+ contents = deserializeAws_json1_1CreateHsmResponse(data, context);
357
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
358
+ return [2, Promise.resolve(response)];
359
+ }
360
+ });
361
+ }); };
362
+ var deserializeAws_json1_1CreateHsmCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
363
+ var parsedOutput, _a, errorCode, _b, parsedBody;
364
+ var _c;
365
+ return __generator(this, function (_d) {
366
+ switch (_d.label) {
367
+ case 0:
368
+ _a = [__assign({}, output)];
369
+ _c = {};
370
+ return [4, parseErrorBody(output.body, context)];
371
+ case 1:
372
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
373
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
374
+ _b = errorCode;
375
+ switch (_b) {
376
+ case "CloudHsmInternalException": return [3, 2];
377
+ case "com.amazonaws.cloudhsm#CloudHsmInternalException": return [3, 2];
378
+ case "CloudHsmServiceException": return [3, 4];
379
+ case "com.amazonaws.cloudhsm#CloudHsmServiceException": return [3, 4];
380
+ case "InvalidRequestException": return [3, 6];
381
+ case "com.amazonaws.cloudhsm#InvalidRequestException": return [3, 6];
382
+ }
383
+ return [3, 8];
384
+ case 2: return [4, deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)];
385
+ case 3: throw _d.sent();
386
+ case 4: return [4, deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)];
387
+ case 5: throw _d.sent();
388
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
389
+ case 7: throw _d.sent();
390
+ case 8:
391
+ parsedBody = parsedOutput.body;
392
+ throwDefaultError({
393
+ output: output,
394
+ parsedBody: parsedBody,
395
+ exceptionCtor: __BaseException,
396
+ errorCode: errorCode,
397
+ });
398
+ _d.label = 9;
399
+ case 9: return [2];
400
+ }
401
+ });
402
+ }); };
403
+ export var deserializeAws_json1_1CreateLunaClientCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
404
+ var data, contents, response;
405
+ return __generator(this, function (_a) {
406
+ switch (_a.label) {
407
+ case 0:
408
+ if (output.statusCode >= 300) {
409
+ return [2, deserializeAws_json1_1CreateLunaClientCommandError(output, context)];
410
+ }
411
+ return [4, parseBody(output.body, context)];
412
+ case 1:
413
+ data = _a.sent();
414
+ contents = {};
415
+ contents = deserializeAws_json1_1CreateLunaClientResponse(data, context);
416
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
417
+ return [2, Promise.resolve(response)];
418
+ }
419
+ });
420
+ }); };
421
+ var deserializeAws_json1_1CreateLunaClientCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
422
+ var parsedOutput, _a, errorCode, _b, parsedBody;
423
+ var _c;
424
+ return __generator(this, function (_d) {
425
+ switch (_d.label) {
426
+ case 0:
427
+ _a = [__assign({}, output)];
428
+ _c = {};
429
+ return [4, parseErrorBody(output.body, context)];
430
+ case 1:
431
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
432
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
433
+ _b = errorCode;
434
+ switch (_b) {
435
+ case "CloudHsmInternalException": return [3, 2];
436
+ case "com.amazonaws.cloudhsm#CloudHsmInternalException": return [3, 2];
437
+ case "CloudHsmServiceException": return [3, 4];
438
+ case "com.amazonaws.cloudhsm#CloudHsmServiceException": return [3, 4];
439
+ case "InvalidRequestException": return [3, 6];
440
+ case "com.amazonaws.cloudhsm#InvalidRequestException": return [3, 6];
441
+ }
442
+ return [3, 8];
443
+ case 2: return [4, deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)];
444
+ case 3: throw _d.sent();
445
+ case 4: return [4, deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)];
446
+ case 5: throw _d.sent();
447
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
448
+ case 7: throw _d.sent();
449
+ case 8:
450
+ parsedBody = parsedOutput.body;
451
+ throwDefaultError({
452
+ output: output,
453
+ parsedBody: parsedBody,
454
+ exceptionCtor: __BaseException,
455
+ errorCode: errorCode,
456
+ });
457
+ _d.label = 9;
458
+ case 9: return [2];
459
+ }
460
+ });
461
+ }); };
462
+ export var deserializeAws_json1_1DeleteHapgCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
463
+ var data, contents, response;
464
+ return __generator(this, function (_a) {
465
+ switch (_a.label) {
466
+ case 0:
467
+ if (output.statusCode >= 300) {
468
+ return [2, deserializeAws_json1_1DeleteHapgCommandError(output, context)];
469
+ }
470
+ return [4, parseBody(output.body, context)];
471
+ case 1:
472
+ data = _a.sent();
473
+ contents = {};
474
+ contents = deserializeAws_json1_1DeleteHapgResponse(data, context);
475
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
476
+ return [2, Promise.resolve(response)];
477
+ }
478
+ });
479
+ }); };
480
+ var deserializeAws_json1_1DeleteHapgCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
481
+ var parsedOutput, _a, errorCode, _b, parsedBody;
482
+ var _c;
483
+ return __generator(this, function (_d) {
484
+ switch (_d.label) {
485
+ case 0:
486
+ _a = [__assign({}, output)];
487
+ _c = {};
488
+ return [4, parseErrorBody(output.body, context)];
489
+ case 1:
490
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
491
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
492
+ _b = errorCode;
493
+ switch (_b) {
494
+ case "CloudHsmInternalException": return [3, 2];
495
+ case "com.amazonaws.cloudhsm#CloudHsmInternalException": return [3, 2];
496
+ case "CloudHsmServiceException": return [3, 4];
497
+ case "com.amazonaws.cloudhsm#CloudHsmServiceException": return [3, 4];
498
+ case "InvalidRequestException": return [3, 6];
499
+ case "com.amazonaws.cloudhsm#InvalidRequestException": return [3, 6];
500
+ }
501
+ return [3, 8];
502
+ case 2: return [4, deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)];
503
+ case 3: throw _d.sent();
504
+ case 4: return [4, deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)];
505
+ case 5: throw _d.sent();
506
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
507
+ case 7: throw _d.sent();
508
+ case 8:
509
+ parsedBody = parsedOutput.body;
510
+ throwDefaultError({
511
+ output: output,
512
+ parsedBody: parsedBody,
513
+ exceptionCtor: __BaseException,
514
+ errorCode: errorCode,
515
+ });
516
+ _d.label = 9;
517
+ case 9: return [2];
518
+ }
519
+ });
520
+ }); };
521
+ export var deserializeAws_json1_1DeleteHsmCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
522
+ var data, contents, response;
523
+ return __generator(this, function (_a) {
524
+ switch (_a.label) {
525
+ case 0:
526
+ if (output.statusCode >= 300) {
527
+ return [2, deserializeAws_json1_1DeleteHsmCommandError(output, context)];
528
+ }
529
+ return [4, parseBody(output.body, context)];
530
+ case 1:
531
+ data = _a.sent();
532
+ contents = {};
533
+ contents = deserializeAws_json1_1DeleteHsmResponse(data, context);
534
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
535
+ return [2, Promise.resolve(response)];
536
+ }
537
+ });
538
+ }); };
539
+ var deserializeAws_json1_1DeleteHsmCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
540
+ var parsedOutput, _a, errorCode, _b, parsedBody;
541
+ var _c;
542
+ return __generator(this, function (_d) {
543
+ switch (_d.label) {
544
+ case 0:
545
+ _a = [__assign({}, output)];
546
+ _c = {};
547
+ return [4, parseErrorBody(output.body, context)];
548
+ case 1:
549
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
550
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
551
+ _b = errorCode;
552
+ switch (_b) {
553
+ case "CloudHsmInternalException": return [3, 2];
554
+ case "com.amazonaws.cloudhsm#CloudHsmInternalException": return [3, 2];
555
+ case "CloudHsmServiceException": return [3, 4];
556
+ case "com.amazonaws.cloudhsm#CloudHsmServiceException": return [3, 4];
557
+ case "InvalidRequestException": return [3, 6];
558
+ case "com.amazonaws.cloudhsm#InvalidRequestException": return [3, 6];
559
+ }
560
+ return [3, 8];
561
+ case 2: return [4, deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)];
562
+ case 3: throw _d.sent();
563
+ case 4: return [4, deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)];
564
+ case 5: throw _d.sent();
565
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
566
+ case 7: throw _d.sent();
567
+ case 8:
568
+ parsedBody = parsedOutput.body;
569
+ throwDefaultError({
570
+ output: output,
571
+ parsedBody: parsedBody,
572
+ exceptionCtor: __BaseException,
573
+ errorCode: errorCode,
574
+ });
575
+ _d.label = 9;
576
+ case 9: return [2];
577
+ }
578
+ });
579
+ }); };
580
+ export var deserializeAws_json1_1DeleteLunaClientCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
581
+ var data, contents, response;
582
+ return __generator(this, function (_a) {
583
+ switch (_a.label) {
584
+ case 0:
585
+ if (output.statusCode >= 300) {
586
+ return [2, deserializeAws_json1_1DeleteLunaClientCommandError(output, context)];
587
+ }
588
+ return [4, parseBody(output.body, context)];
589
+ case 1:
590
+ data = _a.sent();
591
+ contents = {};
592
+ contents = deserializeAws_json1_1DeleteLunaClientResponse(data, context);
593
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
594
+ return [2, Promise.resolve(response)];
595
+ }
596
+ });
597
+ }); };
598
+ var deserializeAws_json1_1DeleteLunaClientCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
599
+ var parsedOutput, _a, errorCode, _b, parsedBody;
600
+ var _c;
601
+ return __generator(this, function (_d) {
602
+ switch (_d.label) {
603
+ case 0:
604
+ _a = [__assign({}, output)];
605
+ _c = {};
606
+ return [4, parseErrorBody(output.body, context)];
607
+ case 1:
608
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
609
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
610
+ _b = errorCode;
611
+ switch (_b) {
612
+ case "CloudHsmInternalException": return [3, 2];
613
+ case "com.amazonaws.cloudhsm#CloudHsmInternalException": return [3, 2];
614
+ case "CloudHsmServiceException": return [3, 4];
615
+ case "com.amazonaws.cloudhsm#CloudHsmServiceException": return [3, 4];
616
+ case "InvalidRequestException": return [3, 6];
617
+ case "com.amazonaws.cloudhsm#InvalidRequestException": return [3, 6];
618
+ }
619
+ return [3, 8];
620
+ case 2: return [4, deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)];
621
+ case 3: throw _d.sent();
622
+ case 4: return [4, deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)];
623
+ case 5: throw _d.sent();
624
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
625
+ case 7: throw _d.sent();
626
+ case 8:
627
+ parsedBody = parsedOutput.body;
628
+ throwDefaultError({
629
+ output: output,
630
+ parsedBody: parsedBody,
631
+ exceptionCtor: __BaseException,
632
+ errorCode: errorCode,
633
+ });
634
+ _d.label = 9;
635
+ case 9: return [2];
636
+ }
637
+ });
638
+ }); };
639
+ export var deserializeAws_json1_1DescribeHapgCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
640
+ var data, contents, response;
641
+ return __generator(this, function (_a) {
642
+ switch (_a.label) {
643
+ case 0:
644
+ if (output.statusCode >= 300) {
645
+ return [2, deserializeAws_json1_1DescribeHapgCommandError(output, context)];
646
+ }
647
+ return [4, parseBody(output.body, context)];
648
+ case 1:
649
+ data = _a.sent();
650
+ contents = {};
651
+ contents = deserializeAws_json1_1DescribeHapgResponse(data, context);
652
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
653
+ return [2, Promise.resolve(response)];
654
+ }
655
+ });
656
+ }); };
657
+ var deserializeAws_json1_1DescribeHapgCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
658
+ var parsedOutput, _a, errorCode, _b, parsedBody;
659
+ var _c;
660
+ return __generator(this, function (_d) {
661
+ switch (_d.label) {
662
+ case 0:
663
+ _a = [__assign({}, output)];
664
+ _c = {};
665
+ return [4, parseErrorBody(output.body, context)];
666
+ case 1:
667
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
668
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
669
+ _b = errorCode;
670
+ switch (_b) {
671
+ case "CloudHsmInternalException": return [3, 2];
672
+ case "com.amazonaws.cloudhsm#CloudHsmInternalException": return [3, 2];
673
+ case "CloudHsmServiceException": return [3, 4];
674
+ case "com.amazonaws.cloudhsm#CloudHsmServiceException": return [3, 4];
675
+ case "InvalidRequestException": return [3, 6];
676
+ case "com.amazonaws.cloudhsm#InvalidRequestException": return [3, 6];
677
+ }
678
+ return [3, 8];
679
+ case 2: return [4, deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)];
680
+ case 3: throw _d.sent();
681
+ case 4: return [4, deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)];
682
+ case 5: throw _d.sent();
683
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
684
+ case 7: throw _d.sent();
685
+ case 8:
686
+ parsedBody = parsedOutput.body;
687
+ throwDefaultError({
688
+ output: output,
689
+ parsedBody: parsedBody,
690
+ exceptionCtor: __BaseException,
691
+ errorCode: errorCode,
692
+ });
693
+ _d.label = 9;
694
+ case 9: return [2];
695
+ }
696
+ });
697
+ }); };
698
+ export var deserializeAws_json1_1DescribeHsmCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
699
+ var data, contents, response;
700
+ return __generator(this, function (_a) {
701
+ switch (_a.label) {
702
+ case 0:
703
+ if (output.statusCode >= 300) {
704
+ return [2, deserializeAws_json1_1DescribeHsmCommandError(output, context)];
705
+ }
706
+ return [4, parseBody(output.body, context)];
707
+ case 1:
708
+ data = _a.sent();
709
+ contents = {};
710
+ contents = deserializeAws_json1_1DescribeHsmResponse(data, context);
711
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
712
+ return [2, Promise.resolve(response)];
713
+ }
714
+ });
715
+ }); };
716
+ var deserializeAws_json1_1DescribeHsmCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
717
+ var parsedOutput, _a, errorCode, _b, parsedBody;
718
+ var _c;
719
+ return __generator(this, function (_d) {
720
+ switch (_d.label) {
721
+ case 0:
722
+ _a = [__assign({}, output)];
723
+ _c = {};
724
+ return [4, parseErrorBody(output.body, context)];
725
+ case 1:
726
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
727
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
728
+ _b = errorCode;
729
+ switch (_b) {
730
+ case "CloudHsmInternalException": return [3, 2];
731
+ case "com.amazonaws.cloudhsm#CloudHsmInternalException": return [3, 2];
732
+ case "CloudHsmServiceException": return [3, 4];
733
+ case "com.amazonaws.cloudhsm#CloudHsmServiceException": return [3, 4];
734
+ case "InvalidRequestException": return [3, 6];
735
+ case "com.amazonaws.cloudhsm#InvalidRequestException": return [3, 6];
736
+ }
737
+ return [3, 8];
738
+ case 2: return [4, deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)];
739
+ case 3: throw _d.sent();
740
+ case 4: return [4, deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)];
741
+ case 5: throw _d.sent();
742
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
743
+ case 7: throw _d.sent();
744
+ case 8:
745
+ parsedBody = parsedOutput.body;
746
+ throwDefaultError({
747
+ output: output,
748
+ parsedBody: parsedBody,
749
+ exceptionCtor: __BaseException,
750
+ errorCode: errorCode,
751
+ });
752
+ _d.label = 9;
753
+ case 9: return [2];
754
+ }
755
+ });
756
+ }); };
757
+ export var deserializeAws_json1_1DescribeLunaClientCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
758
+ var data, contents, response;
759
+ return __generator(this, function (_a) {
760
+ switch (_a.label) {
761
+ case 0:
762
+ if (output.statusCode >= 300) {
763
+ return [2, deserializeAws_json1_1DescribeLunaClientCommandError(output, context)];
764
+ }
765
+ return [4, parseBody(output.body, context)];
766
+ case 1:
767
+ data = _a.sent();
768
+ contents = {};
769
+ contents = deserializeAws_json1_1DescribeLunaClientResponse(data, context);
770
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
771
+ return [2, Promise.resolve(response)];
772
+ }
773
+ });
774
+ }); };
775
+ var deserializeAws_json1_1DescribeLunaClientCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
776
+ var parsedOutput, _a, errorCode, _b, parsedBody;
777
+ var _c;
778
+ return __generator(this, function (_d) {
779
+ switch (_d.label) {
780
+ case 0:
781
+ _a = [__assign({}, output)];
782
+ _c = {};
783
+ return [4, parseErrorBody(output.body, context)];
784
+ case 1:
785
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
786
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
787
+ _b = errorCode;
788
+ switch (_b) {
789
+ case "CloudHsmInternalException": return [3, 2];
790
+ case "com.amazonaws.cloudhsm#CloudHsmInternalException": return [3, 2];
791
+ case "CloudHsmServiceException": return [3, 4];
792
+ case "com.amazonaws.cloudhsm#CloudHsmServiceException": return [3, 4];
793
+ case "InvalidRequestException": return [3, 6];
794
+ case "com.amazonaws.cloudhsm#InvalidRequestException": return [3, 6];
795
+ }
796
+ return [3, 8];
797
+ case 2: return [4, deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)];
798
+ case 3: throw _d.sent();
799
+ case 4: return [4, deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)];
800
+ case 5: throw _d.sent();
801
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
802
+ case 7: throw _d.sent();
803
+ case 8:
804
+ parsedBody = parsedOutput.body;
805
+ throwDefaultError({
806
+ output: output,
807
+ parsedBody: parsedBody,
808
+ exceptionCtor: __BaseException,
809
+ errorCode: errorCode,
810
+ });
811
+ _d.label = 9;
812
+ case 9: return [2];
813
+ }
814
+ });
815
+ }); };
816
+ export var deserializeAws_json1_1GetConfigCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
817
+ var data, contents, response;
818
+ return __generator(this, function (_a) {
819
+ switch (_a.label) {
820
+ case 0:
821
+ if (output.statusCode >= 300) {
822
+ return [2, deserializeAws_json1_1GetConfigCommandError(output, context)];
823
+ }
824
+ return [4, parseBody(output.body, context)];
825
+ case 1:
826
+ data = _a.sent();
827
+ contents = {};
828
+ contents = deserializeAws_json1_1GetConfigResponse(data, context);
829
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
830
+ return [2, Promise.resolve(response)];
831
+ }
832
+ });
833
+ }); };
834
+ var deserializeAws_json1_1GetConfigCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
835
+ var parsedOutput, _a, errorCode, _b, parsedBody;
836
+ var _c;
837
+ return __generator(this, function (_d) {
838
+ switch (_d.label) {
839
+ case 0:
840
+ _a = [__assign({}, output)];
841
+ _c = {};
842
+ return [4, parseErrorBody(output.body, context)];
843
+ case 1:
844
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
845
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
846
+ _b = errorCode;
847
+ switch (_b) {
848
+ case "CloudHsmInternalException": return [3, 2];
849
+ case "com.amazonaws.cloudhsm#CloudHsmInternalException": return [3, 2];
850
+ case "CloudHsmServiceException": return [3, 4];
851
+ case "com.amazonaws.cloudhsm#CloudHsmServiceException": return [3, 4];
852
+ case "InvalidRequestException": return [3, 6];
853
+ case "com.amazonaws.cloudhsm#InvalidRequestException": return [3, 6];
854
+ }
855
+ return [3, 8];
856
+ case 2: return [4, deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)];
857
+ case 3: throw _d.sent();
858
+ case 4: return [4, deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)];
859
+ case 5: throw _d.sent();
860
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
861
+ case 7: throw _d.sent();
862
+ case 8:
863
+ parsedBody = parsedOutput.body;
864
+ throwDefaultError({
865
+ output: output,
866
+ parsedBody: parsedBody,
867
+ exceptionCtor: __BaseException,
868
+ errorCode: errorCode,
869
+ });
870
+ _d.label = 9;
871
+ case 9: return [2];
872
+ }
873
+ });
874
+ }); };
875
+ export var deserializeAws_json1_1ListAvailableZonesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
876
+ var data, contents, response;
877
+ return __generator(this, function (_a) {
878
+ switch (_a.label) {
879
+ case 0:
880
+ if (output.statusCode >= 300) {
881
+ return [2, deserializeAws_json1_1ListAvailableZonesCommandError(output, context)];
882
+ }
883
+ return [4, parseBody(output.body, context)];
884
+ case 1:
885
+ data = _a.sent();
886
+ contents = {};
887
+ contents = deserializeAws_json1_1ListAvailableZonesResponse(data, context);
888
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
889
+ return [2, Promise.resolve(response)];
890
+ }
891
+ });
892
+ }); };
893
+ var deserializeAws_json1_1ListAvailableZonesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
894
+ var parsedOutput, _a, errorCode, _b, parsedBody;
895
+ var _c;
896
+ return __generator(this, function (_d) {
897
+ switch (_d.label) {
898
+ case 0:
899
+ _a = [__assign({}, output)];
900
+ _c = {};
901
+ return [4, parseErrorBody(output.body, context)];
902
+ case 1:
903
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
904
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
905
+ _b = errorCode;
906
+ switch (_b) {
907
+ case "CloudHsmInternalException": return [3, 2];
908
+ case "com.amazonaws.cloudhsm#CloudHsmInternalException": return [3, 2];
909
+ case "CloudHsmServiceException": return [3, 4];
910
+ case "com.amazonaws.cloudhsm#CloudHsmServiceException": return [3, 4];
911
+ case "InvalidRequestException": return [3, 6];
912
+ case "com.amazonaws.cloudhsm#InvalidRequestException": return [3, 6];
913
+ }
914
+ return [3, 8];
915
+ case 2: return [4, deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)];
916
+ case 3: throw _d.sent();
917
+ case 4: return [4, deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)];
918
+ case 5: throw _d.sent();
919
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
920
+ case 7: throw _d.sent();
921
+ case 8:
922
+ parsedBody = parsedOutput.body;
923
+ throwDefaultError({
924
+ output: output,
925
+ parsedBody: parsedBody,
926
+ exceptionCtor: __BaseException,
927
+ errorCode: errorCode,
928
+ });
929
+ _d.label = 9;
930
+ case 9: return [2];
931
+ }
932
+ });
933
+ }); };
934
+ export var deserializeAws_json1_1ListHapgsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
935
+ var data, contents, response;
936
+ return __generator(this, function (_a) {
937
+ switch (_a.label) {
938
+ case 0:
939
+ if (output.statusCode >= 300) {
940
+ return [2, deserializeAws_json1_1ListHapgsCommandError(output, context)];
941
+ }
942
+ return [4, parseBody(output.body, context)];
943
+ case 1:
944
+ data = _a.sent();
945
+ contents = {};
946
+ contents = deserializeAws_json1_1ListHapgsResponse(data, context);
947
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
948
+ return [2, Promise.resolve(response)];
949
+ }
950
+ });
951
+ }); };
952
+ var deserializeAws_json1_1ListHapgsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
953
+ var parsedOutput, _a, errorCode, _b, parsedBody;
954
+ var _c;
955
+ return __generator(this, function (_d) {
956
+ switch (_d.label) {
957
+ case 0:
958
+ _a = [__assign({}, output)];
959
+ _c = {};
960
+ return [4, parseErrorBody(output.body, context)];
961
+ case 1:
962
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
963
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
964
+ _b = errorCode;
965
+ switch (_b) {
966
+ case "CloudHsmInternalException": return [3, 2];
967
+ case "com.amazonaws.cloudhsm#CloudHsmInternalException": return [3, 2];
968
+ case "CloudHsmServiceException": return [3, 4];
969
+ case "com.amazonaws.cloudhsm#CloudHsmServiceException": return [3, 4];
970
+ case "InvalidRequestException": return [3, 6];
971
+ case "com.amazonaws.cloudhsm#InvalidRequestException": return [3, 6];
972
+ }
973
+ return [3, 8];
974
+ case 2: return [4, deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)];
975
+ case 3: throw _d.sent();
976
+ case 4: return [4, deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)];
977
+ case 5: throw _d.sent();
978
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
979
+ case 7: throw _d.sent();
980
+ case 8:
981
+ parsedBody = parsedOutput.body;
982
+ throwDefaultError({
983
+ output: output,
984
+ parsedBody: parsedBody,
985
+ exceptionCtor: __BaseException,
986
+ errorCode: errorCode,
987
+ });
988
+ _d.label = 9;
989
+ case 9: return [2];
990
+ }
991
+ });
992
+ }); };
993
+ export var deserializeAws_json1_1ListHsmsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
994
+ var data, contents, response;
995
+ return __generator(this, function (_a) {
996
+ switch (_a.label) {
997
+ case 0:
998
+ if (output.statusCode >= 300) {
999
+ return [2, deserializeAws_json1_1ListHsmsCommandError(output, context)];
1000
+ }
1001
+ return [4, parseBody(output.body, context)];
1002
+ case 1:
1003
+ data = _a.sent();
1004
+ contents = {};
1005
+ contents = deserializeAws_json1_1ListHsmsResponse(data, context);
1006
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1007
+ return [2, Promise.resolve(response)];
1008
+ }
1009
+ });
1010
+ }); };
1011
+ var deserializeAws_json1_1ListHsmsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1012
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1013
+ var _c;
1014
+ return __generator(this, function (_d) {
1015
+ switch (_d.label) {
1016
+ case 0:
1017
+ _a = [__assign({}, output)];
1018
+ _c = {};
1019
+ return [4, parseErrorBody(output.body, context)];
1020
+ case 1:
1021
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1022
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1023
+ _b = errorCode;
1024
+ switch (_b) {
1025
+ case "CloudHsmInternalException": return [3, 2];
1026
+ case "com.amazonaws.cloudhsm#CloudHsmInternalException": return [3, 2];
1027
+ case "CloudHsmServiceException": return [3, 4];
1028
+ case "com.amazonaws.cloudhsm#CloudHsmServiceException": return [3, 4];
1029
+ case "InvalidRequestException": return [3, 6];
1030
+ case "com.amazonaws.cloudhsm#InvalidRequestException": return [3, 6];
1031
+ }
1032
+ return [3, 8];
1033
+ case 2: return [4, deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)];
1034
+ case 3: throw _d.sent();
1035
+ case 4: return [4, deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)];
1036
+ case 5: throw _d.sent();
1037
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
1038
+ case 7: throw _d.sent();
1039
+ case 8:
1040
+ parsedBody = parsedOutput.body;
1041
+ throwDefaultError({
1042
+ output: output,
1043
+ parsedBody: parsedBody,
1044
+ exceptionCtor: __BaseException,
1045
+ errorCode: errorCode,
1046
+ });
1047
+ _d.label = 9;
1048
+ case 9: return [2];
1049
+ }
1050
+ });
1051
+ }); };
1052
+ export var deserializeAws_json1_1ListLunaClientsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1053
+ var data, contents, response;
1054
+ return __generator(this, function (_a) {
1055
+ switch (_a.label) {
1056
+ case 0:
1057
+ if (output.statusCode >= 300) {
1058
+ return [2, deserializeAws_json1_1ListLunaClientsCommandError(output, context)];
1059
+ }
1060
+ return [4, parseBody(output.body, context)];
1061
+ case 1:
1062
+ data = _a.sent();
1063
+ contents = {};
1064
+ contents = deserializeAws_json1_1ListLunaClientsResponse(data, context);
1065
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1066
+ return [2, Promise.resolve(response)];
1067
+ }
1068
+ });
1069
+ }); };
1070
+ var deserializeAws_json1_1ListLunaClientsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1071
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1072
+ var _c;
1073
+ return __generator(this, function (_d) {
1074
+ switch (_d.label) {
1075
+ case 0:
1076
+ _a = [__assign({}, output)];
1077
+ _c = {};
1078
+ return [4, parseErrorBody(output.body, context)];
1079
+ case 1:
1080
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1081
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1082
+ _b = errorCode;
1083
+ switch (_b) {
1084
+ case "CloudHsmInternalException": return [3, 2];
1085
+ case "com.amazonaws.cloudhsm#CloudHsmInternalException": return [3, 2];
1086
+ case "CloudHsmServiceException": return [3, 4];
1087
+ case "com.amazonaws.cloudhsm#CloudHsmServiceException": return [3, 4];
1088
+ case "InvalidRequestException": return [3, 6];
1089
+ case "com.amazonaws.cloudhsm#InvalidRequestException": return [3, 6];
1090
+ }
1091
+ return [3, 8];
1092
+ case 2: return [4, deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)];
1093
+ case 3: throw _d.sent();
1094
+ case 4: return [4, deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)];
1095
+ case 5: throw _d.sent();
1096
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
1097
+ case 7: throw _d.sent();
1098
+ case 8:
1099
+ parsedBody = parsedOutput.body;
1100
+ throwDefaultError({
1101
+ output: output,
1102
+ parsedBody: parsedBody,
1103
+ exceptionCtor: __BaseException,
1104
+ errorCode: errorCode,
1105
+ });
1106
+ _d.label = 9;
1107
+ case 9: return [2];
1108
+ }
1109
+ });
1110
+ }); };
1111
+ export var deserializeAws_json1_1ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1112
+ var data, contents, response;
1113
+ return __generator(this, function (_a) {
1114
+ switch (_a.label) {
1115
+ case 0:
1116
+ if (output.statusCode >= 300) {
1117
+ return [2, deserializeAws_json1_1ListTagsForResourceCommandError(output, context)];
1118
+ }
1119
+ return [4, parseBody(output.body, context)];
1120
+ case 1:
1121
+ data = _a.sent();
1122
+ contents = {};
1123
+ contents = deserializeAws_json1_1ListTagsForResourceResponse(data, context);
1124
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1125
+ return [2, Promise.resolve(response)];
1126
+ }
1127
+ });
1128
+ }); };
1129
+ var deserializeAws_json1_1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1130
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1131
+ var _c;
1132
+ return __generator(this, function (_d) {
1133
+ switch (_d.label) {
1134
+ case 0:
1135
+ _a = [__assign({}, output)];
1136
+ _c = {};
1137
+ return [4, parseErrorBody(output.body, context)];
1138
+ case 1:
1139
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1140
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1141
+ _b = errorCode;
1142
+ switch (_b) {
1143
+ case "CloudHsmInternalException": return [3, 2];
1144
+ case "com.amazonaws.cloudhsm#CloudHsmInternalException": return [3, 2];
1145
+ case "CloudHsmServiceException": return [3, 4];
1146
+ case "com.amazonaws.cloudhsm#CloudHsmServiceException": return [3, 4];
1147
+ case "InvalidRequestException": return [3, 6];
1148
+ case "com.amazonaws.cloudhsm#InvalidRequestException": return [3, 6];
1149
+ }
1150
+ return [3, 8];
1151
+ case 2: return [4, deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)];
1152
+ case 3: throw _d.sent();
1153
+ case 4: return [4, deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)];
1154
+ case 5: throw _d.sent();
1155
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
1156
+ case 7: throw _d.sent();
1157
+ case 8:
1158
+ parsedBody = parsedOutput.body;
1159
+ throwDefaultError({
1160
+ output: output,
1161
+ parsedBody: parsedBody,
1162
+ exceptionCtor: __BaseException,
1163
+ errorCode: errorCode,
1164
+ });
1165
+ _d.label = 9;
1166
+ case 9: return [2];
1167
+ }
1168
+ });
1169
+ }); };
1170
+ export var deserializeAws_json1_1ModifyHapgCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1171
+ var data, contents, response;
1172
+ return __generator(this, function (_a) {
1173
+ switch (_a.label) {
1174
+ case 0:
1175
+ if (output.statusCode >= 300) {
1176
+ return [2, deserializeAws_json1_1ModifyHapgCommandError(output, context)];
1177
+ }
1178
+ return [4, parseBody(output.body, context)];
1179
+ case 1:
1180
+ data = _a.sent();
1181
+ contents = {};
1182
+ contents = deserializeAws_json1_1ModifyHapgResponse(data, context);
1183
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1184
+ return [2, Promise.resolve(response)];
1185
+ }
1186
+ });
1187
+ }); };
1188
+ var deserializeAws_json1_1ModifyHapgCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1189
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1190
+ var _c;
1191
+ return __generator(this, function (_d) {
1192
+ switch (_d.label) {
1193
+ case 0:
1194
+ _a = [__assign({}, output)];
1195
+ _c = {};
1196
+ return [4, parseErrorBody(output.body, context)];
1197
+ case 1:
1198
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1199
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1200
+ _b = errorCode;
1201
+ switch (_b) {
1202
+ case "CloudHsmInternalException": return [3, 2];
1203
+ case "com.amazonaws.cloudhsm#CloudHsmInternalException": return [3, 2];
1204
+ case "CloudHsmServiceException": return [3, 4];
1205
+ case "com.amazonaws.cloudhsm#CloudHsmServiceException": return [3, 4];
1206
+ case "InvalidRequestException": return [3, 6];
1207
+ case "com.amazonaws.cloudhsm#InvalidRequestException": return [3, 6];
1208
+ }
1209
+ return [3, 8];
1210
+ case 2: return [4, deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)];
1211
+ case 3: throw _d.sent();
1212
+ case 4: return [4, deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)];
1213
+ case 5: throw _d.sent();
1214
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
1215
+ case 7: throw _d.sent();
1216
+ case 8:
1217
+ parsedBody = parsedOutput.body;
1218
+ throwDefaultError({
1219
+ output: output,
1220
+ parsedBody: parsedBody,
1221
+ exceptionCtor: __BaseException,
1222
+ errorCode: errorCode,
1223
+ });
1224
+ _d.label = 9;
1225
+ case 9: return [2];
1226
+ }
1227
+ });
1228
+ }); };
1229
+ export var deserializeAws_json1_1ModifyHsmCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1230
+ var data, contents, response;
1231
+ return __generator(this, function (_a) {
1232
+ switch (_a.label) {
1233
+ case 0:
1234
+ if (output.statusCode >= 300) {
1235
+ return [2, deserializeAws_json1_1ModifyHsmCommandError(output, context)];
1236
+ }
1237
+ return [4, parseBody(output.body, context)];
1238
+ case 1:
1239
+ data = _a.sent();
1240
+ contents = {};
1241
+ contents = deserializeAws_json1_1ModifyHsmResponse(data, context);
1242
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1243
+ return [2, Promise.resolve(response)];
1244
+ }
1245
+ });
1246
+ }); };
1247
+ var deserializeAws_json1_1ModifyHsmCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1248
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1249
+ var _c;
1250
+ return __generator(this, function (_d) {
1251
+ switch (_d.label) {
1252
+ case 0:
1253
+ _a = [__assign({}, output)];
1254
+ _c = {};
1255
+ return [4, parseErrorBody(output.body, context)];
1256
+ case 1:
1257
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1258
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1259
+ _b = errorCode;
1260
+ switch (_b) {
1261
+ case "CloudHsmInternalException": return [3, 2];
1262
+ case "com.amazonaws.cloudhsm#CloudHsmInternalException": return [3, 2];
1263
+ case "CloudHsmServiceException": return [3, 4];
1264
+ case "com.amazonaws.cloudhsm#CloudHsmServiceException": return [3, 4];
1265
+ case "InvalidRequestException": return [3, 6];
1266
+ case "com.amazonaws.cloudhsm#InvalidRequestException": return [3, 6];
1267
+ }
1268
+ return [3, 8];
1269
+ case 2: return [4, deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)];
1270
+ case 3: throw _d.sent();
1271
+ case 4: return [4, deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)];
1272
+ case 5: throw _d.sent();
1273
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
1274
+ case 7: throw _d.sent();
1275
+ case 8:
1276
+ parsedBody = parsedOutput.body;
1277
+ throwDefaultError({
1278
+ output: output,
1279
+ parsedBody: parsedBody,
1280
+ exceptionCtor: __BaseException,
1281
+ errorCode: errorCode,
1282
+ });
1283
+ _d.label = 9;
1284
+ case 9: return [2];
1285
+ }
1286
+ });
1287
+ }); };
1288
+ export var deserializeAws_json1_1ModifyLunaClientCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1289
+ var data, contents, response;
1290
+ return __generator(this, function (_a) {
1291
+ switch (_a.label) {
1292
+ case 0:
1293
+ if (output.statusCode >= 300) {
1294
+ return [2, deserializeAws_json1_1ModifyLunaClientCommandError(output, context)];
1295
+ }
1296
+ return [4, parseBody(output.body, context)];
1297
+ case 1:
1298
+ data = _a.sent();
1299
+ contents = {};
1300
+ contents = deserializeAws_json1_1ModifyLunaClientResponse(data, context);
1301
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1302
+ return [2, Promise.resolve(response)];
1303
+ }
1304
+ });
1305
+ }); };
1306
+ var deserializeAws_json1_1ModifyLunaClientCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1307
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1308
+ var _c;
1309
+ return __generator(this, function (_d) {
1310
+ switch (_d.label) {
1311
+ case 0:
1312
+ _a = [__assign({}, output)];
1313
+ _c = {};
1314
+ return [4, parseErrorBody(output.body, context)];
1315
+ case 1:
1316
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1317
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1318
+ _b = errorCode;
1319
+ switch (_b) {
1320
+ case "CloudHsmServiceException": return [3, 2];
1321
+ case "com.amazonaws.cloudhsm#CloudHsmServiceException": return [3, 2];
1322
+ }
1323
+ return [3, 4];
1324
+ case 2: return [4, deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)];
1325
+ case 3: throw _d.sent();
1326
+ case 4:
1327
+ parsedBody = parsedOutput.body;
1328
+ throwDefaultError({
1329
+ output: output,
1330
+ parsedBody: parsedBody,
1331
+ exceptionCtor: __BaseException,
1332
+ errorCode: errorCode,
1333
+ });
1334
+ _d.label = 5;
1335
+ case 5: return [2];
1336
+ }
1337
+ });
1338
+ }); };
1339
+ export var deserializeAws_json1_1RemoveTagsFromResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1340
+ var data, contents, response;
1341
+ return __generator(this, function (_a) {
1342
+ switch (_a.label) {
1343
+ case 0:
1344
+ if (output.statusCode >= 300) {
1345
+ return [2, deserializeAws_json1_1RemoveTagsFromResourceCommandError(output, context)];
1346
+ }
1347
+ return [4, parseBody(output.body, context)];
1348
+ case 1:
1349
+ data = _a.sent();
1350
+ contents = {};
1351
+ contents = deserializeAws_json1_1RemoveTagsFromResourceResponse(data, context);
1352
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1353
+ return [2, Promise.resolve(response)];
1354
+ }
1355
+ });
1356
+ }); };
1357
+ var deserializeAws_json1_1RemoveTagsFromResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1358
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1359
+ var _c;
1360
+ return __generator(this, function (_d) {
1361
+ switch (_d.label) {
1362
+ case 0:
1363
+ _a = [__assign({}, output)];
1364
+ _c = {};
1365
+ return [4, parseErrorBody(output.body, context)];
1366
+ case 1:
1367
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1368
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1369
+ _b = errorCode;
1370
+ switch (_b) {
1371
+ case "CloudHsmInternalException": return [3, 2];
1372
+ case "com.amazonaws.cloudhsm#CloudHsmInternalException": return [3, 2];
1373
+ case "CloudHsmServiceException": return [3, 4];
1374
+ case "com.amazonaws.cloudhsm#CloudHsmServiceException": return [3, 4];
1375
+ case "InvalidRequestException": return [3, 6];
1376
+ case "com.amazonaws.cloudhsm#InvalidRequestException": return [3, 6];
1377
+ }
1378
+ return [3, 8];
1379
+ case 2: return [4, deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)];
1380
+ case 3: throw _d.sent();
1381
+ case 4: return [4, deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)];
1382
+ case 5: throw _d.sent();
1383
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
1384
+ case 7: throw _d.sent();
1385
+ case 8:
1386
+ parsedBody = parsedOutput.body;
1387
+ throwDefaultError({
1388
+ output: output,
1389
+ parsedBody: parsedBody,
1390
+ exceptionCtor: __BaseException,
1391
+ errorCode: errorCode,
1392
+ });
1393
+ _d.label = 9;
1394
+ case 9: return [2];
1395
+ }
1396
+ });
1397
+ }); };
1398
+ var deserializeAws_json1_1CloudHsmInternalExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1399
+ var body, deserialized, exception;
1400
+ return __generator(this, function (_a) {
1401
+ body = parsedOutput.body;
1402
+ deserialized = deserializeAws_json1_1CloudHsmInternalException(body, context);
1403
+ exception = new CloudHsmInternalException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1404
+ return [2, __decorateServiceException(exception, body)];
1405
+ });
1406
+ }); };
1407
+ var deserializeAws_json1_1CloudHsmServiceExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1408
+ var body, deserialized, exception;
1409
+ return __generator(this, function (_a) {
1410
+ body = parsedOutput.body;
1411
+ deserialized = deserializeAws_json1_1CloudHsmServiceException(body, context);
1412
+ exception = new CloudHsmServiceException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1413
+ return [2, __decorateServiceException(exception, body)];
1414
+ });
1415
+ }); };
1416
+ var deserializeAws_json1_1InvalidRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1417
+ var body, deserialized, exception;
1418
+ return __generator(this, function (_a) {
1419
+ body = parsedOutput.body;
1420
+ deserialized = deserializeAws_json1_1InvalidRequestException(body, context);
1421
+ exception = new InvalidRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1422
+ return [2, __decorateServiceException(exception, body)];
1423
+ });
1424
+ }); };
1425
+ var serializeAws_json1_1AddTagsToResourceRequest = function (input, context) {
1426
+ return __assign(__assign({}, (input.ResourceArn != null && { ResourceArn: input.ResourceArn })), (input.TagList != null && { TagList: serializeAws_json1_1TagList(input.TagList, context) }));
991
1427
  };
992
- const serializeAws_json1_1CreateHapgRequest = (input, context) => {
993
- return {
994
- ...(input.Label != null && { Label: input.Label }),
995
- };
1428
+ var serializeAws_json1_1CreateHapgRequest = function (input, context) {
1429
+ return __assign({}, (input.Label != null && { Label: input.Label }));
996
1430
  };
997
- const serializeAws_json1_1CreateHsmRequest = (input, context) => {
998
- return {
999
- ...(input.ClientToken != null && { ClientToken: input.ClientToken }),
1000
- ...(input.EniIp != null && { EniIp: input.EniIp }),
1001
- ...(input.ExternalId != null && { ExternalId: input.ExternalId }),
1002
- ...(input.IamRoleArn != null && { IamRoleArn: input.IamRoleArn }),
1003
- ...(input.SshKey != null && { SshKey: input.SshKey }),
1004
- ...(input.SubnetId != null && { SubnetId: input.SubnetId }),
1005
- ...(input.SubscriptionType != null && { SubscriptionType: input.SubscriptionType }),
1006
- ...(input.SyslogIp != null && { SyslogIp: input.SyslogIp }),
1007
- };
1431
+ var serializeAws_json1_1CreateHsmRequest = function (input, context) {
1432
+ return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.ClientToken != null && { ClientToken: input.ClientToken })), (input.EniIp != null && { EniIp: input.EniIp })), (input.ExternalId != null && { ExternalId: input.ExternalId })), (input.IamRoleArn != null && { IamRoleArn: input.IamRoleArn })), (input.SshKey != null && { SshKey: input.SshKey })), (input.SubnetId != null && { SubnetId: input.SubnetId })), (input.SubscriptionType != null && { SubscriptionType: input.SubscriptionType })), (input.SyslogIp != null && { SyslogIp: input.SyslogIp }));
1008
1433
  };
1009
- const serializeAws_json1_1CreateLunaClientRequest = (input, context) => {
1010
- return {
1011
- ...(input.Certificate != null && { Certificate: input.Certificate }),
1012
- ...(input.Label != null && { Label: input.Label }),
1013
- };
1434
+ var serializeAws_json1_1CreateLunaClientRequest = function (input, context) {
1435
+ return __assign(__assign({}, (input.Certificate != null && { Certificate: input.Certificate })), (input.Label != null && { Label: input.Label }));
1014
1436
  };
1015
- const serializeAws_json1_1DeleteHapgRequest = (input, context) => {
1016
- return {
1017
- ...(input.HapgArn != null && { HapgArn: input.HapgArn }),
1018
- };
1437
+ var serializeAws_json1_1DeleteHapgRequest = function (input, context) {
1438
+ return __assign({}, (input.HapgArn != null && { HapgArn: input.HapgArn }));
1019
1439
  };
1020
- const serializeAws_json1_1DeleteHsmRequest = (input, context) => {
1021
- return {
1022
- ...(input.HsmArn != null && { HsmArn: input.HsmArn }),
1023
- };
1440
+ var serializeAws_json1_1DeleteHsmRequest = function (input, context) {
1441
+ return __assign({}, (input.HsmArn != null && { HsmArn: input.HsmArn }));
1024
1442
  };
1025
- const serializeAws_json1_1DeleteLunaClientRequest = (input, context) => {
1026
- return {
1027
- ...(input.ClientArn != null && { ClientArn: input.ClientArn }),
1028
- };
1443
+ var serializeAws_json1_1DeleteLunaClientRequest = function (input, context) {
1444
+ return __assign({}, (input.ClientArn != null && { ClientArn: input.ClientArn }));
1029
1445
  };
1030
- const serializeAws_json1_1DescribeHapgRequest = (input, context) => {
1031
- return {
1032
- ...(input.HapgArn != null && { HapgArn: input.HapgArn }),
1033
- };
1446
+ var serializeAws_json1_1DescribeHapgRequest = function (input, context) {
1447
+ return __assign({}, (input.HapgArn != null && { HapgArn: input.HapgArn }));
1034
1448
  };
1035
- const serializeAws_json1_1DescribeHsmRequest = (input, context) => {
1036
- return {
1037
- ...(input.HsmArn != null && { HsmArn: input.HsmArn }),
1038
- ...(input.HsmSerialNumber != null && { HsmSerialNumber: input.HsmSerialNumber }),
1039
- };
1449
+ var serializeAws_json1_1DescribeHsmRequest = function (input, context) {
1450
+ return __assign(__assign({}, (input.HsmArn != null && { HsmArn: input.HsmArn })), (input.HsmSerialNumber != null && { HsmSerialNumber: input.HsmSerialNumber }));
1040
1451
  };
1041
- const serializeAws_json1_1DescribeLunaClientRequest = (input, context) => {
1042
- return {
1043
- ...(input.CertificateFingerprint != null && { CertificateFingerprint: input.CertificateFingerprint }),
1044
- ...(input.ClientArn != null && { ClientArn: input.ClientArn }),
1045
- };
1452
+ var serializeAws_json1_1DescribeLunaClientRequest = function (input, context) {
1453
+ return __assign(__assign({}, (input.CertificateFingerprint != null && { CertificateFingerprint: input.CertificateFingerprint })), (input.ClientArn != null && { ClientArn: input.ClientArn }));
1046
1454
  };
1047
- const serializeAws_json1_1GetConfigRequest = (input, context) => {
1048
- return {
1049
- ...(input.ClientArn != null && { ClientArn: input.ClientArn }),
1050
- ...(input.ClientVersion != null && { ClientVersion: input.ClientVersion }),
1051
- ...(input.HapgList != null && { HapgList: serializeAws_json1_1HapgList(input.HapgList, context) }),
1052
- };
1455
+ var serializeAws_json1_1GetConfigRequest = function (input, context) {
1456
+ return __assign(__assign(__assign({}, (input.ClientArn != null && { ClientArn: input.ClientArn })), (input.ClientVersion != null && { ClientVersion: input.ClientVersion })), (input.HapgList != null && { HapgList: serializeAws_json1_1HapgList(input.HapgList, context) }));
1053
1457
  };
1054
- const serializeAws_json1_1HapgList = (input, context) => {
1458
+ var serializeAws_json1_1HapgList = function (input, context) {
1055
1459
  return input
1056
- .filter((e) => e != null)
1057
- .map((entry) => {
1460
+ .filter(function (e) { return e != null; })
1461
+ .map(function (entry) {
1058
1462
  return entry;
1059
1463
  });
1060
1464
  };
1061
- const serializeAws_json1_1ListAvailableZonesRequest = (input, context) => {
1465
+ var serializeAws_json1_1ListAvailableZonesRequest = function (input, context) {
1062
1466
  return {};
1063
1467
  };
1064
- const serializeAws_json1_1ListHapgsRequest = (input, context) => {
1065
- return {
1066
- ...(input.NextToken != null && { NextToken: input.NextToken }),
1067
- };
1468
+ var serializeAws_json1_1ListHapgsRequest = function (input, context) {
1469
+ return __assign({}, (input.NextToken != null && { NextToken: input.NextToken }));
1068
1470
  };
1069
- const serializeAws_json1_1ListHsmsRequest = (input, context) => {
1070
- return {
1071
- ...(input.NextToken != null && { NextToken: input.NextToken }),
1072
- };
1471
+ var serializeAws_json1_1ListHsmsRequest = function (input, context) {
1472
+ return __assign({}, (input.NextToken != null && { NextToken: input.NextToken }));
1073
1473
  };
1074
- const serializeAws_json1_1ListLunaClientsRequest = (input, context) => {
1075
- return {
1076
- ...(input.NextToken != null && { NextToken: input.NextToken }),
1077
- };
1474
+ var serializeAws_json1_1ListLunaClientsRequest = function (input, context) {
1475
+ return __assign({}, (input.NextToken != null && { NextToken: input.NextToken }));
1078
1476
  };
1079
- const serializeAws_json1_1ListTagsForResourceRequest = (input, context) => {
1080
- return {
1081
- ...(input.ResourceArn != null && { ResourceArn: input.ResourceArn }),
1082
- };
1477
+ var serializeAws_json1_1ListTagsForResourceRequest = function (input, context) {
1478
+ return __assign({}, (input.ResourceArn != null && { ResourceArn: input.ResourceArn }));
1083
1479
  };
1084
- const serializeAws_json1_1ModifyHapgRequest = (input, context) => {
1085
- return {
1086
- ...(input.HapgArn != null && { HapgArn: input.HapgArn }),
1087
- ...(input.Label != null && { Label: input.Label }),
1088
- ...(input.PartitionSerialList != null && {
1089
- PartitionSerialList: serializeAws_json1_1PartitionSerialList(input.PartitionSerialList, context),
1090
- }),
1091
- };
1480
+ var serializeAws_json1_1ModifyHapgRequest = function (input, context) {
1481
+ return __assign(__assign(__assign({}, (input.HapgArn != null && { HapgArn: input.HapgArn })), (input.Label != null && { Label: input.Label })), (input.PartitionSerialList != null && {
1482
+ PartitionSerialList: serializeAws_json1_1PartitionSerialList(input.PartitionSerialList, context),
1483
+ }));
1092
1484
  };
1093
- const serializeAws_json1_1ModifyHsmRequest = (input, context) => {
1094
- return {
1095
- ...(input.EniIp != null && { EniIp: input.EniIp }),
1096
- ...(input.ExternalId != null && { ExternalId: input.ExternalId }),
1097
- ...(input.HsmArn != null && { HsmArn: input.HsmArn }),
1098
- ...(input.IamRoleArn != null && { IamRoleArn: input.IamRoleArn }),
1099
- ...(input.SubnetId != null && { SubnetId: input.SubnetId }),
1100
- ...(input.SyslogIp != null && { SyslogIp: input.SyslogIp }),
1101
- };
1485
+ var serializeAws_json1_1ModifyHsmRequest = function (input, context) {
1486
+ return __assign(__assign(__assign(__assign(__assign(__assign({}, (input.EniIp != null && { EniIp: input.EniIp })), (input.ExternalId != null && { ExternalId: input.ExternalId })), (input.HsmArn != null && { HsmArn: input.HsmArn })), (input.IamRoleArn != null && { IamRoleArn: input.IamRoleArn })), (input.SubnetId != null && { SubnetId: input.SubnetId })), (input.SyslogIp != null && { SyslogIp: input.SyslogIp }));
1102
1487
  };
1103
- const serializeAws_json1_1ModifyLunaClientRequest = (input, context) => {
1104
- return {
1105
- ...(input.Certificate != null && { Certificate: input.Certificate }),
1106
- ...(input.ClientArn != null && { ClientArn: input.ClientArn }),
1107
- };
1488
+ var serializeAws_json1_1ModifyLunaClientRequest = function (input, context) {
1489
+ return __assign(__assign({}, (input.Certificate != null && { Certificate: input.Certificate })), (input.ClientArn != null && { ClientArn: input.ClientArn }));
1108
1490
  };
1109
- const serializeAws_json1_1PartitionSerialList = (input, context) => {
1491
+ var serializeAws_json1_1PartitionSerialList = function (input, context) {
1110
1492
  return input
1111
- .filter((e) => e != null)
1112
- .map((entry) => {
1493
+ .filter(function (e) { return e != null; })
1494
+ .map(function (entry) {
1113
1495
  return entry;
1114
1496
  });
1115
1497
  };
1116
- const serializeAws_json1_1RemoveTagsFromResourceRequest = (input, context) => {
1117
- return {
1118
- ...(input.ResourceArn != null && { ResourceArn: input.ResourceArn }),
1119
- ...(input.TagKeyList != null && { TagKeyList: serializeAws_json1_1TagKeyList(input.TagKeyList, context) }),
1120
- };
1498
+ var serializeAws_json1_1RemoveTagsFromResourceRequest = function (input, context) {
1499
+ return __assign(__assign({}, (input.ResourceArn != null && { ResourceArn: input.ResourceArn })), (input.TagKeyList != null && { TagKeyList: serializeAws_json1_1TagKeyList(input.TagKeyList, context) }));
1121
1500
  };
1122
- const serializeAws_json1_1Tag = (input, context) => {
1123
- return {
1124
- ...(input.Key != null && { Key: input.Key }),
1125
- ...(input.Value != null && { Value: input.Value }),
1126
- };
1501
+ var serializeAws_json1_1Tag = function (input, context) {
1502
+ return __assign(__assign({}, (input.Key != null && { Key: input.Key })), (input.Value != null && { Value: input.Value }));
1127
1503
  };
1128
- const serializeAws_json1_1TagKeyList = (input, context) => {
1504
+ var serializeAws_json1_1TagKeyList = function (input, context) {
1129
1505
  return input
1130
- .filter((e) => e != null)
1131
- .map((entry) => {
1506
+ .filter(function (e) { return e != null; })
1507
+ .map(function (entry) {
1132
1508
  return entry;
1133
1509
  });
1134
1510
  };
1135
- const serializeAws_json1_1TagList = (input, context) => {
1511
+ var serializeAws_json1_1TagList = function (input, context) {
1136
1512
  return input
1137
- .filter((e) => e != null)
1138
- .map((entry) => {
1513
+ .filter(function (e) { return e != null; })
1514
+ .map(function (entry) {
1139
1515
  return serializeAws_json1_1Tag(entry, context);
1140
1516
  });
1141
1517
  };
1142
- const deserializeAws_json1_1AddTagsToResourceResponse = (output, context) => {
1518
+ var deserializeAws_json1_1AddTagsToResourceResponse = function (output, context) {
1143
1519
  return {
1144
1520
  Status: __expectString(output.Status),
1145
1521
  };
1146
1522
  };
1147
- const deserializeAws_json1_1AZList = (output, context) => {
1148
- const retVal = (output || [])
1149
- .filter((e) => e != null)
1150
- .map((entry) => {
1523
+ var deserializeAws_json1_1AZList = function (output, context) {
1524
+ var retVal = (output || [])
1525
+ .filter(function (e) { return e != null; })
1526
+ .map(function (entry) {
1151
1527
  if (entry === null) {
1152
1528
  return null;
1153
1529
  }
@@ -1155,10 +1531,10 @@ const deserializeAws_json1_1AZList = (output, context) => {
1155
1531
  });
1156
1532
  return retVal;
1157
1533
  };
1158
- const deserializeAws_json1_1ClientList = (output, context) => {
1159
- const retVal = (output || [])
1160
- .filter((e) => e != null)
1161
- .map((entry) => {
1534
+ var deserializeAws_json1_1ClientList = function (output, context) {
1535
+ var retVal = (output || [])
1536
+ .filter(function (e) { return e != null; })
1537
+ .map(function (entry) {
1162
1538
  if (entry === null) {
1163
1539
  return null;
1164
1540
  }
@@ -1166,49 +1542,49 @@ const deserializeAws_json1_1ClientList = (output, context) => {
1166
1542
  });
1167
1543
  return retVal;
1168
1544
  };
1169
- const deserializeAws_json1_1CloudHsmInternalException = (output, context) => {
1545
+ var deserializeAws_json1_1CloudHsmInternalException = function (output, context) {
1170
1546
  return {
1171
1547
  message: __expectString(output.message),
1172
1548
  retryable: __expectBoolean(output.retryable),
1173
1549
  };
1174
1550
  };
1175
- const deserializeAws_json1_1CloudHsmServiceException = (output, context) => {
1551
+ var deserializeAws_json1_1CloudHsmServiceException = function (output, context) {
1176
1552
  return {
1177
1553
  message: __expectString(output.message),
1178
1554
  retryable: __expectBoolean(output.retryable),
1179
1555
  };
1180
1556
  };
1181
- const deserializeAws_json1_1CreateHapgResponse = (output, context) => {
1557
+ var deserializeAws_json1_1CreateHapgResponse = function (output, context) {
1182
1558
  return {
1183
1559
  HapgArn: __expectString(output.HapgArn),
1184
1560
  };
1185
1561
  };
1186
- const deserializeAws_json1_1CreateHsmResponse = (output, context) => {
1562
+ var deserializeAws_json1_1CreateHsmResponse = function (output, context) {
1187
1563
  return {
1188
1564
  HsmArn: __expectString(output.HsmArn),
1189
1565
  };
1190
1566
  };
1191
- const deserializeAws_json1_1CreateLunaClientResponse = (output, context) => {
1567
+ var deserializeAws_json1_1CreateLunaClientResponse = function (output, context) {
1192
1568
  return {
1193
1569
  ClientArn: __expectString(output.ClientArn),
1194
1570
  };
1195
1571
  };
1196
- const deserializeAws_json1_1DeleteHapgResponse = (output, context) => {
1572
+ var deserializeAws_json1_1DeleteHapgResponse = function (output, context) {
1197
1573
  return {
1198
1574
  Status: __expectString(output.Status),
1199
1575
  };
1200
1576
  };
1201
- const deserializeAws_json1_1DeleteHsmResponse = (output, context) => {
1577
+ var deserializeAws_json1_1DeleteHsmResponse = function (output, context) {
1202
1578
  return {
1203
1579
  Status: __expectString(output.Status),
1204
1580
  };
1205
1581
  };
1206
- const deserializeAws_json1_1DeleteLunaClientResponse = (output, context) => {
1582
+ var deserializeAws_json1_1DeleteLunaClientResponse = function (output, context) {
1207
1583
  return {
1208
1584
  Status: __expectString(output.Status),
1209
1585
  };
1210
1586
  };
1211
- const deserializeAws_json1_1DescribeHapgResponse = (output, context) => {
1587
+ var deserializeAws_json1_1DescribeHapgResponse = function (output, context) {
1212
1588
  return {
1213
1589
  HapgArn: __expectString(output.HapgArn),
1214
1590
  HapgSerial: __expectString(output.HapgSerial),
@@ -1229,7 +1605,7 @@ const deserializeAws_json1_1DescribeHapgResponse = (output, context) => {
1229
1605
  State: __expectString(output.State),
1230
1606
  };
1231
1607
  };
1232
- const deserializeAws_json1_1DescribeHsmResponse = (output, context) => {
1608
+ var deserializeAws_json1_1DescribeHsmResponse = function (output, context) {
1233
1609
  return {
1234
1610
  AvailabilityZone: __expectString(output.AvailabilityZone),
1235
1611
  EniId: __expectString(output.EniId),
@@ -1254,7 +1630,7 @@ const deserializeAws_json1_1DescribeHsmResponse = (output, context) => {
1254
1630
  VpcId: __expectString(output.VpcId),
1255
1631
  };
1256
1632
  };
1257
- const deserializeAws_json1_1DescribeLunaClientResponse = (output, context) => {
1633
+ var deserializeAws_json1_1DescribeLunaClientResponse = function (output, context) {
1258
1634
  return {
1259
1635
  Certificate: __expectString(output.Certificate),
1260
1636
  CertificateFingerprint: __expectString(output.CertificateFingerprint),
@@ -1263,17 +1639,17 @@ const deserializeAws_json1_1DescribeLunaClientResponse = (output, context) => {
1263
1639
  LastModifiedTimestamp: __expectString(output.LastModifiedTimestamp),
1264
1640
  };
1265
1641
  };
1266
- const deserializeAws_json1_1GetConfigResponse = (output, context) => {
1642
+ var deserializeAws_json1_1GetConfigResponse = function (output, context) {
1267
1643
  return {
1268
1644
  ConfigCred: __expectString(output.ConfigCred),
1269
1645
  ConfigFile: __expectString(output.ConfigFile),
1270
1646
  ConfigType: __expectString(output.ConfigType),
1271
1647
  };
1272
1648
  };
1273
- const deserializeAws_json1_1HapgList = (output, context) => {
1274
- const retVal = (output || [])
1275
- .filter((e) => e != null)
1276
- .map((entry) => {
1649
+ var deserializeAws_json1_1HapgList = function (output, context) {
1650
+ var retVal = (output || [])
1651
+ .filter(function (e) { return e != null; })
1652
+ .map(function (entry) {
1277
1653
  if (entry === null) {
1278
1654
  return null;
1279
1655
  }
@@ -1281,10 +1657,10 @@ const deserializeAws_json1_1HapgList = (output, context) => {
1281
1657
  });
1282
1658
  return retVal;
1283
1659
  };
1284
- const deserializeAws_json1_1HsmList = (output, context) => {
1285
- const retVal = (output || [])
1286
- .filter((e) => e != null)
1287
- .map((entry) => {
1660
+ var deserializeAws_json1_1HsmList = function (output, context) {
1661
+ var retVal = (output || [])
1662
+ .filter(function (e) { return e != null; })
1663
+ .map(function (entry) {
1288
1664
  if (entry === null) {
1289
1665
  return null;
1290
1666
  }
@@ -1292,59 +1668,59 @@ const deserializeAws_json1_1HsmList = (output, context) => {
1292
1668
  });
1293
1669
  return retVal;
1294
1670
  };
1295
- const deserializeAws_json1_1InvalidRequestException = (output, context) => {
1671
+ var deserializeAws_json1_1InvalidRequestException = function (output, context) {
1296
1672
  return {
1297
1673
  message: __expectString(output.message),
1298
1674
  retryable: __expectBoolean(output.retryable),
1299
1675
  };
1300
1676
  };
1301
- const deserializeAws_json1_1ListAvailableZonesResponse = (output, context) => {
1677
+ var deserializeAws_json1_1ListAvailableZonesResponse = function (output, context) {
1302
1678
  return {
1303
1679
  AZList: output.AZList != null ? deserializeAws_json1_1AZList(output.AZList, context) : undefined,
1304
1680
  };
1305
1681
  };
1306
- const deserializeAws_json1_1ListHapgsResponse = (output, context) => {
1682
+ var deserializeAws_json1_1ListHapgsResponse = function (output, context) {
1307
1683
  return {
1308
1684
  HapgList: output.HapgList != null ? deserializeAws_json1_1HapgList(output.HapgList, context) : undefined,
1309
1685
  NextToken: __expectString(output.NextToken),
1310
1686
  };
1311
1687
  };
1312
- const deserializeAws_json1_1ListHsmsResponse = (output, context) => {
1688
+ var deserializeAws_json1_1ListHsmsResponse = function (output, context) {
1313
1689
  return {
1314
1690
  HsmList: output.HsmList != null ? deserializeAws_json1_1HsmList(output.HsmList, context) : undefined,
1315
1691
  NextToken: __expectString(output.NextToken),
1316
1692
  };
1317
1693
  };
1318
- const deserializeAws_json1_1ListLunaClientsResponse = (output, context) => {
1694
+ var deserializeAws_json1_1ListLunaClientsResponse = function (output, context) {
1319
1695
  return {
1320
1696
  ClientList: output.ClientList != null ? deserializeAws_json1_1ClientList(output.ClientList, context) : undefined,
1321
1697
  NextToken: __expectString(output.NextToken),
1322
1698
  };
1323
1699
  };
1324
- const deserializeAws_json1_1ListTagsForResourceResponse = (output, context) => {
1700
+ var deserializeAws_json1_1ListTagsForResourceResponse = function (output, context) {
1325
1701
  return {
1326
1702
  TagList: output.TagList != null ? deserializeAws_json1_1TagList(output.TagList, context) : undefined,
1327
1703
  };
1328
1704
  };
1329
- const deserializeAws_json1_1ModifyHapgResponse = (output, context) => {
1705
+ var deserializeAws_json1_1ModifyHapgResponse = function (output, context) {
1330
1706
  return {
1331
1707
  HapgArn: __expectString(output.HapgArn),
1332
1708
  };
1333
1709
  };
1334
- const deserializeAws_json1_1ModifyHsmResponse = (output, context) => {
1710
+ var deserializeAws_json1_1ModifyHsmResponse = function (output, context) {
1335
1711
  return {
1336
1712
  HsmArn: __expectString(output.HsmArn),
1337
1713
  };
1338
1714
  };
1339
- const deserializeAws_json1_1ModifyLunaClientResponse = (output, context) => {
1715
+ var deserializeAws_json1_1ModifyLunaClientResponse = function (output, context) {
1340
1716
  return {
1341
1717
  ClientArn: __expectString(output.ClientArn),
1342
1718
  };
1343
1719
  };
1344
- const deserializeAws_json1_1PartitionList = (output, context) => {
1345
- const retVal = (output || [])
1346
- .filter((e) => e != null)
1347
- .map((entry) => {
1720
+ var deserializeAws_json1_1PartitionList = function (output, context) {
1721
+ var retVal = (output || [])
1722
+ .filter(function (e) { return e != null; })
1723
+ .map(function (entry) {
1348
1724
  if (entry === null) {
1349
1725
  return null;
1350
1726
  }
@@ -1352,10 +1728,10 @@ const deserializeAws_json1_1PartitionList = (output, context) => {
1352
1728
  });
1353
1729
  return retVal;
1354
1730
  };
1355
- const deserializeAws_json1_1PartitionSerialList = (output, context) => {
1356
- const retVal = (output || [])
1357
- .filter((e) => e != null)
1358
- .map((entry) => {
1731
+ var deserializeAws_json1_1PartitionSerialList = function (output, context) {
1732
+ var retVal = (output || [])
1733
+ .filter(function (e) { return e != null; })
1734
+ .map(function (entry) {
1359
1735
  if (entry === null) {
1360
1736
  return null;
1361
1737
  }
@@ -1363,21 +1739,21 @@ const deserializeAws_json1_1PartitionSerialList = (output, context) => {
1363
1739
  });
1364
1740
  return retVal;
1365
1741
  };
1366
- const deserializeAws_json1_1RemoveTagsFromResourceResponse = (output, context) => {
1742
+ var deserializeAws_json1_1RemoveTagsFromResourceResponse = function (output, context) {
1367
1743
  return {
1368
1744
  Status: __expectString(output.Status),
1369
1745
  };
1370
1746
  };
1371
- const deserializeAws_json1_1Tag = (output, context) => {
1747
+ var deserializeAws_json1_1Tag = function (output, context) {
1372
1748
  return {
1373
1749
  Key: __expectString(output.Key),
1374
1750
  Value: __expectString(output.Value),
1375
1751
  };
1376
1752
  };
1377
- const deserializeAws_json1_1TagList = (output, context) => {
1378
- const retVal = (output || [])
1379
- .filter((e) => e != null)
1380
- .map((entry) => {
1753
+ var deserializeAws_json1_1TagList = function (output, context) {
1754
+ var retVal = (output || [])
1755
+ .filter(function (e) { return e != null; })
1756
+ .map(function (entry) {
1381
1757
  if (entry === null) {
1382
1758
  return null;
1383
1759
  }
@@ -1385,52 +1761,75 @@ const deserializeAws_json1_1TagList = (output, context) => {
1385
1761
  });
1386
1762
  return retVal;
1387
1763
  };
1388
- const deserializeMetadata = (output) => ({
1389
- httpStatusCode: output.statusCode,
1390
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
1391
- extendedRequestId: output.headers["x-amz-id-2"],
1392
- cfId: output.headers["x-amz-cf-id"],
1393
- });
1394
- const collectBody = (streamBody = new Uint8Array(), context) => {
1764
+ var deserializeMetadata = function (output) {
1765
+ var _a, _b;
1766
+ return ({
1767
+ httpStatusCode: output.statusCode,
1768
+ requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"],
1769
+ extendedRequestId: output.headers["x-amz-id-2"],
1770
+ cfId: output.headers["x-amz-cf-id"],
1771
+ });
1772
+ };
1773
+ var collectBody = function (streamBody, context) {
1774
+ if (streamBody === void 0) { streamBody = new Uint8Array(); }
1395
1775
  if (streamBody instanceof Uint8Array) {
1396
1776
  return Promise.resolve(streamBody);
1397
1777
  }
1398
1778
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1399
1779
  };
1400
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1401
- const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
1402
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1403
- const contents = {
1404
- protocol,
1405
- hostname,
1406
- port,
1407
- method: "POST",
1408
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1409
- headers,
1410
- };
1411
- if (resolvedHostname !== undefined) {
1412
- contents.hostname = resolvedHostname;
1413
- }
1414
- if (body !== undefined) {
1415
- contents.body = body;
1416
- }
1417
- return new __HttpRequest(contents);
1418
- };
1419
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1420
- if (encoded.length) {
1421
- return JSON.parse(encoded);
1422
- }
1423
- return {};
1424
- });
1425
- const parseErrorBody = async (errorBody, context) => {
1426
- const value = await parseBody(errorBody, context);
1427
- value.message = value.message ?? value.Message;
1428
- return value;
1780
+ var collectBodyString = function (streamBody, context) {
1781
+ return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
1782
+ };
1783
+ var buildHttpRpcRequest = function (context, headers, path, resolvedHostname, body) { return __awaiter(void 0, void 0, void 0, function () {
1784
+ var _a, hostname, _b, protocol, port, basePath, contents;
1785
+ return __generator(this, function (_c) {
1786
+ switch (_c.label) {
1787
+ case 0: return [4, context.endpoint()];
1788
+ case 1:
1789
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
1790
+ contents = {
1791
+ protocol: protocol,
1792
+ hostname: hostname,
1793
+ port: port,
1794
+ method: "POST",
1795
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1796
+ headers: headers,
1797
+ };
1798
+ if (resolvedHostname !== undefined) {
1799
+ contents.hostname = resolvedHostname;
1800
+ }
1801
+ if (body !== undefined) {
1802
+ contents.body = body;
1803
+ }
1804
+ return [2, new __HttpRequest(contents)];
1805
+ }
1806
+ });
1807
+ }); };
1808
+ var parseBody = function (streamBody, context) {
1809
+ return collectBodyString(streamBody, context).then(function (encoded) {
1810
+ if (encoded.length) {
1811
+ return JSON.parse(encoded);
1812
+ }
1813
+ return {};
1814
+ });
1429
1815
  };
1430
- const loadRestJsonErrorCode = (output, data) => {
1431
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1432
- const sanitizeErrorCode = (rawValue) => {
1433
- let cleanValue = rawValue;
1816
+ var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
1817
+ var value;
1818
+ var _a;
1819
+ return __generator(this, function (_b) {
1820
+ switch (_b.label) {
1821
+ case 0: return [4, parseBody(errorBody, context)];
1822
+ case 1:
1823
+ value = _b.sent();
1824
+ value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
1825
+ return [2, value];
1826
+ }
1827
+ });
1828
+ }); };
1829
+ var loadRestJsonErrorCode = function (output, data) {
1830
+ var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
1831
+ var sanitizeErrorCode = function (rawValue) {
1832
+ var cleanValue = rawValue;
1434
1833
  if (typeof cleanValue === "number") {
1435
1834
  cleanValue = cleanValue.toString();
1436
1835
  }
@@ -1445,7 +1844,7 @@ const loadRestJsonErrorCode = (output, data) => {
1445
1844
  }
1446
1845
  return cleanValue;
1447
1846
  };
1448
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1847
+ var headerKey = findKey(output.headers, "x-amzn-errortype");
1449
1848
  if (headerKey !== undefined) {
1450
1849
  return sanitizeErrorCode(output.headers[headerKey]);
1451
1850
  }