@aws-sdk/client-cloudhsm 3.32.0 → 3.36.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 (244) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/{dist/cjs → dist-cjs}/CloudHSM.js +0 -1
  3. package/{dist/cjs → dist-cjs}/CloudHSMClient.js +8 -9
  4. package/{dist/cjs → dist-cjs}/commands/AddTagsToResourceCommand.js +2 -3
  5. package/{dist/cjs → dist-cjs}/commands/CreateHapgCommand.js +2 -3
  6. package/{dist/cjs → dist-cjs}/commands/CreateHsmCommand.js +2 -3
  7. package/{dist/cjs → dist-cjs}/commands/CreateLunaClientCommand.js +2 -3
  8. package/{dist/cjs → dist-cjs}/commands/DeleteHapgCommand.js +2 -3
  9. package/{dist/cjs → dist-cjs}/commands/DeleteHsmCommand.js +2 -3
  10. package/{dist/cjs → dist-cjs}/commands/DeleteLunaClientCommand.js +2 -3
  11. package/{dist/cjs → dist-cjs}/commands/DescribeHapgCommand.js +2 -3
  12. package/{dist/cjs → dist-cjs}/commands/DescribeHsmCommand.js +2 -3
  13. package/{dist/cjs → dist-cjs}/commands/DescribeLunaClientCommand.js +2 -3
  14. package/{dist/cjs → dist-cjs}/commands/GetConfigCommand.js +2 -3
  15. package/{dist/cjs → dist-cjs}/commands/ListAvailableZonesCommand.js +2 -3
  16. package/{dist/cjs → dist-cjs}/commands/ListHapgsCommand.js +2 -3
  17. package/{dist/cjs → dist-cjs}/commands/ListHsmsCommand.js +2 -3
  18. package/{dist/cjs → dist-cjs}/commands/ListLunaClientsCommand.js +2 -3
  19. package/{dist/cjs → dist-cjs}/commands/ListTagsForResourceCommand.js +2 -3
  20. package/{dist/cjs → dist-cjs}/commands/ModifyHapgCommand.js +2 -3
  21. package/{dist/cjs → dist-cjs}/commands/ModifyHsmCommand.js +2 -3
  22. package/{dist/cjs → dist-cjs}/commands/ModifyLunaClientCommand.js +2 -3
  23. package/{dist/cjs → dist-cjs}/commands/RemoveTagsFromResourceCommand.js +2 -3
  24. package/{dist/cjs → dist-cjs}/endpoints.js +0 -1
  25. package/{dist/cjs → dist-cjs}/index.js +0 -1
  26. package/{dist/cjs → dist-cjs}/models/index.js +0 -1
  27. package/{dist/cjs → dist-cjs}/models/models_0.js +0 -1
  28. package/{dist/cjs → dist-cjs}/protocols/Aws_json1_1.js +0 -1
  29. package/{dist/cjs → dist-cjs}/runtimeConfig.browser.js +2 -2
  30. package/{dist/cjs → dist-cjs}/runtimeConfig.js +2 -2
  31. package/{dist/cjs → dist-cjs}/runtimeConfig.native.js +0 -1
  32. package/{dist/cjs → dist-cjs}/runtimeConfig.shared.js +1 -2
  33. package/{dist/es → dist-es}/CloudHSM.js +1 -15
  34. package/{dist/es → dist-es}/CloudHSMClient.js +2 -21
  35. package/dist-es/commands/AddTagsToResourceCommand.js +39 -0
  36. package/dist-es/commands/CreateHapgCommand.js +39 -0
  37. package/dist-es/commands/CreateHsmCommand.js +39 -0
  38. package/dist-es/commands/CreateLunaClientCommand.js +39 -0
  39. package/dist-es/commands/DeleteHapgCommand.js +39 -0
  40. package/dist-es/commands/DeleteHsmCommand.js +39 -0
  41. package/dist-es/commands/DeleteLunaClientCommand.js +39 -0
  42. package/dist-es/commands/DescribeHapgCommand.js +39 -0
  43. package/dist-es/commands/DescribeHsmCommand.js +39 -0
  44. package/dist-es/commands/DescribeLunaClientCommand.js +39 -0
  45. package/dist-es/commands/GetConfigCommand.js +39 -0
  46. package/dist-es/commands/ListAvailableZonesCommand.js +39 -0
  47. package/dist-es/commands/ListHapgsCommand.js +39 -0
  48. package/dist-es/commands/ListHsmsCommand.js +39 -0
  49. package/dist-es/commands/ListLunaClientsCommand.js +39 -0
  50. package/dist-es/commands/ListTagsForResourceCommand.js +39 -0
  51. package/dist-es/commands/ModifyHapgCommand.js +39 -0
  52. package/dist-es/commands/ModifyHsmCommand.js +39 -0
  53. package/dist-es/commands/ModifyLunaClientCommand.js +39 -0
  54. package/dist-es/commands/RemoveTagsFromResourceCommand.js +39 -0
  55. package/{dist/es → dist-es}/endpoints.js +1 -2
  56. package/{dist/types/index.d.ts → dist-es/index.js} +0 -0
  57. package/{dist/types/models/index.d.ts → dist-es/models/index.js} +0 -0
  58. package/{dist/es → dist-es}/models/models_0.js +0 -133
  59. package/{dist/es → dist-es}/protocols/Aws_json1_1.js +377 -383
  60. package/{dist/es → dist-es}/runtimeConfig.browser.js +1 -5
  61. package/{dist/es → dist-es}/runtimeConfig.js +1 -5
  62. package/{dist/es → dist-es}/runtimeConfig.native.js +0 -4
  63. package/{dist/es → dist-es}/runtimeConfig.shared.js +1 -5
  64. package/{dist/types → dist-types}/CloudHSM.d.ts +1 -1
  65. package/{dist/types → dist-types}/CloudHSMClient.d.ts +8 -8
  66. package/{dist/types → dist-types}/commands/AddTagsToResourceCommand.d.ts +2 -2
  67. package/{dist/types → dist-types}/commands/CreateHapgCommand.d.ts +2 -2
  68. package/{dist/types → dist-types}/commands/CreateHsmCommand.d.ts +2 -2
  69. package/{dist/types → dist-types}/commands/CreateLunaClientCommand.d.ts +2 -2
  70. package/{dist/types → dist-types}/commands/DeleteHapgCommand.d.ts +2 -2
  71. package/{dist/types → dist-types}/commands/DeleteHsmCommand.d.ts +2 -2
  72. package/{dist/types → dist-types}/commands/DeleteLunaClientCommand.d.ts +2 -2
  73. package/{dist/types → dist-types}/commands/DescribeHapgCommand.d.ts +2 -2
  74. package/{dist/types → dist-types}/commands/DescribeHsmCommand.d.ts +2 -2
  75. package/{dist/types → dist-types}/commands/DescribeLunaClientCommand.d.ts +2 -2
  76. package/{dist/types → dist-types}/commands/GetConfigCommand.d.ts +2 -2
  77. package/{dist/types → dist-types}/commands/ListAvailableZonesCommand.d.ts +2 -2
  78. package/{dist/types → dist-types}/commands/ListHapgsCommand.d.ts +2 -2
  79. package/{dist/types → dist-types}/commands/ListHsmsCommand.d.ts +2 -2
  80. package/{dist/types → dist-types}/commands/ListLunaClientsCommand.d.ts +2 -2
  81. package/{dist/types → dist-types}/commands/ListTagsForResourceCommand.d.ts +2 -2
  82. package/{dist/types → dist-types}/commands/ModifyHapgCommand.d.ts +2 -2
  83. package/{dist/types → dist-types}/commands/ModifyHsmCommand.d.ts +2 -2
  84. package/{dist/types → dist-types}/commands/ModifyLunaClientCommand.d.ts +2 -2
  85. package/{dist/types → dist-types}/commands/RemoveTagsFromResourceCommand.d.ts +2 -2
  86. package/{dist/types → dist-types}/endpoints.d.ts +0 -0
  87. package/{index.ts → dist-types/index.d.ts} +0 -0
  88. package/{models/index.ts → dist-types/models/index.d.ts} +0 -0
  89. package/{dist/types → dist-types}/models/models_0.d.ts +0 -0
  90. package/{dist/types → dist-types}/protocols/Aws_json1_1.d.ts +2 -2
  91. package/{dist/types/ts3.4 → dist-types}/runtimeConfig.browser.d.ts +37 -36
  92. package/{dist/types → dist-types}/runtimeConfig.d.ts +2 -1
  93. package/{dist/types/ts3.4 → dist-types}/runtimeConfig.native.d.ts +36 -35
  94. package/{dist/types → dist-types}/runtimeConfig.shared.d.ts +0 -0
  95. package/{dist/types → dist-types}/ts3.4/CloudHSM.d.ts +1 -1
  96. package/{dist/types → dist-types}/ts3.4/CloudHSMClient.d.ts +8 -8
  97. package/{dist/types → dist-types}/ts3.4/commands/AddTagsToResourceCommand.d.ts +2 -2
  98. package/{dist/types → dist-types}/ts3.4/commands/CreateHapgCommand.d.ts +2 -2
  99. package/{dist/types → dist-types}/ts3.4/commands/CreateHsmCommand.d.ts +2 -2
  100. package/{dist/types → dist-types}/ts3.4/commands/CreateLunaClientCommand.d.ts +2 -2
  101. package/{dist/types → dist-types}/ts3.4/commands/DeleteHapgCommand.d.ts +2 -2
  102. package/{dist/types → dist-types}/ts3.4/commands/DeleteHsmCommand.d.ts +2 -2
  103. package/{dist/types → dist-types}/ts3.4/commands/DeleteLunaClientCommand.d.ts +2 -2
  104. package/{dist/types → dist-types}/ts3.4/commands/DescribeHapgCommand.d.ts +2 -2
  105. package/{dist/types → dist-types}/ts3.4/commands/DescribeHsmCommand.d.ts +2 -2
  106. package/{dist/types → dist-types}/ts3.4/commands/DescribeLunaClientCommand.d.ts +2 -2
  107. package/{dist/types → dist-types}/ts3.4/commands/GetConfigCommand.d.ts +2 -2
  108. package/{dist/types → dist-types}/ts3.4/commands/ListAvailableZonesCommand.d.ts +2 -2
  109. package/{dist/types → dist-types}/ts3.4/commands/ListHapgsCommand.d.ts +2 -2
  110. package/{dist/types → dist-types}/ts3.4/commands/ListHsmsCommand.d.ts +2 -2
  111. package/{dist/types → dist-types}/ts3.4/commands/ListLunaClientsCommand.d.ts +2 -2
  112. package/{dist/types → dist-types}/ts3.4/commands/ListTagsForResourceCommand.d.ts +2 -2
  113. package/{dist/types → dist-types}/ts3.4/commands/ModifyHapgCommand.d.ts +2 -2
  114. package/{dist/types → dist-types}/ts3.4/commands/ModifyHsmCommand.d.ts +2 -2
  115. package/{dist/types → dist-types}/ts3.4/commands/ModifyLunaClientCommand.d.ts +2 -2
  116. package/{dist/types → dist-types}/ts3.4/commands/RemoveTagsFromResourceCommand.d.ts +2 -2
  117. package/{dist/types → dist-types}/ts3.4/endpoints.d.ts +0 -0
  118. package/{dist/types → dist-types}/ts3.4/index.d.ts +0 -0
  119. package/{dist/types → dist-types}/ts3.4/models/index.d.ts +0 -0
  120. package/{dist/types → dist-types}/ts3.4/models/models_0.d.ts +0 -0
  121. package/{dist/types → dist-types}/ts3.4/protocols/Aws_json1_1.d.ts +2 -2
  122. package/{dist/types → dist-types/ts3.4}/runtimeConfig.browser.d.ts +37 -36
  123. package/{dist/types → dist-types}/ts3.4/runtimeConfig.d.ts +2 -1
  124. package/{dist/types → dist-types/ts3.4}/runtimeConfig.native.d.ts +36 -35
  125. package/{dist/types → dist-types}/ts3.4/runtimeConfig.shared.d.ts +0 -0
  126. package/package.json +52 -49
  127. package/CloudHSM.ts +0 -892
  128. package/CloudHSMClient.ts +0 -311
  129. package/commands/AddTagsToResourceCommand.ts +0 -106
  130. package/commands/CreateHapgCommand.ts +0 -105
  131. package/commands/CreateHsmCommand.ts +0 -110
  132. package/commands/CreateLunaClientCommand.ts +0 -104
  133. package/commands/DeleteHapgCommand.ts +0 -104
  134. package/commands/DeleteHsmCommand.ts +0 -102
  135. package/commands/DeleteLunaClientCommand.ts +0 -104
  136. package/commands/DescribeHapgCommand.ts +0 -104
  137. package/commands/DescribeHsmCommand.ts +0 -105
  138. package/commands/DescribeLunaClientCommand.ts +0 -104
  139. package/commands/GetConfigCommand.ts +0 -102
  140. package/commands/ListAvailableZonesCommand.ts +0 -104
  141. package/commands/ListHapgsCommand.ts +0 -105
  142. package/commands/ListHsmsCommand.ts +0 -106
  143. package/commands/ListLunaClientsCommand.ts +0 -108
  144. package/commands/ListTagsForResourceCommand.ts +0 -104
  145. package/commands/ModifyHapgCommand.ts +0 -104
  146. package/commands/ModifyHsmCommand.ts +0 -107
  147. package/commands/ModifyLunaClientCommand.ts +0 -106
  148. package/commands/RemoveTagsFromResourceCommand.ts +0 -106
  149. package/dist/cjs/CloudHSM.js.map +0 -1
  150. package/dist/cjs/CloudHSMClient.js.map +0 -1
  151. package/dist/cjs/commands/AddTagsToResourceCommand.js.map +0 -1
  152. package/dist/cjs/commands/CreateHapgCommand.js.map +0 -1
  153. package/dist/cjs/commands/CreateHsmCommand.js.map +0 -1
  154. package/dist/cjs/commands/CreateLunaClientCommand.js.map +0 -1
  155. package/dist/cjs/commands/DeleteHapgCommand.js.map +0 -1
  156. package/dist/cjs/commands/DeleteHsmCommand.js.map +0 -1
  157. package/dist/cjs/commands/DeleteLunaClientCommand.js.map +0 -1
  158. package/dist/cjs/commands/DescribeHapgCommand.js.map +0 -1
  159. package/dist/cjs/commands/DescribeHsmCommand.js.map +0 -1
  160. package/dist/cjs/commands/DescribeLunaClientCommand.js.map +0 -1
  161. package/dist/cjs/commands/GetConfigCommand.js.map +0 -1
  162. package/dist/cjs/commands/ListAvailableZonesCommand.js.map +0 -1
  163. package/dist/cjs/commands/ListHapgsCommand.js.map +0 -1
  164. package/dist/cjs/commands/ListHsmsCommand.js.map +0 -1
  165. package/dist/cjs/commands/ListLunaClientsCommand.js.map +0 -1
  166. package/dist/cjs/commands/ListTagsForResourceCommand.js.map +0 -1
  167. package/dist/cjs/commands/ModifyHapgCommand.js.map +0 -1
  168. package/dist/cjs/commands/ModifyHsmCommand.js.map +0 -1
  169. package/dist/cjs/commands/ModifyLunaClientCommand.js.map +0 -1
  170. package/dist/cjs/commands/RemoveTagsFromResourceCommand.js.map +0 -1
  171. package/dist/cjs/endpoints.js.map +0 -1
  172. package/dist/cjs/index.js.map +0 -1
  173. package/dist/cjs/models/index.js.map +0 -1
  174. package/dist/cjs/models/models_0.js.map +0 -1
  175. package/dist/cjs/package.json +0 -91
  176. package/dist/cjs/protocols/Aws_json1_1.js.map +0 -1
  177. package/dist/cjs/runtimeConfig.browser.js.map +0 -1
  178. package/dist/cjs/runtimeConfig.js.map +0 -1
  179. package/dist/cjs/runtimeConfig.native.js.map +0 -1
  180. package/dist/cjs/runtimeConfig.shared.js.map +0 -1
  181. package/dist/es/CloudHSM.js.map +0 -1
  182. package/dist/es/CloudHSMClient.js.map +0 -1
  183. package/dist/es/commands/AddTagsToResourceCommand.js +0 -77
  184. package/dist/es/commands/AddTagsToResourceCommand.js.map +0 -1
  185. package/dist/es/commands/CreateHapgCommand.js +0 -76
  186. package/dist/es/commands/CreateHapgCommand.js.map +0 -1
  187. package/dist/es/commands/CreateHsmCommand.js +0 -84
  188. package/dist/es/commands/CreateHsmCommand.js.map +0 -1
  189. package/dist/es/commands/CreateLunaClientCommand.js +0 -75
  190. package/dist/es/commands/CreateLunaClientCommand.js.map +0 -1
  191. package/dist/es/commands/DeleteHapgCommand.js +0 -75
  192. package/dist/es/commands/DeleteHapgCommand.js.map +0 -1
  193. package/dist/es/commands/DeleteHsmCommand.js +0 -76
  194. package/dist/es/commands/DeleteHsmCommand.js.map +0 -1
  195. package/dist/es/commands/DeleteLunaClientCommand.js +0 -75
  196. package/dist/es/commands/DeleteLunaClientCommand.js.map +0 -1
  197. package/dist/es/commands/DescribeHapgCommand.js +0 -75
  198. package/dist/es/commands/DescribeHapgCommand.js.map +0 -1
  199. package/dist/es/commands/DescribeHsmCommand.js +0 -76
  200. package/dist/es/commands/DescribeHsmCommand.js.map +0 -1
  201. package/dist/es/commands/DescribeLunaClientCommand.js +0 -75
  202. package/dist/es/commands/DescribeLunaClientCommand.js.map +0 -1
  203. package/dist/es/commands/GetConfigCommand.js +0 -76
  204. package/dist/es/commands/GetConfigCommand.js.map +0 -1
  205. package/dist/es/commands/ListAvailableZonesCommand.js +0 -75
  206. package/dist/es/commands/ListAvailableZonesCommand.js.map +0 -1
  207. package/dist/es/commands/ListHapgsCommand.js +0 -79
  208. package/dist/es/commands/ListHapgsCommand.js.map +0 -1
  209. package/dist/es/commands/ListHsmsCommand.js +0 -80
  210. package/dist/es/commands/ListHsmsCommand.js.map +0 -1
  211. package/dist/es/commands/ListLunaClientsCommand.js +0 -79
  212. package/dist/es/commands/ListLunaClientsCommand.js.map +0 -1
  213. package/dist/es/commands/ListTagsForResourceCommand.js +0 -75
  214. package/dist/es/commands/ListTagsForResourceCommand.js.map +0 -1
  215. package/dist/es/commands/ModifyHapgCommand.js +0 -75
  216. package/dist/es/commands/ModifyHapgCommand.js.map +0 -1
  217. package/dist/es/commands/ModifyHsmCommand.js +0 -81
  218. package/dist/es/commands/ModifyHsmCommand.js.map +0 -1
  219. package/dist/es/commands/ModifyLunaClientCommand.js +0 -77
  220. package/dist/es/commands/ModifyLunaClientCommand.js.map +0 -1
  221. package/dist/es/commands/RemoveTagsFromResourceCommand.js +0 -77
  222. package/dist/es/commands/RemoveTagsFromResourceCommand.js.map +0 -1
  223. package/dist/es/endpoints.js.map +0 -1
  224. package/dist/es/index.js +0 -24
  225. package/dist/es/index.js.map +0 -1
  226. package/dist/es/models/index.js +0 -2
  227. package/dist/es/models/index.js.map +0 -1
  228. package/dist/es/models/models_0.js.map +0 -1
  229. package/dist/es/package.json +0 -91
  230. package/dist/es/protocols/Aws_json1_1.js.map +0 -1
  231. package/dist/es/runtimeConfig.browser.js.map +0 -1
  232. package/dist/es/runtimeConfig.js.map +0 -1
  233. package/dist/es/runtimeConfig.native.js.map +0 -1
  234. package/dist/es/runtimeConfig.shared.js.map +0 -1
  235. package/endpoints.ts +0 -57
  236. package/jest.config.js +0 -4
  237. package/models/models_0.ts +0 -1161
  238. package/protocols/Aws_json1_1.ts +0 -2399
  239. package/runtimeConfig.browser.ts +0 -40
  240. package/runtimeConfig.native.ts +0 -16
  241. package/runtimeConfig.shared.ts +0 -16
  242. package/runtimeConfig.ts +0 -45
  243. package/tsconfig.es.json +0 -12
  244. package/tsconfig.json +0 -32
