@aws-sdk/client-pinpoint-email 3.137.0 → 3.145.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { __assign, __awaiter, __generator, __read } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, limitedParseDouble as __limitedParseDouble, parseEpochTimestamp as __parseEpochTimestamp, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, map as __map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { AccountSuspendedException, AlreadyExistsException, BadRequestException, ConcurrentModificationException, LimitExceededException, MailFromDomainNotVerifiedException, MessageRejected, NotFoundException, SendingPausedException, TooManyRequestsException, } from "../models/models_0";
5
5
  import { PinpointEmailServiceException as __BaseException } from "../models/PinpointEmailServiceException";
6
6
  export var serializeAws_restJson1CreateConfigurationSetCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
@@ -36,7 +36,7 @@ export var serializeAws_restJson1CreateConfigurationSetCommand = function (input
36
36
  });
37
37
  }); };
38
38
  export var serializeAws_restJson1CreateConfigurationSetEventDestinationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
39
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
39
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
40
40
  return __generator(this, function (_c) {
41
41
  switch (_c.label) {
42
42
  case 0: return [4, context.endpoint()];
@@ -47,16 +47,7 @@ export var serializeAws_restJson1CreateConfigurationSetEventDestinationCommand =
47
47
  };
48
48
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
49
49
  "/v1/email/configuration-sets/{ConfigurationSetName}/event-destinations";
50
- if (input.ConfigurationSetName !== undefined) {
51
- labelValue = input.ConfigurationSetName;
52
- if (labelValue.length <= 0) {
53
- throw new Error("Empty value provided for input HTTP label: ConfigurationSetName.");
54
- }
55
- resolvedPath = resolvedPath.replace("{ConfigurationSetName}", __extendedEncodeURIComponent(labelValue));
56
- }
57
- else {
58
- throw new Error("No value provided for input HTTP label: ConfigurationSetName.");
59
- }
50
+ resolvedPath = __resolvedPath(resolvedPath, input, "ConfigurationSetName", function () { return input.ConfigurationSetName; }, "{ConfigurationSetName}", false);
60
51
  body = JSON.stringify(__assign(__assign({}, (input.EventDestination != null && {
61
52
  EventDestination: serializeAws_restJson1EventDestinationDefinition(input.EventDestination, context),
62
53
  })), (input.EventDestinationName != null && { EventDestinationName: input.EventDestinationName })));
@@ -145,7 +136,7 @@ export var serializeAws_restJson1CreateEmailIdentityCommand = function (input, c
145
136
  });
146
137
  }); };
147
138
  export var serializeAws_restJson1DeleteConfigurationSetCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
