@aws-sdk/client-pi 3.181.0 → 3.183.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,557 +1,477 @@
1
- import { __assign, __awaiter, __generator, __read } from "tslib";
2
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
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";
4
3
  import { InternalServiceError, InvalidArgumentException, NotAuthorizedException, } from "../models/models_0";
5
4
  import { PIServiceException as __BaseException } from "../models/PIServiceException";
6
- export var serializeAws_json1_1DescribeDimensionKeysCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
- var headers, body;
8
- return __generator(this, function (_a) {
9
- headers = {
10
- "content-type": "application/x-amz-json-1.1",
11
- "x-amz-target": "PerformanceInsightsv20180227.DescribeDimensionKeys",
12
- };
13
- body = JSON.stringify(serializeAws_json1_1DescribeDimensionKeysRequest(input, context));
14
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
15
- });
16
- }); };
17
- export var serializeAws_json1_1GetDimensionKeyDetailsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
18
- var headers, body;
19
- return __generator(this, function (_a) {
20
- headers = {
21
- "content-type": "application/x-amz-json-1.1",
22
- "x-amz-target": "PerformanceInsightsv20180227.GetDimensionKeyDetails",
23
- };
24
- body = JSON.stringify(serializeAws_json1_1GetDimensionKeyDetailsRequest(input, context));
25
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
26
- });
27
- }); };
28
- export var serializeAws_json1_1GetResourceMetadataCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
29
- var headers, body;
30
- return __generator(this, function (_a) {
31
- headers = {
32
- "content-type": "application/x-amz-json-1.1",
33
- "x-amz-target": "PerformanceInsightsv20180227.GetResourceMetadata",
34
- };
35
- body = JSON.stringify(serializeAws_json1_1GetResourceMetadataRequest(input, context));
36
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
37
- });
38
- }); };
39
- export var serializeAws_json1_1GetResourceMetricsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
40
- var headers, body;
41
- return __generator(this, function (_a) {
42
- headers = {
43
- "content-type": "application/x-amz-json-1.1",
44
- "x-amz-target": "PerformanceInsightsv20180227.GetResourceMetrics",
45
- };
46
- body = JSON.stringify(serializeAws_json1_1GetResourceMetricsRequest(input, context));
47
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
48
- });
49
- }); };
50
- export var serializeAws_json1_1ListAvailableResourceDimensionsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
51
- var headers, body;
52
- return __generator(this, function (_a) {
53
- headers = {
54
- "content-type": "application/x-amz-json-1.1",
55
- "x-amz-target": "PerformanceInsightsv20180227.ListAvailableResourceDimensions",
56
- };
57
- body = JSON.stringify(serializeAws_json1_1ListAvailableResourceDimensionsRequest(input, context));
58
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
59
- });
60
- }); };
61
- export var serializeAws_json1_1ListAvailableResourceMetricsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
62
- var headers, body;
63
- return __generator(this, function (_a) {
64
- headers = {
65
- "content-type": "application/x-amz-json-1.1",
66
- "x-amz-target": "PerformanceInsightsv20180227.ListAvailableResourceMetrics",
67
- };
68
- body = JSON.stringify(serializeAws_json1_1ListAvailableResourceMetricsRequest(input, context));
69
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
70
- });
71
- }); };
72
- export var deserializeAws_json1_1DescribeDimensionKeysCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
73
- var data, contents, response;
74
- return __generator(this, function (_a) {
75
- switch (_a.label) {
76
- case 0:
77
- if (output.statusCode >= 300) {
78
- return [2, deserializeAws_json1_1DescribeDimensionKeysCommandError(output, context)];
79
- }
80
- return [4, parseBody(output.body, context)];
81
- case 1:
82
- data = _a.sent();
83
- contents = {};
84
- contents = deserializeAws_json1_1DescribeDimensionKeysResponse(data, context);
85
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
86
- return [2, Promise.resolve(response)];
87
- }
88
- });
89
- }); };
90
- var deserializeAws_json1_1DescribeDimensionKeysCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
91
- var parsedOutput, _a, errorCode, _b, parsedBody;
92
- var _c;
93
- return __generator(this, function (_d) {
94
- switch (_d.label) {
95
- case 0:
96
- _a = [__assign({}, output)];
97
- _c = {};
98
- return [4, parseErrorBody(output.body, context)];
99
- case 1:
100
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
101
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
102
- _b = errorCode;
103
- switch (_b) {
104
- case "InternalServiceError": return [3, 2];
105
- case "com.amazonaws.pi#InternalServiceError": return [3, 2];
106
- case "InvalidArgumentException": return [3, 4];
107
- case "com.amazonaws.pi#InvalidArgumentException": return [3, 4];
108
- case "NotAuthorizedException": return [3, 6];
109
- case "com.amazonaws.pi#NotAuthorizedException": return [3, 6];
110
- }
111
- return [3, 8];
112
- case 2: return [4, deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context)];
113
- case 3: throw _d.sent();
114
- case 4: return [4, deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)];
115
- case 5: throw _d.sent();
116
- case 6: return [4, deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)];
117
- case 7: throw _d.sent();
118
- case 8:
119
- parsedBody = parsedOutput.body;
120
- throwDefaultError({
121
- output: output,
122
- parsedBody: parsedBody,
123
- exceptionCtor: __BaseException,
124
- errorCode: errorCode,
125
- });
126
- _d.label = 9;
127
- case 9: return [2];
128
- }
129
- });
130
- }); };
131
- export var deserializeAws_json1_1GetDimensionKeyDetailsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
132
- var data, contents, response;
133
- return __generator(this, function (_a) {
134
- switch (_a.label) {
135
- case 0:
136
- if (output.statusCode >= 300) {
137
- return [2, deserializeAws_json1_1GetDimensionKeyDetailsCommandError(output, context)];
138
- }
139
- return [4, parseBody(output.body, context)];
140
- case 1:
141
- data = _a.sent();
142
- contents = {};
143
- contents = deserializeAws_json1_1GetDimensionKeyDetailsResponse(data, context);
144
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
145
- return [2, Promise.resolve(response)];
146
- }
147
- });
148
- }); };
149
- var deserializeAws_json1_1GetDimensionKeyDetailsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
150
- var parsedOutput, _a, errorCode, _b, parsedBody;
151
- var _c;
152
- return __generator(this, function (_d) {
153
- switch (_d.label) {
154
- case 0:
155
- _a = [__assign({}, output)];
156
- _c = {};
157
- return [4, parseErrorBody(output.body, context)];
158
- case 1:
159
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
160
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
161
- _b = errorCode;
162
- switch (_b) {
163
- case "InternalServiceError": return [3, 2];
164
- case "com.amazonaws.pi#InternalServiceError": return [3, 2];
165
- case "InvalidArgumentException": return [3, 4];
166
- case "com.amazonaws.pi#InvalidArgumentException": return [3, 4];
167
- case "NotAuthorizedException": return [3, 6];
168
- case "com.amazonaws.pi#NotAuthorizedException": return [3, 6];
169
- }
170
- return [3, 8];
171
- case 2: return [4, deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context)];
172
- case 3: throw _d.sent();
173
- case 4: return [4, deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)];
174
- case 5: throw _d.sent();
175
- case 6: return [4, deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)];
176
- case 7: throw _d.sent();
177
- case 8:
178
- parsedBody = parsedOutput.body;
179
- throwDefaultError({
180
- output: output,
181
- parsedBody: parsedBody,
182
- exceptionCtor: __BaseException,
183
- errorCode: errorCode,
184
- });
185
- _d.label = 9;
186
- case 9: return [2];
187
- }
188
- });
189
- }); };
190
- export var deserializeAws_json1_1GetResourceMetadataCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
191
- var data, contents, response;
192
- return __generator(this, function (_a) {
193
- switch (_a.label) {
194
- case 0:
195
- if (output.statusCode >= 300) {
196
- return [2, deserializeAws_json1_1GetResourceMetadataCommandError(output, context)];
197
- }
198
- return [4, parseBody(output.body, context)];
199
- case 1:
200
- data = _a.sent();
201
- contents = {};
202
- contents = deserializeAws_json1_1GetResourceMetadataResponse(data, context);
203
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
204
- return [2, Promise.resolve(response)];
205
- }
206
- });
207
- }); };
208
- var deserializeAws_json1_1GetResourceMetadataCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
209
- var parsedOutput, _a, errorCode, _b, parsedBody;
210
- var _c;
211
- return __generator(this, function (_d) {
212
- switch (_d.label) {
213
- case 0:
214
- _a = [__assign({}, output)];
215
- _c = {};
216
- return [4, parseErrorBody(output.body, context)];
217
- case 1:
218
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
219
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
220
- _b = errorCode;
221
- switch (_b) {
222
- case "InternalServiceError": return [3, 2];
223
- case "com.amazonaws.pi#InternalServiceError": return [3, 2];
224
- case "InvalidArgumentException": return [3, 4];
225
- case "com.amazonaws.pi#InvalidArgumentException": return [3, 4];
226
- case "NotAuthorizedException": return [3, 6];
227
- case "com.amazonaws.pi#NotAuthorizedException": return [3, 6];
228
- }
229
- return [3, 8];
230
- case 2: return [4, deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context)];
231
- case 3: throw _d.sent();
232
- case 4: return [4, deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)];
233
- case 5: throw _d.sent();
234
- case 6: return [4, deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)];
235
- case 7: throw _d.sent();
236
- case 8:
237
- parsedBody = parsedOutput.body;
238
- throwDefaultError({
239
- output: output,
240
- parsedBody: parsedBody,
241
- exceptionCtor: __BaseException,
242
- errorCode: errorCode,
243
- });
244
- _d.label = 9;
245
- case 9: return [2];
246
- }
247
- });
248
- }); };
249
- export var deserializeAws_json1_1GetResourceMetricsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
250
- var data, contents, response;
251
- return __generator(this, function (_a) {
252
- switch (_a.label) {
253
- case 0:
254
- if (output.statusCode >= 300) {
255
- return [2, deserializeAws_json1_1GetResourceMetricsCommandError(output, context)];
256
- }
257
- return [4, parseBody(output.body, context)];
258
- case 1:
259
- data = _a.sent();
260
- contents = {};
261
- contents = deserializeAws_json1_1GetResourceMetricsResponse(data, context);
262
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
263
- return [2, Promise.resolve(response)];
264
- }
265
- });
266
- }); };
267
- var deserializeAws_json1_1GetResourceMetricsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
268
- var parsedOutput, _a, errorCode, _b, parsedBody;
269
- var _c;
270
- return __generator(this, function (_d) {
271
- switch (_d.label) {
272
- case 0:
273
- _a = [__assign({}, output)];
274
- _c = {};
275
- return [4, parseErrorBody(output.body, context)];
276
- case 1:
277
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
278
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
279
- _b = errorCode;
280
- switch (_b) {
281
- case "InternalServiceError": return [3, 2];
282
- case "com.amazonaws.pi#InternalServiceError": return [3, 2];
283
- case "InvalidArgumentException": return [3, 4];
284
- case "com.amazonaws.pi#InvalidArgumentException": return [3, 4];
285
- case "NotAuthorizedException": return [3, 6];
286
- case "com.amazonaws.pi#NotAuthorizedException": return [3, 6];
287
- }
288
- return [3, 8];
289
- case 2: return [4, deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context)];
290
- case 3: throw _d.sent();
291
- case 4: return [4, deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)];
292
- case 5: throw _d.sent();
293
- case 6: return [4, deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)];
294
- case 7: throw _d.sent();
295
- case 8:
296
- parsedBody = parsedOutput.body;
297
- throwDefaultError({
298
- output: output,
299
- parsedBody: parsedBody,
300
- exceptionCtor: __BaseException,
301
- errorCode: errorCode,
302
- });
303
- _d.label = 9;
304
- case 9: return [2];
305
- }
306
- });
307
- }); };
308
- export var deserializeAws_json1_1ListAvailableResourceDimensionsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
309
- var data, contents, response;
310
- return __generator(this, function (_a) {
311
- switch (_a.label) {
312
- case 0:
313
- if (output.statusCode >= 300) {
314
- return [2, deserializeAws_json1_1ListAvailableResourceDimensionsCommandError(output, context)];
315
- }
316
- return [4, parseBody(output.body, context)];
317
- case 1:
318
- data = _a.sent();
319
- contents = {};
320
- contents = deserializeAws_json1_1ListAvailableResourceDimensionsResponse(data, context);
321
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
322
- return [2, Promise.resolve(response)];
323
- }
324
- });
325
- }); };
326
- var deserializeAws_json1_1ListAvailableResourceDimensionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
327
- var parsedOutput, _a, errorCode, _b, parsedBody;
328
- var _c;
329
- return __generator(this, function (_d) {
330
- switch (_d.label) {
331
- case 0:
332
- _a = [__assign({}, output)];
333
- _c = {};
334
- return [4, parseErrorBody(output.body, context)];
335
- case 1:
336
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
337
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
338
- _b = errorCode;
339
- switch (_b) {
340
- case "InternalServiceError": return [3, 2];
341
- case "com.amazonaws.pi#InternalServiceError": return [3, 2];
342
- case "InvalidArgumentException": return [3, 4];
343
- case "com.amazonaws.pi#InvalidArgumentException": return [3, 4];
344
- case "NotAuthorizedException": return [3, 6];
345
- case "com.amazonaws.pi#NotAuthorizedException": return [3, 6];
346
- }
347
- return [3, 8];
348
- case 2: return [4, deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context)];
349
- case 3: throw _d.sent();
350
- case 4: return [4, deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)];
351
- case 5: throw _d.sent();
352
- case 6: return [4, deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)];
353
- case 7: throw _d.sent();
354
- case 8:
355
- parsedBody = parsedOutput.body;
356
- throwDefaultError({
357
- output: output,
358
- parsedBody: parsedBody,
359
- exceptionCtor: __BaseException,
360
- errorCode: errorCode,
361
- });
362
- _d.label = 9;
363
- case 9: return [2];
364
- }
365
- });
366
- }); };
367
- export var deserializeAws_json1_1ListAvailableResourceMetricsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
368
- var data, contents, response;
369
- return __generator(this, function (_a) {
370
- switch (_a.label) {
371
- case 0:
372
- if (output.statusCode >= 300) {
373
- return [2, deserializeAws_json1_1ListAvailableResourceMetricsCommandError(output, context)];
374
- }
375
- return [4, parseBody(output.body, context)];
376
- case 1:
377
- data = _a.sent();
378
- contents = {};
379
- contents = deserializeAws_json1_1ListAvailableResourceMetricsResponse(data, context);
380
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
381
- return [2, Promise.resolve(response)];
382
- }
383
- });
384
- }); };
385
- var deserializeAws_json1_1ListAvailableResourceMetricsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
386
- var parsedOutput, _a, errorCode, _b, parsedBody;
387
- var _c;
388
- return __generator(this, function (_d) {
389
- switch (_d.label) {
390
- case 0:
391
- _a = [__assign({}, output)];
392
- _c = {};
393
- return [4, parseErrorBody(output.body, context)];
394
- case 1:
395
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
396
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
397
- _b = errorCode;
398
- switch (_b) {
399
- case "InternalServiceError": return [3, 2];
400
- case "com.amazonaws.pi#InternalServiceError": return [3, 2];
401
- case "InvalidArgumentException": return [3, 4];
402
- case "com.amazonaws.pi#InvalidArgumentException": return [3, 4];
403
- case "NotAuthorizedException": return [3, 6];
404
- case "com.amazonaws.pi#NotAuthorizedException": return [3, 6];
405
- }
406
- return [3, 8];
407
- case 2: return [4, deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context)];
408
- case 3: throw _d.sent();
409
- case 4: return [4, deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)];
410
- case 5: throw _d.sent();
411
- case 6: return [4, deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)];
412
- case 7: throw _d.sent();
413
- case 8:
414
- parsedBody = parsedOutput.body;
415
- throwDefaultError({
416
- output: output,
417
- parsedBody: parsedBody,
418
- exceptionCtor: __BaseException,
419
- errorCode: errorCode,
420
- });
421
- _d.label = 9;
422
- case 9: return [2];
423
- }
424
- });
425
- }); };
426
- var deserializeAws_json1_1InternalServiceErrorResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
427
- var body, deserialized, exception;
428
- return __generator(this, function (_a) {
429
- body = parsedOutput.body;
430
- deserialized = deserializeAws_json1_1InternalServiceError(body, context);
431
- exception = new InternalServiceError(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
432
- return [2, __decorateServiceException(exception, body)];
5
+ export const serializeAws_json1_1DescribeDimensionKeysCommand = async (input, context) => {
6
+ const headers = {
7
+ "content-type": "application/x-amz-json-1.1",
8
+ "x-amz-target": "PerformanceInsightsv20180227.DescribeDimensionKeys",
9
+ };
10
+ let body;
11
+ body = JSON.stringify(serializeAws_json1_1DescribeDimensionKeysRequest(input, context));
12
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
+ };
14
+ export const serializeAws_json1_1GetDimensionKeyDetailsCommand = async (input, context) => {
15
+ const headers = {
16
+ "content-type": "application/x-amz-json-1.1",
17
+ "x-amz-target": "PerformanceInsightsv20180227.GetDimensionKeyDetails",
18
+ };
19
+ let body;
20
+ body = JSON.stringify(serializeAws_json1_1GetDimensionKeyDetailsRequest(input, context));
21
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
+ };
23
+ export const serializeAws_json1_1GetResourceMetadataCommand = async (input, context) => {
24
+ const headers = {
25
+ "content-type": "application/x-amz-json-1.1",
26
+ "x-amz-target": "PerformanceInsightsv20180227.GetResourceMetadata",
27
+ };
28
+ let body;
29
+ body = JSON.stringify(serializeAws_json1_1GetResourceMetadataRequest(input, context));
30
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
31
+ };
32
+ export const serializeAws_json1_1GetResourceMetricsCommand = async (input, context) => {
33
+ const headers = {
34
+ "content-type": "application/x-amz-json-1.1",
35
+ "x-amz-target": "PerformanceInsightsv20180227.GetResourceMetrics",
36
+ };
37
+ let body;
38
+ body = JSON.stringify(serializeAws_json1_1GetResourceMetricsRequest(input, context));
39
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
40
+ };
41
+ export const serializeAws_json1_1ListAvailableResourceDimensionsCommand = async (input, context) => {
42
+ const headers = {
43
+ "content-type": "application/x-amz-json-1.1",
44
+ "x-amz-target": "PerformanceInsightsv20180227.ListAvailableResourceDimensions",
45
+ };
46
+ let body;
47
+ body = JSON.stringify(serializeAws_json1_1ListAvailableResourceDimensionsRequest(input, context));
48
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
49
+ };
50
+ export const serializeAws_json1_1ListAvailableResourceMetricsCommand = async (input, context) => {
51
+ const headers = {
52
+ "content-type": "application/x-amz-json-1.1",
53
+ "x-amz-target": "PerformanceInsightsv20180227.ListAvailableResourceMetrics",
54
+ };
55
+ let body;
56
+ body = JSON.stringify(serializeAws_json1_1ListAvailableResourceMetricsRequest(input, context));
57
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
58
+ };
59
+ export const deserializeAws_json1_1DescribeDimensionKeysCommand = async (output, context) => {
60
+ if (output.statusCode >= 300) {
61
+ return deserializeAws_json1_1DescribeDimensionKeysCommandError(output, context);
62
+ }
63
+ const data = await parseBody(output.body, context);
64
+ let contents = {};
65
+ contents = deserializeAws_json1_1DescribeDimensionKeysResponse(data, context);
66
+ const response = {
67
+ $metadata: deserializeMetadata(output),
68
+ ...contents,
69
+ };
70
+ return Promise.resolve(response);
71
+ };
72
+ const deserializeAws_json1_1DescribeDimensionKeysCommandError = async (output, context) => {
73
+ const parsedOutput = {
74
+ ...output,
75
+ body: await parseErrorBody(output.body, context),
76
+ };
77
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
78
+ switch (errorCode) {
79
+ case "InternalServiceError":
80
+ case "com.amazonaws.pi#InternalServiceError":
81
+ throw await deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context);
82
+ case "InvalidArgumentException":
83
+ case "com.amazonaws.pi#InvalidArgumentException":
84
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
85
+ case "NotAuthorizedException":
86
+ case "com.amazonaws.pi#NotAuthorizedException":
87
+ throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context);
88
+ default:
89
+ const parsedBody = parsedOutput.body;
90
+ throwDefaultError({
91
+ output,
92
+ parsedBody,
93
+ exceptionCtor: __BaseException,
94
+ errorCode,
95
+ });
96
+ }
97
+ };
98
+ export const deserializeAws_json1_1GetDimensionKeyDetailsCommand = async (output, context) => {
99
+ if (output.statusCode >= 300) {
100
+ return deserializeAws_json1_1GetDimensionKeyDetailsCommandError(output, context);
101
+ }
102
+ const data = await parseBody(output.body, context);
103
+ let contents = {};
104
+ contents = deserializeAws_json1_1GetDimensionKeyDetailsResponse(data, context);
105
+ const response = {
106
+ $metadata: deserializeMetadata(output),
107
+ ...contents,
108
+ };
109
+ return Promise.resolve(response);
110
+ };
111
+ const deserializeAws_json1_1GetDimensionKeyDetailsCommandError = async (output, context) => {
112
+ const parsedOutput = {
113
+ ...output,
114
+ body: await parseErrorBody(output.body, context),
115
+ };
116
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
117
+ switch (errorCode) {
118
+ case "InternalServiceError":
119
+ case "com.amazonaws.pi#InternalServiceError":
120
+ throw await deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context);
121
+ case "InvalidArgumentException":
122
+ case "com.amazonaws.pi#InvalidArgumentException":
123
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
124
+ case "NotAuthorizedException":
125
+ case "com.amazonaws.pi#NotAuthorizedException":
126
+ throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context);
127
+ default:
128
+ const parsedBody = parsedOutput.body;
129
+ throwDefaultError({
130
+ output,
131
+ parsedBody,
132
+ exceptionCtor: __BaseException,
133
+ errorCode,
134
+ });
135
+ }
136
+ };
137
+ export const deserializeAws_json1_1GetResourceMetadataCommand = async (output, context) => {
138
+ if (output.statusCode >= 300) {
139
+ return deserializeAws_json1_1GetResourceMetadataCommandError(output, context);
140
+ }
141
+ const data = await parseBody(output.body, context);
142
+ let contents = {};
143
+ contents = deserializeAws_json1_1GetResourceMetadataResponse(data, context);
144
+ const response = {
145
+ $metadata: deserializeMetadata(output),
146
+ ...contents,
147
+ };
148
+ return Promise.resolve(response);
149
+ };
150
+ const deserializeAws_json1_1GetResourceMetadataCommandError = async (output, context) => {
151
+ const parsedOutput = {
152
+ ...output,
153
+ body: await parseErrorBody(output.body, context),
154
+ };
155
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
156
+ switch (errorCode) {
157
+ case "InternalServiceError":
158
+ case "com.amazonaws.pi#InternalServiceError":
159
+ throw await deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context);
160
+ case "InvalidArgumentException":
161
+ case "com.amazonaws.pi#InvalidArgumentException":
162
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
163
+ case "NotAuthorizedException":
164
+ case "com.amazonaws.pi#NotAuthorizedException":
165
+ throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context);
166
+ default:
167
+ const parsedBody = parsedOutput.body;
168
+ throwDefaultError({
169
+ output,
170
+ parsedBody,
171
+ exceptionCtor: __BaseException,
172
+ errorCode,
173
+ });
174
+ }
175
+ };
176
+ export const deserializeAws_json1_1GetResourceMetricsCommand = async (output, context) => {
177
+ if (output.statusCode >= 300) {
178
+ return deserializeAws_json1_1GetResourceMetricsCommandError(output, context);
179
+ }
180
+ const data = await parseBody(output.body, context);
181
+ let contents = {};
182
+ contents = deserializeAws_json1_1GetResourceMetricsResponse(data, context);
183
+ const response = {
184
+ $metadata: deserializeMetadata(output),
185
+ ...contents,
186
+ };
187
+ return Promise.resolve(response);
188
+ };
189
+ const deserializeAws_json1_1GetResourceMetricsCommandError = async (output, context) => {
190
+ const parsedOutput = {
191
+ ...output,
192
+ body: await parseErrorBody(output.body, context),
193
+ };
194
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
195
+ switch (errorCode) {
196
+ case "InternalServiceError":
197
+ case "com.amazonaws.pi#InternalServiceError":
198
+ throw await deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context);
199
+ case "InvalidArgumentException":
200
+ case "com.amazonaws.pi#InvalidArgumentException":
201
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
202
+ case "NotAuthorizedException":
203
+ case "com.amazonaws.pi#NotAuthorizedException":
204
+ throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context);
205
+ default:
206
+ const parsedBody = parsedOutput.body;
207
+ throwDefaultError({
208
+ output,
209
+ parsedBody,
210
+ exceptionCtor: __BaseException,
211
+ errorCode,
212
+ });
213
+ }
214
+ };
215
+ export const deserializeAws_json1_1ListAvailableResourceDimensionsCommand = async (output, context) => {
216
+ if (output.statusCode >= 300) {
217
+ return deserializeAws_json1_1ListAvailableResourceDimensionsCommandError(output, context);
218
+ }
219
+ const data = await parseBody(output.body, context);
220
+ let contents = {};
221
+ contents = deserializeAws_json1_1ListAvailableResourceDimensionsResponse(data, context);
222
+ const response = {
223
+ $metadata: deserializeMetadata(output),
224
+ ...contents,
225
+ };
226
+ return Promise.resolve(response);
227
+ };
228
+ const deserializeAws_json1_1ListAvailableResourceDimensionsCommandError = async (output, context) => {
229
+ const parsedOutput = {
230
+ ...output,
231
+ body: await parseErrorBody(output.body, context),
232
+ };
233
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
234
+ switch (errorCode) {
235
+ case "InternalServiceError":
236
+ case "com.amazonaws.pi#InternalServiceError":
237
+ throw await deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context);
238
+ case "InvalidArgumentException":
239
+ case "com.amazonaws.pi#InvalidArgumentException":
240
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
241
+ case "NotAuthorizedException":
242
+ case "com.amazonaws.pi#NotAuthorizedException":
243
+ throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context);
244
+ default:
245
+ const parsedBody = parsedOutput.body;
246
+ throwDefaultError({
247
+ output,
248
+ parsedBody,
249
+ exceptionCtor: __BaseException,
250
+ errorCode,
251
+ });
252
+ }
253
+ };
254
+ export const deserializeAws_json1_1ListAvailableResourceMetricsCommand = async (output, context) => {
255
+ if (output.statusCode >= 300) {
256
+ return deserializeAws_json1_1ListAvailableResourceMetricsCommandError(output, context);
257
+ }
258
+ const data = await parseBody(output.body, context);
259
+ let contents = {};
260
+ contents = deserializeAws_json1_1ListAvailableResourceMetricsResponse(data, context);
261
+ const response = {
262
+ $metadata: deserializeMetadata(output),
263
+ ...contents,
264
+ };
265
+ return Promise.resolve(response);
266
+ };
267
+ const deserializeAws_json1_1ListAvailableResourceMetricsCommandError = async (output, context) => {
268
+ const parsedOutput = {
269
+ ...output,
270
+ body: await parseErrorBody(output.body, context),
271
+ };
272
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
273
+ switch (errorCode) {
274
+ case "InternalServiceError":
275
+ case "com.amazonaws.pi#InternalServiceError":
276
+ throw await deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context);
277
+ case "InvalidArgumentException":
278
+ case "com.amazonaws.pi#InvalidArgumentException":
279
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
280
+ case "NotAuthorizedException":
281
+ case "com.amazonaws.pi#NotAuthorizedException":
282
+ throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context);
283
+ default:
284
+ const parsedBody = parsedOutput.body;
285
+ throwDefaultError({
286
+ output,
287
+ parsedBody,
288
+ exceptionCtor: __BaseException,
289
+ errorCode,
290
+ });
291
+ }
292
+ };
293
+ const deserializeAws_json1_1InternalServiceErrorResponse = async (parsedOutput, context) => {
294
+ const body = parsedOutput.body;
295
+ const deserialized = deserializeAws_json1_1InternalServiceError(body, context);
296
+ const exception = new InternalServiceError({
297
+ $metadata: deserializeMetadata(parsedOutput),
298
+ ...deserialized,
433
299
  });
434
- }); };
435
- var deserializeAws_json1_1InvalidArgumentExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
436
- var body, deserialized, exception;
437
- return __generator(this, function (_a) {
438
- body = parsedOutput.body;
439
- deserialized = deserializeAws_json1_1InvalidArgumentException(body, context);
440
- exception = new InvalidArgumentException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
441
- return [2, __decorateServiceException(exception, body)];
300
+ return __decorateServiceException(exception, body);
301
+ };
302
+ const deserializeAws_json1_1InvalidArgumentExceptionResponse = async (parsedOutput, context) => {
303
+ const body = parsedOutput.body;
304
+ const deserialized = deserializeAws_json1_1InvalidArgumentException(body, context);
305
+ const exception = new InvalidArgumentException({
306
+ $metadata: deserializeMetadata(parsedOutput),
307
+ ...deserialized,
442
308
  });
443
- }); };
444
- var deserializeAws_json1_1NotAuthorizedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
445
- var body, deserialized, exception;
446
- return __generator(this, function (_a) {
447
- body = parsedOutput.body;
448
- deserialized = deserializeAws_json1_1NotAuthorizedException(body, context);
449
- exception = new NotAuthorizedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
450
- return [2, __decorateServiceException(exception, body)];
309
+ return __decorateServiceException(exception, body);
310
+ };
311
+ const deserializeAws_json1_1NotAuthorizedExceptionResponse = async (parsedOutput, context) => {
312
+ const body = parsedOutput.body;
313
+ const deserialized = deserializeAws_json1_1NotAuthorizedException(body, context);
314
+ const exception = new NotAuthorizedException({
315
+ $metadata: deserializeMetadata(parsedOutput),
316
+ ...deserialized,
451
317
  });
452
- }); };
453
- var serializeAws_json1_1AdditionalMetricsList = function (input, context) {
318
+ return __decorateServiceException(exception, body);
319
+ };
320
+ const serializeAws_json1_1AdditionalMetricsList = (input, context) => {
454
321
  return input
455
- .filter(function (e) { return e != null; })
456
- .map(function (entry) {
322
+ .filter((e) => e != null)
323
+ .map((entry) => {
457
324
  return entry;
458
325
  });
459
326
  };
460
- var serializeAws_json1_1DescribeDimensionKeysRequest = function (input, context) {
461
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.AdditionalMetrics != null && {
462
- AdditionalMetrics: serializeAws_json1_1AdditionalMetricsList(input.AdditionalMetrics, context),
463
- })), (input.EndTime != null && { EndTime: Math.round(input.EndTime.getTime() / 1000) })), (input.Filter != null && { Filter: serializeAws_json1_1MetricQueryFilterMap(input.Filter, context) })), (input.GroupBy != null && { GroupBy: serializeAws_json1_1DimensionGroup(input.GroupBy, context) })), (input.Identifier != null && { Identifier: input.Identifier })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.Metric != null && { Metric: input.Metric })), (input.NextToken != null && { NextToken: input.NextToken })), (input.PartitionBy != null && { PartitionBy: serializeAws_json1_1DimensionGroup(input.PartitionBy, context) })), (input.PeriodInSeconds != null && { PeriodInSeconds: input.PeriodInSeconds })), (input.ServiceType != null && { ServiceType: input.ServiceType })), (input.StartTime != null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }));
327
+ const serializeAws_json1_1DescribeDimensionKeysRequest = (input, context) => {
328
+ return {
329
+ ...(input.AdditionalMetrics != null && {
330
+ AdditionalMetrics: serializeAws_json1_1AdditionalMetricsList(input.AdditionalMetrics, context),
331
+ }),
332
+ ...(input.EndTime != null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }),
333
+ ...(input.Filter != null && { Filter: serializeAws_json1_1MetricQueryFilterMap(input.Filter, context) }),
334
+ ...(input.GroupBy != null && { GroupBy: serializeAws_json1_1DimensionGroup(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: serializeAws_json1_1DimensionGroup(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
+ };
464
344
  };
465
- var serializeAws_json1_1DimensionGroup = function (input, context) {
466
- return __assign(__assign(__assign({}, (input.Dimensions != null && { Dimensions: serializeAws_json1_1RequestStringList(input.Dimensions, context) })), (input.Group != null && { Group: input.Group })), (input.Limit != null && { Limit: input.Limit }));
345
+ const serializeAws_json1_1DimensionGroup = (input, context) => {
346
+ return {
347
+ ...(input.Dimensions != null && { Dimensions: serializeAws_json1_1RequestStringList(input.Dimensions, context) }),
348
+ ...(input.Group != null && { Group: input.Group }),
349
+ ...(input.Limit != null && { Limit: input.Limit }),
350
+ };
467
351
  };
468
- var serializeAws_json1_1DimensionsMetricList = function (input, context) {
352
+ const serializeAws_json1_1DimensionsMetricList = (input, context) => {
469
353
  return input
470
- .filter(function (e) { return e != null; })
471
- .map(function (entry) {
354
+ .filter((e) => e != null)
355
+ .map((entry) => {
472
356
  return entry;
473
357
  });
474
358
  };
475
- var serializeAws_json1_1GetDimensionKeyDetailsRequest = function (input, context) {
476
- return __assign(__assign(__assign(__assign(__assign({}, (input.Group != null && { Group: input.Group })), (input.GroupIdentifier != null && { GroupIdentifier: input.GroupIdentifier })), (input.Identifier != null && { Identifier: input.Identifier })), (input.RequestedDimensions != null && {
477
- RequestedDimensions: serializeAws_json1_1RequestedDimensionList(input.RequestedDimensions, context),
478
- })), (input.ServiceType != null && { ServiceType: input.ServiceType }));
359
+ const serializeAws_json1_1GetDimensionKeyDetailsRequest = (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: serializeAws_json1_1RequestedDimensionList(input.RequestedDimensions, context),
366
+ }),
367
+ ...(input.ServiceType != null && { ServiceType: input.ServiceType }),
368
+ };
479
369
  };
480
- var serializeAws_json1_1GetResourceMetadataRequest = function (input, context) {
481
- return __assign(__assign({}, (input.Identifier != null && { Identifier: input.Identifier })), (input.ServiceType != null && { ServiceType: input.ServiceType }));
370
+ const serializeAws_json1_1GetResourceMetadataRequest = (input, context) => {
371
+ return {
372
+ ...(input.Identifier != null && { Identifier: input.Identifier }),
373
+ ...(input.ServiceType != null && { ServiceType: input.ServiceType }),
374
+ };
482
375
  };
483
- var serializeAws_json1_1GetResourceMetricsRequest = function (input, context) {
484
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.EndTime != null && { EndTime: Math.round(input.EndTime.getTime() / 1000) })), (input.Identifier != null && { Identifier: input.Identifier })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.MetricQueries != null && {
485
- MetricQueries: serializeAws_json1_1MetricQueryList(input.MetricQueries, context),
486
- })), (input.NextToken != null && { NextToken: input.NextToken })), (input.PeriodInSeconds != null && { PeriodInSeconds: input.PeriodInSeconds })), (input.ServiceType != null && { ServiceType: input.ServiceType })), (input.StartTime != null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }));
376
+ const serializeAws_json1_1GetResourceMetricsRequest = (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 && {
382
+ MetricQueries: serializeAws_json1_1MetricQueryList(input.MetricQueries, context),
383
+ }),
384
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
385
+ ...(input.PeriodInSeconds != null && { PeriodInSeconds: input.PeriodInSeconds }),
386
+ ...(input.ServiceType != null && { ServiceType: input.ServiceType }),
387
+ ...(input.StartTime != null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }),
388
+ };
487
389
  };
