@aws-sdk/client-snowball 3.489.0 → 3.495.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist-cjs/Snowball.js +1 -65
  2. package/dist-cjs/SnowballClient.js +1 -43
  3. package/dist-cjs/commands/CancelClusterCommand.js +1 -28
  4. package/dist-cjs/commands/CancelJobCommand.js +1 -28
  5. package/dist-cjs/commands/CreateAddressCommand.js +1 -28
  6. package/dist-cjs/commands/CreateClusterCommand.js +1 -28
  7. package/dist-cjs/commands/CreateJobCommand.js +1 -29
  8. package/dist-cjs/commands/CreateLongTermPricingCommand.js +1 -28
  9. package/dist-cjs/commands/CreateReturnShippingLabelCommand.js +1 -28
  10. package/dist-cjs/commands/DescribeAddressCommand.js +1 -28
  11. package/dist-cjs/commands/DescribeAddressesCommand.js +1 -28
  12. package/dist-cjs/commands/DescribeClusterCommand.js +1 -28
  13. package/dist-cjs/commands/DescribeJobCommand.js +1 -29
  14. package/dist-cjs/commands/DescribeReturnShippingLabelCommand.js +1 -28
  15. package/dist-cjs/commands/GetJobManifestCommand.js +1 -28
  16. package/dist-cjs/commands/GetJobUnlockCodeCommand.js +1 -28
  17. package/dist-cjs/commands/GetSnowballUsageCommand.js +1 -28
  18. package/dist-cjs/commands/GetSoftwareUpdatesCommand.js +1 -28
  19. package/dist-cjs/commands/ListClusterJobsCommand.js +1 -28
  20. package/dist-cjs/commands/ListClustersCommand.js +1 -28
  21. package/dist-cjs/commands/ListCompatibleImagesCommand.js +1 -28
  22. package/dist-cjs/commands/ListJobsCommand.js +1 -28
  23. package/dist-cjs/commands/ListLongTermPricingCommand.js +1 -28
  24. package/dist-cjs/commands/ListPickupLocationsCommand.js +1 -28
  25. package/dist-cjs/commands/ListServiceVersionsCommand.js +1 -28
  26. package/dist-cjs/commands/UpdateClusterCommand.js +1 -28
  27. package/dist-cjs/commands/UpdateJobCommand.js +1 -29
  28. package/dist-cjs/commands/UpdateJobShipmentStateCommand.js +1 -28
  29. package/dist-cjs/commands/UpdateLongTermPricingCommand.js +1 -28
  30. package/dist-cjs/commands/index.js +1 -30
  31. package/dist-cjs/endpoint/EndpointParameters.js +1 -18
  32. package/dist-cjs/extensionConfiguration.js +1 -2
  33. package/dist-cjs/index.js +2714 -11
  34. package/dist-cjs/models/SnowballServiceException.js +1 -12
  35. package/dist-cjs/models/index.js +1 -4
  36. package/dist-cjs/models/models_0.js +1 -293
  37. package/dist-cjs/pagination/DescribeAddressesPaginator.js +1 -7
  38. package/dist-cjs/pagination/Interfaces.js +1 -2
  39. package/dist-cjs/pagination/ListClusterJobsPaginator.js +1 -7
  40. package/dist-cjs/pagination/ListClustersPaginator.js +1 -7
  41. package/dist-cjs/pagination/ListCompatibleImagesPaginator.js +1 -7
  42. package/dist-cjs/pagination/ListJobsPaginator.js +1 -7
  43. package/dist-cjs/pagination/ListLongTermPricingPaginator.js +1 -7
  44. package/dist-cjs/pagination/ListPickupLocationsPaginator.js +1 -7
  45. package/dist-cjs/pagination/index.js +1 -11
  46. package/dist-cjs/protocols/Aws_json1_1.js +1 -1648
  47. package/dist-cjs/runtimeExtensions.js +1 -22
  48. package/package.json +40 -40