148
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
139
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
149
140
  return __generator(this, function (_c) {
150
141
  switch (_c.label) {
151
142
  case 0: return [4, context.endpoint()];
@@ -154,16 +145,7 @@ export var serializeAws_restJson1DeleteConfigurationSetCommand = function (input
154
145
  headers = {};
155
146
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
156
147
  "/v1/email/configuration-sets/{ConfigurationSetName}";
157
- if (input.ConfigurationSetName !== undefined) {
158
- labelValue = input.ConfigurationSetName;
159
- if (labelValue.length <= 0) {
160
- throw new Error("Empty value provided for input HTTP label: ConfigurationSetName.");
161
- }
162
- resolvedPath = resolvedPath.replace("{ConfigurationSetName}", __extendedEncodeURIComponent(labelValue));
163
- }
164
- else {
165
- throw new Error("No value provided for input HTTP label: ConfigurationSetName.");
166
- }
148
+ resolvedPath = __resolvedPath(resolvedPath, input, "ConfigurationSetName", function () { return input.ConfigurationSetName; }, "{ConfigurationSetName}", false);
167
149
  return [2, new __HttpRequest({
168
150
  protocol: protocol,
169
151
  hostname: hostname,
@@ -177,7 +159,7 @@ export var serializeAws_restJson1DeleteConfigurationSetCommand = function (input
177
159
  });
178
160
  }); };
179
161
  export var serializeAws_restJson1DeleteConfigurationSetEventDestinationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
180
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
162
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
181
163
  return __generator(this, function (_c) {
182
164
  switch (_c.label) {
183
165
  case 0: return [4, context.endpoint()];
@@ -186,26 +168,8 @@ export var serializeAws_restJson1DeleteConfigurationSetEventDestinationCommand =
186
168
  headers = {};
187
169
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
188
170
  "/v1/email/configuration-sets/{ConfigurationSetName}/event-destinations/{EventDestinationName}";
189
- if (input.ConfigurationSetName !== undefined) {
190
- labelValue = input.ConfigurationSetName;
191
- if (labelValue.length <= 0) {
192
- throw new Error("Empty value provided for input HTTP label: ConfigurationSetName.");
193
- }
194
- resolvedPath = resolvedPath.replace("{ConfigurationSetName}", __extendedEncodeURIComponent(labelValue));
195
- }
196
- else {
197
- throw new Error("No value provided for input HTTP label: ConfigurationSetName.");
198
- }
199
- if (input.EventDestinationName !== undefined) {
200
- labelValue = input.EventDestinationName;
201
- if (labelValue.length <= 0) {
202
- throw new Error("Empty value provided for input HTTP label: EventDestinationName.");
203
- }
204
- resolvedPath = resolvedPath.replace("{EventDestinationName}", __extendedEncodeURIComponent(labelValue));
205
- }
206
- else {
207
- throw new Error("No value provided for input HTTP label: EventDestinationName.");
208
- }
171
+ resolvedPath = __resolvedPath(resolvedPath, input, "ConfigurationSetName", function () { return input.ConfigurationSetName; }, "{ConfigurationSetName}", false);
172
+ resolvedPath = __resolvedPath(resolvedPath, input, "EventDestinationName", function () { return input.EventDestinationName; }, "{EventDestinationName}", false);
209
173
  return [2, new __HttpRequest({
210
174
  protocol: protocol,
211
175
  hostname: hostname,
@@ -219,7 +183,7 @@ export var serializeAws_restJson1DeleteConfigurationSetEventDestinationCommand =
219
183
  });
220
184
  }); };
221
185
  export var serializeAws_restJson1DeleteDedicatedIpPoolCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
222
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
186
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
223
187
  return __generator(this, function (_c) {
224
188
  switch (_c.label) {
225
189
  case 0: return [4, context.endpoint()];
@@ -227,16 +191,7 @@ export var serializeAws_restJson1DeleteDedicatedIpPoolCommand = function (input,
227
191
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
228
192
  headers = {};
229
193
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/email/dedicated-ip-pools/{PoolName}";
230
- if (input.PoolName !== undefined) {
231
- labelValue = input.PoolName;
232
- if (labelValue.length <= 0) {
233
- throw new Error("Empty value provided for input HTTP label: PoolName.");
234
- }
235
- resolvedPath = resolvedPath.replace("{PoolName}", __extendedEncodeURIComponent(labelValue));
236
- }
237
- else {
238
- throw new Error("No value provided for input HTTP label: PoolName.");
239
- }
194
+ resolvedPath = __resolvedPath(resolvedPath, input, "PoolName", function () { return input.PoolName; }, "{PoolName}", false);
240
195
  return [2, new __HttpRequest({
241
196
  protocol: protocol,
242
197
  hostname: hostname,
@@ -250,7 +205,7 @@ export var serializeAws_restJson1DeleteDedicatedIpPoolCommand = function (input,
250
205
  });
251
206
  }); };
252
207
  export var serializeAws_restJson1DeleteEmailIdentityCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
253
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
208
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
254
209
  return __generator(this, function (_c) {
255
210
  switch (_c.label) {
256
211
  case 0: return [4, context.endpoint()];
@@ -258,16 +213,7 @@ export var serializeAws_restJson1DeleteEmailIdentityCommand = function (input, c
258
213
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
259
214
  headers = {};
260
215
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/email/identities/{EmailIdentity}";
261
- if (input.EmailIdentity !== undefined) {
262
- labelValue = input.EmailIdentity;
263
- if (labelValue.length <= 0) {
264
- throw new Error("Empty value provided for input HTTP label: EmailIdentity.");
265
- }
266
- resolvedPath = resolvedPath.replace("{EmailIdentity}", __extendedEncodeURIComponent(labelValue));
267
- }
268
- else {
269
- throw new Error("No value provided for input HTTP label: EmailIdentity.");
270
- }
216
+ resolvedPath = __resolvedPath(resolvedPath, input, "EmailIdentity", function () { return input.EmailIdentity; }, "{EmailIdentity}", false);
271
217
  return [2, new __HttpRequest({
272
218
  protocol: protocol,
273
219
  hostname: hostname,
@@ -314,9 +260,12 @@ export var serializeAws_restJson1GetBlacklistReportsCommand = function (input, c
314
260
  headers = {};
315
261
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
316
262
  "/v1/email/deliverability-dashboard/blacklist-report";
317
- query = __assign({}, (input.BlacklistItemNames !== undefined && {
318
- BlacklistItemNames: (input.BlacklistItemNames || []).map(function (_entry) { return _entry; }),
319
- }));
263
+ query = map({
264
+ BlacklistItemNames: [
265
+ function () { return input.BlacklistItemNames !== void 0; },
266
+ function () { return (input.BlacklistItemNames || []).map(function (_entry) { return _entry; }); },
267
+ ],
268
+ });
320
269
  return [2, new __HttpRequest({
321
270
  protocol: protocol,
322
271
  hostname: hostname,
@@ -331,7 +280,7 @@ export var serializeAws_restJson1GetBlacklistReportsCommand = function (input, c
331
280
  });
332
281
  }); };
333
282
  export var serializeAws_restJson1GetConfigurationSetCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
334
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
283
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
335
284
  return __generator(this, function (_c) {
336
285
  switch (_c.label) {
337
286
  case 0: return [4, context.endpoint()];
@@ -340,16 +289,7 @@ export var serializeAws_restJson1GetConfigurationSetCommand = function (input, c
340
289
  headers = {};
341
290
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
342
291
  "/v1/email/configuration-sets/{ConfigurationSetName}";
343
- if (input.ConfigurationSetName !== undefined) {
344
- labelValue = input.ConfigurationSetName;
345
- if (labelValue.length <= 0) {
346
- throw new Error("Empty value provided for input HTTP label: ConfigurationSetName.");
347
- }
348
- resolvedPath = resolvedPath.replace("{ConfigurationSetName}", __extendedEncodeURIComponent(labelValue));
349
- }
350
- else {
351
- throw new Error("No value provided for input HTTP label: ConfigurationSetName.");
352
- }
292
+ resolvedPath = __resolvedPath(resolvedPath, input, "ConfigurationSetName", function () { return input.ConfigurationSetName; }, "{ConfigurationSetName}", false);
353
293
  return [2, new __HttpRequest({
354
294
  protocol: protocol,
355
295
  hostname: hostname,
@@ -363,7 +303,7 @@ export var serializeAws_restJson1GetConfigurationSetCommand = function (input, c
363
303
  });
364
304
  }); };
365
305
  export var serializeAws_restJson1GetConfigurationSetEventDestinationsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
366
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
306
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
367
307
  return __generator(this, function (_c) {
368
308
  switch (_c.label) {
369
309
  case 0: return [4, context.endpoint()];
@@ -372,16 +312,7 @@ export var serializeAws_restJson1GetConfigurationSetEventDestinationsCommand = f
372
312
  headers = {};
373
313
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
374
314
  "/v1/email/configuration-sets/{ConfigurationSetName}/event-destinations";
375
- if (input.ConfigurationSetName !== undefined) {
376
- labelValue = input.ConfigurationSetName;
377
- if (labelValue.length <= 0) {
378
- throw new Error("Empty value provided for input HTTP label: ConfigurationSetName.");
379
- }
380
- resolvedPath = resolvedPath.replace("{ConfigurationSetName}", __extendedEncodeURIComponent(labelValue));
381
- }
382
- else {
383
- throw new Error("No value provided for input HTTP label: ConfigurationSetName.");
384
- }
315
+ resolvedPath = __resolvedPath(resolvedPath, input, "ConfigurationSetName", function () { return input.ConfigurationSetName; }, "{ConfigurationSetName}", false);
385
316
  return [2, new __HttpRequest({
386
317
  protocol: protocol,
387
318
  hostname: hostname,
@@ -395,7 +326,7 @@ export var serializeAws_restJson1GetConfigurationSetEventDestinationsCommand = f
395
326
  });
396
327
  }); };
397
328
  export var serializeAws_restJson1GetDedicatedIpCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
398
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
329
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
399
330
  return __generator(this, function (_c) {
400
331
  switch (_c.label) {
401
332
  case 0: return [4, context.endpoint()];
@@ -403,16 +334,7 @@ export var serializeAws_restJson1GetDedicatedIpCommand = function (input, contex
403
334
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
404
335
  headers = {};
405
336
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/email/dedicated-ips/{Ip}";
406
- if (input.Ip !== undefined) {
407
- labelValue = input.Ip;
408
- if (labelValue.length <= 0) {
409
- throw new Error("Empty value provided for input HTTP label: Ip.");
410
- }
411
- resolvedPath = resolvedPath.replace("{Ip}", __extendedEncodeURIComponent(labelValue));
412
- }
413
- else {
414
- throw new Error("No value provided for input HTTP label: Ip.");
415
- }
337
+ resolvedPath = __resolvedPath(resolvedPath, input, "Ip", function () { return input.Ip; }, "{Ip}", false);
416
338
  return [2, new __HttpRequest({
417
339
  protocol: protocol,
418
340
  hostname: hostname,
@@ -434,7 +356,11 @@ export var serializeAws_restJson1GetDedicatedIpsCommand = function (input, conte
434
356
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
435
357
  headers = {};
436
358
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/email/dedicated-ips";
437
- query = __assign(__assign(__assign({}, (input.PoolName !== undefined && { PoolName: input.PoolName })), (input.NextToken !== undefined && { NextToken: input.NextToken })), (input.PageSize !== undefined && { PageSize: input.PageSize.toString() }));
359
+ query = map({
360
+ PoolName: [, input.PoolName],
361
+ NextToken: [, input.NextToken],
362
+ PageSize: [function () { return input.PageSize !== void 0; }, function () { return input.PageSize.toString(); }],
363
+ });
438
364
  return [2, new __HttpRequest({
439
365
  protocol: protocol,
440
366
  hostname: hostname,
@@ -473,7 +399,7 @@ export var serializeAws_restJson1GetDeliverabilityDashboardOptionsCommand = func
473
399
  });
474
400
  }); };
475
401
  export var serializeAws_restJson1GetDeliverabilityTestReportCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
476
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
402
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
477
403
  return __generator(this, function (_c) {
478
404
  switch (_c.label) {
479
405
  case 0: return [4, context.endpoint()];
@@ -482,16 +408,7 @@ export var serializeAws_restJson1GetDeliverabilityTestReportCommand = function (
482
408
  headers = {};
483
409
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
484
410
  "/v1/email/deliverability-dashboard/test-reports/{ReportId}";
485
- if (input.ReportId !== undefined) {
486
- labelValue = input.ReportId;
487
- if (labelValue.length <= 0) {
488
- throw new Error("Empty value provided for input HTTP label: ReportId.");
489
- }
490
- resolvedPath = resolvedPath.replace("{ReportId}", __extendedEncodeURIComponent(labelValue));
491
- }
492
- else {
493
- throw new Error("No value provided for input HTTP label: ReportId.");
494
- }
411
+ resolvedPath = __resolvedPath(resolvedPath, input, "ReportId", function () { return input.ReportId; }, "{ReportId}", false);
495
412
  return [2, new __HttpRequest({
496
413
  protocol: protocol,
497
414
  hostname: hostname,
@@ -505,7 +422,7 @@ export var serializeAws_restJson1GetDeliverabilityTestReportCommand = function (
505
422
  });
506
423
  }); };
507
424
  export var serializeAws_restJson1GetDomainDeliverabilityCampaignCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
508
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
425
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
509
426
  return __generator(this, function (_c) {
510
427
  switch (_c.label) {
511
428
  case 0: return [4, context.endpoint()];
@@ -514,16 +431,7 @@ export var serializeAws_restJson1GetDomainDeliverabilityCampaignCommand = functi
514
431
  headers = {};
515
432
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
516
433
  "/v1/email/deliverability-dashboard/campaigns/{CampaignId}";
517
- if (input.CampaignId !== undefined) {
518
- labelValue = input.CampaignId;
519
- if (labelValue.length <= 0) {
520
- throw new Error("Empty value provided for input HTTP label: CampaignId.");
521
- }
522
- resolvedPath = resolvedPath.replace("{CampaignId}", __extendedEncodeURIComponent(labelValue));
523
- }
524
- else {
525
- throw new Error("No value provided for input HTTP label: CampaignId.");
526
- }
434
+ resolvedPath = __resolvedPath(resolvedPath, input, "CampaignId", function () { return input.CampaignId; }, "{CampaignId}", false);
527
435
  return [2, new __HttpRequest({
528
436
  protocol: protocol,
529
437
  hostname: hostname,
@@ -537,7 +445,7 @@ export var serializeAws_restJson1GetDomainDeliverabilityCampaignCommand = functi
537
445
  });
538
446
  }); };
539
447
  export var serializeAws_restJson1GetDomainStatisticsReportCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
540
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
448
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
541
449
  return __generator(this, function (_c) {
542
450
  switch (_c.label) {
543
451
  case 0: return [4, context.endpoint()];
@@ -546,17 +454,14 @@ export var serializeAws_restJson1GetDomainStatisticsReportCommand = function (in
546
454
  headers = {};
547
455
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
548
456
  "/v1/email/deliverability-dashboard/statistics-report/{Domain}";
549
- if (input.Domain !== undefined) {
550
- labelValue = input.Domain;
551
- if (labelValue.length <= 0) {
552
- throw new Error("Empty value provided for input HTTP label: Domain.");
553
- }
554
- resolvedPath = resolvedPath.replace("{Domain}", __extendedEncodeURIComponent(labelValue));
555
- }
556
- else {
557
- throw new Error("No value provided for input HTTP label: Domain.");
558
- }
559
- query = __assign(__assign({}, (input.StartDate !== undefined && { StartDate: (input.StartDate.toISOString().split(".")[0] + "Z").toString() })), (input.EndDate !== undefined && { EndDate: (input.EndDate.toISOString().split(".")[0] + "Z").toString() }));
457
+ resolvedPath = __resolvedPath(resolvedPath, input, "Domain", function () { return input.Domain; }, "{Domain}", false);
458
+ query = map({
459
+ StartDate: [
460
+ function () { return input.StartDate !== void 0; },
461
+ function () { return (input.StartDate.toISOString().split(".")[0] + "Z").toString(); },
462
+ ],
463
+ EndDate: [function () { return input.EndDate !== void 0; }, function () { return (input.EndDate.toISOString().split(".")[0] + "Z").toString(); }],
464
+ });
560
465
  return [2, new __HttpRequest({
561
466
  protocol: protocol,
562
467
  hostname: hostname,
@@ -571,7 +476,7 @@ export var serializeAws_restJson1GetDomainStatisticsReportCommand = function (in
571
476
  });
572
477
  }); };
573
478
  export var serializeAws_restJson1GetEmailIdentityCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
574
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
479
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
575
480
  return __generator(this, function (_c) {
576
481
  switch (_c.label) {
577
482
  case 0: return [4, context.endpoint()];
@@ -579,16 +484,7 @@ export var serializeAws_restJson1GetEmailIdentityCommand = function (input, cont
579
484
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
580
485
  headers = {};
581
486
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/email/identities/{EmailIdentity}";
582
- if (input.EmailIdentity !== undefined) {
583
- labelValue = input.EmailIdentity;
584
- if (labelValue.length <= 0) {
585
- throw new Error("Empty value provided for input HTTP label: EmailIdentity.");
586
- }
587
- resolvedPath = resolvedPath.replace("{EmailIdentity}", __extendedEncodeURIComponent(labelValue));
588
- }
589
- else {
590
- throw new Error("No value provided for input HTTP label: EmailIdentity.");
591
- }
487
+ resolvedPath = __resolvedPath(resolvedPath, input, "EmailIdentity", function () { return input.EmailIdentity; }, "{EmailIdentity}", false);
592
488
  return [2, new __HttpRequest({
593
489
  protocol: protocol,
594
490
  hostname: hostname,
@@ -610,7 +506,10 @@ export var serializeAws_restJson1ListConfigurationSetsCommand = function (input,
610
506
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
611
507
  headers = {};
612
508
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/email/configuration-sets";
613
- query = __assign(__assign({}, (input.NextToken !== undefined && { NextToken: input.NextToken })), (input.PageSize !== undefined && { PageSize: input.PageSize.toString() }));
509
+ query = map({
510
+ NextToken: [, input.NextToken],
511
+ PageSize: [function () { return input.PageSize !== void 0; }, function () { return input.PageSize.toString(); }],
512
+ });
614
513
  return [2, new __HttpRequest({
615
514
  protocol: protocol,
616
515
  hostname: hostname,
@@ -633,7 +532,10 @@ export var serializeAws_restJson1ListDedicatedIpPoolsCommand = function (input,
633
532
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
634
533
  headers = {};
635
534
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/email/dedicated-ip-pools";
636
- query = __assign(__assign({}, (input.NextToken !== undefined && { NextToken: input.NextToken })), (input.PageSize !== undefined && { PageSize: input.PageSize.toString() }));
535
+ query = map({
536
+ NextToken: [, input.NextToken],
537
+ PageSize: [function () { return input.PageSize !== void 0; }, function () { return input.PageSize.toString(); }],
538
+ });
637
539
  return [2, new __HttpRequest({
638
540
  protocol: protocol,
639
541
  hostname: hostname,
@@ -657,7 +559,10 @@ export var serializeAws_restJson1ListDeliverabilityTestReportsCommand = function
657
559
  headers = {};
658
560
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
659
561
  "/v1/email/deliverability-dashboard/test-reports";
660
- query = __assign(__assign({}, (input.NextToken !== undefined && { NextToken: input.NextToken })), (input.PageSize !== undefined && { PageSize: input.PageSize.toString() }));
562
+ query = map({
563
+ NextToken: [, input.NextToken],
564
+ PageSize: [function () { return input.PageSize !== void 0; }, function () { return input.PageSize.toString(); }],
565
+ });
661
566
  return [2, new __HttpRequest({
662
567
  protocol: protocol,
663
568
  hostname: hostname,
@@ -672,7 +577,7 @@ export var serializeAws_restJson1ListDeliverabilityTestReportsCommand = function
672
577
  });
673
578
  }); };
674
579
  export var serializeAws_restJson1ListDomainDeliverabilityCampaignsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
675
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
580
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
676
581
  return __generator(this, function (_c) {
677
582
  switch (_c.label) {
678
583
  case 0: return [4, context.endpoint()];
@@ -681,17 +586,16 @@ export var serializeAws_restJson1ListDomainDeliverabilityCampaignsCommand = func
681
586
  headers = {};
682
587
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
683
588
  "/v1/email/deliverability-dashboard/domains/{SubscribedDomain}/campaigns";
684
- if (input.SubscribedDomain !== undefined) {
685
- labelValue = input.SubscribedDomain;
686
- if (labelValue.length <= 0) {
687
- throw new Error("Empty value provided for input HTTP label: SubscribedDomain.");
688
- }
689
- resolvedPath = resolvedPath.replace("{SubscribedDomain}", __extendedEncodeURIComponent(labelValue));
690
- }
691
- else {
692
- throw new Error("No value provided for input HTTP label: SubscribedDomain.");
693
- }
694
- query = __assign(__assign(__assign(__assign({}, (input.StartDate !== undefined && { StartDate: (input.StartDate.toISOString().split(".")[0] + "Z").toString() })), (input.EndDate !== undefined && { EndDate: (input.EndDate.toISOString().split(".")[0] + "Z").toString() })), (input.NextToken !== undefined && { NextToken: input.NextToken })), (input.PageSize !== undefined && { PageSize: input.PageSize.toString() }));
589
+ resolvedPath = __resolvedPath(resolvedPath, input, "SubscribedDomain", function () { return input.SubscribedDomain; }, "{SubscribedDomain}", false);
590
+ query = map({
591
+ StartDate: [
592
+ function () { return input.StartDate !== void 0; },
593
+ function () { return (input.StartDate.toISOString().split(".")[0] + "Z").toString(); },
594
+ ],
595
+ EndDate: [function () { return input.EndDate !== void 0; }, function () { return (input.EndDate.toISOString().split(".")[0] + "Z").toString(); }],
596
+ NextToken: [, input.NextToken],
597
+ PageSize: [function () { return input.PageSize !== void 0; }, function () { return input.PageSize.toString(); }],
598
+ });
695
599
  return [2, new __HttpRequest({
696
600
  protocol: protocol,
697
601
  hostname: hostname,
@@ -714,7 +618,10 @@ export var serializeAws_restJson1ListEmailIdentitiesCommand = function (input, c
714
618
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
715
619
  headers = {};
716
620
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/email/identities";
717
- query = __assign(__assign({}, (input.NextToken !== undefined && { NextToken: input.NextToken })), (input.PageSize !== undefined && { PageSize: input.PageSize.toString() }));
621
+ query = map({
622
+ NextToken: [, input.NextToken],
623
+ PageSize: [function () { return input.PageSize !== void 0; }, function () { return input.PageSize.toString(); }],
624
+ });
718
625
  return [2, new __HttpRequest({
719
626
  protocol: protocol,
720
627
  hostname: hostname,
@@ -737,7 +644,9 @@ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, c
737
644
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
738
645
  headers = {};
739
646
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/email/tags";
740
- query = __assign({}, (input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }));
647
+ query = map({
648
+ ResourceArn: [, input.ResourceArn],
649
+ });
741
650
  return [2, new __HttpRequest({
742
651
  protocol: protocol,
743
652
  hostname: hostname,
@@ -800,7 +709,7 @@ export var serializeAws_restJson1PutAccountSendingAttributesCommand = function (
800
709
  });
801
710
  }); };
802
711
  export var serializeAws_restJson1PutConfigurationSetDeliveryOptionsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
803
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
712
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
804
713
  return __generator(this, function (_c) {
805
714
  switch (_c.label) {
806
715
  case 0: return [4, context.endpoint()];
@@ -811,16 +720,7 @@ export var serializeAws_restJson1PutConfigurationSetDeliveryOptionsCommand = fun
811
720
  };
812
721
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
813
722
  "/v1/email/configuration-sets/{ConfigurationSetName}/delivery-options";
814
- if (input.ConfigurationSetName !== undefined) {
815
- labelValue = input.ConfigurationSetName;
816
- if (labelValue.length <= 0) {
817
- throw new Error("Empty value provided for input HTTP label: ConfigurationSetName.");
818
- }
819
- resolvedPath = resolvedPath.replace("{ConfigurationSetName}", __extendedEncodeURIComponent(labelValue));
820
- }
821
- else {
822
- throw new Error("No value provided for input HTTP label: ConfigurationSetName.");
823
- }
723
+ resolvedPath = __resolvedPath(resolvedPath, input, "ConfigurationSetName", function () { return input.ConfigurationSetName; }, "{ConfigurationSetName}", false);
824
724
  body = JSON.stringify(__assign(__assign({}, (input.SendingPoolName != null && { SendingPoolName: input.SendingPoolName })), (input.TlsPolicy != null && { TlsPolicy: input.TlsPolicy })));
825
725
  return [2, new __HttpRequest({
826
726
  protocol: protocol,
@@ -835,7 +735,7 @@ export var serializeAws_restJson1PutConfigurationSetDeliveryOptionsCommand = fun
835
735
  });
836
736
  }); };
837
737
  export var serializeAws_restJson1PutConfigurationSetReputationOptionsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
838
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
738
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
839
739
  return __generator(this, function (_c) {
840
740
  switch (_c.label) {
841
741
  case 0: return [4, context.endpoint()];
@@ -846,16 +746,7 @@ export var serializeAws_restJson1PutConfigurationSetReputationOptionsCommand = f
846
746
  };
847
747
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
848
748
  "/v1/email/configuration-sets/{ConfigurationSetName}/reputation-options";
849
- if (input.ConfigurationSetName !== undefined) {
850
- labelValue = input.ConfigurationSetName;
851
- if (labelValue.length <= 0) {
852
- throw new Error("Empty value provided for input HTTP label: ConfigurationSetName.");
853
- }
854
- resolvedPath = resolvedPath.replace("{ConfigurationSetName}", __extendedEncodeURIComponent(labelValue));
855
- }
856
- else {
857
- throw new Error("No value provided for input HTTP label: ConfigurationSetName.");
858
- }
749
+ resolvedPath = __resolvedPath(resolvedPath, input, "ConfigurationSetName", function () { return input.ConfigurationSetName; }, "{ConfigurationSetName}", false);
859
750
  body = JSON.stringify(__assign({}, (input.ReputationMetricsEnabled != null && { ReputationMetricsEnabled: input.ReputationMetricsEnabled })));
860
751
  return [2, new __HttpRequest({
861
752
  protocol: protocol,
@@ -870,7 +761,7 @@ export var serializeAws_restJson1PutConfigurationSetReputationOptionsCommand = f
870
761
  });
871
762
  }); };
872
763
  export var serializeAws_restJson1PutConfigurationSetSendingOptionsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
873
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
764
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
874
765
  return __generator(this, function (_c) {
875
766
  switch (_c.label) {
876
767
  case 0: return [4, context.endpoint()];
@@ -881,16 +772,7 @@ export var serializeAws_restJson1PutConfigurationSetSendingOptionsCommand = func
881
772
  };
882
773
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
883
774
  "/v1/email/configuration-sets/{ConfigurationSetName}/sending";
884
- if (input.ConfigurationSetName !== undefined) {
885
- labelValue = input.ConfigurationSetName;
886
- if (labelValue.length <= 0) {
887
- throw new Error("Empty value provided for input HTTP label: ConfigurationSetName.");
888
- }
889
- resolvedPath = resolvedPath.replace("{ConfigurationSetName}", __extendedEncodeURIComponent(labelValue));
890
- }
891
- else {
892
- throw new Error("No value provided for input HTTP label: ConfigurationSetName.");
893
- }
775
+ resolvedPath = __resolvedPath(resolvedPath, input, "ConfigurationSetName", function () { return input.ConfigurationSetName; }, "{ConfigurationSetName}", false);
894
776
  body = JSON.stringify(__assign({}, (input.SendingEnabled != null && { SendingEnabled: input.SendingEnabled })));
895
777
  return [2, new __HttpRequest({
896
778
  protocol: protocol,
@@ -905,7 +787,7 @@ export var serializeAws_restJson1PutConfigurationSetSendingOptionsCommand = func
905
787
  });
906
788
  }); };
907
789
  export var serializeAws_restJson1PutConfigurationSetTrackingOptionsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
908
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
790
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
909
791
  return __generator(this, function (_c) {
910
792
  switch (_c.label) {
911
793
  case 0: return [4, context.endpoint()];
@@ -916,16 +798,7 @@ export var serializeAws_restJson1PutConfigurationSetTrackingOptionsCommand = fun
916
798
  };
917
799
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
918
800
  "/v1/email/configuration-sets/{ConfigurationSetName}/tracking-options";
919
- if (input.ConfigurationSetName !== undefined) {
920
- labelValue = input.ConfigurationSetName;
921
- if (labelValue.length <= 0) {
922
- throw new Error("Empty value provided for input HTTP label: ConfigurationSetName.");
923
- }
924
- resolvedPath = resolvedPath.replace("{ConfigurationSetName}", __extendedEncodeURIComponent(labelValue));
925
- }
926
- else {
927
- throw new Error("No value provided for input HTTP label: ConfigurationSetName.");
928
- }
801
+ resolvedPath = __resolvedPath(resolvedPath, input, "ConfigurationSetName", function () { return input.ConfigurationSetName; }, "{ConfigurationSetName}", false);
929
802
  body = JSON.stringify(__assign({}, (input.CustomRedirectDomain != null && { CustomRedirectDomain: input.CustomRedirectDomain })));
930
803
  return [2, new __HttpRequest({
931
804
  protocol: protocol,
@@ -940,7 +813,7 @@ export var serializeAws_restJson1PutConfigurationSetTrackingOptionsCommand = fun
940
813
  });
941
814
  }); };
942
815
  export var serializeAws_restJson1PutDedicatedIpInPoolCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
943
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
816
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
944
817
  return __generator(this, function (_c) {
945
818
  switch (_c.label) {
946
819
  case 0: return [4, context.endpoint()];
@@ -950,16 +823,7 @@ export var serializeAws_restJson1PutDedicatedIpInPoolCommand = function (input,
950
823
  "content-type": "application/json",
951
824
  };
952
825
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/email/dedicated-ips/{Ip}/pool";
953
- if (input.Ip !== undefined) {
954
- labelValue = input.Ip;
955
- if (labelValue.length <= 0) {
956
- throw new Error("Empty value provided for input HTTP label: Ip.");
957
- }
958
- resolvedPath = resolvedPath.replace("{Ip}", __extendedEncodeURIComponent(labelValue));
959
- }
960
- else {
961
- throw new Error("No value provided for input HTTP label: Ip.");
962
- }
826
+ resolvedPath = __resolvedPath(resolvedPath, input, "Ip", function () { return input.Ip; }, "{Ip}", false);
963
827
  body = JSON.stringify(__assign({}, (input.DestinationPoolName != null && { DestinationPoolName: input.DestinationPoolName })));
964
828
  return [2, new __HttpRequest({
965
829
  protocol: protocol,
@@ -974,7 +838,7 @@ export var serializeAws_restJson1PutDedicatedIpInPoolCommand = function (input,
974
838
  });
975
839
  }); };
976
840
  export var serializeAws_restJson1PutDedicatedIpWarmupAttributesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
977
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
841
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
978
842
  return __generator(this, function (_c) {
979
843
  switch (_c.label) {
980
844
  case 0: return [4, context.endpoint()];
@@ -984,16 +848,7 @@ export var serializeAws_restJson1PutDedicatedIpWarmupAttributesCommand = functio
984
848
  "content-type": "application/json",
985
849
  };
986
850
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/email/dedicated-ips/{Ip}/warmup";
987
- if (input.Ip !== undefined) {
988
- labelValue = input.Ip;
989
- if (labelValue.length <= 0) {
990
- throw new Error("Empty value provided for input HTTP label: Ip.");
991
- }
992
- resolvedPath = resolvedPath.replace("{Ip}", __extendedEncodeURIComponent(labelValue));
993
- }
994
- else {
995
- throw new Error("No value provided for input HTTP label: Ip.");
996
- }
851
+ resolvedPath = __resolvedPath(resolvedPath, input, "Ip", function () { return input.Ip; }, "{Ip}", false);
997
852
  body = JSON.stringify(__assign({}, (input.WarmupPercentage != null && { WarmupPercentage: input.WarmupPercentage })));
998
853
  return [2, new __HttpRequest({
999
854
  protocol: protocol,
@@ -1034,7 +889,7 @@ export var serializeAws_restJson1PutDeliverabilityDashboardOptionCommand = funct
1034
889
  });
1035
890
  }); };
1036
891
  export var serializeAws_restJson1PutEmailIdentityDkimAttributesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1037
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
892
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1038
893
  return __generator(this, function (_c) {
1039
894
  switch (_c.label) {
1040
895
  case 0: return [4, context.endpoint()];
@@ -1044,16 +899,7 @@ export var serializeAws_restJson1PutEmailIdentityDkimAttributesCommand = functio
1044
899
  "content-type": "application/json",
1045
900
  };
1046
901
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/email/identities/{EmailIdentity}/dkim";
1047
- if (input.EmailIdentity !== undefined) {
1048
- labelValue = input.EmailIdentity;
1049
- if (labelValue.length <= 0) {
1050
- throw new Error("Empty value provided for input HTTP label: EmailIdentity.");
1051
- }
1052
- resolvedPath = resolvedPath.replace("{EmailIdentity}", __extendedEncodeURIComponent(labelValue));
1053
- }
1054
- else {
1055
- throw new Error("No value provided for input HTTP label: EmailIdentity.");
1056
- }
902
+ resolvedPath = __resolvedPath(resolvedPath, input, "EmailIdentity", function () { return input.EmailIdentity; }, "{EmailIdentity}", false);
1057
903
  body = JSON.stringify(__assign({}, (input.SigningEnabled != null && { SigningEnabled: input.SigningEnabled })));
1058
904
  return [2, new __HttpRequest({
1059
905
  protocol: protocol,
@@ -1068,7 +914,7 @@ export var serializeAws_restJson1PutEmailIdentityDkimAttributesCommand = functio
1068
914
  });
1069
915
  }); };
1070
916
  export var serializeAws_restJson1PutEmailIdentityFeedbackAttributesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1071
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
917
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1072
918
  return __generator(this, function (_c) {
1073
919
  switch (_c.label) {
1074
920
  case 0: return [4, context.endpoint()];
@@ -1079,16 +925,7 @@ export var serializeAws_restJson1PutEmailIdentityFeedbackAttributesCommand = fun
1079
925
  };
1080
926
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1081
927
  "/v1/email/identities/{EmailIdentity}/feedback";
1082
- if (input.EmailIdentity !== undefined) {
1083
- labelValue = input.EmailIdentity;
1084
- if (labelValue.length <= 0) {
1085
- throw new Error("Empty value provided for input HTTP label: EmailIdentity.");
1086
- }
1087
- resolvedPath = resolvedPath.replace("{EmailIdentity}", __extendedEncodeURIComponent(labelValue));
1088
- }
1089
- else {
1090
- throw new Error("No value provided for input HTTP label: EmailIdentity.");
1091
- }
928
+ resolvedPath = __resolvedPath(resolvedPath, input, "EmailIdentity", function () { return input.EmailIdentity; }, "{EmailIdentity}", false);
1092
929
  body = JSON.stringify(__assign({}, (input.EmailForwardingEnabled != null && { EmailForwardingEnabled: input.EmailForwardingEnabled })));
1093
930
  return [2, new __HttpRequest({
1094
931
  protocol: protocol,
@@ -1103,7 +940,7 @@ export var serializeAws_restJson1PutEmailIdentityFeedbackAttributesCommand = fun
1103
940
  });
1104
941
  }); };
1105
942
  export var serializeAws_restJson1PutEmailIdentityMailFromAttributesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1106
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
943
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1107
944
  return __generator(this, function (_c) {
1108
945
  switch (_c.label) {
1109
946
  case 0: return [4, context.endpoint()];
@@ -1114,16 +951,7 @@ export var serializeAws_restJson1PutEmailIdentityMailFromAttributesCommand = fun
1114
951
  };
1115
952
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1116
953
  "/v1/email/identities/{EmailIdentity}/mail-from";
1117
- if (input.EmailIdentity !== undefined) {
1118
- labelValue = input.EmailIdentity;
1119
- if (labelValue.length <= 0) {
1120
- throw new Error("Empty value provided for input HTTP label: EmailIdentity.");
1121
- }
1122
- resolvedPath = resolvedPath.replace("{EmailIdentity}", __extendedEncodeURIComponent(labelValue));
1123
- }
1124
- else {
1125
- throw new Error("No value provided for input HTTP label: EmailIdentity.");
1126
- }
954
+ resolvedPath = __resolvedPath(resolvedPath, input, "EmailIdentity", function () { return input.EmailIdentity; }, "{EmailIdentity}", false);
1127
955
  body = JSON.stringify(__assign(__assign({}, (input.BehaviorOnMxFailure != null && { BehaviorOnMxFailure: input.BehaviorOnMxFailure })), (input.MailFromDomain != null && { MailFromDomain: input.MailFromDomain })));
1128
956
  return [2, new __HttpRequest({
1129
957
  protocol: protocol,
@@ -1198,7 +1026,10 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
1198
1026
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
1199
1027
  headers = {};
1200
1028
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/email/tags";
1201
- query = __assign(__assign({}, (input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn })), (input.TagKeys !== undefined && { TagKeys: (input.TagKeys || []).map(function (_entry) { return _entry; }) }));
1029
+ query = map({
1030
+ ResourceArn: [, input.ResourceArn],
1031
+ TagKeys: [function () { return input.TagKeys !== void 0; }, function () { return (input.TagKeys || []).map(function (_entry) { return _entry; }); }],
1032
+ });
1202
1033
  return [2, new __HttpRequest({
1203
1034
  protocol: protocol,
1204
1035
  hostname: hostname,
@@ -1213,7 +1044,7 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
1213
1044
  });
1214
1045
  }); };
1215
1046
  export var serializeAws_restJson1UpdateConfigurationSetEventDestinationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1216
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
1047
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1217
1048
  return __generator(this, function (_c) {
1218
1049
  switch (_c.label) {
1219
1050
  case 0: return [4, context.endpoint()];
@@ -1224,26 +1055,8 @@ export var serializeAws_restJson1UpdateConfigurationSetEventDestinationCommand =
1224
1055
  };
1225
1056
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1226
1057
  "/v1/email/configuration-sets/{ConfigurationSetName}/event-destinations/{EventDestinationName}";
1227
- if (input.ConfigurationSetName !== undefined) {
1228
- labelValue = input.ConfigurationSetName;
1229
- if (labelValue.length <= 0) {
1230
- throw new Error("Empty value provided for input HTTP label: ConfigurationSetName.");
1231
- }
1232
- resolvedPath = resolvedPath.replace("{ConfigurationSetName}", __extendedEncodeURIComponent(labelValue));
1233
- }
1234
- else {
1235
- throw new Error("No value provided for input HTTP label: ConfigurationSetName.");
1236
- }
1237
- if (input.EventDestinationName !== undefined) {
1238
- labelValue = input.EventDestinationName;
1239
- if (labelValue.length <= 0) {
1240
- throw new Error("Empty value provided for input HTTP label: EventDestinationName.");
1241
- }
1242
- resolvedPath = resolvedPath.replace("{EventDestinationName}", __extendedEncodeURIComponent(labelValue));
1243
- }
1244
- else {
1245
- throw new Error("No value provided for input HTTP label: EventDestinationName.");
1246
- }
1058
+ resolvedPath = __resolvedPath(resolvedPath, input, "ConfigurationSetName", function () { return input.ConfigurationSetName; }, "{ConfigurationSetName}", false);
1059
+ resolvedPath = __resolvedPath(resolvedPath, input, "EventDestinationName", function () { return input.EventDestinationName; }, "{EventDestinationName}", false);
1247
1060
  body = JSON.stringify(__assign({}, (input.EventDestination != null && {
1248
1061
  EventDestination: serializeAws_restJson1EventDestinationDefinition(input.EventDestination, context),
1249
1062
  })));
@@ -1267,18 +1080,18 @@ export var deserializeAws_restJson1CreateConfigurationSetCommand = function (out
1267
1080
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1268
1081
  return [2, deserializeAws_restJson1CreateConfigurationSetCommandError(output, context)];
1269
1082
  }
1270
- contents = {
1083
+ contents = map({
1271
1084
  $metadata: deserializeMetadata(output),
1272
- };
1085
+ });
1273
1086
  return [4, collectBody(output.body, context)];
1274
1087
  case 1:
1275
1088
  _a.sent();
1276
- return [2, Promise.resolve(contents)];
1089
+ return [2, contents];
1277
1090
  }
1278
1091
  });
1279
1092
  }); };
1280
1093
  var deserializeAws_restJson1CreateConfigurationSetCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1281
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1094
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1282
1095
  var _c;
1283
1096
  return __generator(this, function (_d) {
1284
1097
  switch (_d.label) {
@@ -1319,14 +1132,14 @@ var deserializeAws_restJson1CreateConfigurationSetCommandError = function (outpu
1319
1132
  case 13: throw _d.sent();
1320
1133
  case 14:
1321
1134
  parsedBody = parsedOutput.body;
1322
- $metadata = deserializeMetadata(output);
1323
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1324
- response = new __BaseException({
1325
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1326
- $fault: "client",
1327
- $metadata: $metadata,
1135
+ throwDefaultError({
1136
+ output: output,
1137
+ parsedBody: parsedBody,
1138
+ exceptionCtor: __BaseException,
1139
+ errorCode: errorCode,
1328
1140
  });
1329
- throw __decorateServiceException(response, parsedBody);
1141
+ _d.label = 15;
1142
+ case 15: return [2];
1330
1143
  }
1331
1144
  });
1332
1145
  }); };
@@ -1338,18 +1151,18 @@ export var deserializeAws_restJson1CreateConfigurationSetEventDestinationCommand
1338
1151
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1339
1152
  return [2, deserializeAws_restJson1CreateConfigurationSetEventDestinationCommandError(output, context)];
1340
1153
  }
1341
- contents = {
1154
+ contents = map({
1342
1155
  $metadata: deserializeMetadata(output),
1343
- };
1156
+ });
1344
1157
  return [4, collectBody(output.body, context)];
1345
1158
  case 1:
1346
1159
  _a.sent();
1347
- return [2, Promise.resolve(contents)];
1160
+ return [2, contents];
1348
1161
  }
1349
1162
  });
1350
1163
  }); };
1351
1164
  var deserializeAws_restJson1CreateConfigurationSetEventDestinationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1352
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1165
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1353
1166
  var _c;
1354
1167
  return __generator(this, function (_d) {
1355
1168
  switch (_d.label) {
@@ -1386,14 +1199,14 @@ var deserializeAws_restJson1CreateConfigurationSetEventDestinationCommandError =
1386
1199
  case 11: throw _d.sent();
1387
1200
  case 12:
1388
1201
  parsedBody = parsedOutput.body;
1389
- $metadata = deserializeMetadata(output);
1390
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1391
- response = new __BaseException({
1392
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1393
- $fault: "client",
1394
- $metadata: $metadata,
1202
+ throwDefaultError({
1203
+ output: output,
1204
+ parsedBody: parsedBody,
1205
+ exceptionCtor: __BaseException,
1206
+ errorCode: errorCode,
1395
1207
  });
1396
- throw __decorateServiceException(response, parsedBody);
1208
+ _d.label = 13;
1209
+ case 13: return [2];
1397
1210
  }
1398
1211
  });
1399
1212
  }); };
@@ -1405,18 +1218,18 @@ export var deserializeAws_restJson1CreateDedicatedIpPoolCommand = function (outp
1405
1218
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1406
1219
  return [2, deserializeAws_restJson1CreateDedicatedIpPoolCommandError(output, context)];
1407
1220
  }
1408
- contents = {
1221
+ contents = map({
1409
1222
  $metadata: deserializeMetadata(output),
1410
- };
1223
+ });
1411
1224
  return [4, collectBody(output.body, context)];
1412
1225
  case 1:
1413
1226
  _a.sent();
1414
- return [2, Promise.resolve(contents)];
1227
+ return [2, contents];
1415
1228
  }
1416
1229
  });
1417
1230
  }); };
1418
1231
  var deserializeAws_restJson1CreateDedicatedIpPoolCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1419
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1232
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1420
1233
  var _c;
1421
1234
  return __generator(this, function (_d) {
1422
1235
  switch (_d.label) {
@@ -1453,14 +1266,14 @@ var deserializeAws_restJson1CreateDedicatedIpPoolCommandError = function (output
1453
1266
  case 11: throw _d.sent();
1454
1267
  case 12:
1455
1268
  parsedBody = parsedOutput.body;
1456
- $metadata = deserializeMetadata(output);
1457
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1458
- response = new __BaseException({
1459
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1460
- $fault: "client",
1461
- $metadata: $metadata,
1269
+ throwDefaultError({
1270
+ output: output,
1271
+ parsedBody: parsedBody,
1272
+ exceptionCtor: __BaseException,
1273
+ errorCode: errorCode,
1462
1274
  });
1463
- throw __decorateServiceException(response, parsedBody);
1275
+ _d.label = 13;
1276
+ case 13: return [2];
1464
1277
  }
1465
1278
  });
1466
1279
  }); };
@@ -1472,28 +1285,26 @@ export var deserializeAws_restJson1CreateDeliverabilityTestReportCommand = funct
1472
1285
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1473
1286
  return [2, deserializeAws_restJson1CreateDeliverabilityTestReportCommandError(output, context)];
1474
1287
  }
1475
- contents = {
1288
+ contents = map({
1476
1289
  $metadata: deserializeMetadata(output),
1477
- DeliverabilityTestStatus: undefined,
1478
- ReportId: undefined,
1479
- };
1290
+ });
1480
1291
  _a = __expectNonNull;
1481
1292
  _b = __expectObject;
1482
1293
  return [4, parseBody(output.body, context)];
1483
1294
  case 1:
1484
1295
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1485
- if (data.DeliverabilityTestStatus !== undefined && data.DeliverabilityTestStatus !== null) {
1296
+ if (data.DeliverabilityTestStatus != null) {
1486
1297
  contents.DeliverabilityTestStatus = __expectString(data.DeliverabilityTestStatus);
1487
1298
  }
1488
- if (data.ReportId !== undefined && data.ReportId !== null) {
1299
+ if (data.ReportId != null) {
1489
1300
  contents.ReportId = __expectString(data.ReportId);
1490
1301
  }
1491
- return [2, Promise.resolve(contents)];
1302
+ return [2, contents];
1492
1303
  }
1493
1304
  });
1494
1305
  }); };
1495
1306
  var deserializeAws_restJson1CreateDeliverabilityTestReportCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1496
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1307
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1497
1308
  var _c;
1498
1309
  return __generator(this, function (_d) {
1499
1310
  switch (_d.label) {
@@ -1546,14 +1357,14 @@ var deserializeAws_restJson1CreateDeliverabilityTestReportCommandError = functio
1546
1357
  case 19: throw _d.sent();
1547
1358
  case 20:
1548
1359
  parsedBody = parsedOutput.body;
1549
- $metadata = deserializeMetadata(output);
1550
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1551
- response = new __BaseException({
1552
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1553
- $fault: "client",
1554
- $metadata: $metadata,
1360
+ throwDefaultError({
1361
+ output: output,
1362
+ parsedBody: parsedBody,
1363
+ exceptionCtor: __BaseException,
1364
+ errorCode: errorCode,
1555
1365
  });
1556
- throw __decorateServiceException(response, parsedBody);
1366
+ _d.label = 21;
1367
+ case 21: return [2];
1557
1368
  }
1558
1369
  });
1559
1370
  }); };
@@ -1565,32 +1376,29 @@ export var deserializeAws_restJson1CreateEmailIdentityCommand = function (output
1565
1376
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1566
1377
  return [2, deserializeAws_restJson1CreateEmailIdentityCommandError(output, context)];
1567
1378
  }
1568
- contents = {
1379
+ contents = map({
1569
1380
  $metadata: deserializeMetadata(output),
1570
- DkimAttributes: undefined,
1571
- IdentityType: undefined,
1572
- VerifiedForSendingStatus: undefined,
1573
- };
1381
+ });
1574
1382
  _a = __expectNonNull;
1575
1383
  _b = __expectObject;
1576
1384
  return [4, parseBody(output.body, context)];
1577
1385
  case 1:
1578
1386
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1579
- if (data.DkimAttributes !== undefined && data.DkimAttributes !== null) {
1387
+ if (data.DkimAttributes != null) {
1580
1388
  contents.DkimAttributes = deserializeAws_restJson1DkimAttributes(data.DkimAttributes, context);
1581
1389
  }
1582
- if (data.IdentityType !== undefined && data.IdentityType !== null) {
1390
+ if (data.IdentityType != null) {
1583
1391
  contents.IdentityType = __expectString(data.IdentityType);
1584
1392
  }
1585
- if (data.VerifiedForSendingStatus !== undefined && data.VerifiedForSendingStatus !== null) {
1393
+ if (data.VerifiedForSendingStatus != null) {
1586
1394
  contents.VerifiedForSendingStatus = __expectBoolean(data.VerifiedForSendingStatus);
1587
1395
  }
1588
- return [2, Promise.resolve(contents)];
1396
+ return [2, contents];
1589
1397
  }
1590
1398
  });
1591
1399
  }); };
1592
1400
  var deserializeAws_restJson1CreateEmailIdentityCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1593
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1401
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1594
1402
  var _c;
1595
1403
  return __generator(this, function (_d) {
1596
1404
  switch (_d.label) {
@@ -1623,14 +1431,14 @@ var deserializeAws_restJson1CreateEmailIdentityCommandError = function (output,
1623
1431
  case 9: throw _d.sent();
1624
1432
  case 10:
1625
1433
  parsedBody = parsedOutput.body;
1626
- $metadata = deserializeMetadata(output);
1627
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1628
- response = new __BaseException({
1629
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1630
- $fault: "client",
1631
- $metadata: $metadata,
1434
+ throwDefaultError({
1435
+ output: output,
1436
+ parsedBody: parsedBody,
1437
+ exceptionCtor: __BaseException,
1438
+ errorCode: errorCode,
1632
1439
  });
1633
- throw __decorateServiceException(response, parsedBody);
1440
+ _d.label = 11;
1441
+ case 11: return [2];
1634
1442
  }
1635
1443
  });
1636
1444
  }); };
@@ -1642,18 +1450,18 @@ export var deserializeAws_restJson1DeleteConfigurationSetCommand = function (out
1642
1450
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1643
1451
  return [2, deserializeAws_restJson1DeleteConfigurationSetCommandError(output, context)];
1644
1452
  }
1645
- contents = {
1453
+ contents = map({
1646
1454
  $metadata: deserializeMetadata(output),
1647
- };
1455
+ });
1648
1456
  return [4, collectBody(output.body, context)];
1649
1457
  case 1:
1650
1458
  _a.sent();
1651
- return [2, Promise.resolve(contents)];
1459
+ return [2, contents];
1652
1460
  }
1653
1461
  });
1654
1462
  }); };
1655
1463
  var deserializeAws_restJson1DeleteConfigurationSetCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1656
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1464
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1657
1465
  var _c;
1658
1466
  return __generator(this, function (_d) {
1659
1467
  switch (_d.label) {
@@ -1686,14 +1494,14 @@ var deserializeAws_restJson1DeleteConfigurationSetCommandError = function (outpu
1686
1494
  case 9: throw _d.sent();
1687
1495
  case 10:
1688
1496
  parsedBody = parsedOutput.body;
1689
- $metadata = deserializeMetadata(output);
1690
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1691
- response = new __BaseException({
1692
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1693
- $fault: "client",
1694
- $metadata: $metadata,
1497
+ throwDefaultError({
1498
+ output: output,
1499
+ parsedBody: parsedBody,
1500
+ exceptionCtor: __BaseException,
1501
+ errorCode: errorCode,
1695
1502
  });
1696
- throw __decorateServiceException(response, parsedBody);
1503
+ _d.label = 11;
1504
+ case 11: return [2];
1697
1505
  }
1698
1506
  });
1699
1507
  }); };
@@ -1705,18 +1513,18 @@ export var deserializeAws_restJson1DeleteConfigurationSetEventDestinationCommand
1705
1513
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1706
1514
  return [2, deserializeAws_restJson1DeleteConfigurationSetEventDestinationCommandError(output, context)];
1707
1515
  }
1708
- contents = {
1516
+ contents = map({
1709
1517
  $metadata: deserializeMetadata(output),
1710
- };
1518
+ });
1711
1519
  return [4, collectBody(output.body, context)];
1712
1520
  case 1:
1713
1521
  _a.sent();
1714
- return [2, Promise.resolve(contents)];
1522
+ return [2, contents];
1715
1523
  }
1716
1524
  });
1717
1525
  }); };
1718
1526
  var deserializeAws_restJson1DeleteConfigurationSetEventDestinationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1719
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1527
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1720
1528
  var _c;
1721
1529
  return __generator(this, function (_d) {
1722
1530
  switch (_d.label) {
@@ -1745,14 +1553,14 @@ var deserializeAws_restJson1DeleteConfigurationSetEventDestinationCommandError =
1745
1553
  case 7: throw _d.sent();
1746
1554
  case 8:
1747
1555
  parsedBody = parsedOutput.body;
1748
- $metadata = deserializeMetadata(output);
1749
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1750
- response = new __BaseException({
1751
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1752
- $fault: "client",
1753
- $metadata: $metadata,
1556
+ throwDefaultError({
1557
+ output: output,
1558
+ parsedBody: parsedBody,
1559
+ exceptionCtor: __BaseException,
1560
+ errorCode: errorCode,
1754
1561
  });
1755
- throw __decorateServiceException(response, parsedBody);
1562
+ _d.label = 9;
1563
+ case 9: return [2];
1756
1564
  }
1757
1565
  });
1758
1566
  }); };
@@ -1764,18 +1572,18 @@ export var deserializeAws_restJson1DeleteDedicatedIpPoolCommand = function (outp
1764
1572
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1765
1573
  return [2, deserializeAws_restJson1DeleteDedicatedIpPoolCommandError(output, context)];
1766
1574
  }
1767
- contents = {
1575
+ contents = map({
1768
1576
  $metadata: deserializeMetadata(output),
1769
- };
1577
+ });
1770
1578
  return [4, collectBody(output.body, context)];
1771
1579
  case 1:
1772
1580
  _a.sent();
1773
- return [2, Promise.resolve(contents)];
1581
+ return [2, contents];
1774
1582
  }
1775
1583
  });
1776
1584
  }); };
1777
1585
  var deserializeAws_restJson1DeleteDedicatedIpPoolCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1778
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1586
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1779
1587
  var _c;
1780
1588
  return __generator(this, function (_d) {
1781
1589
  switch (_d.label) {
@@ -1808,14 +1616,14 @@ var deserializeAws_restJson1DeleteDedicatedIpPoolCommandError = function (output
1808
1616
  case 9: throw _d.sent();
1809
1617
  case 10:
1810
1618
  parsedBody = parsedOutput.body;
1811
- $metadata = deserializeMetadata(output);
1812
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1813
- response = new __BaseException({
1814
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1815
- $fault: "client",
1816
- $metadata: $metadata,
1619
+ throwDefaultError({
1620
+ output: output,
1621
+ parsedBody: parsedBody,
1622
+ exceptionCtor: __BaseException,
1623
+ errorCode: errorCode,
1817
1624
  });
1818
- throw __decorateServiceException(response, parsedBody);
1625
+ _d.label = 11;
1626
+ case 11: return [2];
1819
1627
  }
1820
1628
  });
1821
1629
  }); };
@@ -1827,18 +1635,18 @@ export var deserializeAws_restJson1DeleteEmailIdentityCommand = function (output
1827
1635
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1828
1636
  return [2, deserializeAws_restJson1DeleteEmailIdentityCommandError(output, context)];
1829
1637
  }
1830
- contents = {
1638
+ contents = map({
1831
1639
  $metadata: deserializeMetadata(output),
1832
- };
1640
+ });
1833
1641
  return [4, collectBody(output.body, context)];
1834
1642
  case 1:
1835
1643
  _a.sent();
1836
- return [2, Promise.resolve(contents)];
1644
+ return [2, contents];
1837
1645
  }
1838
1646
  });
1839
1647
  }); };
1840
1648
  var deserializeAws_restJson1DeleteEmailIdentityCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1841
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1649
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1842
1650
  var _c;
1843
1651
  return __generator(this, function (_d) {
1844
1652
  switch (_d.label) {
@@ -1871,14 +1679,14 @@ var deserializeAws_restJson1DeleteEmailIdentityCommandError = function (output,
1871
1679
  case 9: throw _d.sent();
1872
1680
  case 10:
1873
1681
  parsedBody = parsedOutput.body;
1874
- $metadata = deserializeMetadata(output);
1875
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1876
- response = new __BaseException({
1877
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1878
- $fault: "client",
1879
- $metadata: $metadata,
1682
+ throwDefaultError({
1683
+ output: output,
1684
+ parsedBody: parsedBody,
1685
+ exceptionCtor: __BaseException,
1686
+ errorCode: errorCode,
1880
1687
  });
1881
- throw __decorateServiceException(response, parsedBody);
1688
+ _d.label = 11;
1689
+ case 11: return [2];
1882
1690
  }
1883
1691
  });
1884
1692
  }); };
@@ -1890,40 +1698,35 @@ export var deserializeAws_restJson1GetAccountCommand = function (output, context
1890
1698
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1891
1699
  return [2, deserializeAws_restJson1GetAccountCommandError(output, context)];
1892
1700
  }
1893
- contents = {
1701
+ contents = map({
1894
1702
  $metadata: deserializeMetadata(output),
1895
- DedicatedIpAutoWarmupEnabled: undefined,
1896
- EnforcementStatus: undefined,
1897
- ProductionAccessEnabled: undefined,
1898
- SendQuota: undefined,
1899
- SendingEnabled: undefined,
1900
- };
1703
+ });
1901
1704
  _a = __expectNonNull;
1902
1705
  _b = __expectObject;
1903
1706
  return [4, parseBody(output.body, context)];
1904
1707
  case 1:
1905
1708
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1906
- if (data.DedicatedIpAutoWarmupEnabled !== undefined && data.DedicatedIpAutoWarmupEnabled !== null) {
1709
+ if (data.DedicatedIpAutoWarmupEnabled != null) {
1907
1710
  contents.DedicatedIpAutoWarmupEnabled = __expectBoolean(data.DedicatedIpAutoWarmupEnabled);
1908
1711
  }
1909
- if (data.EnforcementStatus !== undefined && data.EnforcementStatus !== null) {
1712
+ if (data.EnforcementStatus != null) {
1910
1713
  contents.EnforcementStatus = __expectString(data.EnforcementStatus);
1911
1714
  }
1912
- if (data.ProductionAccessEnabled !== undefined && data.ProductionAccessEnabled !== null) {
1715
+ if (data.ProductionAccessEnabled != null) {
1913
1716
  contents.ProductionAccessEnabled = __expectBoolean(data.ProductionAccessEnabled);
1914
1717
  }
1915
- if (data.SendQuota !== undefined && data.SendQuota !== null) {
1718
+ if (data.SendQuota != null) {
1916
1719
  contents.SendQuota = deserializeAws_restJson1SendQuota(data.SendQuota, context);
1917
1720
  }
1918
- if (data.SendingEnabled !== undefined && data.SendingEnabled !== null) {
1721
+ if (data.SendingEnabled != null) {
1919
1722
  contents.SendingEnabled = __expectBoolean(data.SendingEnabled);
1920
1723
  }
1921
- return [2, Promise.resolve(contents)];
1724
+ return [2, contents];
1922
1725
  }
1923
1726
  });
1924
1727
  }); };
1925
1728
  var deserializeAws_restJson1GetAccountCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1926
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1729
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1927
1730
  var _c;
1928
1731
  return __generator(this, function (_d) {
1929
1732
  switch (_d.label) {
@@ -1948,14 +1751,14 @@ var deserializeAws_restJson1GetAccountCommandError = function (output, context)
1948
1751
  case 5: throw _d.sent();
1949
1752
  case 6:
1950
1753
  parsedBody = parsedOutput.body;
1951
- $metadata = deserializeMetadata(output);
1952
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1953
- response = new __BaseException({
1954
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1955
- $fault: "client",
1956
- $metadata: $metadata,
1754
+ throwDefaultError({
1755
+ output: output,
1756
+ parsedBody: parsedBody,
1757
+ exceptionCtor: __BaseException,
1758
+ errorCode: errorCode,
1957
1759
  });
1958
- throw __decorateServiceException(response, parsedBody);
1760
+ _d.label = 7;
1761
+ case 7: return [2];
1959
1762
  }
1960
1763
  });
1961
1764
  }); };
@@ -1967,24 +1770,23 @@ export var deserializeAws_restJson1GetBlacklistReportsCommand = function (output
1967
1770
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1968
1771
  return [2, deserializeAws_restJson1GetBlacklistReportsCommandError(output, context)];
1969
1772
  }
1970
- contents = {
1773
+ contents = map({
1971
1774
  $metadata: deserializeMetadata(output),
1972
- BlacklistReport: undefined,
1973
- };
1775
+ });
1974
1776
  _a = __expectNonNull;
1975
1777
  _b = __expectObject;
1976
1778
  return [4, parseBody(output.body, context)];
1977
1779
  case 1:
1978
1780
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1979
- if (data.BlacklistReport !== undefined && data.BlacklistReport !== null) {
1781
+ if (data.BlacklistReport != null) {
1980
1782
  contents.BlacklistReport = deserializeAws_restJson1BlacklistReport(data.BlacklistReport, context);
1981
1783
  }
1982
- return [2, Promise.resolve(contents)];
1784
+ return [2, contents];
1983
1785
  }
1984
1786
  });
