@aws-sdk/client-acm 3.490.0 → 3.495.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist-cjs/ACM.js +1 -41
  2. package/dist-cjs/ACMClient.js +1 -43
  3. package/dist-cjs/commands/AddTagsToCertificateCommand.js +1 -28
  4. package/dist-cjs/commands/DeleteCertificateCommand.js +1 -28
  5. package/dist-cjs/commands/DescribeCertificateCommand.js +1 -28
  6. package/dist-cjs/commands/ExportCertificateCommand.js +1 -29
  7. package/dist-cjs/commands/GetAccountConfigurationCommand.js +1 -28
  8. package/dist-cjs/commands/GetCertificateCommand.js +1 -28
  9. package/dist-cjs/commands/ImportCertificateCommand.js +1 -29
  10. package/dist-cjs/commands/ListCertificatesCommand.js +1 -28
  11. package/dist-cjs/commands/ListTagsForCertificateCommand.js +1 -28
  12. package/dist-cjs/commands/PutAccountConfigurationCommand.js +1 -28
  13. package/dist-cjs/commands/RemoveTagsFromCertificateCommand.js +1 -28
  14. package/dist-cjs/commands/RenewCertificateCommand.js +1 -28
  15. package/dist-cjs/commands/RequestCertificateCommand.js +1 -28
  16. package/dist-cjs/commands/ResendValidationEmailCommand.js +1 -28
  17. package/dist-cjs/commands/UpdateCertificateOptionsCommand.js +1 -28
  18. package/dist-cjs/commands/index.js +1 -18
  19. package/dist-cjs/endpoint/EndpointParameters.js +1 -18
  20. package/dist-cjs/extensionConfiguration.js +1 -2
  21. package/dist-cjs/index.js +1998 -12
  22. package/dist-cjs/models/ACMServiceException.js +1 -12
  23. package/dist-cjs/models/index.js +1 -4
  24. package/dist-cjs/models/models_0.js +1 -343
  25. package/dist-cjs/pagination/Interfaces.js +1 -2
  26. package/dist-cjs/pagination/ListCertificatesPaginator.js +1 -7
  27. package/dist-cjs/pagination/index.js +1 -5
  28. package/dist-cjs/protocols/Aws_json1_1.js +1 -1033
  29. package/dist-cjs/runtimeExtensions.js +1 -22
  30. package/dist-cjs/waiters/index.js +1 -4
  31. package/dist-cjs/waiters/waitForCertificateValidated.js +1 -71
  32. package/package.json +41 -41
