@aws-sdk/client-pi 3.489.0 → 3.495.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist-cjs/PI.js +1 -37
  2. package/dist-cjs/PIClient.js +1 -43
  3. package/dist-cjs/commands/CreatePerformanceAnalysisReportCommand.js +1 -28
  4. package/dist-cjs/commands/DeletePerformanceAnalysisReportCommand.js +1 -28
  5. package/dist-cjs/commands/DescribeDimensionKeysCommand.js +1 -28
  6. package/dist-cjs/commands/GetDimensionKeyDetailsCommand.js +1 -28
  7. package/dist-cjs/commands/GetPerformanceAnalysisReportCommand.js +1 -29
  8. package/dist-cjs/commands/GetResourceMetadataCommand.js +1 -28
  9. package/dist-cjs/commands/GetResourceMetricsCommand.js +1 -28
  10. package/dist-cjs/commands/ListAvailableResourceDimensionsCommand.js +1 -28
  11. package/dist-cjs/commands/ListAvailableResourceMetricsCommand.js +1 -28
  12. package/dist-cjs/commands/ListPerformanceAnalysisReportsCommand.js +1 -28
  13. package/dist-cjs/commands/ListTagsForResourceCommand.js +1 -28
  14. package/dist-cjs/commands/TagResourceCommand.js +1 -28
  15. package/dist-cjs/commands/UntagResourceCommand.js +1 -28
  16. package/dist-cjs/commands/index.js +1 -16
  17. package/dist-cjs/endpoint/EndpointParameters.js +1 -18
  18. package/dist-cjs/extensionConfiguration.js +1 -2
  19. package/dist-cjs/index.js +1462 -11
  20. package/dist-cjs/models/PIServiceException.js +1 -12
  21. package/dist-cjs/models/index.js +1 -4
  22. package/dist-cjs/models/models_0.js +1 -115
  23. package/dist-cjs/pagination/DescribeDimensionKeysPaginator.js +1 -7
  24. package/dist-cjs/pagination/GetResourceMetricsPaginator.js +1 -7
  25. package/dist-cjs/pagination/Interfaces.js +1 -2
  26. package/dist-cjs/pagination/ListAvailableResourceDimensionsPaginator.js +1 -7
  27. package/dist-cjs/pagination/ListAvailableResourceMetricsPaginator.js +1 -7
  28. package/dist-cjs/pagination/ListPerformanceAnalysisReportsPaginator.js +1 -7
  29. package/dist-cjs/pagination/index.js +1 -9
  30. package/dist-cjs/protocols/Aws_json1_1.js +1 -906
  31. package/dist-cjs/runtimeExtensions.js +1 -22
  32. package/package.json +40 -40