1985
1787
  }); };
1986
1788
  var deserializeAws_restJson1GetBlacklistReportsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1987
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1789
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1988
1790
  var _c;
1989
1791
  return __generator(this, function (_d) {
1990
1792
  switch (_d.label) {
@@ -2013,14 +1815,14 @@ var deserializeAws_restJson1GetBlacklistReportsCommandError = function (output,
2013
1815
  case 7: throw _d.sent();
2014
1816
  case 8:
2015
1817
  parsedBody = parsedOutput.body;
2016
- $metadata = deserializeMetadata(output);
2017
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2018
- response = new __BaseException({
2019
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2020
- $fault: "client",
2021
- $metadata: $metadata,
1818
+ throwDefaultError({
1819
+ output: output,
1820
+ parsedBody: parsedBody,
1821
+ exceptionCtor: __BaseException,
1822
+ errorCode: errorCode,
2022
1823
  });
2023
- throw __decorateServiceException(response, parsedBody);
1824
+ _d.label = 9;
1825
+ case 9: return [2];
2024
1826
  }
2025
1827
  });
2026
1828
  }); };
@@ -2032,44 +1834,38 @@ export var deserializeAws_restJson1GetConfigurationSetCommand = function (output
2032
1834
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2033
1835
  return [2, deserializeAws_restJson1GetConfigurationSetCommandError(output, context)];
2034
1836
  }
