@aws-sdk/client-codeguruprofiler 3.141.0 → 3.150.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.
@@ -12,16 +12,7 @@ const serializeAws_restJson1AddNotificationChannelsCommand = async (input, conte
12
12
  };
13
13
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
14
14
  "/profilingGroups/{profilingGroupName}/notificationConfiguration";
15
- if (input.profilingGroupName !== undefined) {
16
- const labelValue = input.profilingGroupName;
17
- if (labelValue.length <= 0) {
18
- throw new Error("Empty value provided for input HTTP label: profilingGroupName.");
19
- }
20
- resolvedPath = resolvedPath.replace("{profilingGroupName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
21
- }
22
- else {
23
- throw new Error("No value provided for input HTTP label: profilingGroupName.");
24
- }
15
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "profilingGroupName", () => input.profilingGroupName, "{profilingGroupName}", false);
25
16
  let body;
26
17
  body = JSON.stringify({
27
18
  ...(input.channels != null && { channels: serializeAws_restJson1Channels(input.channels, context) }),
@@ -44,22 +35,16 @@ const serializeAws_restJson1BatchGetFrameMetricDataCommand = async (input, conte
44
35
  };
45
36
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
46
37
  "/profilingGroups/{profilingGroupName}/frames/-/metrics";
47
- if (input.profilingGroupName !== undefined) {
48
- const labelValue = input.profilingGroupName;
49
- if (labelValue.length <= 0) {
50
- throw new Error("Empty value provided for input HTTP label: profilingGroupName.");
51
- }
52
- resolvedPath = resolvedPath.replace("{profilingGroupName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
53
- }
54
- else {
55
- throw new Error("No value provided for input HTTP label: profilingGroupName.");
56
- }
57
- const query = {
58
- ...(input.startTime !== undefined && { startTime: (input.startTime.toISOString().split(".")[0] + "Z").toString() }),
59
- ...(input.endTime !== undefined && { endTime: (input.endTime.toISOString().split(".")[0] + "Z").toString() }),
60
- ...(input.period !== undefined && { period: input.period }),
61
- ...(input.targetResolution !== undefined && { targetResolution: input.targetResolution }),
62
- };
38
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "profilingGroupName", () => input.profilingGroupName, "{profilingGroupName}", false);
39
+ const query = map({
40
+ startTime: [
41
+ () => input.startTime !== void 0,
42
+ () => (input.startTime.toISOString().split(".")[0] + "Z").toString(),
43
+ ],
44
+ endTime: [() => input.endTime !== void 0, () => (input.endTime.toISOString().split(".")[0] + "Z").toString()],
45
+ period: [, input.period],
46
+ targetResolution: [, input.targetResolution],
47
+ });
63
48
  let body;
64
49
  body = JSON.stringify({
65
50
  ...(input.frameMetrics != null && {
@@ -85,16 +70,7 @@ const serializeAws_restJson1ConfigureAgentCommand = async (input, context) => {
85
70
  };
86
71
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
87
72
  "/profilingGroups/{profilingGroupName}/configureAgent";
88
- if (input.profilingGroupName !== undefined) {
89
- const labelValue = input.profilingGroupName;
90
- if (labelValue.length <= 0) {
91
- throw new Error("Empty value provided for input HTTP label: profilingGroupName.");
92
- }
93
- resolvedPath = resolvedPath.replace("{profilingGroupName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
94
- }
95
- else {
96
- throw new Error("No value provided for input HTTP label: profilingGroupName.");
97
- }
73
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "profilingGroupName", () => input.profilingGroupName, "{profilingGroupName}", false);
98
74
  let body;
99
75
  body = JSON.stringify({
100
76
  ...(input.fleetInstanceId != null && { fleetInstanceId: input.fleetInstanceId }),
@@ -117,9 +93,9 @@ const serializeAws_restJson1CreateProfilingGroupCommand = async (input, context)
117
93
  "content-type": "application/json",
118
94
  };
119
95
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/profilingGroups";
120
- const query = {
121
- ...(input.clientToken !== undefined && { clientToken: input.clientToken }),
122
- };
96
+ const query = map({
97
+ clientToken: [, input.clientToken],
98
+ });
123
99
  let body;
124
100
  body = JSON.stringify({
125
101
  ...(input.agentOrchestrationConfig != null && {
@@ -145,16 +121,7 @@ const serializeAws_restJson1DeleteProfilingGroupCommand = async (input, context)
145
121
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
146
122
  const headers = {};
147
123
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/profilingGroups/{profilingGroupName}";
148
- if (input.profilingGroupName !== undefined) {
149
- const labelValue = input.profilingGroupName;
150
- if (labelValue.length <= 0) {
151
- throw new Error("Empty value provided for input HTTP label: profilingGroupName.");
152
- }
153
- resolvedPath = resolvedPath.replace("{profilingGroupName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
154
- }
155
- else {
156
- throw new Error("No value provided for input HTTP label: profilingGroupName.");
157
- }
124
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "profilingGroupName", () => input.profilingGroupName, "{profilingGroupName}", false);
158
125
  let body;
159
126
  return new protocol_http_1.HttpRequest({
160
127
  protocol,
@@ -171,16 +138,7 @@ const serializeAws_restJson1DescribeProfilingGroupCommand = async (input, contex
171
138
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
172
139
  const headers = {};
173
140
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/profilingGroups/{profilingGroupName}";
174
- if (input.profilingGroupName !== undefined) {
175
- const labelValue = input.profilingGroupName;
176
- if (labelValue.length <= 0) {
177
- throw new Error("Empty value provided for input HTTP label: profilingGroupName.");
178
- }
179
- resolvedPath = resolvedPath.replace("{profilingGroupName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
180
- }
181
- else {
182
- throw new Error("No value provided for input HTTP label: profilingGroupName.");
183
- }
141
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "profilingGroupName", () => input.profilingGroupName, "{profilingGroupName}", false);
184
142
  let body;
185
143
  return new protocol_http_1.HttpRequest({
186
144
  protocol,
@@ -197,11 +155,11 @@ const serializeAws_restJson1GetFindingsReportAccountSummaryCommand = async (inpu
197
155
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
198
156
  const headers = {};
199
157
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/internal/findingsReports";
200
- const query = {
201
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
202
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
203
- ...(input.dailyReportsOnly !== undefined && { dailyReportsOnly: input.dailyReportsOnly.toString() }),
204
- };
158
+ const query = map({
159
+ nextToken: [, input.nextToken],
160
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
161
+ dailyReportsOnly: [() => input.dailyReportsOnly !== void 0, () => input.dailyReportsOnly.toString()],
162
+ });
205
163
  let body;
206
164
  return new protocol_http_1.HttpRequest({
207
165
  protocol,
@@ -220,16 +178,7 @@ const serializeAws_restJson1GetNotificationConfigurationCommand = async (input,
220
178
  const headers = {};
221
179
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
222
180
  "/profilingGroups/{profilingGroupName}/notificationConfiguration";
223
- if (input.profilingGroupName !== undefined) {
224
- const labelValue = input.profilingGroupName;
225
- if (labelValue.length <= 0) {
226
- throw new Error("Empty value provided for input HTTP label: profilingGroupName.");
227
- }
228
- resolvedPath = resolvedPath.replace("{profilingGroupName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
229
- }
230
- else {
231
- throw new Error("No value provided for input HTTP label: profilingGroupName.");
232
- }
181
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "profilingGroupName", () => input.profilingGroupName, "{profilingGroupName}", false);
233
182
  let body;
234
183
  return new protocol_http_1.HttpRequest({
235
184
  protocol,
@@ -247,16 +196,7 @@ const serializeAws_restJson1GetPolicyCommand = async (input, context) => {
247
196
  const headers = {};
248
197
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
249
198
  "/profilingGroups/{profilingGroupName}/policy";
250
- if (input.profilingGroupName !== undefined) {
251
- const labelValue = input.profilingGroupName;
252
- if (labelValue.length <= 0) {
253
- throw new Error("Empty value provided for input HTTP label: profilingGroupName.");
254
- }
255
- resolvedPath = resolvedPath.replace("{profilingGroupName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
256
- }
257
- else {
258
- throw new Error("No value provided for input HTTP label: profilingGroupName.");
259
- }
199
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "profilingGroupName", () => input.profilingGroupName, "{profilingGroupName}", false);
260
200
  let body;
261
201
  return new protocol_http_1.HttpRequest({
262
202
  protocol,
@@ -271,27 +211,21 @@ const serializeAws_restJson1GetPolicyCommand = async (input, context) => {
271
211
  exports.serializeAws_restJson1GetPolicyCommand = serializeAws_restJson1GetPolicyCommand;
272
212
  const serializeAws_restJson1GetProfileCommand = async (input, context) => {
273
213
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
274
- const headers = {
275
- ...(isSerializableHeaderValue(input.accept) && { accept: input.accept }),
276
- };
214
+ const headers = map({}, isSerializableHeaderValue, {
215
+ accept: input.accept,
216
+ });
277
217
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
278
218
  "/profilingGroups/{profilingGroupName}/profile";
279
- if (input.profilingGroupName !== undefined) {
280
- const labelValue = input.profilingGroupName;
281
- if (labelValue.length <= 0) {
282
- throw new Error("Empty value provided for input HTTP label: profilingGroupName.");
283
- }
284
- resolvedPath = resolvedPath.replace("{profilingGroupName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
285
- }
286
- else {
287
- throw new Error("No value provided for input HTTP label: profilingGroupName.");
288
- }
289
- const query = {
290
- ...(input.startTime !== undefined && { startTime: (input.startTime.toISOString().split(".")[0] + "Z").toString() }),
291
- ...(input.period !== undefined && { period: input.period }),
292
- ...(input.endTime !== undefined && { endTime: (input.endTime.toISOString().split(".")[0] + "Z").toString() }),
293
- ...(input.maxDepth !== undefined && { maxDepth: input.maxDepth.toString() }),
294
- };
219
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "profilingGroupName", () => input.profilingGroupName, "{profilingGroupName}", false);
220
+ const query = map({
221
+ startTime: [
222
+ () => input.startTime !== void 0,
223
+ () => (input.startTime.toISOString().split(".")[0] + "Z").toString(),
224
+ ],
225
+ period: [, input.period],
226
+ endTime: [() => input.endTime !== void 0, () => (input.endTime.toISOString().split(".")[0] + "Z").toString()],
227
+ maxDepth: [() => input.maxDepth !== void 0, () => input.maxDepth.toString()],
228
+ });
295
229
  let body;
296
230
  return new protocol_http_1.HttpRequest({
297
231
  protocol,
@@ -310,21 +244,15 @@ const serializeAws_restJson1GetRecommendationsCommand = async (input, context) =
310
244
  const headers = {};
311
245
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
312
246
  "/internal/profilingGroups/{profilingGroupName}/recommendations";
313
- if (input.profilingGroupName !== undefined) {
314
- const labelValue = input.profilingGroupName;
315
- if (labelValue.length <= 0) {
316
- throw new Error("Empty value provided for input HTTP label: profilingGroupName.");
317
- }
318
- resolvedPath = resolvedPath.replace("{profilingGroupName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
319
- }
320
- else {
321
- throw new Error("No value provided for input HTTP label: profilingGroupName.");
322
- }
323
- const query = {
324
- ...(input.startTime !== undefined && { startTime: (input.startTime.toISOString().split(".")[0] + "Z").toString() }),
325
- ...(input.endTime !== undefined && { endTime: (input.endTime.toISOString().split(".")[0] + "Z").toString() }),
326
- ...(input.locale !== undefined && { locale: input.locale }),
327
- };
247
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "profilingGroupName", () => input.profilingGroupName, "{profilingGroupName}", false);
248
+ const query = map({
249
+ startTime: [
250
+ () => input.startTime !== void 0,
251
+ () => (input.startTime.toISOString().split(".")[0] + "Z").toString(),
252
+ ],
253
+ endTime: [() => input.endTime !== void 0, () => (input.endTime.toISOString().split(".")[0] + "Z").toString()],
254
+ locale: [, input.locale],
255
+ });
328
256
  let body;
329
257
  return new protocol_http_1.HttpRequest({
330
258
  protocol,
@@ -343,23 +271,17 @@ const serializeAws_restJson1ListFindingsReportsCommand = async (input, context)
343
271
  const headers = {};
344
272
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
345
273
  "/internal/profilingGroups/{profilingGroupName}/findingsReports";
346
- if (input.profilingGroupName !== undefined) {
347
- const labelValue = input.profilingGroupName;
348
- if (labelValue.length <= 0) {
349
- throw new Error("Empty value provided for input HTTP label: profilingGroupName.");
350
- }
351
- resolvedPath = resolvedPath.replace("{profilingGroupName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
352
- }
353
- else {
354
- throw new Error("No value provided for input HTTP label: profilingGroupName.");
355
- }
356
- const query = {
357
- ...(input.startTime !== undefined && { startTime: (input.startTime.toISOString().split(".")[0] + "Z").toString() }),
358
- ...(input.endTime !== undefined && { endTime: (input.endTime.toISOString().split(".")[0] + "Z").toString() }),
359
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
360
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
361
- ...(input.dailyReportsOnly !== undefined && { dailyReportsOnly: input.dailyReportsOnly.toString() }),
362
- };
274
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "profilingGroupName", () => input.profilingGroupName, "{profilingGroupName}", false);
275
+ const query = map({
276
+ startTime: [
277
+ () => input.startTime !== void 0,
278
+ () => (input.startTime.toISOString().split(".")[0] + "Z").toString(),
279
+ ],
280
+ endTime: [() => input.endTime !== void 0, () => (input.endTime.toISOString().split(".")[0] + "Z").toString()],
281
+ nextToken: [, input.nextToken],
282
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
283
+ dailyReportsOnly: [() => input.dailyReportsOnly !== void 0, () => input.dailyReportsOnly.toString()],
284
+ });
363
285
  let body;
364
286
  return new protocol_http_1.HttpRequest({
365
287
  protocol,
@@ -378,24 +300,18 @@ const serializeAws_restJson1ListProfileTimesCommand = async (input, context) =>
378
300
  const headers = {};
379
301
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
380
302
  "/profilingGroups/{profilingGroupName}/profileTimes";
381
- if (input.profilingGroupName !== undefined) {
382
- const labelValue = input.profilingGroupName;
383
- if (labelValue.length <= 0) {
384
- throw new Error("Empty value provided for input HTTP label: profilingGroupName.");
385
- }
386
- resolvedPath = resolvedPath.replace("{profilingGroupName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
387
- }
388
- else {
389
- throw new Error("No value provided for input HTTP label: profilingGroupName.");
390
- }
391
- const query = {
392
- ...(input.startTime !== undefined && { startTime: (input.startTime.toISOString().split(".")[0] + "Z").toString() }),
393
- ...(input.endTime !== undefined && { endTime: (input.endTime.toISOString().split(".")[0] + "Z").toString() }),
394
- ...(input.period !== undefined && { period: input.period }),
395
- ...(input.orderBy !== undefined && { orderBy: input.orderBy }),
396
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
397
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
398
- };
303
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "profilingGroupName", () => input.profilingGroupName, "{profilingGroupName}", false);
304
+ const query = map({
305
+ startTime: [
306
+ () => input.startTime !== void 0,
307
+ () => (input.startTime.toISOString().split(".")[0] + "Z").toString(),
308
+ ],
309
+ endTime: [() => input.endTime !== void 0, () => (input.endTime.toISOString().split(".")[0] + "Z").toString()],
310
+ period: [, input.period],
311
+ orderBy: [, input.orderBy],
312
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
313
+ nextToken: [, input.nextToken],
314
+ });
399
315
  let body;
400
316
  return new protocol_http_1.HttpRequest({
401
317
  protocol,
@@ -413,11 +329,11 @@ const serializeAws_restJson1ListProfilingGroupsCommand = async (input, context)
413
329
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
414
330
  const headers = {};
415
331
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/profilingGroups";
416
- const query = {
417
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
418
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
419
- ...(input.includeDescription !== undefined && { includeDescription: input.includeDescription.toString() }),
420
- };
332
+ const query = map({
333
+ nextToken: [, input.nextToken],
334
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
335
+ includeDescription: [() => input.includeDescription !== void 0, () => input.includeDescription.toString()],
336
+ });
421
337
  let body;
422
338
  return new protocol_http_1.HttpRequest({
423
339
  protocol,
@@ -435,16 +351,7 @@ const serializeAws_restJson1ListTagsForResourceCommand = async (input, context)
435
351
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
436
352
  const headers = {};
437
353
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
438
- if (input.resourceArn !== undefined) {
439
- const labelValue = input.resourceArn;
440
- if (labelValue.length <= 0) {
441
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
442
- }
443
- resolvedPath = resolvedPath.replace("{resourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
444
- }
445
- else {
446
- throw new Error("No value provided for input HTTP label: resourceArn.");
447
- }
354
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
448
355
  let body;
449
356
  return new protocol_http_1.HttpRequest({
450
357
  protocol,
@@ -459,25 +366,15 @@ const serializeAws_restJson1ListTagsForResourceCommand = async (input, context)
459
366
  exports.serializeAws_restJson1ListTagsForResourceCommand = serializeAws_restJson1ListTagsForResourceCommand;
460
367
  const serializeAws_restJson1PostAgentProfileCommand = async (input, context) => {
461
368
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
462
- const headers = {
463
- "content-type": "application/octet-stream",
464
- ...(isSerializableHeaderValue(input.contentType) && { "content-type": input.contentType }),
465
- };
369
+ const headers = map({}, isSerializableHeaderValue, {
370
+ "content-type": input.contentType || "application/octet-stream",
371
+ });
466
372
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
467
373
  "/profilingGroups/{profilingGroupName}/agentProfile";
468
- if (input.profilingGroupName !== undefined) {
469
- const labelValue = input.profilingGroupName;
470
- if (labelValue.length <= 0) {
471
- throw new Error("Empty value provided for input HTTP label: profilingGroupName.");
472
- }
473
- resolvedPath = resolvedPath.replace("{profilingGroupName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
474
- }
475
- else {
476
- throw new Error("No value provided for input HTTP label: profilingGroupName.");
477
- }
478
- const query = {
479
- ...(input.profileToken !== undefined && { profileToken: input.profileToken }),
480
- };
374
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "profilingGroupName", () => input.profilingGroupName, "{profilingGroupName}", false);
375
+ const query = map({
376
+ profileToken: [, input.profileToken],
377
+ });
481
378
  let body;
482
379
  if (input.agentProfile !== undefined) {
483
380
  body = input.agentProfile;
@@ -501,26 +398,8 @@ const serializeAws_restJson1PutPermissionCommand = async (input, context) => {
501
398
  };
502
399
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
503
400
  "/profilingGroups/{profilingGroupName}/policy/{actionGroup}";
504
- if (input.profilingGroupName !== undefined) {
505
- const labelValue = input.profilingGroupName;
506
- if (labelValue.length <= 0) {
507
- throw new Error("Empty value provided for input HTTP label: profilingGroupName.");
508
- }
509
- resolvedPath = resolvedPath.replace("{profilingGroupName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
510
- }
511
- else {
512
- throw new Error("No value provided for input HTTP label: profilingGroupName.");
513
- }
514
- if (input.actionGroup !== undefined) {
515
- const labelValue = input.actionGroup;
516
- if (labelValue.length <= 0) {
517
- throw new Error("Empty value provided for input HTTP label: actionGroup.");
518
- }
519
- resolvedPath = resolvedPath.replace("{actionGroup}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
520
- }
521
- else {
522
- throw new Error("No value provided for input HTTP label: actionGroup.");
523
- }
401
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "profilingGroupName", () => input.profilingGroupName, "{profilingGroupName}", false);
402
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "actionGroup", () => input.actionGroup, "{actionGroup}", false);
524
403
  let body;
525
404
  body = JSON.stringify({
526
405
  ...(input.principals != null && { principals: serializeAws_restJson1Principals(input.principals, context) }),
@@ -542,26 +421,8 @@ const serializeAws_restJson1RemoveNotificationChannelCommand = async (input, con
542
421
  const headers = {};
543
422
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
544
423
  "/profilingGroups/{profilingGroupName}/notificationConfiguration/{channelId}";
545
- if (input.profilingGroupName !== undefined) {
546
- const labelValue = input.profilingGroupName;
547
- if (labelValue.length <= 0) {
548
- throw new Error("Empty value provided for input HTTP label: profilingGroupName.");
549
- }
550
- resolvedPath = resolvedPath.replace("{profilingGroupName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
551
- }
552
- else {
553
- throw new Error("No value provided for input HTTP label: profilingGroupName.");
554
- }
555
- if (input.channelId !== undefined) {
556
- const labelValue = input.channelId;
557
- if (labelValue.length <= 0) {
558
- throw new Error("Empty value provided for input HTTP label: channelId.");
559
- }
560
- resolvedPath = resolvedPath.replace("{channelId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
561
- }
562
- else {
563
- throw new Error("No value provided for input HTTP label: channelId.");
564
- }
424
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "profilingGroupName", () => input.profilingGroupName, "{profilingGroupName}", false);
425
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "channelId", () => input.channelId, "{channelId}", false);
565
426
  let body;
566
427
  return new protocol_http_1.HttpRequest({
567
428
  protocol,
@@ -579,29 +440,11 @@ const serializeAws_restJson1RemovePermissionCommand = async (input, context) =>
579
440
  const headers = {};
580
441
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
581
442
  "/profilingGroups/{profilingGroupName}/policy/{actionGroup}";
582
- if (input.profilingGroupName !== undefined) {
583
- const labelValue = input.profilingGroupName;
584
- if (labelValue.length <= 0) {
585
- throw new Error("Empty value provided for input HTTP label: profilingGroupName.");
586
- }
587
- resolvedPath = resolvedPath.replace("{profilingGroupName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
588
- }
589
- else {
590
- throw new Error("No value provided for input HTTP label: profilingGroupName.");
591
- }
592
- if (input.actionGroup !== undefined) {
593
- const labelValue = input.actionGroup;
594
- if (labelValue.length <= 0) {
595
- throw new Error("Empty value provided for input HTTP label: actionGroup.");
596
- }
597
- resolvedPath = resolvedPath.replace("{actionGroup}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
598
- }
599
- else {
600
- throw new Error("No value provided for input HTTP label: actionGroup.");
601
- }
602
- const query = {
603
- ...(input.revisionId !== undefined && { revisionId: input.revisionId }),
604
- };
443
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "profilingGroupName", () => input.profilingGroupName, "{profilingGroupName}", false);
444
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "actionGroup", () => input.actionGroup, "{actionGroup}", false);
445
+ const query = map({
446
+ revisionId: [, input.revisionId],
447
+ });
605
448
  let body;
606
449
  return new protocol_http_1.HttpRequest({
607
450
  protocol,
@@ -622,26 +465,8 @@ const serializeAws_restJson1SubmitFeedbackCommand = async (input, context) => {
622
465
  };
623
466
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
624
467
  "/internal/profilingGroups/{profilingGroupName}/anomalies/{anomalyInstanceId}/feedback";
625
- if (input.profilingGroupName !== undefined) {
626
- const labelValue = input.profilingGroupName;
627
- if (labelValue.length <= 0) {
628
- throw new Error("Empty value provided for input HTTP label: profilingGroupName.");
629
- }
630
- resolvedPath = resolvedPath.replace("{profilingGroupName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
631
- }
632
- else {
633
- throw new Error("No value provided for input HTTP label: profilingGroupName.");
634
- }
635
- if (input.anomalyInstanceId !== undefined) {
636
- const labelValue = input.anomalyInstanceId;
637
- if (labelValue.length <= 0) {
638
- throw new Error("Empty value provided for input HTTP label: anomalyInstanceId.");
639
- }
640
- resolvedPath = resolvedPath.replace("{anomalyInstanceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
641
- }
642
- else {
643
- throw new Error("No value provided for input HTTP label: anomalyInstanceId.");
644
- }
468
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "profilingGroupName", () => input.profilingGroupName, "{profilingGroupName}", false);
469
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "anomalyInstanceId", () => input.anomalyInstanceId, "{anomalyInstanceId}", false);
645
470
  let body;
646
471
  body = JSON.stringify({
647
472
  ...(input.comment != null && { comment: input.comment }),
@@ -664,16 +489,7 @@ const serializeAws_restJson1TagResourceCommand = async (input, context) => {
664
489
  "content-type": "application/json",
665
490
  };
666
491
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
667
- if (input.resourceArn !== undefined) {
668
- const labelValue = input.resourceArn;
669
- if (labelValue.length <= 0) {
670
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
671
- }
672
- resolvedPath = resolvedPath.replace("{resourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
673
- }
674
- else {
675
- throw new Error("No value provided for input HTTP label: resourceArn.");
676
- }
492
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
677
493
  let body;
678
494
  body = JSON.stringify({
679
495
  ...(input.tags != null && { tags: serializeAws_restJson1TagsMap(input.tags, context) }),
@@ -693,19 +509,10 @@ const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
693
509
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
694
510
  const headers = {};
695
511
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
696
- if (input.resourceArn !== undefined) {
697
- const labelValue = input.resourceArn;
698
- if (labelValue.length <= 0) {
699
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
700
- }
701
- resolvedPath = resolvedPath.replace("{resourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
702
- }
703
- else {
704
- throw new Error("No value provided for input HTTP label: resourceArn.");
705
- }
706
- const query = {
707
- ...(input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map((_entry) => _entry) }),
708
- };
512
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
513
+ const query = map({
514
+ tagKeys: [() => input.tagKeys !== void 0, () => (input.tagKeys || []).map((_entry) => _entry)],
515
+ });
709
516
  let body;
710
517
  return new protocol_http_1.HttpRequest({
711
518
  protocol,
@@ -725,16 +532,7 @@ const serializeAws_restJson1UpdateProfilingGroupCommand = async (input, context)
725
532
  "content-type": "application/json",
726
533
  };
727
534
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/profilingGroups/{profilingGroupName}";
728
- if (input.profilingGroupName !== undefined) {
729
- const labelValue = input.profilingGroupName;
730
- if (labelValue.length <= 0) {
731
- throw new Error("Empty value provided for input HTTP label: profilingGroupName.");
732
- }
733
- resolvedPath = resolvedPath.replace("{profilingGroupName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
734
- }
735
- else {
736
- throw new Error("No value provided for input HTTP label: profilingGroupName.");
737
- }
535
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "profilingGroupName", () => input.profilingGroupName, "{profilingGroupName}", false);
738
536
  let body;
739
537
  body = JSON.stringify({
740
538
  ...(input.agentOrchestrationConfig != null && {
@@ -756,15 +554,14 @@ const deserializeAws_restJson1AddNotificationChannelsCommand = async (output, co
756
554
  if (output.statusCode !== 200 && output.statusCode >= 300) {
757
555
  return deserializeAws_restJson1AddNotificationChannelsCommandError(output, context);
758
556
  }
759
- const contents = {
557
+ const contents = map({
760
558
  $metadata: deserializeMetadata(output),
761
- notificationConfiguration: undefined,
762
- };
559
+ });
763
560
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
764
- if (data.notificationConfiguration !== undefined && data.notificationConfiguration !== null) {
561
+ if (data.notificationConfiguration != null) {
765
562
  contents.notificationConfiguration = deserializeAws_restJson1NotificationConfiguration(data.notificationConfiguration, context);
766
563
  }
767
- return Promise.resolve(contents);
564
+ return contents;
768
565
  };
769
566
  exports.deserializeAws_restJson1AddNotificationChannelsCommand = deserializeAws_restJson1AddNotificationChannelsCommand;
770
567
  const deserializeAws_restJson1AddNotificationChannelsCommandError = async (output, context) => {
@@ -772,7 +569,6 @@ const deserializeAws_restJson1AddNotificationChannelsCommandError = async (outpu
772
569
  ...output,
773
570
  body: await parseBody(output.body, context),
774
571
  };
775
- let response;
776
572
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
777
573
  switch (errorCode) {
778
574
  case "ConflictException":
@@ -795,49 +591,41 @@ const deserializeAws_restJson1AddNotificationChannelsCommandError = async (outpu
795
591
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
796
592
  default:
797
593
  const parsedBody = parsedOutput.body;
798
- const $metadata = deserializeMetadata(output);
799
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
800
- response = new CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException({
801
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
802
- $fault: "client",
803
- $metadata,
594
+ (0, smithy_client_1.throwDefaultError)({
595
+ output,
596
+ parsedBody,
597
+ exceptionCtor: CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException,
598
+ errorCode,
804
599
  });
805
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
806
600
  }
807
601
  };
808
602
  const deserializeAws_restJson1BatchGetFrameMetricDataCommand = async (output, context) => {
809
603
  if (output.statusCode !== 200 && output.statusCode >= 300) {
810
604
  return deserializeAws_restJson1BatchGetFrameMetricDataCommandError(output, context);
811
605
  }
812
- const contents = {
606
+ const contents = map({
813
607
  $metadata: deserializeMetadata(output),
814
- endTime: undefined,
815
- endTimes: undefined,
816
- frameMetricData: undefined,
817
- resolution: undefined,
818
- startTime: undefined,
819
- unprocessedEndTimes: undefined,
820
- };
608
+ });
821
609
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
822
- if (data.endTime !== undefined && data.endTime !== null) {
610
+ if (data.endTime != null) {
823
611
  contents.endTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.endTime));
824
612
  }
825
- if (data.endTimes !== undefined && data.endTimes !== null) {
613
+ if (data.endTimes != null) {
826
614
  contents.endTimes = deserializeAws_restJson1ListOfTimestamps(data.endTimes, context);
827
615
  }
828
- if (data.frameMetricData !== undefined && data.frameMetricData !== null) {
616
+ if (data.frameMetricData != null) {
829
617
  contents.frameMetricData = deserializeAws_restJson1FrameMetricData(data.frameMetricData, context);
830
618
  }
831
- if (data.resolution !== undefined && data.resolution !== null) {
619
+ if (data.resolution != null) {
832
620
  contents.resolution = (0, smithy_client_1.expectString)(data.resolution);
833
621
  }
834
- if (data.startTime !== undefined && data.startTime !== null) {
622
+ if (data.startTime != null) {
835
623
  contents.startTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.startTime));
836
624
  }
837
- if (data.unprocessedEndTimes !== undefined && data.unprocessedEndTimes !== null) {
625
+ if (data.unprocessedEndTimes != null) {
838
626
  contents.unprocessedEndTimes = deserializeAws_restJson1UnprocessedEndTimeMap(data.unprocessedEndTimes, context);
839
627
  }
840
- return Promise.resolve(contents);
628
+ return contents;
841
629
  };
842
630
  exports.deserializeAws_restJson1BatchGetFrameMetricDataCommand = deserializeAws_restJson1BatchGetFrameMetricDataCommand;
843
631
  const deserializeAws_restJson1BatchGetFrameMetricDataCommandError = async (output, context) => {
@@ -845,7 +633,6 @@ const deserializeAws_restJson1BatchGetFrameMetricDataCommandError = async (outpu
845
633
  ...output,
846
634
  body: await parseBody(output.body, context),
847
635
  };
848
- let response;
849
636
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
850
637
  switch (errorCode) {
851
638
  case "InternalServerException":
@@ -862,27 +649,24 @@ const deserializeAws_restJson1BatchGetFrameMetricDataCommandError = async (outpu
862
649
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
863
650
  default:
864
651
  const parsedBody = parsedOutput.body;
865
- const $metadata = deserializeMetadata(output);
866
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
867
- response = new CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException({
868
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
869
- $fault: "client",
870
- $metadata,
652
+ (0, smithy_client_1.throwDefaultError)({
653
+ output,
654
+ parsedBody,
655
+ exceptionCtor: CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException,
656
+ errorCode,
871
657
  });
872
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
873
658
  }
874
659
  };
875
660
  const deserializeAws_restJson1ConfigureAgentCommand = async (output, context) => {
876
661
  if (output.statusCode !== 200 && output.statusCode >= 300) {
877
662
  return deserializeAws_restJson1ConfigureAgentCommandError(output, context);
878
663
  }
879
- const contents = {
664
+ const contents = map({
880
665
  $metadata: deserializeMetadata(output),
881
- configuration: undefined,
882
- };
666
+ });
883
667
  const data = (0, smithy_client_1.expectObject)(await parseBody(output.body, context));
884
668
  contents.configuration = deserializeAws_restJson1AgentConfiguration(data, context);
885
- return Promise.resolve(contents);
669
+ return contents;
886
670
  };
887
671
  exports.deserializeAws_restJson1ConfigureAgentCommand = deserializeAws_restJson1ConfigureAgentCommand;
888
672
  const deserializeAws_restJson1ConfigureAgentCommandError = async (output, context) => {
@@ -890,7 +674,6 @@ const deserializeAws_restJson1ConfigureAgentCommandError = async (output, contex
890
674
  ...output,
891
675
  body: await parseBody(output.body, context),
892
676
  };
893
- let response;
894
677
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
895
678
  switch (errorCode) {
896
679
  case "InternalServerException":
@@ -907,27 +690,24 @@ const deserializeAws_restJson1ConfigureAgentCommandError = async (output, contex
907
690
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
908
691
  default:
909
692
  const parsedBody = parsedOutput.body;
910
- const $metadata = deserializeMetadata(output);
911
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
912
- response = new CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException({
913
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
914
- $fault: "client",
915
- $metadata,
693
+ (0, smithy_client_1.throwDefaultError)({
694
+ output,
695
+ parsedBody,
696
+ exceptionCtor: CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException,
697
+ errorCode,
916
698
  });
917
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
918
699
  }
919
700
  };
920
701
  const deserializeAws_restJson1CreateProfilingGroupCommand = async (output, context) => {
921
702
  if (output.statusCode !== 201 && output.statusCode >= 300) {
922
703
  return deserializeAws_restJson1CreateProfilingGroupCommandError(output, context);
923
704
  }
924
- const contents = {
705
+ const contents = map({
925
706
  $metadata: deserializeMetadata(output),
926
- profilingGroup: undefined,
927
- };
707
+ });
928
708
  const data = (0, smithy_client_1.expectObject)(await parseBody(output.body, context));
929
709
  contents.profilingGroup = deserializeAws_restJson1ProfilingGroupDescription(data, context);
930
- return Promise.resolve(contents);
710
+ return contents;
931
711
  };
932
712
  exports.deserializeAws_restJson1CreateProfilingGroupCommand = deserializeAws_restJson1CreateProfilingGroupCommand;
933
713
  const deserializeAws_restJson1CreateProfilingGroupCommandError = async (output, context) => {
@@ -935,7 +715,6 @@ const deserializeAws_restJson1CreateProfilingGroupCommandError = async (output,
935
715
  ...output,
936
716
  body: await parseBody(output.body, context),
937
717
  };
938
- let response;
939
718
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
940
719
  switch (errorCode) {
941
720
  case "ConflictException":
@@ -955,25 +734,23 @@ const deserializeAws_restJson1CreateProfilingGroupCommandError = async (output,
955
734
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
956
735
  default:
957
736
  const parsedBody = parsedOutput.body;
958
- const $metadata = deserializeMetadata(output);
959
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
960
- response = new CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException({
961
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
962
- $fault: "client",
963
- $metadata,
737
+ (0, smithy_client_1.throwDefaultError)({
738
+ output,
739
+ parsedBody,
740
+ exceptionCtor: CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException,
741
+ errorCode,
964
742
  });
965
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
966
743
  }
967
744
  };
968
745
  const deserializeAws_restJson1DeleteProfilingGroupCommand = async (output, context) => {
969
746
  if (output.statusCode !== 204 && output.statusCode >= 300) {
970
747
  return deserializeAws_restJson1DeleteProfilingGroupCommandError(output, context);
971
748
  }
972
- const contents = {
749
+ const contents = map({
973
750
  $metadata: deserializeMetadata(output),
974
- };
751
+ });
975
752
  await collectBody(output.body, context);
976
- return Promise.resolve(contents);
753
+ return contents;
977
754
  };
978
755
  exports.deserializeAws_restJson1DeleteProfilingGroupCommand = deserializeAws_restJson1DeleteProfilingGroupCommand;
979
756
  const deserializeAws_restJson1DeleteProfilingGroupCommandError = async (output, context) => {
@@ -981,7 +758,6 @@ const deserializeAws_restJson1DeleteProfilingGroupCommandError = async (output,
981
758
  ...output,
982
759
  body: await parseBody(output.body, context),
983
760
  };
984
- let response;
985
761
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
986
762
  switch (errorCode) {
987
763
  case "ConflictException":
@@ -1001,27 +777,24 @@ const deserializeAws_restJson1DeleteProfilingGroupCommandError = async (output,
1001
777
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1002
778
  default:
1003
779
  const parsedBody = parsedOutput.body;
1004
- const $metadata = deserializeMetadata(output);
1005
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1006
- response = new CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException({
1007
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1008
- $fault: "client",
1009
- $metadata,
780
+ (0, smithy_client_1.throwDefaultError)({
781
+ output,
782
+ parsedBody,
783
+ exceptionCtor: CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException,
784
+ errorCode,
1010
785
  });
1011
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1012
786
  }
1013
787
  };
1014
788
  const deserializeAws_restJson1DescribeProfilingGroupCommand = async (output, context) => {
1015
789
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1016
790
  return deserializeAws_restJson1DescribeProfilingGroupCommandError(output, context);
1017
791
  }
1018
- const contents = {
792
+ const contents = map({
1019
793
  $metadata: deserializeMetadata(output),
1020
- profilingGroup: undefined,
1021
- };
794
+ });
1022
795
  const data = (0, smithy_client_1.expectObject)(await parseBody(output.body, context));
1023
796
  contents.profilingGroup = deserializeAws_restJson1ProfilingGroupDescription(data, context);
1024
- return Promise.resolve(contents);
797
+ return contents;
1025
798
  };
1026
799
  exports.deserializeAws_restJson1DescribeProfilingGroupCommand = deserializeAws_restJson1DescribeProfilingGroupCommand;
1027
800
  const deserializeAws_restJson1DescribeProfilingGroupCommandError = async (output, context) => {
@@ -1029,7 +802,6 @@ const deserializeAws_restJson1DescribeProfilingGroupCommandError = async (output
1029
802
  ...output,
1030
803
  body: await parseBody(output.body, context),
1031
804
  };
1032
- let response;
1033
805
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1034
806
  switch (errorCode) {
1035
807
  case "InternalServerException":
@@ -1046,33 +818,29 @@ const deserializeAws_restJson1DescribeProfilingGroupCommandError = async (output
1046
818
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1047
819
  default:
1048
820
  const parsedBody = parsedOutput.body;
1049
- const $metadata = deserializeMetadata(output);
1050
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1051
- response = new CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException({
1052
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1053
- $fault: "client",
1054
- $metadata,
821
+ (0, smithy_client_1.throwDefaultError)({
822
+ output,
823
+ parsedBody,
824
+ exceptionCtor: CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException,
825
+ errorCode,
1055
826
  });
1056
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1057
827
  }
1058
828
  };
1059
829
  const deserializeAws_restJson1GetFindingsReportAccountSummaryCommand = async (output, context) => {
1060
830
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1061
831
  return deserializeAws_restJson1GetFindingsReportAccountSummaryCommandError(output, context);
1062
832
  }
1063
- const contents = {
833
+ const contents = map({
1064
834
  $metadata: deserializeMetadata(output),
1065
- nextToken: undefined,
1066
- reportSummaries: undefined,
1067
- };
835
+ });
1068
836
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1069
- if (data.nextToken !== undefined && data.nextToken !== null) {
837
+ if (data.nextToken != null) {
1070
838
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1071
839
  }
1072
- if (data.reportSummaries !== undefined && data.reportSummaries !== null) {
840
+ if (data.reportSummaries != null) {
1073
841
  contents.reportSummaries = deserializeAws_restJson1FindingsReportSummaries(data.reportSummaries, context);
1074
842
  }
1075
- return Promise.resolve(contents);
843
+ return contents;
1076
844
  };
1077
845
  exports.deserializeAws_restJson1GetFindingsReportAccountSummaryCommand = deserializeAws_restJson1GetFindingsReportAccountSummaryCommand;
1078
846
  const deserializeAws_restJson1GetFindingsReportAccountSummaryCommandError = async (output, context) => {
@@ -1080,7 +848,6 @@ const deserializeAws_restJson1GetFindingsReportAccountSummaryCommandError = asyn
1080
848
  ...output,
1081
849
  body: await parseBody(output.body, context),
1082
850
  };
1083
- let response;
1084
851
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1085
852
  switch (errorCode) {
1086
853
  case "InternalServerException":
@@ -1094,29 +861,26 @@ const deserializeAws_restJson1GetFindingsReportAccountSummaryCommandError = asyn
1094
861
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1095
862
  default:
1096
863
  const parsedBody = parsedOutput.body;
1097
- const $metadata = deserializeMetadata(output);
1098
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1099
- response = new CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException({
1100
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1101
- $fault: "client",
1102
- $metadata,
864
+ (0, smithy_client_1.throwDefaultError)({
865
+ output,
866
+ parsedBody,
867
+ exceptionCtor: CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException,
868
+ errorCode,
1103
869
  });
1104
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1105
870
  }
1106
871
  };
1107
872
  const deserializeAws_restJson1GetNotificationConfigurationCommand = async (output, context) => {
1108
873
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1109
874
  return deserializeAws_restJson1GetNotificationConfigurationCommandError(output, context);
1110
875
  }
1111
- const contents = {
876
+ const contents = map({
1112
877
  $metadata: deserializeMetadata(output),
1113
- notificationConfiguration: undefined,
1114
- };
878
+ });
1115
879
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1116
- if (data.notificationConfiguration !== undefined && data.notificationConfiguration !== null) {
880
+ if (data.notificationConfiguration != null) {
1117
881
  contents.notificationConfiguration = deserializeAws_restJson1NotificationConfiguration(data.notificationConfiguration, context);
1118
882
  }
1119
- return Promise.resolve(contents);
883
+ return contents;
1120
884
  };
1121
885
  exports.deserializeAws_restJson1GetNotificationConfigurationCommand = deserializeAws_restJson1GetNotificationConfigurationCommand;
1122
886
  const deserializeAws_restJson1GetNotificationConfigurationCommandError = async (output, context) => {
@@ -1124,7 +888,6 @@ const deserializeAws_restJson1GetNotificationConfigurationCommandError = async (
1124
888
  ...output,
1125
889
  body: await parseBody(output.body, context),
1126
890
  };
1127
- let response;
1128
891
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1129
892
  switch (errorCode) {
1130
893
  case "InternalServerException":
@@ -1141,33 +904,29 @@ const deserializeAws_restJson1GetNotificationConfigurationCommandError = async (
1141
904
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1142
905
  default:
1143
906
  const parsedBody = parsedOutput.body;
1144
- const $metadata = deserializeMetadata(output);
1145
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1146
- response = new CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException({
1147
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1148
- $fault: "client",
1149
- $metadata,
907
+ (0, smithy_client_1.throwDefaultError)({
908
+ output,
909
+ parsedBody,
910
+ exceptionCtor: CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException,
911
+ errorCode,
1150
912
  });
1151
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1152
913
  }
1153
914
  };
1154
915
  const deserializeAws_restJson1GetPolicyCommand = async (output, context) => {
1155
916
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1156
917
  return deserializeAws_restJson1GetPolicyCommandError(output, context);
1157
918
  }
1158
- const contents = {
919
+ const contents = map({
1159
920
  $metadata: deserializeMetadata(output),
1160
- policy: undefined,
1161
- revisionId: undefined,
1162
- };
921
+ });
1163
922
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1164
- if (data.policy !== undefined && data.policy !== null) {
923
+ if (data.policy != null) {
1165
924
  contents.policy = (0, smithy_client_1.expectString)(data.policy);
1166
925
  }
1167
- if (data.revisionId !== undefined && data.revisionId !== null) {
926
+ if (data.revisionId != null) {
1168
927
  contents.revisionId = (0, smithy_client_1.expectString)(data.revisionId);
1169
928
  }
1170
- return Promise.resolve(contents);
929
+ return contents;
1171
930
  };
1172
931
  exports.deserializeAws_restJson1GetPolicyCommand = deserializeAws_restJson1GetPolicyCommand;
1173
932
  const deserializeAws_restJson1GetPolicyCommandError = async (output, context) => {
@@ -1175,7 +934,6 @@ const deserializeAws_restJson1GetPolicyCommandError = async (output, context) =>
1175
934
  ...output,
1176
935
  body: await parseBody(output.body, context),
1177
936
  };
1178
- let response;
1179
937
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1180
938
  switch (errorCode) {
1181
939
  case "InternalServerException":
@@ -1189,35 +947,26 @@ const deserializeAws_restJson1GetPolicyCommandError = async (output, context) =>
1189
947
  throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1190
948
  default:
1191
949
  const parsedBody = parsedOutput.body;
1192
- const $metadata = deserializeMetadata(output);
1193
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1194
- response = new CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException({
1195
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1196
- $fault: "client",
1197
- $metadata,
950
+ (0, smithy_client_1.throwDefaultError)({
951
+ output,
952
+ parsedBody,
953
+ exceptionCtor: CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException,
954
+ errorCode,
1198
955
  });
1199
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1200
956
  }
1201
957
  };
1202
958
  const deserializeAws_restJson1GetProfileCommand = async (output, context) => {
1203
959
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1204
960
  return deserializeAws_restJson1GetProfileCommandError(output, context);
1205
961
  }
1206
- const contents = {
962
+ const contents = map({
1207
963
  $metadata: deserializeMetadata(output),
1208
- contentEncoding: undefined,
1209
- contentType: undefined,
1210
- profile: undefined,
1211
- };
1212
- if (output.headers["content-type"] !== undefined) {
1213
- contents.contentType = output.headers["content-type"];
1214
- }
1215
- if (output.headers["content-encoding"] !== undefined) {
1216
- contents.contentEncoding = output.headers["content-encoding"];
1217
- }
964
+ contentType: [, output.headers["content-type"]],
965
+ contentEncoding: [, output.headers["content-encoding"]],
966
+ });
1218
967
  const data = await collectBody(output.body, context);
1219
968
  contents.profile = data;
1220
- return Promise.resolve(contents);
969
+ return contents;
1221
970
  };
1222
971
  exports.deserializeAws_restJson1GetProfileCommand = deserializeAws_restJson1GetProfileCommand;
1223
972
  const deserializeAws_restJson1GetProfileCommandError = async (output, context) => {
@@ -1225,7 +974,6 @@ const deserializeAws_restJson1GetProfileCommandError = async (output, context) =
1225
974
  ...output,
1226
975
  body: await parseBody(output.body, context),
1227
976
  };
1228
- let response;
1229
977
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1230
978
  switch (errorCode) {
1231
979
  case "InternalServerException":
@@ -1242,45 +990,38 @@ const deserializeAws_restJson1GetProfileCommandError = async (output, context) =
1242
990
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1243
991
  default:
1244
992
  const parsedBody = parsedOutput.body;
1245
- const $metadata = deserializeMetadata(output);
1246
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1247
- response = new CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException({
1248
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1249
- $fault: "client",
1250
- $metadata,
993
+ (0, smithy_client_1.throwDefaultError)({
994
+ output,
995
+ parsedBody,
996
+ exceptionCtor: CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException,
997
+ errorCode,
1251
998
  });
1252
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1253
999
  }
1254
1000
  };
1255
1001
  const deserializeAws_restJson1GetRecommendationsCommand = async (output, context) => {
1256
1002
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1257
1003
  return deserializeAws_restJson1GetRecommendationsCommandError(output, context);
1258
1004
  }
1259
- const contents = {
1005
+ const contents = map({
1260
1006
  $metadata: deserializeMetadata(output),
1261
- anomalies: undefined,
1262
- profileEndTime: undefined,
1263
- profileStartTime: undefined,
1264
- profilingGroupName: undefined,
1265
- recommendations: undefined,
1266
- };
1007
+ });
1267
1008
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1268
- if (data.anomalies !== undefined && data.anomalies !== null) {
1009
+ if (data.anomalies != null) {
1269
1010
  contents.anomalies = deserializeAws_restJson1Anomalies(data.anomalies, context);
1270
1011
  }
1271
- if (data.profileEndTime !== undefined && data.profileEndTime !== null) {
1012
+ if (data.profileEndTime != null) {
1272
1013
  contents.profileEndTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.profileEndTime));
1273
1014
  }
1274
- if (data.profileStartTime !== undefined && data.profileStartTime !== null) {
1015
+ if (data.profileStartTime != null) {
1275
1016
  contents.profileStartTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.profileStartTime));
1276
1017
  }
1277
- if (data.profilingGroupName !== undefined && data.profilingGroupName !== null) {
1018
+ if (data.profilingGroupName != null) {
1278
1019
  contents.profilingGroupName = (0, smithy_client_1.expectString)(data.profilingGroupName);
1279
1020
  }
1280
- if (data.recommendations !== undefined && data.recommendations !== null) {
1021
+ if (data.recommendations != null) {
1281
1022
  contents.recommendations = deserializeAws_restJson1Recommendations(data.recommendations, context);
1282
1023
  }
1283
- return Promise.resolve(contents);
1024
+ return contents;
1284
1025
  };
1285
1026
  exports.deserializeAws_restJson1GetRecommendationsCommand = deserializeAws_restJson1GetRecommendationsCommand;
1286
1027
  const deserializeAws_restJson1GetRecommendationsCommandError = async (output, context) => {
@@ -1288,7 +1029,6 @@ const deserializeAws_restJson1GetRecommendationsCommandError = async (output, co
1288
1029
  ...output,
1289
1030
  body: await parseBody(output.body, context),
1290
1031
  };
1291
- let response;
1292
1032
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1293
1033
  switch (errorCode) {
1294
1034
  case "InternalServerException":
@@ -1305,33 +1045,29 @@ const deserializeAws_restJson1GetRecommendationsCommandError = async (output, co
1305
1045
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1306
1046
  default:
1307
1047
  const parsedBody = parsedOutput.body;
1308
- const $metadata = deserializeMetadata(output);
1309
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1310
- response = new CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException({
1311
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1312
- $fault: "client",
1313
- $metadata,
1048
+ (0, smithy_client_1.throwDefaultError)({
1049
+ output,
1050
+ parsedBody,
1051
+ exceptionCtor: CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException,
1052
+ errorCode,
1314
1053
  });
1315
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1316
1054
  }
1317
1055
  };
1318
1056
  const deserializeAws_restJson1ListFindingsReportsCommand = async (output, context) => {
1319
1057
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1320
1058
  return deserializeAws_restJson1ListFindingsReportsCommandError(output, context);
1321
1059
  }
1322
- const contents = {
1060
+ const contents = map({
1323
1061
  $metadata: deserializeMetadata(output),
1324
- findingsReportSummaries: undefined,
1325
- nextToken: undefined,
1326
- };
1062
+ });
1327
1063
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1328
- if (data.findingsReportSummaries !== undefined && data.findingsReportSummaries !== null) {
1064
+ if (data.findingsReportSummaries != null) {
1329
1065
  contents.findingsReportSummaries = deserializeAws_restJson1FindingsReportSummaries(data.findingsReportSummaries, context);
1330
1066
  }
1331
- if (data.nextToken !== undefined && data.nextToken !== null) {
1067
+ if (data.nextToken != null) {
1332
1068
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1333
1069
  }
1334
- return Promise.resolve(contents);
1070
+ return contents;
1335
1071
  };
1336
1072
  exports.deserializeAws_restJson1ListFindingsReportsCommand = deserializeAws_restJson1ListFindingsReportsCommand;
1337
1073
  const deserializeAws_restJson1ListFindingsReportsCommandError = async (output, context) => {
@@ -1339,7 +1075,6 @@ const deserializeAws_restJson1ListFindingsReportsCommandError = async (output, c
1339
1075
  ...output,
1340
1076
  body: await parseBody(output.body, context),
1341
1077
  };
1342
- let response;
1343
1078
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1344
1079
  switch (errorCode) {
1345
1080
  case "InternalServerException":
@@ -1356,33 +1091,29 @@ const deserializeAws_restJson1ListFindingsReportsCommandError = async (output, c
1356
1091
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1357
1092
  default:
1358
1093
  const parsedBody = parsedOutput.body;
1359
- const $metadata = deserializeMetadata(output);
1360
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1361
- response = new CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException({
1362
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1363
- $fault: "client",
1364
- $metadata,
1094
+ (0, smithy_client_1.throwDefaultError)({
1095
+ output,
1096
+ parsedBody,
1097
+ exceptionCtor: CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException,
1098
+ errorCode,
1365
1099
  });
1366
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1367
1100
  }
1368
1101
  };
1369
1102
  const deserializeAws_restJson1ListProfileTimesCommand = async (output, context) => {
1370
1103
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1371
1104
  return deserializeAws_restJson1ListProfileTimesCommandError(output, context);
1372
1105
  }
1373
- const contents = {
1106
+ const contents = map({
1374
1107
  $metadata: deserializeMetadata(output),
1375
- nextToken: undefined,
1376
- profileTimes: undefined,
1377
- };
1108
+ });
1378
1109
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1379
- if (data.nextToken !== undefined && data.nextToken !== null) {
1110
+ if (data.nextToken != null) {
1380
1111
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1381
1112
  }
1382
- if (data.profileTimes !== undefined && data.profileTimes !== null) {
1113
+ if (data.profileTimes != null) {
1383
1114
  contents.profileTimes = deserializeAws_restJson1ProfileTimes(data.profileTimes, context);
1384
1115
  }
1385
- return Promise.resolve(contents);
1116
+ return contents;
1386
1117
  };
1387
1118
  exports.deserializeAws_restJson1ListProfileTimesCommand = deserializeAws_restJson1ListProfileTimesCommand;
1388
1119
  const deserializeAws_restJson1ListProfileTimesCommandError = async (output, context) => {
@@ -1390,7 +1121,6 @@ const deserializeAws_restJson1ListProfileTimesCommandError = async (output, cont
1390
1121
  ...output,
1391
1122
  body: await parseBody(output.body, context),
1392
1123
  };
1393
- let response;
1394
1124
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1395
1125
  switch (errorCode) {
1396
1126
  case "InternalServerException":
@@ -1407,37 +1137,32 @@ const deserializeAws_restJson1ListProfileTimesCommandError = async (output, cont
1407
1137
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1408
1138
  default:
1409
1139
  const parsedBody = parsedOutput.body;
1410
- const $metadata = deserializeMetadata(output);
1411
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1412
- response = new CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException({
1413
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1414
- $fault: "client",
1415
- $metadata,
1140
+ (0, smithy_client_1.throwDefaultError)({
1141
+ output,
1142
+ parsedBody,
1143
+ exceptionCtor: CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException,
1144
+ errorCode,
1416
1145
  });
1417
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1418
1146
  }
1419
1147
  };
1420
1148
  const deserializeAws_restJson1ListProfilingGroupsCommand = async (output, context) => {
1421
1149
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1422
1150
  return deserializeAws_restJson1ListProfilingGroupsCommandError(output, context);
1423
1151
  }
1424
- const contents = {
1152
+ const contents = map({
1425
1153
  $metadata: deserializeMetadata(output),
1426
- nextToken: undefined,
1427
- profilingGroupNames: undefined,
1428
- profilingGroups: undefined,
1429
- };
1154
+ });
1430
1155
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1431
- if (data.nextToken !== undefined && data.nextToken !== null) {
1156
+ if (data.nextToken != null) {
1432
1157
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1433
1158
  }
1434
- if (data.profilingGroupNames !== undefined && data.profilingGroupNames !== null) {
1159
+ if (data.profilingGroupNames != null) {
1435
1160
  contents.profilingGroupNames = deserializeAws_restJson1ProfilingGroupNames(data.profilingGroupNames, context);
1436
1161
  }
1437
- if (data.profilingGroups !== undefined && data.profilingGroups !== null) {
1162
+ if (data.profilingGroups != null) {
1438
1163
  contents.profilingGroups = deserializeAws_restJson1ProfilingGroupDescriptions(data.profilingGroups, context);
1439
1164
  }
1440
- return Promise.resolve(contents);
1165
+ return contents;
1441
1166
  };
1442
1167
  exports.deserializeAws_restJson1ListProfilingGroupsCommand = deserializeAws_restJson1ListProfilingGroupsCommand;
1443
1168
  const deserializeAws_restJson1ListProfilingGroupsCommandError = async (output, context) => {
@@ -1445,7 +1170,6 @@ const deserializeAws_restJson1ListProfilingGroupsCommandError = async (output, c
1445
1170
  ...output,
1446
1171
  body: await parseBody(output.body, context),
1447
1172
  };
1448
- let response;
1449
1173
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1450
1174
  switch (errorCode) {
1451
1175
  case "InternalServerException":
@@ -1456,29 +1180,26 @@ const deserializeAws_restJson1ListProfilingGroupsCommandError = async (output, c
1456
1180
  throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1457
1181
  default:
1458
1182
  const parsedBody = parsedOutput.body;
1459
- const $metadata = deserializeMetadata(output);
1460
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1461
- response = new CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException({
1462
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1463
- $fault: "client",
1464
- $metadata,
1183
+ (0, smithy_client_1.throwDefaultError)({
1184
+ output,
1185
+ parsedBody,
1186
+ exceptionCtor: CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException,
1187
+ errorCode,
1465
1188
  });
1466
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1467
1189
  }
1468
1190
  };
1469
1191
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
1470
1192
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1471
1193
  return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
1472
1194
  }
1473
- const contents = {
1195
+ const contents = map({
1474
1196
  $metadata: deserializeMetadata(output),
1475
- tags: undefined,
1476
- };
1197
+ });
1477
1198
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1478
- if (data.tags !== undefined && data.tags !== null) {
1199
+ if (data.tags != null) {
1479
1200
  contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
1480
1201
  }
1481
- return Promise.resolve(contents);
1202
+ return contents;
1482
1203
  };
1483
1204
  exports.deserializeAws_restJson1ListTagsForResourceCommand = deserializeAws_restJson1ListTagsForResourceCommand;
1484
1205
  const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
@@ -1486,7 +1207,6 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
1486
1207
  ...output,
1487
1208
  body: await parseBody(output.body, context),
1488
1209
  };
1489
- let response;
1490
1210
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1491
1211
  switch (errorCode) {
1492
1212
  case "InternalServerException":
@@ -1500,25 +1220,23 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
1500
1220
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1501
1221
  default:
1502
1222
  const parsedBody = parsedOutput.body;
1503
- const $metadata = deserializeMetadata(output);
1504
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1505
- response = new CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException({
1506
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1507
- $fault: "client",
1508
- $metadata,
1223
+ (0, smithy_client_1.throwDefaultError)({
1224
+ output,
1225
+ parsedBody,
1226
+ exceptionCtor: CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException,
1227
+ errorCode,
1509
1228
  });
1510
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1511
1229
  }
1512
1230
  };
1513
1231
  const deserializeAws_restJson1PostAgentProfileCommand = async (output, context) => {
1514
1232
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1515
1233
  return deserializeAws_restJson1PostAgentProfileCommandError(output, context);
1516
1234
  }
1517
- const contents = {
1235
+ const contents = map({
1518
1236
  $metadata: deserializeMetadata(output),
1519
- };
1237
+ });
1520
1238
  await collectBody(output.body, context);
1521
- return Promise.resolve(contents);
1239
+ return contents;
1522
1240
  };
1523
1241
  exports.deserializeAws_restJson1PostAgentProfileCommand = deserializeAws_restJson1PostAgentProfileCommand;
1524
1242
  const deserializeAws_restJson1PostAgentProfileCommandError = async (output, context) => {
@@ -1526,7 +1244,6 @@ const deserializeAws_restJson1PostAgentProfileCommandError = async (output, cont
1526
1244
  ...output,
1527
1245
  body: await parseBody(output.body, context),
1528
1246
  };
1529
- let response;
1530
1247
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1531
1248
  switch (errorCode) {
1532
1249
  case "InternalServerException":
@@ -1543,33 +1260,29 @@ const deserializeAws_restJson1PostAgentProfileCommandError = async (output, cont
1543
1260
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1544
1261
  default:
1545
1262
  const parsedBody = parsedOutput.body;
1546
- const $metadata = deserializeMetadata(output);
1547
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1548
- response = new CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException({
1549
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1550
- $fault: "client",
1551
- $metadata,
1263
+ (0, smithy_client_1.throwDefaultError)({
1264
+ output,
1265
+ parsedBody,
1266
+ exceptionCtor: CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException,
1267
+ errorCode,
1552
1268
  });
1553
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1554
1269
  }
1555
1270
  };
1556
1271
  const deserializeAws_restJson1PutPermissionCommand = async (output, context) => {
1557
1272
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1558
1273
  return deserializeAws_restJson1PutPermissionCommandError(output, context);
1559
1274
  }
1560
- const contents = {
1275
+ const contents = map({
1561
1276
  $metadata: deserializeMetadata(output),
1562
- policy: undefined,
1563
- revisionId: undefined,
1564
- };
1277
+ });
1565
1278
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1566
- if (data.policy !== undefined && data.policy !== null) {
1279
+ if (data.policy != null) {
1567
1280
  contents.policy = (0, smithy_client_1.expectString)(data.policy);
1568
1281
  }
1569
- if (data.revisionId !== undefined && data.revisionId !== null) {
1282
+ if (data.revisionId != null) {
1570
1283
  contents.revisionId = (0, smithy_client_1.expectString)(data.revisionId);
1571
1284
  }
1572
- return Promise.resolve(contents);
1285
+ return contents;
1573
1286
  };
1574
1287
  exports.deserializeAws_restJson1PutPermissionCommand = deserializeAws_restJson1PutPermissionCommand;
1575
1288
  const deserializeAws_restJson1PutPermissionCommandError = async (output, context) => {
@@ -1577,7 +1290,6 @@ const deserializeAws_restJson1PutPermissionCommandError = async (output, context
1577
1290
  ...output,
1578
1291
  body: await parseBody(output.body, context),
1579
1292
  };
1580
- let response;
1581
1293
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1582
1294
  switch (errorCode) {
1583
1295
  case "ConflictException":
@@ -1597,29 +1309,26 @@ const deserializeAws_restJson1PutPermissionCommandError = async (output, context
1597
1309
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1598
1310
  default:
1599
1311
  const parsedBody = parsedOutput.body;
1600
- const $metadata = deserializeMetadata(output);
1601
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1602
- response = new CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException({
1603
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1604
- $fault: "client",
1605
- $metadata,
1312
+ (0, smithy_client_1.throwDefaultError)({
1313
+ output,
1314
+ parsedBody,
1315
+ exceptionCtor: CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException,
1316
+ errorCode,
1606
1317
  });
1607
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1608
1318
  }
1609
1319
  };
1610
1320
  const deserializeAws_restJson1RemoveNotificationChannelCommand = async (output, context) => {
1611
1321
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1612
1322
  return deserializeAws_restJson1RemoveNotificationChannelCommandError(output, context);
1613
1323
  }
1614
- const contents = {
1324
+ const contents = map({
1615
1325
  $metadata: deserializeMetadata(output),
1616
- notificationConfiguration: undefined,
1617
- };
1326
+ });
1618
1327
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1619
- if (data.notificationConfiguration !== undefined && data.notificationConfiguration !== null) {
1328
+ if (data.notificationConfiguration != null) {
1620
1329
  contents.notificationConfiguration = deserializeAws_restJson1NotificationConfiguration(data.notificationConfiguration, context);
1621
1330
  }
1622
- return Promise.resolve(contents);
1331
+ return contents;
1623
1332
  };
1624
1333
  exports.deserializeAws_restJson1RemoveNotificationChannelCommand = deserializeAws_restJson1RemoveNotificationChannelCommand;
1625
1334
  const deserializeAws_restJson1RemoveNotificationChannelCommandError = async (output, context) => {
@@ -1627,7 +1336,6 @@ const deserializeAws_restJson1RemoveNotificationChannelCommandError = async (out
1627
1336
  ...output,
1628
1337
  body: await parseBody(output.body, context),
1629
1338
  };
1630
- let response;
1631
1339
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1632
1340
  switch (errorCode) {
1633
1341
  case "InternalServerException":
@@ -1644,33 +1352,29 @@ const deserializeAws_restJson1RemoveNotificationChannelCommandError = async (out
1644
1352
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1645
1353
  default:
1646
1354
  const parsedBody = parsedOutput.body;
1647
- const $metadata = deserializeMetadata(output);
1648
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1649
- response = new CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException({
1650
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1651
- $fault: "client",
1652
- $metadata,
1355
+ (0, smithy_client_1.throwDefaultError)({
1356
+ output,
1357
+ parsedBody,
1358
+ exceptionCtor: CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException,
1359
+ errorCode,
1653
1360
  });
1654
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1655
1361
  }
1656
1362
  };
1657
1363
  const deserializeAws_restJson1RemovePermissionCommand = async (output, context) => {
1658
1364
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1659
1365
  return deserializeAws_restJson1RemovePermissionCommandError(output, context);
1660
1366
  }
1661
- const contents = {
1367
+ const contents = map({
1662
1368
  $metadata: deserializeMetadata(output),
1663
- policy: undefined,
1664
- revisionId: undefined,
1665
- };
1369
+ });
1666
1370
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1667
- if (data.policy !== undefined && data.policy !== null) {
1371
+ if (data.policy != null) {
1668
1372
  contents.policy = (0, smithy_client_1.expectString)(data.policy);
1669
1373
  }
1670
- if (data.revisionId !== undefined && data.revisionId !== null) {
1374
+ if (data.revisionId != null) {
1671
1375
  contents.revisionId = (0, smithy_client_1.expectString)(data.revisionId);
1672
1376
  }
1673
- return Promise.resolve(contents);
1377
+ return contents;
1674
1378
  };
1675
1379
  exports.deserializeAws_restJson1RemovePermissionCommand = deserializeAws_restJson1RemovePermissionCommand;
1676
1380
  const deserializeAws_restJson1RemovePermissionCommandError = async (output, context) => {
@@ -1678,7 +1382,6 @@ const deserializeAws_restJson1RemovePermissionCommandError = async (output, cont
1678
1382
  ...output,
1679
1383
  body: await parseBody(output.body, context),
1680
1384
  };
1681
- let response;
1682
1385
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1683
1386
  switch (errorCode) {
1684
1387
  case "ConflictException":
@@ -1698,25 +1401,23 @@ const deserializeAws_restJson1RemovePermissionCommandError = async (output, cont
1698
1401
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1699
1402
  default:
1700
1403
  const parsedBody = parsedOutput.body;
1701
- const $metadata = deserializeMetadata(output);
1702
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1703
- response = new CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException({
1704
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1705
- $fault: "client",
1706
- $metadata,
1404
+ (0, smithy_client_1.throwDefaultError)({
1405
+ output,
1406
+ parsedBody,
1407
+ exceptionCtor: CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException,
1408
+ errorCode,
1707
1409
  });
1708
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1709
1410
  }
1710
1411
  };
1711
1412
  const deserializeAws_restJson1SubmitFeedbackCommand = async (output, context) => {
1712
1413
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1713
1414
  return deserializeAws_restJson1SubmitFeedbackCommandError(output, context);
1714
1415
  }
1715
- const contents = {
1416
+ const contents = map({
1716
1417
  $metadata: deserializeMetadata(output),
1717
- };
1418
+ });
1718
1419
  await collectBody(output.body, context);
1719
- return Promise.resolve(contents);
1420
+ return contents;
1720
1421
  };
1721
1422
  exports.deserializeAws_restJson1SubmitFeedbackCommand = deserializeAws_restJson1SubmitFeedbackCommand;
1722
1423
  const deserializeAws_restJson1SubmitFeedbackCommandError = async (output, context) => {
@@ -1724,7 +1425,6 @@ const deserializeAws_restJson1SubmitFeedbackCommandError = async (output, contex
1724
1425
  ...output,
1725
1426
  body: await parseBody(output.body, context),
1726
1427
  };
1727
- let response;
1728
1428
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1729
1429
  switch (errorCode) {
1730
1430
  case "InternalServerException":
@@ -1741,25 +1441,23 @@ const deserializeAws_restJson1SubmitFeedbackCommandError = async (output, contex
1741
1441
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1742
1442
  default:
1743
1443
  const parsedBody = parsedOutput.body;
1744
- const $metadata = deserializeMetadata(output);
1745
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1746
- response = new CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException({
1747
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1748
- $fault: "client",
1749
- $metadata,
1444
+ (0, smithy_client_1.throwDefaultError)({
1445
+ output,
1446
+ parsedBody,
1447
+ exceptionCtor: CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException,
1448
+ errorCode,
1750
1449
  });
1751
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1752
1450
  }
1753
1451
  };
1754
1452
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
1755
1453
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1756
1454
  return deserializeAws_restJson1TagResourceCommandError(output, context);
1757
1455
  }
1758
- const contents = {
1456
+ const contents = map({
1759
1457
  $metadata: deserializeMetadata(output),
1760
- };
1458
+ });
1761
1459
  await collectBody(output.body, context);
1762
- return Promise.resolve(contents);
1460
+ return contents;
1763
1461
  };
1764
1462
  exports.deserializeAws_restJson1TagResourceCommand = deserializeAws_restJson1TagResourceCommand;
1765
1463
  const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
@@ -1767,7 +1465,6 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
1767
1465
  ...output,
1768
1466
  body: await parseBody(output.body, context),
1769
1467
  };
1770
- let response;
1771
1468
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1772
1469
  switch (errorCode) {
1773
1470
  case "InternalServerException":
@@ -1781,25 +1478,23 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
1781
1478
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1782
1479
  default:
1783
1480
  const parsedBody = parsedOutput.body;
1784
- const $metadata = deserializeMetadata(output);
1785
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1786
- response = new CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException({
1787
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1788
- $fault: "client",
1789
- $metadata,
1481
+ (0, smithy_client_1.throwDefaultError)({
1482
+ output,
1483
+ parsedBody,
1484
+ exceptionCtor: CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException,
1485
+ errorCode,
1790
1486
  });
1791
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1792
1487
  }
1793
1488
  };
1794
1489
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
1795
1490
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1796
1491
  return deserializeAws_restJson1UntagResourceCommandError(output, context);
1797
1492
  }
1798
- const contents = {
1493
+ const contents = map({
1799
1494
  $metadata: deserializeMetadata(output),
1800
- };
1495
+ });
1801
1496
  await collectBody(output.body, context);
1802
- return Promise.resolve(contents);
1497
+ return contents;
1803
1498
  };
1804
1499
  exports.deserializeAws_restJson1UntagResourceCommand = deserializeAws_restJson1UntagResourceCommand;
1805
1500
  const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
@@ -1807,7 +1502,6 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
1807
1502
  ...output,
1808
1503
  body: await parseBody(output.body, context),
1809
1504
  };
1810
- let response;
1811
1505
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1812
1506
  switch (errorCode) {
1813
1507
  case "InternalServerException":
@@ -1821,27 +1515,24 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
1821
1515
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1822
1516
  default:
1823
1517
  const parsedBody = parsedOutput.body;
1824
- const $metadata = deserializeMetadata(output);
1825
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1826
- response = new CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException({
1827
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1828
- $fault: "client",
1829
- $metadata,
1518
+ (0, smithy_client_1.throwDefaultError)({
1519
+ output,
1520
+ parsedBody,
1521
+ exceptionCtor: CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException,
1522
+ errorCode,
1830
1523
  });
1831
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1832
1524
  }
1833
1525
  };
1834
1526
  const deserializeAws_restJson1UpdateProfilingGroupCommand = async (output, context) => {
1835
1527
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1836
1528
  return deserializeAws_restJson1UpdateProfilingGroupCommandError(output, context);
1837
1529
  }
1838
- const contents = {
1530
+ const contents = map({
1839
1531
  $metadata: deserializeMetadata(output),
1840
- profilingGroup: undefined,
1841
- };
1532
+ });
1842
1533
  const data = (0, smithy_client_1.expectObject)(await parseBody(output.body, context));
1843
1534
  contents.profilingGroup = deserializeAws_restJson1ProfilingGroupDescription(data, context);
1844
- return Promise.resolve(contents);
1535
+ return contents;
1845
1536
  };
1846
1537
  exports.deserializeAws_restJson1UpdateProfilingGroupCommand = deserializeAws_restJson1UpdateProfilingGroupCommand;
1847
1538
  const deserializeAws_restJson1UpdateProfilingGroupCommandError = async (output, context) => {
@@ -1849,7 +1540,6 @@ const deserializeAws_restJson1UpdateProfilingGroupCommandError = async (output,
1849
1540
  ...output,
1850
1541
  body: await parseBody(output.body, context),
1851
1542
  };
1852
- let response;
1853
1543
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1854
1544
  switch (errorCode) {
1855
1545
  case "ConflictException":
@@ -1869,20 +1559,19 @@ const deserializeAws_restJson1UpdateProfilingGroupCommandError = async (output,
1869
1559
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1870
1560
  default:
1871
1561
  const parsedBody = parsedOutput.body;
1872
- const $metadata = deserializeMetadata(output);
1873
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1874
- response = new CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException({
1875
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1876
- $fault: "client",
1877
- $metadata,
1562
+ (0, smithy_client_1.throwDefaultError)({
1563
+ output,
1564
+ parsedBody,
1565
+ exceptionCtor: CodeGuruProfilerServiceException_1.CodeGuruProfilerServiceException,
1566
+ errorCode,
1878
1567
  });
1879
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1880
1568
  }
1881
1569
  };
1570
+ const map = smithy_client_1.map;
1882
1571
  const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
1883
- const contents = {};
1572
+ const contents = map({});
1884
1573
  const data = parsedOutput.body;
1885
- if (data.message !== undefined && data.message !== null) {
1574
+ if (data.message != null) {
1886
1575
  contents.message = (0, smithy_client_1.expectString)(data.message);
1887
1576
  }
1888
1577
  const exception = new models_0_1.ConflictException({
@@ -1892,9 +1581,9 @@ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, c
1892
1581
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1893
1582
  };
1894
1583
  const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
1895
- const contents = {};
1584
+ const contents = map({});
1896
1585
  const data = parsedOutput.body;
1897
- if (data.message !== undefined && data.message !== null) {
1586
+ if (data.message != null) {
1898
1587
  contents.message = (0, smithy_client_1.expectString)(data.message);
1899
1588
  }
1900
1589
  const exception = new models_0_1.InternalServerException({
@@ -1904,9 +1593,9 @@ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOut
1904
1593
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1905
1594
  };
1906
1595
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
1907
- const contents = {};
1596
+ const contents = map({});
1908
1597
  const data = parsedOutput.body;
1909
- if (data.message !== undefined && data.message !== null) {
1598
+ if (data.message != null) {
1910
1599
  contents.message = (0, smithy_client_1.expectString)(data.message);
1911
1600
  }
1912
1601
  const exception = new models_0_1.ResourceNotFoundException({
@@ -1916,9 +1605,9 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedO
1916
1605
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1917
1606
  };
1918
1607
  const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
1919
- const contents = {};
1608
+ const contents = map({});
1920
1609
  const data = parsedOutput.body;
1921
- if (data.message !== undefined && data.message !== null) {
1610
+ if (data.message != null) {
1922
1611
  contents.message = (0, smithy_client_1.expectString)(data.message);
1923
1612
  }
1924
1613
  const exception = new models_0_1.ServiceQuotaExceededException({
@@ -1928,9 +1617,9 @@ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (par
1928
1617
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1929
1618
  };
1930
1619
  const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
1931
- const contents = {};
1620
+ const contents = map({});
1932
1621
  const data = parsedOutput.body;
1933
- if (data.message !== undefined && data.message !== null) {
1622
+ if (data.message != null) {
1934
1623
  contents.message = (0, smithy_client_1.expectString)(data.message);
1935
1624
  }
1936
1625
  const exception = new models_0_1.ThrottlingException({
@@ -1940,9 +1629,9 @@ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput,
1940
1629
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1941
1630
  };
1942
1631
  const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
1943
- const contents = {};
1632
+ const contents = map({});
1944
1633
  const data = parsedOutput.body;
1945
- if (data.message !== undefined && data.message !== null) {
1634
+ if (data.message != null) {
1946
1635
  contents.message = (0, smithy_client_1.expectString)(data.message);
1947
1636
  }
1948
1637
  const exception = new models_0_1.ValidationException({
@@ -1969,9 +1658,6 @@ const serializeAws_restJson1Channels = (input, context) => {
1969
1658
  return input
1970
1659
  .filter((e) => e != null)
1971
1660
  .map((entry) => {
1972
- if (entry === null) {
1973
- return null;
1974
- }
1975
1661
  return serializeAws_restJson1Channel(entry, context);
1976
1662
  });
1977
1663
  };
@@ -1979,9 +1665,6 @@ const serializeAws_restJson1EventPublishers = (input, context) => {
1979
1665
  return input
1980
1666
  .filter((e) => e != null)
1981
1667
  .map((entry) => {
1982
- if (entry === null) {
1983
- return null;
1984
- }
1985
1668
  return entry;
1986
1669
  });
1987
1670
  };
@@ -1998,9 +1681,6 @@ const serializeAws_restJson1FrameMetrics = (input, context) => {
1998
1681
  return input
1999
1682
  .filter((e) => e != null)
2000
1683
  .map((entry) => {
2001
- if (entry === null) {
2002
- return null;
2003
- }
2004
1684
  return serializeAws_restJson1FrameMetric(entry, context);
2005
1685
  });
2006
1686
  };
@@ -2019,9 +1699,6 @@ const serializeAws_restJson1Principals = (input, context) => {
2019
1699
  return input
2020
1700
  .filter((e) => e != null)
2021
1701
  .map((entry) => {
2022
- if (entry === null) {
2023
- return null;
2024
- }
2025
1702
  return entry;
2026
1703
  });
2027
1704
  };
@@ -2040,9 +1717,6 @@ const serializeAws_restJson1ThreadStates = (input, context) => {
2040
1717
  return input
2041
1718
  .filter((e) => e != null)
2042
1719
  .map((entry) => {
2043
- if (entry === null) {
2044
- return null;
2045
- }
2046
1720
  return entry;
2047
1721
  });
2048
1722
  };