@aws-sdk/client-applicationcostprofiler 3.141.0 → 3.142.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.142.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.141.0...v3.142.0) (2022-08-02)
7
+
8
+
9
+ ### Features
10
+
11
+ * **codegen:** general data mapping function ([#3830](https://github.com/aws/aws-sdk-js-v3/issues/3830)) ([9417eae](https://github.com/aws/aws-sdk-js-v3/commit/9417eae722806799fb4c15c07921574268c1165c))
12
+
13
+
14
+
15
+
16
+
6
17
  # [3.141.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.140.0...v3.141.0) (2022-08-01)
7
18
 
8
19
 
@@ -9,16 +9,7 @@ const serializeAws_restJson1DeleteReportDefinitionCommand = async (input, contex
9
9
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
10
10
  const headers = {};
11
11
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/reportDefinition/{reportId}";
12
- if (input.reportId !== undefined) {
13
- const labelValue = input.reportId;
14
- if (labelValue.length <= 0) {
15
- throw new Error("Empty value provided for input HTTP label: reportId.");
16
- }
17
- resolvedPath = resolvedPath.replace("{reportId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
18
- }
19
- else {
20
- throw new Error("No value provided for input HTTP label: reportId.");
21
- }
12
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "reportId", () => input.reportId, "{reportId}", false);
22
13
  let body;
23
14
  return new protocol_http_1.HttpRequest({
24
15
  protocol,
@@ -35,16 +26,7 @@ const serializeAws_restJson1GetReportDefinitionCommand = async (input, context)
35
26
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
36
27
  const headers = {};
37
28
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/reportDefinition/{reportId}";
38
- if (input.reportId !== undefined) {
39
- const labelValue = input.reportId;
40
- if (labelValue.length <= 0) {
41
- throw new Error("Empty value provided for input HTTP label: reportId.");
42
- }
43
- resolvedPath = resolvedPath.replace("{reportId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
44
- }
45
- else {
46
- throw new Error("No value provided for input HTTP label: reportId.");
47
- }
29
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "reportId", () => input.reportId, "{reportId}", false);
48
30
  let body;
49
31
  return new protocol_http_1.HttpRequest({
50
32
  protocol,
@@ -84,10 +66,10 @@ const serializeAws_restJson1ListReportDefinitionsCommand = async (input, context
84
66
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
85
67
  const headers = {};
86
68
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/reportDefinition";
87
- const query = {
88
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
89
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
90
- };
69
+ const query = map({
70
+ nextToken: [, input.nextToken],
71
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
72
+ });
91
73
  let body;
92
74
  return new protocol_http_1.HttpRequest({
93
75
  protocol,
@@ -134,16 +116,7 @@ const serializeAws_restJson1UpdateReportDefinitionCommand = async (input, contex
134
116
  "content-type": "application/json",
135
117
  };
136
118
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/reportDefinition/{reportId}";
137
- if (input.reportId !== undefined) {
138
- const labelValue = input.reportId;
139
- if (labelValue.length <= 0) {
140
- throw new Error("Empty value provided for input HTTP label: reportId.");
141
- }
142
- resolvedPath = resolvedPath.replace("{reportId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
143
- }
144
- else {
145
- throw new Error("No value provided for input HTTP label: reportId.");
146
- }
119
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "reportId", () => input.reportId, "{reportId}", false);
147
120
  let body;
148
121
  body = JSON.stringify({
149
122
  ...(input.destinationS3Location != null && {
@@ -168,15 +141,14 @@ const deserializeAws_restJson1DeleteReportDefinitionCommand = async (output, con
168
141
  if (output.statusCode !== 200 && output.statusCode >= 300) {
169
142
  return deserializeAws_restJson1DeleteReportDefinitionCommandError(output, context);
170
143
  }
171
- const contents = {
144
+ const contents = map({
172
145
  $metadata: deserializeMetadata(output),
173
- reportId: undefined,
174
- };
146
+ });
175
147
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
176
- if (data.reportId !== undefined && data.reportId !== null) {
148
+ if (data.reportId != null) {
177
149
  contents.reportId = (0, smithy_client_1.expectString)(data.reportId);
178
150
  }
179
- return Promise.resolve(contents);
151
+ return contents;
180
152
  };
181
153
  exports.deserializeAws_restJson1DeleteReportDefinitionCommand = deserializeAws_restJson1DeleteReportDefinitionCommand;
182
154
  const deserializeAws_restJson1DeleteReportDefinitionCommandError = async (output, context) => {
@@ -184,7 +156,6 @@ const deserializeAws_restJson1DeleteReportDefinitionCommandError = async (output
184
156
  ...output,
185
157
  body: await parseBody(output.body, context),
186
158
  };
187
- let response;
188
159
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
189
160
  switch (errorCode) {
190
161
  case "AccessDeniedException":
@@ -201,53 +172,44 @@ const deserializeAws_restJson1DeleteReportDefinitionCommandError = async (output
201
172
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
202
173
  default:
203
174
  const parsedBody = parsedOutput.body;
204
- const $metadata = deserializeMetadata(output);
205
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
206
- response = new ApplicationCostProfilerServiceException_1.ApplicationCostProfilerServiceException({
207
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
208
- $fault: "client",
209
- $metadata,
175
+ (0, smithy_client_1.throwDefaultError)({
176
+ output,
177
+ parsedBody,
178
+ exceptionCtor: ApplicationCostProfilerServiceException_1.ApplicationCostProfilerServiceException,
179
+ errorCode,
210
180
  });
211
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
212
181
  }
213
182
  };
214
183
  const deserializeAws_restJson1GetReportDefinitionCommand = async (output, context) => {
215
184
  if (output.statusCode !== 200 && output.statusCode >= 300) {
216
185
  return deserializeAws_restJson1GetReportDefinitionCommandError(output, context);
217
186
  }
218
- const contents = {
187
+ const contents = map({
219
188
  $metadata: deserializeMetadata(output),
220
- createdAt: undefined,
221
- destinationS3Location: undefined,
222
- format: undefined,
223
- lastUpdated: undefined,
224
- reportDescription: undefined,
225
- reportFrequency: undefined,
226
- reportId: undefined,
227
- };
189
+ });
228
190
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
229
- if (data.createdAt !== undefined && data.createdAt !== null) {
191
+ if (data.createdAt != null) {
230
192
  contents.createdAt = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.createdAt)));
231
193
  }
232
- if (data.destinationS3Location !== undefined && data.destinationS3Location !== null) {
194
+ if (data.destinationS3Location != null) {
233
195
  contents.destinationS3Location = deserializeAws_restJson1S3Location(data.destinationS3Location, context);
234
196
  }
235
- if (data.format !== undefined && data.format !== null) {
197
+ if (data.format != null) {
236
198
  contents.format = (0, smithy_client_1.expectString)(data.format);
237
199
  }
238
- if (data.lastUpdated !== undefined && data.lastUpdated !== null) {
200
+ if (data.lastUpdated != null) {
239
201
  contents.lastUpdated = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.lastUpdated)));
240
202
  }
241
- if (data.reportDescription !== undefined && data.reportDescription !== null) {
203
+ if (data.reportDescription != null) {
242
204
  contents.reportDescription = (0, smithy_client_1.expectString)(data.reportDescription);
243
205
  }
244
- if (data.reportFrequency !== undefined && data.reportFrequency !== null) {
206
+ if (data.reportFrequency != null) {
245
207
  contents.reportFrequency = (0, smithy_client_1.expectString)(data.reportFrequency);
246
208
  }
247
- if (data.reportId !== undefined && data.reportId !== null) {
209
+ if (data.reportId != null) {
248
210
  contents.reportId = (0, smithy_client_1.expectString)(data.reportId);
249
211
  }
250
- return Promise.resolve(contents);
212
+ return contents;
251
213
  };
252
214
  exports.deserializeAws_restJson1GetReportDefinitionCommand = deserializeAws_restJson1GetReportDefinitionCommand;
253
215
  const deserializeAws_restJson1GetReportDefinitionCommandError = async (output, context) => {
@@ -255,7 +217,6 @@ const deserializeAws_restJson1GetReportDefinitionCommandError = async (output, c
255
217
  ...output,
256
218
  body: await parseBody(output.body, context),
257
219
  };
258
- let response;
259
220
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
260
221
  switch (errorCode) {
261
222
  case "AccessDeniedException":
@@ -272,29 +233,26 @@ const deserializeAws_restJson1GetReportDefinitionCommandError = async (output, c
272
233
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
273
234
  default:
274
235
  const parsedBody = parsedOutput.body;
275
- const $metadata = deserializeMetadata(output);
276
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
277
- response = new ApplicationCostProfilerServiceException_1.ApplicationCostProfilerServiceException({
278
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
279
- $fault: "client",
280
- $metadata,
236
+ (0, smithy_client_1.throwDefaultError)({
237
+ output,
238
+ parsedBody,
239
+ exceptionCtor: ApplicationCostProfilerServiceException_1.ApplicationCostProfilerServiceException,
240
+ errorCode,
281
241
  });
282
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
283
242
  }
284
243
  };
285
244
  const deserializeAws_restJson1ImportApplicationUsageCommand = async (output, context) => {
286
245
  if (output.statusCode !== 200 && output.statusCode >= 300) {
287
246
  return deserializeAws_restJson1ImportApplicationUsageCommandError(output, context);
288
247
  }
289
- const contents = {
248
+ const contents = map({
290
249
  $metadata: deserializeMetadata(output),
291
- importId: undefined,
292
- };
250
+ });
293
251
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
294
- if (data.importId !== undefined && data.importId !== null) {
252
+ if (data.importId != null) {
295
253
  contents.importId = (0, smithy_client_1.expectString)(data.importId);
296
254
  }
297
- return Promise.resolve(contents);
255
+ return contents;
298
256
  };
299
257
  exports.deserializeAws_restJson1ImportApplicationUsageCommand = deserializeAws_restJson1ImportApplicationUsageCommand;
300
258
  const deserializeAws_restJson1ImportApplicationUsageCommandError = async (output, context) => {
@@ -302,7 +260,6 @@ const deserializeAws_restJson1ImportApplicationUsageCommandError = async (output
302
260
  ...output,
303
261
  body: await parseBody(output.body, context),
304
262
  };
305
- let response;
306
263
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
307
264
  switch (errorCode) {
308
265
  case "AccessDeniedException":
@@ -319,33 +276,29 @@ const deserializeAws_restJson1ImportApplicationUsageCommandError = async (output
319
276
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
320
277
  default:
321
278
  const parsedBody = parsedOutput.body;
322
- const $metadata = deserializeMetadata(output);
323
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
324
- response = new ApplicationCostProfilerServiceException_1.ApplicationCostProfilerServiceException({
325
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
326
- $fault: "client",
327
- $metadata,
279
+ (0, smithy_client_1.throwDefaultError)({
280
+ output,
281
+ parsedBody,
282
+ exceptionCtor: ApplicationCostProfilerServiceException_1.ApplicationCostProfilerServiceException,
283
+ errorCode,
328
284
  });
329
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
330
285
  }
331
286
  };
332
287
  const deserializeAws_restJson1ListReportDefinitionsCommand = async (output, context) => {
333
288
  if (output.statusCode !== 200 && output.statusCode >= 300) {
334
289
  return deserializeAws_restJson1ListReportDefinitionsCommandError(output, context);
335
290
  }
336
- const contents = {
291
+ const contents = map({
337
292
  $metadata: deserializeMetadata(output),
338
- nextToken: undefined,
339
- reportDefinitions: undefined,
340
- };
293
+ });
341
294
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
342
- if (data.nextToken !== undefined && data.nextToken !== null) {
295
+ if (data.nextToken != null) {
343
296
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
344
297
  }
345
- if (data.reportDefinitions !== undefined && data.reportDefinitions !== null) {
298
+ if (data.reportDefinitions != null) {
346
299
  contents.reportDefinitions = deserializeAws_restJson1ReportDefinitionList(data.reportDefinitions, context);
347
300
  }
348
- return Promise.resolve(contents);
301
+ return contents;
349
302
  };
350
303
  exports.deserializeAws_restJson1ListReportDefinitionsCommand = deserializeAws_restJson1ListReportDefinitionsCommand;
351
304
  const deserializeAws_restJson1ListReportDefinitionsCommandError = async (output, context) => {
@@ -353,7 +306,6 @@ const deserializeAws_restJson1ListReportDefinitionsCommandError = async (output,
353
306
  ...output,
354
307
  body: await parseBody(output.body, context),
355
308
  };
356
- let response;
357
309
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
358
310
  switch (errorCode) {
359
311
  case "AccessDeniedException":
@@ -370,29 +322,26 @@ const deserializeAws_restJson1ListReportDefinitionsCommandError = async (output,
370
322
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
371
323
  default:
372
324
  const parsedBody = parsedOutput.body;
373
- const $metadata = deserializeMetadata(output);
374
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
375
- response = new ApplicationCostProfilerServiceException_1.ApplicationCostProfilerServiceException({
376
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
377
- $fault: "client",
378
- $metadata,
325
+ (0, smithy_client_1.throwDefaultError)({
326
+ output,
327
+ parsedBody,
328
+ exceptionCtor: ApplicationCostProfilerServiceException_1.ApplicationCostProfilerServiceException,
329
+ errorCode,
379
330
  });
380
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
381
331
  }
382
332
  };
383
333
  const deserializeAws_restJson1PutReportDefinitionCommand = async (output, context) => {
384
334
  if (output.statusCode !== 200 && output.statusCode >= 300) {
385
335
  return deserializeAws_restJson1PutReportDefinitionCommandError(output, context);
386
336
  }
387
- const contents = {
337
+ const contents = map({
388
338
  $metadata: deserializeMetadata(output),
389
- reportId: undefined,
390
- };
339
+ });
391
340
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
392
- if (data.reportId !== undefined && data.reportId !== null) {
341
+ if (data.reportId != null) {
393
342
  contents.reportId = (0, smithy_client_1.expectString)(data.reportId);
394
343
  }
395
- return Promise.resolve(contents);
344
+ return contents;
396
345
  };
397
346
  exports.deserializeAws_restJson1PutReportDefinitionCommand = deserializeAws_restJson1PutReportDefinitionCommand;
398
347
  const deserializeAws_restJson1PutReportDefinitionCommandError = async (output, context) => {
@@ -400,7 +349,6 @@ const deserializeAws_restJson1PutReportDefinitionCommandError = async (output, c
400
349
  ...output,
401
350
  body: await parseBody(output.body, context),
402
351
  };
403
- let response;
404
352
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
405
353
  switch (errorCode) {
406
354
  case "AccessDeniedException":
@@ -420,29 +368,26 @@ const deserializeAws_restJson1PutReportDefinitionCommandError = async (output, c
420
368
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
421
369
  default:
422
370
  const parsedBody = parsedOutput.body;
423
- const $metadata = deserializeMetadata(output);
424
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
425
- response = new ApplicationCostProfilerServiceException_1.ApplicationCostProfilerServiceException({
426
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
427
- $fault: "client",
428
- $metadata,
371
+ (0, smithy_client_1.throwDefaultError)({
372
+ output,
373
+ parsedBody,
374
+ exceptionCtor: ApplicationCostProfilerServiceException_1.ApplicationCostProfilerServiceException,
375
+ errorCode,
429
376
  });
430
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
431
377
  }
432
378
  };
433
379
  const deserializeAws_restJson1UpdateReportDefinitionCommand = async (output, context) => {
434
380
  if (output.statusCode !== 200 && output.statusCode >= 300) {
435
381
  return deserializeAws_restJson1UpdateReportDefinitionCommandError(output, context);
436
382
  }
437
- const contents = {
383
+ const contents = map({
438
384
  $metadata: deserializeMetadata(output),
439
- reportId: undefined,
440
- };
385
+ });
441
386
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
442
- if (data.reportId !== undefined && data.reportId !== null) {
387
+ if (data.reportId != null) {
443
388
  contents.reportId = (0, smithy_client_1.expectString)(data.reportId);
444
389
  }
445
- return Promise.resolve(contents);
390
+ return contents;
446
391
  };
447
392
  exports.deserializeAws_restJson1UpdateReportDefinitionCommand = deserializeAws_restJson1UpdateReportDefinitionCommand;
448
393
  const deserializeAws_restJson1UpdateReportDefinitionCommandError = async (output, context) => {
@@ -450,7 +395,6 @@ const deserializeAws_restJson1UpdateReportDefinitionCommandError = async (output
450
395
  ...output,
451
396
  body: await parseBody(output.body, context),
452
397
  };
453
- let response;
454
398
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
455
399
  switch (errorCode) {
456
400
  case "AccessDeniedException":
@@ -467,20 +411,19 @@ const deserializeAws_restJson1UpdateReportDefinitionCommandError = async (output
467
411
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
468
412
  default:
469
413
  const parsedBody = parsedOutput.body;
470
- const $metadata = deserializeMetadata(output);
471
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
472
- response = new ApplicationCostProfilerServiceException_1.ApplicationCostProfilerServiceException({
473
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
474
- $fault: "client",
475
- $metadata,
414
+ (0, smithy_client_1.throwDefaultError)({
415
+ output,
416
+ parsedBody,
417
+ exceptionCtor: ApplicationCostProfilerServiceException_1.ApplicationCostProfilerServiceException,
418
+ errorCode,
476
419
  });
477
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
478
420
  }
479
421
  };
422
+ const map = smithy_client_1.map;
480
423
  const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
481
- const contents = {};
424
+ const contents = map({});
482
425
  const data = parsedOutput.body;
483
- if (data.message !== undefined && data.message !== null) {
426
+ if (data.message != null) {
484
427
  contents.message = (0, smithy_client_1.expectString)(data.message);
485
428
  }
486
429
  const exception = new models_0_1.AccessDeniedException({
@@ -490,9 +433,9 @@ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutpu
490
433
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
491
434
  };
492
435
  const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
493
- const contents = {};
436
+ const contents = map({});
494
437
  const data = parsedOutput.body;
495
- if (data.message !== undefined && data.message !== null) {
438
+ if (data.message != null) {
496
439
  contents.message = (0, smithy_client_1.expectString)(data.message);
497
440
  }
498
441
  const exception = new models_0_1.InternalServerException({
@@ -502,9 +445,9 @@ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOut
502
445
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
503
446
  };
504
447
  const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
505
- const contents = {};
448
+ const contents = map({});
506
449
  const data = parsedOutput.body;
507
- if (data.message !== undefined && data.message !== null) {
450
+ if (data.message != null) {
508
451
  contents.message = (0, smithy_client_1.expectString)(data.message);
509
452
  }
510
453
  const exception = new models_0_1.ServiceQuotaExceededException({
@@ -514,9 +457,9 @@ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (par
514
457
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
515
458
  };
516
459
  const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
517
- const contents = {};
460
+ const contents = map({});
518
461
  const data = parsedOutput.body;
519
- if (data.message !== undefined && data.message !== null) {
462
+ if (data.message != null) {
520
463
  contents.message = (0, smithy_client_1.expectString)(data.message);
521
464
  }
522
465
  const exception = new models_0_1.ThrottlingException({
@@ -526,9 +469,9 @@ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput,
526
469
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
527
470
  };
528
471
  const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
529
- const contents = {};
472
+ const contents = map({});
530
473
  const data = parsedOutput.body;
531
- if (data.message !== undefined && data.message !== null) {
474
+ if (data.message != null) {
532
475
  contents.message = (0, smithy_client_1.expectString)(data.message);
533
476
  }
534
477
  const exception = new models_0_1.ValidationException({
@@ -1,10 +1,10 @@
1
1
  import { __assign, __awaiter, __generator } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, parseEpochTimestamp as __parseEpochTimestamp, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map as __map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { ApplicationCostProfilerServiceException as __BaseException } from "../models/ApplicationCostProfilerServiceException";
5
5
  import { AccessDeniedException, InternalServerException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
6
6
  export var serializeAws_restJson1DeleteReportDefinitionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
7
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
8
8
  return __generator(this, function (_c) {
9
9
  switch (_c.label) {
10
10
  case 0: return [4, context.endpoint()];
@@ -12,16 +12,7 @@ export var serializeAws_restJson1DeleteReportDefinitionCommand = function (input
12
12
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
13
13
  headers = {};
14
14
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/reportDefinition/{reportId}";
15
- if (input.reportId !== undefined) {
16
- labelValue = input.reportId;
17
- if (labelValue.length <= 0) {
18
- throw new Error("Empty value provided for input HTTP label: reportId.");
19
- }
20
- resolvedPath = resolvedPath.replace("{reportId}", __extendedEncodeURIComponent(labelValue));
21
- }
22
- else {
23
- throw new Error("No value provided for input HTTP label: reportId.");
24
- }
15
+ resolvedPath = __resolvedPath(resolvedPath, input, "reportId", function () { return input.reportId; }, "{reportId}", false);
25
16
  return [2, new __HttpRequest({
26
17
  protocol: protocol,
27
18
  hostname: hostname,
@@ -35,7 +26,7 @@ export var serializeAws_restJson1DeleteReportDefinitionCommand = function (input
35
26
  });
36
27
  }); };
37
28
  export var serializeAws_restJson1GetReportDefinitionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
38
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
29
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
39
30
  return __generator(this, function (_c) {
40
31
  switch (_c.label) {
41
32
  case 0: return [4, context.endpoint()];
@@ -43,16 +34,7 @@ export var serializeAws_restJson1GetReportDefinitionCommand = function (input, c
43
34
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
44
35
  headers = {};
45
36
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/reportDefinition/{reportId}";
46
- if (input.reportId !== undefined) {
47
- labelValue = input.reportId;
48
- if (labelValue.length <= 0) {
49
- throw new Error("Empty value provided for input HTTP label: reportId.");
50
- }
51
- resolvedPath = resolvedPath.replace("{reportId}", __extendedEncodeURIComponent(labelValue));
52
- }
53
- else {
54
- throw new Error("No value provided for input HTTP label: reportId.");
55
- }
37
+ resolvedPath = __resolvedPath(resolvedPath, input, "reportId", function () { return input.reportId; }, "{reportId}", false);
56
38
  return [2, new __HttpRequest({
57
39
  protocol: protocol,
58
40
  hostname: hostname,
@@ -100,7 +82,10 @@ export var serializeAws_restJson1ListReportDefinitionsCommand = function (input,
100
82
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
101
83
  headers = {};
102
84
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/reportDefinition";
103
- query = __assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.maxResults !== undefined && { maxResults: input.maxResults.toString() }));
85
+ query = map({
86
+ nextToken: [, input.nextToken],
87
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
88
+ });
104
89
  return [2, new __HttpRequest({
105
90
  protocol: protocol,
106
91
  hostname: hostname,
@@ -141,7 +126,7 @@ export var serializeAws_restJson1PutReportDefinitionCommand = function (input, c
141
126
  });
142
127
  }); };
143
128
  export var serializeAws_restJson1UpdateReportDefinitionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
144
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
129
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
145
130
  return __generator(this, function (_c) {
146
131
  switch (_c.label) {
147
132
  case 0: return [4, context.endpoint()];
@@ -151,16 +136,7 @@ export var serializeAws_restJson1UpdateReportDefinitionCommand = function (input
151
136
  "content-type": "application/json",
152
137
  };
153
138
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/reportDefinition/{reportId}";
154
- if (input.reportId !== undefined) {
155
- labelValue = input.reportId;
156
- if (labelValue.length <= 0) {
157
- throw new Error("Empty value provided for input HTTP label: reportId.");
158
- }
159
- resolvedPath = resolvedPath.replace("{reportId}", __extendedEncodeURIComponent(labelValue));
160
- }
161
- else {
162
- throw new Error("No value provided for input HTTP label: reportId.");
163
- }
139
+ resolvedPath = __resolvedPath(resolvedPath, input, "reportId", function () { return input.reportId; }, "{reportId}", false);
164
140
  body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.destinationS3Location != null && {
165
141
  destinationS3Location: serializeAws_restJson1S3Location(input.destinationS3Location, context),
166
142
  })), (input.format != null && { format: input.format })), (input.reportDescription != null && { reportDescription: input.reportDescription })), (input.reportFrequency != null && { reportFrequency: input.reportFrequency })));
@@ -184,24 +160,23 @@ export var deserializeAws_restJson1DeleteReportDefinitionCommand = function (out
184
160
  if (output.statusCode !== 200 && output.statusCode >= 300) {
185
161
  return [2, deserializeAws_restJson1DeleteReportDefinitionCommandError(output, context)];
186
162
  }
187
- contents = {
163
+ contents = map({
188
164
  $metadata: deserializeMetadata(output),
189
- reportId: undefined,
190
- };
165
+ });
191
166
  _a = __expectNonNull;
192
167
  _b = __expectObject;
193
168
  return [4, parseBody(output.body, context)];
194
169
  case 1:
195
170
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
196
- if (data.reportId !== undefined && data.reportId !== null) {
171
+ if (data.reportId != null) {
197
172
  contents.reportId = __expectString(data.reportId);
198
173
  }
199
- return [2, Promise.resolve(contents)];
174
+ return [2, contents];
200
175
  }
201
176
  });
202
177
  }); };
203
178
  var deserializeAws_restJson1DeleteReportDefinitionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
204
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
179
+ var parsedOutput, _a, errorCode, _b, parsedBody;
205
180
  var _c;
206
181
  return __generator(this, function (_d) {
207
182
  switch (_d.label) {
@@ -234,14 +209,14 @@ var deserializeAws_restJson1DeleteReportDefinitionCommandError = function (outpu
234
209
  case 9: throw _d.sent();
235
210
  case 10:
236
211
  parsedBody = parsedOutput.body;
237
- $metadata = deserializeMetadata(output);
238
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
239
- response = new __BaseException({
240
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
241
- $fault: "client",
242
- $metadata: $metadata,
212
+ throwDefaultError({
213
+ output: output,
214
+ parsedBody: parsedBody,
215
+ exceptionCtor: __BaseException,
216
+ errorCode: errorCode,
243
217
  });
244
- throw __decorateServiceException(response, parsedBody);
218
+ _d.label = 11;
219
+ case 11: return [2];
245
220
  }
246
221
  });
247
222
  }); };
@@ -253,48 +228,41 @@ export var deserializeAws_restJson1GetReportDefinitionCommand = function (output
253
228
  if (output.statusCode !== 200 && output.statusCode >= 300) {
254
229
  return [2, deserializeAws_restJson1GetReportDefinitionCommandError(output, context)];
255
230
  }
256
- contents = {
231
+ contents = map({
257
232
  $metadata: deserializeMetadata(output),
258
- createdAt: undefined,
259
- destinationS3Location: undefined,
260
- format: undefined,
261
- lastUpdated: undefined,
262
- reportDescription: undefined,
263
- reportFrequency: undefined,
264
- reportId: undefined,
265
- };
233
+ });
266
234
  _a = __expectNonNull;
267
235
  _b = __expectObject;
268
236
  return [4, parseBody(output.body, context)];
269
237
  case 1:
270
238
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
271
- if (data.createdAt !== undefined && data.createdAt !== null) {
239
+ if (data.createdAt != null) {
272
240
  contents.createdAt = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.createdAt)));
273
241
  }
274
- if (data.destinationS3Location !== undefined && data.destinationS3Location !== null) {
242
+ if (data.destinationS3Location != null) {
275
243
  contents.destinationS3Location = deserializeAws_restJson1S3Location(data.destinationS3Location, context);
276
244
  }
277
- if (data.format !== undefined && data.format !== null) {
245
+ if (data.format != null) {
278
246
  contents.format = __expectString(data.format);
279
247
  }
280
- if (data.lastUpdated !== undefined && data.lastUpdated !== null) {
248
+ if (data.lastUpdated != null) {
281
249
  contents.lastUpdated = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.lastUpdated)));
282
250
  }
283
- if (data.reportDescription !== undefined && data.reportDescription !== null) {
251
+ if (data.reportDescription != null) {
284
252
  contents.reportDescription = __expectString(data.reportDescription);
285
253
  }
286
- if (data.reportFrequency !== undefined && data.reportFrequency !== null) {
254
+ if (data.reportFrequency != null) {
287
255
  contents.reportFrequency = __expectString(data.reportFrequency);
288
256
  }
289
- if (data.reportId !== undefined && data.reportId !== null) {
257
+ if (data.reportId != null) {
290
258
  contents.reportId = __expectString(data.reportId);
291
259
  }
292
- return [2, Promise.resolve(contents)];
260
+ return [2, contents];
293
261
  }
294
262
  });
295
263
  }); };
296
264
  var deserializeAws_restJson1GetReportDefinitionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
297
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
265
+ var parsedOutput, _a, errorCode, _b, parsedBody;
298
266
  var _c;
299
267
  return __generator(this, function (_d) {
300
268
  switch (_d.label) {
@@ -327,14 +295,14 @@ var deserializeAws_restJson1GetReportDefinitionCommandError = function (output,
327
295
  case 9: throw _d.sent();
328
296
  case 10:
329
297
  parsedBody = parsedOutput.body;
330
- $metadata = deserializeMetadata(output);
331
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
332
- response = new __BaseException({
333
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
334
- $fault: "client",
335
- $metadata: $metadata,
298
+ throwDefaultError({
299
+ output: output,
300
+ parsedBody: parsedBody,
301
+ exceptionCtor: __BaseException,
302
+ errorCode: errorCode,
336
303
  });
337
- throw __decorateServiceException(response, parsedBody);
304
+ _d.label = 11;
305
+ case 11: return [2];
338
306
  }
339
307
  });
340
308
  }); };
@@ -346,24 +314,23 @@ export var deserializeAws_restJson1ImportApplicationUsageCommand = function (out
346
314
  if (output.statusCode !== 200 && output.statusCode >= 300) {
347
315
  return [2, deserializeAws_restJson1ImportApplicationUsageCommandError(output, context)];
348
316
  }
349
- contents = {
317
+ contents = map({
350
318
  $metadata: deserializeMetadata(output),
351
- importId: undefined,
352
- };
319
+ });
353
320
  _a = __expectNonNull;
354
321
  _b = __expectObject;
355
322
  return [4, parseBody(output.body, context)];
356
323
  case 1:
357
324
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
358
- if (data.importId !== undefined && data.importId !== null) {
325
+ if (data.importId != null) {
359
326
  contents.importId = __expectString(data.importId);
360
327
  }
361
- return [2, Promise.resolve(contents)];
328
+ return [2, contents];
362
329
  }
363
330
  });
364
331
  }); };
365
332
  var deserializeAws_restJson1ImportApplicationUsageCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
366
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
333
+ var parsedOutput, _a, errorCode, _b, parsedBody;
367
334
  var _c;
368
335
  return __generator(this, function (_d) {
369
336
  switch (_d.label) {
@@ -396,14 +363,14 @@ var deserializeAws_restJson1ImportApplicationUsageCommandError = function (outpu
396
363
  case 9: throw _d.sent();
397
364
  case 10:
398
365
  parsedBody = parsedOutput.body;
399
- $metadata = deserializeMetadata(output);
400
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
401
- response = new __BaseException({
402
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
403
- $fault: "client",
404
- $metadata: $metadata,
366
+ throwDefaultError({
367
+ output: output,
368
+ parsedBody: parsedBody,
369
+ exceptionCtor: __BaseException,
370
+ errorCode: errorCode,
405
371
  });
406
- throw __decorateServiceException(response, parsedBody);
372
+ _d.label = 11;
373
+ case 11: return [2];
407
374
  }
408
375
  });
409
376
  }); };
@@ -415,28 +382,26 @@ export var deserializeAws_restJson1ListReportDefinitionsCommand = function (outp
415
382
  if (output.statusCode !== 200 && output.statusCode >= 300) {
416
383
  return [2, deserializeAws_restJson1ListReportDefinitionsCommandError(output, context)];
417
384
  }
418
- contents = {
385
+ contents = map({
419
386
  $metadata: deserializeMetadata(output),
420
- nextToken: undefined,
421
- reportDefinitions: undefined,
422
- };
387
+ });
423
388
  _a = __expectNonNull;
424
389
  _b = __expectObject;
425
390
  return [4, parseBody(output.body, context)];
426
391
  case 1:
427
392
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
428
- if (data.nextToken !== undefined && data.nextToken !== null) {
393
+ if (data.nextToken != null) {
429
394
  contents.nextToken = __expectString(data.nextToken);
430
395
  }
431
- if (data.reportDefinitions !== undefined && data.reportDefinitions !== null) {
396
+ if (data.reportDefinitions != null) {
432
397
  contents.reportDefinitions = deserializeAws_restJson1ReportDefinitionList(data.reportDefinitions, context);
433
398
  }
434
- return [2, Promise.resolve(contents)];
399
+ return [2, contents];
435
400
  }
436
401
  });
437
402
  }); };
438
403
  var deserializeAws_restJson1ListReportDefinitionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
439
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
404
+ var parsedOutput, _a, errorCode, _b, parsedBody;
440
405
  var _c;
441
406
  return __generator(this, function (_d) {
442
407
  switch (_d.label) {
@@ -469,14 +434,14 @@ var deserializeAws_restJson1ListReportDefinitionsCommandError = function (output
469
434
  case 9: throw _d.sent();
470
435
  case 10:
471
436
  parsedBody = parsedOutput.body;
472
- $metadata = deserializeMetadata(output);
473
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
474
- response = new __BaseException({
475
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
476
- $fault: "client",
477
- $metadata: $metadata,
437
+ throwDefaultError({
438
+ output: output,
439
+ parsedBody: parsedBody,
440
+ exceptionCtor: __BaseException,
441
+ errorCode: errorCode,
478
442
  });
479
- throw __decorateServiceException(response, parsedBody);
443
+ _d.label = 11;
444
+ case 11: return [2];
480
445
  }
481
446
  });
482
447
  }); };
@@ -488,24 +453,23 @@ export var deserializeAws_restJson1PutReportDefinitionCommand = function (output
488
453
  if (output.statusCode !== 200 && output.statusCode >= 300) {
489
454
  return [2, deserializeAws_restJson1PutReportDefinitionCommandError(output, context)];
490
455
  }
491
- contents = {
456
+ contents = map({
492
457
  $metadata: deserializeMetadata(output),
493
- reportId: undefined,
494
- };
458
+ });
495
459
  _a = __expectNonNull;
496
460
  _b = __expectObject;
497
461
  return [4, parseBody(output.body, context)];
498
462
  case 1:
499
463
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
500
- if (data.reportId !== undefined && data.reportId !== null) {
464
+ if (data.reportId != null) {
501
465
  contents.reportId = __expectString(data.reportId);
502
466
  }
503
- return [2, Promise.resolve(contents)];
467
+ return [2, contents];
504
468
  }
505
469
  });
506
470
  }); };
507
471
  var deserializeAws_restJson1PutReportDefinitionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
508
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
472
+ var parsedOutput, _a, errorCode, _b, parsedBody;
509
473
  var _c;
510
474
  return __generator(this, function (_d) {
511
475
  switch (_d.label) {
@@ -542,14 +506,14 @@ var deserializeAws_restJson1PutReportDefinitionCommandError = function (output,
542
506
  case 11: throw _d.sent();
543
507
  case 12:
544
508
  parsedBody = parsedOutput.body;
545
- $metadata = deserializeMetadata(output);
546
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
547
- response = new __BaseException({
548
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
549
- $fault: "client",
550
- $metadata: $metadata,
509
+ throwDefaultError({
510
+ output: output,
511
+ parsedBody: parsedBody,
512
+ exceptionCtor: __BaseException,
513
+ errorCode: errorCode,
551
514
  });
552
- throw __decorateServiceException(response, parsedBody);
515
+ _d.label = 13;
516
+ case 13: return [2];
553
517
  }
554
518
  });
555
519
  }); };
@@ -561,24 +525,23 @@ export var deserializeAws_restJson1UpdateReportDefinitionCommand = function (out
561
525
  if (output.statusCode !== 200 && output.statusCode >= 300) {
562
526
  return [2, deserializeAws_restJson1UpdateReportDefinitionCommandError(output, context)];
563
527
  }
564
- contents = {
528
+ contents = map({
565
529
  $metadata: deserializeMetadata(output),
566
- reportId: undefined,
567
- };
530
+ });
568
531
  _a = __expectNonNull;
569
532
  _b = __expectObject;
570
533
  return [4, parseBody(output.body, context)];
571
534
  case 1:
572
535
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
573
- if (data.reportId !== undefined && data.reportId !== null) {
536
+ if (data.reportId != null) {
574
537
  contents.reportId = __expectString(data.reportId);
575
538
  }
576
- return [2, Promise.resolve(contents)];
539
+ return [2, contents];
577
540
  }
578
541
  });
579
542
  }); };
580
543
  var deserializeAws_restJson1UpdateReportDefinitionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
581
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
544
+ var parsedOutput, _a, errorCode, _b, parsedBody;
582
545
  var _c;
583
546
  return __generator(this, function (_d) {
584
547
  switch (_d.label) {
@@ -611,23 +574,24 @@ var deserializeAws_restJson1UpdateReportDefinitionCommandError = function (outpu
611
574
  case 9: throw _d.sent();
612
575
  case 10:
613
576
  parsedBody = parsedOutput.body;
614
- $metadata = deserializeMetadata(output);
615
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
616
- response = new __BaseException({
617
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
618
- $fault: "client",
619
- $metadata: $metadata,
577
+ throwDefaultError({
578
+ output: output,
579
+ parsedBody: parsedBody,
580
+ exceptionCtor: __BaseException,
581
+ errorCode: errorCode,
620
582
  });
621
- throw __decorateServiceException(response, parsedBody);
583
+ _d.label = 11;
584
+ case 11: return [2];
622
585
  }
623
586
  });
624
587
  }); };
588
+ var map = __map;
625
589
  var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
626
590
  var contents, data, exception;
627
591
  return __generator(this, function (_a) {
628
- contents = {};
592
+ contents = map({});
629
593
  data = parsedOutput.body;
630
- if (data.message !== undefined && data.message !== null) {
594
+ if (data.message != null) {
631
595
  contents.message = __expectString(data.message);
632
596
  }
633
597
  exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -637,9 +601,9 @@ var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutp
637
601
  var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
638
602
  var contents, data, exception;
639
603
  return __generator(this, function (_a) {
640
- contents = {};
604
+ contents = map({});
641
605
  data = parsedOutput.body;
642
- if (data.message !== undefined && data.message !== null) {
606
+ if (data.message != null) {
643
607
  contents.message = __expectString(data.message);
644
608
  }
645
609
  exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -649,9 +613,9 @@ var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOu
649
613
  var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
650
614
  var contents, data, exception;
651
615
  return __generator(this, function (_a) {
652
- contents = {};
616
+ contents = map({});
653
617
  data = parsedOutput.body;
654
- if (data.message !== undefined && data.message !== null) {
618
+ if (data.message != null) {
655
619
  contents.message = __expectString(data.message);
656
620
  }
657
621
  exception = new ServiceQuotaExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -661,9 +625,9 @@ var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (pa
661
625
  var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
662
626
  var contents, data, exception;
663
627
  return __generator(this, function (_a) {
664
- contents = {};
628
+ contents = map({});
665
629
  data = parsedOutput.body;
666
- if (data.message !== undefined && data.message !== null) {
630
+ if (data.message != null) {
667
631
  contents.message = __expectString(data.message);
668
632
  }
669
633
  exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -673,9 +637,9 @@ var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput
673
637
  var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
674
638
  var contents, data, exception;
675
639
  return __generator(this, function (_a) {
676
- contents = {};
640
+ contents = map({});
677
641
  data = parsedOutput.body;
678
- if (data.message !== undefined && data.message !== null) {
642
+ if (data.message != null) {
679
643
  contents.message = __expectString(data.message);
680
644
  }
681
645
  exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-applicationcostprofiler",
3
3
  "description": "AWS SDK for JavaScript Applicationcostprofiler Client for Node.js, Browser and React Native",
4
- "version": "3.141.0",
4
+ "version": "3.142.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -18,9 +18,9 @@
18
18
  "dependencies": {
19
19
  "@aws-crypto/sha256-browser": "2.0.0",
20
20
  "@aws-crypto/sha256-js": "2.0.0",
21
- "@aws-sdk/client-sts": "3.141.0",
21
+ "@aws-sdk/client-sts": "3.142.0",
22
22
  "@aws-sdk/config-resolver": "3.130.0",
23
- "@aws-sdk/credential-provider-node": "3.141.0",
23
+ "@aws-sdk/credential-provider-node": "3.142.0",
24
24
  "@aws-sdk/fetch-http-handler": "3.131.0",
25
25
  "@aws-sdk/hash-node": "3.127.0",
26
26
  "@aws-sdk/invalid-dependency": "3.127.0",
@@ -36,15 +36,15 @@
36
36
  "@aws-sdk/node-config-provider": "3.127.0",
37
37
  "@aws-sdk/node-http-handler": "3.127.0",
38
38
  "@aws-sdk/protocol-http": "3.127.0",
39
- "@aws-sdk/smithy-client": "3.137.0",
39
+ "@aws-sdk/smithy-client": "3.142.0",
40
40
  "@aws-sdk/types": "3.127.0",
41
41
  "@aws-sdk/url-parser": "3.127.0",
42
42
  "@aws-sdk/util-base64-browser": "3.109.0",
43
43
  "@aws-sdk/util-base64-node": "3.55.0",
44
44
  "@aws-sdk/util-body-length-browser": "3.55.0",
45
45
  "@aws-sdk/util-body-length-node": "3.55.0",
46
- "@aws-sdk/util-defaults-mode-browser": "3.137.0",
47
- "@aws-sdk/util-defaults-mode-node": "3.137.0",
46
+ "@aws-sdk/util-defaults-mode-browser": "3.142.0",
47
+ "@aws-sdk/util-defaults-mode-node": "3.142.0",
48
48
  "@aws-sdk/util-user-agent-browser": "3.127.0",
49
49
  "@aws-sdk/util-user-agent-node": "3.127.0",
50
50
  "@aws-sdk/util-utf8-browser": "3.109.0",