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