@@ -1,1033 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_UpdateCertificateOptionsCommand = exports.de_ResendValidationEmailCommand = exports.de_RequestCertificateCommand = exports.de_RenewCertificateCommand = exports.de_RemoveTagsFromCertificateCommand = exports.de_PutAccountConfigurationCommand = exports.de_ListTagsForCertificateCommand = exports.de_ListCertificatesCommand = exports.de_ImportCertificateCommand = exports.de_GetCertificateCommand = exports.de_GetAccountConfigurationCommand = exports.de_ExportCertificateCommand = exports.de_DescribeCertificateCommand = exports.de_DeleteCertificateCommand = exports.de_AddTagsToCertificateCommand = exports.se_UpdateCertificateOptionsCommand = exports.se_ResendValidationEmailCommand = exports.se_RequestCertificateCommand = exports.se_RenewCertificateCommand = exports.se_RemoveTagsFromCertificateCommand = exports.se_PutAccountConfigurationCommand = exports.se_ListTagsForCertificateCommand = exports.se_ListCertificatesCommand = exports.se_ImportCertificateCommand = exports.se_GetCertificateCommand = exports.se_GetAccountConfigurationCommand = exports.se_ExportCertificateCommand = exports.se_DescribeCertificateCommand = exports.se_DeleteCertificateCommand = exports.se_AddTagsToCertificateCommand = void 0;
4
- const protocol_http_1 = require("@smithy/protocol-http");
5
- const smithy_client_1 = require("@smithy/smithy-client");
6
- const ACMServiceException_1 = require("../models/ACMServiceException");
7
- const models_0_1 = require("../models/models_0");
8
- const se_AddTagsToCertificateCommand = async (input, context) => {
9
- const headers = sharedHeaders("AddTagsToCertificate");
10
- let body;
11
- body = JSON.stringify((0, smithy_client_1._json)(input));
12
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
- };
14
- exports.se_AddTagsToCertificateCommand = se_AddTagsToCertificateCommand;
15
- const se_DeleteCertificateCommand = async (input, context) => {
16
- const headers = sharedHeaders("DeleteCertificate");
17
- let body;
18
- body = JSON.stringify((0, smithy_client_1._json)(input));
19
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
20
- };
21
- exports.se_DeleteCertificateCommand = se_DeleteCertificateCommand;
22
- const se_DescribeCertificateCommand = async (input, context) => {
23
- const headers = sharedHeaders("DescribeCertificate");
24
- let body;
25
- body = JSON.stringify((0, smithy_client_1._json)(input));
26
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
27
- };
28
- exports.se_DescribeCertificateCommand = se_DescribeCertificateCommand;
29
- const se_ExportCertificateCommand = async (input, context) => {
30
- const headers = sharedHeaders("ExportCertificate");
31
- let body;
32
- body = JSON.stringify(se_ExportCertificateRequest(input, context));
33
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
34
- };
35
- exports.se_ExportCertificateCommand = se_ExportCertificateCommand;
36
- const se_GetAccountConfigurationCommand = async (input, context) => {
37
- const headers = sharedHeaders("GetAccountConfiguration");
38
- const body = "{}";
39
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
40
- };
41
- exports.se_GetAccountConfigurationCommand = se_GetAccountConfigurationCommand;
42
- const se_GetCertificateCommand = async (input, context) => {
43
- const headers = sharedHeaders("GetCertificate");
44
- let body;
45
- body = JSON.stringify((0, smithy_client_1._json)(input));
46
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
47
- };
48
- exports.se_GetCertificateCommand = se_GetCertificateCommand;
49
- const se_ImportCertificateCommand = async (input, context) => {
50
- const headers = sharedHeaders("ImportCertificate");
51
- let body;
52
- body = JSON.stringify(se_ImportCertificateRequest(input, context));
53
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
54
- };
55
- exports.se_ImportCertificateCommand = se_ImportCertificateCommand;
56
- const se_ListCertificatesCommand = async (input, context) => {
57
- const headers = sharedHeaders("ListCertificates");
58
- let body;
59
- body = JSON.stringify((0, smithy_client_1._json)(input));
60
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
61
- };
62
- exports.se_ListCertificatesCommand = se_ListCertificatesCommand;
63
- const se_ListTagsForCertificateCommand = async (input, context) => {
64
- const headers = sharedHeaders("ListTagsForCertificate");
65
- let body;
66
- body = JSON.stringify((0, smithy_client_1._json)(input));
67
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
68
- };
69
- exports.se_ListTagsForCertificateCommand = se_ListTagsForCertificateCommand;
70
- const se_PutAccountConfigurationCommand = async (input, context) => {
71
- const headers = sharedHeaders("PutAccountConfiguration");
72
- let body;
73
- body = JSON.stringify((0, smithy_client_1._json)(input));
74
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
75
- };
76
- exports.se_PutAccountConfigurationCommand = se_PutAccountConfigurationCommand;
77
- const se_RemoveTagsFromCertificateCommand = async (input, context) => {
78
- const headers = sharedHeaders("RemoveTagsFromCertificate");
79
- let body;
80
- body = JSON.stringify((0, smithy_client_1._json)(input));
81
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
82
- };
83
- exports.se_RemoveTagsFromCertificateCommand = se_RemoveTagsFromCertificateCommand;
84
- const se_RenewCertificateCommand = async (input, context) => {
85
- const headers = sharedHeaders("RenewCertificate");
86
- let body;
87
- body = JSON.stringify((0, smithy_client_1._json)(input));
88
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
89
- };
90
- exports.se_RenewCertificateCommand = se_RenewCertificateCommand;
91
- const se_RequestCertificateCommand = async (input, context) => {
92
- const headers = sharedHeaders("RequestCertificate");
93
- let body;
94
- body = JSON.stringify((0, smithy_client_1._json)(input));
95
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
96
- };
97
- exports.se_RequestCertificateCommand = se_RequestCertificateCommand;
98
- const se_ResendValidationEmailCommand = async (input, context) => {
99
- const headers = sharedHeaders("ResendValidationEmail");
100
- let body;
101
- body = JSON.stringify((0, smithy_client_1._json)(input));
102
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
103
- };
104
- exports.se_ResendValidationEmailCommand = se_ResendValidationEmailCommand;
105
- const se_UpdateCertificateOptionsCommand = async (input, context) => {
106
- const headers = sharedHeaders("UpdateCertificateOptions");
107
- let body;
108
- body = JSON.stringify((0, smithy_client_1._json)(input));
109
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
110
- };
111
- exports.se_UpdateCertificateOptionsCommand = se_UpdateCertificateOptionsCommand;
112
- const de_AddTagsToCertificateCommand = async (output, context) => {
113
- if (output.statusCode >= 300) {
114
- return de_AddTagsToCertificateCommandError(output, context);
115
- }
116
- await (0, smithy_client_1.collectBody)(output.body, context);
117
- const response = {
118
- $metadata: deserializeMetadata(output),
119
- };
120
- return response;
121
- };
122
- exports.de_AddTagsToCertificateCommand = de_AddTagsToCertificateCommand;
123
- const de_AddTagsToCertificateCommandError = async (output, context) => {
124
- const parsedOutput = {
125
- ...output,
126
- body: await parseErrorBody(output.body, context),
127
- };
128
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
129
- switch (errorCode) {
130
- case "InvalidArnException":
131
- case "com.amazonaws.acm#InvalidArnException":
132
- throw await de_InvalidArnExceptionRes(parsedOutput, context);
133
- case "InvalidParameterException":
134
- case "com.amazonaws.acm#InvalidParameterException":
135
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
136
- case "InvalidTagException":
137
- case "com.amazonaws.acm#InvalidTagException":
138
- throw await de_InvalidTagExceptionRes(parsedOutput, context);
139
- case "ResourceNotFoundException":
140
- case "com.amazonaws.acm#ResourceNotFoundException":
141
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
142
- case "TagPolicyException":
143
- case "com.amazonaws.acm#TagPolicyException":
144
- throw await de_TagPolicyExceptionRes(parsedOutput, context);
145
- case "ThrottlingException":
146
- case "com.amazonaws.acm#ThrottlingException":
147
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
148
- case "TooManyTagsException":
149
- case "com.amazonaws.acm#TooManyTagsException":
150
- throw await de_TooManyTagsExceptionRes(parsedOutput, context);
151
- default:
152
- const parsedBody = parsedOutput.body;
153
- return throwDefaultError({
154
- output,
155
- parsedBody,
156
- errorCode,
157
- });
158
- }
159
- };
160
- const de_DeleteCertificateCommand = async (output, context) => {
161
- if (output.statusCode >= 300) {
162
- return de_DeleteCertificateCommandError(output, context);
163
- }
164
- await (0, smithy_client_1.collectBody)(output.body, context);
165
- const response = {
166
- $metadata: deserializeMetadata(output),
167
- };
168
- return response;
169
- };
170
- exports.de_DeleteCertificateCommand = de_DeleteCertificateCommand;
171
- const de_DeleteCertificateCommandError = async (output, context) => {
172
- const parsedOutput = {
173
- ...output,
174
- body: await parseErrorBody(output.body, context),
175
- };
176
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
177
- switch (errorCode) {
178
- case "AccessDeniedException":
179
- case "com.amazonaws.acm#AccessDeniedException":
180
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
181
- case "ConflictException":
182
- case "com.amazonaws.acm#ConflictException":
183
- throw await de_ConflictExceptionRes(parsedOutput, context);
184
- case "InvalidArnException":
185
- case "com.amazonaws.acm#InvalidArnException":
186
- throw await de_InvalidArnExceptionRes(parsedOutput, context);
187
- case "ResourceInUseException":
188
- case "com.amazonaws.acm#ResourceInUseException":
189
- throw await de_ResourceInUseExceptionRes(parsedOutput, context);
190
- case "ResourceNotFoundException":
191
- case "com.amazonaws.acm#ResourceNotFoundException":
192
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
193
- case "ThrottlingException":
194
- case "com.amazonaws.acm#ThrottlingException":
195
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
196
- default:
197
- const parsedBody = parsedOutput.body;
198
- return throwDefaultError({
199
- output,
200
- parsedBody,
201
- errorCode,
202
- });
203
- }
204
- };
205
- const de_DescribeCertificateCommand = async (output, context) => {
206
- if (output.statusCode >= 300) {
207
- return de_DescribeCertificateCommandError(output, context);
208
- }
209
- const data = await parseBody(output.body, context);
210
- let contents = {};
211
- contents = de_DescribeCertificateResponse(data, context);
212
- const response = {
213
- $metadata: deserializeMetadata(output),
214
- ...contents,
215
- };
216
- return response;
217
- };
218
- exports.de_DescribeCertificateCommand = de_DescribeCertificateCommand;
219
- const de_DescribeCertificateCommandError = async (output, context) => {
220
- const parsedOutput = {
221
- ...output,
222
- body: await parseErrorBody(output.body, context),
223
- };
224
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
225
- switch (errorCode) {
226
- case "InvalidArnException":
227
- case "com.amazonaws.acm#InvalidArnException":
228
- throw await de_InvalidArnExceptionRes(parsedOutput, context);
229
- case "ResourceNotFoundException":
230
- case "com.amazonaws.acm#ResourceNotFoundException":
231
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
232
- default:
233
- const parsedBody = parsedOutput.body;
234
- return throwDefaultError({
235
- output,
236
- parsedBody,
237
- errorCode,
238
- });
239
- }
240
- };
241
- const de_ExportCertificateCommand = async (output, context) => {
242
- if (output.statusCode >= 300) {
243
- return de_ExportCertificateCommandError(output, context);
244
- }
245
- const data = await parseBody(output.body, context);
246
- let contents = {};
247
- contents = (0, smithy_client_1._json)(data);
248
- const response = {
249
- $metadata: deserializeMetadata(output),
250
- ...contents,
251
- };
252
- return response;
253
- };
254
- exports.de_ExportCertificateCommand = de_ExportCertificateCommand;
255
- const de_ExportCertificateCommandError = async (output, context) => {
256
- const parsedOutput = {
257
- ...output,
258
- body: await parseErrorBody(output.body, context),
259
- };
260
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
261
- switch (errorCode) {
262
- case "InvalidArnException":
263
- case "com.amazonaws.acm#InvalidArnException":
264
- throw await de_InvalidArnExceptionRes(parsedOutput, context);
265
- case "RequestInProgressException":
266
- case "com.amazonaws.acm#RequestInProgressException":
267
- throw await de_RequestInProgressExceptionRes(parsedOutput, context);
268
- case "ResourceNotFoundException":
269
- case "com.amazonaws.acm#ResourceNotFoundException":
270
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
271
- default:
272
- const parsedBody = parsedOutput.body;
273
- return throwDefaultError({
274
- output,
275
- parsedBody,
276
- errorCode,
277
- });
278
- }
279
- };
280
- const de_GetAccountConfigurationCommand = async (output, context) => {
281
- if (output.statusCode >= 300) {
282
- return de_GetAccountConfigurationCommandError(output, context);
283
- }
284
- const data = await parseBody(output.body, context);
285
- let contents = {};
286
- contents = (0, smithy_client_1._json)(data);
287
- const response = {
288
- $metadata: deserializeMetadata(output),
289
- ...contents,
290
- };
291
- return response;
292
- };
293
- exports.de_GetAccountConfigurationCommand = de_GetAccountConfigurationCommand;
294
- const de_GetAccountConfigurationCommandError = async (output, context) => {
295
- const parsedOutput = {
296
- ...output,
297
- body: await parseErrorBody(output.body, context),
298
- };
299
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
300
- switch (errorCode) {
301
- case "AccessDeniedException":
302
- case "com.amazonaws.acm#AccessDeniedException":
303
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
304
- case "ThrottlingException":
305
- case "com.amazonaws.acm#ThrottlingException":
306
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
307
- default:
308
- const parsedBody = parsedOutput.body;
309
- return throwDefaultError({
310
- output,
311
- parsedBody,
312
- errorCode,
313
- });
314
- }
315
- };
316
- const de_GetCertificateCommand = async (output, context) => {
317
- if (output.statusCode >= 300) {
318
- return de_GetCertificateCommandError(output, context);
319
- }
320
- const data = await parseBody(output.body, context);
321
- let contents = {};
322
- contents = (0, smithy_client_1._json)(data);
323
- const response = {
324
- $metadata: deserializeMetadata(output),
325
- ...contents,
326
- };
327
- return response;
328
- };
329
- exports.de_GetCertificateCommand = de_GetCertificateCommand;
330
- const de_GetCertificateCommandError = async (output, context) => {
331
- const parsedOutput = {
332
- ...output,
333
- body: await parseErrorBody(output.body, context),
334
- };
335
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
336
- switch (errorCode) {
337
- case "InvalidArnException":
338
- case "com.amazonaws.acm#InvalidArnException":
339
- throw await de_InvalidArnExceptionRes(parsedOutput, context);
340
- case "RequestInProgressException":
341
- case "com.amazonaws.acm#RequestInProgressException":
342
- throw await de_RequestInProgressExceptionRes(parsedOutput, context);
343
- case "ResourceNotFoundException":
344
- case "com.amazonaws.acm#ResourceNotFoundException":
345
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
346
- default:
347
- const parsedBody = parsedOutput.body;
348
- return throwDefaultError({
349
- output,
350
- parsedBody,
351
- errorCode,
352
- });
353
- }
354
- };
355
- const de_ImportCertificateCommand = async (output, context) => {
356
- if (output.statusCode >= 300) {
357
- return de_ImportCertificateCommandError(output, context);
358
- }
359
- const data = await parseBody(output.body, context);
360
- let contents = {};
361
- contents = (0, smithy_client_1._json)(data);
362
- const response = {
363
- $metadata: deserializeMetadata(output),
364
- ...contents,
365
- };
366
- return response;
367
- };
368
- exports.de_ImportCertificateCommand = de_ImportCertificateCommand;
369
- const de_ImportCertificateCommandError = async (output, context) => {
370
- const parsedOutput = {
371
- ...output,
372
- body: await parseErrorBody(output.body, context),
373
- };
374
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
375
- switch (errorCode) {
376
- case "InvalidArnException":
377
- case "com.amazonaws.acm#InvalidArnException":
378
- throw await de_InvalidArnExceptionRes(parsedOutput, context);
379
- case "InvalidParameterException":
380
- case "com.amazonaws.acm#InvalidParameterException":
381
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
382
- case "InvalidTagException":
383
- case "com.amazonaws.acm#InvalidTagException":
384
- throw await de_InvalidTagExceptionRes(parsedOutput, context);
385
- case "LimitExceededException":
386
- case "com.amazonaws.acm#LimitExceededException":
387
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
388
- case "ResourceNotFoundException":
389
- case "com.amazonaws.acm#ResourceNotFoundException":
390
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
391
- case "TagPolicyException":
392
- case "com.amazonaws.acm#TagPolicyException":
393
- throw await de_TagPolicyExceptionRes(parsedOutput, context);
394
- case "TooManyTagsException":
395
- case "com.amazonaws.acm#TooManyTagsException":
396
- throw await de_TooManyTagsExceptionRes(parsedOutput, context);
397
- default:
398
- const parsedBody = parsedOutput.body;
399
- return throwDefaultError({
400
- output,
401
- parsedBody,
402
- errorCode,
403
- });
404
- }
405
- };
406
- const de_ListCertificatesCommand = async (output, context) => {
407
- if (output.statusCode >= 300) {
408
- return de_ListCertificatesCommandError(output, context);
409
- }
410
- const data = await parseBody(output.body, context);
411
- let contents = {};
412
- contents = de_ListCertificatesResponse(data, context);
413
- const response = {
414
- $metadata: deserializeMetadata(output),
415
- ...contents,
416
- };
417
- return response;
418
- };
419
- exports.de_ListCertificatesCommand = de_ListCertificatesCommand;
420
- const de_ListCertificatesCommandError = async (output, context) => {
421
- const parsedOutput = {
422
- ...output,
423
- body: await parseErrorBody(output.body, context),
424
- };
425
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
426
- switch (errorCode) {
427
- case "InvalidArgsException":
428
- case "com.amazonaws.acm#InvalidArgsException":
429
- throw await de_InvalidArgsExceptionRes(parsedOutput, context);
430
- case "ValidationException":
431
- case "com.amazonaws.acm#ValidationException":
432
- throw await de_ValidationExceptionRes(parsedOutput, context);
433
- default:
434
- const parsedBody = parsedOutput.body;
435
- return throwDefaultError({
436
- output,
437
- parsedBody,
438
- errorCode,
439
- });
440
- }
441
- };
442
- const de_ListTagsForCertificateCommand = async (output, context) => {
443
- if (output.statusCode >= 300) {
444
- return de_ListTagsForCertificateCommandError(output, context);
445
- }
446
- const data = await parseBody(output.body, context);
447
- let contents = {};
448
- contents = (0, smithy_client_1._json)(data);
449
- const response = {
450
- $metadata: deserializeMetadata(output),
451
- ...contents,
452
- };
453
- return response;
454
- };
455
- exports.de_ListTagsForCertificateCommand = de_ListTagsForCertificateCommand;
456
- const de_ListTagsForCertificateCommandError = async (output, context) => {
457
- const parsedOutput = {
458
- ...output,
459
- body: await parseErrorBody(output.body, context),
460
- };
461
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
462
- switch (errorCode) {
463
- case "InvalidArnException":
464
- case "com.amazonaws.acm#InvalidArnException":
465
- throw await de_InvalidArnExceptionRes(parsedOutput, context);
466
- case "ResourceNotFoundException":
467
- case "com.amazonaws.acm#ResourceNotFoundException":
468
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
469
- default:
470
- const parsedBody = parsedOutput.body;
471
- return throwDefaultError({
472
- output,
473
- parsedBody,
474
- errorCode,
475
- });
476
- }
477
- };
478
- const de_PutAccountConfigurationCommand = async (output, context) => {
479
- if (output.statusCode >= 300) {
480
- return de_PutAccountConfigurationCommandError(output, context);
481
- }
482
- await (0, smithy_client_1.collectBody)(output.body, context);
483
- const response = {
484
- $metadata: deserializeMetadata(output),
485
- };
486
- return response;
487
- };
488
- exports.de_PutAccountConfigurationCommand = de_PutAccountConfigurationCommand;
489
- const de_PutAccountConfigurationCommandError = async (output, context) => {
490
- const parsedOutput = {
491
- ...output,
492
- body: await parseErrorBody(output.body, context),
493
- };
494
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
495
- switch (errorCode) {
496
- case "AccessDeniedException":
497
- case "com.amazonaws.acm#AccessDeniedException":
498
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
499
- case "ConflictException":
500
- case "com.amazonaws.acm#ConflictException":
501
- throw await de_ConflictExceptionRes(parsedOutput, context);
502
- case "ThrottlingException":
503
- case "com.amazonaws.acm#ThrottlingException":
504
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
505
- case "ValidationException":
506
- case "com.amazonaws.acm#ValidationException":
507
- throw await de_ValidationExceptionRes(parsedOutput, context);
508
- default:
509
- const parsedBody = parsedOutput.body;
510
- return throwDefaultError({
511
- output,
512
- parsedBody,
513
- errorCode,
514
- });
515
- }
516
- };
517
- const de_RemoveTagsFromCertificateCommand = async (output, context) => {
518
- if (output.statusCode >= 300) {
519
- return de_RemoveTagsFromCertificateCommandError(output, context);
520
- }
521
- await (0, smithy_client_1.collectBody)(output.body, context);
522
- const response = {
523
- $metadata: deserializeMetadata(output),
524
- };
525
- return response;
526
- };
527
- exports.de_RemoveTagsFromCertificateCommand = de_RemoveTagsFromCertificateCommand;
528
- const de_RemoveTagsFromCertificateCommandError = async (output, context) => {
529
- const parsedOutput = {
530
- ...output,
531
- body: await parseErrorBody(output.body, context),
532
- };
533
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
534
- switch (errorCode) {
535
- case "InvalidArnException":
536
- case "com.amazonaws.acm#InvalidArnException":
537
- throw await de_InvalidArnExceptionRes(parsedOutput, context);
538
- case "InvalidParameterException":
539
- case "com.amazonaws.acm#InvalidParameterException":
540
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
541
- case "InvalidTagException":
542
- case "com.amazonaws.acm#InvalidTagException":
543
- throw await de_InvalidTagExceptionRes(parsedOutput, context);
544
- case "ResourceNotFoundException":
545
- case "com.amazonaws.acm#ResourceNotFoundException":
546
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
547
- case "TagPolicyException":
548
- case "com.amazonaws.acm#TagPolicyException":
549
- throw await de_TagPolicyExceptionRes(parsedOutput, context);
550
- case "ThrottlingException":
551
- case "com.amazonaws.acm#ThrottlingException":
552
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
553
- default:
554
- const parsedBody = parsedOutput.body;
555
- return throwDefaultError({
556
- output,
557
- parsedBody,
558
- errorCode,
559
- });
560
- }
561
- };
562
- const de_RenewCertificateCommand = async (output, context) => {
563
- if (output.statusCode >= 300) {
564
- return de_RenewCertificateCommandError(output, context);
565
- }
566
- await (0, smithy_client_1.collectBody)(output.body, context);
567
- const response = {
568
- $metadata: deserializeMetadata(output),
569
- };
570
- return response;
571
- };
572
- exports.de_RenewCertificateCommand = de_RenewCertificateCommand;
573
- const de_RenewCertificateCommandError = async (output, context) => {
574
- const parsedOutput = {
575
- ...output,
576
- body: await parseErrorBody(output.body, context),
577
- };
578
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
579
- switch (errorCode) {
580
- case "InvalidArnException":
581
- case "com.amazonaws.acm#InvalidArnException":
582
- throw await de_InvalidArnExceptionRes(parsedOutput, context);
583
- case "ResourceNotFoundException":
584
- case "com.amazonaws.acm#ResourceNotFoundException":
585
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
586
- default:
587
- const parsedBody = parsedOutput.body;
588
- return throwDefaultError({
589
- output,
590
- parsedBody,
591
- errorCode,
592
- });
593
- }
594
- };
595
- const de_RequestCertificateCommand = async (output, context) => {
596
- if (output.statusCode >= 300) {
597
- return de_RequestCertificateCommandError(output, context);
598
- }
599
- const data = await parseBody(output.body, context);
600
- let contents = {};
601
- contents = (0, smithy_client_1._json)(data);
602
- const response = {
603
- $metadata: deserializeMetadata(output),
604
- ...contents,
605
- };
606
- return response;
607
- };
608
- exports.de_RequestCertificateCommand = de_RequestCertificateCommand;
609
- const de_RequestCertificateCommandError = async (output, context) => {
610
- const parsedOutput = {
611
- ...output,
612
- body: await parseErrorBody(output.body, context),
613
- };
614
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
615
- switch (errorCode) {
616
- case "InvalidArnException":
617
- case "com.amazonaws.acm#InvalidArnException":
618
- throw await de_InvalidArnExceptionRes(parsedOutput, context);
619
- case "InvalidDomainValidationOptionsException":
620
- case "com.amazonaws.acm#InvalidDomainValidationOptionsException":
621
- throw await de_InvalidDomainValidationOptionsExceptionRes(parsedOutput, context);
622
- case "InvalidParameterException":
623
- case "com.amazonaws.acm#InvalidParameterException":
624
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
625
- case "InvalidTagException":
626
- case "com.amazonaws.acm#InvalidTagException":
627
- throw await de_InvalidTagExceptionRes(parsedOutput, context);
628
- case "LimitExceededException":
629
- case "com.amazonaws.acm#LimitExceededException":
630
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
631
- case "TagPolicyException":
632
- case "com.amazonaws.acm#TagPolicyException":
633
- throw await de_TagPolicyExceptionRes(parsedOutput, context);
634
- case "TooManyTagsException":
635
- case "com.amazonaws.acm#TooManyTagsException":
636
- throw await de_TooManyTagsExceptionRes(parsedOutput, context);
637
- default:
638
- const parsedBody = parsedOutput.body;
639
- return throwDefaultError({
640
- output,
641
- parsedBody,
642
- errorCode,
643
- });
644
- }
645
- };
646
- const de_ResendValidationEmailCommand = async (output, context) => {
647
- if (output.statusCode >= 300) {
648
- return de_ResendValidationEmailCommandError(output, context);
649
- }
650
- await (0, smithy_client_1.collectBody)(output.body, context);
651
- const response = {
652
- $metadata: deserializeMetadata(output),
653
- };
654
- return response;
655
- };
656
- exports.de_ResendValidationEmailCommand = de_ResendValidationEmailCommand;
657
- const de_ResendValidationEmailCommandError = async (output, context) => {
658
- const parsedOutput = {
659
- ...output,
660
- body: await parseErrorBody(output.body, context),
661
- };
662
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
663
- switch (errorCode) {
664
- case "InvalidArnException":
665
- case "com.amazonaws.acm#InvalidArnException":
666
- throw await de_InvalidArnExceptionRes(parsedOutput, context);
667
- case "InvalidDomainValidationOptionsException":
668
- case "com.amazonaws.acm#InvalidDomainValidationOptionsException":
669
- throw await de_InvalidDomainValidationOptionsExceptionRes(parsedOutput, context);
670
- case "InvalidStateException":
671
- case "com.amazonaws.acm#InvalidStateException":
672
- throw await de_InvalidStateExceptionRes(parsedOutput, context);
673
- case "ResourceNotFoundException":
674
- case "com.amazonaws.acm#ResourceNotFoundException":
675
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
676
- default:
677
- const parsedBody = parsedOutput.body;
678
- return throwDefaultError({
679
- output,
680
- parsedBody,
681
- errorCode,
682
- });
683
- }
684
- };
685
- const de_UpdateCertificateOptionsCommand = async (output, context) => {
686
- if (output.statusCode >= 300) {
687
- return de_UpdateCertificateOptionsCommandError(output, context);
688
- }
689
- await (0, smithy_client_1.collectBody)(output.body, context);
690
- const response = {
691
- $metadata: deserializeMetadata(output),
692
- };
693
- return response;
694
- };
695
- exports.de_UpdateCertificateOptionsCommand = de_UpdateCertificateOptionsCommand;
696
- const de_UpdateCertificateOptionsCommandError = async (output, context) => {
697
- const parsedOutput = {
698
- ...output,
699
- body: await parseErrorBody(output.body, context),
700
- };
701
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
702
- switch (errorCode) {
703
- case "InvalidArnException":
704
- case "com.amazonaws.acm#InvalidArnException":
705
- throw await de_InvalidArnExceptionRes(parsedOutput, context);
706
- case "InvalidStateException":
707
- case "com.amazonaws.acm#InvalidStateException":
708
- throw await de_InvalidStateExceptionRes(parsedOutput, context);
709
- case "LimitExceededException":
710
- case "com.amazonaws.acm#LimitExceededException":
711
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
712
- case "ResourceNotFoundException":
713
- case "com.amazonaws.acm#ResourceNotFoundException":
714
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
715
- default:
716
- const parsedBody = parsedOutput.body;
717
- return throwDefaultError({
718
- output,
719
- parsedBody,
720
- errorCode,
721
- });
722
- }
723
- };
724
- const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
725
- const body = parsedOutput.body;
726
- const deserialized = (0, smithy_client_1._json)(body);
727
- const exception = new models_0_1.AccessDeniedException({
728
- $metadata: deserializeMetadata(parsedOutput),
729
- ...deserialized,
730
- });
731
- return (0, smithy_client_1.decorateServiceException)(exception, body);
732
- };
733
- const de_ConflictExceptionRes = async (parsedOutput, context) => {
734
- const body = parsedOutput.body;
735
- const deserialized = (0, smithy_client_1._json)(body);
736
- const exception = new models_0_1.ConflictException({
737
- $metadata: deserializeMetadata(parsedOutput),
738
- ...deserialized,
739
- });
740
- return (0, smithy_client_1.decorateServiceException)(exception, body);
741
- };
742
- const de_InvalidArgsExceptionRes = async (parsedOutput, context) => {
743
- const body = parsedOutput.body;
744
- const deserialized = (0, smithy_client_1._json)(body);
745
- const exception = new models_0_1.InvalidArgsException({
746
- $metadata: deserializeMetadata(parsedOutput),
747
- ...deserialized,
748
- });
749
- return (0, smithy_client_1.decorateServiceException)(exception, body);
750
- };
751
- const de_InvalidArnExceptionRes = async (parsedOutput, context) => {
752
- const body = parsedOutput.body;
753
- const deserialized = (0, smithy_client_1._json)(body);
754
- const exception = new models_0_1.InvalidArnException({
755
- $metadata: deserializeMetadata(parsedOutput),
756
- ...deserialized,
757
- });
758
- return (0, smithy_client_1.decorateServiceException)(exception, body);
759
- };
760
- const de_InvalidDomainValidationOptionsExceptionRes = async (parsedOutput, context) => {
761
- const body = parsedOutput.body;
762
- const deserialized = (0, smithy_client_1._json)(body);
763
- const exception = new models_0_1.InvalidDomainValidationOptionsException({
764
- $metadata: deserializeMetadata(parsedOutput),
765
- ...deserialized,
766
- });
767
- return (0, smithy_client_1.decorateServiceException)(exception, body);
768
- };
769
- const de_InvalidParameterExceptionRes = async (parsedOutput, context) => {
770
- const body = parsedOutput.body;
771
- const deserialized = (0, smithy_client_1._json)(body);
772
- const exception = new models_0_1.InvalidParameterException({
773
- $metadata: deserializeMetadata(parsedOutput),
774
- ...deserialized,
775
- });
776
- return (0, smithy_client_1.decorateServiceException)(exception, body);
777
- };
778
- const de_InvalidStateExceptionRes = async (parsedOutput, context) => {
779
- const body = parsedOutput.body;
780
- const deserialized = (0, smithy_client_1._json)(body);
781
- const exception = new models_0_1.InvalidStateException({
782
- $metadata: deserializeMetadata(parsedOutput),
783
- ...deserialized,
784
- });
785
- return (0, smithy_client_1.decorateServiceException)(exception, body);
786
- };
787
- const de_InvalidTagExceptionRes = async (parsedOutput, context) => {
788
- const body = parsedOutput.body;
789
- const deserialized = (0, smithy_client_1._json)(body);
790
- const exception = new models_0_1.InvalidTagException({
791
- $metadata: deserializeMetadata(parsedOutput),
792
- ...deserialized,
793
- });
794
- return (0, smithy_client_1.decorateServiceException)(exception, body);
795
- };
796
- const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
797
- const body = parsedOutput.body;
798
- const deserialized = (0, smithy_client_1._json)(body);
799
- const exception = new models_0_1.LimitExceededException({
800
- $metadata: deserializeMetadata(parsedOutput),
801
- ...deserialized,
802
- });
803
- return (0, smithy_client_1.decorateServiceException)(exception, body);
804
- };
805
- const de_RequestInProgressExceptionRes = async (parsedOutput, context) => {
806
- const body = parsedOutput.body;
807
- const deserialized = (0, smithy_client_1._json)(body);
808
- const exception = new models_0_1.RequestInProgressException({
809
- $metadata: deserializeMetadata(parsedOutput),
810
- ...deserialized,
811
- });
812
- return (0, smithy_client_1.decorateServiceException)(exception, body);
813
- };
814
- const de_ResourceInUseExceptionRes = async (parsedOutput, context) => {
815
- const body = parsedOutput.body;
816
- const deserialized = (0, smithy_client_1._json)(body);
817
- const exception = new models_0_1.ResourceInUseException({
818
- $metadata: deserializeMetadata(parsedOutput),
819
- ...deserialized,
820
- });
821
- return (0, smithy_client_1.decorateServiceException)(exception, body);
822
- };
823
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
824
- const body = parsedOutput.body;
825
- const deserialized = (0, smithy_client_1._json)(body);
826
- const exception = new models_0_1.ResourceNotFoundException({
827
- $metadata: deserializeMetadata(parsedOutput),
828
- ...deserialized,
829
- });
830
- return (0, smithy_client_1.decorateServiceException)(exception, body);
831
- };
832
- const de_TagPolicyExceptionRes = async (parsedOutput, context) => {
833
- const body = parsedOutput.body;
834
- const deserialized = (0, smithy_client_1._json)(body);
835
- const exception = new models_0_1.TagPolicyException({
836
- $metadata: deserializeMetadata(parsedOutput),
837
- ...deserialized,
838
- });
839
- return (0, smithy_client_1.decorateServiceException)(exception, body);
840
- };
841
- const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
842
- const body = parsedOutput.body;
843
- const deserialized = (0, smithy_client_1._json)(body);
844
- const exception = new models_0_1.ThrottlingException({
845
- $metadata: deserializeMetadata(parsedOutput),
846
- ...deserialized,
847
- });
848
- return (0, smithy_client_1.decorateServiceException)(exception, body);
849
- };
850
- const de_TooManyTagsExceptionRes = async (parsedOutput, context) => {
851
- const body = parsedOutput.body;
852
- const deserialized = (0, smithy_client_1._json)(body);
853
- const exception = new models_0_1.TooManyTagsException({
854
- $metadata: deserializeMetadata(parsedOutput),
855
- ...deserialized,
856
- });
857
- return (0, smithy_client_1.decorateServiceException)(exception, body);
858
- };
859
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
860
- const body = parsedOutput.body;
861
- const deserialized = (0, smithy_client_1._json)(body);
862
- const exception = new models_0_1.ValidationException({
863
- $metadata: deserializeMetadata(parsedOutput),
864
- ...deserialized,
865
- });
866
- return (0, smithy_client_1.decorateServiceException)(exception, body);
867
- };
868
- const se_ExportCertificateRequest = (input, context) => {
869
- return (0, smithy_client_1.take)(input, {
870
- CertificateArn: [],
871
- Passphrase: context.base64Encoder,
872
- });
873
- };
874
- const se_ImportCertificateRequest = (input, context) => {
875
- return (0, smithy_client_1.take)(input, {
876
- Certificate: context.base64Encoder,
877
- CertificateArn: [],
878
- CertificateChain: context.base64Encoder,
879
- PrivateKey: context.base64Encoder,
880
- Tags: smithy_client_1._json,
881
- });
882
- };
883
- const de_CertificateDetail = (output, context) => {
884
- return (0, smithy_client_1.take)(output, {
885
- CertificateArn: smithy_client_1.expectString,
886
- CertificateAuthorityArn: smithy_client_1.expectString,
887
- CreatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
888
- DomainName: smithy_client_1.expectString,
889
- DomainValidationOptions: smithy_client_1._json,
890
- ExtendedKeyUsages: smithy_client_1._json,
891
- FailureReason: smithy_client_1.expectString,
892
- ImportedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
893
- InUseBy: smithy_client_1._json,
894
- IssuedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
895
- Issuer: smithy_client_1.expectString,
896
- KeyAlgorithm: smithy_client_1.expectString,
897
- KeyUsages: smithy_client_1._json,
898
- NotAfter: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
899
- NotBefore: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
900
- Options: smithy_client_1._json,
901
- RenewalEligibility: smithy_client_1.expectString,
902
- RenewalSummary: (_) => de_RenewalSummary(_, context),
903
- RevocationReason: smithy_client_1.expectString,
904
- RevokedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
905
- Serial: smithy_client_1.expectString,
906
- SignatureAlgorithm: smithy_client_1.expectString,
907
- Status: smithy_client_1.expectString,
908
- Subject: smithy_client_1.expectString,
909
- SubjectAlternativeNames: smithy_client_1._json,
910
- Type: smithy_client_1.expectString,
911
- });
912
- };
913
- const de_CertificateSummary = (output, context) => {
914
- return (0, smithy_client_1.take)(output, {
915
- CertificateArn: smithy_client_1.expectString,
916
- CreatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
917
- DomainName: smithy_client_1.expectString,
918
- Exported: smithy_client_1.expectBoolean,
919
- ExtendedKeyUsages: smithy_client_1._json,
920
- HasAdditionalSubjectAlternativeNames: smithy_client_1.expectBoolean,
921
- ImportedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
922
- InUse: smithy_client_1.expectBoolean,
923
- IssuedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
924
- KeyAlgorithm: smithy_client_1.expectString,
925
- KeyUsages: smithy_client_1._json,
926
- NotAfter: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
927
- NotBefore: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
928
- RenewalEligibility: smithy_client_1.expectString,
929
- RevokedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
930
- Status: smithy_client_1.expectString,
931
- SubjectAlternativeNameSummaries: smithy_client_1._json,
932
- Type: smithy_client_1.expectString,
933
- });
934
- };
935
- const de_CertificateSummaryList = (output, context) => {
936
- const retVal = (output || [])
937
- .filter((e) => e != null)
938
- .map((entry) => {
939
- return de_CertificateSummary(entry, context);
940
- });
941
- return retVal;
942
- };
943
- const de_DescribeCertificateResponse = (output, context) => {
944
- return (0, smithy_client_1.take)(output, {
945
- Certificate: (_) => de_CertificateDetail(_, context),
946
- });
947
- };
948
- const de_ListCertificatesResponse = (output, context) => {
949
- return (0, smithy_client_1.take)(output, {
950
- CertificateSummaryList: (_) => de_CertificateSummaryList(_, context),
951
- NextToken: smithy_client_1.expectString,
952
- });
953
- };
954
- const de_RenewalSummary = (output, context) => {
955
- return (0, smithy_client_1.take)(output, {
956
- DomainValidationOptions: smithy_client_1._json,
957
- RenewalStatus: smithy_client_1.expectString,
958
- RenewalStatusReason: smithy_client_1.expectString,
959
- UpdatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
960
- });
961
- };
962
- const deserializeMetadata = (output) => ({
963
- httpStatusCode: output.statusCode,
964
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
965
- extendedRequestId: output.headers["x-amz-id-2"],
966
- cfId: output.headers["x-amz-cf-id"],
967
- });
968
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
969
- const throwDefaultError = (0, smithy_client_1.withBaseException)(ACMServiceException_1.ACMServiceException);
970
- const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
971
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
972
- const contents = {
973
- protocol,
974
- hostname,
975
- port,
976
- method: "POST",
977
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
978
- headers,
979
- };
980
- if (resolvedHostname !== undefined) {
981
- contents.hostname = resolvedHostname;
982
- }
983
- if (body !== undefined) {
984
- contents.body = body;
985
- }
986
- return new protocol_http_1.HttpRequest(contents);
987
- };
988
- function sharedHeaders(operation) {
989
- return {
990
- "content-type": "application/x-amz-json-1.1",
991
- "x-amz-target": `CertificateManager.${operation}`,
992
- };
993
- }
994
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
995
- if (encoded.length) {
996
- return JSON.parse(encoded);
997
- }
998
- return {};
999
- });
1000
- const parseErrorBody = async (errorBody, context) => {
1001
- const value = await parseBody(errorBody, context);
1002
- value.message = value.message ?? value.Message;
1003
- return value;
1004
- };
1005
- const loadRestJsonErrorCode = (output, data) => {
1006
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1007
- const sanitizeErrorCode = (rawValue) => {
1008
- let cleanValue = rawValue;
1009
- if (typeof cleanValue === "number") {
1010
- cleanValue = cleanValue.toString();
1011
- }
1012
- if (cleanValue.indexOf(",") >= 0) {
1013
- cleanValue = cleanValue.split(",")[0];
1014
- }
1015
- if (cleanValue.indexOf(":") >= 0) {
1016
- cleanValue = cleanValue.split(":")[0];
1017
- }
1018
- if (cleanValue.indexOf("#") >= 0) {
1019
- cleanValue = cleanValue.split("#")[1];
1020
- }
1021
- return cleanValue;
1022
- };
1023
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1024
- if (headerKey !== undefined) {
1025
- return sanitizeErrorCode(output.headers[headerKey]);
1026
- }
1027
- if (data.code !== undefined) {
1028
- return sanitizeErrorCode(data.code);
1029
- }
1030
- if (data["__type"] !== undefined) {
1031
- return sanitizeErrorCode(data["__type"]);
1032
- }
1033
- };
1
+ module.exports = require("../index.js");