@aws-sdk/client-pi 3.310.0 → 3.315.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.
@@ -1,59 +1,41 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, limitedParseDouble as __limitedParseDouble, parseEpochTimestamp as __parseEpochTimestamp, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, limitedParseDouble as __limitedParseDouble, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { InternalServiceError, InvalidArgumentException, NotAuthorizedException, } from "../models/models_0";
4
4
  import { PIServiceException as __BaseException } from "../models/PIServiceException";
5
5
  export const se_DescribeDimensionKeysCommand = async (input, context) => {
6
- const headers = {
7
- "content-type": "application/x-amz-json-1.1",
8
- "x-amz-target": "PerformanceInsightsv20180227.DescribeDimensionKeys",
9
- };
6
+ const headers = sharedHeaders("DescribeDimensionKeys");
10
7
  let body;
11
8
  body = JSON.stringify(se_DescribeDimensionKeysRequest(input, context));
12
9
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
10
  };
14
11
  export const se_GetDimensionKeyDetailsCommand = async (input, context) => {
15
- const headers = {
16
- "content-type": "application/x-amz-json-1.1",
17
- "x-amz-target": "PerformanceInsightsv20180227.GetDimensionKeyDetails",
18
- };
12
+ const headers = sharedHeaders("GetDimensionKeyDetails");
19
13
  let body;
20
- body = JSON.stringify(se_GetDimensionKeyDetailsRequest(input, context));
14
+ body = JSON.stringify(_json(input));
21
15
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
16
  };
23
17
  export const se_GetResourceMetadataCommand = async (input, context) => {
24
- const headers = {
25
- "content-type": "application/x-amz-json-1.1",
26
- "x-amz-target": "PerformanceInsightsv20180227.GetResourceMetadata",
27
- };
18
+ const headers = sharedHeaders("GetResourceMetadata");
28
19
  let body;
29
- body = JSON.stringify(se_GetResourceMetadataRequest(input, context));
20
+ body = JSON.stringify(_json(input));
30
21
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
31
22
  };
32
23
  export const se_GetResourceMetricsCommand = async (input, context) => {
33
- const headers = {
34
- "content-type": "application/x-amz-json-1.1",
35
- "x-amz-target": "PerformanceInsightsv20180227.GetResourceMetrics",
36
- };
24
+ const headers = sharedHeaders("GetResourceMetrics");
37
25
  let body;
38
26
  body = JSON.stringify(se_GetResourceMetricsRequest(input, context));
39
27
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
40
28
  };
41
29
  export const se_ListAvailableResourceDimensionsCommand = async (input, context) => {
42
- const headers = {
43
- "content-type": "application/x-amz-json-1.1",
44
- "x-amz-target": "PerformanceInsightsv20180227.ListAvailableResourceDimensions",
45
- };
30
+ const headers = sharedHeaders("ListAvailableResourceDimensions");
46
31
  let body;
47
- body = JSON.stringify(se_ListAvailableResourceDimensionsRequest(input, context));
32
+ body = JSON.stringify(_json(input));
48
33
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
49
34
  };
50
35
  export const se_ListAvailableResourceMetricsCommand = async (input, context) => {
51
- const headers = {
52
- "content-type": "application/x-amz-json-1.1",
53
- "x-amz-target": "PerformanceInsightsv20180227.ListAvailableResourceMetrics",
54
- };
36
+ const headers = sharedHeaders("ListAvailableResourceMetrics");
55
37
  let body;
56
- body = JSON.stringify(se_ListAvailableResourceMetricsRequest(input, context));
38
+ body = JSON.stringify(_json(input));
57
39
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
58
40
  };
59
41
  export const de_DescribeDimensionKeysCommand = async (output, context) => {
@@ -67,7 +49,7 @@ export const de_DescribeDimensionKeysCommand = async (output, context) => {
67
49
  $metadata: deserializeMetadata(output),
68
50
  ...contents,
69
51
  };
70
- return Promise.resolve(response);
52
+ return response;
71
53
  };