@@ -1,1648 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_ListServiceVersionsCommand = exports.de_ListPickupLocationsCommand = exports.de_ListLongTermPricingCommand = exports.de_ListJobsCommand = exports.de_ListCompatibleImagesCommand = exports.de_ListClustersCommand = exports.de_ListClusterJobsCommand = exports.de_GetSoftwareUpdatesCommand = exports.de_GetSnowballUsageCommand = exports.de_GetJobUnlockCodeCommand = exports.de_GetJobManifestCommand = exports.de_DescribeReturnShippingLabelCommand = exports.de_DescribeJobCommand = exports.de_DescribeClusterCommand = exports.de_DescribeAddressesCommand = exports.de_DescribeAddressCommand = exports.de_CreateReturnShippingLabelCommand = exports.de_CreateLongTermPricingCommand = exports.de_CreateJobCommand = exports.de_CreateClusterCommand = exports.de_CreateAddressCommand = exports.de_CancelJobCommand = exports.de_CancelClusterCommand = exports.se_UpdateLongTermPricingCommand = exports.se_UpdateJobShipmentStateCommand = exports.se_UpdateJobCommand = exports.se_UpdateClusterCommand = exports.se_ListServiceVersionsCommand = exports.se_ListPickupLocationsCommand = exports.se_ListLongTermPricingCommand = exports.se_ListJobsCommand = exports.se_ListCompatibleImagesCommand = exports.se_ListClustersCommand = exports.se_ListClusterJobsCommand = exports.se_GetSoftwareUpdatesCommand = exports.se_GetSnowballUsageCommand = exports.se_GetJobUnlockCodeCommand = exports.se_GetJobManifestCommand = exports.se_DescribeReturnShippingLabelCommand = exports.se_DescribeJobCommand = exports.se_DescribeClusterCommand = exports.se_DescribeAddressesCommand = exports.se_DescribeAddressCommand = exports.se_CreateReturnShippingLabelCommand = exports.se_CreateLongTermPricingCommand = exports.se_CreateJobCommand = exports.se_CreateClusterCommand = exports.se_CreateAddressCommand = exports.se_CancelJobCommand = exports.se_CancelClusterCommand = void 0;
4
- exports.de_UpdateLongTermPricingCommand = exports.de_UpdateJobShipmentStateCommand = exports.de_UpdateJobCommand = exports.de_UpdateClusterCommand = void 0;
5
- const protocol_http_1 = require("@smithy/protocol-http");
6
- const smithy_client_1 = require("@smithy/smithy-client");
7
- const models_0_1 = require("../models/models_0");
8
- const SnowballServiceException_1 = require("../models/SnowballServiceException");
9
- const se_CancelClusterCommand = async (input, context) => {
10
- const headers = sharedHeaders("CancelCluster");
11
- let body;
12
- body = JSON.stringify((0, smithy_client_1._json)(input));
13
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
14
- };
15
- exports.se_CancelClusterCommand = se_CancelClusterCommand;
16
- const se_CancelJobCommand = async (input, context) => {
17
- const headers = sharedHeaders("CancelJob");
18
- let body;
19
- body = JSON.stringify((0, smithy_client_1._json)(input));
20
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
21
- };
22
- exports.se_CancelJobCommand = se_CancelJobCommand;
23
- const se_CreateAddressCommand = async (input, context) => {
24
- const headers = sharedHeaders("CreateAddress");
25
- let body;
26
- body = JSON.stringify((0, smithy_client_1._json)(input));
27
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
28
- };
29
- exports.se_CreateAddressCommand = se_CreateAddressCommand;
30
- const se_CreateClusterCommand = async (input, context) => {
31
- const headers = sharedHeaders("CreateCluster");
32
- let body;
33
- body = JSON.stringify(se_CreateClusterRequest(input, context));
34
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
35
- };
36
- exports.se_CreateClusterCommand = se_CreateClusterCommand;
37
- const se_CreateJobCommand = async (input, context) => {
38
- const headers = sharedHeaders("CreateJob");
39
- let body;
40
- body = JSON.stringify(se_CreateJobRequest(input, context));
41
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
42
- };
43
- exports.se_CreateJobCommand = se_CreateJobCommand;
44
- const se_CreateLongTermPricingCommand = async (input, context) => {
45
- const headers = sharedHeaders("CreateLongTermPricing");
46
- let body;
47
- body = JSON.stringify((0, smithy_client_1._json)(input));
48
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
49
- };
50
- exports.se_CreateLongTermPricingCommand = se_CreateLongTermPricingCommand;
51
- const se_CreateReturnShippingLabelCommand = async (input, context) => {
52
- const headers = sharedHeaders("CreateReturnShippingLabel");
53
- let body;
54
- body = JSON.stringify((0, smithy_client_1._json)(input));
55
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
56
- };
57
- exports.se_CreateReturnShippingLabelCommand = se_CreateReturnShippingLabelCommand;
58
- const se_DescribeAddressCommand = async (input, context) => {
59
- const headers = sharedHeaders("DescribeAddress");
60
- let body;
61
- body = JSON.stringify((0, smithy_client_1._json)(input));
62
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
63
- };
64
- exports.se_DescribeAddressCommand = se_DescribeAddressCommand;
65
- const se_DescribeAddressesCommand = async (input, context) => {
66
- const headers = sharedHeaders("DescribeAddresses");
67
- let body;
68
- body = JSON.stringify((0, smithy_client_1._json)(input));
69
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
70
- };
71
- exports.se_DescribeAddressesCommand = se_DescribeAddressesCommand;
72
- const se_DescribeClusterCommand = async (input, context) => {
73
- const headers = sharedHeaders("DescribeCluster");
74
- let body;
75
- body = JSON.stringify((0, smithy_client_1._json)(input));
76
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
77
- };
78
- exports.se_DescribeClusterCommand = se_DescribeClusterCommand;
79
- const se_DescribeJobCommand = async (input, context) => {
80
- const headers = sharedHeaders("DescribeJob");
81
- let body;
82
- body = JSON.stringify((0, smithy_client_1._json)(input));
83
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
84
- };
85
- exports.se_DescribeJobCommand = se_DescribeJobCommand;
86
- const se_DescribeReturnShippingLabelCommand = async (input, context) => {
87
- const headers = sharedHeaders("DescribeReturnShippingLabel");
88
- let body;
89
- body = JSON.stringify((0, smithy_client_1._json)(input));
90
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
91
- };
92
- exports.se_DescribeReturnShippingLabelCommand = se_DescribeReturnShippingLabelCommand;
93
- const se_GetJobManifestCommand = async (input, context) => {
94
- const headers = sharedHeaders("GetJobManifest");
95
- let body;
96
- body = JSON.stringify((0, smithy_client_1._json)(input));
97
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
98
- };
99
- exports.se_GetJobManifestCommand = se_GetJobManifestCommand;
100
- const se_GetJobUnlockCodeCommand = async (input, context) => {
101
- const headers = sharedHeaders("GetJobUnlockCode");
102
- let body;
103
- body = JSON.stringify((0, smithy_client_1._json)(input));
104
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
105
- };
106
- exports.se_GetJobUnlockCodeCommand = se_GetJobUnlockCodeCommand;
107
- const se_GetSnowballUsageCommand = async (input, context) => {
108
- const headers = sharedHeaders("GetSnowballUsage");
109
- let body;
110
- body = JSON.stringify((0, smithy_client_1._json)(input));
111
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
112
- };
113
- exports.se_GetSnowballUsageCommand = se_GetSnowballUsageCommand;
114
- const se_GetSoftwareUpdatesCommand = async (input, context) => {
115
- const headers = sharedHeaders("GetSoftwareUpdates");
116
- let body;
117
- body = JSON.stringify((0, smithy_client_1._json)(input));
118
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
119
- };
120
- exports.se_GetSoftwareUpdatesCommand = se_GetSoftwareUpdatesCommand;
121
- const se_ListClusterJobsCommand = async (input, context) => {
122
- const headers = sharedHeaders("ListClusterJobs");
123
- let body;
124
- body = JSON.stringify((0, smithy_client_1._json)(input));
125
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
126
- };
127
- exports.se_ListClusterJobsCommand = se_ListClusterJobsCommand;
128
- const se_ListClustersCommand = async (input, context) => {
129
- const headers = sharedHeaders("ListClusters");
130
- let body;
131
- body = JSON.stringify((0, smithy_client_1._json)(input));
132
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
133
- };
134
- exports.se_ListClustersCommand = se_ListClustersCommand;
135
- const se_ListCompatibleImagesCommand = async (input, context) => {
136
- const headers = sharedHeaders("ListCompatibleImages");
137
- let body;
138
- body = JSON.stringify((0, smithy_client_1._json)(input));
139
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
140
- };
141
- exports.se_ListCompatibleImagesCommand = se_ListCompatibleImagesCommand;
142
- const se_ListJobsCommand = async (input, context) => {
143
- const headers = sharedHeaders("ListJobs");
144
- let body;
145
- body = JSON.stringify((0, smithy_client_1._json)(input));
146
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
147
- };
148
- exports.se_ListJobsCommand = se_ListJobsCommand;
149
- const se_ListLongTermPricingCommand = async (input, context) => {
150
- const headers = sharedHeaders("ListLongTermPricing");
151
- let body;
152
- body = JSON.stringify((0, smithy_client_1._json)(input));
153
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
154
- };
155
- exports.se_ListLongTermPricingCommand = se_ListLongTermPricingCommand;
156
- const se_ListPickupLocationsCommand = async (input, context) => {
157
- const headers = sharedHeaders("ListPickupLocations");
158
- let body;
159
- body = JSON.stringify((0, smithy_client_1._json)(input));
160
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
161
- };
162
- exports.se_ListPickupLocationsCommand = se_ListPickupLocationsCommand;
163
- const se_ListServiceVersionsCommand = async (input, context) => {
164
- const headers = sharedHeaders("ListServiceVersions");
165
- let body;
166
- body = JSON.stringify((0, smithy_client_1._json)(input));
167
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
168
- };
169
- exports.se_ListServiceVersionsCommand = se_ListServiceVersionsCommand;
170
- const se_UpdateClusterCommand = async (input, context) => {
171
- const headers = sharedHeaders("UpdateCluster");
172
- let body;
173
- body = JSON.stringify(se_UpdateClusterRequest(input, context));
174
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
175
- };
176
- exports.se_UpdateClusterCommand = se_UpdateClusterCommand;
177
- const se_UpdateJobCommand = async (input, context) => {
178
- const headers = sharedHeaders("UpdateJob");
179
- let body;
180
- body = JSON.stringify(se_UpdateJobRequest(input, context));
181
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
182
- };
183
- exports.se_UpdateJobCommand = se_UpdateJobCommand;
184
- const se_UpdateJobShipmentStateCommand = async (input, context) => {
185
- const headers = sharedHeaders("UpdateJobShipmentState");
186
- let body;
187
- body = JSON.stringify((0, smithy_client_1._json)(input));
188
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
189
- };
190
- exports.se_UpdateJobShipmentStateCommand = se_UpdateJobShipmentStateCommand;
191
- const se_UpdateLongTermPricingCommand = async (input, context) => {
192
- const headers = sharedHeaders("UpdateLongTermPricing");
193
- let body;
194
- body = JSON.stringify((0, smithy_client_1._json)(input));
195
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
196
- };
197
- exports.se_UpdateLongTermPricingCommand = se_UpdateLongTermPricingCommand;
198
- const de_CancelClusterCommand = async (output, context) => {
199
- if (output.statusCode >= 300) {
200
- return de_CancelClusterCommandError(output, context);
201
- }
202
- const data = await parseBody(output.body, context);
203
- let contents = {};
204
- contents = (0, smithy_client_1._json)(data);
205
- const response = {
206
- $metadata: deserializeMetadata(output),
207
- ...contents,
208
- };
209
- return response;
210
- };
211
- exports.de_CancelClusterCommand = de_CancelClusterCommand;
212
- const de_CancelClusterCommandError = async (output, context) => {
213
- const parsedOutput = {
214
- ...output,
215
- body: await parseErrorBody(output.body, context),
216
- };
217
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
218
- switch (errorCode) {
219
- case "InvalidJobStateException":
220
- case "com.amazonaws.snowball#InvalidJobStateException":
221
- throw await de_InvalidJobStateExceptionRes(parsedOutput, context);
222
- case "InvalidResourceException":
223
- case "com.amazonaws.snowball#InvalidResourceException":
224
- throw await de_InvalidResourceExceptionRes(parsedOutput, context);
225
- case "KMSRequestFailedException":
226
- case "com.amazonaws.snowball#KMSRequestFailedException":
227
- throw await de_KMSRequestFailedExceptionRes(parsedOutput, context);
228
- default:
229
- const parsedBody = parsedOutput.body;
230
- return throwDefaultError({
231
- output,
232
- parsedBody,
233
- errorCode,
234
- });
235
- }
236
- };
237
- const de_CancelJobCommand = async (output, context) => {
238
- if (output.statusCode >= 300) {
239
- return de_CancelJobCommandError(output, context);
240
- }
241
- const data = await parseBody(output.body, context);
242
- let contents = {};
243
- contents = (0, smithy_client_1._json)(data);
244
- const response = {
245
- $metadata: deserializeMetadata(output),
246
- ...contents,
247
- };
248
- return response;
249
- };
250
- exports.de_CancelJobCommand = de_CancelJobCommand;
251
- const de_CancelJobCommandError = async (output, context) => {
252
- const parsedOutput = {
253
- ...output,
254
- body: await parseErrorBody(output.body, context),
255
- };
256
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
257
- switch (errorCode) {
258
- case "InvalidJobStateException":
259
- case "com.amazonaws.snowball#InvalidJobStateException":
260
- throw await de_InvalidJobStateExceptionRes(parsedOutput, context);
261
- case "InvalidResourceException":
262
- case "com.amazonaws.snowball#InvalidResourceException":
263
- throw await de_InvalidResourceExceptionRes(parsedOutput, context);
264
- case "KMSRequestFailedException":
265
- case "com.amazonaws.snowball#KMSRequestFailedException":
266
- throw await de_KMSRequestFailedExceptionRes(parsedOutput, context);
267
- default:
268
- const parsedBody = parsedOutput.body;
269
- return throwDefaultError({
270
- output,
271
- parsedBody,
272
- errorCode,
273
- });
274
- }
275
- };
276
- const de_CreateAddressCommand = async (output, context) => {
277
- if (output.statusCode >= 300) {
278
- return de_CreateAddressCommandError(output, context);
279
- }
280
- const data = await parseBody(output.body, context);
281
- let contents = {};
282
- contents = (0, smithy_client_1._json)(data);
283
- const response = {
284
- $metadata: deserializeMetadata(output),
285
- ...contents,
286
- };
287
- return response;
288
- };
289
- exports.de_CreateAddressCommand = de_CreateAddressCommand;
290
- const de_CreateAddressCommandError = async (output, context) => {
291
- const parsedOutput = {
292
- ...output,
293
- body: await parseErrorBody(output.body, context),
294
- };
295
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
296
- switch (errorCode) {
297
- case "InvalidAddressException":
298
- case "com.amazonaws.snowball#InvalidAddressException":
299
- throw await de_InvalidAddressExceptionRes(parsedOutput, context);
300
- case "UnsupportedAddressException":
301
- case "com.amazonaws.snowball#UnsupportedAddressException":
302
- throw await de_UnsupportedAddressExceptionRes(parsedOutput, context);
303
- default:
304
- const parsedBody = parsedOutput.body;
305
- return throwDefaultError({
306
- output,
307
- parsedBody,
308
- errorCode,
309
- });
310
- }
311
- };
312
- const de_CreateClusterCommand = async (output, context) => {
313
- if (output.statusCode >= 300) {
314
- return de_CreateClusterCommandError(output, context);
315
- }
316
- const data = await parseBody(output.body, context);
317
- let contents = {};
318
- contents = de_CreateClusterResult(data, context);
319
- const response = {
320
- $metadata: deserializeMetadata(output),
321
- ...contents,
322
- };
323
- return response;
324
- };
325
- exports.de_CreateClusterCommand = de_CreateClusterCommand;
326
- const de_CreateClusterCommandError = async (output, context) => {
327
- const parsedOutput = {
328
- ...output,
329
- body: await parseErrorBody(output.body, context),
330
- };
331
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
332
- switch (errorCode) {
333
- case "Ec2RequestFailedException":
334
- case "com.amazonaws.snowball#Ec2RequestFailedException":
335
- throw await de_Ec2RequestFailedExceptionRes(parsedOutput, context);
336
- case "InvalidInputCombinationException":
337
- case "com.amazonaws.snowball#InvalidInputCombinationException":
338
- throw await de_InvalidInputCombinationExceptionRes(parsedOutput, context);
339
- case "InvalidResourceException":
340
- case "com.amazonaws.snowball#InvalidResourceException":
341
- throw await de_InvalidResourceExceptionRes(parsedOutput, context);
342
- case "KMSRequestFailedException":
343
- case "com.amazonaws.snowball#KMSRequestFailedException":
344
- throw await de_KMSRequestFailedExceptionRes(parsedOutput, context);
345
- default:
346
- const parsedBody = parsedOutput.body;
347
- return throwDefaultError({
348
- output,
349
- parsedBody,
350
- errorCode,
351
- });
352
- }
353
- };
354
- const de_CreateJobCommand = async (output, context) => {
355
- if (output.statusCode >= 300) {
356
- return de_CreateJobCommandError(output, context);
357
- }
358
- const data = await parseBody(output.body, context);
359
- let contents = {};
360
- contents = (0, smithy_client_1._json)(data);
361
- const response = {
362
- $metadata: deserializeMetadata(output),
363
- ...contents,
364
- };
365
- return response;
366
- };
367
- exports.de_CreateJobCommand = de_CreateJobCommand;
368
- const de_CreateJobCommandError = async (output, context) => {
369
- const parsedOutput = {
370
- ...output,
371
- body: await parseErrorBody(output.body, context),
372
- };
373
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
374
- switch (errorCode) {
375
- case "ClusterLimitExceededException":
376
- case "com.amazonaws.snowball#ClusterLimitExceededException":
377
- throw await de_ClusterLimitExceededExceptionRes(parsedOutput, context);
378
- case "Ec2RequestFailedException":
379
- case "com.amazonaws.snowball#Ec2RequestFailedException":
380
- throw await de_Ec2RequestFailedExceptionRes(parsedOutput, context);
381
- case "InvalidInputCombinationException":
382
- case "com.amazonaws.snowball#InvalidInputCombinationException":
383
- throw await de_InvalidInputCombinationExceptionRes(parsedOutput, context);
384
- case "InvalidResourceException":
385
- case "com.amazonaws.snowball#InvalidResourceException":
386
- throw await de_InvalidResourceExceptionRes(parsedOutput, context);
387
- case "KMSRequestFailedException":
388
- case "com.amazonaws.snowball#KMSRequestFailedException":
389
- throw await de_KMSRequestFailedExceptionRes(parsedOutput, context);
390
- default:
391
- const parsedBody = parsedOutput.body;
392
- return throwDefaultError({
393
- output,
394
- parsedBody,
395
- errorCode,
396
- });
397
- }
398
- };
399
- const de_CreateLongTermPricingCommand = async (output, context) => {
400
- if (output.statusCode >= 300) {
401
- return de_CreateLongTermPricingCommandError(output, context);
402
- }
403
- const data = await parseBody(output.body, context);
404
- let contents = {};
405
- contents = (0, smithy_client_1._json)(data);
406
- const response = {
407
- $metadata: deserializeMetadata(output),
408
- ...contents,
409
- };
410
- return response;
411
- };
412
- exports.de_CreateLongTermPricingCommand = de_CreateLongTermPricingCommand;
413
- const de_CreateLongTermPricingCommandError = async (output, context) => {
414
- const parsedOutput = {
415
- ...output,
416
- body: await parseErrorBody(output.body, context),
417
- };
418
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
419
- switch (errorCode) {
420
- case "InvalidResourceException":
421
- case "com.amazonaws.snowball#InvalidResourceException":
422
- throw await de_InvalidResourceExceptionRes(parsedOutput, context);
423
- default:
424
- const parsedBody = parsedOutput.body;
425
- return throwDefaultError({
426
- output,
427
- parsedBody,
428
- errorCode,
429
- });
430
- }
431
- };
432
- const de_CreateReturnShippingLabelCommand = async (output, context) => {
433
- if (output.statusCode >= 300) {
434
- return de_CreateReturnShippingLabelCommandError(output, context);
435
- }
436
- const data = await parseBody(output.body, context);
437
- let contents = {};
438
- contents = (0, smithy_client_1._json)(data);
439
- const response = {
440
- $metadata: deserializeMetadata(output),
441
- ...contents,
442
- };
443
- return response;
444
- };
445
- exports.de_CreateReturnShippingLabelCommand = de_CreateReturnShippingLabelCommand;
446
- const de_CreateReturnShippingLabelCommandError = async (output, context) => {
447
- const parsedOutput = {
448
- ...output,
449
- body: await parseErrorBody(output.body, context),
450
- };
451
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
452
- switch (errorCode) {
453
- case "ConflictException":
454
- case "com.amazonaws.snowball#ConflictException":
455
- throw await de_ConflictExceptionRes(parsedOutput, context);
456
- case "InvalidInputCombinationException":
457
- case "com.amazonaws.snowball#InvalidInputCombinationException":
458
- throw await de_InvalidInputCombinationExceptionRes(parsedOutput, context);
459
- case "InvalidJobStateException":
460
- case "com.amazonaws.snowball#InvalidJobStateException":
461
- throw await de_InvalidJobStateExceptionRes(parsedOutput, context);
462
- case "InvalidResourceException":
463
- case "com.amazonaws.snowball#InvalidResourceException":
464
- throw await de_InvalidResourceExceptionRes(parsedOutput, context);
465
- case "ReturnShippingLabelAlreadyExistsException":
466
- case "com.amazonaws.snowball#ReturnShippingLabelAlreadyExistsException":
467
- throw await de_ReturnShippingLabelAlreadyExistsExceptionRes(parsedOutput, context);
468
- default:
469
- const parsedBody = parsedOutput.body;
470
- return throwDefaultError({
471
- output,
472
- parsedBody,
473
- errorCode,
474
- });
475
- }
476
- };
477
- const de_DescribeAddressCommand = async (output, context) => {
478
- if (output.statusCode >= 300) {
479
- return de_DescribeAddressCommandError(output, context);
480
- }
481
- const data = await parseBody(output.body, context);
482
- let contents = {};
483
- contents = (0, smithy_client_1._json)(data);
484
- const response = {
485
- $metadata: deserializeMetadata(output),
486
- ...contents,
487
- };
488
- return response;
489
- };
490
- exports.de_DescribeAddressCommand = de_DescribeAddressCommand;
491
- const de_DescribeAddressCommandError = async (output, context) => {
492
- const parsedOutput = {
493
- ...output,
494
- body: await parseErrorBody(output.body, context),
495
- };
496
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
497
- switch (errorCode) {
498
- case "InvalidResourceException":
499
- case "com.amazonaws.snowball#InvalidResourceException":
500
- throw await de_InvalidResourceExceptionRes(parsedOutput, context);
501
- default:
502
- const parsedBody = parsedOutput.body;
503
- return throwDefaultError({
504
- output,
505
- parsedBody,
506
- errorCode,
507
- });
508
- }
509
- };
510
- const de_DescribeAddressesCommand = async (output, context) => {
511
- if (output.statusCode >= 300) {
512
- return de_DescribeAddressesCommandError(output, context);
513
- }
514
- const data = await parseBody(output.body, context);
515
- let contents = {};
516
- contents = (0, smithy_client_1._json)(data);
517
- const response = {
518
- $metadata: deserializeMetadata(output),
519
- ...contents,
520
- };
521
- return response;
522
- };
523
- exports.de_DescribeAddressesCommand = de_DescribeAddressesCommand;
524
- const de_DescribeAddressesCommandError = async (output, context) => {
525
- const parsedOutput = {
526
- ...output,
527
- body: await parseErrorBody(output.body, context),
528
- };
529
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
530
- switch (errorCode) {
531
- case "InvalidNextTokenException":
532
- case "com.amazonaws.snowball#InvalidNextTokenException":
533
- throw await de_InvalidNextTokenExceptionRes(parsedOutput, context);
534
- case "InvalidResourceException":
535
- case "com.amazonaws.snowball#InvalidResourceException":
536
- throw await de_InvalidResourceExceptionRes(parsedOutput, context);
537
- default:
538
- const parsedBody = parsedOutput.body;
539
- return throwDefaultError({
540
- output,
541
- parsedBody,
542
- errorCode,
543
- });
544
- }
545
- };
546
- const de_DescribeClusterCommand = async (output, context) => {
547
- if (output.statusCode >= 300) {
548
- return de_DescribeClusterCommandError(output, context);
549
- }
550
- const data = await parseBody(output.body, context);
551
- let contents = {};
552
- contents = de_DescribeClusterResult(data, context);
553
- const response = {
554
- $metadata: deserializeMetadata(output),
555
- ...contents,
556
- };
557
- return response;
558
- };
559
- exports.de_DescribeClusterCommand = de_DescribeClusterCommand;
560
- const de_DescribeClusterCommandError = async (output, context) => {
561
- const parsedOutput = {
562
- ...output,
563
- body: await parseErrorBody(output.body, context),
564
- };
565
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
566
- switch (errorCode) {
567
- case "InvalidResourceException":
568
- case "com.amazonaws.snowball#InvalidResourceException":
569
- throw await de_InvalidResourceExceptionRes(parsedOutput, context);
570
- default:
571
- const parsedBody = parsedOutput.body;
572
- return throwDefaultError({
573
- output,
574
- parsedBody,
575
- errorCode,
576
- });
577
- }
578
- };
579
- const de_DescribeJobCommand = async (output, context) => {
580
- if (output.statusCode >= 300) {
581
- return de_DescribeJobCommandError(output, context);
582
- }
583
- const data = await parseBody(output.body, context);
584
- let contents = {};
585
- contents = de_DescribeJobResult(data, context);
586
- const response = {
587
- $metadata: deserializeMetadata(output),
588
- ...contents,
589
- };
590
- return response;
591
- };
592
- exports.de_DescribeJobCommand = de_DescribeJobCommand;
593
- const de_DescribeJobCommandError = async (output, context) => {
594
- const parsedOutput = {
595
- ...output,
596
- body: await parseErrorBody(output.body, context),
597
- };
598
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
599
- switch (errorCode) {
600
- case "InvalidResourceException":
601
- case "com.amazonaws.snowball#InvalidResourceException":
602
- throw await de_InvalidResourceExceptionRes(parsedOutput, context);
603
- default:
604
- const parsedBody = parsedOutput.body;
605
- return throwDefaultError({
606
- output,
607
- parsedBody,
608
- errorCode,
609
- });
610
- }
611
- };
612
- const de_DescribeReturnShippingLabelCommand = async (output, context) => {
613
- if (output.statusCode >= 300) {
614
- return de_DescribeReturnShippingLabelCommandError(output, context);
615
- }
616
- const data = await parseBody(output.body, context);
617
- let contents = {};
618
- contents = de_DescribeReturnShippingLabelResult(data, context);
619
- const response = {
620
- $metadata: deserializeMetadata(output),
621
- ...contents,
622
- };
623
- return response;
624
- };
625
- exports.de_DescribeReturnShippingLabelCommand = de_DescribeReturnShippingLabelCommand;
626
- const de_DescribeReturnShippingLabelCommandError = async (output, context) => {
627
- const parsedOutput = {
628
- ...output,
629
- body: await parseErrorBody(output.body, context),
630
- };
631
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
632
- switch (errorCode) {
633
- case "ConflictException":
634
- case "com.amazonaws.snowball#ConflictException":
635
- throw await de_ConflictExceptionRes(parsedOutput, context);
636
- case "InvalidJobStateException":
637
- case "com.amazonaws.snowball#InvalidJobStateException":
638
- throw await de_InvalidJobStateExceptionRes(parsedOutput, context);
639
- case "InvalidResourceException":
640
- case "com.amazonaws.snowball#InvalidResourceException":
641
- throw await de_InvalidResourceExceptionRes(parsedOutput, context);
642
- default:
643
- const parsedBody = parsedOutput.body;
644
- return throwDefaultError({
645
- output,
646
- parsedBody,
647
- errorCode,
648
- });
649
- }
650
- };
651
- const de_GetJobManifestCommand = async (output, context) => {
652
- if (output.statusCode >= 300) {
653
- return de_GetJobManifestCommandError(output, context);
654
- }
655
- const data = await parseBody(output.body, context);
656
- let contents = {};
657
- contents = (0, smithy_client_1._json)(data);
658
- const response = {
659
- $metadata: deserializeMetadata(output),
660
- ...contents,
661
- };
662
- return response;
663
- };
664
- exports.de_GetJobManifestCommand = de_GetJobManifestCommand;
665
- const de_GetJobManifestCommandError = async (output, context) => {
666
- const parsedOutput = {
667
- ...output,
668
- body: await parseErrorBody(output.body, context),
669
- };
670
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
671
- switch (errorCode) {
672
- case "InvalidJobStateException":
673
- case "com.amazonaws.snowball#InvalidJobStateException":
674
- throw await de_InvalidJobStateExceptionRes(parsedOutput, context);
675
- case "InvalidResourceException":
676
- case "com.amazonaws.snowball#InvalidResourceException":
677
- throw await de_InvalidResourceExceptionRes(parsedOutput, context);
678
- default:
679
- const parsedBody = parsedOutput.body;
680
- return throwDefaultError({
681
- output,
682
- parsedBody,
683
- errorCode,
684
- });
685
- }
686
- };
687
- const de_GetJobUnlockCodeCommand = async (output, context) => {
688
- if (output.statusCode >= 300) {
689
- return de_GetJobUnlockCodeCommandError(output, context);
690
- }
691
- const data = await parseBody(output.body, context);
692
- let contents = {};
693
- contents = (0, smithy_client_1._json)(data);
694
- const response = {
695
- $metadata: deserializeMetadata(output),
696
- ...contents,
697
- };
698
- return response;
699
- };
700
- exports.de_GetJobUnlockCodeCommand = de_GetJobUnlockCodeCommand;
701
- const de_GetJobUnlockCodeCommandError = async (output, context) => {
702
- const parsedOutput = {
703
- ...output,
704
- body: await parseErrorBody(output.body, context),
705
- };
706
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
707
- switch (errorCode) {
708
- case "InvalidJobStateException":
709
- case "com.amazonaws.snowball#InvalidJobStateException":
710
- throw await de_InvalidJobStateExceptionRes(parsedOutput, context);
711
- case "InvalidResourceException":
712
- case "com.amazonaws.snowball#InvalidResourceException":
713
- throw await de_InvalidResourceExceptionRes(parsedOutput, context);
714
- default:
715
- const parsedBody = parsedOutput.body;
716
- return throwDefaultError({
717
- output,
718
- parsedBody,
719
- errorCode,
720
- });
721
- }
722
- };
723
- const de_GetSnowballUsageCommand = async (output, context) => {
724
- if (output.statusCode >= 300) {
725
- return de_GetSnowballUsageCommandError(output, context);
726
- }
727
- const data = await parseBody(output.body, context);
728
- let contents = {};
729
- contents = (0, smithy_client_1._json)(data);
730
- const response = {
731
- $metadata: deserializeMetadata(output),
732
- ...contents,
733
- };
734
- return response;
735
- };
736
- exports.de_GetSnowballUsageCommand = de_GetSnowballUsageCommand;
737
- const de_GetSnowballUsageCommandError = async (output, context) => {
738
- const parsedOutput = {
739
- ...output,
740
- body: await parseErrorBody(output.body, context),
741
- };
742
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
743
- const parsedBody = parsedOutput.body;
744
- return throwDefaultError({
745
- output,
746
- parsedBody,
747
- errorCode,
748
- });
749
- };
750
- const de_GetSoftwareUpdatesCommand = async (output, context) => {
751
- if (output.statusCode >= 300) {
752
- return de_GetSoftwareUpdatesCommandError(output, context);
753
- }
754
- const data = await parseBody(output.body, context);
755
- let contents = {};
756
- contents = (0, smithy_client_1._json)(data);
757
- const response = {
758
- $metadata: deserializeMetadata(output),
759
- ...contents,
760
- };
761
- return response;
762
- };
763
- exports.de_GetSoftwareUpdatesCommand = de_GetSoftwareUpdatesCommand;
764
- const de_GetSoftwareUpdatesCommandError = async (output, context) => {
765
- const parsedOutput = {
766
- ...output,
767
- body: await parseErrorBody(output.body, context),
768
- };
769
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
770
- switch (errorCode) {
771
- case "InvalidJobStateException":
772
- case "com.amazonaws.snowball#InvalidJobStateException":
773
- throw await de_InvalidJobStateExceptionRes(parsedOutput, context);
774
- case "InvalidResourceException":
775
- case "com.amazonaws.snowball#InvalidResourceException":
776
- throw await de_InvalidResourceExceptionRes(parsedOutput, context);
777
- default:
778
- const parsedBody = parsedOutput.body;
779
- return throwDefaultError({
780
- output,
781
- parsedBody,
782
- errorCode,
783
- });
784
- }
785
- };
786
- const de_ListClusterJobsCommand = async (output, context) => {
787
- if (output.statusCode >= 300) {
788
- return de_ListClusterJobsCommandError(output, context);
789
- }
790
- const data = await parseBody(output.body, context);
791
- let contents = {};
792
- contents = de_ListClusterJobsResult(data, context);
793
- const response = {
794
- $metadata: deserializeMetadata(output),
795
- ...contents,
796
- };
797
- return response;
798
- };
799
- exports.de_ListClusterJobsCommand = de_ListClusterJobsCommand;
800
- const de_ListClusterJobsCommandError = async (output, context) => {
801
- const parsedOutput = {
802
- ...output,
803
- body: await parseErrorBody(output.body, context),
804
- };
805
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
806
- switch (errorCode) {
807
- case "InvalidNextTokenException":
808
- case "com.amazonaws.snowball#InvalidNextTokenException":
809
- throw await de_InvalidNextTokenExceptionRes(parsedOutput, context);
810
- case "InvalidResourceException":
811
- case "com.amazonaws.snowball#InvalidResourceException":
812
- throw await de_InvalidResourceExceptionRes(parsedOutput, context);
813
- default:
814
- const parsedBody = parsedOutput.body;
815
- return throwDefaultError({
816
- output,
817
- parsedBody,
818
- errorCode,
819
- });
820
- }
821
- };
822
- const de_ListClustersCommand = async (output, context) => {
823
- if (output.statusCode >= 300) {
824
- return de_ListClustersCommandError(output, context);
825
- }
826
- const data = await parseBody(output.body, context);
827
- let contents = {};
828
- contents = de_ListClustersResult(data, context);
829
- const response = {
830
- $metadata: deserializeMetadata(output),
831
- ...contents,
832
- };
833
- return response;
834
- };
835
- exports.de_ListClustersCommand = de_ListClustersCommand;
836
- const de_ListClustersCommandError = async (output, context) => {
837
- const parsedOutput = {
838
- ...output,
839
- body: await parseErrorBody(output.body, context),
840
- };
841
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
842
- switch (errorCode) {
843
- case "InvalidNextTokenException":
844
- case "com.amazonaws.snowball#InvalidNextTokenException":
845
- throw await de_InvalidNextTokenExceptionRes(parsedOutput, context);
846
- default:
847
- const parsedBody = parsedOutput.body;
848
- return throwDefaultError({
849
- output,
850
- parsedBody,
851
- errorCode,
852
- });
853
- }
854
- };
855
- const de_ListCompatibleImagesCommand = async (output, context) => {
856
- if (output.statusCode >= 300) {
857
- return de_ListCompatibleImagesCommandError(output, context);
858
- }
859
- const data = await parseBody(output.body, context);
860
- let contents = {};
861
- contents = (0, smithy_client_1._json)(data);
862
- const response = {
863
- $metadata: deserializeMetadata(output),
864
- ...contents,
865
- };
866
- return response;
867
- };
868
- exports.de_ListCompatibleImagesCommand = de_ListCompatibleImagesCommand;
869
- const de_ListCompatibleImagesCommandError = async (output, context) => {
870
- const parsedOutput = {
871
- ...output,
872
- body: await parseErrorBody(output.body, context),
873
- };
874
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
875
- switch (errorCode) {
876
- case "Ec2RequestFailedException":
877
- case "com.amazonaws.snowball#Ec2RequestFailedException":
878
- throw await de_Ec2RequestFailedExceptionRes(parsedOutput, context);
879
- case "InvalidNextTokenException":
880
- case "com.amazonaws.snowball#InvalidNextTokenException":
881
- throw await de_InvalidNextTokenExceptionRes(parsedOutput, context);
882
- default:
883
- const parsedBody = parsedOutput.body;
884
- return throwDefaultError({
885
- output,
886
- parsedBody,
887
- errorCode,
888
- });
889
- }
890
- };
891
- const de_ListJobsCommand = async (output, context) => {
892
- if (output.statusCode >= 300) {
893
- return de_ListJobsCommandError(output, context);
894
- }
895
- const data = await parseBody(output.body, context);
896
- let contents = {};
897
- contents = de_ListJobsResult(data, context);
898
- const response = {
899
- $metadata: deserializeMetadata(output),
900
- ...contents,
901
- };
902
- return response;
903
- };
904
- exports.de_ListJobsCommand = de_ListJobsCommand;
905
- const de_ListJobsCommandError = async (output, context) => {
906
- const parsedOutput = {
907
- ...output,
908
- body: await parseErrorBody(output.body, context),
909
- };
910
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
911
- switch (errorCode) {
912
- case "InvalidNextTokenException":
913
- case "com.amazonaws.snowball#InvalidNextTokenException":
914
- throw await de_InvalidNextTokenExceptionRes(parsedOutput, context);
915
- default:
916
- const parsedBody = parsedOutput.body;
917
- return throwDefaultError({
918
- output,
919
- parsedBody,
920
- errorCode,
921
- });
922
- }
923
- };
924
- const de_ListLongTermPricingCommand = async (output, context) => {
925
- if (output.statusCode >= 300) {
926
- return de_ListLongTermPricingCommandError(output, context);
927
- }
928
- const data = await parseBody(output.body, context);
929
- let contents = {};
930
- contents = de_ListLongTermPricingResult(data, context);
931
- const response = {
932
- $metadata: deserializeMetadata(output),
933
- ...contents,
934
- };
935
- return response;
936
- };
937
- exports.de_ListLongTermPricingCommand = de_ListLongTermPricingCommand;
938
- const de_ListLongTermPricingCommandError = async (output, context) => {
939
- const parsedOutput = {
940
- ...output,
941
- body: await parseErrorBody(output.body, context),
942
- };
943
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
944
- switch (errorCode) {
945
- case "InvalidNextTokenException":
946
- case "com.amazonaws.snowball#InvalidNextTokenException":
947
- throw await de_InvalidNextTokenExceptionRes(parsedOutput, context);
948
- case "InvalidResourceException":
949
- case "com.amazonaws.snowball#InvalidResourceException":
950
- throw await de_InvalidResourceExceptionRes(parsedOutput, context);
951
- default:
952
- const parsedBody = parsedOutput.body;
953
- return throwDefaultError({
954
- output,
955
- parsedBody,
956
- errorCode,
957
- });
958
- }
959
- };
960
- const de_ListPickupLocationsCommand = async (output, context) => {
961
- if (output.statusCode >= 300) {
962
- return de_ListPickupLocationsCommandError(output, context);
963
- }
964
- const data = await parseBody(output.body, context);
965
- let contents = {};
966
- contents = (0, smithy_client_1._json)(data);
967
- const response = {
968
- $metadata: deserializeMetadata(output),
969
- ...contents,
970
- };
971
- return response;
972
- };
973
- exports.de_ListPickupLocationsCommand = de_ListPickupLocationsCommand;
974
- const de_ListPickupLocationsCommandError = async (output, context) => {
975
- const parsedOutput = {
976
- ...output,
977
- body: await parseErrorBody(output.body, context),
978
- };
979
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
980
- switch (errorCode) {
981
- case "InvalidResourceException":
982
- case "com.amazonaws.snowball#InvalidResourceException":
983
- throw await de_InvalidResourceExceptionRes(parsedOutput, context);
984
- default:
985
- const parsedBody = parsedOutput.body;
986
- return throwDefaultError({
987
- output,
988
- parsedBody,
989
- errorCode,
990
- });
991
- }
992
- };
993
- const de_ListServiceVersionsCommand = async (output, context) => {
994
- if (output.statusCode >= 300) {
995
- return de_ListServiceVersionsCommandError(output, context);
996
- }
997
- const data = await parseBody(output.body, context);
998
- let contents = {};
999
- contents = (0, smithy_client_1._json)(data);
1000
- const response = {
1001
- $metadata: deserializeMetadata(output),
1002
- ...contents,
1003
- };
1004
- return response;
1005
- };
1006
- exports.de_ListServiceVersionsCommand = de_ListServiceVersionsCommand;
1007
- const de_ListServiceVersionsCommandError = async (output, context) => {
1008
- const parsedOutput = {
1009
- ...output,
1010
- body: await parseErrorBody(output.body, context),
1011
- };
1012
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1013
- switch (errorCode) {
1014
- case "InvalidNextTokenException":
1015
- case "com.amazonaws.snowball#InvalidNextTokenException":
1016
- throw await de_InvalidNextTokenExceptionRes(parsedOutput, context);
1017
- case "InvalidResourceException":
1018
- case "com.amazonaws.snowball#InvalidResourceException":
1019
- throw await de_InvalidResourceExceptionRes(parsedOutput, context);
1020
- default:
1021
- const parsedBody = parsedOutput.body;
1022
- return throwDefaultError({
1023
- output,
1024
- parsedBody,
1025
- errorCode,
1026
- });
1027
- }
1028
- };
1029
- const de_UpdateClusterCommand = async (output, context) => {
1030
- if (output.statusCode >= 300) {
1031
- return de_UpdateClusterCommandError(output, context);
1032
- }
1033
- const data = await parseBody(output.body, context);
1034
- let contents = {};
1035
- contents = (0, smithy_client_1._json)(data);
1036
- const response = {
1037
- $metadata: deserializeMetadata(output),
1038
- ...contents,
1039
- };
1040
- return response;
1041
- };
1042
- exports.de_UpdateClusterCommand = de_UpdateClusterCommand;
1043
- const de_UpdateClusterCommandError = async (output, context) => {
1044
- const parsedOutput = {
1045
- ...output,
1046
- body: await parseErrorBody(output.body, context),
1047
- };
1048
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1049
- switch (errorCode) {
1050
- case "Ec2RequestFailedException":
1051
- case "com.amazonaws.snowball#Ec2RequestFailedException":
1052
- throw await de_Ec2RequestFailedExceptionRes(parsedOutput, context);
1053
- case "InvalidInputCombinationException":
1054
- case "com.amazonaws.snowball#InvalidInputCombinationException":
1055
- throw await de_InvalidInputCombinationExceptionRes(parsedOutput, context);
1056
- case "InvalidJobStateException":
1057
- case "com.amazonaws.snowball#InvalidJobStateException":
1058
- throw await de_InvalidJobStateExceptionRes(parsedOutput, context);
1059
- case "InvalidResourceException":
1060
- case "com.amazonaws.snowball#InvalidResourceException":
1061
- throw await de_InvalidResourceExceptionRes(parsedOutput, context);
1062
- case "KMSRequestFailedException":
1063
- case "com.amazonaws.snowball#KMSRequestFailedException":
1064
- throw await de_KMSRequestFailedExceptionRes(parsedOutput, context);
1065
- default:
1066
- const parsedBody = parsedOutput.body;
1067
- return throwDefaultError({
1068
- output,
1069
- parsedBody,
1070
- errorCode,
1071
- });
1072
- }
1073
- };
1074
- const de_UpdateJobCommand = async (output, context) => {
1075
- if (output.statusCode >= 300) {
1076
- return de_UpdateJobCommandError(output, context);
1077
- }
1078
- const data = await parseBody(output.body, context);
1079
- let contents = {};
1080
- contents = (0, smithy_client_1._json)(data);
1081
- const response = {
1082
- $metadata: deserializeMetadata(output),
1083
- ...contents,
1084
- };
1085
- return response;
1086
- };
1087
- exports.de_UpdateJobCommand = de_UpdateJobCommand;
1088
- const de_UpdateJobCommandError = async (output, context) => {
1089
- const parsedOutput = {
1090
- ...output,
1091
- body: await parseErrorBody(output.body, context),
1092
- };
1093
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1094
- switch (errorCode) {
1095
- case "ClusterLimitExceededException":
1096
- case "com.amazonaws.snowball#ClusterLimitExceededException":
1097
- throw await de_ClusterLimitExceededExceptionRes(parsedOutput, context);
1098
- case "Ec2RequestFailedException":
1099
- case "com.amazonaws.snowball#Ec2RequestFailedException":
1100
- throw await de_Ec2RequestFailedExceptionRes(parsedOutput, context);
1101
- case "InvalidInputCombinationException":
1102
- case "com.amazonaws.snowball#InvalidInputCombinationException":
1103
- throw await de_InvalidInputCombinationExceptionRes(parsedOutput, context);
1104
- case "InvalidJobStateException":
1105
- case "com.amazonaws.snowball#InvalidJobStateException":
1106
- throw await de_InvalidJobStateExceptionRes(parsedOutput, context);
1107
- case "InvalidResourceException":
1108
- case "com.amazonaws.snowball#InvalidResourceException":
1109
- throw await de_InvalidResourceExceptionRes(parsedOutput, context);
1110
- case "KMSRequestFailedException":
1111
- case "com.amazonaws.snowball#KMSRequestFailedException":
1112
- throw await de_KMSRequestFailedExceptionRes(parsedOutput, context);
1113
- default:
1114
- const parsedBody = parsedOutput.body;
1115
- return throwDefaultError({
1116
- output,
1117
- parsedBody,
1118
- errorCode,
1119
- });
1120
- }
1121
- };
1122
- const de_UpdateJobShipmentStateCommand = async (output, context) => {
1123
- if (output.statusCode >= 300) {
1124
- return de_UpdateJobShipmentStateCommandError(output, context);
1125
- }
1126
- const data = await parseBody(output.body, context);
1127
- let contents = {};
1128
- contents = (0, smithy_client_1._json)(data);
1129
- const response = {
1130
- $metadata: deserializeMetadata(output),
1131
- ...contents,
1132
- };
1133
- return response;
1134
- };
1135
- exports.de_UpdateJobShipmentStateCommand = de_UpdateJobShipmentStateCommand;
1136
- const de_UpdateJobShipmentStateCommandError = async (output, context) => {
1137
- const parsedOutput = {
1138
- ...output,
1139
- body: await parseErrorBody(output.body, context),
1140
- };
1141
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1142
- switch (errorCode) {
1143
- case "InvalidJobStateException":
1144
- case "com.amazonaws.snowball#InvalidJobStateException":
1145
- throw await de_InvalidJobStateExceptionRes(parsedOutput, context);
1146
- case "InvalidResourceException":
1147
- case "com.amazonaws.snowball#InvalidResourceException":
1148
- throw await de_InvalidResourceExceptionRes(parsedOutput, context);
1149
- default:
1150
- const parsedBody = parsedOutput.body;
1151
- return throwDefaultError({
1152
- output,
1153
- parsedBody,
1154
- errorCode,
1155
- });
1156
- }
1157
- };
1158
- const de_UpdateLongTermPricingCommand = async (output, context) => {
1159
- if (output.statusCode >= 300) {
1160
- return de_UpdateLongTermPricingCommandError(output, context);
1161
- }
1162
- const data = await parseBody(output.body, context);
1163
- let contents = {};
1164
- contents = (0, smithy_client_1._json)(data);
1165
- const response = {
1166
- $metadata: deserializeMetadata(output),
1167
- ...contents,
1168
- };
1169
- return response;
1170
- };
1171
- exports.de_UpdateLongTermPricingCommand = de_UpdateLongTermPricingCommand;
1172
- const de_UpdateLongTermPricingCommandError = async (output, context) => {
1173
- const parsedOutput = {
1174
- ...output,
1175
- body: await parseErrorBody(output.body, context),
1176
- };
1177
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1178
- switch (errorCode) {
1179
- case "InvalidResourceException":
1180
- case "com.amazonaws.snowball#InvalidResourceException":
1181
- throw await de_InvalidResourceExceptionRes(parsedOutput, context);
1182
- default:
1183
- const parsedBody = parsedOutput.body;
1184
- return throwDefaultError({
1185
- output,
1186
- parsedBody,
1187
- errorCode,
1188
- });
1189
- }
1190
- };
1191
- const de_ClusterLimitExceededExceptionRes = async (parsedOutput, context) => {
1192
- const body = parsedOutput.body;
1193
- const deserialized = (0, smithy_client_1._json)(body);
1194
- const exception = new models_0_1.ClusterLimitExceededException({
1195
- $metadata: deserializeMetadata(parsedOutput),
1196
- ...deserialized,
1197
- });
1198
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1199
- };
1200
- const de_ConflictExceptionRes = async (parsedOutput, context) => {
1201
- const body = parsedOutput.body;
1202
- const deserialized = (0, smithy_client_1._json)(body);
1203
- const exception = new models_0_1.ConflictException({
1204
- $metadata: deserializeMetadata(parsedOutput),
1205
- ...deserialized,
1206
- });
1207
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1208
- };
1209
- const de_Ec2RequestFailedExceptionRes = async (parsedOutput, context) => {
1210
- const body = parsedOutput.body;
1211
- const deserialized = (0, smithy_client_1._json)(body);
1212
- const exception = new models_0_1.Ec2RequestFailedException({
1213
- $metadata: deserializeMetadata(parsedOutput),
1214
- ...deserialized,
1215
- });
1216
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1217
- };
1218
- const de_InvalidAddressExceptionRes = async (parsedOutput, context) => {
1219
- const body = parsedOutput.body;
1220
- const deserialized = (0, smithy_client_1._json)(body);
1221
- const exception = new models_0_1.InvalidAddressException({
1222
- $metadata: deserializeMetadata(parsedOutput),
1223
- ...deserialized,
1224
- });
1225
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1226
- };
1227
- const de_InvalidInputCombinationExceptionRes = async (parsedOutput, context) => {
1228
- const body = parsedOutput.body;
1229
- const deserialized = (0, smithy_client_1._json)(body);
1230
- const exception = new models_0_1.InvalidInputCombinationException({
1231
- $metadata: deserializeMetadata(parsedOutput),
1232
- ...deserialized,
1233
- });
1234
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1235
- };
1236
- const de_InvalidJobStateExceptionRes = async (parsedOutput, context) => {
1237
- const body = parsedOutput.body;
1238
- const deserialized = (0, smithy_client_1._json)(body);
1239
- const exception = new models_0_1.InvalidJobStateException({
1240
- $metadata: deserializeMetadata(parsedOutput),
1241
- ...deserialized,
1242
- });
1243
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1244
- };
1245
- const de_InvalidNextTokenExceptionRes = async (parsedOutput, context) => {
1246
- const body = parsedOutput.body;
1247
- const deserialized = (0, smithy_client_1._json)(body);
1248
- const exception = new models_0_1.InvalidNextTokenException({
1249
- $metadata: deserializeMetadata(parsedOutput),
1250
- ...deserialized,
1251
- });
1252
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1253
- };
1254
- const de_InvalidResourceExceptionRes = async (parsedOutput, context) => {
1255
- const body = parsedOutput.body;
1256
- const deserialized = (0, smithy_client_1._json)(body);
1257
- const exception = new models_0_1.InvalidResourceException({
1258
- $metadata: deserializeMetadata(parsedOutput),
1259
- ...deserialized,
1260
- });
1261
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1262
- };
1263
- const de_KMSRequestFailedExceptionRes = async (parsedOutput, context) => {
1264
- const body = parsedOutput.body;
1265
- const deserialized = (0, smithy_client_1._json)(body);
1266
- const exception = new models_0_1.KMSRequestFailedException({
1267
- $metadata: deserializeMetadata(parsedOutput),
1268
- ...deserialized,
1269
- });
1270
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1271
- };
1272
- const de_ReturnShippingLabelAlreadyExistsExceptionRes = async (parsedOutput, context) => {
1273
- const body = parsedOutput.body;
1274
- const deserialized = (0, smithy_client_1._json)(body);
1275
- const exception = new models_0_1.ReturnShippingLabelAlreadyExistsException({
1276
- $metadata: deserializeMetadata(parsedOutput),
1277
- ...deserialized,
1278
- });
1279
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1280
- };
1281
- const de_UnsupportedAddressExceptionRes = async (parsedOutput, context) => {
1282
- const body = parsedOutput.body;
1283
- const deserialized = (0, smithy_client_1._json)(body);
1284
- const exception = new models_0_1.UnsupportedAddressException({
1285
- $metadata: deserializeMetadata(parsedOutput),
1286
- ...deserialized,
1287
- });
1288
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1289
- };
1290
- const se_CreateClusterRequest = (input, context) => {
1291
- return (0, smithy_client_1.take)(input, {
1292
- AddressId: [],
1293
- Description: [],
1294
- ForceCreateJobs: [],
1295
- ForwardingAddressId: [],
1296
- InitialClusterSize: [],
1297
- JobType: [],
1298
- KmsKeyARN: [],
1299
- LongTermPricingIds: smithy_client_1._json,
1300
- Notification: smithy_client_1._json,
1301
- OnDeviceServiceConfiguration: (_) => se_OnDeviceServiceConfiguration(_, context),
1302
- RemoteManagement: [],
1303
- Resources: smithy_client_1._json,
1304
- RoleARN: [],
1305
- ShippingOption: [],
1306
- SnowballCapacityPreference: [],
1307
- SnowballType: [],
1308
- TaxDocuments: smithy_client_1._json,
1309
- });
1310
- };
1311
- const se_CreateJobRequest = (input, context) => {
1312
- return (0, smithy_client_1.take)(input, {
1313
- AddressId: [],
1314
- ClusterId: [],
1315
- Description: [],
1316
- DeviceConfiguration: smithy_client_1._json,
1317
- ForwardingAddressId: [],
1318
- ImpactLevel: [],
1319
- JobType: [],
1320
- KmsKeyARN: [],
1321
- LongTermPricingId: [],
1322
- Notification: smithy_client_1._json,
1323
- OnDeviceServiceConfiguration: (_) => se_OnDeviceServiceConfiguration(_, context),
1324
- PickupDetails: (_) => se_PickupDetails(_, context),
1325
- RemoteManagement: [],
1326
- Resources: smithy_client_1._json,
1327
- RoleARN: [],
1328
- ShippingOption: [],
1329
- SnowballCapacityPreference: [],
1330
- SnowballType: [],
1331
- TaxDocuments: smithy_client_1._json,
1332
- });
1333
- };
1334
- const se_OnDeviceServiceConfiguration = (input, context) => {
1335
- return (0, smithy_client_1.take)(input, {
1336
- EKSOnDeviceService: smithy_client_1._json,
1337
- NFSOnDeviceService: smithy_client_1._json,
1338
- S3OnDeviceService: (_) => se_S3OnDeviceServiceConfiguration(_, context),
1339
- TGWOnDeviceService: smithy_client_1._json,
1340
- });
1341
- };
1342
- const se_PickupDetails = (input, context) => {
1343
- return (0, smithy_client_1.take)(input, {
1344
- DevicePickupId: [],
1345
- Email: [],
1346
- IdentificationExpirationDate: (_) => Math.round(_.getTime() / 1000),
1347
- IdentificationIssuingOrg: [],
1348
- IdentificationNumber: [],
1349
- Name: [],
1350
- PhoneNumber: [],
1351
- });
1352
- };
1353
- const se_S3OnDeviceServiceConfiguration = (input, context) => {
1354
- return (0, smithy_client_1.take)(input, {
1355
- FaultTolerance: [],
1356
- ServiceSize: [],
1357
- StorageLimit: smithy_client_1.serializeFloat,
1358
- StorageUnit: [],
1359
- });
1360
- };
1361
- const se_UpdateClusterRequest = (input, context) => {
1362
- return (0, smithy_client_1.take)(input, {
1363
- AddressId: [],
1364
- ClusterId: [],
1365
- Description: [],
1366
- ForwardingAddressId: [],
1367
- Notification: smithy_client_1._json,
1368
- OnDeviceServiceConfiguration: (_) => se_OnDeviceServiceConfiguration(_, context),
1369
- Resources: smithy_client_1._json,
1370
- RoleARN: [],
1371
- ShippingOption: [],
1372
- });
1373
- };
1374
- const se_UpdateJobRequest = (input, context) => {
1375
- return (0, smithy_client_1.take)(input, {
1376
- AddressId: [],
1377
- Description: [],
1378
- ForwardingAddressId: [],
1379
- JobId: [],
1380
- Notification: smithy_client_1._json,
1381
- OnDeviceServiceConfiguration: (_) => se_OnDeviceServiceConfiguration(_, context),
1382
- PickupDetails: (_) => se_PickupDetails(_, context),
1383
- Resources: smithy_client_1._json,
1384
- RoleARN: [],
1385
- ShippingOption: [],
1386
- SnowballCapacityPreference: [],
1387
- });
1388
- };
1389
- const de_ClusterListEntry = (output, context) => {
1390
- return (0, smithy_client_1.take)(output, {
1391
- ClusterId: smithy_client_1.expectString,
1392
- ClusterState: smithy_client_1.expectString,
1393
- CreationDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1394
- Description: smithy_client_1.expectString,
1395
- });
1396
- };
1397
- const de_ClusterListEntryList = (output, context) => {
1398
- const retVal = (output || [])
1399
- .filter((e) => e != null)
1400
- .map((entry) => {
1401
- return de_ClusterListEntry(entry, context);
1402
- });
1403
- return retVal;
1404
- };
1405
- const de_ClusterMetadata = (output, context) => {
1406
- return (0, smithy_client_1.take)(output, {
1407
- AddressId: smithy_client_1.expectString,
1408
- ClusterId: smithy_client_1.expectString,
1409
- ClusterState: smithy_client_1.expectString,
1410
- CreationDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1411
- Description: smithy_client_1.expectString,
1412
- ForwardingAddressId: smithy_client_1.expectString,
1413
- JobType: smithy_client_1.expectString,
1414
- KmsKeyARN: smithy_client_1.expectString,
1415
- Notification: smithy_client_1._json,
1416
- OnDeviceServiceConfiguration: (_) => de_OnDeviceServiceConfiguration(_, context),
1417
- Resources: smithy_client_1._json,
1418
- RoleARN: smithy_client_1.expectString,
1419
- ShippingOption: smithy_client_1.expectString,
1420
- SnowballType: smithy_client_1.expectString,
1421
- TaxDocuments: smithy_client_1._json,
1422
- });
1423
- };
1424
- const de_CreateClusterResult = (output, context) => {
1425
- return (0, smithy_client_1.take)(output, {
1426
- ClusterId: smithy_client_1.expectString,
1427
- JobListEntries: (_) => de_JobListEntryList(_, context),
1428
- });
1429
- };
1430
- const de_DescribeClusterResult = (output, context) => {
1431
- return (0, smithy_client_1.take)(output, {
1432
- ClusterMetadata: (_) => de_ClusterMetadata(_, context),
1433
- });
1434
- };
1435
- const de_DescribeJobResult = (output, context) => {
1436
- return (0, smithy_client_1.take)(output, {
1437
- JobMetadata: (_) => de_JobMetadata(_, context),
1438
- SubJobMetadata: (_) => de_JobMetadataList(_, context),
1439
- });
1440
- };
1441
- const de_DescribeReturnShippingLabelResult = (output, context) => {
1442
- return (0, smithy_client_1.take)(output, {
1443
- ExpirationDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1444
- ReturnShippingLabelURI: smithy_client_1.expectString,
1445
- Status: smithy_client_1.expectString,
1446
- });
1447
- };
1448
- const de_JobListEntry = (output, context) => {
1449
- return (0, smithy_client_1.take)(output, {
1450
- CreationDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1451
- Description: smithy_client_1.expectString,
1452
- IsMaster: smithy_client_1.expectBoolean,
1453
- JobId: smithy_client_1.expectString,
1454
- JobState: smithy_client_1.expectString,
1455
- JobType: smithy_client_1.expectString,
1456
- SnowballType: smithy_client_1.expectString,
1457
- });
1458
- };
1459
- const de_JobListEntryList = (output, context) => {
1460
- const retVal = (output || [])
1461
- .filter((e) => e != null)
1462
- .map((entry) => {
1463
- return de_JobListEntry(entry, context);
1464
- });
1465
- return retVal;
1466
- };
1467
- const de_JobMetadata = (output, context) => {
1468
- return (0, smithy_client_1.take)(output, {
1469
- AddressId: smithy_client_1.expectString,
1470
- ClusterId: smithy_client_1.expectString,
1471
- CreationDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1472
- DataTransferProgress: smithy_client_1._json,
1473
- Description: smithy_client_1.expectString,
1474
- DeviceConfiguration: smithy_client_1._json,
1475
- ForwardingAddressId: smithy_client_1.expectString,
1476
- ImpactLevel: smithy_client_1.expectString,
1477
- JobId: smithy_client_1.expectString,
1478
- JobLogInfo: smithy_client_1._json,
1479
- JobState: smithy_client_1.expectString,
1480
- JobType: smithy_client_1.expectString,
1481
- KmsKeyARN: smithy_client_1.expectString,
1482
- LongTermPricingId: smithy_client_1.expectString,
1483
- Notification: smithy_client_1._json,
1484
- OnDeviceServiceConfiguration: (_) => de_OnDeviceServiceConfiguration(_, context),
1485
- PickupDetails: (_) => de_PickupDetails(_, context),
1486
- RemoteManagement: smithy_client_1.expectString,
1487
- Resources: smithy_client_1._json,
1488
- RoleARN: smithy_client_1.expectString,
1489
- ShippingDetails: smithy_client_1._json,
1490
- SnowballCapacityPreference: smithy_client_1.expectString,
1491
- SnowballId: smithy_client_1.expectString,
1492
- SnowballType: smithy_client_1.expectString,
1493
- TaxDocuments: smithy_client_1._json,
1494
- });
1495
- };
1496
- const de_JobMetadataList = (output, context) => {
1497
- const retVal = (output || [])
1498
- .filter((e) => e != null)
1499
- .map((entry) => {
1500
- return de_JobMetadata(entry, context);
1501
- });
1502
- return retVal;
1503
- };
1504
- const de_ListClusterJobsResult = (output, context) => {
1505
- return (0, smithy_client_1.take)(output, {
1506
- JobListEntries: (_) => de_JobListEntryList(_, context),
1507
- NextToken: smithy_client_1.expectString,
1508
- });
1509
- };
1510
- const de_ListClustersResult = (output, context) => {
1511
- return (0, smithy_client_1.take)(output, {
1512
- ClusterListEntries: (_) => de_ClusterListEntryList(_, context),
1513
- NextToken: smithy_client_1.expectString,
1514
- });
1515
- };
1516
- const de_ListJobsResult = (output, context) => {
1517
- return (0, smithy_client_1.take)(output, {
1518
- JobListEntries: (_) => de_JobListEntryList(_, context),
1519
- NextToken: smithy_client_1.expectString,
1520
- });
1521
- };
1522
- const de_ListLongTermPricingResult = (output, context) => {
1523
- return (0, smithy_client_1.take)(output, {
1524
- LongTermPricingEntries: (_) => de_LongTermPricingEntryList(_, context),
1525
- NextToken: smithy_client_1.expectString,
1526
- });
1527
- };
1528
- const de_LongTermPricingEntryList = (output, context) => {
1529
- const retVal = (output || [])
1530
- .filter((e) => e != null)
1531
- .map((entry) => {
1532
- return de_LongTermPricingListEntry(entry, context);
1533
- });
1534
- return retVal;
1535
- };
1536
- const de_LongTermPricingListEntry = (output, context) => {
1537
- return (0, smithy_client_1.take)(output, {
1538
- CurrentActiveJob: smithy_client_1.expectString,
1539
- IsLongTermPricingAutoRenew: smithy_client_1.expectBoolean,
1540
- JobIds: smithy_client_1._json,
1541
- LongTermPricingEndDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1542
- LongTermPricingId: smithy_client_1.expectString,
1543
- LongTermPricingStartDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1544
- LongTermPricingStatus: smithy_client_1.expectString,
1545
- LongTermPricingType: smithy_client_1.expectString,
1546
- ReplacementJob: smithy_client_1.expectString,
1547
- SnowballType: smithy_client_1.expectString,
1548
- });
1549
- };
1550
- const de_OnDeviceServiceConfiguration = (output, context) => {
1551
- return (0, smithy_client_1.take)(output, {
1552
- EKSOnDeviceService: smithy_client_1._json,
1553
- NFSOnDeviceService: smithy_client_1._json,
1554
- S3OnDeviceService: (_) => de_S3OnDeviceServiceConfiguration(_, context),
1555
- TGWOnDeviceService: smithy_client_1._json,
1556
- });
1557
- };
1558
- const de_PickupDetails = (output, context) => {
1559
- return (0, smithy_client_1.take)(output, {
1560
- DevicePickupId: smithy_client_1.expectString,
1561
- Email: smithy_client_1.expectString,
1562
- IdentificationExpirationDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1563
- IdentificationIssuingOrg: smithy_client_1.expectString,
1564
- IdentificationNumber: smithy_client_1.expectString,
1565
- Name: smithy_client_1.expectString,
1566
- PhoneNumber: smithy_client_1.expectString,
1567
- });
1568
- };
1569
- const de_S3OnDeviceServiceConfiguration = (output, context) => {
1570
- return (0, smithy_client_1.take)(output, {
1571
- FaultTolerance: smithy_client_1.expectInt32,
1572
- ServiceSize: smithy_client_1.expectInt32,
1573
- StorageLimit: smithy_client_1.limitedParseDouble,
1574
- StorageUnit: smithy_client_1.expectString,
1575
- });
1576
- };
1577
- const deserializeMetadata = (output) => ({
1578
- httpStatusCode: output.statusCode,
1579
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1580
- extendedRequestId: output.headers["x-amz-id-2"],
1581
- cfId: output.headers["x-amz-cf-id"],
1582
- });
1583
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
1584
- const throwDefaultError = (0, smithy_client_1.withBaseException)(SnowballServiceException_1.SnowballServiceException);
1585
- const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
1586
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1587
- const contents = {
1588
- protocol,
1589
- hostname,
1590
- port,
1591
- method: "POST",
1592
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1593
- headers,
1594
- };
1595
- if (resolvedHostname !== undefined) {
1596
- contents.hostname = resolvedHostname;
1597
- }
1598
- if (body !== undefined) {
1599
- contents.body = body;
1600
- }
1601
- return new protocol_http_1.HttpRequest(contents);
1602
- };
1603
- function sharedHeaders(operation) {
1604
- return {
1605
- "content-type": "application/x-amz-json-1.1",
1606
- "x-amz-target": `AWSIESnowballJobManagementService.${operation}`,
1607
- };
1608
- }
1609
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1610
- if (encoded.length) {
1611
- return JSON.parse(encoded);
1612
- }
1613
- return {};
1614
- });
1615
- const parseErrorBody = async (errorBody, context) => {
1616
- const value = await parseBody(errorBody, context);
1617
- value.message = value.message ?? value.Message;
1618
- return value;
1619
- };
1620
- const loadRestJsonErrorCode = (output, data) => {
1621
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1622
- const sanitizeErrorCode = (rawValue) => {
1623
- let cleanValue = rawValue;
1624
- if (typeof cleanValue === "number") {
1625
- cleanValue = cleanValue.toString();
1626
- }
1627
- if (cleanValue.indexOf(",") >= 0) {
1628
- cleanValue = cleanValue.split(",")[0];
1629
- }
1630
- if (cleanValue.indexOf(":") >= 0) {
1631
- cleanValue = cleanValue.split(":")[0];
1632
- }
1633
- if (cleanValue.indexOf("#") >= 0) {
1634
- cleanValue = cleanValue.split("#")[1];
1635
- }
1636
- return cleanValue;
1637
- };
1638
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1639
- if (headerKey !== undefined) {
1640
- return sanitizeErrorCode(output.headers[headerKey]);
1641
- }
1642
- if (data.code !== undefined) {
1643
- return sanitizeErrorCode(data.code);
1644
- }
1645
- if (data["__type"] !== undefined) {
1646
- return sanitizeErrorCode(data["__type"]);
1647
- }
1648
- };
1
+ module.exports = require("../index.js");