488
- var serializeAws_json1_1ListAvailableResourceDimensionsRequest = function (input, context) {
489
- return __assign(__assign(__assign(__assign(__assign({}, (input.Identifier != null && { Identifier: input.Identifier })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.Metrics != null && { Metrics: serializeAws_json1_1DimensionsMetricList(input.Metrics, context) })), (input.NextToken != null && { NextToken: input.NextToken })), (input.ServiceType != null && { ServiceType: input.ServiceType }));
390
+ const serializeAws_json1_1ListAvailableResourceDimensionsRequest = (input, context) => {
391
+ return {
392
+ ...(input.Identifier != null && { Identifier: input.Identifier }),
393
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
394
+ ...(input.Metrics != null && { Metrics: serializeAws_json1_1DimensionsMetricList(input.Metrics, context) }),
395
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
396
+ ...(input.ServiceType != null && { ServiceType: input.ServiceType }),
397
+ };
490
398
  };
491
- var serializeAws_json1_1ListAvailableResourceMetricsRequest = function (input, context) {
492
- return __assign(__assign(__assign(__assign(__assign({}, (input.Identifier != null && { Identifier: input.Identifier })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.MetricTypes != null && { MetricTypes: serializeAws_json1_1MetricTypeList(input.MetricTypes, context) })), (input.NextToken != null && { NextToken: input.NextToken })), (input.ServiceType != null && { ServiceType: input.ServiceType }));
399
+ const serializeAws_json1_1ListAvailableResourceMetricsRequest = (input, context) => {
400
+ return {
401
+ ...(input.Identifier != null && { Identifier: input.Identifier }),
402
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
403
+ ...(input.MetricTypes != null && { MetricTypes: serializeAws_json1_1MetricTypeList(input.MetricTypes, context) }),
404
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
405
+ ...(input.ServiceType != null && { ServiceType: input.ServiceType }),
406
+ };
493
407
  };
494
- var serializeAws_json1_1MetricQuery = function (input, context) {
495
- return __assign(__assign(__assign({}, (input.Filter != null && { Filter: serializeAws_json1_1MetricQueryFilterMap(input.Filter, context) })), (input.GroupBy != null && { GroupBy: serializeAws_json1_1DimensionGroup(input.GroupBy, context) })), (input.Metric != null && { Metric: input.Metric }));
408
+ const serializeAws_json1_1MetricQuery = (input, context) => {
409
+ return {
410
+ ...(input.Filter != null && { Filter: serializeAws_json1_1MetricQueryFilterMap(input.Filter, context) }),
411
+ ...(input.GroupBy != null && { GroupBy: serializeAws_json1_1DimensionGroup(input.GroupBy, context) }),
412
+ ...(input.Metric != null && { Metric: input.Metric }),
413
+ };
496
414
  };
497
- var serializeAws_json1_1MetricQueryFilterMap = function (input, context) {
498
- return Object.entries(input).reduce(function (acc, _a) {
499
- var _b;
500
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
415
+ const serializeAws_json1_1MetricQueryFilterMap = (input, context) => {
416
+ return Object.entries(input).reduce((acc, [key, value]) => {
501
417
  if (value === null) {
502
418
  return acc;
503
419
  }
504
- return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
420
+ return {
421
+ ...acc,
422
+ [key]: value,
423
+ };
505
424
  }, {});
506
425
  };
507
- var serializeAws_json1_1MetricQueryList = function (input, context) {
426
+ const serializeAws_json1_1MetricQueryList = (input, context) => {
508
427
  return input
509
- .filter(function (e) { return e != null; })
510
- .map(function (entry) {
428
+ .filter((e) => e != null)
429
+ .map((entry) => {
511
430
  return serializeAws_json1_1MetricQuery(entry, context);
512
431
  });
513
432
  };
514
- var serializeAws_json1_1MetricTypeList = function (input, context) {
433
+ const serializeAws_json1_1MetricTypeList = (input, context) => {
515
434
  return input
516
- .filter(function (e) { return e != null; })
517
- .map(function (entry) {
435
+ .filter((e) => e != null)
436
+ .map((entry) => {
518
437
  return entry;
519
438
  });
520
439
  };
521
- var serializeAws_json1_1RequestedDimensionList = function (input, context) {
440
+ const serializeAws_json1_1RequestedDimensionList = (input, context) => {
522
441
  return input
523
- .filter(function (e) { return e != null; })
524
- .map(function (entry) {
442
+ .filter((e) => e != null)
443
+ .map((entry) => {
525
444
  return entry;
526
445
  });
527
446
  };
528
- var serializeAws_json1_1RequestStringList = function (input, context) {
447
+ const serializeAws_json1_1RequestStringList = (input, context) => {
529
448
  return input
530
- .filter(function (e) { return e != null; })
531
- .map(function (entry) {
449
+ .filter((e) => e != null)
450
+ .map((entry) => {
532
451
  return entry;
533
452
  });
534
453
  };
535
- var deserializeAws_json1_1AdditionalMetricsMap = function (output, context) {
536
- return Object.entries(output).reduce(function (acc, _a) {
537
- var _b;
538
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
454
+ const deserializeAws_json1_1AdditionalMetricsMap = (output, context) => {
455
+ return Object.entries(output).reduce((acc, [key, value]) => {
539
456
  if (value === null) {
540
457
  return acc;
541
458
  }
542
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __limitedParseDouble(value), _b));
459
+ return {
460
+ ...acc,
461
+ [key]: __limitedParseDouble(value),
462
+ };
543
463
  }, {});
544
464
  };
545
- var deserializeAws_json1_1DataPoint = function (output, context) {
465
+ const deserializeAws_json1_1DataPoint = (output, context) => {
546
466
  return {
547
467
  Timestamp: output.Timestamp != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.Timestamp))) : undefined,
548
468
  Value: __limitedParseDouble(output.Value),
549
469
  };
550
470
  };
551
- var deserializeAws_json1_1DataPointsList = function (output, context) {
552
- var retVal = (output || [])
553
- .filter(function (e) { return e != null; })
554
- .map(function (entry) {
471
+ const deserializeAws_json1_1DataPointsList = (output, context) => {
472
+ const retVal = (output || [])
473
+ .filter((e) => e != null)
474
+ .map((entry) => {
555
475
  if (entry === null) {
556
476
  return null;
557
477
  }
@@ -559,7 +479,7 @@ var deserializeAws_json1_1DataPointsList = function (output, context) {
559
479
  });
560
480
  return retVal;
561
481
  };
562
- var deserializeAws_json1_1DescribeDimensionKeysResponse = function (output, context) {
482
+ const deserializeAws_json1_1DescribeDimensionKeysResponse = (output, context) => {
563
483
  return {
564
484
  AlignedEndTime: output.AlignedEndTime != null
565
485
  ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.AlignedEndTime)))
@@ -574,15 +494,15 @@ var deserializeAws_json1_1DescribeDimensionKeysResponse = function (output, cont
574
494
  : undefined,
575
495
  };
576
496
  };
577
- var deserializeAws_json1_1DimensionDetail = function (output, context) {
497
+ const deserializeAws_json1_1DimensionDetail = (output, context) => {
578
498
  return {
579
499
  Identifier: __expectString(output.Identifier),
580
500
  };
581
501
  };
582
- var deserializeAws_json1_1DimensionDetailList = function (output, context) {
583
- var retVal = (output || [])
584
- .filter(function (e) { return e != null; })
585
- .map(function (entry) {
502
+ const deserializeAws_json1_1DimensionDetailList = (output, context) => {
503
+ const retVal = (output || [])
504
+ .filter((e) => e != null)
505
+ .map((entry) => {
586
506
  if (entry === null) {
587
507
  return null;
588
508
  }
@@ -590,16 +510,16 @@ var deserializeAws_json1_1DimensionDetailList = function (output, context) {
590
510
  });
591
511
  return retVal;
592
512
  };
593
- var deserializeAws_json1_1DimensionGroupDetail = function (output, context) {
513
+ const deserializeAws_json1_1DimensionGroupDetail = (output, context) => {
594
514
  return {
595
515
  Dimensions: output.Dimensions != null ? deserializeAws_json1_1DimensionDetailList(output.Dimensions, context) : undefined,
596
516
  Group: __expectString(output.Group),
597
517
  };
598
518
  };
599
- var deserializeAws_json1_1DimensionGroupDetailList = function (output, context) {
600
- var retVal = (output || [])
601
- .filter(function (e) { return e != null; })
602
- .map(function (entry) {
519
+ const deserializeAws_json1_1DimensionGroupDetailList = (output, context) => {
520
+ const retVal = (output || [])
521
+ .filter((e) => e != null)
522
+ .map((entry) => {
603
523
  if (entry === null) {
604
524
  return null;
605
525
  }
@@ -607,7 +527,7 @@ var deserializeAws_json1_1DimensionGroupDetailList = function (output, context)
607
527
  });
608
528
  return retVal;
609
529
  };
610
- var deserializeAws_json1_1DimensionKeyDescription = function (output, context) {
530
+ const deserializeAws_json1_1DimensionKeyDescription = (output, context) => {
611
531
  return {
612
532
  AdditionalMetrics: output.AdditionalMetrics != null
613
533
  ? deserializeAws_json1_1AdditionalMetricsMap(output.AdditionalMetrics, context)
@@ -617,10 +537,10 @@ var deserializeAws_json1_1DimensionKeyDescription = function (output, context) {
617
537
  Total: __limitedParseDouble(output.Total),
618
538
  };
619
539
  };
620
- var deserializeAws_json1_1DimensionKeyDescriptionList = function (output, context) {
621
- var retVal = (output || [])
622
- .filter(function (e) { return e != null; })
623
- .map(function (entry) {
540
+ const deserializeAws_json1_1DimensionKeyDescriptionList = (output, context) => {
541
+ const retVal = (output || [])
542
+ .filter((e) => e != null)
543
+ .map((entry) => {
624
544
  if (entry === null) {
625
545
  return null;
626
546
  }
@@ -628,17 +548,17 @@ var deserializeAws_json1_1DimensionKeyDescriptionList = function (output, contex
628
548
  });
629
549
  return retVal;
630
550
  };
631
- var deserializeAws_json1_1DimensionKeyDetail = function (output, context) {
551
+ const deserializeAws_json1_1DimensionKeyDetail = (output, context) => {
632
552
  return {
633
553
  Dimension: __expectString(output.Dimension),
634
554
  Status: __expectString(output.Status),
635
555
  Value: __expectString(output.Value),
636
556
  };
637
557
  };
638
- var deserializeAws_json1_1DimensionKeyDetailList = function (output, context) {
639
- var retVal = (output || [])
640
- .filter(function (e) { return e != null; })
641
- .map(function (entry) {
558
+ const deserializeAws_json1_1DimensionKeyDetailList = (output, context) => {
559
+ const retVal = (output || [])
560
+ .filter((e) => e != null)
561
+ .map((entry) => {
642
562
  if (entry === null) {
643
563
  return null;
644
564
  }
@@ -646,43 +566,45 @@ var deserializeAws_json1_1DimensionKeyDetailList = function (output, context) {
646
566
  });
647
567
  return retVal;
648
568
  };
649
- var deserializeAws_json1_1DimensionMap = function (output, context) {
650
- return Object.entries(output).reduce(function (acc, _a) {
651
- var _b;
652
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
569
+ const deserializeAws_json1_1DimensionMap = (output, context) => {
570
+ return Object.entries(output).reduce((acc, [key, value]) => {
653
571
  if (value === null) {
654
572
  return acc;
655
573
  }
656
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
574
+ return {
575
+ ...acc,
576
+ [key]: __expectString(value),
577
+ };
657
578
  }, {});
658
579
  };
659
- var deserializeAws_json1_1FeatureMetadata = function (output, context) {
580
+ const deserializeAws_json1_1FeatureMetadata = (output, context) => {
660
581
  return {
661
582
  Status: __expectString(output.Status),
662
583
  };
663
584
  };
664
- var deserializeAws_json1_1FeatureMetadataMap = function (output, context) {
665
- return Object.entries(output).reduce(function (acc, _a) {
666
- var _b;
667
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
585
+ const deserializeAws_json1_1FeatureMetadataMap = (output, context) => {
586
+ return Object.entries(output).reduce((acc, [key, value]) => {
668
587
  if (value === null) {
669
588
  return acc;
670
589
  }
671
- return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_json1_1FeatureMetadata(value, context), _b));
590
+ return {
591
+ ...acc,
592
+ [key]: deserializeAws_json1_1FeatureMetadata(value, context),
593
+ };
672
594
  }, {});
673
595
  };
674
- var deserializeAws_json1_1GetDimensionKeyDetailsResponse = function (output, context) {
596
+ const deserializeAws_json1_1GetDimensionKeyDetailsResponse = (output, context) => {
675
597
  return {
676
598
  Dimensions: output.Dimensions != null ? deserializeAws_json1_1DimensionKeyDetailList(output.Dimensions, context) : undefined,
677
599
  };
678
600
  };
679
- var deserializeAws_json1_1GetResourceMetadataResponse = function (output, context) {
601
+ const deserializeAws_json1_1GetResourceMetadataResponse = (output, context) => {
680
602
  return {
681
603
  Features: output.Features != null ? deserializeAws_json1_1FeatureMetadataMap(output.Features, context) : undefined,
682
604
  Identifier: __expectString(output.Identifier),
683
605
  };
684
606
  };
685
- var deserializeAws_json1_1GetResourceMetricsResponse = function (output, context) {
607
+ const deserializeAws_json1_1GetResourceMetricsResponse = (output, context) => {
686
608
  return {
687
609
  AlignedEndTime: output.AlignedEndTime != null
688
610
  ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.AlignedEndTime)))
@@ -695,17 +617,17 @@ var deserializeAws_json1_1GetResourceMetricsResponse = function (output, context
695
617
  NextToken: __expectString(output.NextToken),
696
618
  };
697
619
  };
698
- var deserializeAws_json1_1InternalServiceError = function (output, context) {
620
+ const deserializeAws_json1_1InternalServiceError = (output, context) => {
699
621
  return {
700
622
  Message: __expectString(output.Message),
701
623
  };
702
624
  };
703
- var deserializeAws_json1_1InvalidArgumentException = function (output, context) {
625
+ const deserializeAws_json1_1InvalidArgumentException = (output, context) => {
704
626
  return {
705
627
  Message: __expectString(output.Message),
706
628
  };
707
629
  };
708
- var deserializeAws_json1_1ListAvailableResourceDimensionsResponse = function (output, context) {
630
+ const deserializeAws_json1_1ListAvailableResourceDimensionsResponse = (output, context) => {
709
631
  return {
710
632
  MetricDimensions: output.MetricDimensions != null
711
633
  ? deserializeAws_json1_1MetricDimensionsList(output.MetricDimensions, context)
@@ -713,22 +635,22 @@ var deserializeAws_json1_1ListAvailableResourceDimensionsResponse = function (ou
713
635
  NextToken: __expectString(output.NextToken),
714
636
  };
715
637
  };
716
- var deserializeAws_json1_1ListAvailableResourceMetricsResponse = function (output, context) {
638
+ const deserializeAws_json1_1ListAvailableResourceMetricsResponse = (output, context) => {
717
639
  return {
718
640
  Metrics: output.Metrics != null ? deserializeAws_json1_1ResponseResourceMetricList(output.Metrics, context) : undefined,
719
641
  NextToken: __expectString(output.NextToken),
720
642
  };
721
643
  };
722
- var deserializeAws_json1_1MetricDimensionGroups = function (output, context) {
644
+ const deserializeAws_json1_1MetricDimensionGroups = (output, context) => {
723
645
  return {
724
646
  Groups: output.Groups != null ? deserializeAws_json1_1DimensionGroupDetailList(output.Groups, context) : undefined,
725
647
  Metric: __expectString(output.Metric),
726
648
  };
727
649
  };
728
- var deserializeAws_json1_1MetricDimensionsList = function (output, context) {
729
- var retVal = (output || [])
730
- .filter(function (e) { return e != null; })
731
- .map(function (entry) {
650
+ const deserializeAws_json1_1MetricDimensionsList = (output, context) => {
651
+ const retVal = (output || [])
652
+ .filter((e) => e != null)
653
+ .map((entry) => {
732
654
  if (entry === null) {
733
655
  return null;
734
656
  }
@@ -736,16 +658,16 @@ var deserializeAws_json1_1MetricDimensionsList = function (output, context) {
736
658
  });
737
659
  return retVal;
738
660
  };
739
- var deserializeAws_json1_1MetricKeyDataPoints = function (output, context) {
661
+ const deserializeAws_json1_1MetricKeyDataPoints = (output, context) => {
740
662
  return {
741
663
  DataPoints: output.DataPoints != null ? deserializeAws_json1_1DataPointsList(output.DataPoints, context) : undefined,
742
664
  Key: output.Key != null ? deserializeAws_json1_1ResponseResourceMetricKey(output.Key, context) : undefined,
743
665
  };
744
666
  };
745
- var deserializeAws_json1_1MetricKeyDataPointsList = function (output, context) {
746
- var retVal = (output || [])
747
- .filter(function (e) { return e != null; })
748
- .map(function (entry) {
667
+ const deserializeAws_json1_1MetricKeyDataPointsList = (output, context) => {
668
+ const retVal = (output || [])
669
+ .filter((e) => e != null)
670
+ .map((entry) => {
749
671
  if (entry === null) {
750
672
  return null;
751
673
  }
@@ -753,10 +675,10 @@ var deserializeAws_json1_1MetricKeyDataPointsList = function (output, context) {
753
675
  });
754
676
  return retVal;
755
677
  };
756
- var deserializeAws_json1_1MetricValuesList = function (output, context) {
757
- var retVal = (output || [])
758
- .filter(function (e) { return e != null; })
759
- .map(function (entry) {
678
+ const deserializeAws_json1_1MetricValuesList = (output, context) => {
679
+ const retVal = (output || [])
680
+ .filter((e) => e != null)
681
+ .map((entry) => {
760
682
  if (entry === null) {
761
683
  return null;
762
684
  }
@@ -764,20 +686,20 @@ var deserializeAws_json1_1MetricValuesList = function (output, context) {
764
686
  });
765
687
  return retVal;
766
688
  };
767
- var deserializeAws_json1_1NotAuthorizedException = function (output, context) {
689
+ const deserializeAws_json1_1NotAuthorizedException = (output, context) => {
768
690
  return {
769
691
  Message: __expectString(output.Message),
770
692
  };
771
693
  };
772
- var deserializeAws_json1_1ResponsePartitionKey = function (output, context) {
694
+ const deserializeAws_json1_1ResponsePartitionKey = (output, context) => {
773
695
  return {
774
696
  Dimensions: output.Dimensions != null ? deserializeAws_json1_1DimensionMap(output.Dimensions, context) : undefined,
775
697
  };
776
698
  };
777
- var deserializeAws_json1_1ResponsePartitionKeyList = function (output, context) {
778
- var retVal = (output || [])
779
- .filter(function (e) { return e != null; })
780
- .map(function (entry) {
699
+ const deserializeAws_json1_1ResponsePartitionKeyList = (output, context) => {
700
+ const retVal = (output || [])
701
+ .filter((e) => e != null)
702
+ .map((entry) => {
781
703
  if (entry === null) {
782
704
  return null;
783
705
  }
@@ -785,23 +707,23 @@ var deserializeAws_json1_1ResponsePartitionKeyList = function (output, context)
785
707
  });
786
708
  return retVal;
787
709
  };
788
- var deserializeAws_json1_1ResponseResourceMetric = function (output, context) {
710
+ const deserializeAws_json1_1ResponseResourceMetric = (output, context) => {
789
711
  return {
790
712
  Description: __expectString(output.Description),
791
713
  Metric: __expectString(output.Metric),
792
714
  Unit: __expectString(output.Unit),
793
715
  };
794
716
  };
795
- var deserializeAws_json1_1ResponseResourceMetricKey = function (output, context) {
717
+ const deserializeAws_json1_1ResponseResourceMetricKey = (output, context) => {
796
718
  return {
797
719
  Dimensions: output.Dimensions != null ? deserializeAws_json1_1DimensionMap(output.Dimensions, context) : undefined,
798
720
  Metric: __expectString(output.Metric),
799
721
  };
800
722
  };
801
- var deserializeAws_json1_1ResponseResourceMetricList = function (output, context) {
802
- var retVal = (output || [])
803
- .filter(function (e) { return e != null; })
804
- .map(function (entry) {
723
+ const deserializeAws_json1_1ResponseResourceMetricList = (output, context) => {
724
+ const retVal = (output || [])
725
+ .filter((e) => e != null)
726
+ .map((entry) => {
805
727
  if (entry === null) {
806
728
  return null;
807
729
  }
@@ -809,75 +731,52 @@ var deserializeAws_json1_1ResponseResourceMetricList = function (output, context
809
731
  });
810
732
  return retVal;
811
733
  };
812
- var deserializeMetadata = function (output) {
813
- var _a;
814
- return ({
815
- httpStatusCode: output.statusCode,
816
- requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
817
- extendedRequestId: output.headers["x-amz-id-2"],
818
- cfId: output.headers["x-amz-cf-id"],
819
- });
820
- };
821
- var collectBody = function (streamBody, context) {
822
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
734
+ const deserializeMetadata = (output) => ({
735
+ httpStatusCode: output.statusCode,
736
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
737
+ extendedRequestId: output.headers["x-amz-id-2"],
738
+ cfId: output.headers["x-amz-cf-id"],
739
+ });
740
+ const collectBody = (streamBody = new Uint8Array(), context) => {
823
741
  if (streamBody instanceof Uint8Array) {
824
742
  return Promise.resolve(streamBody);
825
743
  }
826
744
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
827
745
  };
828
- var collectBodyString = function (streamBody, context) {
829
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
830
- };
831
- var buildHttpRpcRequest = function (context, headers, path, resolvedHostname, body) { return __awaiter(void 0, void 0, void 0, function () {
832
- var _a, hostname, _b, protocol, port, basePath, contents;
833
- return __generator(this, function (_c) {
834
- switch (_c.label) {
835
- case 0: return [4, context.endpoint()];
836
- case 1:
837
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
838
- contents = {
839
- protocol: protocol,
840
- hostname: hostname,
841
- port: port,
842
- method: "POST",
843
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
844
- headers: headers,
845
- };
846
- if (resolvedHostname !== undefined) {
847
- contents.hostname = resolvedHostname;
848
- }
849
- if (body !== undefined) {
850
- contents.body = body;
851
- }
852
- return [2, new __HttpRequest(contents)];
853
- }
854
- });
855
- }); };
856
- var parseBody = function (streamBody, context) {
857
- return collectBodyString(streamBody, context).then(function (encoded) {
858
- if (encoded.length) {
859
- return JSON.parse(encoded);
860
- }
861
- return {};
862
- });
746
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
747
+ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
748
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
749
+ const contents = {
750
+ protocol,
751
+ hostname,
752
+ port,
753
+ method: "POST",
754
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
755
+ headers,
756
+ };
757
+ if (resolvedHostname !== undefined) {
758
+ contents.hostname = resolvedHostname;
759
+ }
760
+ if (body !== undefined) {
761
+ contents.body = body;
762
+ }
763
+ return new __HttpRequest(contents);
863
764
  };
864
- var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
865
- var value;
866
- var _a;
867
- return __generator(this, function (_b) {
868
- switch (_b.label) {
869
- case 0: return [4, parseBody(errorBody, context)];
870
- case 1:
871
- value = _b.sent();
872
- value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
873
- return [2, value];
874
- }
875
- });
876
- }); };
877
- var loadRestJsonErrorCode = function (output, data) {
878
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
879
- var sanitizeErrorCode = function (rawValue) {
880
- var cleanValue = rawValue;
765
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
766
+ if (encoded.length) {
767
+ return JSON.parse(encoded);
768
+ }
769
+ return {};
770
+ });
771
+ const parseErrorBody = async (errorBody, context) => {
772
+ const value = await parseBody(errorBody, context);
773
+ value.message = value.message ?? value.Message;
774
+ return value;
775
+ };
776
+ const loadRestJsonErrorCode = (output, data) => {
777
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
778
+ const sanitizeErrorCode = (rawValue) => {
779
+ let cleanValue = rawValue;
881
780
  if (typeof cleanValue === "number") {
882
781
  cleanValue = cleanValue.toString();
883
782
  }
@@ -892,7 +791,7 @@ var loadRestJsonErrorCode = function (output, data) {
892
791
  }
893
792
  return cleanValue;
894
793
  };
895
- var headerKey = findKey(output.headers, "x-amzn-errortype");
794
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
896
795
  if (headerKey !== undefined) {
897
796
  return sanitizeErrorCode(output.headers[headerKey]);
898
797
  }