72
54
  const de_DescribeDimensionKeysCommandError = async (output, context) => {
73
55
  const parsedOutput = {
@@ -87,10 +69,9 @@ const de_DescribeDimensionKeysCommandError = async (output, context) => {
87
69
  throw await de_NotAuthorizedExceptionRes(parsedOutput, context);
88
70
  default:
89
71
  const parsedBody = parsedOutput.body;
90
- throwDefaultError({
72
+ return throwDefaultError({
91
73
  output,
92
74
  parsedBody,
93
- exceptionCtor: __BaseException,
94
75
  errorCode,
95
76
  });
96
77
  }
@@ -101,12 +82,12 @@ export const de_GetDimensionKeyDetailsCommand = async (output, context) => {
101
82
  }
102
83
  const data = await parseBody(output.body, context);
103
84
  let contents = {};
104
- contents = de_GetDimensionKeyDetailsResponse(data, context);
85
+ contents = _json(data);
105
86
  const response = {
106
87
  $metadata: deserializeMetadata(output),
107
88
  ...contents,
108
89
  };
109
- return Promise.resolve(response);
90
+ return response;
110
91
  };
111
92
  const de_GetDimensionKeyDetailsCommandError = async (output, context) => {
112
93
  const parsedOutput = {
@@ -126,10 +107,9 @@ const de_GetDimensionKeyDetailsCommandError = async (output, context) => {
126
107
  throw await de_NotAuthorizedExceptionRes(parsedOutput, context);
127
108
  default:
128
109
  const parsedBody = parsedOutput.body;
129
- throwDefaultError({
110
+ return throwDefaultError({
130
111
  output,
131
112
  parsedBody,
132
- exceptionCtor: __BaseException,
133
113
  errorCode,
134
114
  });
135
115
  }
@@ -140,12 +120,12 @@ export const de_GetResourceMetadataCommand = async (output, context) => {
140
120
  }
141
121
  const data = await parseBody(output.body, context);
142
122
  let contents = {};
143
- contents = de_GetResourceMetadataResponse(data, context);
123
+ contents = _json(data);
144
124
  const response = {
145
125
  $metadata: deserializeMetadata(output),
146
126
  ...contents,
147
127
  };
148
- return Promise.resolve(response);
128
+ return response;
149
129
  };
150
130
  const de_GetResourceMetadataCommandError = async (output, context) => {
151
131
  const parsedOutput = {
@@ -165,10 +145,9 @@ const de_GetResourceMetadataCommandError = async (output, context) => {
165
145
  throw await de_NotAuthorizedExceptionRes(parsedOutput, context);
166
146
  default:
167
147
  const parsedBody = parsedOutput.body;
168
- throwDefaultError({
148
+ return throwDefaultError({
169
149
  output,
170
150
  parsedBody,
171
- exceptionCtor: __BaseException,
172
151
  errorCode,
173
152
  });
174
153
  }
@@ -184,7 +163,7 @@ export const de_GetResourceMetricsCommand = async (output, context) => {
184
163
  $metadata: deserializeMetadata(output),
185
164
  ...contents,
186
165
  };
187
- return Promise.resolve(response);
166
+ return response;
188
167
  };
189
168
  const de_GetResourceMetricsCommandError = async (output, context) => {
190
169
  const parsedOutput = {
@@ -204,10 +183,9 @@ const de_GetResourceMetricsCommandError = async (output, context) => {
204
183
  throw await de_NotAuthorizedExceptionRes(parsedOutput, context);
205
184
  default:
206
185
  const parsedBody = parsedOutput.body;
207
- throwDefaultError({
186
+ return throwDefaultError({
208
187
  output,
209
188
  parsedBody,
210
- exceptionCtor: __BaseException,
211
189
  errorCode,
212
190
  });
213
191
  }
@@ -218,12 +196,12 @@ export const de_ListAvailableResourceDimensionsCommand = async (output, context)
218
196
  }
219
197
  const data = await parseBody(output.body, context);
220
198
  let contents = {};
221
- contents = de_ListAvailableResourceDimensionsResponse(data, context);
199
+ contents = _json(data);
222
200
  const response = {
223
201
  $metadata: deserializeMetadata(output),
224
202
  ...contents,
225
203
  };
226
- return Promise.resolve(response);
204
+ return response;
227
205
  };
228
206
  const de_ListAvailableResourceDimensionsCommandError = async (output, context) => {
229
207
  const parsedOutput = {
@@ -243,10 +221,9 @@ const de_ListAvailableResourceDimensionsCommandError = async (output, context) =
243
221
  throw await de_NotAuthorizedExceptionRes(parsedOutput, context);
244
222
  default:
245
223
  const parsedBody = parsedOutput.body;
246
- throwDefaultError({
224
+ return throwDefaultError({
247
225
  output,
248
226
  parsedBody,
249
- exceptionCtor: __BaseException,
250
227
  errorCode,
251
228
  });
252
229
  }
@@ -257,12 +234,12 @@ export const de_ListAvailableResourceMetricsCommand = async (output, context) =>
257
234
  }
258
235
  const data = await parseBody(output.body, context);
259
236
  let contents = {};
260
- contents = de_ListAvailableResourceMetricsResponse(data, context);
237
+ contents = _json(data);
261
238
  const response = {
262
239
  $metadata: deserializeMetadata(output),
263
240
  ...contents,
264
241
  };
265
- return Promise.resolve(response);
242
+ return response;
266
243
  };
267
244
  const de_ListAvailableResourceMetricsCommandError = async (output, context) => {
268
245
  const parsedOutput = {
@@ -282,17 +259,16 @@ const de_ListAvailableResourceMetricsCommandError = async (output, context) => {
282
259
  throw await de_NotAuthorizedExceptionRes(parsedOutput, context);
283
260
  default:
284
261
  const parsedBody = parsedOutput.body;
285
- throwDefaultError({
262
+ return throwDefaultError({
286
263
  output,
287
264
  parsedBody,
288
- exceptionCtor: __BaseException,
289
265
  errorCode,
290
266
  });
291
267
  }
292
268
  };
293
269
  const de_InternalServiceErrorRes = async (parsedOutput, context) => {
294
270
  const body = parsedOutput.body;
295
- const deserialized = de_InternalServiceError(body, context);
271
+ const deserialized = _json(body);
296
272
  const exception = new InternalServiceError({
297
273
  $metadata: deserializeMetadata(parsedOutput),
298
274
  ...deserialized,
@@ -301,7 +277,7 @@ const de_InternalServiceErrorRes = async (parsedOutput, context) => {
301
277
  };
302
278
  const de_InvalidArgumentExceptionRes = async (parsedOutput, context) => {
303
279
  const body = parsedOutput.body;
304
- const deserialized = de_InvalidArgumentException(body, context);
280
+ const deserialized = _json(body);
305
281
  const exception = new InvalidArgumentException({
306
282
  $metadata: deserializeMetadata(parsedOutput),
307
283
  ...deserialized,
@@ -310,142 +286,40 @@ const de_InvalidArgumentExceptionRes = async (parsedOutput, context) => {
310
286
  };
311
287
  const de_NotAuthorizedExceptionRes = async (parsedOutput, context) => {
312
288
  const body = parsedOutput.body;
313
- const deserialized = de_NotAuthorizedException(body, context);
289
+ const deserialized = _json(body);
314
290
  const exception = new NotAuthorizedException({
315
291
  $metadata: deserializeMetadata(parsedOutput),
316
292
  ...deserialized,
317
293
  });
318
294
  return __decorateServiceException(exception, body);
319
295
  };
320
- const se_AdditionalMetricsList = (input, context) => {
321
- return input
322
- .filter((e) => e != null)
323
- .map((entry) => {
324
- return entry;
325
- });
326
- };
327
296
  const se_DescribeDimensionKeysRequest = (input, context) => {
328
- return {
329
- ...(input.AdditionalMetrics != null && {
330
- AdditionalMetrics: se_AdditionalMetricsList(input.AdditionalMetrics, context),
331
- }),
332
- ...(input.EndTime != null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }),
333
- ...(input.Filter != null && { Filter: se_MetricQueryFilterMap(input.Filter, context) }),
334
- ...(input.GroupBy != null && { GroupBy: se_DimensionGroup(input.GroupBy, context) }),
335
- ...(input.Identifier != null && { Identifier: input.Identifier }),
336
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
337
- ...(input.Metric != null && { Metric: input.Metric }),
338
- ...(input.NextToken != null && { NextToken: input.NextToken }),
339
- ...(input.PartitionBy != null && { PartitionBy: se_DimensionGroup(input.PartitionBy, context) }),
340
- ...(input.PeriodInSeconds != null && { PeriodInSeconds: input.PeriodInSeconds }),
341
- ...(input.ServiceType != null && { ServiceType: input.ServiceType }),
342
- ...(input.StartTime != null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }),
343
- };
344
- };
345
- const se_DimensionGroup = (input, context) => {
346
- return {
347
- ...(input.Dimensions != null && { Dimensions: se_RequestStringList(input.Dimensions, context) }),
348
- ...(input.Group != null && { Group: input.Group }),
349
- ...(input.Limit != null && { Limit: input.Limit }),
350
- };
351
- };
352
- const se_DimensionsMetricList = (input, context) => {
353
- return input
354
- .filter((e) => e != null)
355
- .map((entry) => {
356
- return entry;
297
+ return take(input, {
298
+ AdditionalMetrics: _json,
299
+ EndTime: (_) => Math.round(_.getTime() / 1000),
300
+ Filter: _json,
301
+ GroupBy: _json,
302
+ Identifier: [],
303
+ MaxResults: [],
304
+ Metric: [],
305
+ NextToken: [],
306
+ PartitionBy: _json,
307
+ PeriodInSeconds: [],
308
+ ServiceType: [],
309
+ StartTime: (_) => Math.round(_.getTime() / 1000),
357
310
  });
358
311
  };
359
- const se_GetDimensionKeyDetailsRequest = (input, context) => {
360
- return {
361
- ...(input.Group != null && { Group: input.Group }),
362
- ...(input.GroupIdentifier != null && { GroupIdentifier: input.GroupIdentifier }),
363
- ...(input.Identifier != null && { Identifier: input.Identifier }),
364
- ...(input.RequestedDimensions != null && {
365
- RequestedDimensions: se_RequestedDimensionList(input.RequestedDimensions, context),
366
- }),
367
- ...(input.ServiceType != null && { ServiceType: input.ServiceType }),
368
- };
369
- };
370
- const se_GetResourceMetadataRequest = (input, context) => {
371
- return {
372
- ...(input.Identifier != null && { Identifier: input.Identifier }),
373
- ...(input.ServiceType != null && { ServiceType: input.ServiceType }),
374
- };
375
- };
376
312
  const se_GetResourceMetricsRequest = (input, context) => {
377
- return {
378
- ...(input.EndTime != null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }),
379
- ...(input.Identifier != null && { Identifier: input.Identifier }),
380
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
381
- ...(input.MetricQueries != null && { MetricQueries: se_MetricQueryList(input.MetricQueries, context) }),
382
- ...(input.NextToken != null && { NextToken: input.NextToken }),
383
- ...(input.PeriodAlignment != null && { PeriodAlignment: input.PeriodAlignment }),
384
- ...(input.PeriodInSeconds != null && { PeriodInSeconds: input.PeriodInSeconds }),
385
- ...(input.ServiceType != null && { ServiceType: input.ServiceType }),
386
- ...(input.StartTime != null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }),
387
- };
388
- };
389
- const se_ListAvailableResourceDimensionsRequest = (input, context) => {
390
- return {
391
- ...(input.Identifier != null && { Identifier: input.Identifier }),
392
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
393
- ...(input.Metrics != null && { Metrics: se_DimensionsMetricList(input.Metrics, context) }),
394
- ...(input.NextToken != null && { NextToken: input.NextToken }),
395
- ...(input.ServiceType != null && { ServiceType: input.ServiceType }),
396
- };
397
- };
398
- const se_ListAvailableResourceMetricsRequest = (input, context) => {
399
- return {
400
- ...(input.Identifier != null && { Identifier: input.Identifier }),
401
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
402
- ...(input.MetricTypes != null && { MetricTypes: se_MetricTypeList(input.MetricTypes, context) }),
403
- ...(input.NextToken != null && { NextToken: input.NextToken }),
404
- ...(input.ServiceType != null && { ServiceType: input.ServiceType }),
405
- };
406
- };
407
- const se_MetricQuery = (input, context) => {
408
- return {
409
- ...(input.Filter != null && { Filter: se_MetricQueryFilterMap(input.Filter, context) }),
410
- ...(input.GroupBy != null && { GroupBy: se_DimensionGroup(input.GroupBy, context) }),
411
- ...(input.Metric != null && { Metric: input.Metric }),
412
- };
413
- };
414
- const se_MetricQueryFilterMap = (input, context) => {
415
- return Object.entries(input).reduce((acc, [key, value]) => {
416
- if (value === null) {
417
- return acc;
418
- }
419
- acc[key] = value;
420
- return acc;
421
- }, {});
422
- };
423
- const se_MetricQueryList = (input, context) => {
424
- return input
425
- .filter((e) => e != null)
426
- .map((entry) => {
427
- return se_MetricQuery(entry, context);
428
- });
429
- };
430
- const se_MetricTypeList = (input, context) => {
431
- return input
432
- .filter((e) => e != null)
433
- .map((entry) => {
434
- return entry;
435
- });
436
- };
437
- const se_RequestedDimensionList = (input, context) => {
438
- return input
439
- .filter((e) => e != null)
440
- .map((entry) => {
441
- return entry;
442
- });
443
- };
444
- const se_RequestStringList = (input, context) => {
445
- return input
446
- .filter((e) => e != null)
447
- .map((entry) => {
448
- return entry;
313
+ return take(input, {
314
+ EndTime: (_) => Math.round(_.getTime() / 1000),
315
+ Identifier: [],
316
+ MaxResults: [],
317
+ MetricQueries: _json,
318
+ NextToken: [],
319
+ PeriodAlignment: [],
320
+ PeriodInSeconds: [],
321
+ ServiceType: [],
322
+ StartTime: (_) => Math.round(_.getTime() / 1000),
449
323
  });
450
324
  };
451
325
  const de_AdditionalMetricsMap = (output, context) => {
@@ -458,204 +332,63 @@ const de_AdditionalMetricsMap = (output, context) => {
458
332
  }, {});
459
333
  };
460
334
  const de_DataPoint = (output, context) => {
461
- return {
462
- Timestamp: output.Timestamp != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.Timestamp))) : undefined,
463
- Value: __limitedParseDouble(output.Value),
464
- };
335
+ return take(output, {
336
+ Timestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
337
+ Value: __limitedParseDouble,
338
+ });
465
339
  };
466
340
  const de_DataPointsList = (output, context) => {
467
341
  const retVal = (output || [])
468
342
  .filter((e) => e != null)
469
343
  .map((entry) => {
470
- if (entry === null) {
471
- return null;
472
- }
473
344
  return de_DataPoint(entry, context);
474
345
  });
475
346
  return retVal;
476
347
  };
477
348
  const de_DescribeDimensionKeysResponse = (output, context) => {
478
- return {
479
- AlignedEndTime: output.AlignedEndTime != null
480
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.AlignedEndTime)))
481
- : undefined,
482
- AlignedStartTime: output.AlignedStartTime != null
483
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.AlignedStartTime)))
484
- : undefined,
485
- Keys: output.Keys != null ? de_DimensionKeyDescriptionList(output.Keys, context) : undefined,
486
- NextToken: __expectString(output.NextToken),
487
- PartitionKeys: output.PartitionKeys != null ? de_ResponsePartitionKeyList(output.PartitionKeys, context) : undefined,
488
- };
489
- };
490
- const de_DimensionDetail = (output, context) => {
491
- return {
492
- Identifier: __expectString(output.Identifier),
493
- };
494
- };
495
- const de_DimensionDetailList = (output, context) => {
496
- const retVal = (output || [])
497
- .filter((e) => e != null)
498
- .map((entry) => {
499
- if (entry === null) {
500
- return null;
501
- }
502
- return de_DimensionDetail(entry, context);
503
- });
504
- return retVal;
505
- };
506
- const de_DimensionGroupDetail = (output, context) => {
507
- return {
508
- Dimensions: output.Dimensions != null ? de_DimensionDetailList(output.Dimensions, context) : undefined,
509
- Group: __expectString(output.Group),
510
- };
511
- };
512
- const de_DimensionGroupDetailList = (output, context) => {
513
- const retVal = (output || [])
514
- .filter((e) => e != null)
515
- .map((entry) => {
516
- if (entry === null) {
517
- return null;
518
- }
519
- return de_DimensionGroupDetail(entry, context);
349
+ return take(output, {
350
+ AlignedEndTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
351
+ AlignedStartTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
352
+ Keys: (_) => de_DimensionKeyDescriptionList(_, context),
353
+ NextToken: __expectString,
354
+ PartitionKeys: _json,
520
355
  });
521
- return retVal;
522
356
  };
523
357
  const de_DimensionKeyDescription = (output, context) => {
524
- return {
525
- AdditionalMetrics: output.AdditionalMetrics != null ? de_AdditionalMetricsMap(output.AdditionalMetrics, context) : undefined,
526
- Dimensions: output.Dimensions != null ? de_DimensionMap(output.Dimensions, context) : undefined,
527
- Partitions: output.Partitions != null ? de_MetricValuesList(output.Partitions, context) : undefined,
528
- Total: __limitedParseDouble(output.Total),
529
- };
358
+ return take(output, {
359
+ AdditionalMetrics: (_) => de_AdditionalMetricsMap(_, context),
360
+ Dimensions: _json,
361
+ Partitions: (_) => de_MetricValuesList(_, context),
362
+ Total: __limitedParseDouble,
363
+ });
530
364
  };
531
365
  const de_DimensionKeyDescriptionList = (output, context) => {
532
366
  const retVal = (output || [])
533
367
  .filter((e) => e != null)
534
368
  .map((entry) => {
535
- if (entry === null) {
536
- return null;
537
- }
538
369
  return de_DimensionKeyDescription(entry, context);
539
370
  });
540
371
  return retVal;
541
372
  };
542
- const de_DimensionKeyDetail = (output, context) => {
543
- return {
544
- Dimension: __expectString(output.Dimension),
545
- Status: __expectString(output.Status),
546
- Value: __expectString(output.Value),
547
- };
548
- };
549
- const de_DimensionKeyDetailList = (output, context) => {
550
- const retVal = (output || [])
551
- .filter((e) => e != null)
552
- .map((entry) => {
553
- if (entry === null) {
554
- return null;
555
- }
556
- return de_DimensionKeyDetail(entry, context);
557
- });
558
- return retVal;
559
- };
560
- const de_DimensionMap = (output, context) => {
561
- return Object.entries(output).reduce((acc, [key, value]) => {
562
- if (value === null) {
563
- return acc;
564
- }
565
- acc[key] = __expectString(value);
566
- return acc;
567
- }, {});
568
- };
569
- const de_FeatureMetadata = (output, context) => {
570
- return {
571
- Status: __expectString(output.Status),
572
- };
573
- };
574
- const de_FeatureMetadataMap = (output, context) => {
575
- return Object.entries(output).reduce((acc, [key, value]) => {
576
- if (value === null) {
577
- return acc;
578
- }
579
- acc[key] = de_FeatureMetadata(value, context);
580
- return acc;
581
- }, {});
582
- };
583
- const de_GetDimensionKeyDetailsResponse = (output, context) => {
584
- return {
585
- Dimensions: output.Dimensions != null ? de_DimensionKeyDetailList(output.Dimensions, context) : undefined,
586
- };
587
- };
588
- const de_GetResourceMetadataResponse = (output, context) => {
589
- return {
590
- Features: output.Features != null ? de_FeatureMetadataMap(output.Features, context) : undefined,
591
- Identifier: __expectString(output.Identifier),
592
- };
593
- };
594
373
  const de_GetResourceMetricsResponse = (output, context) => {
595
- return {
596
- AlignedEndTime: output.AlignedEndTime != null
597
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.AlignedEndTime)))
598
- : undefined,
599
- AlignedStartTime: output.AlignedStartTime != null
600
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.AlignedStartTime)))
601
- : undefined,
602
- Identifier: __expectString(output.Identifier),
603
- MetricList: output.MetricList != null ? de_MetricKeyDataPointsList(output.MetricList, context) : undefined,
604
- NextToken: __expectString(output.NextToken),
605
- };
606
- };
607
- const de_InternalServiceError = (output, context) => {
608
- return {
609
- Message: __expectString(output.Message),
610
- };
611
- };
612
- const de_InvalidArgumentException = (output, context) => {
613
- return {
614
- Message: __expectString(output.Message),
615
- };
616
- };
617
- const de_ListAvailableResourceDimensionsResponse = (output, context) => {
618
- return {
619
- MetricDimensions: output.MetricDimensions != null ? de_MetricDimensionsList(output.MetricDimensions, context) : undefined,
620
- NextToken: __expectString(output.NextToken),
621
- };
622
- };
623
- const de_ListAvailableResourceMetricsResponse = (output, context) => {
624
- return {
625
- Metrics: output.Metrics != null ? de_ResponseResourceMetricList(output.Metrics, context) : undefined,
626
- NextToken: __expectString(output.NextToken),
627
- };
628
- };
629
- const de_MetricDimensionGroups = (output, context) => {
630
- return {
631
- Groups: output.Groups != null ? de_DimensionGroupDetailList(output.Groups, context) : undefined,
632
- Metric: __expectString(output.Metric),
633
- };
634
- };
635
- const de_MetricDimensionsList = (output, context) => {
636
- const retVal = (output || [])
637
- .filter((e) => e != null)
638
- .map((entry) => {
639
- if (entry === null) {
640
- return null;
641
- }
642
- return de_MetricDimensionGroups(entry, context);
374
+ return take(output, {
375
+ AlignedEndTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
376
+ AlignedStartTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
377
+ Identifier: __expectString,
378
+ MetricList: (_) => de_MetricKeyDataPointsList(_, context),
379
+ NextToken: __expectString,
643
380
  });
644
- return retVal;
645
381
  };
646
382
  const de_MetricKeyDataPoints = (output, context) => {
647
- return {
648
- DataPoints: output.DataPoints != null ? de_DataPointsList(output.DataPoints, context) : undefined,
649
- Key: output.Key != null ? de_ResponseResourceMetricKey(output.Key, context) : undefined,
650
- };
383
+ return take(output, {
384
+ DataPoints: (_) => de_DataPointsList(_, context),
385
+ Key: _json,
386
+ });
651
387
  };
652
388
  const de_MetricKeyDataPointsList = (output, context) => {
653
389
  const retVal = (output || [])
654
390
  .filter((e) => e != null)
655
391
  .map((entry) => {
656
- if (entry === null) {
657
- return null;
658
- }
659
392
  return de_MetricKeyDataPoints(entry, context);
660
393
  });
661
394
  return retVal;
@@ -664,58 +397,10 @@ const de_MetricValuesList = (output, context) => {
664
397
  const retVal = (output || [])
665
398
  .filter((e) => e != null)
666
399
  .map((entry) => {
667
- if (entry === null) {
668
- return null;
669
- }
670
400
  return __limitedParseDouble(entry);
671
401
  });
672
402
  return retVal;
673
403
  };
674
- const de_NotAuthorizedException = (output, context) => {
675
- return {
676
- Message: __expectString(output.Message),
677
- };
678
- };
679
- const de_ResponsePartitionKey = (output, context) => {
680
- return {
681
- Dimensions: output.Dimensions != null ? de_DimensionMap(output.Dimensions, context) : undefined,
682
- };
683
- };
684
- const de_ResponsePartitionKeyList = (output, context) => {
685
- const retVal = (output || [])
686
- .filter((e) => e != null)
687
- .map((entry) => {
688
- if (entry === null) {
689
- return null;
690
- }
691
- return de_ResponsePartitionKey(entry, context);
692
- });
693
- return retVal;
694
- };
695
- const de_ResponseResourceMetric = (output, context) => {
696
- return {
697
- Description: __expectString(output.Description),
698
- Metric: __expectString(output.Metric),
699
- Unit: __expectString(output.Unit),
700
- };
701
- };
702
- const de_ResponseResourceMetricKey = (output, context) => {
703
- return {
704
- Dimensions: output.Dimensions != null ? de_DimensionMap(output.Dimensions, context) : undefined,
705
- Metric: __expectString(output.Metric),
706
- };
707
- };
708
- const de_ResponseResourceMetricList = (output, context) => {
709
- const retVal = (output || [])
710
- .filter((e) => e != null)
711
- .map((entry) => {
712
- if (entry === null) {
713
- return null;
714
- }
715
- return de_ResponseResourceMetric(entry, context);
716
- });
717
- return retVal;
718
- };
719
404
  const deserializeMetadata = (output) => ({
720
405
  httpStatusCode: output.statusCode,
721
406
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -729,6 +414,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
729
414
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
730
415
  };
731
416
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
417
+ const throwDefaultError = withBaseException(__BaseException);
732
418
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
733
419
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
734
420
  const contents = {
@@ -747,6 +433,12 @@ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, bod
747
433
  }
748
434
  return new __HttpRequest(contents);
749
435
  };
436
+ function sharedHeaders(operation) {
437
+ return {
438
+ "content-type": "application/x-amz-json-1.1",
439
+ "x-amz-target": `PerformanceInsightsv20180227.${operation}`,
440
+ };
441
+ }
750
442
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
751
443
  if (encoded.length) {
752
444
  return JSON.parse(encoded);