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