@@ -1,906 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_ListTagsForResourceCommand = exports.de_ListPerformanceAnalysisReportsCommand = exports.de_ListAvailableResourceMetricsCommand = exports.de_ListAvailableResourceDimensionsCommand = exports.de_GetResourceMetricsCommand = exports.de_GetResourceMetadataCommand = exports.de_GetPerformanceAnalysisReportCommand = exports.de_GetDimensionKeyDetailsCommand = exports.de_DescribeDimensionKeysCommand = exports.de_DeletePerformanceAnalysisReportCommand = exports.de_CreatePerformanceAnalysisReportCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_ListTagsForResourceCommand = exports.se_ListPerformanceAnalysisReportsCommand = exports.se_ListAvailableResourceMetricsCommand = exports.se_ListAvailableResourceDimensionsCommand = exports.se_GetResourceMetricsCommand = exports.se_GetResourceMetadataCommand = exports.se_GetPerformanceAnalysisReportCommand = exports.se_GetDimensionKeyDetailsCommand = exports.se_DescribeDimensionKeysCommand = exports.se_DeletePerformanceAnalysisReportCommand = exports.se_CreatePerformanceAnalysisReportCommand = 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 PIServiceException_1 = require("../models/PIServiceException");
8
- const se_CreatePerformanceAnalysisReportCommand = async (input, context) => {
9
- const headers = sharedHeaders("CreatePerformanceAnalysisReport");
10
- let body;
11
- body = JSON.stringify(se_CreatePerformanceAnalysisReportRequest(input, context));
12
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
- };
14
- exports.se_CreatePerformanceAnalysisReportCommand = se_CreatePerformanceAnalysisReportCommand;
15
- const se_DeletePerformanceAnalysisReportCommand = async (input, context) => {
16
- const headers = sharedHeaders("DeletePerformanceAnalysisReport");
17
- let body;
18
- body = JSON.stringify((0, smithy_client_1._json)(input));
19
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
20
- };
21
- exports.se_DeletePerformanceAnalysisReportCommand = se_DeletePerformanceAnalysisReportCommand;
22
- const se_DescribeDimensionKeysCommand = async (input, context) => {
23
- const headers = sharedHeaders("DescribeDimensionKeys");
24
- let body;
25
- body = JSON.stringify(se_DescribeDimensionKeysRequest(input, context));
26
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
27
- };
28
- exports.se_DescribeDimensionKeysCommand = se_DescribeDimensionKeysCommand;
29
- const se_GetDimensionKeyDetailsCommand = async (input, context) => {
30
- const headers = sharedHeaders("GetDimensionKeyDetails");
31
- let body;
32
- body = JSON.stringify((0, smithy_client_1._json)(input));
33
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
34
- };
35
- exports.se_GetDimensionKeyDetailsCommand = se_GetDimensionKeyDetailsCommand;
36
- const se_GetPerformanceAnalysisReportCommand = async (input, context) => {
37
- const headers = sharedHeaders("GetPerformanceAnalysisReport");
38
- let body;
39
- body = JSON.stringify((0, smithy_client_1._json)(input));
40
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
41
- };
42
- exports.se_GetPerformanceAnalysisReportCommand = se_GetPerformanceAnalysisReportCommand;
43
- const se_GetResourceMetadataCommand = async (input, context) => {
44
- const headers = sharedHeaders("GetResourceMetadata");
45
- let body;
46
- body = JSON.stringify((0, smithy_client_1._json)(input));
47
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
48
- };
49
- exports.se_GetResourceMetadataCommand = se_GetResourceMetadataCommand;
50
- const se_GetResourceMetricsCommand = async (input, context) => {
51
- const headers = sharedHeaders("GetResourceMetrics");
52
- let body;
53
- body = JSON.stringify(se_GetResourceMetricsRequest(input, context));
54
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
55
- };
56
- exports.se_GetResourceMetricsCommand = se_GetResourceMetricsCommand;
57
- const se_ListAvailableResourceDimensionsCommand = async (input, context) => {
58
- const headers = sharedHeaders("ListAvailableResourceDimensions");
59
- let body;
60
- body = JSON.stringify((0, smithy_client_1._json)(input));
61
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
62
- };
63
- exports.se_ListAvailableResourceDimensionsCommand = se_ListAvailableResourceDimensionsCommand;
64
- const se_ListAvailableResourceMetricsCommand = async (input, context) => {
65
- const headers = sharedHeaders("ListAvailableResourceMetrics");
66
- let body;
67
- body = JSON.stringify((0, smithy_client_1._json)(input));
68
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
69
- };
70
- exports.se_ListAvailableResourceMetricsCommand = se_ListAvailableResourceMetricsCommand;
71
- const se_ListPerformanceAnalysisReportsCommand = async (input, context) => {
72
- const headers = sharedHeaders("ListPerformanceAnalysisReports");
73
- let body;
74
- body = JSON.stringify((0, smithy_client_1._json)(input));
75
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
76
- };
77
- exports.se_ListPerformanceAnalysisReportsCommand = se_ListPerformanceAnalysisReportsCommand;
78
- const se_ListTagsForResourceCommand = async (input, context) => {
79
- const headers = sharedHeaders("ListTagsForResource");
80
- let body;
81
- body = JSON.stringify((0, smithy_client_1._json)(input));
82
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
83
- };
84
- exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
85
- const se_TagResourceCommand = async (input, context) => {
86
- const headers = sharedHeaders("TagResource");
87
- let body;
88
- body = JSON.stringify((0, smithy_client_1._json)(input));
89
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
90
- };
91
- exports.se_TagResourceCommand = se_TagResourceCommand;
92
- const se_UntagResourceCommand = async (input, context) => {
93
- const headers = sharedHeaders("UntagResource");
94
- let body;
95
- body = JSON.stringify((0, smithy_client_1._json)(input));
96
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
97
- };
98
- exports.se_UntagResourceCommand = se_UntagResourceCommand;
99
- const de_CreatePerformanceAnalysisReportCommand = async (output, context) => {
100
- if (output.statusCode >= 300) {
101
- return de_CreatePerformanceAnalysisReportCommandError(output, context);
102
- }
103
- const data = await parseBody(output.body, context);
104
- let contents = {};
105
- contents = (0, smithy_client_1._json)(data);
106
- const response = {
107
- $metadata: deserializeMetadata(output),
108
- ...contents,
109
- };
110
- return response;
111
- };
112
- exports.de_CreatePerformanceAnalysisReportCommand = de_CreatePerformanceAnalysisReportCommand;
113
- const de_CreatePerformanceAnalysisReportCommandError = async (output, context) => {
114
- const parsedOutput = {
115
- ...output,
116
- body: await parseErrorBody(output.body, context),
117
- };
118
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
119
- switch (errorCode) {
120
- case "InternalServiceError":
121
- case "com.amazonaws.pi#InternalServiceError":
122
- throw await de_InternalServiceErrorRes(parsedOutput, context);
123
- case "InvalidArgumentException":
124
- case "com.amazonaws.pi#InvalidArgumentException":
125
- throw await de_InvalidArgumentExceptionRes(parsedOutput, context);
126
- case "NotAuthorizedException":
127
- case "com.amazonaws.pi#NotAuthorizedException":
128
- throw await de_NotAuthorizedExceptionRes(parsedOutput, context);
129
- default:
130
- const parsedBody = parsedOutput.body;
131
- return throwDefaultError({
132
- output,
133
- parsedBody,
134
- errorCode,
135
- });
136
- }
137
- };
138
- const de_DeletePerformanceAnalysisReportCommand = async (output, context) => {
139
- if (output.statusCode >= 300) {
140
- return de_DeletePerformanceAnalysisReportCommandError(output, context);
141
- }
142
- const data = await parseBody(output.body, context);
143
- let contents = {};
144
- contents = (0, smithy_client_1._json)(data);
145
- const response = {
146
- $metadata: deserializeMetadata(output),
147
- ...contents,
148
- };
149
- return response;
150
- };
151
- exports.de_DeletePerformanceAnalysisReportCommand = de_DeletePerformanceAnalysisReportCommand;
152
- const de_DeletePerformanceAnalysisReportCommandError = async (output, context) => {
153
- const parsedOutput = {
154
- ...output,
155
- body: await parseErrorBody(output.body, context),
156
- };
157
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
158
- switch (errorCode) {
159
- case "InternalServiceError":
160
- case "com.amazonaws.pi#InternalServiceError":
161
- throw await de_InternalServiceErrorRes(parsedOutput, context);
162
- case "InvalidArgumentException":
163
- case "com.amazonaws.pi#InvalidArgumentException":
164
- throw await de_InvalidArgumentExceptionRes(parsedOutput, context);
165
- case "NotAuthorizedException":
166
- case "com.amazonaws.pi#NotAuthorizedException":
167
- throw await de_NotAuthorizedExceptionRes(parsedOutput, context);
168
- default:
169
- const parsedBody = parsedOutput.body;
170
- return throwDefaultError({
171
- output,
172
- parsedBody,
173
- errorCode,
174
- });
175
- }
176
- };
177
- const de_DescribeDimensionKeysCommand = async (output, context) => {
178
- if (output.statusCode >= 300) {
179
- return de_DescribeDimensionKeysCommandError(output, context);
180
- }
181
- const data = await parseBody(output.body, context);
182
- let contents = {};
183
- contents = de_DescribeDimensionKeysResponse(data, context);
184
- const response = {
185
- $metadata: deserializeMetadata(output),
186
- ...contents,
187
- };
188
- return response;
189
- };
190
- exports.de_DescribeDimensionKeysCommand = de_DescribeDimensionKeysCommand;
191
- const de_DescribeDimensionKeysCommandError = async (output, context) => {
192
- const parsedOutput = {
193
- ...output,
194
- body: await parseErrorBody(output.body, context),
195
- };
196
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
197
- switch (errorCode) {
198
- case "InternalServiceError":
199
- case "com.amazonaws.pi#InternalServiceError":
200
- throw await de_InternalServiceErrorRes(parsedOutput, context);
201
- case "InvalidArgumentException":
202
- case "com.amazonaws.pi#InvalidArgumentException":
203
- throw await de_InvalidArgumentExceptionRes(parsedOutput, context);
204
- case "NotAuthorizedException":
205
- case "com.amazonaws.pi#NotAuthorizedException":
206
- throw await de_NotAuthorizedExceptionRes(parsedOutput, context);
207
- default:
208
- const parsedBody = parsedOutput.body;
209
- return throwDefaultError({
210
- output,
211
- parsedBody,
212
- errorCode,
213
- });
214
- }
215
- };
216
- const de_GetDimensionKeyDetailsCommand = async (output, context) => {
217
- if (output.statusCode >= 300) {
218
- return de_GetDimensionKeyDetailsCommandError(output, context);
219
- }
220
- const data = await parseBody(output.body, context);
221
- let contents = {};
222
- contents = (0, smithy_client_1._json)(data);
223
- const response = {
224
- $metadata: deserializeMetadata(output),
225
- ...contents,
226
- };
227
- return response;
228
- };
229
- exports.de_GetDimensionKeyDetailsCommand = de_GetDimensionKeyDetailsCommand;
230
- const de_GetDimensionKeyDetailsCommandError = async (output, context) => {
231
- const parsedOutput = {
232
- ...output,
233
- body: await parseErrorBody(output.body, context),
234
- };
235
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
236
- switch (errorCode) {
237
- case "InternalServiceError":
238
- case "com.amazonaws.pi#InternalServiceError":
239
- throw await de_InternalServiceErrorRes(parsedOutput, context);
240
- case "InvalidArgumentException":
241
- case "com.amazonaws.pi#InvalidArgumentException":
242
- throw await de_InvalidArgumentExceptionRes(parsedOutput, context);
243
- case "NotAuthorizedException":
244
- case "com.amazonaws.pi#NotAuthorizedException":
245
- throw await de_NotAuthorizedExceptionRes(parsedOutput, context);
246
- default:
247
- const parsedBody = parsedOutput.body;
248
- return throwDefaultError({
249
- output,
250
- parsedBody,
251
- errorCode,
252
- });
253
- }
254
- };
255
- const de_GetPerformanceAnalysisReportCommand = async (output, context) => {
256
- if (output.statusCode >= 300) {
257
- return de_GetPerformanceAnalysisReportCommandError(output, context);
258
- }
259
- const data = await parseBody(output.body, context);
260
- let contents = {};
261
- contents = de_GetPerformanceAnalysisReportResponse(data, context);
262
- const response = {
263
- $metadata: deserializeMetadata(output),
264
- ...contents,
265
- };
266
- return response;
267
- };
268
- exports.de_GetPerformanceAnalysisReportCommand = de_GetPerformanceAnalysisReportCommand;
269
- const de_GetPerformanceAnalysisReportCommandError = async (output, context) => {
270
- const parsedOutput = {
271
- ...output,
272
- body: await parseErrorBody(output.body, context),
273
- };
274
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
275
- switch (errorCode) {
276
- case "InternalServiceError":
277
- case "com.amazonaws.pi#InternalServiceError":
278
- throw await de_InternalServiceErrorRes(parsedOutput, context);
279
- case "InvalidArgumentException":
280
- case "com.amazonaws.pi#InvalidArgumentException":
281
- throw await de_InvalidArgumentExceptionRes(parsedOutput, context);
282
- case "NotAuthorizedException":
283
- case "com.amazonaws.pi#NotAuthorizedException":
284
- throw await de_NotAuthorizedExceptionRes(parsedOutput, context);
285
- default:
286
- const parsedBody = parsedOutput.body;
287
- return throwDefaultError({
288
- output,
289
- parsedBody,
290
- errorCode,
291
- });
292
- }
293
- };
294
- const de_GetResourceMetadataCommand = async (output, context) => {
295
- if (output.statusCode >= 300) {
296
- return de_GetResourceMetadataCommandError(output, context);
297
- }
298
- const data = await parseBody(output.body, context);
299
- let contents = {};
300
- contents = (0, smithy_client_1._json)(data);
301
- const response = {
302
- $metadata: deserializeMetadata(output),
303
- ...contents,
304
- };
305
- return response;
306
- };
307
- exports.de_GetResourceMetadataCommand = de_GetResourceMetadataCommand;
308
- const de_GetResourceMetadataCommandError = async (output, context) => {
309
- const parsedOutput = {
310
- ...output,
311
- body: await parseErrorBody(output.body, context),
312
- };
313
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
314
- switch (errorCode) {
315
- case "InternalServiceError":
316
- case "com.amazonaws.pi#InternalServiceError":
317
- throw await de_InternalServiceErrorRes(parsedOutput, context);
318
- case "InvalidArgumentException":
319
- case "com.amazonaws.pi#InvalidArgumentException":
320
- throw await de_InvalidArgumentExceptionRes(parsedOutput, context);
321
- case "NotAuthorizedException":
322
- case "com.amazonaws.pi#NotAuthorizedException":
323
- throw await de_NotAuthorizedExceptionRes(parsedOutput, context);
324
- default:
325
- const parsedBody = parsedOutput.body;
326
- return throwDefaultError({
327
- output,
328
- parsedBody,
329
- errorCode,
330
- });
331
- }
332
- };
333
- const de_GetResourceMetricsCommand = async (output, context) => {
334
- if (output.statusCode >= 300) {
335
- return de_GetResourceMetricsCommandError(output, context);
336
- }
337
- const data = await parseBody(output.body, context);
338
- let contents = {};
339
- contents = de_GetResourceMetricsResponse(data, context);
340
- const response = {
341
- $metadata: deserializeMetadata(output),
342
- ...contents,
343
- };
344
- return response;
345
- };
346
- exports.de_GetResourceMetricsCommand = de_GetResourceMetricsCommand;
347
- const de_GetResourceMetricsCommandError = async (output, context) => {
348
- const parsedOutput = {
349
- ...output,
350
- body: await parseErrorBody(output.body, context),
351
- };
352
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
353
- switch (errorCode) {
354
- case "InternalServiceError":
355
- case "com.amazonaws.pi#InternalServiceError":
356
- throw await de_InternalServiceErrorRes(parsedOutput, context);
357
- case "InvalidArgumentException":
358
- case "com.amazonaws.pi#InvalidArgumentException":
359
- throw await de_InvalidArgumentExceptionRes(parsedOutput, context);
360
- case "NotAuthorizedException":
361
- case "com.amazonaws.pi#NotAuthorizedException":
362
- throw await de_NotAuthorizedExceptionRes(parsedOutput, context);
363
- default:
364
- const parsedBody = parsedOutput.body;
365
- return throwDefaultError({
366
- output,
367
- parsedBody,
368
- errorCode,
369
- });
370
- }
371
- };
372
- const de_ListAvailableResourceDimensionsCommand = async (output, context) => {
373
- if (output.statusCode >= 300) {
374
- return de_ListAvailableResourceDimensionsCommandError(output, context);
375
- }
376
- const data = await parseBody(output.body, context);
377
- let contents = {};
378
- contents = (0, smithy_client_1._json)(data);
379
- const response = {
380
- $metadata: deserializeMetadata(output),
381
- ...contents,
382
- };
383
- return response;
384
- };
385
- exports.de_ListAvailableResourceDimensionsCommand = de_ListAvailableResourceDimensionsCommand;
386
- const de_ListAvailableResourceDimensionsCommandError = async (output, context) => {
387
- const parsedOutput = {
388
- ...output,
389
- body: await parseErrorBody(output.body, context),
390
- };
391
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
392
- switch (errorCode) {
393
- case "InternalServiceError":
394
- case "com.amazonaws.pi#InternalServiceError":
395
- throw await de_InternalServiceErrorRes(parsedOutput, context);
396
- case "InvalidArgumentException":
397
- case "com.amazonaws.pi#InvalidArgumentException":
398
- throw await de_InvalidArgumentExceptionRes(parsedOutput, context);
399
- case "NotAuthorizedException":
400
- case "com.amazonaws.pi#NotAuthorizedException":
401
- throw await de_NotAuthorizedExceptionRes(parsedOutput, context);
402
- default:
403
- const parsedBody = parsedOutput.body;
404
- return throwDefaultError({
405
- output,
406
- parsedBody,
407
- errorCode,
408
- });
409
- }
410
- };
411
- const de_ListAvailableResourceMetricsCommand = async (output, context) => {
412
- if (output.statusCode >= 300) {
413
- return de_ListAvailableResourceMetricsCommandError(output, context);
414
- }
415
- const data = await parseBody(output.body, context);
416
- let contents = {};
417
- contents = (0, smithy_client_1._json)(data);
418
- const response = {
419
- $metadata: deserializeMetadata(output),
420
- ...contents,
421
- };
422
- return response;
423
- };
424
- exports.de_ListAvailableResourceMetricsCommand = de_ListAvailableResourceMetricsCommand;
425
- const de_ListAvailableResourceMetricsCommandError = async (output, context) => {
426
- const parsedOutput = {
427
- ...output,
428
- body: await parseErrorBody(output.body, context),
429
- };
430
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
431
- switch (errorCode) {
432
- case "InternalServiceError":
433
- case "com.amazonaws.pi#InternalServiceError":
434
- throw await de_InternalServiceErrorRes(parsedOutput, context);
435
- case "InvalidArgumentException":
436
- case "com.amazonaws.pi#InvalidArgumentException":
437
- throw await de_InvalidArgumentExceptionRes(parsedOutput, context);
438
- case "NotAuthorizedException":
439
- case "com.amazonaws.pi#NotAuthorizedException":
440
- throw await de_NotAuthorizedExceptionRes(parsedOutput, context);
441
- default:
442
- const parsedBody = parsedOutput.body;
443
- return throwDefaultError({
444
- output,
445
- parsedBody,
446
- errorCode,
447
- });
448
- }
449
- };
450
- const de_ListPerformanceAnalysisReportsCommand = async (output, context) => {
451
- if (output.statusCode >= 300) {
452
- return de_ListPerformanceAnalysisReportsCommandError(output, context);
453
- }
454
- const data = await parseBody(output.body, context);
455
- let contents = {};
456
- contents = de_ListPerformanceAnalysisReportsResponse(data, context);
457
- const response = {
458
- $metadata: deserializeMetadata(output),
459
- ...contents,
460
- };
461
- return response;
462
- };
463
- exports.de_ListPerformanceAnalysisReportsCommand = de_ListPerformanceAnalysisReportsCommand;
464
- const de_ListPerformanceAnalysisReportsCommandError = async (output, context) => {
465
- const parsedOutput = {
466
- ...output,
467
- body: await parseErrorBody(output.body, context),
468
- };
469
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
470
- switch (errorCode) {
471
- case "InternalServiceError":
472
- case "com.amazonaws.pi#InternalServiceError":
473
- throw await de_InternalServiceErrorRes(parsedOutput, context);
474
- case "InvalidArgumentException":
475
- case "com.amazonaws.pi#InvalidArgumentException":
476
- throw await de_InvalidArgumentExceptionRes(parsedOutput, context);
477
- case "NotAuthorizedException":
478
- case "com.amazonaws.pi#NotAuthorizedException":
479
- throw await de_NotAuthorizedExceptionRes(parsedOutput, context);
480
- default:
481
- const parsedBody = parsedOutput.body;
482
- return throwDefaultError({
483
- output,
484
- parsedBody,
485
- errorCode,
486
- });
487
- }
488
- };
489
- const de_ListTagsForResourceCommand = async (output, context) => {
490
- if (output.statusCode >= 300) {
491
- return de_ListTagsForResourceCommandError(output, context);
492
- }
493
- const data = await parseBody(output.body, context);
494
- let contents = {};
495
- contents = (0, smithy_client_1._json)(data);
496
- const response = {
497
- $metadata: deserializeMetadata(output),
498
- ...contents,
499
- };
500
- return response;
501
- };
502
- exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
503
- const de_ListTagsForResourceCommandError = async (output, context) => {
504
- const parsedOutput = {
505
- ...output,
506
- body: await parseErrorBody(output.body, context),
507
- };
508
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
509
- switch (errorCode) {
510
- case "InternalServiceError":
511
- case "com.amazonaws.pi#InternalServiceError":
512
- throw await de_InternalServiceErrorRes(parsedOutput, context);
513
- case "InvalidArgumentException":
514
- case "com.amazonaws.pi#InvalidArgumentException":
515
- throw await de_InvalidArgumentExceptionRes(parsedOutput, context);
516
- case "NotAuthorizedException":
517
- case "com.amazonaws.pi#NotAuthorizedException":
518
- throw await de_NotAuthorizedExceptionRes(parsedOutput, context);
519
- default:
520
- const parsedBody = parsedOutput.body;
521
- return throwDefaultError({
522
- output,
523
- parsedBody,
524
- errorCode,
525
- });
526
- }
527
- };
528
- const de_TagResourceCommand = async (output, context) => {
529
- if (output.statusCode >= 300) {
530
- return de_TagResourceCommandError(output, context);
531
- }
532
- const data = await parseBody(output.body, context);
533
- let contents = {};
534
- contents = (0, smithy_client_1._json)(data);
535
- const response = {
536
- $metadata: deserializeMetadata(output),
537
- ...contents,
538
- };
539
- return response;
540
- };
541
- exports.de_TagResourceCommand = de_TagResourceCommand;
542
- const de_TagResourceCommandError = async (output, context) => {
543
- const parsedOutput = {
544
- ...output,
545
- body: await parseErrorBody(output.body, context),
546
- };
547
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
548
- switch (errorCode) {
549
- case "InternalServiceError":
550
- case "com.amazonaws.pi#InternalServiceError":
551
- throw await de_InternalServiceErrorRes(parsedOutput, context);
552
- case "InvalidArgumentException":
553
- case "com.amazonaws.pi#InvalidArgumentException":
554
- throw await de_InvalidArgumentExceptionRes(parsedOutput, context);
555
- case "NotAuthorizedException":
556
- case "com.amazonaws.pi#NotAuthorizedException":
557
- throw await de_NotAuthorizedExceptionRes(parsedOutput, context);
558
- default:
559
- const parsedBody = parsedOutput.body;
560
- return throwDefaultError({
561
- output,
562
- parsedBody,
563
- errorCode,
564
- });
565
- }
566
- };
567
- const de_UntagResourceCommand = async (output, context) => {
568
- if (output.statusCode >= 300) {
569
- return de_UntagResourceCommandError(output, context);
570
- }
571
- const data = await parseBody(output.body, context);
572
- let contents = {};
573
- contents = (0, smithy_client_1._json)(data);
574
- const response = {
575
- $metadata: deserializeMetadata(output),
576
- ...contents,
577
- };
578
- return response;
579
- };
580
- exports.de_UntagResourceCommand = de_UntagResourceCommand;
581
- const de_UntagResourceCommandError = async (output, context) => {
582
- const parsedOutput = {
583
- ...output,
584
- body: await parseErrorBody(output.body, context),
585
- };
586
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
587
- switch (errorCode) {
588
- case "InternalServiceError":
589
- case "com.amazonaws.pi#InternalServiceError":
590
- throw await de_InternalServiceErrorRes(parsedOutput, context);
591
- case "InvalidArgumentException":
592
- case "com.amazonaws.pi#InvalidArgumentException":
593
- throw await de_InvalidArgumentExceptionRes(parsedOutput, context);
594
- case "NotAuthorizedException":
595
- case "com.amazonaws.pi#NotAuthorizedException":
596
- throw await de_NotAuthorizedExceptionRes(parsedOutput, context);
597
- default:
598
- const parsedBody = parsedOutput.body;
599
- return throwDefaultError({
600
- output,
601
- parsedBody,
602
- errorCode,
603
- });
604
- }
605
- };
606
- const de_InternalServiceErrorRes = async (parsedOutput, context) => {
607
- const body = parsedOutput.body;
608
- const deserialized = (0, smithy_client_1._json)(body);
609
- const exception = new models_0_1.InternalServiceError({
610
- $metadata: deserializeMetadata(parsedOutput),
611
- ...deserialized,
612
- });
613
- return (0, smithy_client_1.decorateServiceException)(exception, body);
614
- };
615
- const de_InvalidArgumentExceptionRes = async (parsedOutput, context) => {
616
- const body = parsedOutput.body;
617
- const deserialized = (0, smithy_client_1._json)(body);
618
- const exception = new models_0_1.InvalidArgumentException({
619
- $metadata: deserializeMetadata(parsedOutput),
620
- ...deserialized,
621
- });
622
- return (0, smithy_client_1.decorateServiceException)(exception, body);
623
- };
624
- const de_NotAuthorizedExceptionRes = async (parsedOutput, context) => {
625
- const body = parsedOutput.body;
626
- const deserialized = (0, smithy_client_1._json)(body);
627
- const exception = new models_0_1.NotAuthorizedException({
628
- $metadata: deserializeMetadata(parsedOutput),
629
- ...deserialized,
630
- });
631
- return (0, smithy_client_1.decorateServiceException)(exception, body);
632
- };
633
- const se_CreatePerformanceAnalysisReportRequest = (input, context) => {
634
- return (0, smithy_client_1.take)(input, {
635
- EndTime: (_) => Math.round(_.getTime() / 1000),
636
- Identifier: [],
637
- ServiceType: [],
638
- StartTime: (_) => Math.round(_.getTime() / 1000),
639
- Tags: smithy_client_1._json,
640
- });
641
- };
642
- const se_DescribeDimensionKeysRequest = (input, context) => {
643
- return (0, smithy_client_1.take)(input, {
644
- AdditionalMetrics: smithy_client_1._json,
645
- EndTime: (_) => Math.round(_.getTime() / 1000),
646
- Filter: smithy_client_1._json,
647
- GroupBy: smithy_client_1._json,
648
- Identifier: [],
649
- MaxResults: [],
650
- Metric: [],
651
- NextToken: [],
652
- PartitionBy: smithy_client_1._json,
653
- PeriodInSeconds: [],
654
- ServiceType: [],
655
- StartTime: (_) => Math.round(_.getTime() / 1000),
656
- });
657
- };
658
- const se_GetResourceMetricsRequest = (input, context) => {
659
- return (0, smithy_client_1.take)(input, {
660
- EndTime: (_) => Math.round(_.getTime() / 1000),
661
- Identifier: [],
662
- MaxResults: [],
663
- MetricQueries: smithy_client_1._json,
664
- NextToken: [],
665
- PeriodAlignment: [],
666
- PeriodInSeconds: [],
667
- ServiceType: [],
668
- StartTime: (_) => Math.round(_.getTime() / 1000),
669
- });
670
- };
671
- const de_AdditionalMetricsMap = (output, context) => {
672
- return Object.entries(output).reduce((acc, [key, value]) => {
673
- if (value === null) {
674
- return acc;
675
- }
676
- acc[key] = (0, smithy_client_1.limitedParseDouble)(value);
677
- return acc;
678
- }, {});
679
- };
680
- const de_AnalysisReport = (output, context) => {
681
- return (0, smithy_client_1.take)(output, {
682
- AnalysisReportId: smithy_client_1.expectString,
683
- CreateTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
684
- EndTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
685
- Identifier: smithy_client_1.expectString,
686
- Insights: (_) => de_InsightList(_, context),
687
- ServiceType: smithy_client_1.expectString,
688
- StartTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
689
- Status: smithy_client_1.expectString,
690
- });
691
- };
692
- const de_AnalysisReportSummary = (output, context) => {
693
- return (0, smithy_client_1.take)(output, {
694
- AnalysisReportId: smithy_client_1.expectString,
695
- CreateTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
696
- EndTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
697
- StartTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
698
- Status: smithy_client_1.expectString,
699
- Tags: smithy_client_1._json,
700
- });
701
- };
702
- const de_AnalysisReportSummaryList = (output, context) => {
703
- const retVal = (output || [])
704
- .filter((e) => e != null)
705
- .map((entry) => {
706
- return de_AnalysisReportSummary(entry, context);
707
- });
708
- return retVal;
709
- };
710
- const de_Data = (output, context) => {
711
- return (0, smithy_client_1.take)(output, {
712
- PerformanceInsightsMetric: (_) => de_PerformanceInsightsMetric(_, context),
713
- });
714
- };
715
- const de_DataList = (output, context) => {
716
- const retVal = (output || [])
717
- .filter((e) => e != null)
718
- .map((entry) => {
719
- return de_Data(entry, context);
720
- });
721
- return retVal;
722
- };
723
- const de_DataPoint = (output, context) => {
724
- return (0, smithy_client_1.take)(output, {
725
- Timestamp: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
726
- Value: smithy_client_1.limitedParseDouble,
727
- });
728
- };
729
- const de_DataPointsList = (output, context) => {
730
- const retVal = (output || [])
731
- .filter((e) => e != null)
732
- .map((entry) => {
733
- return de_DataPoint(entry, context);
734
- });
735
- return retVal;
736
- };
737
- const de_DescribeDimensionKeysResponse = (output, context) => {
738
- return (0, smithy_client_1.take)(output, {
739
- AlignedEndTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
740
- AlignedStartTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
741
- Keys: (_) => de_DimensionKeyDescriptionList(_, context),
742
- NextToken: smithy_client_1.expectString,
743
- PartitionKeys: smithy_client_1._json,
744
- });
745
- };
746
- const de_DimensionKeyDescription = (output, context) => {
747
- return (0, smithy_client_1.take)(output, {
748
- AdditionalMetrics: (_) => de_AdditionalMetricsMap(_, context),
749
- Dimensions: smithy_client_1._json,
750
- Partitions: (_) => de_MetricValuesList(_, context),
751
- Total: smithy_client_1.limitedParseDouble,
752
- });
753
- };
754
- const de_DimensionKeyDescriptionList = (output, context) => {
755
- const retVal = (output || [])
756
- .filter((e) => e != null)
757
- .map((entry) => {
758
- return de_DimensionKeyDescription(entry, context);
759
- });
760
- return retVal;
761
- };
762
- const de_GetPerformanceAnalysisReportResponse = (output, context) => {
763
- return (0, smithy_client_1.take)(output, {
764
- AnalysisReport: (_) => de_AnalysisReport(_, context),
765
- });
766
- };
767
- const de_GetResourceMetricsResponse = (output, context) => {
768
- return (0, smithy_client_1.take)(output, {
769
- AlignedEndTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
770
- AlignedStartTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
771
- Identifier: smithy_client_1.expectString,
772
- MetricList: (_) => de_MetricKeyDataPointsList(_, context),
773
- NextToken: smithy_client_1.expectString,
774
- });
775
- };
776
- const de_Insight = (output, context) => {
777
- return (0, smithy_client_1.take)(output, {
778
- BaselineData: (_) => de_DataList(_, context),
779
- Context: smithy_client_1.expectString,
780
- Description: smithy_client_1.expectString,
781
- EndTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
782
- InsightData: (_) => de_DataList(_, context),
783
- InsightId: smithy_client_1.expectString,
784
- InsightType: smithy_client_1.expectString,
785
- Recommendations: smithy_client_1._json,
786
- Severity: smithy_client_1.expectString,
787
- StartTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
788
- SupportingInsights: (_) => de_InsightList(_, context),
789
- });
790
- };
791
- const de_InsightList = (output, context) => {
792
- const retVal = (output || [])
793
- .filter((e) => e != null)
794
- .map((entry) => {
795
- return de_Insight(entry, context);
796
- });
797
- return retVal;
798
- };
799
- const de_ListPerformanceAnalysisReportsResponse = (output, context) => {
800
- return (0, smithy_client_1.take)(output, {
801
- AnalysisReports: (_) => de_AnalysisReportSummaryList(_, context),
802
- NextToken: smithy_client_1.expectString,
803
- });
804
- };
805
- const de_MetricKeyDataPoints = (output, context) => {
806
- return (0, smithy_client_1.take)(output, {
807
- DataPoints: (_) => de_DataPointsList(_, context),
808
- Key: smithy_client_1._json,
809
- });
810
- };
811
- const de_MetricKeyDataPointsList = (output, context) => {
812
- const retVal = (output || [])
813
- .filter((e) => e != null)
814
- .map((entry) => {
815
- return de_MetricKeyDataPoints(entry, context);
816
- });
817
- return retVal;
818
- };
819
- const de_MetricValuesList = (output, context) => {
820
- const retVal = (output || [])
821
- .filter((e) => e != null)
822
- .map((entry) => {
823
- return (0, smithy_client_1.limitedParseDouble)(entry);
824
- });
825
- return retVal;
826
- };
827
- const de_PerformanceInsightsMetric = (output, context) => {
828
- return (0, smithy_client_1.take)(output, {
829
- Dimensions: smithy_client_1._json,
830
- DisplayName: smithy_client_1.expectString,
831
- Metric: smithy_client_1.expectString,
832
- Value: smithy_client_1.limitedParseDouble,
833
- });
834
- };
835
- const deserializeMetadata = (output) => ({
836
- httpStatusCode: output.statusCode,
837
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
838
- extendedRequestId: output.headers["x-amz-id-2"],
839
- cfId: output.headers["x-amz-cf-id"],
840
- });
841
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
842
- const throwDefaultError = (0, smithy_client_1.withBaseException)(PIServiceException_1.PIServiceException);
843
- const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
844
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
845
- const contents = {
846
- protocol,
847
- hostname,
848
- port,
849
- method: "POST",
850
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
851
- headers,
852
- };
853
- if (resolvedHostname !== undefined) {
854
- contents.hostname = resolvedHostname;
855
- }
856
- if (body !== undefined) {
857
- contents.body = body;
858
- }
859
- return new protocol_http_1.HttpRequest(contents);
860
- };
861
- function sharedHeaders(operation) {
862
- return {
863
- "content-type": "application/x-amz-json-1.1",
864
- "x-amz-target": `PerformanceInsightsv20180227.${operation}`,
865
- };
866
- }
867
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
868
- if (encoded.length) {
869
- return JSON.parse(encoded);
870
- }
871
- return {};
872
- });
873
- const parseErrorBody = async (errorBody, context) => {
874
- const value = await parseBody(errorBody, context);
875
- value.message = value.message ?? value.Message;
876
- return value;
877
- };
878
- const loadRestJsonErrorCode = (output, data) => {
879
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
880
- const sanitizeErrorCode = (rawValue) => {
881
- let cleanValue = rawValue;
882
- if (typeof cleanValue === "number") {
883
- cleanValue = cleanValue.toString();
884
- }
885
- if (cleanValue.indexOf(",") >= 0) {
886
- cleanValue = cleanValue.split(",")[0];
887
- }
888
- if (cleanValue.indexOf(":") >= 0) {
889
- cleanValue = cleanValue.split(":")[0];
890
- }
891
- if (cleanValue.indexOf("#") >= 0) {
892
- cleanValue = cleanValue.split("#")[1];
893
- }
894
- return cleanValue;
895
- };
896
- const headerKey = findKey(output.headers, "x-amzn-errortype");
897
- if (headerKey !== undefined) {
898
- return sanitizeErrorCode(output.headers[headerKey]);
899
- }
900
- if (data.code !== undefined) {
901
- return sanitizeErrorCode(data.code);
902
- }
903
- if (data["__type"] !== undefined) {
904
- return sanitizeErrorCode(data["__type"]);
905
- }
906
- };
1
+ module.exports = require("../index.js");