2035
- contents = {
1837
+ contents = map({
2036
1838
  $metadata: deserializeMetadata(output),
2037
- ConfigurationSetName: undefined,
2038
- DeliveryOptions: undefined,
2039
- ReputationOptions: undefined,
2040
- SendingOptions: undefined,
2041
- Tags: undefined,
2042
- TrackingOptions: undefined,
2043
- };
1839
+ });
2044
1840
  _a = __expectNonNull;
2045
1841
  _b = __expectObject;
2046
1842
  return [4, parseBody(output.body, context)];
2047
1843
  case 1:
2048
1844
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2049
- if (data.ConfigurationSetName !== undefined && data.ConfigurationSetName !== null) {
1845
+ if (data.ConfigurationSetName != null) {
2050
1846
  contents.ConfigurationSetName = __expectString(data.ConfigurationSetName);
2051
1847
  }
2052
- if (data.DeliveryOptions !== undefined && data.DeliveryOptions !== null) {
1848
+ if (data.DeliveryOptions != null) {
2053
1849
  contents.DeliveryOptions = deserializeAws_restJson1DeliveryOptions(data.DeliveryOptions, context);
2054
1850
  }
2055
- if (data.ReputationOptions !== undefined && data.ReputationOptions !== null) {
1851
+ if (data.ReputationOptions != null) {
2056
1852
  contents.ReputationOptions = deserializeAws_restJson1ReputationOptions(data.ReputationOptions, context);
2057
1853
  }
2058
- if (data.SendingOptions !== undefined && data.SendingOptions !== null) {
1854
+ if (data.SendingOptions != null) {
2059
1855
  contents.SendingOptions = deserializeAws_restJson1SendingOptions(data.SendingOptions, context);
2060
1856
  }
2061
- if (data.Tags !== undefined && data.Tags !== null) {
1857
+ if (data.Tags != null) {
2062
1858
  contents.Tags = deserializeAws_restJson1TagList(data.Tags, context);
2063
1859
  }
2064
- if (data.TrackingOptions !== undefined && data.TrackingOptions !== null) {
1860
+ if (data.TrackingOptions != null) {
2065
1861
  contents.TrackingOptions = deserializeAws_restJson1TrackingOptions(data.TrackingOptions, context);
2066
1862
  }
2067
- return [2, Promise.resolve(contents)];
1863
+ return [2, contents];
2068
1864
  }
2069
1865
  });
2070
1866
  }); };
2071
1867
  var deserializeAws_restJson1GetConfigurationSetCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2072
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1868
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2073
1869
  var _c;
2074
1870
  return __generator(this, function (_d) {
2075
1871
  switch (_d.label) {
@@ -2098,14 +1894,14 @@ var deserializeAws_restJson1GetConfigurationSetCommandError = function (output,
2098
1894
  case 7: throw _d.sent();
2099
1895
  case 8:
2100
1896
  parsedBody = parsedOutput.body;
2101
- $metadata = deserializeMetadata(output);
2102
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2103
- response = new __BaseException({
2104
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2105
- $fault: "client",
2106
- $metadata: $metadata,
1897
+ throwDefaultError({
1898
+ output: output,
1899
+ parsedBody: parsedBody,
1900
+ exceptionCtor: __BaseException,
1901
+ errorCode: errorCode,
2107
1902
  });
2108
- throw __decorateServiceException(response, parsedBody);
1903
+ _d.label = 9;
1904
+ case 9: return [2];
2109
1905
  }
2110
1906
  });
2111
1907
  }); };
@@ -2117,24 +1913,23 @@ export var deserializeAws_restJson1GetConfigurationSetEventDestinationsCommand =
2117
1913
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2118
1914
  return [2, deserializeAws_restJson1GetConfigurationSetEventDestinationsCommandError(output, context)];
2119
1915
  }
2120
- contents = {
1916
+ contents = map({
2121
1917
  $metadata: deserializeMetadata(output),
2122
- EventDestinations: undefined,
2123
- };
1918
+ });
2124
1919
  _a = __expectNonNull;
2125
1920
  _b = __expectObject;
2126
1921
  return [4, parseBody(output.body, context)];
2127
1922
  case 1:
2128
1923
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2129
- if (data.EventDestinations !== undefined && data.EventDestinations !== null) {
1924
+ if (data.EventDestinations != null) {
2130
1925
  contents.EventDestinations = deserializeAws_restJson1EventDestinations(data.EventDestinations, context);
2131
1926
  }
2132
- return [2, Promise.resolve(contents)];
1927
+ return [2, contents];
2133
1928
  }
2134
1929
  });
2135
1930
  }); };
2136
1931
  var deserializeAws_restJson1GetConfigurationSetEventDestinationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2137
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1932
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2138
1933
  var _c;
2139
1934
  return __generator(this, function (_d) {
2140
1935
  switch (_d.label) {
@@ -2163,14 +1958,14 @@ var deserializeAws_restJson1GetConfigurationSetEventDestinationsCommandError = f
2163
1958
  case 7: throw _d.sent();
2164
1959
  case 8:
2165
1960
  parsedBody = parsedOutput.body;
2166
- $metadata = deserializeMetadata(output);
2167
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2168
- response = new __BaseException({
2169
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2170
- $fault: "client",
2171
- $metadata: $metadata,
1961
+ throwDefaultError({
1962
+ output: output,
1963
+ parsedBody: parsedBody,
1964
+ exceptionCtor: __BaseException,
1965
+ errorCode: errorCode,
2172
1966
  });
2173
- throw __decorateServiceException(response, parsedBody);
1967
+ _d.label = 9;
1968
+ case 9: return [2];
2174
1969
  }
2175
1970
  });
2176
1971
  }); };