@@ -1,2399 +0,0 @@
1
- import { AddTagsToResourceCommandInput, AddTagsToResourceCommandOutput } from "../commands/AddTagsToResourceCommand";
2
- import { CreateHapgCommandInput, CreateHapgCommandOutput } from "../commands/CreateHapgCommand";
3
- import { CreateHsmCommandInput, CreateHsmCommandOutput } from "../commands/CreateHsmCommand";
4
- import { CreateLunaClientCommandInput, CreateLunaClientCommandOutput } from "../commands/CreateLunaClientCommand";
5
- import { DeleteHapgCommandInput, DeleteHapgCommandOutput } from "../commands/DeleteHapgCommand";
6
- import { DeleteHsmCommandInput, DeleteHsmCommandOutput } from "../commands/DeleteHsmCommand";
7
- import { DeleteLunaClientCommandInput, DeleteLunaClientCommandOutput } from "../commands/DeleteLunaClientCommand";
8
- import { DescribeHapgCommandInput, DescribeHapgCommandOutput } from "../commands/DescribeHapgCommand";
9
- import { DescribeHsmCommandInput, DescribeHsmCommandOutput } from "../commands/DescribeHsmCommand";
10
- import { DescribeLunaClientCommandInput, DescribeLunaClientCommandOutput } from "../commands/DescribeLunaClientCommand";
11
- import { GetConfigCommandInput, GetConfigCommandOutput } from "../commands/GetConfigCommand";
12
- import { ListAvailableZonesCommandInput, ListAvailableZonesCommandOutput } from "../commands/ListAvailableZonesCommand";
13
- import { ListHapgsCommandInput, ListHapgsCommandOutput } from "../commands/ListHapgsCommand";
14
- import { ListHsmsCommandInput, ListHsmsCommandOutput } from "../commands/ListHsmsCommand";
15
- import { ListLunaClientsCommandInput, ListLunaClientsCommandOutput } from "../commands/ListLunaClientsCommand";
16
- import {
17
- ListTagsForResourceCommandInput,
18
- ListTagsForResourceCommandOutput,
19
- } from "../commands/ListTagsForResourceCommand";
20
- import { ModifyHapgCommandInput, ModifyHapgCommandOutput } from "../commands/ModifyHapgCommand";
21
- import { ModifyHsmCommandInput, ModifyHsmCommandOutput } from "../commands/ModifyHsmCommand";
22
- import { ModifyLunaClientCommandInput, ModifyLunaClientCommandOutput } from "../commands/ModifyLunaClientCommand";
23
- import {
24
- RemoveTagsFromResourceCommandInput,
25
- RemoveTagsFromResourceCommandOutput,
26
- } from "../commands/RemoveTagsFromResourceCommand";
27
- import {
28
- AddTagsToResourceRequest,
29
- AddTagsToResourceResponse,
30
- CloudHsmInternalException,
31
- CloudHsmServiceException,
32
- CreateHapgRequest,
33
- CreateHapgResponse,
34
- CreateHsmRequest,
35
- CreateHsmResponse,
36
- CreateLunaClientRequest,
37
- CreateLunaClientResponse,
38
- DeleteHapgRequest,
39
- DeleteHapgResponse,
40
- DeleteHsmRequest,
41
- DeleteHsmResponse,
42
- DeleteLunaClientRequest,
43
- DeleteLunaClientResponse,
44
- DescribeHapgRequest,
45
- DescribeHapgResponse,
46
- DescribeHsmRequest,
47
- DescribeHsmResponse,
48
- DescribeLunaClientRequest,
49
- DescribeLunaClientResponse,
50
- GetConfigRequest,
51
- GetConfigResponse,
52
- InvalidRequestException,
53
- ListAvailableZonesRequest,
54
- ListAvailableZonesResponse,
55
- ListHapgsRequest,
56
- ListHapgsResponse,
57
- ListHsmsRequest,
58
- ListHsmsResponse,
59
- ListLunaClientsRequest,
60
- ListLunaClientsResponse,
61
- ListTagsForResourceRequest,
62
- ListTagsForResourceResponse,
63
- ModifyHapgRequest,
64
- ModifyHapgResponse,
65
- ModifyHsmRequest,
66
- ModifyHsmResponse,
67
- ModifyLunaClientRequest,
68
- ModifyLunaClientResponse,
69
- RemoveTagsFromResourceRequest,
70
- RemoveTagsFromResourceResponse,
71
- Tag,
72
- } from "../models/models_0";
73
- import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
74
- import { expectBoolean as __expectBoolean, expectString as __expectString } from "@aws-sdk/smithy-client";
75
- import {
76
- Endpoint as __Endpoint,
77
- HeaderBag as __HeaderBag,
78
- MetadataBearer as __MetadataBearer,
79
- ResponseMetadata as __ResponseMetadata,
80
- SerdeContext as __SerdeContext,
81
- SmithyException as __SmithyException,
82
- } from "@aws-sdk/types";
83
-
84
- export const serializeAws_json1_1AddTagsToResourceCommand = async (
85
- input: AddTagsToResourceCommandInput,
86
- context: __SerdeContext
87
- ): Promise<__HttpRequest> => {
88
- const headers: __HeaderBag = {
89
- "content-type": "application/x-amz-json-1.1",
90
- "x-amz-target": "CloudHsmFrontendService.AddTagsToResource",
91
- };
92
- let body: any;
93
- body = JSON.stringify(serializeAws_json1_1AddTagsToResourceRequest(input, context));
94
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
95
- };
96
-
97
- export const serializeAws_json1_1CreateHapgCommand = async (
98
- input: CreateHapgCommandInput,
99
- context: __SerdeContext
100
- ): Promise<__HttpRequest> => {
101
- const headers: __HeaderBag = {
102
- "content-type": "application/x-amz-json-1.1",
103
- "x-amz-target": "CloudHsmFrontendService.CreateHapg",
104
- };
105
- let body: any;
106
- body = JSON.stringify(serializeAws_json1_1CreateHapgRequest(input, context));
107
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
108
- };
109
-
110
- export const serializeAws_json1_1CreateHsmCommand = async (
111
- input: CreateHsmCommandInput,
112
- context: __SerdeContext
113
- ): Promise<__HttpRequest> => {
114
- const headers: __HeaderBag = {
115
- "content-type": "application/x-amz-json-1.1",
116
- "x-amz-target": "CloudHsmFrontendService.CreateHsm",
117
- };
118
- let body: any;
119
- body = JSON.stringify(serializeAws_json1_1CreateHsmRequest(input, context));
120
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
121
- };
122
-
123
- export const serializeAws_json1_1CreateLunaClientCommand = async (
124
- input: CreateLunaClientCommandInput,
125
- context: __SerdeContext
126
- ): Promise<__HttpRequest> => {
127
- const headers: __HeaderBag = {
128
- "content-type": "application/x-amz-json-1.1",
129
- "x-amz-target": "CloudHsmFrontendService.CreateLunaClient",
130
- };
131
- let body: any;
132
- body = JSON.stringify(serializeAws_json1_1CreateLunaClientRequest(input, context));
133
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
134
- };
135
-
136
- export const serializeAws_json1_1DeleteHapgCommand = async (
137
- input: DeleteHapgCommandInput,
138
- context: __SerdeContext
139
- ): Promise<__HttpRequest> => {
140
- const headers: __HeaderBag = {
141
- "content-type": "application/x-amz-json-1.1",
142
- "x-amz-target": "CloudHsmFrontendService.DeleteHapg",
143
- };
144
- let body: any;
145
- body = JSON.stringify(serializeAws_json1_1DeleteHapgRequest(input, context));
146
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
147
- };
148
-
149
- export const serializeAws_json1_1DeleteHsmCommand = async (
150
- input: DeleteHsmCommandInput,
151
- context: __SerdeContext
152
- ): Promise<__HttpRequest> => {
153
- const headers: __HeaderBag = {
154
- "content-type": "application/x-amz-json-1.1",
155
- "x-amz-target": "CloudHsmFrontendService.DeleteHsm",
156
- };
157
- let body: any;
158
- body = JSON.stringify(serializeAws_json1_1DeleteHsmRequest(input, context));
159
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
160
- };
161
-
162
- export const serializeAws_json1_1DeleteLunaClientCommand = async (
163
- input: DeleteLunaClientCommandInput,
164
- context: __SerdeContext
165
- ): Promise<__HttpRequest> => {
166
- const headers: __HeaderBag = {
167
- "content-type": "application/x-amz-json-1.1",
168
- "x-amz-target": "CloudHsmFrontendService.DeleteLunaClient",
169
- };
170
- let body: any;
171
- body = JSON.stringify(serializeAws_json1_1DeleteLunaClientRequest(input, context));
172
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
173
- };
174
-
175
- export const serializeAws_json1_1DescribeHapgCommand = async (
176
- input: DescribeHapgCommandInput,
177
- context: __SerdeContext
178
- ): Promise<__HttpRequest> => {
179
- const headers: __HeaderBag = {
180
- "content-type": "application/x-amz-json-1.1",
181
- "x-amz-target": "CloudHsmFrontendService.DescribeHapg",
182
- };
183
- let body: any;
184
- body = JSON.stringify(serializeAws_json1_1DescribeHapgRequest(input, context));
185
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
186
- };
187
-
188
- export const serializeAws_json1_1DescribeHsmCommand = async (
189
- input: DescribeHsmCommandInput,
190
- context: __SerdeContext
191
- ): Promise<__HttpRequest> => {
192
- const headers: __HeaderBag = {
193
- "content-type": "application/x-amz-json-1.1",
194
- "x-amz-target": "CloudHsmFrontendService.DescribeHsm",
195
- };
196
- let body: any;
197
- body = JSON.stringify(serializeAws_json1_1DescribeHsmRequest(input, context));
198
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
199
- };
200
-
201
- export const serializeAws_json1_1DescribeLunaClientCommand = async (
202
- input: DescribeLunaClientCommandInput,
203
- context: __SerdeContext
204
- ): Promise<__HttpRequest> => {
205
- const headers: __HeaderBag = {
206
- "content-type": "application/x-amz-json-1.1",
207
- "x-amz-target": "CloudHsmFrontendService.DescribeLunaClient",
208
- };
209
- let body: any;
210
- body = JSON.stringify(serializeAws_json1_1DescribeLunaClientRequest(input, context));
211
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
212
- };
213
-
214
- export const serializeAws_json1_1GetConfigCommand = async (
215
- input: GetConfigCommandInput,
216
- context: __SerdeContext
217
- ): Promise<__HttpRequest> => {
218
- const headers: __HeaderBag = {
219
- "content-type": "application/x-amz-json-1.1",
220
- "x-amz-target": "CloudHsmFrontendService.GetConfig",
221
- };
222
- let body: any;
223
- body = JSON.stringify(serializeAws_json1_1GetConfigRequest(input, context));
224
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
225
- };
226
-
227
- export const serializeAws_json1_1ListAvailableZonesCommand = async (
228
- input: ListAvailableZonesCommandInput,
229
- context: __SerdeContext
230
- ): Promise<__HttpRequest> => {
231
- const headers: __HeaderBag = {
232
- "content-type": "application/x-amz-json-1.1",
233
- "x-amz-target": "CloudHsmFrontendService.ListAvailableZones",
234
- };
235
- let body: any;
236
- body = JSON.stringify(serializeAws_json1_1ListAvailableZonesRequest(input, context));
237
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
238
- };
239
-
240
- export const serializeAws_json1_1ListHapgsCommand = async (
241
- input: ListHapgsCommandInput,
242
- context: __SerdeContext
243
- ): Promise<__HttpRequest> => {
244
- const headers: __HeaderBag = {
245
- "content-type": "application/x-amz-json-1.1",
246
- "x-amz-target": "CloudHsmFrontendService.ListHapgs",
247
- };
248
- let body: any;
249
- body = JSON.stringify(serializeAws_json1_1ListHapgsRequest(input, context));
250
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
251
- };
252
-
253
- export const serializeAws_json1_1ListHsmsCommand = async (
254
- input: ListHsmsCommandInput,
255
- context: __SerdeContext
256
- ): Promise<__HttpRequest> => {
257
- const headers: __HeaderBag = {
258
- "content-type": "application/x-amz-json-1.1",
259
- "x-amz-target": "CloudHsmFrontendService.ListHsms",
260
- };
261
- let body: any;
262
- body = JSON.stringify(serializeAws_json1_1ListHsmsRequest(input, context));
263
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
264
- };
265
-
266
- export const serializeAws_json1_1ListLunaClientsCommand = async (
267
- input: ListLunaClientsCommandInput,
268
- context: __SerdeContext
269
- ): Promise<__HttpRequest> => {
270
- const headers: __HeaderBag = {
271
- "content-type": "application/x-amz-json-1.1",
272
- "x-amz-target": "CloudHsmFrontendService.ListLunaClients",
273
- };
274
- let body: any;
275
- body = JSON.stringify(serializeAws_json1_1ListLunaClientsRequest(input, context));
276
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
277
- };
278
-
279
- export const serializeAws_json1_1ListTagsForResourceCommand = async (
280
- input: ListTagsForResourceCommandInput,
281
- context: __SerdeContext
282
- ): Promise<__HttpRequest> => {
283
- const headers: __HeaderBag = {
284
- "content-type": "application/x-amz-json-1.1",
285
- "x-amz-target": "CloudHsmFrontendService.ListTagsForResource",
286
- };
287
- let body: any;
288
- body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context));
289
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
290
- };
291
-
292
- export const serializeAws_json1_1ModifyHapgCommand = async (
293
- input: ModifyHapgCommandInput,
294
- context: __SerdeContext
295
- ): Promise<__HttpRequest> => {
296
- const headers: __HeaderBag = {
297
- "content-type": "application/x-amz-json-1.1",
298
- "x-amz-target": "CloudHsmFrontendService.ModifyHapg",
299
- };
300
- let body: any;
301
- body = JSON.stringify(serializeAws_json1_1ModifyHapgRequest(input, context));
302
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
303
- };
304
-
305
- export const serializeAws_json1_1ModifyHsmCommand = async (
306
- input: ModifyHsmCommandInput,
307
- context: __SerdeContext
308
- ): Promise<__HttpRequest> => {
309
- const headers: __HeaderBag = {
310
- "content-type": "application/x-amz-json-1.1",
311
- "x-amz-target": "CloudHsmFrontendService.ModifyHsm",
312
- };
313
- let body: any;
314
- body = JSON.stringify(serializeAws_json1_1ModifyHsmRequest(input, context));
315
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
316
- };
317
-
318
- export const serializeAws_json1_1ModifyLunaClientCommand = async (
319
- input: ModifyLunaClientCommandInput,
320
- context: __SerdeContext
321
- ): Promise<__HttpRequest> => {
322
- const headers: __HeaderBag = {
323
- "content-type": "application/x-amz-json-1.1",
324
- "x-amz-target": "CloudHsmFrontendService.ModifyLunaClient",
325
- };
326
- let body: any;
327
- body = JSON.stringify(serializeAws_json1_1ModifyLunaClientRequest(input, context));
328
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
329
- };
330
-
331
- export const serializeAws_json1_1RemoveTagsFromResourceCommand = async (
332
- input: RemoveTagsFromResourceCommandInput,
333
- context: __SerdeContext
334
- ): Promise<__HttpRequest> => {
335
- const headers: __HeaderBag = {
336
- "content-type": "application/x-amz-json-1.1",
337
- "x-amz-target": "CloudHsmFrontendService.RemoveTagsFromResource",
338
- };
339
- let body: any;
340
- body = JSON.stringify(serializeAws_json1_1RemoveTagsFromResourceRequest(input, context));
341
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
342
- };
343
-
344
- export const deserializeAws_json1_1AddTagsToResourceCommand = async (
345
- output: __HttpResponse,
346
- context: __SerdeContext
347
- ): Promise<AddTagsToResourceCommandOutput> => {
348
- if (output.statusCode >= 300) {
349
- return deserializeAws_json1_1AddTagsToResourceCommandError(output, context);
350
- }
351
- const data: any = await parseBody(output.body, context);
352
- let contents: any = {};
353
- contents = deserializeAws_json1_1AddTagsToResourceResponse(data, context);
354
- const response: AddTagsToResourceCommandOutput = {
355
- $metadata: deserializeMetadata(output),
356
- ...contents,
357
- };
358
- return Promise.resolve(response);
359
- };
360
-
361
- const deserializeAws_json1_1AddTagsToResourceCommandError = async (
362
- output: __HttpResponse,
363
- context: __SerdeContext
364
- ): Promise<AddTagsToResourceCommandOutput> => {
365
- const parsedOutput: any = {
366
- ...output,
367
- body: await parseBody(output.body, context),
368
- };
369
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
370
- let errorCode: string = "UnknownError";
371
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
372
- switch (errorCode) {
373
- case "CloudHsmInternalException":
374
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
375
- response = {
376
- ...(await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)),
377
- name: errorCode,
378
- $metadata: deserializeMetadata(output),
379
- };
380
- break;
381
- case "CloudHsmServiceException":
382
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
383
- response = {
384
- ...(await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)),
385
- name: errorCode,
386
- $metadata: deserializeMetadata(output),
387
- };
388
- break;
389
- case "InvalidRequestException":
390
- case "com.amazonaws.cloudhsm#InvalidRequestException":
391
- response = {
392
- ...(await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)),
393
- name: errorCode,
394
- $metadata: deserializeMetadata(output),
395
- };
396
- break;
397
- default:
398
- const parsedBody = parsedOutput.body;
399
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
400
- response = {
401
- ...parsedBody,
402
- name: `${errorCode}`,
403
- message: parsedBody.message || parsedBody.Message || errorCode,
404
- $fault: "client",
405
- $metadata: deserializeMetadata(output),
406
- } as any;
407
- }
408
- const message = response.message || response.Message || errorCode;
409
- response.message = message;
410
- delete response.Message;
411
- return Promise.reject(Object.assign(new Error(message), response));
412
- };
413
-
414
- export const deserializeAws_json1_1CreateHapgCommand = async (
415
- output: __HttpResponse,
416
- context: __SerdeContext
417
- ): Promise<CreateHapgCommandOutput> => {
418
- if (output.statusCode >= 300) {
419
- return deserializeAws_json1_1CreateHapgCommandError(output, context);
420
- }
421
- const data: any = await parseBody(output.body, context);
422
- let contents: any = {};
423
- contents = deserializeAws_json1_1CreateHapgResponse(data, context);
424
- const response: CreateHapgCommandOutput = {
425
- $metadata: deserializeMetadata(output),
426
- ...contents,
427
- };
428
- return Promise.resolve(response);
429
- };
430
-
431
- const deserializeAws_json1_1CreateHapgCommandError = async (
432
- output: __HttpResponse,
433
- context: __SerdeContext
434
- ): Promise<CreateHapgCommandOutput> => {
435
- const parsedOutput: any = {
436
- ...output,
437
- body: await parseBody(output.body, context),
438
- };
439
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
440
- let errorCode: string = "UnknownError";
441
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
442
- switch (errorCode) {
443
- case "CloudHsmInternalException":
444
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
445
- response = {
446
- ...(await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)),
447
- name: errorCode,
448
- $metadata: deserializeMetadata(output),
449
- };
450
- break;
451
- case "CloudHsmServiceException":
452
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
453
- response = {
454
- ...(await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)),
455
- name: errorCode,
456
- $metadata: deserializeMetadata(output),
457
- };
458
- break;
459
- case "InvalidRequestException":
460
- case "com.amazonaws.cloudhsm#InvalidRequestException":
461
- response = {
462
- ...(await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)),
463
- name: errorCode,
464
- $metadata: deserializeMetadata(output),
465
- };
466
- break;
467
- default:
468
- const parsedBody = parsedOutput.body;
469
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
470
- response = {
471
- ...parsedBody,
472
- name: `${errorCode}`,
473
- message: parsedBody.message || parsedBody.Message || errorCode,
474
- $fault: "client",
475
- $metadata: deserializeMetadata(output),
476
- } as any;
477
- }
478
- const message = response.message || response.Message || errorCode;
479
- response.message = message;
480
- delete response.Message;
481
- return Promise.reject(Object.assign(new Error(message), response));
482
- };
483
-
484
- export const deserializeAws_json1_1CreateHsmCommand = async (
485
- output: __HttpResponse,
486
- context: __SerdeContext
487
- ): Promise<CreateHsmCommandOutput> => {
488
- if (output.statusCode >= 300) {
489
- return deserializeAws_json1_1CreateHsmCommandError(output, context);
490
- }
491
- const data: any = await parseBody(output.body, context);
492
- let contents: any = {};
493
- contents = deserializeAws_json1_1CreateHsmResponse(data, context);
494
- const response: CreateHsmCommandOutput = {
495
- $metadata: deserializeMetadata(output),
496
- ...contents,
497
- };
498
- return Promise.resolve(response);
499
- };
500
-
501
- const deserializeAws_json1_1CreateHsmCommandError = async (
502
- output: __HttpResponse,
503
- context: __SerdeContext
504
- ): Promise<CreateHsmCommandOutput> => {
505
- const parsedOutput: any = {
506
- ...output,
507
- body: await parseBody(output.body, context),
508
- };
509
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
510
- let errorCode: string = "UnknownError";
511
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
512
- switch (errorCode) {
513
- case "CloudHsmInternalException":
514
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
515
- response = {
516
- ...(await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)),
517
- name: errorCode,
518
- $metadata: deserializeMetadata(output),
519
- };
520
- break;
521
- case "CloudHsmServiceException":
522
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
523
- response = {
524
- ...(await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)),
525
- name: errorCode,
526
- $metadata: deserializeMetadata(output),
527
- };
528
- break;
529
- case "InvalidRequestException":
530
- case "com.amazonaws.cloudhsm#InvalidRequestException":
531
- response = {
532
- ...(await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)),
533
- name: errorCode,
534
- $metadata: deserializeMetadata(output),
535
- };
536
- break;
537
- default:
538
- const parsedBody = parsedOutput.body;
539
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
540
- response = {
541
- ...parsedBody,
542
- name: `${errorCode}`,
543
- message: parsedBody.message || parsedBody.Message || errorCode,
544
- $fault: "client",
545
- $metadata: deserializeMetadata(output),
546
- } as any;
547
- }
548
- const message = response.message || response.Message || errorCode;
549
- response.message = message;
550
- delete response.Message;
551
- return Promise.reject(Object.assign(new Error(message), response));
552
- };
553
-
554
- export const deserializeAws_json1_1CreateLunaClientCommand = async (
555
- output: __HttpResponse,
556
- context: __SerdeContext
557
- ): Promise<CreateLunaClientCommandOutput> => {
558
- if (output.statusCode >= 300) {
559
- return deserializeAws_json1_1CreateLunaClientCommandError(output, context);
560
- }
561
- const data: any = await parseBody(output.body, context);
562
- let contents: any = {};
563
- contents = deserializeAws_json1_1CreateLunaClientResponse(data, context);
564
- const response: CreateLunaClientCommandOutput = {
565
- $metadata: deserializeMetadata(output),
566
- ...contents,
567
- };
568
- return Promise.resolve(response);
569
- };
570
-
571
- const deserializeAws_json1_1CreateLunaClientCommandError = async (
572
- output: __HttpResponse,
573
- context: __SerdeContext
574
- ): Promise<CreateLunaClientCommandOutput> => {
575
- const parsedOutput: any = {
576
- ...output,
577
- body: await parseBody(output.body, context),
578
- };
579
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
580
- let errorCode: string = "UnknownError";
581
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
582
- switch (errorCode) {
583
- case "CloudHsmInternalException":
584
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
585
- response = {
586
- ...(await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)),
587
- name: errorCode,
588
- $metadata: deserializeMetadata(output),
589
- };
590
- break;
591
- case "CloudHsmServiceException":
592
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
593
- response = {
594
- ...(await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)),
595
- name: errorCode,
596
- $metadata: deserializeMetadata(output),
597
- };
598
- break;
599
- case "InvalidRequestException":
600
- case "com.amazonaws.cloudhsm#InvalidRequestException":
601
- response = {
602
- ...(await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)),
603
- name: errorCode,
604
- $metadata: deserializeMetadata(output),
605
- };
606
- break;
607
- default:
608
- const parsedBody = parsedOutput.body;
609
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
610
- response = {
611
- ...parsedBody,
612
- name: `${errorCode}`,
613
- message: parsedBody.message || parsedBody.Message || errorCode,
614
- $fault: "client",
615
- $metadata: deserializeMetadata(output),
616
- } as any;
617
- }
618
- const message = response.message || response.Message || errorCode;
619
- response.message = message;
620
- delete response.Message;
621
- return Promise.reject(Object.assign(new Error(message), response));
622
- };
623
-
624
- export const deserializeAws_json1_1DeleteHapgCommand = async (
625
- output: __HttpResponse,
626
- context: __SerdeContext
627
- ): Promise<DeleteHapgCommandOutput> => {
628
- if (output.statusCode >= 300) {
629
- return deserializeAws_json1_1DeleteHapgCommandError(output, context);
630
- }
631
- const data: any = await parseBody(output.body, context);
632
- let contents: any = {};
633
- contents = deserializeAws_json1_1DeleteHapgResponse(data, context);
634
- const response: DeleteHapgCommandOutput = {
635
- $metadata: deserializeMetadata(output),
636
- ...contents,
637
- };
638
- return Promise.resolve(response);
639
- };
640
-
641
- const deserializeAws_json1_1DeleteHapgCommandError = async (
642
- output: __HttpResponse,
643
- context: __SerdeContext
644
- ): Promise<DeleteHapgCommandOutput> => {
645
- const parsedOutput: any = {
646
- ...output,
647
- body: await parseBody(output.body, context),
648
- };
649
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
650
- let errorCode: string = "UnknownError";
651
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
652
- switch (errorCode) {
653
- case "CloudHsmInternalException":
654
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
655
- response = {
656
- ...(await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)),
657
- name: errorCode,
658
- $metadata: deserializeMetadata(output),
659
- };
660
- break;
661
- case "CloudHsmServiceException":
662
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
663
- response = {
664
- ...(await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)),
665
- name: errorCode,
666
- $metadata: deserializeMetadata(output),
667
- };
668
- break;
669
- case "InvalidRequestException":
670
- case "com.amazonaws.cloudhsm#InvalidRequestException":
671
- response = {
672
- ...(await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)),
673
- name: errorCode,
674
- $metadata: deserializeMetadata(output),
675
- };
676
- break;
677
- default:
678
- const parsedBody = parsedOutput.body;
679
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
680
- response = {
681
- ...parsedBody,
682
- name: `${errorCode}`,
683
- message: parsedBody.message || parsedBody.Message || errorCode,
684
- $fault: "client",
685
- $metadata: deserializeMetadata(output),
686
- } as any;
687
- }
688
- const message = response.message || response.Message || errorCode;
689
- response.message = message;
690
- delete response.Message;
691
- return Promise.reject(Object.assign(new Error(message), response));
692
- };
693
-
694
- export const deserializeAws_json1_1DeleteHsmCommand = async (
695
- output: __HttpResponse,
696
- context: __SerdeContext
697
- ): Promise<DeleteHsmCommandOutput> => {
698
- if (output.statusCode >= 300) {
699
- return deserializeAws_json1_1DeleteHsmCommandError(output, context);
700
- }
701
- const data: any = await parseBody(output.body, context);
702
- let contents: any = {};
703
- contents = deserializeAws_json1_1DeleteHsmResponse(data, context);
704
- const response: DeleteHsmCommandOutput = {
705
- $metadata: deserializeMetadata(output),
706
- ...contents,
707
- };
708
- return Promise.resolve(response);
709
- };
710
-
711
- const deserializeAws_json1_1DeleteHsmCommandError = async (
712
- output: __HttpResponse,
713
- context: __SerdeContext
714
- ): Promise<DeleteHsmCommandOutput> => {
715
- const parsedOutput: any = {
716
- ...output,
717
- body: await parseBody(output.body, context),
718
- };
719
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
720
- let errorCode: string = "UnknownError";
721
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
722
- switch (errorCode) {
723
- case "CloudHsmInternalException":
724
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
725
- response = {
726
- ...(await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)),
727
- name: errorCode,
728
- $metadata: deserializeMetadata(output),
729
- };
730
- break;
731
- case "CloudHsmServiceException":
732
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
733
- response = {
734
- ...(await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)),
735
- name: errorCode,
736
- $metadata: deserializeMetadata(output),
737
- };
738
- break;
739
- case "InvalidRequestException":
740
- case "com.amazonaws.cloudhsm#InvalidRequestException":
741
- response = {
742
- ...(await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)),
743
- name: errorCode,
744
- $metadata: deserializeMetadata(output),
745
- };
746
- break;
747
- default:
748
- const parsedBody = parsedOutput.body;
749
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
750
- response = {
751
- ...parsedBody,
752
- name: `${errorCode}`,
753
- message: parsedBody.message || parsedBody.Message || errorCode,
754
- $fault: "client",
755
- $metadata: deserializeMetadata(output),
756
- } as any;
757
- }
758
- const message = response.message || response.Message || errorCode;
759
- response.message = message;
760
- delete response.Message;
761
- return Promise.reject(Object.assign(new Error(message), response));
762
- };
763
-
764
- export const deserializeAws_json1_1DeleteLunaClientCommand = async (
765
- output: __HttpResponse,
766
- context: __SerdeContext
767
- ): Promise<DeleteLunaClientCommandOutput> => {
768
- if (output.statusCode >= 300) {
769
- return deserializeAws_json1_1DeleteLunaClientCommandError(output, context);
770
- }
771
- const data: any = await parseBody(output.body, context);
772
- let contents: any = {};
773
- contents = deserializeAws_json1_1DeleteLunaClientResponse(data, context);
774
- const response: DeleteLunaClientCommandOutput = {
775
- $metadata: deserializeMetadata(output),
776
- ...contents,
777
- };
778
- return Promise.resolve(response);
779
- };
780
-
781
- const deserializeAws_json1_1DeleteLunaClientCommandError = async (
782
- output: __HttpResponse,
783
- context: __SerdeContext
784
- ): Promise<DeleteLunaClientCommandOutput> => {
785
- const parsedOutput: any = {
786
- ...output,
787
- body: await parseBody(output.body, context),
788
- };
789
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
790
- let errorCode: string = "UnknownError";
791
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
792
- switch (errorCode) {
793
- case "CloudHsmInternalException":
794
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
795
- response = {
796
- ...(await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)),
797
- name: errorCode,
798
- $metadata: deserializeMetadata(output),
799
- };
800
- break;
801
- case "CloudHsmServiceException":
802
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
803
- response = {
804
- ...(await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)),
805
- name: errorCode,
806
- $metadata: deserializeMetadata(output),
807
- };
808
- break;
809
- case "InvalidRequestException":
810
- case "com.amazonaws.cloudhsm#InvalidRequestException":
811
- response = {
812
- ...(await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)),
813
- name: errorCode,
814
- $metadata: deserializeMetadata(output),
815
- };
816
- break;
817
- default:
818
- const parsedBody = parsedOutput.body;
819
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
820
- response = {
821
- ...parsedBody,
822
- name: `${errorCode}`,
823
- message: parsedBody.message || parsedBody.Message || errorCode,
824
- $fault: "client",
825
- $metadata: deserializeMetadata(output),
826
- } as any;
827
- }
828
- const message = response.message || response.Message || errorCode;
829
- response.message = message;
830
- delete response.Message;
831
- return Promise.reject(Object.assign(new Error(message), response));
832
- };
833
-
834
- export const deserializeAws_json1_1DescribeHapgCommand = async (
835
- output: __HttpResponse,
836
- context: __SerdeContext
837
- ): Promise<DescribeHapgCommandOutput> => {
838
- if (output.statusCode >= 300) {
839
- return deserializeAws_json1_1DescribeHapgCommandError(output, context);
840
- }
841
- const data: any = await parseBody(output.body, context);
842
- let contents: any = {};
843
- contents = deserializeAws_json1_1DescribeHapgResponse(data, context);
844
- const response: DescribeHapgCommandOutput = {
845
- $metadata: deserializeMetadata(output),
846
- ...contents,
847
- };
848
- return Promise.resolve(response);
849
- };
850
-
851
- const deserializeAws_json1_1DescribeHapgCommandError = async (
852
- output: __HttpResponse,
853
- context: __SerdeContext
854
- ): Promise<DescribeHapgCommandOutput> => {
855
- const parsedOutput: any = {
856
- ...output,
857
- body: await parseBody(output.body, context),
858
- };
859
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
860
- let errorCode: string = "UnknownError";
861
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
862
- switch (errorCode) {
863
- case "CloudHsmInternalException":
864
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
865
- response = {
866
- ...(await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)),
867
- name: errorCode,
868
- $metadata: deserializeMetadata(output),
869
- };
870
- break;
871
- case "CloudHsmServiceException":
872
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
873
- response = {
874
- ...(await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)),
875
- name: errorCode,
876
- $metadata: deserializeMetadata(output),
877
- };
878
- break;
879
- case "InvalidRequestException":
880
- case "com.amazonaws.cloudhsm#InvalidRequestException":
881
- response = {
882
- ...(await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)),
883
- name: errorCode,
884
- $metadata: deserializeMetadata(output),
885
- };
886
- break;
887
- default:
888
- const parsedBody = parsedOutput.body;
889
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
890
- response = {
891
- ...parsedBody,
892
- name: `${errorCode}`,
893
- message: parsedBody.message || parsedBody.Message || errorCode,
894
- $fault: "client",
895
- $metadata: deserializeMetadata(output),
896
- } as any;
897
- }
898
- const message = response.message || response.Message || errorCode;
899
- response.message = message;
900
- delete response.Message;
901
- return Promise.reject(Object.assign(new Error(message), response));
902
- };
903
-
904
- export const deserializeAws_json1_1DescribeHsmCommand = async (
905
- output: __HttpResponse,
906
- context: __SerdeContext
907
- ): Promise<DescribeHsmCommandOutput> => {
908
- if (output.statusCode >= 300) {
909
- return deserializeAws_json1_1DescribeHsmCommandError(output, context);
910
- }
911
- const data: any = await parseBody(output.body, context);
912
- let contents: any = {};
913
- contents = deserializeAws_json1_1DescribeHsmResponse(data, context);
914
- const response: DescribeHsmCommandOutput = {
915
- $metadata: deserializeMetadata(output),
916
- ...contents,
917
- };
918
- return Promise.resolve(response);
919
- };
920
-
921
- const deserializeAws_json1_1DescribeHsmCommandError = async (
922
- output: __HttpResponse,
923
- context: __SerdeContext
924
- ): Promise<DescribeHsmCommandOutput> => {
925
- const parsedOutput: any = {
926
- ...output,
927
- body: await parseBody(output.body, context),
928
- };
929
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
930
- let errorCode: string = "UnknownError";
931
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
932
- switch (errorCode) {
933
- case "CloudHsmInternalException":
934
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
935
- response = {
936
- ...(await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)),
937
- name: errorCode,
938
- $metadata: deserializeMetadata(output),
939
- };
940
- break;
941
- case "CloudHsmServiceException":
942
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
943
- response = {
944
- ...(await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)),
945
- name: errorCode,
946
- $metadata: deserializeMetadata(output),
947
- };
948
- break;
949
- case "InvalidRequestException":
950
- case "com.amazonaws.cloudhsm#InvalidRequestException":
951
- response = {
952
- ...(await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)),
953
- name: errorCode,
954
- $metadata: deserializeMetadata(output),
955
- };
956
- break;
957
- default:
958
- const parsedBody = parsedOutput.body;
959
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
960
- response = {
961
- ...parsedBody,
962
- name: `${errorCode}`,
963
- message: parsedBody.message || parsedBody.Message || errorCode,
964
- $fault: "client",
965
- $metadata: deserializeMetadata(output),
966
- } as any;
967
- }
968
- const message = response.message || response.Message || errorCode;
969
- response.message = message;
970
- delete response.Message;
971
- return Promise.reject(Object.assign(new Error(message), response));
972
- };
973
-
974
- export const deserializeAws_json1_1DescribeLunaClientCommand = async (
975
- output: __HttpResponse,
976
- context: __SerdeContext
977
- ): Promise<DescribeLunaClientCommandOutput> => {
978
- if (output.statusCode >= 300) {
979
- return deserializeAws_json1_1DescribeLunaClientCommandError(output, context);
980
- }
981
- const data: any = await parseBody(output.body, context);
982
- let contents: any = {};
983
- contents = deserializeAws_json1_1DescribeLunaClientResponse(data, context);
984
- const response: DescribeLunaClientCommandOutput = {
985
- $metadata: deserializeMetadata(output),
986
- ...contents,
987
- };
988
- return Promise.resolve(response);
989
- };
990
-
991
- const deserializeAws_json1_1DescribeLunaClientCommandError = async (
992
- output: __HttpResponse,
993
- context: __SerdeContext
994
- ): Promise<DescribeLunaClientCommandOutput> => {
995
- const parsedOutput: any = {
996
- ...output,
997
- body: await parseBody(output.body, context),
998
- };
999
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1000
- let errorCode: string = "UnknownError";
1001
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1002
- switch (errorCode) {
1003
- case "CloudHsmInternalException":
1004
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
1005
- response = {
1006
- ...(await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)),
1007
- name: errorCode,
1008
- $metadata: deserializeMetadata(output),
1009
- };
1010
- break;
1011
- case "CloudHsmServiceException":
1012
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
1013
- response = {
1014
- ...(await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)),
1015
- name: errorCode,
1016
- $metadata: deserializeMetadata(output),
1017
- };
1018
- break;
1019
- case "InvalidRequestException":
1020
- case "com.amazonaws.cloudhsm#InvalidRequestException":
1021
- response = {
1022
- ...(await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)),
1023
- name: errorCode,
1024
- $metadata: deserializeMetadata(output),
1025
- };
1026
- break;
1027
- default:
1028
- const parsedBody = parsedOutput.body;
1029
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1030
- response = {
1031
- ...parsedBody,
1032
- name: `${errorCode}`,
1033
- message: parsedBody.message || parsedBody.Message || errorCode,
1034
- $fault: "client",
1035
- $metadata: deserializeMetadata(output),
1036
- } as any;
1037
- }
1038
- const message = response.message || response.Message || errorCode;
1039
- response.message = message;
1040
- delete response.Message;
1041
- return Promise.reject(Object.assign(new Error(message), response));
1042
- };
1043
-
1044
- export const deserializeAws_json1_1GetConfigCommand = async (
1045
- output: __HttpResponse,
1046
- context: __SerdeContext
1047
- ): Promise<GetConfigCommandOutput> => {
1048
- if (output.statusCode >= 300) {
1049
- return deserializeAws_json1_1GetConfigCommandError(output, context);
1050
- }
1051
- const data: any = await parseBody(output.body, context);
1052
- let contents: any = {};
1053
- contents = deserializeAws_json1_1GetConfigResponse(data, context);
1054
- const response: GetConfigCommandOutput = {
1055
- $metadata: deserializeMetadata(output),
1056
- ...contents,
1057
- };
1058
- return Promise.resolve(response);
1059
- };
1060
-
1061
- const deserializeAws_json1_1GetConfigCommandError = async (
1062
- output: __HttpResponse,
1063
- context: __SerdeContext
1064
- ): Promise<GetConfigCommandOutput> => {
1065
- const parsedOutput: any = {
1066
- ...output,
1067
- body: await parseBody(output.body, context),
1068
- };
1069
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1070
- let errorCode: string = "UnknownError";
1071
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1072
- switch (errorCode) {
1073
- case "CloudHsmInternalException":
1074
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
1075
- response = {
1076
- ...(await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)),
1077
- name: errorCode,
1078
- $metadata: deserializeMetadata(output),
1079
- };
1080
- break;
1081
- case "CloudHsmServiceException":
1082
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
1083
- response = {
1084
- ...(await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)),
1085
- name: errorCode,
1086
- $metadata: deserializeMetadata(output),
1087
- };
1088
- break;
1089
- case "InvalidRequestException":
1090
- case "com.amazonaws.cloudhsm#InvalidRequestException":
1091
- response = {
1092
- ...(await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)),
1093
- name: errorCode,
1094
- $metadata: deserializeMetadata(output),
1095
- };
1096
- break;
1097
- default:
1098
- const parsedBody = parsedOutput.body;
1099
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1100
- response = {
1101
- ...parsedBody,
1102
- name: `${errorCode}`,
1103
- message: parsedBody.message || parsedBody.Message || errorCode,
1104
- $fault: "client",
1105
- $metadata: deserializeMetadata(output),
1106
- } as any;
1107
- }
1108
- const message = response.message || response.Message || errorCode;
1109
- response.message = message;
1110
- delete response.Message;
1111
- return Promise.reject(Object.assign(new Error(message), response));
1112
- };
1113
-
1114
- export const deserializeAws_json1_1ListAvailableZonesCommand = async (
1115
- output: __HttpResponse,
1116
- context: __SerdeContext
1117
- ): Promise<ListAvailableZonesCommandOutput> => {
1118
- if (output.statusCode >= 300) {
1119
- return deserializeAws_json1_1ListAvailableZonesCommandError(output, context);
1120
- }
1121
- const data: any = await parseBody(output.body, context);
1122
- let contents: any = {};
1123
- contents = deserializeAws_json1_1ListAvailableZonesResponse(data, context);
1124
- const response: ListAvailableZonesCommandOutput = {
1125
- $metadata: deserializeMetadata(output),
1126
- ...contents,
1127
- };
1128
- return Promise.resolve(response);
1129
- };
1130
-
1131
- const deserializeAws_json1_1ListAvailableZonesCommandError = async (
1132
- output: __HttpResponse,
1133
- context: __SerdeContext
1134
- ): Promise<ListAvailableZonesCommandOutput> => {
1135
- const parsedOutput: any = {
1136
- ...output,
1137
- body: await parseBody(output.body, context),
1138
- };
1139
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1140
- let errorCode: string = "UnknownError";
1141
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1142
- switch (errorCode) {
1143
- case "CloudHsmInternalException":
1144
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
1145
- response = {
1146
- ...(await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)),
1147
- name: errorCode,
1148
- $metadata: deserializeMetadata(output),
1149
- };
1150
- break;
1151
- case "CloudHsmServiceException":
1152
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
1153
- response = {
1154
- ...(await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)),
1155
- name: errorCode,
1156
- $metadata: deserializeMetadata(output),
1157
- };
1158
- break;
1159
- case "InvalidRequestException":
1160
- case "com.amazonaws.cloudhsm#InvalidRequestException":
1161
- response = {
1162
- ...(await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)),
1163
- name: errorCode,
1164
- $metadata: deserializeMetadata(output),
1165
- };
1166
- break;
1167
- default:
1168
- const parsedBody = parsedOutput.body;
1169
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1170
- response = {
1171
- ...parsedBody,
1172
- name: `${errorCode}`,
1173
- message: parsedBody.message || parsedBody.Message || errorCode,
1174
- $fault: "client",
1175
- $metadata: deserializeMetadata(output),
1176
- } as any;
1177
- }
1178
- const message = response.message || response.Message || errorCode;
1179
- response.message = message;
1180
- delete response.Message;
1181
- return Promise.reject(Object.assign(new Error(message), response));
1182
- };
1183
-
1184
- export const deserializeAws_json1_1ListHapgsCommand = async (
1185
- output: __HttpResponse,
1186
- context: __SerdeContext
1187
- ): Promise<ListHapgsCommandOutput> => {
1188
- if (output.statusCode >= 300) {
1189
- return deserializeAws_json1_1ListHapgsCommandError(output, context);
1190
- }
1191
- const data: any = await parseBody(output.body, context);
1192
- let contents: any = {};
1193
- contents = deserializeAws_json1_1ListHapgsResponse(data, context);
1194
- const response: ListHapgsCommandOutput = {
1195
- $metadata: deserializeMetadata(output),
1196
- ...contents,
1197
- };
1198
- return Promise.resolve(response);
1199
- };
1200
-
1201
- const deserializeAws_json1_1ListHapgsCommandError = async (
1202
- output: __HttpResponse,
1203
- context: __SerdeContext
1204
- ): Promise<ListHapgsCommandOutput> => {
1205
- const parsedOutput: any = {
1206
- ...output,
1207
- body: await parseBody(output.body, context),
1208
- };
1209
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1210
- let errorCode: string = "UnknownError";
1211
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1212
- switch (errorCode) {
1213
- case "CloudHsmInternalException":
1214
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
1215
- response = {
1216
- ...(await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)),
1217
- name: errorCode,
1218
- $metadata: deserializeMetadata(output),
1219
- };
1220
- break;
1221
- case "CloudHsmServiceException":
1222
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
1223
- response = {
1224
- ...(await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)),
1225
- name: errorCode,
1226
- $metadata: deserializeMetadata(output),
1227
- };
1228
- break;
1229
- case "InvalidRequestException":
1230
- case "com.amazonaws.cloudhsm#InvalidRequestException":
1231
- response = {
1232
- ...(await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)),
1233
- name: errorCode,
1234
- $metadata: deserializeMetadata(output),
1235
- };
1236
- break;
1237
- default:
1238
- const parsedBody = parsedOutput.body;
1239
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1240
- response = {
1241
- ...parsedBody,
1242
- name: `${errorCode}`,
1243
- message: parsedBody.message || parsedBody.Message || errorCode,
1244
- $fault: "client",
1245
- $metadata: deserializeMetadata(output),
1246
- } as any;
1247
- }
1248
- const message = response.message || response.Message || errorCode;
1249
- response.message = message;
1250
- delete response.Message;
1251
- return Promise.reject(Object.assign(new Error(message), response));
1252
- };
1253
-
1254
- export const deserializeAws_json1_1ListHsmsCommand = async (
1255
- output: __HttpResponse,
1256
- context: __SerdeContext
1257
- ): Promise<ListHsmsCommandOutput> => {
1258
- if (output.statusCode >= 300) {
1259
- return deserializeAws_json1_1ListHsmsCommandError(output, context);
1260
- }
1261
- const data: any = await parseBody(output.body, context);
1262
- let contents: any = {};
1263
- contents = deserializeAws_json1_1ListHsmsResponse(data, context);
1264
- const response: ListHsmsCommandOutput = {
1265
- $metadata: deserializeMetadata(output),
1266
- ...contents,
1267
- };
1268
- return Promise.resolve(response);
1269
- };
1270
-
1271
- const deserializeAws_json1_1ListHsmsCommandError = async (
1272
- output: __HttpResponse,
1273
- context: __SerdeContext
1274
- ): Promise<ListHsmsCommandOutput> => {
1275
- const parsedOutput: any = {
1276
- ...output,
1277
- body: await parseBody(output.body, context),
1278
- };
1279
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1280
- let errorCode: string = "UnknownError";
1281
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1282
- switch (errorCode) {
1283
- case "CloudHsmInternalException":
1284
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
1285
- response = {
1286
- ...(await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)),
1287
- name: errorCode,
1288
- $metadata: deserializeMetadata(output),
1289
- };
1290
- break;
1291
- case "CloudHsmServiceException":
1292
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
1293
- response = {
1294
- ...(await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)),
1295
- name: errorCode,
1296
- $metadata: deserializeMetadata(output),
1297
- };
1298
- break;
1299
- case "InvalidRequestException":
1300
- case "com.amazonaws.cloudhsm#InvalidRequestException":
1301
- response = {
1302
- ...(await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)),
1303
- name: errorCode,
1304
- $metadata: deserializeMetadata(output),
1305
- };
1306
- break;
1307
- default:
1308
- const parsedBody = parsedOutput.body;
1309
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1310
- response = {
1311
- ...parsedBody,
1312
- name: `${errorCode}`,
1313
- message: parsedBody.message || parsedBody.Message || errorCode,
1314
- $fault: "client",
1315
- $metadata: deserializeMetadata(output),
1316
- } as any;
1317
- }
1318
- const message = response.message || response.Message || errorCode;
1319
- response.message = message;
1320
- delete response.Message;
1321
- return Promise.reject(Object.assign(new Error(message), response));
1322
- };
1323
-
1324
- export const deserializeAws_json1_1ListLunaClientsCommand = async (
1325
- output: __HttpResponse,
1326
- context: __SerdeContext
1327
- ): Promise<ListLunaClientsCommandOutput> => {
1328
- if (output.statusCode >= 300) {
1329
- return deserializeAws_json1_1ListLunaClientsCommandError(output, context);
1330
- }
1331
- const data: any = await parseBody(output.body, context);
1332
- let contents: any = {};
1333
- contents = deserializeAws_json1_1ListLunaClientsResponse(data, context);
1334
- const response: ListLunaClientsCommandOutput = {
1335
- $metadata: deserializeMetadata(output),
1336
- ...contents,
1337
- };
1338
- return Promise.resolve(response);
1339
- };
1340
-
1341
- const deserializeAws_json1_1ListLunaClientsCommandError = async (
1342
- output: __HttpResponse,
1343
- context: __SerdeContext
1344
- ): Promise<ListLunaClientsCommandOutput> => {
1345
- const parsedOutput: any = {
1346
- ...output,
1347
- body: await parseBody(output.body, context),
1348
- };
1349
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1350
- let errorCode: string = "UnknownError";
1351
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1352
- switch (errorCode) {
1353
- case "CloudHsmInternalException":
1354
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
1355
- response = {
1356
- ...(await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)),
1357
- name: errorCode,
1358
- $metadata: deserializeMetadata(output),
1359
- };
1360
- break;
1361
- case "CloudHsmServiceException":
1362
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
1363
- response = {
1364
- ...(await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)),
1365
- name: errorCode,
1366
- $metadata: deserializeMetadata(output),
1367
- };
1368
- break;
1369
- case "InvalidRequestException":
1370
- case "com.amazonaws.cloudhsm#InvalidRequestException":
1371
- response = {
1372
- ...(await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)),
1373
- name: errorCode,
1374
- $metadata: deserializeMetadata(output),
1375
- };
1376
- break;
1377
- default:
1378
- const parsedBody = parsedOutput.body;
1379
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1380
- response = {
1381
- ...parsedBody,
1382
- name: `${errorCode}`,
1383
- message: parsedBody.message || parsedBody.Message || errorCode,
1384
- $fault: "client",
1385
- $metadata: deserializeMetadata(output),
1386
- } as any;
1387
- }
1388
- const message = response.message || response.Message || errorCode;
1389
- response.message = message;
1390
- delete response.Message;
1391
- return Promise.reject(Object.assign(new Error(message), response));
1392
- };
1393
-
1394
- export const deserializeAws_json1_1ListTagsForResourceCommand = async (
1395
- output: __HttpResponse,
1396
- context: __SerdeContext
1397
- ): Promise<ListTagsForResourceCommandOutput> => {
1398
- if (output.statusCode >= 300) {
1399
- return deserializeAws_json1_1ListTagsForResourceCommandError(output, context);
1400
- }
1401
- const data: any = await parseBody(output.body, context);
1402
- let contents: any = {};
1403
- contents = deserializeAws_json1_1ListTagsForResourceResponse(data, context);
1404
- const response: ListTagsForResourceCommandOutput = {
1405
- $metadata: deserializeMetadata(output),
1406
- ...contents,
1407
- };
1408
- return Promise.resolve(response);
1409
- };
1410
-
1411
- const deserializeAws_json1_1ListTagsForResourceCommandError = async (
1412
- output: __HttpResponse,
1413
- context: __SerdeContext
1414
- ): Promise<ListTagsForResourceCommandOutput> => {
1415
- const parsedOutput: any = {
1416
- ...output,
1417
- body: await parseBody(output.body, context),
1418
- };
1419
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1420
- let errorCode: string = "UnknownError";
1421
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1422
- switch (errorCode) {
1423
- case "CloudHsmInternalException":
1424
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
1425
- response = {
1426
- ...(await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)),
1427
- name: errorCode,
1428
- $metadata: deserializeMetadata(output),
1429
- };
1430
- break;
1431
- case "CloudHsmServiceException":
1432
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
1433
- response = {
1434
- ...(await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)),
1435
- name: errorCode,
1436
- $metadata: deserializeMetadata(output),
1437
- };
1438
- break;
1439
- case "InvalidRequestException":
1440
- case "com.amazonaws.cloudhsm#InvalidRequestException":
1441
- response = {
1442
- ...(await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)),
1443
- name: errorCode,
1444
- $metadata: deserializeMetadata(output),
1445
- };
1446
- break;
1447
- default:
1448
- const parsedBody = parsedOutput.body;
1449
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1450
- response = {
1451
- ...parsedBody,
1452
- name: `${errorCode}`,
1453
- message: parsedBody.message || parsedBody.Message || errorCode,
1454
- $fault: "client",
1455
- $metadata: deserializeMetadata(output),
1456
- } as any;
1457
- }
1458
- const message = response.message || response.Message || errorCode;
1459
- response.message = message;
1460
- delete response.Message;
1461
- return Promise.reject(Object.assign(new Error(message), response));
1462
- };
1463
-
1464
- export const deserializeAws_json1_1ModifyHapgCommand = async (
1465
- output: __HttpResponse,
1466
- context: __SerdeContext
1467
- ): Promise<ModifyHapgCommandOutput> => {
1468
- if (output.statusCode >= 300) {
1469
- return deserializeAws_json1_1ModifyHapgCommandError(output, context);
1470
- }
1471
- const data: any = await parseBody(output.body, context);
1472
- let contents: any = {};
1473
- contents = deserializeAws_json1_1ModifyHapgResponse(data, context);
1474
- const response: ModifyHapgCommandOutput = {
1475
- $metadata: deserializeMetadata(output),
1476
- ...contents,
1477
- };
1478
- return Promise.resolve(response);
1479
- };
1480
-
1481
- const deserializeAws_json1_1ModifyHapgCommandError = async (
1482
- output: __HttpResponse,
1483
- context: __SerdeContext
1484
- ): Promise<ModifyHapgCommandOutput> => {
1485
- const parsedOutput: any = {
1486
- ...output,
1487
- body: await parseBody(output.body, context),
1488
- };
1489
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1490
- let errorCode: string = "UnknownError";
1491
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1492
- switch (errorCode) {
1493
- case "CloudHsmInternalException":
1494
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
1495
- response = {
1496
- ...(await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)),
1497
- name: errorCode,
1498
- $metadata: deserializeMetadata(output),
1499
- };
1500
- break;
1501
- case "CloudHsmServiceException":
1502
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
1503
- response = {
1504
- ...(await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)),
1505
- name: errorCode,
1506
- $metadata: deserializeMetadata(output),
1507
- };
1508
- break;
1509
- case "InvalidRequestException":
1510
- case "com.amazonaws.cloudhsm#InvalidRequestException":
1511
- response = {
1512
- ...(await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)),
1513
- name: errorCode,
1514
- $metadata: deserializeMetadata(output),
1515
- };
1516
- break;
1517
- default:
1518
- const parsedBody = parsedOutput.body;
1519
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1520
- response = {
1521
- ...parsedBody,
1522
- name: `${errorCode}`,
1523
- message: parsedBody.message || parsedBody.Message || errorCode,
1524
- $fault: "client",
1525
- $metadata: deserializeMetadata(output),
1526
- } as any;
1527
- }
1528
- const message = response.message || response.Message || errorCode;
1529
- response.message = message;
1530
- delete response.Message;
1531
- return Promise.reject(Object.assign(new Error(message), response));
1532
- };
1533
-
1534
- export const deserializeAws_json1_1ModifyHsmCommand = async (
1535
- output: __HttpResponse,
1536
- context: __SerdeContext
1537
- ): Promise<ModifyHsmCommandOutput> => {
1538
- if (output.statusCode >= 300) {
1539
- return deserializeAws_json1_1ModifyHsmCommandError(output, context);
1540
- }
1541
- const data: any = await parseBody(output.body, context);
1542
- let contents: any = {};
1543
- contents = deserializeAws_json1_1ModifyHsmResponse(data, context);
1544
- const response: ModifyHsmCommandOutput = {
1545
- $metadata: deserializeMetadata(output),
1546
- ...contents,
1547
- };
1548
- return Promise.resolve(response);
1549
- };
1550
-
1551
- const deserializeAws_json1_1ModifyHsmCommandError = async (
1552
- output: __HttpResponse,
1553
- context: __SerdeContext
1554
- ): Promise<ModifyHsmCommandOutput> => {
1555
- const parsedOutput: any = {
1556
- ...output,
1557
- body: await parseBody(output.body, context),
1558
- };
1559
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1560
- let errorCode: string = "UnknownError";
1561
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1562
- switch (errorCode) {
1563
- case "CloudHsmInternalException":
1564
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
1565
- response = {
1566
- ...(await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)),
1567
- name: errorCode,
1568
- $metadata: deserializeMetadata(output),
1569
- };
1570
- break;
1571
- case "CloudHsmServiceException":
1572
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
1573
- response = {
1574
- ...(await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)),
1575
- name: errorCode,
1576
- $metadata: deserializeMetadata(output),
1577
- };
1578
- break;
1579
- case "InvalidRequestException":
1580
- case "com.amazonaws.cloudhsm#InvalidRequestException":
1581
- response = {
1582
- ...(await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)),
1583
- name: errorCode,
1584
- $metadata: deserializeMetadata(output),
1585
- };
1586
- break;
1587
- default:
1588
- const parsedBody = parsedOutput.body;
1589
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1590
- response = {
1591
- ...parsedBody,
1592
- name: `${errorCode}`,
1593
- message: parsedBody.message || parsedBody.Message || errorCode,
1594
- $fault: "client",
1595
- $metadata: deserializeMetadata(output),
1596
- } as any;
1597
- }
1598
- const message = response.message || response.Message || errorCode;
1599
- response.message = message;
1600
- delete response.Message;
1601
- return Promise.reject(Object.assign(new Error(message), response));
1602
- };
1603
-
1604
- export const deserializeAws_json1_1ModifyLunaClientCommand = async (
1605
- output: __HttpResponse,
1606
- context: __SerdeContext
1607
- ): Promise<ModifyLunaClientCommandOutput> => {
1608
- if (output.statusCode >= 300) {
1609
- return deserializeAws_json1_1ModifyLunaClientCommandError(output, context);
1610
- }
1611
- const data: any = await parseBody(output.body, context);
1612
- let contents: any = {};
1613
- contents = deserializeAws_json1_1ModifyLunaClientResponse(data, context);
1614
- const response: ModifyLunaClientCommandOutput = {
1615
- $metadata: deserializeMetadata(output),
1616
- ...contents,
1617
- };
1618
- return Promise.resolve(response);
1619
- };
1620
-
1621
- const deserializeAws_json1_1ModifyLunaClientCommandError = async (
1622
- output: __HttpResponse,
1623
- context: __SerdeContext
1624
- ): Promise<ModifyLunaClientCommandOutput> => {
1625
- const parsedOutput: any = {
1626
- ...output,
1627
- body: await parseBody(output.body, context),
1628
- };
1629
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1630
- let errorCode: string = "UnknownError";
1631
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1632
- switch (errorCode) {
1633
- case "CloudHsmServiceException":
1634
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
1635
- response = {
1636
- ...(await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)),
1637
- name: errorCode,
1638
- $metadata: deserializeMetadata(output),
1639
- };
1640
- break;
1641
- default:
1642
- const parsedBody = parsedOutput.body;
1643
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1644
- response = {
1645
- ...parsedBody,
1646
- name: `${errorCode}`,
1647
- message: parsedBody.message || parsedBody.Message || errorCode,
1648
- $fault: "client",
1649
- $metadata: deserializeMetadata(output),
1650
- } as any;
1651
- }
1652
- const message = response.message || response.Message || errorCode;
1653
- response.message = message;
1654
- delete response.Message;
1655
- return Promise.reject(Object.assign(new Error(message), response));
1656
- };
1657
-
1658
- export const deserializeAws_json1_1RemoveTagsFromResourceCommand = async (
1659
- output: __HttpResponse,
1660
- context: __SerdeContext
1661
- ): Promise<RemoveTagsFromResourceCommandOutput> => {
1662
- if (output.statusCode >= 300) {
1663
- return deserializeAws_json1_1RemoveTagsFromResourceCommandError(output, context);
1664
- }
1665
- const data: any = await parseBody(output.body, context);
1666
- let contents: any = {};
1667
- contents = deserializeAws_json1_1RemoveTagsFromResourceResponse(data, context);
1668
- const response: RemoveTagsFromResourceCommandOutput = {
1669
- $metadata: deserializeMetadata(output),
1670
- ...contents,
1671
- };
1672
- return Promise.resolve(response);
1673
- };
1674
-
1675
- const deserializeAws_json1_1RemoveTagsFromResourceCommandError = async (
1676
- output: __HttpResponse,
1677
- context: __SerdeContext
1678
- ): Promise<RemoveTagsFromResourceCommandOutput> => {
1679
- const parsedOutput: any = {
1680
- ...output,
1681
- body: await parseBody(output.body, context),
1682
- };
1683
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1684
- let errorCode: string = "UnknownError";
1685
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1686
- switch (errorCode) {
1687
- case "CloudHsmInternalException":
1688
- case "com.amazonaws.cloudhsm#CloudHsmInternalException":
1689
- response = {
1690
- ...(await deserializeAws_json1_1CloudHsmInternalExceptionResponse(parsedOutput, context)),
1691
- name: errorCode,
1692
- $metadata: deserializeMetadata(output),
1693
- };
1694
- break;
1695
- case "CloudHsmServiceException":
1696
- case "com.amazonaws.cloudhsm#CloudHsmServiceException":
1697
- response = {
1698
- ...(await deserializeAws_json1_1CloudHsmServiceExceptionResponse(parsedOutput, context)),
1699
- name: errorCode,
1700
- $metadata: deserializeMetadata(output),
1701
- };
1702
- break;
1703
- case "InvalidRequestException":
1704
- case "com.amazonaws.cloudhsm#InvalidRequestException":
1705
- response = {
1706
- ...(await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)),
1707
- name: errorCode,
1708
- $metadata: deserializeMetadata(output),
1709
- };
1710
- break;
1711
- default:
1712
- const parsedBody = parsedOutput.body;
1713
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1714
- response = {
1715
- ...parsedBody,
1716
- name: `${errorCode}`,
1717
- message: parsedBody.message || parsedBody.Message || errorCode,
1718
- $fault: "client",
1719
- $metadata: deserializeMetadata(output),
1720
- } as any;
1721
- }
1722
- const message = response.message || response.Message || errorCode;
1723
- response.message = message;
1724
- delete response.Message;
1725
- return Promise.reject(Object.assign(new Error(message), response));
1726
- };
1727
-
1728
- const deserializeAws_json1_1CloudHsmInternalExceptionResponse = async (
1729
- parsedOutput: any,
1730
- context: __SerdeContext
1731
- ): Promise<CloudHsmInternalException> => {
1732
- const body = parsedOutput.body;
1733
- const deserialized: any = deserializeAws_json1_1CloudHsmInternalException(body, context);
1734
- const contents: CloudHsmInternalException = {
1735
- name: "CloudHsmInternalException",
1736
- $fault: "server",
1737
- $metadata: deserializeMetadata(parsedOutput),
1738
- ...deserialized,
1739
- };
1740
- return contents;
1741
- };
1742
-
1743
- const deserializeAws_json1_1CloudHsmServiceExceptionResponse = async (
1744
- parsedOutput: any,
1745
- context: __SerdeContext
1746
- ): Promise<CloudHsmServiceException> => {
1747
- const body = parsedOutput.body;
1748
- const deserialized: any = deserializeAws_json1_1CloudHsmServiceException(body, context);
1749
- const contents: CloudHsmServiceException = {
1750
- name: "CloudHsmServiceException",
1751
- $fault: "client",
1752
- $metadata: deserializeMetadata(parsedOutput),
1753
- ...deserialized,
1754
- };
1755
- return contents;
1756
- };
1757
-
1758
- const deserializeAws_json1_1InvalidRequestExceptionResponse = async (
1759
- parsedOutput: any,
1760
- context: __SerdeContext
1761
- ): Promise<InvalidRequestException> => {
1762
- const body = parsedOutput.body;
1763
- const deserialized: any = deserializeAws_json1_1InvalidRequestException(body, context);
1764
- const contents: InvalidRequestException = {
1765
- name: "InvalidRequestException",
1766
- $fault: "client",
1767
- $metadata: deserializeMetadata(parsedOutput),
1768
- ...deserialized,
1769
- };
1770
- return contents;
1771
- };
1772
-
1773
- const serializeAws_json1_1AddTagsToResourceRequest = (
1774
- input: AddTagsToResourceRequest,
1775
- context: __SerdeContext
1776
- ): any => {
1777
- return {
1778
- ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }),
1779
- ...(input.TagList !== undefined &&
1780
- input.TagList !== null && { TagList: serializeAws_json1_1TagList(input.TagList, context) }),
1781
- };
1782
- };
1783
-
1784
- const serializeAws_json1_1CreateHapgRequest = (input: CreateHapgRequest, context: __SerdeContext): any => {
1785
- return {
1786
- ...(input.Label !== undefined && input.Label !== null && { Label: input.Label }),
1787
- };
1788
- };
1789
-
1790
- const serializeAws_json1_1CreateHsmRequest = (input: CreateHsmRequest, context: __SerdeContext): any => {
1791
- return {
1792
- ...(input.ClientToken !== undefined && input.ClientToken !== null && { ClientToken: input.ClientToken }),
1793
- ...(input.EniIp !== undefined && input.EniIp !== null && { EniIp: input.EniIp }),
1794
- ...(input.ExternalId !== undefined && input.ExternalId !== null && { ExternalId: input.ExternalId }),
1795
- ...(input.IamRoleArn !== undefined && input.IamRoleArn !== null && { IamRoleArn: input.IamRoleArn }),
1796
- ...(input.SshKey !== undefined && input.SshKey !== null && { SshKey: input.SshKey }),
1797
- ...(input.SubnetId !== undefined && input.SubnetId !== null && { SubnetId: input.SubnetId }),
1798
- ...(input.SubscriptionType !== undefined &&
1799
- input.SubscriptionType !== null && { SubscriptionType: input.SubscriptionType }),
1800
- ...(input.SyslogIp !== undefined && input.SyslogIp !== null && { SyslogIp: input.SyslogIp }),
1801
- };
1802
- };
1803
-
1804
- const serializeAws_json1_1CreateLunaClientRequest = (input: CreateLunaClientRequest, context: __SerdeContext): any => {
1805
- return {
1806
- ...(input.Certificate !== undefined && input.Certificate !== null && { Certificate: input.Certificate }),
1807
- ...(input.Label !== undefined && input.Label !== null && { Label: input.Label }),
1808
- };
1809
- };
1810
-
1811
- const serializeAws_json1_1DeleteHapgRequest = (input: DeleteHapgRequest, context: __SerdeContext): any => {
1812
- return {
1813
- ...(input.HapgArn !== undefined && input.HapgArn !== null && { HapgArn: input.HapgArn }),
1814
- };
1815
- };
1816
-
1817
- const serializeAws_json1_1DeleteHsmRequest = (input: DeleteHsmRequest, context: __SerdeContext): any => {
1818
- return {
1819
- ...(input.HsmArn !== undefined && input.HsmArn !== null && { HsmArn: input.HsmArn }),
1820
- };
1821
- };
1822
-
1823
- const serializeAws_json1_1DeleteLunaClientRequest = (input: DeleteLunaClientRequest, context: __SerdeContext): any => {
1824
- return {
1825
- ...(input.ClientArn !== undefined && input.ClientArn !== null && { ClientArn: input.ClientArn }),
1826
- };
1827
- };
1828
-
1829
- const serializeAws_json1_1DescribeHapgRequest = (input: DescribeHapgRequest, context: __SerdeContext): any => {
1830
- return {
1831
- ...(input.HapgArn !== undefined && input.HapgArn !== null && { HapgArn: input.HapgArn }),
1832
- };
1833
- };
1834
-
1835
- const serializeAws_json1_1DescribeHsmRequest = (input: DescribeHsmRequest, context: __SerdeContext): any => {
1836
- return {
1837
- ...(input.HsmArn !== undefined && input.HsmArn !== null && { HsmArn: input.HsmArn }),
1838
- ...(input.HsmSerialNumber !== undefined &&
1839
- input.HsmSerialNumber !== null && { HsmSerialNumber: input.HsmSerialNumber }),
1840
- };
1841
- };
1842
-
1843
- const serializeAws_json1_1DescribeLunaClientRequest = (
1844
- input: DescribeLunaClientRequest,
1845
- context: __SerdeContext
1846
- ): any => {
1847
- return {
1848
- ...(input.CertificateFingerprint !== undefined &&
1849
- input.CertificateFingerprint !== null && { CertificateFingerprint: input.CertificateFingerprint }),
1850
- ...(input.ClientArn !== undefined && input.ClientArn !== null && { ClientArn: input.ClientArn }),
1851
- };
1852
- };
1853
-
1854
- const serializeAws_json1_1GetConfigRequest = (input: GetConfigRequest, context: __SerdeContext): any => {
1855
- return {
1856
- ...(input.ClientArn !== undefined && input.ClientArn !== null && { ClientArn: input.ClientArn }),
1857
- ...(input.ClientVersion !== undefined && input.ClientVersion !== null && { ClientVersion: input.ClientVersion }),
1858
- ...(input.HapgList !== undefined &&
1859
- input.HapgList !== null && { HapgList: serializeAws_json1_1HapgList(input.HapgList, context) }),
1860
- };
1861
- };
1862
-
1863
- const serializeAws_json1_1HapgList = (input: string[], context: __SerdeContext): any => {
1864
- return input
1865
- .filter((e: any) => e != null)
1866
- .map((entry) => {
1867
- if (entry === null) {
1868
- return null as any;
1869
- }
1870
- return entry;
1871
- });
1872
- };
1873
-
1874
- const serializeAws_json1_1ListAvailableZonesRequest = (
1875
- input: ListAvailableZonesRequest,
1876
- context: __SerdeContext
1877
- ): any => {
1878
- return {};
1879
- };
1880
-
1881
- const serializeAws_json1_1ListHapgsRequest = (input: ListHapgsRequest, context: __SerdeContext): any => {
1882
- return {
1883
- ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),
1884
- };
1885
- };
1886
-
1887
- const serializeAws_json1_1ListHsmsRequest = (input: ListHsmsRequest, context: __SerdeContext): any => {
1888
- return {
1889
- ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),
1890
- };
1891
- };
1892
-
1893
- const serializeAws_json1_1ListLunaClientsRequest = (input: ListLunaClientsRequest, context: __SerdeContext): any => {
1894
- return {
1895
- ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),
1896
- };
1897
- };
1898
-
1899
- const serializeAws_json1_1ListTagsForResourceRequest = (
1900
- input: ListTagsForResourceRequest,
1901
- context: __SerdeContext
1902
- ): any => {
1903
- return {
1904
- ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }),
1905
- };
1906
- };
1907
-
1908
- const serializeAws_json1_1ModifyHapgRequest = (input: ModifyHapgRequest, context: __SerdeContext): any => {
1909
- return {
1910
- ...(input.HapgArn !== undefined && input.HapgArn !== null && { HapgArn: input.HapgArn }),
1911
- ...(input.Label !== undefined && input.Label !== null && { Label: input.Label }),
1912
- ...(input.PartitionSerialList !== undefined &&
1913
- input.PartitionSerialList !== null && {
1914
- PartitionSerialList: serializeAws_json1_1PartitionSerialList(input.PartitionSerialList, context),
1915
- }),
1916
- };
1917
- };
1918
-
1919
- const serializeAws_json1_1ModifyHsmRequest = (input: ModifyHsmRequest, context: __SerdeContext): any => {
1920
- return {
1921
- ...(input.EniIp !== undefined && input.EniIp !== null && { EniIp: input.EniIp }),
1922
- ...(input.ExternalId !== undefined && input.ExternalId !== null && { ExternalId: input.ExternalId }),
1923
- ...(input.HsmArn !== undefined && input.HsmArn !== null && { HsmArn: input.HsmArn }),
1924
- ...(input.IamRoleArn !== undefined && input.IamRoleArn !== null && { IamRoleArn: input.IamRoleArn }),
1925
- ...(input.SubnetId !== undefined && input.SubnetId !== null && { SubnetId: input.SubnetId }),
1926
- ...(input.SyslogIp !== undefined && input.SyslogIp !== null && { SyslogIp: input.SyslogIp }),
1927
- };
1928
- };
1929
-
1930
- const serializeAws_json1_1ModifyLunaClientRequest = (input: ModifyLunaClientRequest, context: __SerdeContext): any => {
1931
- return {
1932
- ...(input.Certificate !== undefined && input.Certificate !== null && { Certificate: input.Certificate }),
1933
- ...(input.ClientArn !== undefined && input.ClientArn !== null && { ClientArn: input.ClientArn }),
1934
- };
1935
- };
1936
-
1937
- const serializeAws_json1_1PartitionSerialList = (input: string[], context: __SerdeContext): any => {
1938
- return input
1939
- .filter((e: any) => e != null)
1940
- .map((entry) => {
1941
- if (entry === null) {
1942
- return null as any;
1943
- }
1944
- return entry;
1945
- });
1946
- };
1947
-
1948
- const serializeAws_json1_1RemoveTagsFromResourceRequest = (
1949
- input: RemoveTagsFromResourceRequest,
1950
- context: __SerdeContext
1951
- ): any => {
1952
- return {
1953
- ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }),
1954
- ...(input.TagKeyList !== undefined &&
1955
- input.TagKeyList !== null && { TagKeyList: serializeAws_json1_1TagKeyList(input.TagKeyList, context) }),
1956
- };
1957
- };
1958
-
1959
- const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => {
1960
- return {
1961
- ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }),
1962
- ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }),
1963
- };
1964
- };
1965
-
1966
- const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => {
1967
- return input
1968
- .filter((e: any) => e != null)
1969
- .map((entry) => {
1970
- if (entry === null) {
1971
- return null as any;
1972
- }
1973
- return entry;
1974
- });
1975
- };
1976
-
1977
- const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => {
1978
- return input
1979
- .filter((e: any) => e != null)
1980
- .map((entry) => {
1981
- if (entry === null) {
1982
- return null as any;
1983
- }
1984
- return serializeAws_json1_1Tag(entry, context);
1985
- });
1986
- };
1987
-
1988
- const deserializeAws_json1_1AddTagsToResourceResponse = (
1989
- output: any,
1990
- context: __SerdeContext
1991
- ): AddTagsToResourceResponse => {
1992
- return {
1993
- Status: __expectString(output.Status),
1994
- } as any;
1995
- };
1996
-
1997
- const deserializeAws_json1_1AZList = (output: any, context: __SerdeContext): string[] => {
1998
- return (output || [])
1999
- .filter((e: any) => e != null)
2000
- .map((entry: any) => {
2001
- if (entry === null) {
2002
- return null as any;
2003
- }
2004
- return __expectString(entry) as any;
2005
- });
2006
- };
2007
-
2008
- const deserializeAws_json1_1ClientList = (output: any, context: __SerdeContext): string[] => {
2009
- return (output || [])
2010
- .filter((e: any) => e != null)
2011
- .map((entry: any) => {
2012
- if (entry === null) {
2013
- return null as any;
2014
- }
2015
- return __expectString(entry) as any;
2016
- });
2017
- };
2018
-
2019
- const deserializeAws_json1_1CloudHsmInternalException = (
2020
- output: any,
2021
- context: __SerdeContext
2022
- ): CloudHsmInternalException => {
2023
- return {
2024
- message: __expectString(output.message),
2025
- retryable: __expectBoolean(output.retryable),
2026
- } as any;
2027
- };
2028
-
2029
- const deserializeAws_json1_1CloudHsmServiceException = (
2030
- output: any,
2031
- context: __SerdeContext
2032
- ): CloudHsmServiceException => {
2033
- return {
2034
- message: __expectString(output.message),
2035
- retryable: __expectBoolean(output.retryable),
2036
- } as any;
2037
- };
2038
-
2039
- const deserializeAws_json1_1CreateHapgResponse = (output: any, context: __SerdeContext): CreateHapgResponse => {
2040
- return {
2041
- HapgArn: __expectString(output.HapgArn),
2042
- } as any;
2043
- };
2044
-
2045
- const deserializeAws_json1_1CreateHsmResponse = (output: any, context: __SerdeContext): CreateHsmResponse => {
2046
- return {
2047
- HsmArn: __expectString(output.HsmArn),
2048
- } as any;
2049
- };
2050
-
2051
- const deserializeAws_json1_1CreateLunaClientResponse = (
2052
- output: any,
2053
- context: __SerdeContext
2054
- ): CreateLunaClientResponse => {
2055
- return {
2056
- ClientArn: __expectString(output.ClientArn),
2057
- } as any;
2058
- };
2059
-
2060
- const deserializeAws_json1_1DeleteHapgResponse = (output: any, context: __SerdeContext): DeleteHapgResponse => {
2061
- return {
2062
- Status: __expectString(output.Status),
2063
- } as any;
2064
- };
2065
-
2066
- const deserializeAws_json1_1DeleteHsmResponse = (output: any, context: __SerdeContext): DeleteHsmResponse => {
2067
- return {
2068
- Status: __expectString(output.Status),
2069
- } as any;
2070
- };
2071
-
2072
- const deserializeAws_json1_1DeleteLunaClientResponse = (
2073
- output: any,
2074
- context: __SerdeContext
2075
- ): DeleteLunaClientResponse => {
2076
- return {
2077
- Status: __expectString(output.Status),
2078
- } as any;
2079
- };
2080
-
2081
- const deserializeAws_json1_1DescribeHapgResponse = (output: any, context: __SerdeContext): DescribeHapgResponse => {
2082
- return {
2083
- HapgArn: __expectString(output.HapgArn),
2084
- HapgSerial: __expectString(output.HapgSerial),
2085
- HsmsLastActionFailed:
2086
- output.HsmsLastActionFailed !== undefined && output.HsmsLastActionFailed !== null
2087
- ? deserializeAws_json1_1HsmList(output.HsmsLastActionFailed, context)
2088
- : undefined,
2089
- HsmsPendingDeletion:
2090
- output.HsmsPendingDeletion !== undefined && output.HsmsPendingDeletion !== null
2091
- ? deserializeAws_json1_1HsmList(output.HsmsPendingDeletion, context)
2092
- : undefined,
2093
- HsmsPendingRegistration:
2094
- output.HsmsPendingRegistration !== undefined && output.HsmsPendingRegistration !== null
2095
- ? deserializeAws_json1_1HsmList(output.HsmsPendingRegistration, context)
2096
- : undefined,
2097
- Label: __expectString(output.Label),
2098
- LastModifiedTimestamp: __expectString(output.LastModifiedTimestamp),
2099
- PartitionSerialList:
2100
- output.PartitionSerialList !== undefined && output.PartitionSerialList !== null
2101
- ? deserializeAws_json1_1PartitionSerialList(output.PartitionSerialList, context)
2102
- : undefined,
2103
- State: __expectString(output.State),
2104
- } as any;
2105
- };
2106
-
2107
- const deserializeAws_json1_1DescribeHsmResponse = (output: any, context: __SerdeContext): DescribeHsmResponse => {
2108
- return {
2109
- AvailabilityZone: __expectString(output.AvailabilityZone),
2110
- EniId: __expectString(output.EniId),
2111
- EniIp: __expectString(output.EniIp),
2112
- HsmArn: __expectString(output.HsmArn),
2113
- HsmType: __expectString(output.HsmType),
2114
- IamRoleArn: __expectString(output.IamRoleArn),
2115
- Partitions:
2116
- output.Partitions !== undefined && output.Partitions !== null
2117
- ? deserializeAws_json1_1PartitionList(output.Partitions, context)
2118
- : undefined,
2119
- SerialNumber: __expectString(output.SerialNumber),
2120
- ServerCertLastUpdated: __expectString(output.ServerCertLastUpdated),
2121
- ServerCertUri: __expectString(output.ServerCertUri),
2122
- SoftwareVersion: __expectString(output.SoftwareVersion),
2123
- SshKeyLastUpdated: __expectString(output.SshKeyLastUpdated),
2124
- SshPublicKey: __expectString(output.SshPublicKey),
2125
- Status: __expectString(output.Status),
2126
- StatusDetails: __expectString(output.StatusDetails),
2127
- SubnetId: __expectString(output.SubnetId),
2128
- SubscriptionEndDate: __expectString(output.SubscriptionEndDate),
2129
- SubscriptionStartDate: __expectString(output.SubscriptionStartDate),
2130
- SubscriptionType: __expectString(output.SubscriptionType),
2131
- VendorName: __expectString(output.VendorName),
2132
- VpcId: __expectString(output.VpcId),
2133
- } as any;
2134
- };
2135
-
2136
- const deserializeAws_json1_1DescribeLunaClientResponse = (
2137
- output: any,
2138
- context: __SerdeContext
2139
- ): DescribeLunaClientResponse => {
2140
- return {
2141
- Certificate: __expectString(output.Certificate),
2142
- CertificateFingerprint: __expectString(output.CertificateFingerprint),
2143
- ClientArn: __expectString(output.ClientArn),
2144
- Label: __expectString(output.Label),
2145
- LastModifiedTimestamp: __expectString(output.LastModifiedTimestamp),
2146
- } as any;
2147
- };
2148
-
2149
- const deserializeAws_json1_1GetConfigResponse = (output: any, context: __SerdeContext): GetConfigResponse => {
2150
- return {
2151
- ConfigCred: __expectString(output.ConfigCred),
2152
- ConfigFile: __expectString(output.ConfigFile),
2153
- ConfigType: __expectString(output.ConfigType),
2154
- } as any;
2155
- };
2156
-
2157
- const deserializeAws_json1_1HapgList = (output: any, context: __SerdeContext): string[] => {
2158
- return (output || [])
2159
- .filter((e: any) => e != null)
2160
- .map((entry: any) => {
2161
- if (entry === null) {
2162
- return null as any;
2163
- }
2164
- return __expectString(entry) as any;
2165
- });
2166
- };
2167
-
2168
- const deserializeAws_json1_1HsmList = (output: any, context: __SerdeContext): string[] => {
2169
- return (output || [])
2170
- .filter((e: any) => e != null)
2171
- .map((entry: any) => {
2172
- if (entry === null) {
2173
- return null as any;
2174
- }
2175
- return __expectString(entry) as any;
2176
- });
2177
- };
2178
-
2179
- const deserializeAws_json1_1InvalidRequestException = (
2180
- output: any,
2181
- context: __SerdeContext
2182
- ): InvalidRequestException => {
2183
- return {
2184
- message: __expectString(output.message),
2185
- retryable: __expectBoolean(output.retryable),
2186
- } as any;
2187
- };
2188
-
2189
- const deserializeAws_json1_1ListAvailableZonesResponse = (
2190
- output: any,
2191
- context: __SerdeContext
2192
- ): ListAvailableZonesResponse => {
2193
- return {
2194
- AZList:
2195
- output.AZList !== undefined && output.AZList !== null
2196
- ? deserializeAws_json1_1AZList(output.AZList, context)
2197
- : undefined,
2198
- } as any;
2199
- };
2200
-
2201
- const deserializeAws_json1_1ListHapgsResponse = (output: any, context: __SerdeContext): ListHapgsResponse => {
2202
- return {
2203
- HapgList:
2204
- output.HapgList !== undefined && output.HapgList !== null
2205
- ? deserializeAws_json1_1HapgList(output.HapgList, context)
2206
- : undefined,
2207
- NextToken: __expectString(output.NextToken),
2208
- } as any;
2209
- };
2210
-
2211
- const deserializeAws_json1_1ListHsmsResponse = (output: any, context: __SerdeContext): ListHsmsResponse => {
2212
- return {
2213
- HsmList:
2214
- output.HsmList !== undefined && output.HsmList !== null
2215
- ? deserializeAws_json1_1HsmList(output.HsmList, context)
2216
- : undefined,
2217
- NextToken: __expectString(output.NextToken),
2218
- } as any;
2219
- };
2220
-
2221
- const deserializeAws_json1_1ListLunaClientsResponse = (
2222
- output: any,
2223
- context: __SerdeContext
2224
- ): ListLunaClientsResponse => {
2225
- return {
2226
- ClientList:
2227
- output.ClientList !== undefined && output.ClientList !== null
2228
- ? deserializeAws_json1_1ClientList(output.ClientList, context)
2229
- : undefined,
2230
- NextToken: __expectString(output.NextToken),
2231
- } as any;
2232
- };
2233
-
2234
- const deserializeAws_json1_1ListTagsForResourceResponse = (
2235
- output: any,
2236
- context: __SerdeContext
2237
- ): ListTagsForResourceResponse => {
2238
- return {
2239
- TagList:
2240
- output.TagList !== undefined && output.TagList !== null
2241
- ? deserializeAws_json1_1TagList(output.TagList, context)
2242
- : undefined,
2243
- } as any;
2244
- };
2245
-
2246
- const deserializeAws_json1_1ModifyHapgResponse = (output: any, context: __SerdeContext): ModifyHapgResponse => {
2247
- return {
2248
- HapgArn: __expectString(output.HapgArn),
2249
- } as any;
2250
- };
2251
-
2252
- const deserializeAws_json1_1ModifyHsmResponse = (output: any, context: __SerdeContext): ModifyHsmResponse => {
2253
- return {
2254
- HsmArn: __expectString(output.HsmArn),
2255
- } as any;
2256
- };
2257
-
2258
- const deserializeAws_json1_1ModifyLunaClientResponse = (
2259
- output: any,
2260
- context: __SerdeContext
2261
- ): ModifyLunaClientResponse => {
2262
- return {
2263
- ClientArn: __expectString(output.ClientArn),
2264
- } as any;
2265
- };
2266
-
2267
- const deserializeAws_json1_1PartitionList = (output: any, context: __SerdeContext): string[] => {
2268
- return (output || [])
2269
- .filter((e: any) => e != null)
2270
- .map((entry: any) => {
2271
- if (entry === null) {
2272
- return null as any;
2273
- }
2274
- return __expectString(entry) as any;
2275
- });
2276
- };
2277
-
2278
- const deserializeAws_json1_1PartitionSerialList = (output: any, context: __SerdeContext): string[] => {
2279
- return (output || [])
2280
- .filter((e: any) => e != null)
2281
- .map((entry: any) => {
2282
- if (entry === null) {
2283
- return null as any;
2284
- }
2285
- return __expectString(entry) as any;
2286
- });
2287
- };
2288
-
2289
- const deserializeAws_json1_1RemoveTagsFromResourceResponse = (
2290
- output: any,
2291
- context: __SerdeContext
2292
- ): RemoveTagsFromResourceResponse => {
2293
- return {
2294
- Status: __expectString(output.Status),
2295
- } as any;
2296
- };
2297
-
2298
- const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => {
2299
- return {
2300
- Key: __expectString(output.Key),
2301
- Value: __expectString(output.Value),
2302
- } as any;
2303
- };
2304
-
2305
- const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => {
2306
- return (output || [])
2307
- .filter((e: any) => e != null)
2308
- .map((entry: any) => {
2309
- if (entry === null) {
2310
- return null as any;
2311
- }
2312
- return deserializeAws_json1_1Tag(entry, context);
2313
- });
2314
- };
2315
-
2316
- const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
2317
- httpStatusCode: output.statusCode,
2318
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
2319
- extendedRequestId: output.headers["x-amz-id-2"],
2320
- cfId: output.headers["x-amz-cf-id"],
2321
- });
2322
-
2323
- // Collect low-level response body stream to Uint8Array.
2324
- const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
2325
- if (streamBody instanceof Uint8Array) {
2326
- return Promise.resolve(streamBody);
2327
- }
2328
- return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
2329
- };
2330
-
2331
- // Encode Uint8Array data into string with utf-8.
2332
- const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
2333
- collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
2334
-
2335
- const buildHttpRpcRequest = async (
2336
- context: __SerdeContext,
2337
- headers: __HeaderBag,
2338
- path: string,
2339
- resolvedHostname: string | undefined,
2340
- body: any
2341
- ): Promise<__HttpRequest> => {
2342
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
2343
- const contents: any = {
2344
- protocol,
2345
- hostname,
2346
- port,
2347
- method: "POST",
2348
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
2349
- headers,
2350
- };
2351
- if (resolvedHostname !== undefined) {
2352
- contents.hostname = resolvedHostname;
2353
- }
2354
- if (body !== undefined) {
2355
- contents.body = body;
2356
- }
2357
- return new __HttpRequest(contents);
2358
- };
2359
-
2360
- const parseBody = (streamBody: any, context: __SerdeContext): any =>
2361
- collectBodyString(streamBody, context).then((encoded) => {
2362
- if (encoded.length) {
2363
- return JSON.parse(encoded);
2364
- }
2365
- return {};
2366
- });
2367
-
2368
- /**
2369
- * Load an error code for the aws.rest-json-1.1 protocol.
2370
- */
2371
- const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => {
2372
- const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
2373
-
2374
- const sanitizeErrorCode = (rawValue: string): string => {
2375
- let cleanValue = rawValue;
2376
- if (cleanValue.indexOf(":") >= 0) {
2377
- cleanValue = cleanValue.split(":")[0];
2378
- }
2379
- if (cleanValue.indexOf("#") >= 0) {
2380
- cleanValue = cleanValue.split("#")[1];
2381
- }
2382
- return cleanValue;
2383
- };
2384
-
2385
- const headerKey = findKey(output.headers, "x-amzn-errortype");
2386
- if (headerKey !== undefined) {
2387
- return sanitizeErrorCode(output.headers[headerKey]);
2388
- }
2389
-
2390
- if (data.code !== undefined) {
2391
- return sanitizeErrorCode(data.code);
2392
- }
2393
-
2394
- if (data["__type"] !== undefined) {
2395
- return sanitizeErrorCode(data["__type"]);
2396
- }
2397
-
2398
- return "";
2399
- };