@aws-sdk/client-support 3.490.0 → 3.496.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/Support.js +1 -43
  2. package/dist-cjs/SupportClient.js +1 -43
  3. package/dist-cjs/commands/AddAttachmentsToSetCommand.js +1 -28
  4. package/dist-cjs/commands/AddCommunicationToCaseCommand.js +1 -28
  5. package/dist-cjs/commands/CreateCaseCommand.js +1 -28
  6. package/dist-cjs/commands/DescribeAttachmentCommand.js +1 -28
  7. package/dist-cjs/commands/DescribeCasesCommand.js +1 -28
  8. package/dist-cjs/commands/DescribeCommunicationsCommand.js +1 -28
  9. package/dist-cjs/commands/DescribeCreateCaseOptionsCommand.js +1 -28
  10. package/dist-cjs/commands/DescribeServicesCommand.js +1 -28
  11. package/dist-cjs/commands/DescribeSeverityLevelsCommand.js +1 -28
  12. package/dist-cjs/commands/DescribeSupportedLanguagesCommand.js +1 -28
  13. package/dist-cjs/commands/DescribeTrustedAdvisorCheckRefreshStatusesCommand.js +1 -28
  14. package/dist-cjs/commands/DescribeTrustedAdvisorCheckResultCommand.js +1 -28
  15. package/dist-cjs/commands/DescribeTrustedAdvisorCheckSummariesCommand.js +1 -28
  16. package/dist-cjs/commands/DescribeTrustedAdvisorChecksCommand.js +1 -28
  17. package/dist-cjs/commands/RefreshTrustedAdvisorCheckCommand.js +1 -28
  18. package/dist-cjs/commands/ResolveCaseCommand.js +1 -28
  19. package/dist-cjs/commands/index.js +1 -19
  20. package/dist-cjs/endpoint/EndpointParameters.js +1 -18
  21. package/dist-cjs/extensionConfiguration.js +1 -2
  22. package/dist-cjs/index.js +1649 -11
  23. package/dist-cjs/models/SupportServiceException.js +1 -12
  24. package/dist-cjs/models/index.js +1 -4
  25. package/dist-cjs/models/models_0.js +1 -134
  26. package/dist-cjs/pagination/DescribeCasesPaginator.js +1 -7
  27. package/dist-cjs/pagination/DescribeCommunicationsPaginator.js +1 -7
  28. package/dist-cjs/pagination/Interfaces.js +1 -2
  29. package/dist-cjs/pagination/index.js +1 -6
  30. package/dist-cjs/protocols/Aws_json1_1.js +1 -1012
  31. package/dist-cjs/runtimeExtensions.js +1 -22
  32. package/package.json +40 -40