@@ -2182,24 +1977,23 @@ export var deserializeAws_restJson1GetDedicatedIpCommand = function (output, con
2182
1977
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2183
1978
  return [2, deserializeAws_restJson1GetDedicatedIpCommandError(output, context)];
2184
1979
  }
2185
- contents = {
1980
+ contents = map({
2186
1981
  $metadata: deserializeMetadata(output),
2187
- DedicatedIp: undefined,
2188
- };
1982
+ });
2189
1983
  _a = __expectNonNull;
2190
1984
  _b = __expectObject;
2191
1985
  return [4, parseBody(output.body, context)];
2192
1986
  case 1:
2193
1987
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2194
- if (data.DedicatedIp !== undefined && data.DedicatedIp !== null) {
1988
+ if (data.DedicatedIp != null) {
2195
1989
  contents.DedicatedIp = deserializeAws_restJson1DedicatedIp(data.DedicatedIp, context);
2196
1990
  }
2197
- return [2, Promise.resolve(contents)];
1991
+ return [2, contents];
2198
1992
  }
2199
1993
  });
2200
1994
  }); };
2201
1995
  var deserializeAws_restJson1GetDedicatedIpCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2202
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1996
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2203
1997
  var _c;
2204
1998
  return __generator(this, function (_d) {
2205
1999
  switch (_d.label) {
@@ -2228,14 +2022,14 @@ var deserializeAws_restJson1GetDedicatedIpCommandError = function (output, conte
2228
2022
  case 7: throw _d.sent();
2229
2023
  case 8:
2230
2024
  parsedBody = parsedOutput.body;
2231
- $metadata = deserializeMetadata(output);
2232
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2233
- response = new __BaseException({
2234
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2235
- $fault: "client",
2236
- $metadata: $metadata,
2025
+ throwDefaultError({
2026
+ output: output,
2027
+ parsedBody: parsedBody,
2028
+ exceptionCtor: __BaseException,
2029
+ errorCode: errorCode,
2237
2030
  });
2238
- throw __decorateServiceException(response, parsedBody);
2031
+ _d.label = 9;
2032
+ case 9: return [2];
2239
2033
  }
2240
2034
  });
2241
2035
  }); };
@@ -2247,28 +2041,26 @@ export var deserializeAws_restJson1GetDedicatedIpsCommand = function (output, co
2247
2041
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2248
2042
  return [2, deserializeAws_restJson1GetDedicatedIpsCommandError(output, context)];
2249
2043
  }
2250
- contents = {
2044
+ contents = map({
2251
2045
  $metadata: deserializeMetadata(output),
2252
- DedicatedIps: undefined,
2253
- NextToken: undefined,
2254
- };
2046
+ });
2255
2047
  _a = __expectNonNull;
2256
2048
  _b = __expectObject;
2257
2049
  return [4, parseBody(output.body, context)];
2258
2050
  case 1:
2259
2051
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2260
- if (data.DedicatedIps !== undefined && data.DedicatedIps !== null) {
2052
+ if (data.DedicatedIps != null) {
2261
2053
  contents.DedicatedIps = deserializeAws_restJson1DedicatedIpList(data.DedicatedIps, context);
2262
2054
  }
2263
- if (data.NextToken !== undefined && data.NextToken !== null) {
2055
+ if (data.NextToken != null) {
2264
2056
  contents.NextToken = __expectString(data.NextToken);
2265
2057
  }
2266
- return [2, Promise.resolve(contents)];
2058
+ return [2, contents];
2267
2059
  }
2268
2060
  });
2269
2061
  }); };
2270
2062
  var deserializeAws_restJson1GetDedicatedIpsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2271
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2063
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2272
2064
  var _c;
2273
2065
  return __generator(this, function (_d) {
2274
2066
  switch (_d.label) {
@@ -2297,14 +2089,14 @@ var deserializeAws_restJson1GetDedicatedIpsCommandError = function (output, cont
2297
2089
  case 7: throw _d.sent();
2298
2090
  case 8:
2299
2091
  parsedBody = parsedOutput.body;
2300
- $metadata = deserializeMetadata(output);
2301
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2302
- response = new __BaseException({
2303
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2304
- $fault: "client",
2305
- $metadata: $metadata,
2092
+ throwDefaultError({
2093
+ output: output,
2094
+ parsedBody: parsedBody,
2095
+ exceptionCtor: __BaseException,
2096
+ errorCode: errorCode,
2306
2097
  });
2307
- throw __decorateServiceException(response, parsedBody);
2098
+ _d.label = 9;
2099
+ case 9: return [2];
2308
2100
  }
2309
2101
  });
2310
2102
  }); };
@@ -2316,40 +2108,35 @@ export var deserializeAws_restJson1GetDeliverabilityDashboardOptionsCommand = fu
2316
2108
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2317
2109
  return [2, deserializeAws_restJson1GetDeliverabilityDashboardOptionsCommandError(output, context)];
2318
2110
  }
2319
- contents = {
2111
+ contents = map({
2320
2112
  $metadata: deserializeMetadata(output),
2321
- AccountStatus: undefined,
2322
- ActiveSubscribedDomains: undefined,
2323
- DashboardEnabled: undefined,
2324
- PendingExpirationSubscribedDomains: undefined,
2325
- SubscriptionExpiryDate: undefined,
2326
- };
2113
+ });
2327
2114
  _a = __expectNonNull;
2328
2115
  _b = __expectObject;
2329
2116
  return [4, parseBody(output.body, context)];
2330
2117
  case 1:
2331
2118
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2332
- if (data.AccountStatus !== undefined && data.AccountStatus !== null) {
2119
+ if (data.AccountStatus != null) {
2333
2120
  contents.AccountStatus = __expectString(data.AccountStatus);
2334
2121
  }
2335
- if (data.ActiveSubscribedDomains !== undefined && data.ActiveSubscribedDomains !== null) {
2122
+ if (data.ActiveSubscribedDomains != null) {
2336
2123
  contents.ActiveSubscribedDomains = deserializeAws_restJson1DomainDeliverabilityTrackingOptions(data.ActiveSubscribedDomains, context);
2337
2124
  }
2338
- if (data.DashboardEnabled !== undefined && data.DashboardEnabled !== null) {
2125
+ if (data.DashboardEnabled != null) {
2339
2126
  contents.DashboardEnabled = __expectBoolean(data.DashboardEnabled);
2340
2127
  }
2341
- if (data.PendingExpirationSubscribedDomains !== undefined && data.PendingExpirationSubscribedDomains !== null) {
2128
+ if (data.PendingExpirationSubscribedDomains != null) {
2342
2129
  contents.PendingExpirationSubscribedDomains = deserializeAws_restJson1DomainDeliverabilityTrackingOptions(data.PendingExpirationSubscribedDomains, context);
2343
2130
  }
2344
- if (data.SubscriptionExpiryDate !== undefined && data.SubscriptionExpiryDate !== null) {
2131
+ if (data.SubscriptionExpiryDate != null) {
2345
2132
  contents.SubscriptionExpiryDate = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.SubscriptionExpiryDate)));
2346
2133
  }
2347
- return [2, Promise.resolve(contents)];
2134
+ return [2, contents];
2348
2135
  }
2349
2136
  });
2350
2137
  }); };
2351
2138
  var deserializeAws_restJson1GetDeliverabilityDashboardOptionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2352
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2139
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2353
2140
  var _c;
2354
2141
  return __generator(this, function (_d) {
2355
2142
  switch (_d.label) {
@@ -2378,14 +2165,14 @@ var deserializeAws_restJson1GetDeliverabilityDashboardOptionsCommandError = func
2378
2165
  case 7: throw _d.sent();
2379
2166
  case 8:
2380
2167
  parsedBody = parsedOutput.body;
2381
- $metadata = deserializeMetadata(output);
2382
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2383
- response = new __BaseException({
2384
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2385
- $fault: "client",
2386
- $metadata: $metadata,
2168
+ throwDefaultError({
2169
+ output: output,
2170
+ parsedBody: parsedBody,
2171
+ exceptionCtor: __BaseException,
2172
+ errorCode: errorCode,
2387
2173
  });
2388
- throw __decorateServiceException(response, parsedBody);
2174
+ _d.label = 9;
2175
+ case 9: return [2];
2389
2176
  }
2390
2177
  });
2391
2178
  }); };
@@ -2397,40 +2184,35 @@ export var deserializeAws_restJson1GetDeliverabilityTestReportCommand = function
2397
2184
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2398
2185
  return [2, deserializeAws_restJson1GetDeliverabilityTestReportCommandError(output, context)];
2399
2186
  }
2400
- contents = {
2187
+ contents = map({
2401
2188
  $metadata: deserializeMetadata(output),
2402
- DeliverabilityTestReport: undefined,
2403
- IspPlacements: undefined,
2404
- Message: undefined,
2405
- OverallPlacement: undefined,
2406
- Tags: undefined,
2407
- };
2189
+ });
2408
2190
  _a = __expectNonNull;
2409
2191
  _b = __expectObject;
2410
2192
  return [4, parseBody(output.body, context)];
2411
2193
  case 1:
2412
2194
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2413
- if (data.DeliverabilityTestReport !== undefined && data.DeliverabilityTestReport !== null) {
2195
+ if (data.DeliverabilityTestReport != null) {
2414
2196
  contents.DeliverabilityTestReport = deserializeAws_restJson1DeliverabilityTestReport(data.DeliverabilityTestReport, context);
2415
2197
  }
2416
- if (data.IspPlacements !== undefined && data.IspPlacements !== null) {
2198
+ if (data.IspPlacements != null) {
2417
2199
  contents.IspPlacements = deserializeAws_restJson1IspPlacements(data.IspPlacements, context);
2418
2200
  }
2419
- if (data.Message !== undefined && data.Message !== null) {
2201
+ if (data.Message != null) {
2420
2202
  contents.Message = __expectString(data.Message);
2421
2203
  }
2422
- if (data.OverallPlacement !== undefined && data.OverallPlacement !== null) {
2204
+ if (data.OverallPlacement != null) {
2423
2205
  contents.OverallPlacement = deserializeAws_restJson1PlacementStatistics(data.OverallPlacement, context);
2424
2206
  }
2425
- if (data.Tags !== undefined && data.Tags !== null) {
2207
+ if (data.Tags != null) {
2426
2208
  contents.Tags = deserializeAws_restJson1TagList(data.Tags, context);
2427
2209
  }
2428
- return [2, Promise.resolve(contents)];
2210
+ return [2, contents];
2429
2211
  }
2430
2212
  });
2431
2213
  }); };
2432
2214
  var deserializeAws_restJson1GetDeliverabilityTestReportCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2433
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2215
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2434
2216
  var _c;
2435
2217
  return __generator(this, function (_d) {
2436
2218
  switch (_d.label) {
@@ -2459,14 +2241,14 @@ var deserializeAws_restJson1GetDeliverabilityTestReportCommandError = function (
2459
2241
  case 7: throw _d.sent();
2460
2242
  case 8:
2461
2243
  parsedBody = parsedOutput.body;
2462
- $metadata = deserializeMetadata(output);
2463
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2464
- response = new __BaseException({
2465
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2466
- $fault: "client",
2467
- $metadata: $metadata,
2244
+ throwDefaultError({
2245
+ output: output,
2246
+ parsedBody: parsedBody,
2247
+ exceptionCtor: __BaseException,
2248
+ errorCode: errorCode,
2468
2249
  });
2469
- throw __decorateServiceException(response, parsedBody);
2250
+ _d.label = 9;
2251
+ case 9: return [2];
2470
2252
  }
2471
2253
  });
2472
2254
  }); };
@@ -2478,24 +2260,23 @@ export var deserializeAws_restJson1GetDomainDeliverabilityCampaignCommand = func
2478
2260
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2479
2261
  return [2, deserializeAws_restJson1GetDomainDeliverabilityCampaignCommandError(output, context)];
2480
2262
  }
2481
- contents = {
2263
+ contents = map({
2482
2264
  $metadata: deserializeMetadata(output),
2483
- DomainDeliverabilityCampaign: undefined,
2484
- };
2265
+ });
2485
2266
  _a = __expectNonNull;
2486
2267
  _b = __expectObject;
2487
2268
  return [4, parseBody(output.body, context)];
2488
2269
  case 1:
2489
2270
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2490
- if (data.DomainDeliverabilityCampaign !== undefined && data.DomainDeliverabilityCampaign !== null) {
2271
+ if (data.DomainDeliverabilityCampaign != null) {
2491
2272
  contents.DomainDeliverabilityCampaign = deserializeAws_restJson1DomainDeliverabilityCampaign(data.DomainDeliverabilityCampaign, context);
2492
2273
  }
2493
- return [2, Promise.resolve(contents)];
2274
+ return [2, contents];
2494
2275
  }
2495
2276
  });
2496
2277
  }); };
2497
2278
  var deserializeAws_restJson1GetDomainDeliverabilityCampaignCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2498
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2279
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2499
2280
  var _c;
2500
2281
  return __generator(this, function (_d) {
2501
2282
  switch (_d.label) {
@@ -2524,14 +2305,14 @@ var deserializeAws_restJson1GetDomainDeliverabilityCampaignCommandError = functi
2524
2305
  case 7: throw _d.sent();
2525
2306
  case 8:
2526
2307
  parsedBody = parsedOutput.body;
2527
- $metadata = deserializeMetadata(output);
2528
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2529
- response = new __BaseException({
2530
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2531
- $fault: "client",
2532
- $metadata: $metadata,
2308
+ throwDefaultError({
2309
+ output: output,
2310
+ parsedBody: parsedBody,
2311
+ exceptionCtor: __BaseException,
2312
+ errorCode: errorCode,
2533
2313
  });
2534
- throw __decorateServiceException(response, parsedBody);
2314
+ _d.label = 9;
2315
+ case 9: return [2];
2535
2316
  }
2536
2317
  });
2537
2318
  }); };
@@ -2543,28 +2324,26 @@ export var deserializeAws_restJson1GetDomainStatisticsReportCommand = function (
2543
2324
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2544
2325
  return [2, deserializeAws_restJson1GetDomainStatisticsReportCommandError(output, context)];
2545
2326
  }
2546
- contents = {
2327
+ contents = map({
2547
2328
  $metadata: deserializeMetadata(output),
2548
- DailyVolumes: undefined,
2549
- OverallVolume: undefined,
2550
- };
2329
+ });
2551
2330
  _a = __expectNonNull;
2552
2331
  _b = __expectObject;
2553
2332
  return [4, parseBody(output.body, context)];
2554
2333
  case 1:
2555
2334
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2556
- if (data.DailyVolumes !== undefined && data.DailyVolumes !== null) {
2335
+ if (data.DailyVolumes != null) {
2557
2336
  contents.DailyVolumes = deserializeAws_restJson1DailyVolumes(data.DailyVolumes, context);
2558
2337
  }
2559
- if (data.OverallVolume !== undefined && data.OverallVolume !== null) {
2338
+ if (data.OverallVolume != null) {
2560
2339
  contents.OverallVolume = deserializeAws_restJson1OverallVolume(data.OverallVolume, context);
2561
2340
  }
2562
- return [2, Promise.resolve(contents)];
2341
+ return [2, contents];
2563
2342
  }
2564
2343
  });
2565
2344
  }); };
2566
2345
  var deserializeAws_restJson1GetDomainStatisticsReportCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2567
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2346
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2568
2347
  var _c;
2569
2348
  return __generator(this, function (_d) {
2570
2349
  switch (_d.label) {
@@ -2593,14 +2372,14 @@ var deserializeAws_restJson1GetDomainStatisticsReportCommandError = function (ou
2593
2372
  case 7: throw _d.sent();
2594
2373
  case 8:
2595
2374
  parsedBody = parsedOutput.body;
2596
- $metadata = deserializeMetadata(output);
2597
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2598
- response = new __BaseException({
2599
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2600
- $fault: "client",
2601
- $metadata: $metadata,
2375
+ throwDefaultError({
2376
+ output: output,
2377
+ parsedBody: parsedBody,
2378
+ exceptionCtor: __BaseException,
2379
+ errorCode: errorCode,
2602
2380
  });
2603
- throw __decorateServiceException(response, parsedBody);
2381
+ _d.label = 9;
2382
+ case 9: return [2];
2604
2383
  }
2605
2384
  });
2606
2385
  }); };
@@ -2612,44 +2391,38 @@ export var deserializeAws_restJson1GetEmailIdentityCommand = function (output, c
2612
2391
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2613
2392
  return [2, deserializeAws_restJson1GetEmailIdentityCommandError(output, context)];
2614
2393
  }
2615
- contents = {
2394
+ contents = map({
2616
2395
  $metadata: deserializeMetadata(output),
2617
- DkimAttributes: undefined,
2618
- FeedbackForwardingStatus: undefined,
2619
- IdentityType: undefined,
2620
- MailFromAttributes: undefined,
2621
- Tags: undefined,
2622
- VerifiedForSendingStatus: undefined,
2623
- };
2396
+ });
2624
2397
  _a = __expectNonNull;
2625
2398
  _b = __expectObject;
2626
2399
  return [4, parseBody(output.body, context)];
2627
2400
  case 1:
2628
2401
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2629
- if (data.DkimAttributes !== undefined && data.DkimAttributes !== null) {
2402
+ if (data.DkimAttributes != null) {
2630
2403
  contents.DkimAttributes = deserializeAws_restJson1DkimAttributes(data.DkimAttributes, context);
2631
2404
  }
2632
- if (data.FeedbackForwardingStatus !== undefined && data.FeedbackForwardingStatus !== null) {
2405
+ if (data.FeedbackForwardingStatus != null) {
2633
2406
  contents.FeedbackForwardingStatus = __expectBoolean(data.FeedbackForwardingStatus);
2634
2407
  }
2635
- if (data.IdentityType !== undefined && data.IdentityType !== null) {
2408
+ if (data.IdentityType != null) {
2636
2409
  contents.IdentityType = __expectString(data.IdentityType);
2637
2410
  }
2638
- if (data.MailFromAttributes !== undefined && data.MailFromAttributes !== null) {
2411
+ if (data.MailFromAttributes != null) {
2639
2412
  contents.MailFromAttributes = deserializeAws_restJson1MailFromAttributes(data.MailFromAttributes, context);
2640
2413
  }
2641
- if (data.Tags !== undefined && data.Tags !== null) {
2414
+ if (data.Tags != null) {
2642
2415
  contents.Tags = deserializeAws_restJson1TagList(data.Tags, context);
2643
2416
  }
2644
- if (data.VerifiedForSendingStatus !== undefined && data.VerifiedForSendingStatus !== null) {
2417
+ if (data.VerifiedForSendingStatus != null) {
2645
2418
  contents.VerifiedForSendingStatus = __expectBoolean(data.VerifiedForSendingStatus);
2646
2419
  }
2647
- return [2, Promise.resolve(contents)];
2420
+ return [2, contents];
2648
2421
  }
2649
2422
  });
2650
2423
  }); };
2651
2424
  var deserializeAws_restJson1GetEmailIdentityCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2652
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2425
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2653
2426
  var _c;
2654
2427
  return __generator(this, function (_d) {
2655
2428
  switch (_d.label) {
@@ -2678,14 +2451,14 @@ var deserializeAws_restJson1GetEmailIdentityCommandError = function (output, con
2678
2451
  case 7: throw _d.sent();
2679
2452
  case 8:
2680
2453
  parsedBody = parsedOutput.body;
2681
- $metadata = deserializeMetadata(output);
2682
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2683
- response = new __BaseException({
2684
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2685
- $fault: "client",
2686
- $metadata: $metadata,
2454
+ throwDefaultError({
2455
+ output: output,
2456
+ parsedBody: parsedBody,
2457
+ exceptionCtor: __BaseException,
2458
+ errorCode: errorCode,
2687
2459
  });
2688
- throw __decorateServiceException(response, parsedBody);
2460
+ _d.label = 9;
2461
+ case 9: return [2];
2689
2462
  }
2690
2463
  });
2691
2464
  }); };
@@ -2697,28 +2470,26 @@ export var deserializeAws_restJson1ListConfigurationSetsCommand = function (outp
2697
2470
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2698
2471
  return [2, deserializeAws_restJson1ListConfigurationSetsCommandError(output, context)];
2699
2472
  }
2700
- contents = {
2473
+ contents = map({
2701
2474
  $metadata: deserializeMetadata(output),
2702
- ConfigurationSets: undefined,
2703
- NextToken: undefined,
2704
- };
2475
+ });
2705
2476
  _a = __expectNonNull;
2706
2477
  _b = __expectObject;
2707
2478
  return [4, parseBody(output.body, context)];
2708
2479
  case 1:
2709
2480
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2710
- if (data.ConfigurationSets !== undefined && data.ConfigurationSets !== null) {
2481
+ if (data.ConfigurationSets != null) {
2711
2482
  contents.ConfigurationSets = deserializeAws_restJson1ConfigurationSetNameList(data.ConfigurationSets, context);
2712
2483
  }
2713
- if (data.NextToken !== undefined && data.NextToken !== null) {
2484
+ if (data.NextToken != null) {
2714
2485
  contents.NextToken = __expectString(data.NextToken);
2715
2486
  }
2716
- return [2, Promise.resolve(contents)];
2487
+ return [2, contents];
2717
2488
  }
2718
2489
  });
2719
2490
  }); };
2720
2491
  var deserializeAws_restJson1ListConfigurationSetsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2721
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2492
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2722
2493
  var _c;
2723
2494
  return __generator(this, function (_d) {
2724
2495
  switch (_d.label) {
@@ -2743,14 +2514,14 @@ var deserializeAws_restJson1ListConfigurationSetsCommandError = function (output
2743
2514
  case 5: throw _d.sent();
2744
2515
  case 6:
2745
2516
  parsedBody = parsedOutput.body;
2746
- $metadata = deserializeMetadata(output);
2747
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2748
- response = new __BaseException({
2749
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2750
- $fault: "client",
2751
- $metadata: $metadata,
2517
+ throwDefaultError({
2518
+ output: output,
2519
+ parsedBody: parsedBody,
2520
+ exceptionCtor: __BaseException,
2521
+ errorCode: errorCode,
2752
2522
  });
2753
- throw __decorateServiceException(response, parsedBody);
2523
+ _d.label = 7;
2524
+ case 7: return [2];
2754
2525
  }
2755
2526
  });
2756
2527
  }); };
@@ -2762,28 +2533,26 @@ export var deserializeAws_restJson1ListDedicatedIpPoolsCommand = function (outpu
2762
2533
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2763
2534
  return [2, deserializeAws_restJson1ListDedicatedIpPoolsCommandError(output, context)];
2764
2535
  }
2765
- contents = {
2536
+ contents = map({
2766
2537
  $metadata: deserializeMetadata(output),
2767
- DedicatedIpPools: undefined,
2768
- NextToken: undefined,
2769
- };
2538
+ });
2770
2539
  _a = __expectNonNull;
2771
2540
  _b = __expectObject;
2772
2541
  return [4, parseBody(output.body, context)];
2773
2542
  case 1:
2774
2543
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2775
- if (data.DedicatedIpPools !== undefined && data.DedicatedIpPools !== null) {
2544
+ if (data.DedicatedIpPools != null) {
2776
2545
  contents.DedicatedIpPools = deserializeAws_restJson1ListOfDedicatedIpPools(data.DedicatedIpPools, context);
2777
2546
  }
2778
- if (data.NextToken !== undefined && data.NextToken !== null) {
2547
+ if (data.NextToken != null) {
2779
2548
  contents.NextToken = __expectString(data.NextToken);
2780
2549
  }
2781
- return [2, Promise.resolve(contents)];
2550
+ return [2, contents];
2782
2551
  }
2783
2552
  });
2784
2553
  }); };
2785
2554
  var deserializeAws_restJson1ListDedicatedIpPoolsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2786
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2555
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2787
2556
  var _c;
2788
2557
  return __generator(this, function (_d) {
2789
2558
  switch (_d.label) {
@@ -2808,14 +2577,14 @@ var deserializeAws_restJson1ListDedicatedIpPoolsCommandError = function (output,
2808
2577
  case 5: throw _d.sent();
2809
2578
  case 6:
2810
2579
  parsedBody = parsedOutput.body;
2811
- $metadata = deserializeMetadata(output);
2812
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2813
- response = new __BaseException({
2814
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2815
- $fault: "client",
2816
- $metadata: $metadata,
2580
+ throwDefaultError({
2581
+ output: output,
2582
+ parsedBody: parsedBody,
2583
+ exceptionCtor: __BaseException,
2584
+ errorCode: errorCode,
2817
2585
  });
2818
- throw __decorateServiceException(response, parsedBody);
2586
+ _d.label = 7;
2587
+ case 7: return [2];
2819
2588
  }
2820
2589
  });
2821
2590
  }); };
@@ -2827,28 +2596,26 @@ export var deserializeAws_restJson1ListDeliverabilityTestReportsCommand = functi
2827
2596
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2828
2597
  return [2, deserializeAws_restJson1ListDeliverabilityTestReportsCommandError(output, context)];
2829
2598
  }
2830
- contents = {
2599
+ contents = map({
2831
2600
  $metadata: deserializeMetadata(output),
2832
- DeliverabilityTestReports: undefined,
2833
- NextToken: undefined,
2834
- };
2601
+ });
2835
2602
  _a = __expectNonNull;
2836
2603
  _b = __expectObject;
2837
2604
  return [4, parseBody(output.body, context)];
2838
2605
  case 1:
2839
2606
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2840
- if (data.DeliverabilityTestReports !== undefined && data.DeliverabilityTestReports !== null) {
2607
+ if (data.DeliverabilityTestReports != null) {
2841
2608
  contents.DeliverabilityTestReports = deserializeAws_restJson1DeliverabilityTestReports(data.DeliverabilityTestReports, context);
2842
2609
  }
2843
- if (data.NextToken !== undefined && data.NextToken !== null) {
2610
+ if (data.NextToken != null) {
2844
2611
  contents.NextToken = __expectString(data.NextToken);
2845
2612
  }
2846
- return [2, Promise.resolve(contents)];
2613
+ return [2, contents];
2847
2614
  }
2848
2615
  });
2849
2616
  }); };
2850
2617
  var deserializeAws_restJson1ListDeliverabilityTestReportsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2851
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2618
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2852
2619
  var _c;
2853
2620
  return __generator(this, function (_d) {
2854
2621
  switch (_d.label) {
@@ -2877,14 +2644,14 @@ var deserializeAws_restJson1ListDeliverabilityTestReportsCommandError = function
2877
2644
  case 7: throw _d.sent();
2878
2645
  case 8:
2879
2646
  parsedBody = parsedOutput.body;
2880
- $metadata = deserializeMetadata(output);
2881
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2882
- response = new __BaseException({
2883
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2884
- $fault: "client",
2885
- $metadata: $metadata,
2647
+ throwDefaultError({
2648
+ output: output,
2649
+ parsedBody: parsedBody,
2650
+ exceptionCtor: __BaseException,
2651
+ errorCode: errorCode,
2886
2652
  });
2887
- throw __decorateServiceException(response, parsedBody);
2653
+ _d.label = 9;
2654
+ case 9: return [2];
2888
2655
  }
2889
2656
  });
2890
2657
  }); };
@@ -2896,28 +2663,26 @@ export var deserializeAws_restJson1ListDomainDeliverabilityCampaignsCommand = fu
2896
2663
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2897
2664
  return [2, deserializeAws_restJson1ListDomainDeliverabilityCampaignsCommandError(output, context)];
2898
2665
  }
2899
- contents = {
2666
+ contents = map({
2900
2667
  $metadata: deserializeMetadata(output),
2901
- DomainDeliverabilityCampaigns: undefined,
2902
- NextToken: undefined,
2903
- };
2668
+ });
2904
2669
  _a = __expectNonNull;
2905
2670
  _b = __expectObject;
2906
2671
  return [4, parseBody(output.body, context)];
2907
2672
  case 1:
2908
2673
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2909
- if (data.DomainDeliverabilityCampaigns !== undefined && data.DomainDeliverabilityCampaigns !== null) {
2674
+ if (data.DomainDeliverabilityCampaigns != null) {
2910
2675
  contents.DomainDeliverabilityCampaigns = deserializeAws_restJson1DomainDeliverabilityCampaignList(data.DomainDeliverabilityCampaigns, context);
2911
2676
  }
2912
- if (data.NextToken !== undefined && data.NextToken !== null) {
2677
+ if (data.NextToken != null) {
2913
2678
  contents.NextToken = __expectString(data.NextToken);
2914
2679
  }
2915
- return [2, Promise.resolve(contents)];
2680
+ return [2, contents];
2916
2681
  }
2917
2682
  });
2918
2683
  }); };
2919
2684
  var deserializeAws_restJson1ListDomainDeliverabilityCampaignsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2920
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2685
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2921
2686
  var _c;
2922
2687
  return __generator(this, function (_d) {
2923
2688
  switch (_d.label) {
@@ -2946,14 +2711,14 @@ var deserializeAws_restJson1ListDomainDeliverabilityCampaignsCommandError = func
2946
2711
  case 7: throw _d.sent();
2947
2712
  case 8:
2948
2713
  parsedBody = parsedOutput.body;
2949
- $metadata = deserializeMetadata(output);
2950
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2951
- response = new __BaseException({
2952
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2953
- $fault: "client",
2954
- $metadata: $metadata,
2714
+ throwDefaultError({
2715
+ output: output,
2716
+ parsedBody: parsedBody,
2717
+ exceptionCtor: __BaseException,
2718
+ errorCode: errorCode,
2955
2719
  });
2956
- throw __decorateServiceException(response, parsedBody);
2720
+ _d.label = 9;
2721
+ case 9: return [2];
2957
2722
  }
2958
2723
  });
2959
2724
  }); };
@@ -2965,28 +2730,26 @@ export var deserializeAws_restJson1ListEmailIdentitiesCommand = function (output
2965
2730
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2966
2731
  return [2, deserializeAws_restJson1ListEmailIdentitiesCommandError(output, context)];
2967
2732
  }
2968
- contents = {
2733
+ contents = map({
2969
2734
  $metadata: deserializeMetadata(output),
2970
- EmailIdentities: undefined,
2971
- NextToken: undefined,
2972
- };
2735
+ });
2973
2736
  _a = __expectNonNull;
2974
2737
  _b = __expectObject;
2975
2738
  return [4, parseBody(output.body, context)];
2976
2739
  case 1:
2977
2740
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2978
- if (data.EmailIdentities !== undefined && data.EmailIdentities !== null) {
2741
+ if (data.EmailIdentities != null) {
2979
2742
  contents.EmailIdentities = deserializeAws_restJson1IdentityInfoList(data.EmailIdentities, context);
2980
2743
  }
2981
- if (data.NextToken !== undefined && data.NextToken !== null) {
2744
+ if (data.NextToken != null) {
2982
2745
  contents.NextToken = __expectString(data.NextToken);
2983
2746
  }
2984
- return [2, Promise.resolve(contents)];
2747
+ return [2, contents];
2985
2748
  }
2986
2749
  });
2987
2750
  }); };
2988
2751
  var deserializeAws_restJson1ListEmailIdentitiesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2989
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2752
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2990
2753
  var _c;
2991
2754
  return __generator(this, function (_d) {
2992
2755
  switch (_d.label) {
@@ -3011,14 +2774,14 @@ var deserializeAws_restJson1ListEmailIdentitiesCommandError = function (output,
3011
2774
  case 5: throw _d.sent();
3012
2775
  case 6:
3013
2776
  parsedBody = parsedOutput.body;
3014
- $metadata = deserializeMetadata(output);
3015
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3016
- response = new __BaseException({
3017
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3018
- $fault: "client",
3019
- $metadata: $metadata,
2777
+ throwDefaultError({
2778
+ output: output,
2779
+ parsedBody: parsedBody,
2780
+ exceptionCtor: __BaseException,
2781
+ errorCode: errorCode,
3020
2782
  });
3021
- throw __decorateServiceException(response, parsedBody);
2783
+ _d.label = 7;
2784
+ case 7: return [2];
3022
2785
  }
3023
2786
  });
3024
2787
  }); };
@@ -3030,24 +2793,23 @@ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output
3030
2793
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3031
2794
  return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
3032
2795
  }
3033
- contents = {
2796
+ contents = map({
3034
2797
  $metadata: deserializeMetadata(output),
3035
- Tags: undefined,
3036
- };
2798
+ });
3037
2799
  _a = __expectNonNull;
3038
2800
  _b = __expectObject;
3039
2801
  return [4, parseBody(output.body, context)];
3040
2802
  case 1:
3041
2803
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3042
- if (data.Tags !== undefined && data.Tags !== null) {
2804
+ if (data.Tags != null) {
3043
2805
  contents.Tags = deserializeAws_restJson1TagList(data.Tags, context);
3044
2806
  }
3045
- return [2, Promise.resolve(contents)];
2807
+ return [2, contents];
3046
2808
  }
3047
2809
  });
3048
2810
  }); };
3049
2811
  var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3050
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2812
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3051
2813
  var _c;
3052
2814
  return __generator(this, function (_d) {
3053
2815
  switch (_d.label) {
@@ -3076,14 +2838,14 @@ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output,
3076
2838
  case 7: throw _d.sent();
3077
2839
  case 8:
3078
2840
  parsedBody = parsedOutput.body;
3079
- $metadata = deserializeMetadata(output);
3080
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3081
- response = new __BaseException({
3082
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3083
- $fault: "client",
3084
- $metadata: $metadata,
2841
+ throwDefaultError({
2842
+ output: output,
2843
+ parsedBody: parsedBody,
2844
+ exceptionCtor: __BaseException,
2845
+ errorCode: errorCode,
3085
2846
  });
3086
- throw __decorateServiceException(response, parsedBody);
2847
+ _d.label = 9;
2848
+ case 9: return [2];
3087
2849
  }
3088
2850
  });
3089
2851
  }); };
@@ -3095,18 +2857,18 @@ export var deserializeAws_restJson1PutAccountDedicatedIpWarmupAttributesCommand
3095
2857
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3096
2858
  return [2, deserializeAws_restJson1PutAccountDedicatedIpWarmupAttributesCommandError(output, context)];
3097
2859
  }
3098
- contents = {
2860
+ contents = map({
3099
2861
  $metadata: deserializeMetadata(output),
3100
- };
2862
+ });
3101
2863
  return [4, collectBody(output.body, context)];
3102
2864
  case 1:
3103
2865
  _a.sent();
3104
- return [2, Promise.resolve(contents)];
2866
+ return [2, contents];
3105
2867
  }
3106
2868
  });
3107
2869
  }); };
3108
2870
  var deserializeAws_restJson1PutAccountDedicatedIpWarmupAttributesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3109
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2871
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3110
2872
  var _c;