@@ -1,1012 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_ResolveCaseCommand = exports.de_RefreshTrustedAdvisorCheckCommand = exports.de_DescribeTrustedAdvisorCheckSummariesCommand = exports.de_DescribeTrustedAdvisorChecksCommand = exports.de_DescribeTrustedAdvisorCheckResultCommand = exports.de_DescribeTrustedAdvisorCheckRefreshStatusesCommand = exports.de_DescribeSupportedLanguagesCommand = exports.de_DescribeSeverityLevelsCommand = exports.de_DescribeServicesCommand = exports.de_DescribeCreateCaseOptionsCommand = exports.de_DescribeCommunicationsCommand = exports.de_DescribeCasesCommand = exports.de_DescribeAttachmentCommand = exports.de_CreateCaseCommand = exports.de_AddCommunicationToCaseCommand = exports.de_AddAttachmentsToSetCommand = exports.se_ResolveCaseCommand = exports.se_RefreshTrustedAdvisorCheckCommand = exports.se_DescribeTrustedAdvisorCheckSummariesCommand = exports.se_DescribeTrustedAdvisorChecksCommand = exports.se_DescribeTrustedAdvisorCheckResultCommand = exports.se_DescribeTrustedAdvisorCheckRefreshStatusesCommand = exports.se_DescribeSupportedLanguagesCommand = exports.se_DescribeSeverityLevelsCommand = exports.se_DescribeServicesCommand = exports.se_DescribeCreateCaseOptionsCommand = exports.se_DescribeCommunicationsCommand = exports.se_DescribeCasesCommand = exports.se_DescribeAttachmentCommand = exports.se_CreateCaseCommand = exports.se_AddCommunicationToCaseCommand = exports.se_AddAttachmentsToSetCommand = void 0;
4
- const protocol_http_1 = require("@smithy/protocol-http");
5
- const smithy_client_1 = require("@smithy/smithy-client");
6
- const models_0_1 = require("../models/models_0");
7
- const SupportServiceException_1 = require("../models/SupportServiceException");
8
- const se_AddAttachmentsToSetCommand = async (input, context) => {
9
- const headers = sharedHeaders("AddAttachmentsToSet");
10
- let body;
11
- body = JSON.stringify(se_AddAttachmentsToSetRequest(input, context));
12
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
- };
14
- exports.se_AddAttachmentsToSetCommand = se_AddAttachmentsToSetCommand;
15
- const se_AddCommunicationToCaseCommand = async (input, context) => {
16
- const headers = sharedHeaders("AddCommunicationToCase");
17
- let body;
18
- body = JSON.stringify((0, smithy_client_1._json)(input));
19
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
20
- };
21
- exports.se_AddCommunicationToCaseCommand = se_AddCommunicationToCaseCommand;
22
- const se_CreateCaseCommand = async (input, context) => {
23
- const headers = sharedHeaders("CreateCase");
24
- let body;
25
- body = JSON.stringify((0, smithy_client_1._json)(input));
26
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
27
- };
28
- exports.se_CreateCaseCommand = se_CreateCaseCommand;
29
- const se_DescribeAttachmentCommand = async (input, context) => {
30
- const headers = sharedHeaders("DescribeAttachment");
31
- let body;
32
- body = JSON.stringify((0, smithy_client_1._json)(input));
33
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
34
- };
35
- exports.se_DescribeAttachmentCommand = se_DescribeAttachmentCommand;
36
- const se_DescribeCasesCommand = async (input, context) => {
37
- const headers = sharedHeaders("DescribeCases");
38
- let body;
39
- body = JSON.stringify((0, smithy_client_1._json)(input));
40
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
41
- };
42
- exports.se_DescribeCasesCommand = se_DescribeCasesCommand;
43
- const se_DescribeCommunicationsCommand = async (input, context) => {
44
- const headers = sharedHeaders("DescribeCommunications");
45
- let body;
46
- body = JSON.stringify((0, smithy_client_1._json)(input));
47
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
48
- };
49
- exports.se_DescribeCommunicationsCommand = se_DescribeCommunicationsCommand;
50
- const se_DescribeCreateCaseOptionsCommand = async (input, context) => {
51
- const headers = sharedHeaders("DescribeCreateCaseOptions");
52
- let body;
53
- body = JSON.stringify((0, smithy_client_1._json)(input));
54
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
55
- };
56
- exports.se_DescribeCreateCaseOptionsCommand = se_DescribeCreateCaseOptionsCommand;
57
- const se_DescribeServicesCommand = async (input, context) => {
58
- const headers = sharedHeaders("DescribeServices");
59
- let body;
60
- body = JSON.stringify((0, smithy_client_1._json)(input));
61
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
62
- };
63
- exports.se_DescribeServicesCommand = se_DescribeServicesCommand;
64
- const se_DescribeSeverityLevelsCommand = async (input, context) => {
65
- const headers = sharedHeaders("DescribeSeverityLevels");
66
- let body;
67
- body = JSON.stringify((0, smithy_client_1._json)(input));
68
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
69
- };
70
- exports.se_DescribeSeverityLevelsCommand = se_DescribeSeverityLevelsCommand;
71
- const se_DescribeSupportedLanguagesCommand = async (input, context) => {
72
- const headers = sharedHeaders("DescribeSupportedLanguages");
73
- let body;
74
- body = JSON.stringify((0, smithy_client_1._json)(input));
75
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
76
- };
77
- exports.se_DescribeSupportedLanguagesCommand = se_DescribeSupportedLanguagesCommand;
78
- const se_DescribeTrustedAdvisorCheckRefreshStatusesCommand = async (input, context) => {
79
- const headers = sharedHeaders("DescribeTrustedAdvisorCheckRefreshStatuses");
80
- let body;
81
- body = JSON.stringify(se_DescribeTrustedAdvisorCheckRefreshStatusesRequest(input, context));
82
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
83
- };
84
- exports.se_DescribeTrustedAdvisorCheckRefreshStatusesCommand = se_DescribeTrustedAdvisorCheckRefreshStatusesCommand;
85
- const se_DescribeTrustedAdvisorCheckResultCommand = async (input, context) => {
86
- const headers = sharedHeaders("DescribeTrustedAdvisorCheckResult");
87
- let body;
88
- body = JSON.stringify((0, smithy_client_1._json)(input));
89
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
90
- };
91
- exports.se_DescribeTrustedAdvisorCheckResultCommand = se_DescribeTrustedAdvisorCheckResultCommand;
92
- const se_DescribeTrustedAdvisorChecksCommand = async (input, context) => {
93
- const headers = sharedHeaders("DescribeTrustedAdvisorChecks");
94
- let body;
95
- body = JSON.stringify((0, smithy_client_1._json)(input));
96
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
97
- };
98
- exports.se_DescribeTrustedAdvisorChecksCommand = se_DescribeTrustedAdvisorChecksCommand;
99
- const se_DescribeTrustedAdvisorCheckSummariesCommand = async (input, context) => {
100
- const headers = sharedHeaders("DescribeTrustedAdvisorCheckSummaries");
101
- let body;
102
- body = JSON.stringify(se_DescribeTrustedAdvisorCheckSummariesRequest(input, context));
103
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
104
- };
105
- exports.se_DescribeTrustedAdvisorCheckSummariesCommand = se_DescribeTrustedAdvisorCheckSummariesCommand;
106
- const se_RefreshTrustedAdvisorCheckCommand = async (input, context) => {
107
- const headers = sharedHeaders("RefreshTrustedAdvisorCheck");
108
- let body;
109
- body = JSON.stringify((0, smithy_client_1._json)(input));
110
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
111
- };
112
- exports.se_RefreshTrustedAdvisorCheckCommand = se_RefreshTrustedAdvisorCheckCommand;
113
- const se_ResolveCaseCommand = async (input, context) => {
114
- const headers = sharedHeaders("ResolveCase");
115
- let body;
116
- body = JSON.stringify((0, smithy_client_1._json)(input));
117
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
118
- };
119
- exports.se_ResolveCaseCommand = se_ResolveCaseCommand;
120
- const de_AddAttachmentsToSetCommand = async (output, context) => {
121
- if (output.statusCode >= 300) {
122
- return de_AddAttachmentsToSetCommandError(output, context);
123
- }
124
- const data = await parseBody(output.body, context);
125
- let contents = {};
126
- contents = (0, smithy_client_1._json)(data);
127
- const response = {
128
- $metadata: deserializeMetadata(output),
129
- ...contents,
130
- };
131
- return response;
132
- };
133
- exports.de_AddAttachmentsToSetCommand = de_AddAttachmentsToSetCommand;
134
- const de_AddAttachmentsToSetCommandError = async (output, context) => {
135
- const parsedOutput = {
136
- ...output,
137
- body: await parseErrorBody(output.body, context),
138
- };
139
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
140
- switch (errorCode) {
141
- case "AttachmentLimitExceeded":
142
- case "com.amazonaws.support#AttachmentLimitExceeded":
143
- throw await de_AttachmentLimitExceededRes(parsedOutput, context);
144
- case "AttachmentSetExpired":
145
- case "com.amazonaws.support#AttachmentSetExpired":
146
- throw await de_AttachmentSetExpiredRes(parsedOutput, context);
147
- case "AttachmentSetIdNotFound":
148
- case "com.amazonaws.support#AttachmentSetIdNotFound":
149
- throw await de_AttachmentSetIdNotFoundRes(parsedOutput, context);
150
- case "AttachmentSetSizeLimitExceeded":
151
- case "com.amazonaws.support#AttachmentSetSizeLimitExceeded":
152
- throw await de_AttachmentSetSizeLimitExceededRes(parsedOutput, context);
153
- case "InternalServerError":
154
- case "com.amazonaws.support#InternalServerError":
155
- throw await de_InternalServerErrorRes(parsedOutput, context);
156
- default:
157
- const parsedBody = parsedOutput.body;
158
- return throwDefaultError({
159
- output,
160
- parsedBody,
161
- errorCode,
162
- });
163
- }
164
- };
165
- const de_AddCommunicationToCaseCommand = async (output, context) => {
166
- if (output.statusCode >= 300) {
167
- return de_AddCommunicationToCaseCommandError(output, context);
168
- }
169
- const data = await parseBody(output.body, context);
170
- let contents = {};
171
- contents = (0, smithy_client_1._json)(data);
172
- const response = {
173
- $metadata: deserializeMetadata(output),
174
- ...contents,
175
- };
176
- return response;
177
- };
178
- exports.de_AddCommunicationToCaseCommand = de_AddCommunicationToCaseCommand;
179
- const de_AddCommunicationToCaseCommandError = async (output, context) => {
180
- const parsedOutput = {
181
- ...output,
182
- body: await parseErrorBody(output.body, context),
183
- };
184
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
185
- switch (errorCode) {
186
- case "AttachmentSetExpired":
187
- case "com.amazonaws.support#AttachmentSetExpired":
188
- throw await de_AttachmentSetExpiredRes(parsedOutput, context);
189
- case "AttachmentSetIdNotFound":
190
- case "com.amazonaws.support#AttachmentSetIdNotFound":
191
- throw await de_AttachmentSetIdNotFoundRes(parsedOutput, context);
192
- case "CaseIdNotFound":
193
- case "com.amazonaws.support#CaseIdNotFound":
194
- throw await de_CaseIdNotFoundRes(parsedOutput, context);
195
- case "InternalServerError":
196
- case "com.amazonaws.support#InternalServerError":
197
- throw await de_InternalServerErrorRes(parsedOutput, context);
198
- default:
199
- const parsedBody = parsedOutput.body;
200
- return throwDefaultError({
201
- output,
202
- parsedBody,
203
- errorCode,
204
- });
205
- }
206
- };
207
- const de_CreateCaseCommand = async (output, context) => {
208
- if (output.statusCode >= 300) {
209
- return de_CreateCaseCommandError(output, context);
210
- }
211
- const data = await parseBody(output.body, context);
212
- let contents = {};
213
- contents = (0, smithy_client_1._json)(data);
214
- const response = {
215
- $metadata: deserializeMetadata(output),
216
- ...contents,
217
- };
218
- return response;
219
- };
220
- exports.de_CreateCaseCommand = de_CreateCaseCommand;
221
- const de_CreateCaseCommandError = async (output, context) => {
222
- const parsedOutput = {
223
- ...output,
224
- body: await parseErrorBody(output.body, context),
225
- };
226
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
227
- switch (errorCode) {
228
- case "AttachmentSetExpired":
229
- case "com.amazonaws.support#AttachmentSetExpired":
230
- throw await de_AttachmentSetExpiredRes(parsedOutput, context);
231
- case "AttachmentSetIdNotFound":
232
- case "com.amazonaws.support#AttachmentSetIdNotFound":
233
- throw await de_AttachmentSetIdNotFoundRes(parsedOutput, context);
234
- case "CaseCreationLimitExceeded":
235
- case "com.amazonaws.support#CaseCreationLimitExceeded":
236
- throw await de_CaseCreationLimitExceededRes(parsedOutput, context);
237
- case "InternalServerError":
238
- case "com.amazonaws.support#InternalServerError":
239
- throw await de_InternalServerErrorRes(parsedOutput, context);
240
- default:
241
- const parsedBody = parsedOutput.body;
242
- return throwDefaultError({
243
- output,
244
- parsedBody,
245
- errorCode,
246
- });
247
- }
248
- };
249
- const de_DescribeAttachmentCommand = async (output, context) => {
250
- if (output.statusCode >= 300) {
251
- return de_DescribeAttachmentCommandError(output, context);
252
- }
253
- const data = await parseBody(output.body, context);
254
- let contents = {};
255
- contents = de_DescribeAttachmentResponse(data, context);
256
- const response = {
257
- $metadata: deserializeMetadata(output),
258
- ...contents,
259
- };
260
- return response;
261
- };
262
- exports.de_DescribeAttachmentCommand = de_DescribeAttachmentCommand;
263
- const de_DescribeAttachmentCommandError = async (output, context) => {
264
- const parsedOutput = {
265
- ...output,
266
- body: await parseErrorBody(output.body, context),
267
- };
268
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
269
- switch (errorCode) {
270
- case "AttachmentIdNotFound":
271
- case "com.amazonaws.support#AttachmentIdNotFound":
272
- throw await de_AttachmentIdNotFoundRes(parsedOutput, context);
273
- case "DescribeAttachmentLimitExceeded":
274
- case "com.amazonaws.support#DescribeAttachmentLimitExceeded":
275
- throw await de_DescribeAttachmentLimitExceededRes(parsedOutput, context);
276
- case "InternalServerError":
277
- case "com.amazonaws.support#InternalServerError":
278
- throw await de_InternalServerErrorRes(parsedOutput, context);
279
- default:
280
- const parsedBody = parsedOutput.body;
281
- return throwDefaultError({
282
- output,
283
- parsedBody,
284
- errorCode,
285
- });
286
- }
287
- };
288
- const de_DescribeCasesCommand = async (output, context) => {
289
- if (output.statusCode >= 300) {
290
- return de_DescribeCasesCommandError(output, context);
291
- }
292
- const data = await parseBody(output.body, context);
293
- let contents = {};
294
- contents = (0, smithy_client_1._json)(data);
295
- const response = {
296
- $metadata: deserializeMetadata(output),
297
- ...contents,
298
- };
299
- return response;
300
- };
301
- exports.de_DescribeCasesCommand = de_DescribeCasesCommand;
302
- const de_DescribeCasesCommandError = async (output, context) => {
303
- const parsedOutput = {
304
- ...output,
305
- body: await parseErrorBody(output.body, context),
306
- };
307
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
308
- switch (errorCode) {
309
- case "CaseIdNotFound":
310
- case "com.amazonaws.support#CaseIdNotFound":
311
- throw await de_CaseIdNotFoundRes(parsedOutput, context);
312
- case "InternalServerError":
313
- case "com.amazonaws.support#InternalServerError":
314
- throw await de_InternalServerErrorRes(parsedOutput, context);
315
- default:
316
- const parsedBody = parsedOutput.body;
317
- return throwDefaultError({
318
- output,
319
- parsedBody,
320
- errorCode,
321
- });
322
- }
323
- };
324
- const de_DescribeCommunicationsCommand = async (output, context) => {
325
- if (output.statusCode >= 300) {
326
- return de_DescribeCommunicationsCommandError(output, context);
327
- }
328
- const data = await parseBody(output.body, context);
329
- let contents = {};
330
- contents = (0, smithy_client_1._json)(data);
331
- const response = {
332
- $metadata: deserializeMetadata(output),
333
- ...contents,
334
- };
335
- return response;
336
- };
337
- exports.de_DescribeCommunicationsCommand = de_DescribeCommunicationsCommand;
338
- const de_DescribeCommunicationsCommandError = async (output, context) => {
339
- const parsedOutput = {
340
- ...output,
341
- body: await parseErrorBody(output.body, context),
342
- };
343
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
344
- switch (errorCode) {
345
- case "CaseIdNotFound":
346
- case "com.amazonaws.support#CaseIdNotFound":
347
- throw await de_CaseIdNotFoundRes(parsedOutput, context);
348
- case "InternalServerError":
349
- case "com.amazonaws.support#InternalServerError":
350
- throw await de_InternalServerErrorRes(parsedOutput, context);
351
- default:
352
- const parsedBody = parsedOutput.body;
353
- return throwDefaultError({
354
- output,
355
- parsedBody,
356
- errorCode,
357
- });
358
- }
359
- };
360
- const de_DescribeCreateCaseOptionsCommand = async (output, context) => {
361
- if (output.statusCode >= 300) {
362
- return de_DescribeCreateCaseOptionsCommandError(output, context);
363
- }
364
- const data = await parseBody(output.body, context);
365
- let contents = {};
366
- contents = (0, smithy_client_1._json)(data);
367
- const response = {
368
- $metadata: deserializeMetadata(output),
369
- ...contents,
370
- };
371
- return response;
372
- };
373
- exports.de_DescribeCreateCaseOptionsCommand = de_DescribeCreateCaseOptionsCommand;
374
- const de_DescribeCreateCaseOptionsCommandError = async (output, context) => {
375
- const parsedOutput = {
376
- ...output,
377
- body: await parseErrorBody(output.body, context),
378
- };
379
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
380
- switch (errorCode) {
381
- case "InternalServerError":
382
- case "com.amazonaws.support#InternalServerError":
383
- throw await de_InternalServerErrorRes(parsedOutput, context);
384
- case "ThrottlingException":
385
- case "com.amazonaws.support#ThrottlingException":
386
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
387
- default:
388
- const parsedBody = parsedOutput.body;
389
- return throwDefaultError({
390
- output,
391
- parsedBody,
392
- errorCode,
393
- });
394
- }
395
- };
396
- const de_DescribeServicesCommand = async (output, context) => {
397
- if (output.statusCode >= 300) {
398
- return de_DescribeServicesCommandError(output, context);
399
- }
400
- const data = await parseBody(output.body, context);
401
- let contents = {};
402
- contents = (0, smithy_client_1._json)(data);
403
- const response = {
404
- $metadata: deserializeMetadata(output),
405
- ...contents,
406
- };
407
- return response;
408
- };
409
- exports.de_DescribeServicesCommand = de_DescribeServicesCommand;
410
- const de_DescribeServicesCommandError = async (output, context) => {
411
- const parsedOutput = {
412
- ...output,
413
- body: await parseErrorBody(output.body, context),
414
- };
415
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
416
- switch (errorCode) {
417
- case "InternalServerError":
418
- case "com.amazonaws.support#InternalServerError":
419
- throw await de_InternalServerErrorRes(parsedOutput, context);
420
- default:
421
- const parsedBody = parsedOutput.body;
422
- return throwDefaultError({
423
- output,
424
- parsedBody,
425
- errorCode,
426
- });
427
- }
428
- };
429
- const de_DescribeSeverityLevelsCommand = async (output, context) => {
430
- if (output.statusCode >= 300) {
431
- return de_DescribeSeverityLevelsCommandError(output, context);
432
- }
433
- const data = await parseBody(output.body, context);
434
- let contents = {};
435
- contents = (0, smithy_client_1._json)(data);
436
- const response = {
437
- $metadata: deserializeMetadata(output),
438
- ...contents,
439
- };
440
- return response;
441
- };
442
- exports.de_DescribeSeverityLevelsCommand = de_DescribeSeverityLevelsCommand;
443
- const de_DescribeSeverityLevelsCommandError = async (output, context) => {
444
- const parsedOutput = {
445
- ...output,
446
- body: await parseErrorBody(output.body, context),
447
- };
448
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
449
- switch (errorCode) {
450
- case "InternalServerError":
451
- case "com.amazonaws.support#InternalServerError":
452
- throw await de_InternalServerErrorRes(parsedOutput, context);
453
- default:
454
- const parsedBody = parsedOutput.body;
455
- return throwDefaultError({
456
- output,
457
- parsedBody,
458
- errorCode,
459
- });
460
- }
461
- };
462
- const de_DescribeSupportedLanguagesCommand = async (output, context) => {
463
- if (output.statusCode >= 300) {
464
- return de_DescribeSupportedLanguagesCommandError(output, context);
465
- }
466
- const data = await parseBody(output.body, context);
467
- let contents = {};
468
- contents = (0, smithy_client_1._json)(data);
469
- const response = {
470
- $metadata: deserializeMetadata(output),
471
- ...contents,
472
- };
473
- return response;
474
- };
475
- exports.de_DescribeSupportedLanguagesCommand = de_DescribeSupportedLanguagesCommand;
476
- const de_DescribeSupportedLanguagesCommandError = async (output, context) => {
477
- const parsedOutput = {
478
- ...output,
479
- body: await parseErrorBody(output.body, context),
480
- };
481
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
482
- switch (errorCode) {
483
- case "InternalServerError":
484
- case "com.amazonaws.support#InternalServerError":
485
- throw await de_InternalServerErrorRes(parsedOutput, context);
486
- case "ThrottlingException":
487
- case "com.amazonaws.support#ThrottlingException":
488
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
489
- default:
490
- const parsedBody = parsedOutput.body;
491
- return throwDefaultError({
492
- output,
493
- parsedBody,
494
- errorCode,
495
- });
496
- }
497
- };
498
- const de_DescribeTrustedAdvisorCheckRefreshStatusesCommand = async (output, context) => {
499
- if (output.statusCode >= 300) {
500
- return de_DescribeTrustedAdvisorCheckRefreshStatusesCommandError(output, context);
501
- }
502
- const data = await parseBody(output.body, context);
503
- let contents = {};
504
- contents = (0, smithy_client_1._json)(data);
505
- const response = {
506
- $metadata: deserializeMetadata(output),
507
- ...contents,
508
- };
509
- return response;
510
- };
511
- exports.de_DescribeTrustedAdvisorCheckRefreshStatusesCommand = de_DescribeTrustedAdvisorCheckRefreshStatusesCommand;
512
- const de_DescribeTrustedAdvisorCheckRefreshStatusesCommandError = async (output, context) => {
513
- const parsedOutput = {
514
- ...output,
515
- body: await parseErrorBody(output.body, context),
516
- };
517
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
518
- switch (errorCode) {
519
- case "InternalServerError":
520
- case "com.amazonaws.support#InternalServerError":
521
- throw await de_InternalServerErrorRes(parsedOutput, context);
522
- case "ThrottlingException":
523
- case "com.amazonaws.support#ThrottlingException":
524
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
525
- default:
526
- const parsedBody = parsedOutput.body;
527
- return throwDefaultError({
528
- output,
529
- parsedBody,
530
- errorCode,
531
- });
532
- }
533
- };
534
- const de_DescribeTrustedAdvisorCheckResultCommand = async (output, context) => {
535
- if (output.statusCode >= 300) {
536
- return de_DescribeTrustedAdvisorCheckResultCommandError(output, context);
537
- }
538
- const data = await parseBody(output.body, context);
539
- let contents = {};
540
- contents = de_DescribeTrustedAdvisorCheckResultResponse(data, context);
541
- const response = {
542
- $metadata: deserializeMetadata(output),
543
- ...contents,
544
- };
545
- return response;
546
- };
547
- exports.de_DescribeTrustedAdvisorCheckResultCommand = de_DescribeTrustedAdvisorCheckResultCommand;
548
- const de_DescribeTrustedAdvisorCheckResultCommandError = async (output, context) => {
549
- const parsedOutput = {
550
- ...output,
551
- body: await parseErrorBody(output.body, context),
552
- };
553
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
554
- switch (errorCode) {
555
- case "InternalServerError":
556
- case "com.amazonaws.support#InternalServerError":
557
- throw await de_InternalServerErrorRes(parsedOutput, context);
558
- case "ThrottlingException":
559
- case "com.amazonaws.support#ThrottlingException":
560
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
561
- default:
562
- const parsedBody = parsedOutput.body;
563
- return throwDefaultError({
564
- output,
565
- parsedBody,
566
- errorCode,
567
- });
568
- }
569
- };
570
- const de_DescribeTrustedAdvisorChecksCommand = async (output, context) => {
571
- if (output.statusCode >= 300) {
572
- return de_DescribeTrustedAdvisorChecksCommandError(output, context);
573
- }
574
- const data = await parseBody(output.body, context);
575
- let contents = {};
576
- contents = de_DescribeTrustedAdvisorChecksResponse(data, context);
577
- const response = {
578
- $metadata: deserializeMetadata(output),
579
- ...contents,
580
- };
581
- return response;
582
- };
583
- exports.de_DescribeTrustedAdvisorChecksCommand = de_DescribeTrustedAdvisorChecksCommand;
584
- const de_DescribeTrustedAdvisorChecksCommandError = async (output, context) => {
585
- const parsedOutput = {
586
- ...output,
587
- body: await parseErrorBody(output.body, context),
588
- };
589
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
590
- switch (errorCode) {
591
- case "InternalServerError":
592
- case "com.amazonaws.support#InternalServerError":
593
- throw await de_InternalServerErrorRes(parsedOutput, context);
594
- case "ThrottlingException":
595
- case "com.amazonaws.support#ThrottlingException":
596
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
597
- default:
598
- const parsedBody = parsedOutput.body;
599
- return throwDefaultError({
600
- output,
601
- parsedBody,
602
- errorCode,
603
- });
604
- }
605
- };
606
- const de_DescribeTrustedAdvisorCheckSummariesCommand = async (output, context) => {
607
- if (output.statusCode >= 300) {
608
- return de_DescribeTrustedAdvisorCheckSummariesCommandError(output, context);
609
- }
610
- const data = await parseBody(output.body, context);
611
- let contents = {};
612
- contents = de_DescribeTrustedAdvisorCheckSummariesResponse(data, context);
613
- const response = {
614
- $metadata: deserializeMetadata(output),
615
- ...contents,
616
- };
617
- return response;
618
- };
619
- exports.de_DescribeTrustedAdvisorCheckSummariesCommand = de_DescribeTrustedAdvisorCheckSummariesCommand;
620
- const de_DescribeTrustedAdvisorCheckSummariesCommandError = async (output, context) => {
621
- const parsedOutput = {
622
- ...output,
623
- body: await parseErrorBody(output.body, context),
624
- };
625
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
626
- switch (errorCode) {
627
- case "InternalServerError":
628
- case "com.amazonaws.support#InternalServerError":
629
- throw await de_InternalServerErrorRes(parsedOutput, context);
630
- case "ThrottlingException":
631
- case "com.amazonaws.support#ThrottlingException":
632
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
633
- default:
634
- const parsedBody = parsedOutput.body;
635
- return throwDefaultError({
636
- output,
637
- parsedBody,
638
- errorCode,
639
- });
640
- }
641
- };
642
- const de_RefreshTrustedAdvisorCheckCommand = async (output, context) => {
643
- if (output.statusCode >= 300) {
644
- return de_RefreshTrustedAdvisorCheckCommandError(output, context);
645
- }
646
- const data = await parseBody(output.body, context);
647
- let contents = {};
648
- contents = (0, smithy_client_1._json)(data);
649
- const response = {
650
- $metadata: deserializeMetadata(output),
651
- ...contents,
652
- };
653
- return response;
654
- };
655
- exports.de_RefreshTrustedAdvisorCheckCommand = de_RefreshTrustedAdvisorCheckCommand;
656
- const de_RefreshTrustedAdvisorCheckCommandError = async (output, context) => {
657
- const parsedOutput = {
658
- ...output,
659
- body: await parseErrorBody(output.body, context),
660
- };
661
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
662
- switch (errorCode) {
663
- case "InternalServerError":
664
- case "com.amazonaws.support#InternalServerError":
665
- throw await de_InternalServerErrorRes(parsedOutput, context);
666
- default:
667
- const parsedBody = parsedOutput.body;
668
- return throwDefaultError({
669
- output,
670
- parsedBody,
671
- errorCode,
672
- });
673
- }
674
- };
675
- const de_ResolveCaseCommand = async (output, context) => {
676
- if (output.statusCode >= 300) {
677
- return de_ResolveCaseCommandError(output, context);
678
- }
679
- const data = await parseBody(output.body, context);
680
- let contents = {};
681
- contents = (0, smithy_client_1._json)(data);
682
- const response = {
683
- $metadata: deserializeMetadata(output),
684
- ...contents,
685
- };
686
- return response;
687
- };
688
- exports.de_ResolveCaseCommand = de_ResolveCaseCommand;
689
- const de_ResolveCaseCommandError = async (output, context) => {
690
- const parsedOutput = {
691
- ...output,
692
- body: await parseErrorBody(output.body, context),
693
- };
694
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
695
- switch (errorCode) {
696
- case "CaseIdNotFound":
697
- case "com.amazonaws.support#CaseIdNotFound":
698
- throw await de_CaseIdNotFoundRes(parsedOutput, context);
699
- case "InternalServerError":
700
- case "com.amazonaws.support#InternalServerError":
701
- throw await de_InternalServerErrorRes(parsedOutput, context);
702
- default:
703
- const parsedBody = parsedOutput.body;
704
- return throwDefaultError({
705
- output,
706
- parsedBody,
707
- errorCode,
708
- });
709
- }
710
- };
711
- const de_AttachmentIdNotFoundRes = async (parsedOutput, context) => {
712
- const body = parsedOutput.body;
713
- const deserialized = (0, smithy_client_1._json)(body);
714
- const exception = new models_0_1.AttachmentIdNotFound({
715
- $metadata: deserializeMetadata(parsedOutput),
716
- ...deserialized,
717
- });
718
- return (0, smithy_client_1.decorateServiceException)(exception, body);
719
- };
720
- const de_AttachmentLimitExceededRes = async (parsedOutput, context) => {
721
- const body = parsedOutput.body;
722
- const deserialized = (0, smithy_client_1._json)(body);
723
- const exception = new models_0_1.AttachmentLimitExceeded({
724
- $metadata: deserializeMetadata(parsedOutput),
725
- ...deserialized,
726
- });
727
- return (0, smithy_client_1.decorateServiceException)(exception, body);
728
- };
729
- const de_AttachmentSetExpiredRes = async (parsedOutput, context) => {
730
- const body = parsedOutput.body;
731
- const deserialized = (0, smithy_client_1._json)(body);
732
- const exception = new models_0_1.AttachmentSetExpired({
733
- $metadata: deserializeMetadata(parsedOutput),
734
- ...deserialized,
735
- });
736
- return (0, smithy_client_1.decorateServiceException)(exception, body);
737
- };
738
- const de_AttachmentSetIdNotFoundRes = async (parsedOutput, context) => {
739
- const body = parsedOutput.body;
740
- const deserialized = (0, smithy_client_1._json)(body);
741
- const exception = new models_0_1.AttachmentSetIdNotFound({
742
- $metadata: deserializeMetadata(parsedOutput),
743
- ...deserialized,
744
- });
745
- return (0, smithy_client_1.decorateServiceException)(exception, body);
746
- };
747
- const de_AttachmentSetSizeLimitExceededRes = async (parsedOutput, context) => {
748
- const body = parsedOutput.body;
749
- const deserialized = (0, smithy_client_1._json)(body);
750
- const exception = new models_0_1.AttachmentSetSizeLimitExceeded({
751
- $metadata: deserializeMetadata(parsedOutput),
752
- ...deserialized,
753
- });
754
- return (0, smithy_client_1.decorateServiceException)(exception, body);
755
- };
756
- const de_CaseCreationLimitExceededRes = async (parsedOutput, context) => {
757
- const body = parsedOutput.body;
758
- const deserialized = (0, smithy_client_1._json)(body);
759
- const exception = new models_0_1.CaseCreationLimitExceeded({
760
- $metadata: deserializeMetadata(parsedOutput),
761
- ...deserialized,
762
- });
763
- return (0, smithy_client_1.decorateServiceException)(exception, body);
764
- };
765
- const de_CaseIdNotFoundRes = async (parsedOutput, context) => {
766
- const body = parsedOutput.body;
767
- const deserialized = (0, smithy_client_1._json)(body);
768
- const exception = new models_0_1.CaseIdNotFound({
769
- $metadata: deserializeMetadata(parsedOutput),
770
- ...deserialized,
771
- });
772
- return (0, smithy_client_1.decorateServiceException)(exception, body);
773
- };
774
- const de_DescribeAttachmentLimitExceededRes = async (parsedOutput, context) => {
775
- const body = parsedOutput.body;
776
- const deserialized = (0, smithy_client_1._json)(body);
777
- const exception = new models_0_1.DescribeAttachmentLimitExceeded({
778
- $metadata: deserializeMetadata(parsedOutput),
779
- ...deserialized,
780
- });
781
- return (0, smithy_client_1.decorateServiceException)(exception, body);
782
- };
783
- const de_InternalServerErrorRes = async (parsedOutput, context) => {
784
- const body = parsedOutput.body;
785
- const deserialized = (0, smithy_client_1._json)(body);
786
- const exception = new models_0_1.InternalServerError({
787
- $metadata: deserializeMetadata(parsedOutput),
788
- ...deserialized,
789
- });
790
- return (0, smithy_client_1.decorateServiceException)(exception, body);
791
- };
792
- const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
793
- const body = parsedOutput.body;
794
- const deserialized = (0, smithy_client_1._json)(body);
795
- const exception = new models_0_1.ThrottlingException({
796
- $metadata: deserializeMetadata(parsedOutput),
797
- ...deserialized,
798
- });
799
- return (0, smithy_client_1.decorateServiceException)(exception, body);
800
- };
801
- const se_AddAttachmentsToSetRequest = (input, context) => {
802
- return (0, smithy_client_1.take)(input, {
803
- attachmentSetId: [],
804
- attachments: (_) => se_Attachments(_, context),
805
- });
806
- };
807
- const se_Attachment = (input, context) => {
808
- return (0, smithy_client_1.take)(input, {
809
- data: context.base64Encoder,
810
- fileName: [],
811
- });
812
- };
813
- const se_Attachments = (input, context) => {
814
- return input
815
- .filter((e) => e != null)
816
- .map((entry) => {
817
- return se_Attachment(entry, context);
818
- });
819
- };
820
- const se_DescribeTrustedAdvisorCheckRefreshStatusesRequest = (input, context) => {
821
- return (0, smithy_client_1.take)(input, {
822
- checkIds: (_) => se_StringList(_, context),
823
- });
824
- };
825
- const se_DescribeTrustedAdvisorCheckSummariesRequest = (input, context) => {
826
- return (0, smithy_client_1.take)(input, {
827
- checkIds: (_) => se_StringList(_, context),
828
- });
829
- };
830
- const se_StringList = (input, context) => {
831
- return input;
832
- };
833
- const de_Attachment = (output, context) => {
834
- return (0, smithy_client_1.take)(output, {
835
- data: context.base64Decoder,
836
- fileName: smithy_client_1.expectString,
837
- });
838
- };
839
- const de_DescribeAttachmentResponse = (output, context) => {
840
- return (0, smithy_client_1.take)(output, {
841
- attachment: (_) => de_Attachment(_, context),
842
- });
843
- };
844
- const de_DescribeTrustedAdvisorCheckResultResponse = (output, context) => {
845
- return (0, smithy_client_1.take)(output, {
846
- result: (_) => de_TrustedAdvisorCheckResult(_, context),
847
- });
848
- };
849
- const de_DescribeTrustedAdvisorChecksResponse = (output, context) => {
850
- return (0, smithy_client_1.take)(output, {
851
- checks: (_) => de_TrustedAdvisorCheckList(_, context),
852
- });
853
- };
854
- const de_DescribeTrustedAdvisorCheckSummariesResponse = (output, context) => {
855
- return (0, smithy_client_1.take)(output, {
856
- summaries: (_) => de_TrustedAdvisorCheckSummaryList(_, context),
857
- });
858
- };
859
- const de_StringList = (output, context) => {
860
- const retVal = (output || []).map((entry) => {
861
- if (entry === null) {
862
- return null;
863
- }
864
- return (0, smithy_client_1.expectString)(entry);
865
- });
866
- return retVal;
867
- };
868
- const de_TrustedAdvisorCategorySpecificSummary = (output, context) => {
869
- return (0, smithy_client_1.take)(output, {
870
- costOptimizing: (_) => de_TrustedAdvisorCostOptimizingSummary(_, context),
871
- });
872
- };
873
- const de_TrustedAdvisorCheckDescription = (output, context) => {
874
- return (0, smithy_client_1.take)(output, {
875
- category: smithy_client_1.expectString,
876
- description: smithy_client_1.expectString,
877
- id: smithy_client_1.expectString,
878
- metadata: (_) => de_StringList(_, context),
879
- name: smithy_client_1.expectString,
880
- });
881
- };
882
- const de_TrustedAdvisorCheckList = (output, context) => {
883
- const retVal = (output || [])
884
- .filter((e) => e != null)
885
- .map((entry) => {
886
- return de_TrustedAdvisorCheckDescription(entry, context);
887
- });
888
- return retVal;
889
- };
890
- const de_TrustedAdvisorCheckResult = (output, context) => {
891
- return (0, smithy_client_1.take)(output, {
892
- categorySpecificSummary: (_) => de_TrustedAdvisorCategorySpecificSummary(_, context),
893
- checkId: smithy_client_1.expectString,
894
- flaggedResources: (_) => de_TrustedAdvisorResourceDetailList(_, context),
895
- resourcesSummary: smithy_client_1._json,
896
- status: smithy_client_1.expectString,
897
- timestamp: smithy_client_1.expectString,
898
- });
899
- };
900
- const de_TrustedAdvisorCheckSummary = (output, context) => {
901
- return (0, smithy_client_1.take)(output, {
902
- categorySpecificSummary: (_) => de_TrustedAdvisorCategorySpecificSummary(_, context),
903
- checkId: smithy_client_1.expectString,
904
- hasFlaggedResources: smithy_client_1.expectBoolean,
905
- resourcesSummary: smithy_client_1._json,
906
- status: smithy_client_1.expectString,
907
- timestamp: smithy_client_1.expectString,
908
- });
909
- };
910
- const de_TrustedAdvisorCheckSummaryList = (output, context) => {
911
- const retVal = (output || [])
912
- .filter((e) => e != null)
913
- .map((entry) => {
914
- return de_TrustedAdvisorCheckSummary(entry, context);
915
- });
916
- return retVal;
917
- };
918
- const de_TrustedAdvisorCostOptimizingSummary = (output, context) => {
919
- return (0, smithy_client_1.take)(output, {
920
- estimatedMonthlySavings: smithy_client_1.limitedParseDouble,
921
- estimatedPercentMonthlySavings: smithy_client_1.limitedParseDouble,
922
- });
923
- };
924
- const de_TrustedAdvisorResourceDetail = (output, context) => {
925
- return (0, smithy_client_1.take)(output, {
926
- isSuppressed: smithy_client_1.expectBoolean,
927
- metadata: (_) => de_StringList(_, context),
928
- region: smithy_client_1.expectString,
929
- resourceId: smithy_client_1.expectString,
930
- status: smithy_client_1.expectString,
931
- });
932
- };
933
- const de_TrustedAdvisorResourceDetailList = (output, context) => {
934
- const retVal = (output || [])
935
- .filter((e) => e != null)
936
- .map((entry) => {
937
- return de_TrustedAdvisorResourceDetail(entry, context);
938
- });
939
- return retVal;
940
- };
941
- const deserializeMetadata = (output) => ({
942
- httpStatusCode: output.statusCode,
943
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
944
- extendedRequestId: output.headers["x-amz-id-2"],
945
- cfId: output.headers["x-amz-cf-id"],
946
- });
947
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
948
- const throwDefaultError = (0, smithy_client_1.withBaseException)(SupportServiceException_1.SupportServiceException);
949
- const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
950
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
951
- const contents = {
952
- protocol,
953
- hostname,
954
- port,
955
- method: "POST",
956
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
957
- headers,
958
- };
959
- if (resolvedHostname !== undefined) {
960
- contents.hostname = resolvedHostname;
961
- }
962
- if (body !== undefined) {
963
- contents.body = body;
964
- }
965
- return new protocol_http_1.HttpRequest(contents);
966
- };
967
- function sharedHeaders(operation) {
968
- return {
969
- "content-type": "application/x-amz-json-1.1",
970
- "x-amz-target": `AWSSupport_20130415.${operation}`,
971
- };
972
- }
973
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
974
- if (encoded.length) {
975
- return JSON.parse(encoded);
976
- }
977
- return {};
978
- });
979
- const parseErrorBody = async (errorBody, context) => {
980
- const value = await parseBody(errorBody, context);
981
- value.message = value.message ?? value.Message;
982
- return value;
983
- };
984
- const loadRestJsonErrorCode = (output, data) => {
985
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
986
- const sanitizeErrorCode = (rawValue) => {
987
- let cleanValue = rawValue;
988
- if (typeof cleanValue === "number") {
989
- cleanValue = cleanValue.toString();
990
- }
991
- if (cleanValue.indexOf(",") >= 0) {
992
- cleanValue = cleanValue.split(",")[0];
993
- }
994
- if (cleanValue.indexOf(":") >= 0) {
995
- cleanValue = cleanValue.split(":")[0];
996
- }
997
- if (cleanValue.indexOf("#") >= 0) {
998
- cleanValue = cleanValue.split("#")[1];
999
- }
1000
- return cleanValue;
1001
- };
1002
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1003
- if (headerKey !== undefined) {
1004
- return sanitizeErrorCode(output.headers[headerKey]);
1005
- }
1006
- if (data.code !== undefined) {
1007
- return sanitizeErrorCode(data.code);
1008
- }
1009
- if (data["__type"] !== undefined) {
1010
- return sanitizeErrorCode(data["__type"]);
1011
- }
1012
- };
1
+ module.exports = require("../index.js");