3111
2873
  return __generator(this, function (_d) {
3112
2874
  switch (_d.label) {
@@ -3131,14 +2893,14 @@ var deserializeAws_restJson1PutAccountDedicatedIpWarmupAttributesCommandError =
3131
2893
  case 5: throw _d.sent();
3132
2894
  case 6:
3133
2895
  parsedBody = parsedOutput.body;
3134
- $metadata = deserializeMetadata(output);
3135
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3136
- response = new __BaseException({
3137
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3138
- $fault: "client",
3139
- $metadata: $metadata,
2896
+ throwDefaultError({
2897
+ output: output,
2898
+ parsedBody: parsedBody,
2899
+ exceptionCtor: __BaseException,
2900
+ errorCode: errorCode,
3140
2901
  });
3141
- throw __decorateServiceException(response, parsedBody);
2902
+ _d.label = 7;
2903
+ case 7: return [2];
3142
2904
  }
3143
2905
  });
3144
2906
  }); };
@@ -3150,18 +2912,18 @@ export var deserializeAws_restJson1PutAccountSendingAttributesCommand = function
3150
2912
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3151
2913
  return [2, deserializeAws_restJson1PutAccountSendingAttributesCommandError(output, context)];
3152
2914
  }
3153
- contents = {
2915
+ contents = map({
3154
2916
  $metadata: deserializeMetadata(output),
3155
- };
2917
+ });
3156
2918
  return [4, collectBody(output.body, context)];
3157
2919
  case 1:
3158
2920
  _a.sent();
3159
- return [2, Promise.resolve(contents)];
2921
+ return [2, contents];
3160
2922
  }
3161
2923
  });
3162
2924
  }); };
3163
2925
  var deserializeAws_restJson1PutAccountSendingAttributesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3164
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2926
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3165
2927
  var _c;
3166
2928
  return __generator(this, function (_d) {
3167
2929
  switch (_d.label) {
@@ -3186,14 +2948,14 @@ var deserializeAws_restJson1PutAccountSendingAttributesCommandError = function (
3186
2948
  case 5: throw _d.sent();
3187
2949
  case 6:
3188
2950
  parsedBody = parsedOutput.body;
3189
- $metadata = deserializeMetadata(output);
3190
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3191
- response = new __BaseException({
3192
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3193
- $fault: "client",
3194
- $metadata: $metadata,
2951
+ throwDefaultError({
2952
+ output: output,
2953
+ parsedBody: parsedBody,
2954
+ exceptionCtor: __BaseException,
2955
+ errorCode: errorCode,
3195
2956
  });
3196
- throw __decorateServiceException(response, parsedBody);
2957
+ _d.label = 7;
2958
+ case 7: return [2];
3197
2959
  }
3198
2960
  });
3199
2961
  }); };
@@ -3205,18 +2967,18 @@ export var deserializeAws_restJson1PutConfigurationSetDeliveryOptionsCommand = f
3205
2967
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3206
2968
  return [2, deserializeAws_restJson1PutConfigurationSetDeliveryOptionsCommandError(output, context)];
3207
2969
  }
3208
- contents = {
2970
+ contents = map({
3209
2971
  $metadata: deserializeMetadata(output),
3210
- };
2972
+ });
3211
2973
  return [4, collectBody(output.body, context)];
3212
2974
  case 1:
3213
2975
  _a.sent();
3214
- return [2, Promise.resolve(contents)];
2976
+ return [2, contents];
3215
2977
  }
3216
2978
  });
3217
2979
  }); };
3218
2980
  var deserializeAws_restJson1PutConfigurationSetDeliveryOptionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3219
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2981
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3220
2982
  var _c;
3221
2983
  return __generator(this, function (_d) {
3222
2984
  switch (_d.label) {
@@ -3245,14 +3007,14 @@ var deserializeAws_restJson1PutConfigurationSetDeliveryOptionsCommandError = fun
3245
3007
  case 7: throw _d.sent();
3246
3008
  case 8:
3247
3009
  parsedBody = parsedOutput.body;
3248
- $metadata = deserializeMetadata(output);
3249
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3250
- response = new __BaseException({
3251
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3252
- $fault: "client",
3253
- $metadata: $metadata,
3010
+ throwDefaultError({
3011
+ output: output,
3012
+ parsedBody: parsedBody,
3013
+ exceptionCtor: __BaseException,
3014
+ errorCode: errorCode,
3254
3015
  });
3255
- throw __decorateServiceException(response, parsedBody);
3016
+ _d.label = 9;
3017
+ case 9: return [2];
3256
3018
  }
3257
3019
  });
3258
3020
  }); };
@@ -3264,18 +3026,18 @@ export var deserializeAws_restJson1PutConfigurationSetReputationOptionsCommand =
3264
3026
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3265
3027
  return [2, deserializeAws_restJson1PutConfigurationSetReputationOptionsCommandError(output, context)];
3266
3028
  }
3267
- contents = {
3029
+ contents = map({
3268
3030
  $metadata: deserializeMetadata(output),
3269
- };
3031
+ });
3270
3032
  return [4, collectBody(output.body, context)];
3271
3033
  case 1:
3272
3034
  _a.sent();
3273
- return [2, Promise.resolve(contents)];
3035
+ return [2, contents];
3274
3036
  }
3275
3037
  });
3276
3038
  }); };
3277
3039
  var deserializeAws_restJson1PutConfigurationSetReputationOptionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3278
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3040
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3279
3041
  var _c;
3280
3042
  return __generator(this, function (_d) {
3281
3043
  switch (_d.label) {
@@ -3304,14 +3066,14 @@ var deserializeAws_restJson1PutConfigurationSetReputationOptionsCommandError = f
3304
3066
  case 7: throw _d.sent();
3305
3067
  case 8:
3306
3068
  parsedBody = parsedOutput.body;
3307
- $metadata = deserializeMetadata(output);
3308
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3309
- response = new __BaseException({
3310
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3311
- $fault: "client",
3312
- $metadata: $metadata,
3069
+ throwDefaultError({
3070
+ output: output,
3071
+ parsedBody: parsedBody,
3072
+ exceptionCtor: __BaseException,
3073
+ errorCode: errorCode,
3313
3074
  });
3314
- throw __decorateServiceException(response, parsedBody);
3075
+ _d.label = 9;
3076
+ case 9: return [2];
3315
3077
  }
3316
3078
  });
3317
3079
  }); };
@@ -3323,18 +3085,18 @@ export var deserializeAws_restJson1PutConfigurationSetSendingOptionsCommand = fu
3323
3085
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3324
3086
  return [2, deserializeAws_restJson1PutConfigurationSetSendingOptionsCommandError(output, context)];
3325
3087
  }
3326
- contents = {
3088
+ contents = map({
3327
3089
  $metadata: deserializeMetadata(output),
3328
- };
3090
+ });
3329
3091
  return [4, collectBody(output.body, context)];
3330
3092
  case 1:
3331
3093
  _a.sent();
3332
- return [2, Promise.resolve(contents)];
3094
+ return [2, contents];
3333
3095
  }
3334
3096
  });
3335
3097
  }); };
3336
3098
  var deserializeAws_restJson1PutConfigurationSetSendingOptionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3337
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3099
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3338
3100
  var _c;
3339
3101
  return __generator(this, function (_d) {
3340
3102
  switch (_d.label) {
@@ -3363,14 +3125,14 @@ var deserializeAws_restJson1PutConfigurationSetSendingOptionsCommandError = func
3363
3125
  case 7: throw _d.sent();
3364
3126
  case 8:
3365
3127
  parsedBody = parsedOutput.body;
3366
- $metadata = deserializeMetadata(output);
3367
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3368
- response = new __BaseException({
3369
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3370
- $fault: "client",
3371
- $metadata: $metadata,
3128
+ throwDefaultError({
3129
+ output: output,
3130
+ parsedBody: parsedBody,
3131
+ exceptionCtor: __BaseException,
3132
+ errorCode: errorCode,
3372
3133
  });
3373
- throw __decorateServiceException(response, parsedBody);
3134
+ _d.label = 9;
3135
+ case 9: return [2];
3374
3136
  }
3375
3137
  });
3376
3138
  }); };
@@ -3382,18 +3144,18 @@ export var deserializeAws_restJson1PutConfigurationSetTrackingOptionsCommand = f
3382
3144
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3383
3145
  return [2, deserializeAws_restJson1PutConfigurationSetTrackingOptionsCommandError(output, context)];
3384
3146
  }
3385
- contents = {
3147
+ contents = map({
3386
3148
  $metadata: deserializeMetadata(output),
3387
- };
3149
+ });
3388
3150
  return [4, collectBody(output.body, context)];
3389
3151
  case 1:
3390
3152
  _a.sent();
3391
- return [2, Promise.resolve(contents)];
3153
+ return [2, contents];
3392
3154
  }
3393
3155
  });
3394
3156
  }); };
3395
3157
  var deserializeAws_restJson1PutConfigurationSetTrackingOptionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3396
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3158
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3397
3159
  var _c;
3398
3160
  return __generator(this, function (_d) {
3399
3161
  switch (_d.label) {
@@ -3422,14 +3184,14 @@ var deserializeAws_restJson1PutConfigurationSetTrackingOptionsCommandError = fun
3422
3184
  case 7: throw _d.sent();
3423
3185
  case 8:
3424
3186
  parsedBody = parsedOutput.body;
3425
- $metadata = deserializeMetadata(output);
3426
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3427
- response = new __BaseException({
3428
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3429
- $fault: "client",
3430
- $metadata: $metadata,
3187
+ throwDefaultError({
3188
+ output: output,
3189
+ parsedBody: parsedBody,
3190
+ exceptionCtor: __BaseException,
3191
+ errorCode: errorCode,
3431
3192
  });
3432
- throw __decorateServiceException(response, parsedBody);
3193
+ _d.label = 9;
3194
+ case 9: return [2];
3433
3195
  }
3434
3196
  });
3435
3197
  }); };
@@ -3441,18 +3203,18 @@ export var deserializeAws_restJson1PutDedicatedIpInPoolCommand = function (outpu
3441
3203
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3442
3204
  return [2, deserializeAws_restJson1PutDedicatedIpInPoolCommandError(output, context)];
3443
3205
  }
3444
- contents = {
3206
+ contents = map({
3445
3207
  $metadata: deserializeMetadata(output),
3446
- };
3208
+ });
3447
3209
  return [4, collectBody(output.body, context)];
3448
3210
  case 1:
3449
3211
  _a.sent();
3450
- return [2, Promise.resolve(contents)];
3212
+ return [2, contents];
3451
3213
  }
3452
3214
  });
3453
3215
  }); };
3454
3216
  var deserializeAws_restJson1PutDedicatedIpInPoolCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3455
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3217
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3456
3218
  var _c;
3457
3219
  return __generator(this, function (_d) {
3458
3220
  switch (_d.label) {
@@ -3481,14 +3243,14 @@ var deserializeAws_restJson1PutDedicatedIpInPoolCommandError = function (output,
3481
3243
  case 7: throw _d.sent();
3482
3244
  case 8:
3483
3245
  parsedBody = parsedOutput.body;
3484
- $metadata = deserializeMetadata(output);
3485
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3486
- response = new __BaseException({
3487
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3488
- $fault: "client",
3489
- $metadata: $metadata,
3246
+ throwDefaultError({
3247
+ output: output,
3248
+ parsedBody: parsedBody,
3249
+ exceptionCtor: __BaseException,
3250
+ errorCode: errorCode,
3490
3251
  });
3491
- throw __decorateServiceException(response, parsedBody);
3252
+ _d.label = 9;
3253
+ case 9: return [2];
3492
3254
  }
3493
3255
  });
3494
3256
  }); };
@@ -3500,18 +3262,18 @@ export var deserializeAws_restJson1PutDedicatedIpWarmupAttributesCommand = funct
3500
3262
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3501
3263
  return [2, deserializeAws_restJson1PutDedicatedIpWarmupAttributesCommandError(output, context)];
3502
3264
  }
3503
- contents = {
3265
+ contents = map({
3504
3266
  $metadata: deserializeMetadata(output),
3505
- };
3267
+ });
3506
3268
  return [4, collectBody(output.body, context)];
3507
3269
  case 1:
3508
3270
  _a.sent();
3509
- return [2, Promise.resolve(contents)];
3271
+ return [2, contents];
3510
3272
  }
3511
3273
  });
3512
3274
  }); };
3513
3275
  var deserializeAws_restJson1PutDedicatedIpWarmupAttributesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3514
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3276
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3515
3277
  var _c;
3516
3278
  return __generator(this, function (_d) {
3517
3279
  switch (_d.label) {
@@ -3540,14 +3302,14 @@ var deserializeAws_restJson1PutDedicatedIpWarmupAttributesCommandError = functio
3540
3302
  case 7: throw _d.sent();
3541
3303
  case 8:
3542
3304
  parsedBody = parsedOutput.body;
3543
- $metadata = deserializeMetadata(output);
3544
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3545
- response = new __BaseException({
3546
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3547
- $fault: "client",
3548
- $metadata: $metadata,
3305
+ throwDefaultError({
3306
+ output: output,
3307
+ parsedBody: parsedBody,
3308
+ exceptionCtor: __BaseException,
3309
+ errorCode: errorCode,
3549
3310
  });
3550
- throw __decorateServiceException(response, parsedBody);
3311
+ _d.label = 9;
3312
+ case 9: return [2];
3551
3313
  }
3552
3314
  });
3553
3315
  }); };
@@ -3559,18 +3321,18 @@ export var deserializeAws_restJson1PutDeliverabilityDashboardOptionCommand = fun
3559
3321
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3560
3322
  return [2, deserializeAws_restJson1PutDeliverabilityDashboardOptionCommandError(output, context)];
3561
3323
  }
3562
- contents = {
3324
+ contents = map({
3563
3325
  $metadata: deserializeMetadata(output),
3564
- };
3326
+ });
3565
3327
  return [4, collectBody(output.body, context)];
3566
3328
  case 1:
3567
3329
  _a.sent();
3568
- return [2, Promise.resolve(contents)];
3330
+ return [2, contents];
3569
3331
  }
3570
3332
  });
3571
3333
  }); };
3572
3334
  var deserializeAws_restJson1PutDeliverabilityDashboardOptionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3573
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3335
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3574
3336
  var _c;
3575
3337
  return __generator(this, function (_d) {
3576
3338
  switch (_d.label) {
@@ -3607,14 +3369,14 @@ var deserializeAws_restJson1PutDeliverabilityDashboardOptionCommandError = funct
3607
3369
  case 11: throw _d.sent();
3608
3370
  case 12:
3609
3371
  parsedBody = parsedOutput.body;
3610
- $metadata = deserializeMetadata(output);
3611
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3612
- response = new __BaseException({
3613
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3614
- $fault: "client",
3615
- $metadata: $metadata,
3372
+ throwDefaultError({
3373
+ output: output,
3374
+ parsedBody: parsedBody,
3375
+ exceptionCtor: __BaseException,
3376
+ errorCode: errorCode,
3616
3377
  });
3617
- throw __decorateServiceException(response, parsedBody);
3378
+ _d.label = 13;
3379
+ case 13: return [2];
3618
3380
  }
3619
3381
  });
3620
3382
  }); };
@@ -3626,18 +3388,18 @@ export var deserializeAws_restJson1PutEmailIdentityDkimAttributesCommand = funct
3626
3388
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3627
3389
  return [2, deserializeAws_restJson1PutEmailIdentityDkimAttributesCommandError(output, context)];
3628
3390
  }
3629
- contents = {
3391
+ contents = map({
3630
3392
  $metadata: deserializeMetadata(output),
3631
- };
3393
+ });
3632
3394
  return [4, collectBody(output.body, context)];
3633
3395
  case 1:
3634
3396
  _a.sent();
3635
- return [2, Promise.resolve(contents)];
3397
+ return [2, contents];
3636
3398
  }
3637
3399
  });
3638
3400
  }); };
3639
3401
  var deserializeAws_restJson1PutEmailIdentityDkimAttributesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3640
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3402
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3641
3403
  var _c;
3642
3404
  return __generator(this, function (_d) {
3643
3405
  switch (_d.label) {
@@ -3666,14 +3428,14 @@ var deserializeAws_restJson1PutEmailIdentityDkimAttributesCommandError = functio
3666
3428
  case 7: throw _d.sent();
3667
3429
  case 8:
3668
3430
  parsedBody = parsedOutput.body;
3669
- $metadata = deserializeMetadata(output);
3670
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3671
- response = new __BaseException({
3672
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3673
- $fault: "client",
3674
- $metadata: $metadata,
3431
+ throwDefaultError({
3432
+ output: output,
3433
+ parsedBody: parsedBody,
3434
+ exceptionCtor: __BaseException,
3435
+ errorCode: errorCode,
3675
3436
  });
3676
- throw __decorateServiceException(response, parsedBody);
3437
+ _d.label = 9;
3438
+ case 9: return [2];
3677
3439
  }
3678
3440
  });
3679
3441
  }); };
@@ -3685,18 +3447,18 @@ export var deserializeAws_restJson1PutEmailIdentityFeedbackAttributesCommand = f
3685
3447
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3686
3448
  return [2, deserializeAws_restJson1PutEmailIdentityFeedbackAttributesCommandError(output, context)];
3687
3449
  }
3688
- contents = {
3450
+ contents = map({
3689
3451
  $metadata: deserializeMetadata(output),
3690
- };
3452
+ });
3691
3453
  return [4, collectBody(output.body, context)];
3692
3454
  case 1:
3693
3455
  _a.sent();
3694
- return [2, Promise.resolve(contents)];
3456
+ return [2, contents];
3695
3457
  }
3696
3458
  });
3697
3459
  }); };
3698
3460
  var deserializeAws_restJson1PutEmailIdentityFeedbackAttributesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3699
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3461
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3700
3462
  var _c;
3701
3463
  return __generator(this, function (_d) {
3702
3464
  switch (_d.label) {
@@ -3725,14 +3487,14 @@ var deserializeAws_restJson1PutEmailIdentityFeedbackAttributesCommandError = fun
3725
3487
  case 7: throw _d.sent();
3726
3488
  case 8:
3727
3489
  parsedBody = parsedOutput.body;
3728
- $metadata = deserializeMetadata(output);
3729
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3730
- response = new __BaseException({
3731
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3732
- $fault: "client",
3733
- $metadata: $metadata,
3490
+ throwDefaultError({
3491
+ output: output,
3492
+ parsedBody: parsedBody,
3493
+ exceptionCtor: __BaseException,
3494
+ errorCode: errorCode,
3734
3495
  });
3735
- throw __decorateServiceException(response, parsedBody);
3496
+ _d.label = 9;
3497
+ case 9: return [2];
3736
3498
  }
3737
3499
  });
3738
3500
  }); };
@@ -3744,18 +3506,18 @@ export var deserializeAws_restJson1PutEmailIdentityMailFromAttributesCommand = f
3744
3506
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3745
3507
  return [2, deserializeAws_restJson1PutEmailIdentityMailFromAttributesCommandError(output, context)];
3746
3508
  }
3747
- contents = {
3509
+ contents = map({
3748
3510
  $metadata: deserializeMetadata(output),
3749
- };
3511
+ });
3750
3512
  return [4, collectBody(output.body, context)];
3751
3513
  case 1:
3752
3514
  _a.sent();
3753
- return [2, Promise.resolve(contents)];
3515
+ return [2, contents];
3754
3516
  }
3755
3517
  });
3756
3518
  }); };
3757
3519
  var deserializeAws_restJson1PutEmailIdentityMailFromAttributesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3758
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3520
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3759
3521
  var _c;
3760
3522
  return __generator(this, function (_d) {
3761
3523
  switch (_d.label) {
@@ -3784,14 +3546,14 @@ var deserializeAws_restJson1PutEmailIdentityMailFromAttributesCommandError = fun
3784
3546
  case 7: throw _d.sent();
3785
3547
  case 8:
3786
3548
  parsedBody = parsedOutput.body;
3787
- $metadata = deserializeMetadata(output);
3788
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3789
- response = new __BaseException({
3790
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3791
- $fault: "client",
3792
- $metadata: $metadata,
3549
+ throwDefaultError({
3550
+ output: output,
3551
+ parsedBody: parsedBody,
3552
+ exceptionCtor: __BaseException,
3553
+ errorCode: errorCode,
3793
3554
  });
3794
- throw __decorateServiceException(response, parsedBody);
3555
+ _d.label = 9;
3556
+ case 9: return [2];
3795
3557
  }
3796
3558
  });
3797
3559
  }); };
@@ -3803,24 +3565,23 @@ export var deserializeAws_restJson1SendEmailCommand = function (output, context)
3803
3565
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3804
3566
  return [2, deserializeAws_restJson1SendEmailCommandError(output, context)];
3805
3567
  }
3806
- contents = {
3568
+ contents = map({
3807
3569
  $metadata: deserializeMetadata(output),
3808
- MessageId: undefined,
3809
- };
3570
+ });
3810
3571
  _a = __expectNonNull;
3811
3572
  _b = __expectObject;
3812
3573
  return [4, parseBody(output.body, context)];
3813
3574
  case 1:
3814
3575
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3815
- if (data.MessageId !== undefined && data.MessageId !== null) {
3576
+ if (data.MessageId != null) {
3816
3577
  contents.MessageId = __expectString(data.MessageId);
3817
3578
  }
3818
- return [2, Promise.resolve(contents)];
3579
+ return [2, contents];
3819
3580
  }
3820
3581
  });
3821
3582
  }); };
3822
3583
  var deserializeAws_restJson1SendEmailCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3823
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3584
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3824
3585
  var _c;
3825
3586
  return __generator(this, function (_d) {
3826
3587
  switch (_d.label) {
@@ -3869,14 +3630,14 @@ var deserializeAws_restJson1SendEmailCommandError = function (output, context) {
3869
3630
  case 17: throw _d.sent();
3870
3631
  case 18:
3871
3632
  parsedBody = parsedOutput.body;
3872
- $metadata = deserializeMetadata(output);
3873
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3874
- response = new __BaseException({
3875
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3876
- $fault: "client",
3877
- $metadata: $metadata,
3633
+ throwDefaultError({
3634
+ output: output,
3635
+ parsedBody: parsedBody,
3636
+ exceptionCtor: __BaseException,
3637
+ errorCode: errorCode,
3878
3638
  });
3879
- throw __decorateServiceException(response, parsedBody);
3639
+ _d.label = 19;
3640
+ case 19: return [2];
3880
3641
  }
3881
3642
  });
3882
3643
  }); };
@@ -3888,18 +3649,18 @@ export var deserializeAws_restJson1TagResourceCommand = function (output, contex
3888
3649
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3889
3650
  return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
3890
3651
  }
3891
- contents = {
3652
+ contents = map({
3892
3653
  $metadata: deserializeMetadata(output),
3893
- };
3654
+ });
3894
3655
  return [4, collectBody(output.body, context)];
3895
3656
  case 1:
3896
3657
  _a.sent();
3897
- return [2, Promise.resolve(contents)];
3658
+ return [2, contents];
3898
3659
  }
3899
3660
  });
3900
3661
  }); };
3901
3662
  var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3902
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3663
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3903
3664
  var _c;
3904
3665
  return __generator(this, function (_d) {
3905
3666
  switch (_d.label) {
@@ -3932,14 +3693,14 @@ var deserializeAws_restJson1TagResourceCommandError = function (output, context)
3932
3693
  case 9: throw _d.sent();
3933
3694
  case 10:
3934
3695
  parsedBody = parsedOutput.body;
3935
- $metadata = deserializeMetadata(output);
3936
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3937
- response = new __BaseException({
3938
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3939
- $fault: "client",
3940
- $metadata: $metadata,
3696
+ throwDefaultError({
3697
+ output: output,
3698
+ parsedBody: parsedBody,
3699
+ exceptionCtor: __BaseException,
3700
+ errorCode: errorCode,
3941
3701
  });
3942
- throw __decorateServiceException(response, parsedBody);
3702
+ _d.label = 11;
3703
+ case 11: return [2];
3943
3704
  }
3944
3705
  });
3945
3706
  }); };
@@ -3951,18 +3712,18 @@ export var deserializeAws_restJson1UntagResourceCommand = function (output, cont
3951
3712
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3952
3713
  return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
3953
3714
  }
3954
- contents = {
3715
+ contents = map({
3955
3716
  $metadata: deserializeMetadata(output),
3956
- };
3717
+ });
3957
3718
  return [4, collectBody(output.body, context)];
3958
3719
  case 1:
3959
3720
  _a.sent();
3960
- return [2, Promise.resolve(contents)];
3721
+ return [2, contents];
3961
3722
  }
3962
3723
  });
3963
3724
  }); };
3964
3725
  var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3965
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3726
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3966
3727
  var _c;
3967
3728
  return __generator(this, function (_d) {
3968
3729
  switch (_d.label) {
@@ -3995,14 +3756,14 @@ var deserializeAws_restJson1UntagResourceCommandError = function (output, contex
3995
3756
  case 9: throw _d.sent();
3996
3757
  case 10:
3997
3758
  parsedBody = parsedOutput.body;
3998
- $metadata = deserializeMetadata(output);
3999
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4000
- response = new __BaseException({
4001
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4002
- $fault: "client",
4003
- $metadata: $metadata,
3759
+ throwDefaultError({
3760
+ output: output,
3761
+ parsedBody: parsedBody,
3762
+ exceptionCtor: __BaseException,
3763
+ errorCode: errorCode,
4004
3764
  });
4005
- throw __decorateServiceException(response, parsedBody);
3765
+ _d.label = 11;
3766
+ case 11: return [2];
4006
3767
  }
4007
3768
  });
4008
3769
  }); };
@@ -4014,18 +3775,18 @@ export var deserializeAws_restJson1UpdateConfigurationSetEventDestinationCommand
4014
3775
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4015
3776
  return [2, deserializeAws_restJson1UpdateConfigurationSetEventDestinationCommandError(output, context)];
4016
3777
  }
4017
- contents = {
3778
+ contents = map({
4018
3779
  $metadata: deserializeMetadata(output),
4019
- };
3780
+ });
4020
3781
  return [4, collectBody(output.body, context)];
4021
3782
  case 1:
4022
3783
  _a.sent();
4023
- return [2, Promise.resolve(contents)];
3784
+ return [2, contents];
4024
3785
  }
4025
3786
  });
4026
3787
  }); };
4027
3788
  var deserializeAws_restJson1UpdateConfigurationSetEventDestinationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
4028
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3789
+ var parsedOutput, _a, errorCode, _b, parsedBody;
4029
3790
  var _c;
4030
3791
  return __generator(this, function (_d) {
4031
3792
  switch (_d.label) {
@@ -4054,23 +3815,24 @@ var deserializeAws_restJson1UpdateConfigurationSetEventDestinationCommandError =
4054
3815
  case 7: throw _d.sent();
4055
3816
  case 8:
4056
3817
  parsedBody = parsedOutput.body;
4057
- $metadata = deserializeMetadata(output);
4058
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4059
- response = new __BaseException({
4060
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4061
- $fault: "client",
4062
- $metadata: $metadata,
3818
+ throwDefaultError({
3819
+ output: output,
3820
+ parsedBody: parsedBody,
3821
+ exceptionCtor: __BaseException,
3822
+ errorCode: errorCode,
4063
3823
  });
4064
- throw __decorateServiceException(response, parsedBody);
3824
+ _d.label = 9;
3825
+ case 9: return [2];
4065
3826
  }
4066
3827
  });
4067
3828
  }); };
3829
+ var map = __map;
4068
3830
  var deserializeAws_restJson1AccountSuspendedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
4069
3831
  var contents, data, exception;
4070
3832
  return __generator(this, function (_a) {
4071
- contents = {};
3833
+ contents = map({});
4072
3834
  data = parsedOutput.body;
4073
- if (data.message !== undefined && data.message !== null) {
3835
+ if (data.message != null) {
4074
3836
  contents.message = __expectString(data.message);
4075
3837
  }
4076
3838
  exception = new AccountSuspendedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -4080,9 +3842,9 @@ var deserializeAws_restJson1AccountSuspendedExceptionResponse = function (parsed
4080
3842
  var deserializeAws_restJson1AlreadyExistsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
4081
3843
  var contents, data, exception;
4082
3844
  return __generator(this, function (_a) {
4083
- contents = {};
3845
+ contents = map({});
4084
3846
  data = parsedOutput.body;
4085
- if (data.message !== undefined && data.message !== null) {
3847
+ if (data.message != null) {
4086
3848
  contents.message = __expectString(data.message);
4087
3849
  }
4088
3850
  exception = new AlreadyExistsException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -4092,9 +3854,9 @@ var deserializeAws_restJson1AlreadyExistsExceptionResponse = function (parsedOut
4092
3854
  var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
4093
3855
  var contents, data, exception;
4094
3856
  return __generator(this, function (_a) {
4095
- contents = {};
3857
+ contents = map({});
4096
3858
  data = parsedOutput.body;
4097
- if (data.message !== undefined && data.message !== null) {
3859
+ if (data.message != null) {
4098
3860
  contents.message = __expectString(data.message);
4099
3861
  }
4100
3862
  exception = new BadRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -4104,9 +3866,9 @@ var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput
4104
3866
  var deserializeAws_restJson1ConcurrentModificationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
4105
3867
  var contents, data, exception;
4106
3868
  return __generator(this, function (_a) {
4107
- contents = {};
3869
+ contents = map({});
4108
3870
  data = parsedOutput.body;
4109
- if (data.message !== undefined && data.message !== null) {
3871
+ if (data.message != null) {
4110
3872
  contents.message = __expectString(data.message);
4111
3873
  }
4112
3874
  exception = new ConcurrentModificationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -4116,9 +3878,9 @@ var deserializeAws_restJson1ConcurrentModificationExceptionResponse = function (
4116
3878
  var deserializeAws_restJson1LimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
4117
3879
  var contents, data, exception;
4118
3880
  return __generator(this, function (_a) {
4119
- contents = {};
3881
+ contents = map({});
4120
3882
  data = parsedOutput.body;
4121
- if (data.message !== undefined && data.message !== null) {
3883
+ if (data.message != null) {
4122
3884
  contents.message = __expectString(data.message);
4123
3885
  }
4124
3886
  exception = new LimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -4128,9 +3890,9 @@ var deserializeAws_restJson1LimitExceededExceptionResponse = function (parsedOut
4128
3890
  var deserializeAws_restJson1MailFromDomainNotVerifiedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
4129
3891
  var contents, data, exception;
4130
3892
  return __generator(this, function (_a) {
4131
- contents = {};
3893
+ contents = map({});
4132
3894
  data = parsedOutput.body;
4133
- if (data.message !== undefined && data.message !== null) {
3895
+ if (data.message != null) {
4134
3896
  contents.message = __expectString(data.message);
4135
3897
  }
4136
3898
  exception = new MailFromDomainNotVerifiedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -4140,9 +3902,9 @@ var deserializeAws_restJson1MailFromDomainNotVerifiedExceptionResponse = functio
4140
3902
  var deserializeAws_restJson1MessageRejectedResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
4141
3903
  var contents, data, exception;
4142
3904
  return __generator(this, function (_a) {
4143
- contents = {};
3905
+ contents = map({});
4144
3906
  data = parsedOutput.body;
4145
- if (data.message !== undefined && data.message !== null) {
3907
+ if (data.message != null) {
4146
3908
  contents.message = __expectString(data.message);
4147
3909
  }
4148
3910
  exception = new MessageRejected(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -4152,9 +3914,9 @@ var deserializeAws_restJson1MessageRejectedResponse = function (parsedOutput, co
4152
3914
  var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
4153
3915
  var contents, data, exception;
4154
3916
  return __generator(this, function (_a) {
4155
- contents = {};
3917
+ contents = map({});
4156
3918
  data = parsedOutput.body;
4157
- if (data.message !== undefined && data.message !== null) {
3919
+ if (data.message != null) {
4158
3920
  contents.message = __expectString(data.message);
4159
3921
  }
4160
3922
  exception = new NotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -4164,9 +3926,9 @@ var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput,
4164
3926
  var deserializeAws_restJson1SendingPausedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
4165
3927
  var contents, data, exception;
4166
3928
  return __generator(this, function (_a) {
4167
- contents = {};
3929
+ contents = map({});
4168
3930
  data = parsedOutput.body;
4169
- if (data.message !== undefined && data.message !== null) {
3931
+ if (data.message != null) {
4170
3932
  contents.message = __expectString(data.message);
4171
3933
  }
4172
3934
  exception = new SendingPausedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -4176,9 +3938,9 @@ var deserializeAws_restJson1SendingPausedExceptionResponse = function (parsedOut
4176
3938
  var deserializeAws_restJson1TooManyRequestsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
4177
3939
  var contents, data, exception;
4178
3940
  return __generator(this, function (_a) {
4179
- contents = {};
3941
+ contents = map({});
4180
3942
  data = parsedOutput.body;
4181
- if (data.message !== undefined && data.message !== null) {
3943
+ if (data.message != null) {
4182
3944
  contents.message = __expectString(data.message);
4183
3945
  }
4184
3946
  exception = new TooManyRequestsException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -4200,9 +3962,6 @@ var serializeAws_restJson1CloudWatchDimensionConfigurations = function (input, c
4200
3962
  return input
4201
3963
  .filter(function (e) { return e != null; })
4202
3964
  .map(function (entry) {
4203
- if (entry === null) {
4204
- return null;
4205
- }
4206
3965
  return serializeAws_restJson1CloudWatchDimensionConfiguration(entry, context);
4207
3966
  });
4208
3967
  };
@@ -4232,9 +3991,6 @@ var serializeAws_restJson1DomainDeliverabilityTrackingOptions = function (input,
4232
3991
  return input
4233
3992
  .filter(function (e) { return e != null; })
4234
3993
  .map(function (entry) {
4235
- if (entry === null) {
4236
- return null;
4237
- }
4238
3994
  return serializeAws_restJson1DomainDeliverabilityTrackingOption(entry, context);
4239
3995
  });
4240
3996
  };
@@ -4242,9 +3998,6 @@ var serializeAws_restJson1EmailAddressList = function (input, context) {
4242
3998
  return input
4243
3999
  .filter(function (e) { return e != null; })
4244
4000
  .map(function (entry) {
4245
- if (entry === null) {
4246
- return null;
4247
- }
4248
4001
  return entry;
4249
4002
  });
4250
4003
  };
@@ -4268,9 +4021,6 @@ var serializeAws_restJson1EventTypes = function (input, context) {
4268
4021
  return input
4269
4022
  .filter(function (e) { return e != null; })
4270
4023
  .map(function (entry) {
4271
- if (entry === null) {
4272
- return null;
4273
- }
4274
4024
  return entry;
4275
4025
  });
4276
4026
  };
@@ -4281,9 +4031,6 @@ var serializeAws_restJson1IspNameList = function (input, context) {
4281
4031
  return input
4282
4032
  .filter(function (e) { return e != null; })
4283
4033
  .map(function (entry) {
4284
- if (entry === null) {
4285
- return null;
4286
- }
4287
4034
  return entry;
4288
4035
  });
4289
4036
  };
@@ -4300,9 +4047,6 @@ var serializeAws_restJson1MessageTagList = function (input, context) {
4300
4047
  return input
4301
4048
  .filter(function (e) { return e != null; })
4302
4049
  .map(function (entry) {
4303
- if (entry === null) {
4304
- return null;
4305
- }
4306
4050
  return serializeAws_restJson1MessageTag(entry, context);
4307
4051
  });
4308
4052
  };
@@ -4328,9 +4072,6 @@ var serializeAws_restJson1TagList = function (input, context) {
4328
4072
  return input
4329
4073
  .filter(function (e) { return e != null; })
4330
4074
  .map(function (entry) {
4331
- if (entry === null) {
4332
- return null;
4333
- }
4334
4075
  return serializeAws_restJson1Tag(entry, context);
4335
4076
  });
4336
4077
  };