@aws-sdk/client-rolesanywhere 3.141.0 → 3.150.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, extendedEncodeURIComponent as __extendedEncodeURIComponent, parseRfc3339DateTime as __parseRfc3339DateTime, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, map as __map, parseRfc3339DateTime as __parseRfc3339DateTime, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { AccessDeniedException, ResourceNotFoundException, SourceData, TooManyTagsException, ValidationException, } from "../models/models_0";
5
5
  import { RolesAnywhereServiceException as __BaseException } from "../models/RolesAnywhereServiceException";
6
6
  export var serializeAws_restJson1CreateProfileCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
@@ -54,7 +54,7 @@ export var serializeAws_restJson1CreateTrustAnchorCommand = function (input, con
54
54
  });
55
55
  }); };
56
56
  export var serializeAws_restJson1DeleteCrlCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
57
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
57
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
58
58
  return __generator(this, function (_c) {
59
59
  switch (_c.label) {
60
60
  case 0: return [4, context.endpoint()];
@@ -62,16 +62,7 @@ export var serializeAws_restJson1DeleteCrlCommand = function (input, context) {
62
62
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
63
63
  headers = {};
64
64
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/crl/{crlId}";
65
- if (input.crlId !== undefined) {
66
- labelValue = input.crlId;
67
- if (labelValue.length <= 0) {
68
- throw new Error("Empty value provided for input HTTP label: crlId.");
69
- }
70
- resolvedPath = resolvedPath.replace("{crlId}", __extendedEncodeURIComponent(labelValue));
71
- }
72
- else {
73
- throw new Error("No value provided for input HTTP label: crlId.");
74
- }
65
+ resolvedPath = __resolvedPath(resolvedPath, input, "crlId", function () { return input.crlId; }, "{crlId}", false);
75
66
  return [2, new __HttpRequest({
76
67
  protocol: protocol,
77
68
  hostname: hostname,
@@ -85,7 +76,7 @@ export var serializeAws_restJson1DeleteCrlCommand = function (input, context) {
85
76
  });
86
77
  }); };
87
78
  export var serializeAws_restJson1DeleteProfileCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
88
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
79
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
89
80
  return __generator(this, function (_c) {
90
81
  switch (_c.label) {
91
82
  case 0: return [4, context.endpoint()];
@@ -93,16 +84,7 @@ export var serializeAws_restJson1DeleteProfileCommand = function (input, context
93
84
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
94
85
  headers = {};
95
86
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/profile/{profileId}";
96
- if (input.profileId !== undefined) {
97
- labelValue = input.profileId;
98
- if (labelValue.length <= 0) {
99
- throw new Error("Empty value provided for input HTTP label: profileId.");
100
- }
101
- resolvedPath = resolvedPath.replace("{profileId}", __extendedEncodeURIComponent(labelValue));
102
- }
103
- else {
104
- throw new Error("No value provided for input HTTP label: profileId.");
105
- }
87
+ resolvedPath = __resolvedPath(resolvedPath, input, "profileId", function () { return input.profileId; }, "{profileId}", false);
106
88
  return [2, new __HttpRequest({
107
89
  protocol: protocol,
108
90
  hostname: hostname,
@@ -116,7 +98,7 @@ export var serializeAws_restJson1DeleteProfileCommand = function (input, context
116
98
  });
117
99
  }); };
118
100
  export var serializeAws_restJson1DeleteTrustAnchorCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
119
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
101
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
120
102
  return __generator(this, function (_c) {
121
103
  switch (_c.label) {
122
104
  case 0: return [4, context.endpoint()];
@@ -124,16 +106,7 @@ export var serializeAws_restJson1DeleteTrustAnchorCommand = function (input, con
124
106
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
125
107
  headers = {};
126
108
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/trustanchor/{trustAnchorId}";
127
- if (input.trustAnchorId !== undefined) {
128
- labelValue = input.trustAnchorId;
129
- if (labelValue.length <= 0) {
130
- throw new Error("Empty value provided for input HTTP label: trustAnchorId.");
131
- }
132
- resolvedPath = resolvedPath.replace("{trustAnchorId}", __extendedEncodeURIComponent(labelValue));
133
- }
134
- else {
135
- throw new Error("No value provided for input HTTP label: trustAnchorId.");
136
- }
109
+ resolvedPath = __resolvedPath(resolvedPath, input, "trustAnchorId", function () { return input.trustAnchorId; }, "{trustAnchorId}", false);
137
110
  return [2, new __HttpRequest({
138
111
  protocol: protocol,
139
112
  hostname: hostname,
@@ -147,7 +120,7 @@ export var serializeAws_restJson1DeleteTrustAnchorCommand = function (input, con
147
120
  });
148
121
  }); };
149
122
  export var serializeAws_restJson1DisableCrlCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
150
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
123
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
151
124
  return __generator(this, function (_c) {
152
125
  switch (_c.label) {
153
126
  case 0: return [4, context.endpoint()];
@@ -155,16 +128,7 @@ export var serializeAws_restJson1DisableCrlCommand = function (input, context) {
155
128
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
156
129
  headers = {};
157
130
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/crl/{crlId}/disable";
158
- if (input.crlId !== undefined) {
159
- labelValue = input.crlId;
160
- if (labelValue.length <= 0) {
161
- throw new Error("Empty value provided for input HTTP label: crlId.");
162
- }
163
- resolvedPath = resolvedPath.replace("{crlId}", __extendedEncodeURIComponent(labelValue));
164
- }
165
- else {
166
- throw new Error("No value provided for input HTTP label: crlId.");
167
- }
131
+ resolvedPath = __resolvedPath(resolvedPath, input, "crlId", function () { return input.crlId; }, "{crlId}", false);
168
132
  return [2, new __HttpRequest({
169
133
  protocol: protocol,
170
134
  hostname: hostname,
@@ -178,7 +142,7 @@ export var serializeAws_restJson1DisableCrlCommand = function (input, context) {
178
142
  });
179
143
  }); };
180
144
  export var serializeAws_restJson1DisableProfileCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
181
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
145
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
182
146
  return __generator(this, function (_c) {
183
147
  switch (_c.label) {
184
148
  case 0: return [4, context.endpoint()];
@@ -186,16 +150,7 @@ export var serializeAws_restJson1DisableProfileCommand = function (input, contex
186
150
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
187
151
  headers = {};
188
152
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/profile/{profileId}/disable";
189
- if (input.profileId !== undefined) {
190
- labelValue = input.profileId;
191
- if (labelValue.length <= 0) {
192
- throw new Error("Empty value provided for input HTTP label: profileId.");
193
- }
194
- resolvedPath = resolvedPath.replace("{profileId}", __extendedEncodeURIComponent(labelValue));
195
- }
196
- else {
197
- throw new Error("No value provided for input HTTP label: profileId.");
198
- }
153
+ resolvedPath = __resolvedPath(resolvedPath, input, "profileId", function () { return input.profileId; }, "{profileId}", false);
199
154
  return [2, new __HttpRequest({
200
155
  protocol: protocol,
201
156
  hostname: hostname,
@@ -209,7 +164,7 @@ export var serializeAws_restJson1DisableProfileCommand = function (input, contex
209
164
  });
210
165
  }); };
211
166
  export var serializeAws_restJson1DisableTrustAnchorCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
212
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
167
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
213
168
  return __generator(this, function (_c) {
214
169
  switch (_c.label) {
215
170
  case 0: return [4, context.endpoint()];
@@ -217,16 +172,7 @@ export var serializeAws_restJson1DisableTrustAnchorCommand = function (input, co
217
172
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
218
173
  headers = {};
219
174
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/trustanchor/{trustAnchorId}/disable";
220
- if (input.trustAnchorId !== undefined) {
221
- labelValue = input.trustAnchorId;
222
- if (labelValue.length <= 0) {
223
- throw new Error("Empty value provided for input HTTP label: trustAnchorId.");
224
- }
225
- resolvedPath = resolvedPath.replace("{trustAnchorId}", __extendedEncodeURIComponent(labelValue));
226
- }
227
- else {
228
- throw new Error("No value provided for input HTTP label: trustAnchorId.");
229
- }
175
+ resolvedPath = __resolvedPath(resolvedPath, input, "trustAnchorId", function () { return input.trustAnchorId; }, "{trustAnchorId}", false);
230
176
  return [2, new __HttpRequest({
231
177
  protocol: protocol,
232
178
  hostname: hostname,
@@ -240,7 +186,7 @@ export var serializeAws_restJson1DisableTrustAnchorCommand = function (input, co
240
186
  });
241
187
  }); };
242
188
  export var serializeAws_restJson1EnableCrlCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
243
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
189
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
244
190
  return __generator(this, function (_c) {
245
191
  switch (_c.label) {
246
192
  case 0: return [4, context.endpoint()];
@@ -248,16 +194,7 @@ export var serializeAws_restJson1EnableCrlCommand = function (input, context) {
248
194
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
249
195
  headers = {};
250
196
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/crl/{crlId}/enable";
251
- if (input.crlId !== undefined) {
252
- labelValue = input.crlId;
253
- if (labelValue.length <= 0) {
254
- throw new Error("Empty value provided for input HTTP label: crlId.");
255
- }
256
- resolvedPath = resolvedPath.replace("{crlId}", __extendedEncodeURIComponent(labelValue));
257
- }
258
- else {
259
- throw new Error("No value provided for input HTTP label: crlId.");
260
- }
197
+ resolvedPath = __resolvedPath(resolvedPath, input, "crlId", function () { return input.crlId; }, "{crlId}", false);
261
198
  return [2, new __HttpRequest({
262
199
  protocol: protocol,
263
200
  hostname: hostname,
@@ -271,7 +208,7 @@ export var serializeAws_restJson1EnableCrlCommand = function (input, context) {
271
208
  });
272
209
  }); };
273
210
  export var serializeAws_restJson1EnableProfileCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
274
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
211
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
275
212
  return __generator(this, function (_c) {
276
213
  switch (_c.label) {
277
214
  case 0: return [4, context.endpoint()];
@@ -279,16 +216,7 @@ export var serializeAws_restJson1EnableProfileCommand = function (input, context
279
216
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
280
217
  headers = {};
281
218
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/profile/{profileId}/enable";
282
- if (input.profileId !== undefined) {
283
- labelValue = input.profileId;
284
- if (labelValue.length <= 0) {
285
- throw new Error("Empty value provided for input HTTP label: profileId.");
286
- }
287
- resolvedPath = resolvedPath.replace("{profileId}", __extendedEncodeURIComponent(labelValue));
288
- }
289
- else {
290
- throw new Error("No value provided for input HTTP label: profileId.");
291
- }
219
+ resolvedPath = __resolvedPath(resolvedPath, input, "profileId", function () { return input.profileId; }, "{profileId}", false);
292
220
  return [2, new __HttpRequest({
293
221
  protocol: protocol,
294
222
  hostname: hostname,
@@ -302,7 +230,7 @@ export var serializeAws_restJson1EnableProfileCommand = function (input, context
302
230
  });
303
231
  }); };
304
232
  export var serializeAws_restJson1EnableTrustAnchorCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
305
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
233
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
306
234
  return __generator(this, function (_c) {
307
235
  switch (_c.label) {
308
236
  case 0: return [4, context.endpoint()];
@@ -310,16 +238,7 @@ export var serializeAws_restJson1EnableTrustAnchorCommand = function (input, con
310
238
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
311
239
  headers = {};
312
240
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/trustanchor/{trustAnchorId}/enable";
313
- if (input.trustAnchorId !== undefined) {
314
- labelValue = input.trustAnchorId;
315
- if (labelValue.length <= 0) {
316
- throw new Error("Empty value provided for input HTTP label: trustAnchorId.");
317
- }
318
- resolvedPath = resolvedPath.replace("{trustAnchorId}", __extendedEncodeURIComponent(labelValue));
319
- }
320
- else {
321
- throw new Error("No value provided for input HTTP label: trustAnchorId.");
322
- }
241
+ resolvedPath = __resolvedPath(resolvedPath, input, "trustAnchorId", function () { return input.trustAnchorId; }, "{trustAnchorId}", false);
323
242
  return [2, new __HttpRequest({
324
243
  protocol: protocol,
325
244
  hostname: hostname,
@@ -333,7 +252,7 @@ export var serializeAws_restJson1EnableTrustAnchorCommand = function (input, con
333
252
  });
334
253
  }); };
335
254
  export var serializeAws_restJson1GetCrlCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
336
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
255
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
337
256
  return __generator(this, function (_c) {
338
257
  switch (_c.label) {
339
258
  case 0: return [4, context.endpoint()];
@@ -341,16 +260,7 @@ export var serializeAws_restJson1GetCrlCommand = function (input, context) { ret
341
260
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
342
261
  headers = {};
343
262
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/crl/{crlId}";
344
- if (input.crlId !== undefined) {
345
- labelValue = input.crlId;
346
- if (labelValue.length <= 0) {
347
- throw new Error("Empty value provided for input HTTP label: crlId.");
348
- }
349
- resolvedPath = resolvedPath.replace("{crlId}", __extendedEncodeURIComponent(labelValue));
350
- }
351
- else {
352
- throw new Error("No value provided for input HTTP label: crlId.");
353
- }
263
+ resolvedPath = __resolvedPath(resolvedPath, input, "crlId", function () { return input.crlId; }, "{crlId}", false);
354
264
  return [2, new __HttpRequest({
355
265
  protocol: protocol,
356
266
  hostname: hostname,
@@ -364,7 +274,7 @@ export var serializeAws_restJson1GetCrlCommand = function (input, context) { ret
364
274
  });
365
275
  }); };
366
276
  export var serializeAws_restJson1GetProfileCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
367
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
277
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
368
278
  return __generator(this, function (_c) {
369
279
  switch (_c.label) {
370
280
  case 0: return [4, context.endpoint()];
@@ -372,16 +282,7 @@ export var serializeAws_restJson1GetProfileCommand = function (input, context) {
372
282
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
373
283
  headers = {};
374
284
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/profile/{profileId}";
375
- if (input.profileId !== undefined) {
376
- labelValue = input.profileId;
377
- if (labelValue.length <= 0) {
378
- throw new Error("Empty value provided for input HTTP label: profileId.");
379
- }
380
- resolvedPath = resolvedPath.replace("{profileId}", __extendedEncodeURIComponent(labelValue));
381
- }
382
- else {
383
- throw new Error("No value provided for input HTTP label: profileId.");
384
- }
285
+ resolvedPath = __resolvedPath(resolvedPath, input, "profileId", function () { return input.profileId; }, "{profileId}", false);
385
286
  return [2, new __HttpRequest({
386
287
  protocol: protocol,
387
288
  hostname: hostname,
@@ -395,7 +296,7 @@ export var serializeAws_restJson1GetProfileCommand = function (input, context) {
395
296
  });
396
297
  }); };
397
298
  export var serializeAws_restJson1GetSubjectCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
398
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
299
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
399
300
  return __generator(this, function (_c) {
400
301
  switch (_c.label) {
401
302
  case 0: return [4, context.endpoint()];
@@ -403,16 +304,7 @@ export var serializeAws_restJson1GetSubjectCommand = function (input, context) {
403
304
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
404
305
  headers = {};
405
306
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/subject/{subjectId}";
406
- if (input.subjectId !== undefined) {
407
- labelValue = input.subjectId;
408
- if (labelValue.length <= 0) {
409
- throw new Error("Empty value provided for input HTTP label: subjectId.");
410
- }
411
- resolvedPath = resolvedPath.replace("{subjectId}", __extendedEncodeURIComponent(labelValue));
412
- }
413
- else {
414
- throw new Error("No value provided for input HTTP label: subjectId.");
415
- }
307
+ resolvedPath = __resolvedPath(resolvedPath, input, "subjectId", function () { return input.subjectId; }, "{subjectId}", false);
416
308
  return [2, new __HttpRequest({
417
309
  protocol: protocol,
418
310
  hostname: hostname,
@@ -426,7 +318,7 @@ export var serializeAws_restJson1GetSubjectCommand = function (input, context) {
426
318
  });
427
319
  }); };
428
320
  export var serializeAws_restJson1GetTrustAnchorCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
429
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
321
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
430
322
  return __generator(this, function (_c) {
431
323
  switch (_c.label) {
432
324
  case 0: return [4, context.endpoint()];
@@ -434,16 +326,7 @@ export var serializeAws_restJson1GetTrustAnchorCommand = function (input, contex
434
326
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
435
327
  headers = {};
436
328
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/trustanchor/{trustAnchorId}";
437
- if (input.trustAnchorId !== undefined) {
438
- labelValue = input.trustAnchorId;
439
- if (labelValue.length <= 0) {
440
- throw new Error("Empty value provided for input HTTP label: trustAnchorId.");
441
- }
442
- resolvedPath = resolvedPath.replace("{trustAnchorId}", __extendedEncodeURIComponent(labelValue));
443
- }
444
- else {
445
- throw new Error("No value provided for input HTTP label: trustAnchorId.");
446
- }
329
+ resolvedPath = __resolvedPath(resolvedPath, input, "trustAnchorId", function () { return input.trustAnchorId; }, "{trustAnchorId}", false);
447
330
  return [2, new __HttpRequest({
448
331
  protocol: protocol,
449
332
  hostname: hostname,
@@ -489,7 +372,10 @@ export var serializeAws_restJson1ListCrlsCommand = function (input, context) { r
489
372
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
490
373
  headers = {};
491
374
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/crls";
492
- query = __assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.pageSize !== undefined && { pageSize: input.pageSize.toString() }));
375
+ query = map({
376
+ nextToken: [, input.nextToken],
377
+ pageSize: [function () { return input.pageSize !== void 0; }, function () { return input.pageSize.toString(); }],
378
+ });
493
379
  return [2, new __HttpRequest({
494
380
  protocol: protocol,
495
381
  hostname: hostname,
@@ -512,7 +398,10 @@ export var serializeAws_restJson1ListProfilesCommand = function (input, context)
512
398
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
513
399
  headers = {};
514
400
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/profiles";
515
- query = __assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.pageSize !== undefined && { pageSize: input.pageSize.toString() }));
401
+ query = map({
402
+ nextToken: [, input.nextToken],
403
+ pageSize: [function () { return input.pageSize !== void 0; }, function () { return input.pageSize.toString(); }],
404
+ });
516
405
  return [2, new __HttpRequest({
517
406
  protocol: protocol,
518
407
  hostname: hostname,
@@ -535,7 +424,10 @@ export var serializeAws_restJson1ListSubjectsCommand = function (input, context)
535
424
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
536
425
  headers = {};
537
426
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/subjects";
538
- query = __assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.pageSize !== undefined && { pageSize: input.pageSize.toString() }));
427
+ query = map({
428
+ nextToken: [, input.nextToken],
429
+ pageSize: [function () { return input.pageSize !== void 0; }, function () { return input.pageSize.toString(); }],
430
+ });
539
431
  return [2, new __HttpRequest({
540
432
  protocol: protocol,
541
433
  hostname: hostname,
@@ -558,7 +450,9 @@ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, c
558
450
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
559
451
  headers = {};
560
452
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/ListTagsForResource";
561
- query = __assign({}, (input.resourceArn !== undefined && { resourceArn: input.resourceArn }));
453
+ query = map({
454
+ resourceArn: [, input.resourceArn],
455
+ });
562
456
  return [2, new __HttpRequest({
563
457
  protocol: protocol,
564
458
  hostname: hostname,
@@ -581,7 +475,10 @@ export var serializeAws_restJson1ListTrustAnchorsCommand = function (input, cont
581
475
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
582
476
  headers = {};
583
477
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/trustanchors";
584
- query = __assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.pageSize !== undefined && { pageSize: input.pageSize.toString() }));
478
+ query = map({
479
+ nextToken: [, input.nextToken],
480
+ pageSize: [function () { return input.pageSize !== void 0; }, function () { return input.pageSize.toString(); }],
481
+ });
585
482
  return [2, new __HttpRequest({
586
483
  protocol: protocol,
587
484
  hostname: hostname,
@@ -644,7 +541,7 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
644
541
  });
645
542
  }); };
646
543
  export var serializeAws_restJson1UpdateCrlCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
647
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
544
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
648
545
  return __generator(this, function (_c) {
649
546
  switch (_c.label) {
650
547
  case 0: return [4, context.endpoint()];
@@ -654,16 +551,7 @@ export var serializeAws_restJson1UpdateCrlCommand = function (input, context) {
654
551
  "content-type": "application/json",
655
552
  };
656
553
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/crl/{crlId}";
657
- if (input.crlId !== undefined) {
658
- labelValue = input.crlId;
659
- if (labelValue.length <= 0) {
660
- throw new Error("Empty value provided for input HTTP label: crlId.");
661
- }
662
- resolvedPath = resolvedPath.replace("{crlId}", __extendedEncodeURIComponent(labelValue));
663
- }
664
- else {
665
- throw new Error("No value provided for input HTTP label: crlId.");
666
- }
554
+ resolvedPath = __resolvedPath(resolvedPath, input, "crlId", function () { return input.crlId; }, "{crlId}", false);
667
555
  body = JSON.stringify(__assign(__assign({}, (input.crlData != null && { crlData: context.base64Encoder(input.crlData) })), (input.name != null && { name: input.name })));
668
556
  return [2, new __HttpRequest({
669
557
  protocol: protocol,
@@ -678,7 +566,7 @@ export var serializeAws_restJson1UpdateCrlCommand = function (input, context) {
678
566
  });
679
567
  }); };
680
568
  export var serializeAws_restJson1UpdateProfileCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
681
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
569
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
682
570
  return __generator(this, function (_c) {
683
571
  switch (_c.label) {
684
572
  case 0: return [4, context.endpoint()];
@@ -688,16 +576,7 @@ export var serializeAws_restJson1UpdateProfileCommand = function (input, context
688
576
  "content-type": "application/json",
689
577
  };
690
578
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/profile/{profileId}";
691
- if (input.profileId !== undefined) {
692
- labelValue = input.profileId;
693
- if (labelValue.length <= 0) {
694
- throw new Error("Empty value provided for input HTTP label: profileId.");
695
- }
696
- resolvedPath = resolvedPath.replace("{profileId}", __extendedEncodeURIComponent(labelValue));
697
- }
698
- else {
699
- throw new Error("No value provided for input HTTP label: profileId.");
700
- }
579
+ resolvedPath = __resolvedPath(resolvedPath, input, "profileId", function () { return input.profileId; }, "{profileId}", false);
701
580
  body = JSON.stringify(__assign(__assign(__assign(__assign(__assign({}, (input.durationSeconds != null && { durationSeconds: input.durationSeconds })), (input.managedPolicyArns != null && {
702
581
  managedPolicyArns: serializeAws_restJson1ManagedPolicyList(input.managedPolicyArns, context),
703
582
  })), (input.name != null && { name: input.name })), (input.roleArns != null && { roleArns: serializeAws_restJson1RoleArnList(input.roleArns, context) })), (input.sessionPolicy != null && { sessionPolicy: input.sessionPolicy })));
@@ -714,7 +593,7 @@ export var serializeAws_restJson1UpdateProfileCommand = function (input, context
714
593
  });
715
594
  }); };
716
595
  export var serializeAws_restJson1UpdateTrustAnchorCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
717
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
596
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
718
597
  return __generator(this, function (_c) {
719
598
  switch (_c.label) {
720
599
  case 0: return [4, context.endpoint()];
@@ -724,16 +603,7 @@ export var serializeAws_restJson1UpdateTrustAnchorCommand = function (input, con
724
603
  "content-type": "application/json",
725
604
  };
726
605
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/trustanchor/{trustAnchorId}";
727
- if (input.trustAnchorId !== undefined) {
728
- labelValue = input.trustAnchorId;
729
- if (labelValue.length <= 0) {
730
- throw new Error("Empty value provided for input HTTP label: trustAnchorId.");
731
- }
732
- resolvedPath = resolvedPath.replace("{trustAnchorId}", __extendedEncodeURIComponent(labelValue));
733
- }
734
- else {
735
- throw new Error("No value provided for input HTTP label: trustAnchorId.");
736
- }
606
+ resolvedPath = __resolvedPath(resolvedPath, input, "trustAnchorId", function () { return input.trustAnchorId; }, "{trustAnchorId}", false);
737
607
  body = JSON.stringify(__assign(__assign({}, (input.name != null && { name: input.name })), (input.source != null && { source: serializeAws_restJson1Source(input.source, context) })));
738
608
  return [2, new __HttpRequest({
739
609
  protocol: protocol,
@@ -755,24 +625,23 @@ export var deserializeAws_restJson1CreateProfileCommand = function (output, cont
755
625
  if (output.statusCode !== 201 && output.statusCode >= 300) {
756
626
  return [2, deserializeAws_restJson1CreateProfileCommandError(output, context)];
757
627
  }
758
- contents = {
628
+ contents = map({
759
629
  $metadata: deserializeMetadata(output),
760
- profile: undefined,
761
- };
630
+ });
762
631
  _a = __expectNonNull;
763
632
  _b = __expectObject;
764
633
  return [4, parseBody(output.body, context)];
765
634
  case 1:
766
635
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
767
- if (data.profile !== undefined && data.profile !== null) {
636
+ if (data.profile != null) {
768
637
  contents.profile = deserializeAws_restJson1ProfileDetail(data.profile, context);
769
638
  }
770
- return [2, Promise.resolve(contents)];
639
+ return [2, contents];
771
640
  }
772
641
  });
773
642
  }); };
774
643
  var deserializeAws_restJson1CreateProfileCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
775
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
644
+ var parsedOutput, _a, errorCode, _b, parsedBody;
776
645
  var _c;
777
646
  return __generator(this, function (_d) {
778
647
  switch (_d.label) {
@@ -797,14 +666,14 @@ var deserializeAws_restJson1CreateProfileCommandError = function (output, contex
797
666
  case 5: throw _d.sent();
798
667
  case 6:
799
668
  parsedBody = parsedOutput.body;
800
- $metadata = deserializeMetadata(output);
801
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
802
- response = new __BaseException({
803
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
804
- $fault: "client",
805
- $metadata: $metadata,
669
+ throwDefaultError({
670
+ output: output,
671
+ parsedBody: parsedBody,
672
+ exceptionCtor: __BaseException,
673
+ errorCode: errorCode,
806
674
  });
807
- throw __decorateServiceException(response, parsedBody);
675
+ _d.label = 7;
676
+ case 7: return [2];
808
677
  }
809
678
  });
810
679
  }); };
@@ -816,24 +685,23 @@ export var deserializeAws_restJson1CreateTrustAnchorCommand = function (output,
816
685
  if (output.statusCode !== 201 && output.statusCode >= 300) {
817
686
  return [2, deserializeAws_restJson1CreateTrustAnchorCommandError(output, context)];
818
687
  }
819
- contents = {
688
+ contents = map({
820
689
  $metadata: deserializeMetadata(output),
821
- trustAnchor: undefined,
822
- };
690
+ });
823
691
  _a = __expectNonNull;
824
692
  _b = __expectObject;
825
693
  return [4, parseBody(output.body, context)];
826
694
  case 1:
827
695
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
828
- if (data.trustAnchor !== undefined && data.trustAnchor !== null) {
696
+ if (data.trustAnchor != null) {
829
697
  contents.trustAnchor = deserializeAws_restJson1TrustAnchorDetail(data.trustAnchor, context);
830
698
  }
831
- return [2, Promise.resolve(contents)];
699
+ return [2, contents];
832
700
  }
833
701
  });
834
702
  }); };
835
703
  var deserializeAws_restJson1CreateTrustAnchorCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
836
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
704
+ var parsedOutput, _a, errorCode, _b, parsedBody;
837
705
  var _c;
838
706
  return __generator(this, function (_d) {
839
707
  switch (_d.label) {
@@ -858,14 +726,14 @@ var deserializeAws_restJson1CreateTrustAnchorCommandError = function (output, co
858
726
  case 5: throw _d.sent();
859
727
  case 6:
860
728
  parsedBody = parsedOutput.body;
861
- $metadata = deserializeMetadata(output);
862
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
863
- response = new __BaseException({
864
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
865
- $fault: "client",
866
- $metadata: $metadata,
729
+ throwDefaultError({
730
+ output: output,
731
+ parsedBody: parsedBody,
732
+ exceptionCtor: __BaseException,
733
+ errorCode: errorCode,
867
734
  });
868
- throw __decorateServiceException(response, parsedBody);
735
+ _d.label = 7;
736
+ case 7: return [2];
869
737
  }
870
738
  });
871
739
  }); };
@@ -877,24 +745,23 @@ export var deserializeAws_restJson1DeleteCrlCommand = function (output, context)
877
745
  if (output.statusCode !== 200 && output.statusCode >= 300) {
878
746
  return [2, deserializeAws_restJson1DeleteCrlCommandError(output, context)];
879
747
  }
880
- contents = {
748
+ contents = map({
881
749
  $metadata: deserializeMetadata(output),
882
- crl: undefined,
883
- };
750
+ });
884
751
  _a = __expectNonNull;
885
752
  _b = __expectObject;
886
753
  return [4, parseBody(output.body, context)];
887
754
  case 1:
888
755
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
889
- if (data.crl !== undefined && data.crl !== null) {
756
+ if (data.crl != null) {
890
757
  contents.crl = deserializeAws_restJson1CrlDetail(data.crl, context);
891
758
  }
892
- return [2, Promise.resolve(contents)];
759
+ return [2, contents];
893
760
  }
894
761
  });
895
762
  }); };
896
763
  var deserializeAws_restJson1DeleteCrlCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
897
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
764
+ var parsedOutput, _a, errorCode, _b, parsedBody;
898
765
  var _c;
899
766
  return __generator(this, function (_d) {
900
767
  switch (_d.label) {
@@ -919,14 +786,14 @@ var deserializeAws_restJson1DeleteCrlCommandError = function (output, context) {
919
786
  case 5: throw _d.sent();
920
787
  case 6:
921
788
  parsedBody = parsedOutput.body;
922
- $metadata = deserializeMetadata(output);
923
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
924
- response = new __BaseException({
925
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
926
- $fault: "client",
927
- $metadata: $metadata,
789
+ throwDefaultError({
790
+ output: output,
791
+ parsedBody: parsedBody,
792
+ exceptionCtor: __BaseException,
793
+ errorCode: errorCode,
928
794
  });
929
- throw __decorateServiceException(response, parsedBody);
795
+ _d.label = 7;
796
+ case 7: return [2];
930
797
  }
931
798
  });
932
799
  }); };
@@ -938,24 +805,23 @@ export var deserializeAws_restJson1DeleteProfileCommand = function (output, cont
938
805
  if (output.statusCode !== 200 && output.statusCode >= 300) {
939
806
  return [2, deserializeAws_restJson1DeleteProfileCommandError(output, context)];
940
807
  }
941
- contents = {
808
+ contents = map({
942
809
  $metadata: deserializeMetadata(output),
943
- profile: undefined,
944
- };
810
+ });
945
811
  _a = __expectNonNull;
946
812
  _b = __expectObject;
947
813
  return [4, parseBody(output.body, context)];
948
814
  case 1:
949
815
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
950
- if (data.profile !== undefined && data.profile !== null) {
816
+ if (data.profile != null) {
951
817
  contents.profile = deserializeAws_restJson1ProfileDetail(data.profile, context);
952
818
  }
953
- return [2, Promise.resolve(contents)];
819
+ return [2, contents];
954
820
  }
955
821
  });
956
822
  }); };
957
823
  var deserializeAws_restJson1DeleteProfileCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
958
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
824
+ var parsedOutput, _a, errorCode, _b, parsedBody;
959
825
  var _c;
960
826
  return __generator(this, function (_d) {
961
827
  switch (_d.label) {
@@ -980,14 +846,14 @@ var deserializeAws_restJson1DeleteProfileCommandError = function (output, contex
980
846
  case 5: throw _d.sent();
981
847
  case 6:
982
848
  parsedBody = parsedOutput.body;
983
- $metadata = deserializeMetadata(output);
984
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
985
- response = new __BaseException({
986
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
987
- $fault: "client",
988
- $metadata: $metadata,
849
+ throwDefaultError({
850
+ output: output,
851
+ parsedBody: parsedBody,
852
+ exceptionCtor: __BaseException,
853
+ errorCode: errorCode,
989
854
  });
990
- throw __decorateServiceException(response, parsedBody);
855
+ _d.label = 7;
856
+ case 7: return [2];
991
857
  }
992
858
  });
993
859
  }); };
@@ -999,24 +865,23 @@ export var deserializeAws_restJson1DeleteTrustAnchorCommand = function (output,
999
865
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1000
866
  return [2, deserializeAws_restJson1DeleteTrustAnchorCommandError(output, context)];
1001
867
  }
1002
- contents = {
868
+ contents = map({
1003
869
  $metadata: deserializeMetadata(output),
1004
- trustAnchor: undefined,
1005
- };
870
+ });
1006
871
  _a = __expectNonNull;
1007
872
  _b = __expectObject;
1008
873
  return [4, parseBody(output.body, context)];
1009
874
  case 1:
1010
875
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1011
- if (data.trustAnchor !== undefined && data.trustAnchor !== null) {
876
+ if (data.trustAnchor != null) {
1012
877
  contents.trustAnchor = deserializeAws_restJson1TrustAnchorDetail(data.trustAnchor, context);
1013
878
  }
1014
- return [2, Promise.resolve(contents)];
879
+ return [2, contents];
1015
880
  }
1016
881
  });
1017
882
  }); };
1018
883
  var deserializeAws_restJson1DeleteTrustAnchorCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1019
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
884
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1020
885
  var _c;
1021
886
  return __generator(this, function (_d) {
1022
887
  switch (_d.label) {
@@ -1041,14 +906,14 @@ var deserializeAws_restJson1DeleteTrustAnchorCommandError = function (output, co
1041
906
  case 5: throw _d.sent();
1042
907
  case 6:
1043
908
  parsedBody = parsedOutput.body;
1044
- $metadata = deserializeMetadata(output);
1045
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1046
- response = new __BaseException({
1047
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1048
- $fault: "client",
1049
- $metadata: $metadata,
909
+ throwDefaultError({
910
+ output: output,
911
+ parsedBody: parsedBody,
912
+ exceptionCtor: __BaseException,
913
+ errorCode: errorCode,
1050
914
  });
1051
- throw __decorateServiceException(response, parsedBody);
915
+ _d.label = 7;
916
+ case 7: return [2];
1052
917
  }
1053
918
  });
1054
919
  }); };
@@ -1060,24 +925,23 @@ export var deserializeAws_restJson1DisableCrlCommand = function (output, context
1060
925
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1061
926
  return [2, deserializeAws_restJson1DisableCrlCommandError(output, context)];
1062
927
  }
1063
- contents = {
928
+ contents = map({
1064
929
  $metadata: deserializeMetadata(output),
1065
- crl: undefined,
1066
- };
930
+ });
1067
931
  _a = __expectNonNull;
1068
932
  _b = __expectObject;
1069
933
  return [4, parseBody(output.body, context)];
1070
934
  case 1:
1071
935
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1072
- if (data.crl !== undefined && data.crl !== null) {
936
+ if (data.crl != null) {
1073
937
  contents.crl = deserializeAws_restJson1CrlDetail(data.crl, context);
1074
938
  }
1075
- return [2, Promise.resolve(contents)];
939
+ return [2, contents];
1076
940
  }
1077
941
  });
1078
942
  }); };
1079
943
  var deserializeAws_restJson1DisableCrlCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1080
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
944
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1081
945
  var _c;
1082
946
  return __generator(this, function (_d) {
1083
947
  switch (_d.label) {
@@ -1102,14 +966,14 @@ var deserializeAws_restJson1DisableCrlCommandError = function (output, context)
1102
966
  case 5: throw _d.sent();
1103
967
  case 6:
1104
968
  parsedBody = parsedOutput.body;
1105
- $metadata = deserializeMetadata(output);
1106
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1107
- response = new __BaseException({
1108
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1109
- $fault: "client",
1110
- $metadata: $metadata,
969
+ throwDefaultError({
970
+ output: output,
971
+ parsedBody: parsedBody,
972
+ exceptionCtor: __BaseException,
973
+ errorCode: errorCode,
1111
974
  });
1112
- throw __decorateServiceException(response, parsedBody);
975
+ _d.label = 7;
976
+ case 7: return [2];
1113
977
  }
1114
978
  });
1115
979
  }); };
@@ -1121,24 +985,23 @@ export var deserializeAws_restJson1DisableProfileCommand = function (output, con
1121
985
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1122
986
  return [2, deserializeAws_restJson1DisableProfileCommandError(output, context)];
1123
987
  }
1124
- contents = {
988
+ contents = map({
1125
989
  $metadata: deserializeMetadata(output),
1126
- profile: undefined,
1127
- };
990
+ });
1128
991
  _a = __expectNonNull;
1129
992
  _b = __expectObject;
1130
993
  return [4, parseBody(output.body, context)];
1131
994
  case 1:
1132
995
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1133
- if (data.profile !== undefined && data.profile !== null) {
996
+ if (data.profile != null) {
1134
997
  contents.profile = deserializeAws_restJson1ProfileDetail(data.profile, context);
1135
998
  }
1136
- return [2, Promise.resolve(contents)];
999
+ return [2, contents];
1137
1000
  }
1138
1001
  });
1139
1002
  }); };
1140
1003
  var deserializeAws_restJson1DisableProfileCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1141
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1004
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1142
1005
  var _c;
1143
1006
  return __generator(this, function (_d) {
1144
1007
  switch (_d.label) {
@@ -1163,14 +1026,14 @@ var deserializeAws_restJson1DisableProfileCommandError = function (output, conte
1163
1026
  case 5: throw _d.sent();
1164
1027
  case 6:
1165
1028
  parsedBody = parsedOutput.body;
1166
- $metadata = deserializeMetadata(output);
1167
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1168
- response = new __BaseException({
1169
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1170
- $fault: "client",
1171
- $metadata: $metadata,
1029
+ throwDefaultError({
1030
+ output: output,
1031
+ parsedBody: parsedBody,
1032
+ exceptionCtor: __BaseException,
1033
+ errorCode: errorCode,
1172
1034
  });
1173
- throw __decorateServiceException(response, parsedBody);
1035
+ _d.label = 7;
1036
+ case 7: return [2];
1174
1037
  }
1175
1038
  });
1176
1039
  }); };
@@ -1182,24 +1045,23 @@ export var deserializeAws_restJson1DisableTrustAnchorCommand = function (output,
1182
1045
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1183
1046
  return [2, deserializeAws_restJson1DisableTrustAnchorCommandError(output, context)];
1184
1047
  }
1185
- contents = {
1048
+ contents = map({
1186
1049
  $metadata: deserializeMetadata(output),
1187
- trustAnchor: undefined,
1188
- };
1050
+ });
1189
1051
  _a = __expectNonNull;
1190
1052
  _b = __expectObject;
1191
1053
  return [4, parseBody(output.body, context)];
1192
1054
  case 1:
1193
1055
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1194
- if (data.trustAnchor !== undefined && data.trustAnchor !== null) {
1056
+ if (data.trustAnchor != null) {
1195
1057
  contents.trustAnchor = deserializeAws_restJson1TrustAnchorDetail(data.trustAnchor, context);
1196
1058
  }
1197
- return [2, Promise.resolve(contents)];
1059
+ return [2, contents];
1198
1060
  }
1199
1061
  });
1200
1062
  }); };
1201
1063
  var deserializeAws_restJson1DisableTrustAnchorCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1202
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1064
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1203
1065
  var _c;
1204
1066
  return __generator(this, function (_d) {
1205
1067
  switch (_d.label) {
@@ -1224,14 +1086,14 @@ var deserializeAws_restJson1DisableTrustAnchorCommandError = function (output, c
1224
1086
  case 5: throw _d.sent();
1225
1087
  case 6:
1226
1088
  parsedBody = parsedOutput.body;
1227
- $metadata = deserializeMetadata(output);
1228
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1229
- response = new __BaseException({
1230
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1231
- $fault: "client",
1232
- $metadata: $metadata,
1089
+ throwDefaultError({
1090
+ output: output,
1091
+ parsedBody: parsedBody,
1092
+ exceptionCtor: __BaseException,
1093
+ errorCode: errorCode,
1233
1094
  });
1234
- throw __decorateServiceException(response, parsedBody);
1095
+ _d.label = 7;
1096
+ case 7: return [2];
1235
1097
  }
1236
1098
  });
1237
1099
  }); };
@@ -1243,24 +1105,23 @@ export var deserializeAws_restJson1EnableCrlCommand = function (output, context)
1243
1105
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1244
1106
  return [2, deserializeAws_restJson1EnableCrlCommandError(output, context)];
1245
1107
  }
1246
- contents = {
1108
+ contents = map({
1247
1109
  $metadata: deserializeMetadata(output),
1248
- crl: undefined,
1249
- };
1110
+ });
1250
1111
  _a = __expectNonNull;
1251
1112
  _b = __expectObject;
1252
1113
  return [4, parseBody(output.body, context)];
1253
1114
  case 1:
1254
1115
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1255
- if (data.crl !== undefined && data.crl !== null) {
1116
+ if (data.crl != null) {
1256
1117
  contents.crl = deserializeAws_restJson1CrlDetail(data.crl, context);
1257
1118
  }
1258
- return [2, Promise.resolve(contents)];
1119
+ return [2, contents];
1259
1120
  }
1260
1121
  });
1261
1122
  }); };
1262
1123
  var deserializeAws_restJson1EnableCrlCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1263
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1124
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1264
1125
  var _c;
1265
1126
  return __generator(this, function (_d) {
1266
1127
  switch (_d.label) {
@@ -1285,14 +1146,14 @@ var deserializeAws_restJson1EnableCrlCommandError = function (output, context) {
1285
1146
  case 5: throw _d.sent();
1286
1147
  case 6:
1287
1148
  parsedBody = parsedOutput.body;
1288
- $metadata = deserializeMetadata(output);
1289
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1290
- response = new __BaseException({
1291
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1292
- $fault: "client",
1293
- $metadata: $metadata,
1149
+ throwDefaultError({
1150
+ output: output,
1151
+ parsedBody: parsedBody,
1152
+ exceptionCtor: __BaseException,
1153
+ errorCode: errorCode,
1294
1154
  });
1295
- throw __decorateServiceException(response, parsedBody);
1155
+ _d.label = 7;
1156
+ case 7: return [2];
1296
1157
  }
1297
1158
  });
1298
1159
  }); };
@@ -1304,24 +1165,23 @@ export var deserializeAws_restJson1EnableProfileCommand = function (output, cont
1304
1165
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1305
1166
  return [2, deserializeAws_restJson1EnableProfileCommandError(output, context)];
1306
1167
  }
1307
- contents = {
1168
+ contents = map({
1308
1169
  $metadata: deserializeMetadata(output),
1309
- profile: undefined,
1310
- };
1170
+ });
1311
1171
  _a = __expectNonNull;
1312
1172
  _b = __expectObject;
1313
1173
  return [4, parseBody(output.body, context)];
1314
1174
  case 1:
1315
1175
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1316
- if (data.profile !== undefined && data.profile !== null) {
1176
+ if (data.profile != null) {
1317
1177
  contents.profile = deserializeAws_restJson1ProfileDetail(data.profile, context);
1318
1178
  }
1319
- return [2, Promise.resolve(contents)];
1179
+ return [2, contents];
1320
1180
  }
1321
1181
  });
1322
1182
  }); };
1323
1183
  var deserializeAws_restJson1EnableProfileCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1324
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1184
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1325
1185
  var _c;
1326
1186
  return __generator(this, function (_d) {
1327
1187
  switch (_d.label) {
@@ -1346,14 +1206,14 @@ var deserializeAws_restJson1EnableProfileCommandError = function (output, contex
1346
1206
  case 5: throw _d.sent();
1347
1207
  case 6:
1348
1208
  parsedBody = parsedOutput.body;
1349
- $metadata = deserializeMetadata(output);
1350
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1351
- response = new __BaseException({
1352
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1353
- $fault: "client",
1354
- $metadata: $metadata,
1209
+ throwDefaultError({
1210
+ output: output,
1211
+ parsedBody: parsedBody,
1212
+ exceptionCtor: __BaseException,
1213
+ errorCode: errorCode,
1355
1214
  });
1356
- throw __decorateServiceException(response, parsedBody);
1215
+ _d.label = 7;
1216
+ case 7: return [2];
1357
1217
  }
1358
1218
  });
1359
1219
  }); };
@@ -1365,24 +1225,23 @@ export var deserializeAws_restJson1EnableTrustAnchorCommand = function (output,
1365
1225
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1366
1226
  return [2, deserializeAws_restJson1EnableTrustAnchorCommandError(output, context)];
1367
1227
  }
1368
- contents = {
1228
+ contents = map({
1369
1229
  $metadata: deserializeMetadata(output),
1370
- trustAnchor: undefined,
1371
- };
1230
+ });
1372
1231
  _a = __expectNonNull;
1373
1232
  _b = __expectObject;
1374
1233
  return [4, parseBody(output.body, context)];
1375
1234
  case 1:
1376
1235
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1377
- if (data.trustAnchor !== undefined && data.trustAnchor !== null) {
1236
+ if (data.trustAnchor != null) {
1378
1237
  contents.trustAnchor = deserializeAws_restJson1TrustAnchorDetail(data.trustAnchor, context);
1379
1238
  }
1380
- return [2, Promise.resolve(contents)];
1239
+ return [2, contents];
1381
1240
  }
1382
1241
  });
1383
1242
  }); };
1384
1243
  var deserializeAws_restJson1EnableTrustAnchorCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1385
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1244
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1386
1245
  var _c;
1387
1246
  return __generator(this, function (_d) {
1388
1247
  switch (_d.label) {
@@ -1407,14 +1266,14 @@ var deserializeAws_restJson1EnableTrustAnchorCommandError = function (output, co
1407
1266
  case 5: throw _d.sent();
1408
1267
  case 6:
1409
1268
  parsedBody = parsedOutput.body;
1410
- $metadata = deserializeMetadata(output);
1411
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1412
- response = new __BaseException({
1413
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1414
- $fault: "client",
1415
- $metadata: $metadata,
1269
+ throwDefaultError({
1270
+ output: output,
1271
+ parsedBody: parsedBody,
1272
+ exceptionCtor: __BaseException,
1273
+ errorCode: errorCode,
1416
1274
  });
1417
- throw __decorateServiceException(response, parsedBody);
1275
+ _d.label = 7;
1276
+ case 7: return [2];
1418
1277
  }
1419
1278
  });
1420
1279
  }); };
@@ -1426,24 +1285,23 @@ export var deserializeAws_restJson1GetCrlCommand = function (output, context) {
1426
1285
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1427
1286
  return [2, deserializeAws_restJson1GetCrlCommandError(output, context)];
1428
1287
  }
1429
- contents = {
1288
+ contents = map({
1430
1289
  $metadata: deserializeMetadata(output),
1431
- crl: undefined,
1432
- };
1290
+ });
1433
1291
  _a = __expectNonNull;
1434
1292
  _b = __expectObject;
1435
1293
  return [4, parseBody(output.body, context)];
1436
1294
  case 1:
1437
1295
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1438
- if (data.crl !== undefined && data.crl !== null) {
1296
+ if (data.crl != null) {
1439
1297
  contents.crl = deserializeAws_restJson1CrlDetail(data.crl, context);
1440
1298
  }
1441
- return [2, Promise.resolve(contents)];
1299
+ return [2, contents];
1442
1300
  }
1443
1301
  });
1444
1302
  }); };
1445
1303
  var deserializeAws_restJson1GetCrlCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1446
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1304
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1447
1305
  var _c;
1448
1306
  return __generator(this, function (_d) {
1449
1307
  switch (_d.label) {
@@ -1464,14 +1322,14 @@ var deserializeAws_restJson1GetCrlCommandError = function (output, context) { re
1464
1322
  case 3: throw _d.sent();
1465
1323
  case 4:
1466
1324
  parsedBody = parsedOutput.body;
1467
- $metadata = deserializeMetadata(output);
1468
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1469
- response = new __BaseException({
1470
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1471
- $fault: "client",
1472
- $metadata: $metadata,
1325
+ throwDefaultError({
1326
+ output: output,
1327
+ parsedBody: parsedBody,
1328
+ exceptionCtor: __BaseException,
1329
+ errorCode: errorCode,
1473
1330
  });
1474
- throw __decorateServiceException(response, parsedBody);
1331
+ _d.label = 5;
1332
+ case 5: return [2];
1475
1333
  }
1476
1334
  });
1477
1335
  }); };
@@ -1483,24 +1341,23 @@ export var deserializeAws_restJson1GetProfileCommand = function (output, context
1483
1341
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1484
1342
  return [2, deserializeAws_restJson1GetProfileCommandError(output, context)];
1485
1343
  }
1486
- contents = {
1344
+ contents = map({
1487
1345
  $metadata: deserializeMetadata(output),
1488
- profile: undefined,
1489
- };
1346
+ });
1490
1347
  _a = __expectNonNull;
1491
1348
  _b = __expectObject;
1492
1349
  return [4, parseBody(output.body, context)];
1493
1350
  case 1:
1494
1351
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1495
- if (data.profile !== undefined && data.profile !== null) {
1352
+ if (data.profile != null) {
1496
1353
  contents.profile = deserializeAws_restJson1ProfileDetail(data.profile, context);
1497
1354
  }
1498
- return [2, Promise.resolve(contents)];
1355
+ return [2, contents];
1499
1356
  }
1500
1357
  });
1501
1358
  }); };
1502
1359
  var deserializeAws_restJson1GetProfileCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1503
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1360
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1504
1361
  var _c;
1505
1362
  return __generator(this, function (_d) {
1506
1363
  switch (_d.label) {
@@ -1525,14 +1382,14 @@ var deserializeAws_restJson1GetProfileCommandError = function (output, context)
1525
1382
  case 5: throw _d.sent();
1526
1383
  case 6:
1527
1384
  parsedBody = parsedOutput.body;
1528
- $metadata = deserializeMetadata(output);
1529
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1530
- response = new __BaseException({
1531
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1532
- $fault: "client",
1533
- $metadata: $metadata,
1385
+ throwDefaultError({
1386
+ output: output,
1387
+ parsedBody: parsedBody,
1388
+ exceptionCtor: __BaseException,
1389
+ errorCode: errorCode,
1534
1390
  });
1535
- throw __decorateServiceException(response, parsedBody);
1391
+ _d.label = 7;
1392
+ case 7: return [2];
1536
1393
  }
1537
1394
  });
1538
1395
  }); };
@@ -1544,24 +1401,23 @@ export var deserializeAws_restJson1GetSubjectCommand = function (output, context
1544
1401
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1545
1402
  return [2, deserializeAws_restJson1GetSubjectCommandError(output, context)];
1546
1403
  }
1547
- contents = {
1404
+ contents = map({
1548
1405
  $metadata: deserializeMetadata(output),
1549
- subject: undefined,
1550
- };
1406
+ });
1551
1407
  _a = __expectNonNull;
1552
1408
  _b = __expectObject;
1553
1409
  return [4, parseBody(output.body, context)];
1554
1410
  case 1:
1555
1411
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1556
- if (data.subject !== undefined && data.subject !== null) {
1412
+ if (data.subject != null) {
1557
1413
  contents.subject = deserializeAws_restJson1SubjectDetail(data.subject, context);
1558
1414
  }
1559
- return [2, Promise.resolve(contents)];
1415
+ return [2, contents];
1560
1416
  }
1561
1417
  });
1562
1418
  }); };
1563
1419
  var deserializeAws_restJson1GetSubjectCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1564
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1420
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1565
1421
  var _c;
1566
1422
  return __generator(this, function (_d) {
1567
1423
  switch (_d.label) {
@@ -1586,14 +1442,14 @@ var deserializeAws_restJson1GetSubjectCommandError = function (output, context)
1586
1442
  case 5: throw _d.sent();
1587
1443
  case 6:
1588
1444
  parsedBody = parsedOutput.body;
1589
- $metadata = deserializeMetadata(output);
1590
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1591
- response = new __BaseException({
1592
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1593
- $fault: "client",
1594
- $metadata: $metadata,
1445
+ throwDefaultError({
1446
+ output: output,
1447
+ parsedBody: parsedBody,
1448
+ exceptionCtor: __BaseException,
1449
+ errorCode: errorCode,
1595
1450
  });
1596
- throw __decorateServiceException(response, parsedBody);
1451
+ _d.label = 7;
1452
+ case 7: return [2];
1597
1453
  }
1598
1454
  });
1599
1455
  }); };
@@ -1605,24 +1461,23 @@ export var deserializeAws_restJson1GetTrustAnchorCommand = function (output, con
1605
1461
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1606
1462
  return [2, deserializeAws_restJson1GetTrustAnchorCommandError(output, context)];
1607
1463
  }
1608
- contents = {
1464
+ contents = map({
1609
1465
  $metadata: deserializeMetadata(output),
1610
- trustAnchor: undefined,
1611
- };
1466
+ });
1612
1467
  _a = __expectNonNull;
1613
1468
  _b = __expectObject;
1614
1469
  return [4, parseBody(output.body, context)];
1615
1470
  case 1:
1616
1471
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1617
- if (data.trustAnchor !== undefined && data.trustAnchor !== null) {
1472
+ if (data.trustAnchor != null) {
1618
1473
  contents.trustAnchor = deserializeAws_restJson1TrustAnchorDetail(data.trustAnchor, context);
1619
1474
  }
1620
- return [2, Promise.resolve(contents)];
1475
+ return [2, contents];
1621
1476
  }
1622
1477
  });
1623
1478
  }); };
1624
1479
  var deserializeAws_restJson1GetTrustAnchorCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1625
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1480
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1626
1481
  var _c;
1627
1482
  return __generator(this, function (_d) {
1628
1483
  switch (_d.label) {
@@ -1651,14 +1506,14 @@ var deserializeAws_restJson1GetTrustAnchorCommandError = function (output, conte
1651
1506
  case 7: throw _d.sent();
1652
1507
  case 8:
1653
1508
  parsedBody = parsedOutput.body;
1654
- $metadata = deserializeMetadata(output);
1655
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1656
- response = new __BaseException({
1657
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1658
- $fault: "client",
1659
- $metadata: $metadata,
1509
+ throwDefaultError({
1510
+ output: output,
1511
+ parsedBody: parsedBody,
1512
+ exceptionCtor: __BaseException,
1513
+ errorCode: errorCode,
1660
1514
  });
1661
- throw __decorateServiceException(response, parsedBody);
1515
+ _d.label = 9;
1516
+ case 9: return [2];
1662
1517
  }
1663
1518
  });
1664
1519
  }); };
@@ -1670,24 +1525,23 @@ export var deserializeAws_restJson1ImportCrlCommand = function (output, context)
1670
1525
  if (output.statusCode !== 201 && output.statusCode >= 300) {
1671
1526
  return [2, deserializeAws_restJson1ImportCrlCommandError(output, context)];
1672
1527
  }
1673
- contents = {
1528
+ contents = map({
1674
1529
  $metadata: deserializeMetadata(output),
1675
- crl: undefined,
1676
- };
1530
+ });
1677
1531
  _a = __expectNonNull;
1678
1532
  _b = __expectObject;
1679
1533
  return [4, parseBody(output.body, context)];
1680
1534
  case 1:
1681
1535
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1682
- if (data.crl !== undefined && data.crl !== null) {
1536
+ if (data.crl != null) {
1683
1537
  contents.crl = deserializeAws_restJson1CrlDetail(data.crl, context);
1684
1538
  }
1685
- return [2, Promise.resolve(contents)];
1539
+ return [2, contents];
1686
1540
  }
1687
1541
  });
1688
1542
  }); };
1689
1543
  var deserializeAws_restJson1ImportCrlCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1690
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1544
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1691
1545
  var _c;
1692
1546
  return __generator(this, function (_d) {
1693
1547
  switch (_d.label) {
@@ -1712,14 +1566,14 @@ var deserializeAws_restJson1ImportCrlCommandError = function (output, context) {
1712
1566
  case 5: throw _d.sent();
1713
1567
  case 6:
1714
1568
  parsedBody = parsedOutput.body;
1715
- $metadata = deserializeMetadata(output);
1716
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1717
- response = new __BaseException({
1718
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1719
- $fault: "client",
1720
- $metadata: $metadata,
1569
+ throwDefaultError({
1570
+ output: output,
1571
+ parsedBody: parsedBody,
1572
+ exceptionCtor: __BaseException,
1573
+ errorCode: errorCode,
1721
1574
  });
1722
- throw __decorateServiceException(response, parsedBody);
1575
+ _d.label = 7;
1576
+ case 7: return [2];
1723
1577
  }
1724
1578
  });
1725
1579
  }); };
@@ -1731,28 +1585,26 @@ export var deserializeAws_restJson1ListCrlsCommand = function (output, context)
1731
1585
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1732
1586
  return [2, deserializeAws_restJson1ListCrlsCommandError(output, context)];
1733
1587
  }
1734
- contents = {
1588
+ contents = map({
1735
1589
  $metadata: deserializeMetadata(output),
1736
- crls: undefined,
1737
- nextToken: undefined,
1738
- };
1590
+ });
1739
1591
  _a = __expectNonNull;
1740
1592
  _b = __expectObject;
1741
1593
  return [4, parseBody(output.body, context)];
1742
1594
  case 1:
1743
1595
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1744
- if (data.crls !== undefined && data.crls !== null) {
1596
+ if (data.crls != null) {
1745
1597
  contents.crls = deserializeAws_restJson1CrlDetails(data.crls, context);
1746
1598
  }
1747
- if (data.nextToken !== undefined && data.nextToken !== null) {
1599
+ if (data.nextToken != null) {
1748
1600
  contents.nextToken = __expectString(data.nextToken);
1749
1601
  }
1750
- return [2, Promise.resolve(contents)];
1602
+ return [2, contents];
1751
1603
  }
1752
1604
  });
1753
1605
  }); };
1754
1606
  var deserializeAws_restJson1ListCrlsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1755
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1607
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1756
1608
  var _c;
1757
1609
  return __generator(this, function (_d) {
1758
1610
  switch (_d.label) {
@@ -1777,14 +1629,14 @@ var deserializeAws_restJson1ListCrlsCommandError = function (output, context) {
1777
1629
  case 5: throw _d.sent();
1778
1630
  case 6:
1779
1631
  parsedBody = parsedOutput.body;
1780
- $metadata = deserializeMetadata(output);
1781
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1782
- response = new __BaseException({
1783
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1784
- $fault: "client",
1785
- $metadata: $metadata,
1632
+ throwDefaultError({
1633
+ output: output,
1634
+ parsedBody: parsedBody,
1635
+ exceptionCtor: __BaseException,
1636
+ errorCode: errorCode,
1786
1637
  });
1787
- throw __decorateServiceException(response, parsedBody);
1638
+ _d.label = 7;
1639
+ case 7: return [2];
1788
1640
  }
1789
1641
  });
1790
1642
  }); };
@@ -1796,28 +1648,26 @@ export var deserializeAws_restJson1ListProfilesCommand = function (output, conte
1796
1648
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1797
1649
  return [2, deserializeAws_restJson1ListProfilesCommandError(output, context)];
1798
1650
  }
1799
- contents = {
1651
+ contents = map({
1800
1652
  $metadata: deserializeMetadata(output),
1801
- nextToken: undefined,
1802
- profiles: undefined,
1803
- };
1653
+ });
1804
1654
  _a = __expectNonNull;
1805
1655
  _b = __expectObject;
1806
1656
  return [4, parseBody(output.body, context)];
1807
1657
  case 1:
1808
1658
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1809
- if (data.nextToken !== undefined && data.nextToken !== null) {
1659
+ if (data.nextToken != null) {
1810
1660
  contents.nextToken = __expectString(data.nextToken);
1811
1661
  }
1812
- if (data.profiles !== undefined && data.profiles !== null) {
1662
+ if (data.profiles != null) {
1813
1663
  contents.profiles = deserializeAws_restJson1ProfileDetails(data.profiles, context);
1814
1664
  }
1815
- return [2, Promise.resolve(contents)];
1665
+ return [2, contents];
1816
1666
  }
1817
1667
  });
1818
1668
  }); };
1819
1669
  var deserializeAws_restJson1ListProfilesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1820
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1670
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1821
1671
  var _c;
1822
1672
  return __generator(this, function (_d) {
1823
1673
  switch (_d.label) {
@@ -1842,14 +1692,14 @@ var deserializeAws_restJson1ListProfilesCommandError = function (output, context
1842
1692
  case 5: throw _d.sent();
1843
1693
  case 6:
1844
1694
  parsedBody = parsedOutput.body;
1845
- $metadata = deserializeMetadata(output);
1846
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1847
- response = new __BaseException({
1848
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1849
- $fault: "client",
1850
- $metadata: $metadata,
1695
+ throwDefaultError({
1696
+ output: output,
1697
+ parsedBody: parsedBody,
1698
+ exceptionCtor: __BaseException,
1699
+ errorCode: errorCode,
1851
1700
  });
1852
- throw __decorateServiceException(response, parsedBody);
1701
+ _d.label = 7;
1702
+ case 7: return [2];
1853
1703
  }
1854
1704
  });
1855
1705
  }); };
@@ -1861,28 +1711,26 @@ export var deserializeAws_restJson1ListSubjectsCommand = function (output, conte
1861
1711
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1862
1712
  return [2, deserializeAws_restJson1ListSubjectsCommandError(output, context)];
1863
1713
  }
1864
- contents = {
1714
+ contents = map({
1865
1715
  $metadata: deserializeMetadata(output),
1866
- nextToken: undefined,
1867
- subjects: undefined,
1868
- };
1716
+ });
1869
1717
  _a = __expectNonNull;
1870
1718
  _b = __expectObject;
1871
1719
  return [4, parseBody(output.body, context)];
1872
1720
  case 1:
1873
1721
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1874
- if (data.nextToken !== undefined && data.nextToken !== null) {
1722
+ if (data.nextToken != null) {
1875
1723
  contents.nextToken = __expectString(data.nextToken);
1876
1724
  }
1877
- if (data.subjects !== undefined && data.subjects !== null) {
1725
+ if (data.subjects != null) {
1878
1726
  contents.subjects = deserializeAws_restJson1SubjectSummaries(data.subjects, context);
1879
1727
  }
1880
- return [2, Promise.resolve(contents)];
1728
+ return [2, contents];
1881
1729
  }
1882
1730
  });
1883
1731
  }); };
1884
1732
  var deserializeAws_restJson1ListSubjectsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1885
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1733
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1886
1734
  var _c;
1887
1735
  return __generator(this, function (_d) {
1888
1736
  switch (_d.label) {
@@ -1907,14 +1755,14 @@ var deserializeAws_restJson1ListSubjectsCommandError = function (output, context
1907
1755
  case 5: throw _d.sent();
1908
1756
  case 6:
1909
1757
  parsedBody = parsedOutput.body;
1910
- $metadata = deserializeMetadata(output);
1911
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1912
- response = new __BaseException({
1913
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1914
- $fault: "client",
1915
- $metadata: $metadata,
1758
+ throwDefaultError({
1759
+ output: output,
1760
+ parsedBody: parsedBody,
1761
+ exceptionCtor: __BaseException,
1762
+ errorCode: errorCode,
1916
1763
  });
1917
- throw __decorateServiceException(response, parsedBody);
1764
+ _d.label = 7;
1765
+ case 7: return [2];
1918
1766
  }
1919
1767
  });
1920
1768
  }); };
@@ -1926,24 +1774,23 @@ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output
1926
1774
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1927
1775
  return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
1928
1776
  }
1929
- contents = {
1777
+ contents = map({
1930
1778
  $metadata: deserializeMetadata(output),
1931
- tags: undefined,
1932
- };
1779
+ });
1933
1780
  _a = __expectNonNull;
1934
1781
  _b = __expectObject;
1935
1782
  return [4, parseBody(output.body, context)];
1936
1783
  case 1:
1937
1784
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1938
- if (data.tags !== undefined && data.tags !== null) {
1785
+ if (data.tags != null) {
1939
1786
  contents.tags = deserializeAws_restJson1TagList(data.tags, context);
1940
1787
  }
1941
- return [2, Promise.resolve(contents)];
1788
+ return [2, contents];
1942
1789
  }
1943
1790
  });
1944
1791
  }); };
1945
1792
  var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1946
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1793
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1947
1794
  var _c;
1948
1795
  return __generator(this, function (_d) {
1949
1796
  switch (_d.label) {
@@ -1972,14 +1819,14 @@ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output,
1972
1819
  case 7: throw _d.sent();
1973
1820
  case 8:
1974
1821
  parsedBody = parsedOutput.body;
1975
- $metadata = deserializeMetadata(output);
1976
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1977
- response = new __BaseException({
1978
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1979
- $fault: "client",
1980
- $metadata: $metadata,
1822
+ throwDefaultError({
1823
+ output: output,
1824
+ parsedBody: parsedBody,
1825
+ exceptionCtor: __BaseException,
1826
+ errorCode: errorCode,
1981
1827
  });
1982
- throw __decorateServiceException(response, parsedBody);
1828
+ _d.label = 9;
1829
+ case 9: return [2];
1983
1830
  }
1984
1831
  });
1985
1832
  }); };
@@ -1991,28 +1838,26 @@ export var deserializeAws_restJson1ListTrustAnchorsCommand = function (output, c
1991
1838
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1992
1839
  return [2, deserializeAws_restJson1ListTrustAnchorsCommandError(output, context)];
1993
1840
  }
1994
- contents = {
1841
+ contents = map({
1995
1842
  $metadata: deserializeMetadata(output),
1996
- nextToken: undefined,
1997
- trustAnchors: undefined,
1998
- };
1843
+ });
1999
1844
  _a = __expectNonNull;
2000
1845
  _b = __expectObject;
2001
1846
  return [4, parseBody(output.body, context)];
2002
1847
  case 1:
2003
1848
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2004
- if (data.nextToken !== undefined && data.nextToken !== null) {
1849
+ if (data.nextToken != null) {
2005
1850
  contents.nextToken = __expectString(data.nextToken);
2006
1851
  }
2007
- if (data.trustAnchors !== undefined && data.trustAnchors !== null) {
1852
+ if (data.trustAnchors != null) {
2008
1853
  contents.trustAnchors = deserializeAws_restJson1TrustAnchorDetails(data.trustAnchors, context);
2009
1854
  }
2010
- return [2, Promise.resolve(contents)];
1855
+ return [2, contents];
2011
1856
  }
2012
1857
  });
2013
1858
  }); };
2014
1859
  var deserializeAws_restJson1ListTrustAnchorsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2015
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1860
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2016
1861
  var _c;
2017
1862
  return __generator(this, function (_d) {
2018
1863
  switch (_d.label) {
@@ -2037,14 +1882,14 @@ var deserializeAws_restJson1ListTrustAnchorsCommandError = function (output, con
2037
1882
  case 5: throw _d.sent();
2038
1883
  case 6:
2039
1884
  parsedBody = parsedOutput.body;
2040
- $metadata = deserializeMetadata(output);
2041
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2042
- response = new __BaseException({
2043
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2044
- $fault: "client",
2045
- $metadata: $metadata,
1885
+ throwDefaultError({
1886
+ output: output,
1887
+ parsedBody: parsedBody,
1888
+ exceptionCtor: __BaseException,
1889
+ errorCode: errorCode,
2046
1890
  });
2047
- throw __decorateServiceException(response, parsedBody);
1891
+ _d.label = 7;
1892
+ case 7: return [2];
2048
1893
  }
2049
1894
  });
2050
1895
  }); };
@@ -2056,18 +1901,18 @@ export var deserializeAws_restJson1TagResourceCommand = function (output, contex
2056
1901
  if (output.statusCode !== 201 && output.statusCode >= 300) {
2057
1902
  return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
2058
1903
  }
2059
- contents = {
1904
+ contents = map({
2060
1905
  $metadata: deserializeMetadata(output),
2061
- };
1906
+ });
2062
1907
  return [4, collectBody(output.body, context)];
2063
1908
  case 1:
2064
1909
  _a.sent();
2065
- return [2, Promise.resolve(contents)];
1910
+ return [2, contents];
2066
1911
  }
2067
1912
  });
2068
1913
  }); };
2069
1914
  var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2070
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1915
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2071
1916
  var _c;
2072
1917
  return __generator(this, function (_d) {
2073
1918
  switch (_d.label) {
@@ -2100,14 +1945,14 @@ var deserializeAws_restJson1TagResourceCommandError = function (output, context)
2100
1945
  case 9: throw _d.sent();
2101
1946
  case 10:
2102
1947
  parsedBody = parsedOutput.body;
2103
- $metadata = deserializeMetadata(output);
2104
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2105
- response = new __BaseException({
2106
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2107
- $fault: "client",
2108
- $metadata: $metadata,
1948
+ throwDefaultError({
1949
+ output: output,
1950
+ parsedBody: parsedBody,
1951
+ exceptionCtor: __BaseException,
1952
+ errorCode: errorCode,
2109
1953
  });
2110
- throw __decorateServiceException(response, parsedBody);
1954
+ _d.label = 11;
1955
+ case 11: return [2];
2111
1956
  }
2112
1957
  });
2113
1958
  }); };
@@ -2119,18 +1964,18 @@ export var deserializeAws_restJson1UntagResourceCommand = function (output, cont
2119
1964
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2120
1965
  return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
2121
1966
  }
2122
- contents = {
1967
+ contents = map({
2123
1968
  $metadata: deserializeMetadata(output),
2124
- };
1969
+ });
2125
1970
  return [4, collectBody(output.body, context)];
2126
1971
  case 1:
2127
1972
  _a.sent();
2128
- return [2, Promise.resolve(contents)];
1973
+ return [2, contents];
2129
1974
  }
2130
1975
  });
2131
1976
  }); };
2132
1977
  var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2133
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1978
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2134
1979
  var _c;
2135
1980
  return __generator(this, function (_d) {
2136
1981
  switch (_d.label) {
@@ -2159,14 +2004,14 @@ var deserializeAws_restJson1UntagResourceCommandError = function (output, contex
2159
2004
  case 7: throw _d.sent();
2160
2005
  case 8:
2161
2006
  parsedBody = parsedOutput.body;
2162
- $metadata = deserializeMetadata(output);
2163
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2164
- response = new __BaseException({
2165
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2166
- $fault: "client",
2167
- $metadata: $metadata,
2007
+ throwDefaultError({
2008
+ output: output,
2009
+ parsedBody: parsedBody,
2010
+ exceptionCtor: __BaseException,
2011
+ errorCode: errorCode,
2168
2012
  });
2169
- throw __decorateServiceException(response, parsedBody);
2013
+ _d.label = 9;
2014
+ case 9: return [2];
2170
2015
  }
2171
2016
  });
2172
2017
  }); };
@@ -2178,24 +2023,23 @@ export var deserializeAws_restJson1UpdateCrlCommand = function (output, context)
2178
2023
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2179
2024
  return [2, deserializeAws_restJson1UpdateCrlCommandError(output, context)];
2180
2025
  }
2181
- contents = {
2026
+ contents = map({
2182
2027
  $metadata: deserializeMetadata(output),
2183
- crl: undefined,
2184
- };
2028
+ });
2185
2029
  _a = __expectNonNull;
2186
2030
  _b = __expectObject;
2187
2031
  return [4, parseBody(output.body, context)];
2188
2032
  case 1:
2189
2033
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2190
- if (data.crl !== undefined && data.crl !== null) {
2034
+ if (data.crl != null) {
2191
2035
  contents.crl = deserializeAws_restJson1CrlDetail(data.crl, context);
2192
2036
  }
2193
- return [2, Promise.resolve(contents)];
2037
+ return [2, contents];
2194
2038
  }
2195
2039
  });
2196
2040
  }); };
2197
2041
  var deserializeAws_restJson1UpdateCrlCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2198
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2042
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2199
2043
  var _c;
2200
2044
  return __generator(this, function (_d) {
2201
2045
  switch (_d.label) {
@@ -2224,14 +2068,14 @@ var deserializeAws_restJson1UpdateCrlCommandError = function (output, context) {
2224
2068
  case 7: throw _d.sent();
2225
2069
  case 8:
2226
2070
  parsedBody = parsedOutput.body;
2227
- $metadata = deserializeMetadata(output);
2228
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2229
- response = new __BaseException({
2230
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2231
- $fault: "client",
2232
- $metadata: $metadata,
2071
+ throwDefaultError({
2072
+ output: output,
2073
+ parsedBody: parsedBody,
2074
+ exceptionCtor: __BaseException,
2075
+ errorCode: errorCode,
2233
2076
  });
2234
- throw __decorateServiceException(response, parsedBody);
2077
+ _d.label = 9;
2078
+ case 9: return [2];
2235
2079
  }
2236
2080
  });
2237
2081
  }); };
@@ -2243,24 +2087,23 @@ export var deserializeAws_restJson1UpdateProfileCommand = function (output, cont
2243
2087
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2244
2088
  return [2, deserializeAws_restJson1UpdateProfileCommandError(output, context)];
2245
2089
  }
2246
- contents = {
2090
+ contents = map({
2247
2091
  $metadata: deserializeMetadata(output),
2248
- profile: undefined,
2249
- };
2092
+ });
2250
2093
  _a = __expectNonNull;
2251
2094
  _b = __expectObject;
2252
2095
  return [4, parseBody(output.body, context)];
2253
2096
  case 1:
2254
2097
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2255
- if (data.profile !== undefined && data.profile !== null) {
2098
+ if (data.profile != null) {
2256
2099
  contents.profile = deserializeAws_restJson1ProfileDetail(data.profile, context);
2257
2100
  }
2258
- return [2, Promise.resolve(contents)];
2101
+ return [2, contents];
2259
2102
  }
2260
2103
  });
2261
2104
  }); };
2262
2105
  var deserializeAws_restJson1UpdateProfileCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2263
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2106
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2264
2107
  var _c;
2265
2108
  return __generator(this, function (_d) {
2266
2109
  switch (_d.label) {
@@ -2289,14 +2132,14 @@ var deserializeAws_restJson1UpdateProfileCommandError = function (output, contex
2289
2132
  case 7: throw _d.sent();
2290
2133
  case 8:
2291
2134
  parsedBody = parsedOutput.body;
2292
- $metadata = deserializeMetadata(output);
2293
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2294
- response = new __BaseException({
2295
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2296
- $fault: "client",
2297
- $metadata: $metadata,
2135
+ throwDefaultError({
2136
+ output: output,
2137
+ parsedBody: parsedBody,
2138
+ exceptionCtor: __BaseException,
2139
+ errorCode: errorCode,
2298
2140
  });
2299
- throw __decorateServiceException(response, parsedBody);
2141
+ _d.label = 9;
2142
+ case 9: return [2];
2300
2143
  }
2301
2144
  });
2302
2145
  }); };
@@ -2308,24 +2151,23 @@ export var deserializeAws_restJson1UpdateTrustAnchorCommand = function (output,
2308
2151
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2309
2152
  return [2, deserializeAws_restJson1UpdateTrustAnchorCommandError(output, context)];
2310
2153
  }
2311
- contents = {
2154
+ contents = map({
2312
2155
  $metadata: deserializeMetadata(output),
2313
- trustAnchor: undefined,
2314
- };
2156
+ });
2315
2157
  _a = __expectNonNull;
2316
2158
  _b = __expectObject;
2317
2159
  return [4, parseBody(output.body, context)];
2318
2160
  case 1:
2319
2161
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2320
- if (data.trustAnchor !== undefined && data.trustAnchor !== null) {
2162
+ if (data.trustAnchor != null) {
2321
2163
  contents.trustAnchor = deserializeAws_restJson1TrustAnchorDetail(data.trustAnchor, context);
2322
2164
  }
2323
- return [2, Promise.resolve(contents)];
2165
+ return [2, contents];
2324
2166
  }
2325
2167
  });
2326
2168
  }); };
2327
2169
  var deserializeAws_restJson1UpdateTrustAnchorCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2328
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2170
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2329
2171
  var _c;
2330
2172
  return __generator(this, function (_d) {
2331
2173
  switch (_d.label) {
@@ -2354,23 +2196,24 @@ var deserializeAws_restJson1UpdateTrustAnchorCommandError = function (output, co
2354
2196
  case 7: throw _d.sent();
2355
2197
  case 8:
2356
2198
  parsedBody = parsedOutput.body;
2357
- $metadata = deserializeMetadata(output);
2358
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2359
- response = new __BaseException({
2360
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2361
- $fault: "client",
2362
- $metadata: $metadata,
2199
+ throwDefaultError({
2200
+ output: output,
2201
+ parsedBody: parsedBody,
2202
+ exceptionCtor: __BaseException,
2203
+ errorCode: errorCode,
2363
2204
  });
2364
- throw __decorateServiceException(response, parsedBody);
2205
+ _d.label = 9;
2206
+ case 9: return [2];
2365
2207
  }
2366
2208
  });
2367
2209
  }); };
2210
+ var map = __map;
2368
2211
  var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2369
2212
  var contents, data, exception;
2370
2213
  return __generator(this, function (_a) {
2371
- contents = {};
2214
+ contents = map({});
2372
2215
  data = parsedOutput.body;
2373
- if (data.message !== undefined && data.message !== null) {
2216
+ if (data.message != null) {
2374
2217
  contents.message = __expectString(data.message);
2375
2218
  }
2376
2219
  exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2380,9 +2223,9 @@ var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutp
2380
2223
  var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2381
2224
  var contents, data, exception;
2382
2225
  return __generator(this, function (_a) {
2383
- contents = {};
2226
+ contents = map({});
2384
2227
  data = parsedOutput.body;
2385
- if (data.message !== undefined && data.message !== null) {
2228
+ if (data.message != null) {
2386
2229
  contents.message = __expectString(data.message);
2387
2230
  }
2388
2231
  exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2392,9 +2235,9 @@ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsed
2392
2235
  var deserializeAws_restJson1TooManyTagsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2393
2236
  var contents, data, exception;
2394
2237
  return __generator(this, function (_a) {
2395
- contents = {};
2238
+ contents = map({});
2396
2239
  data = parsedOutput.body;
2397
- if (data.message !== undefined && data.message !== null) {
2240
+ if (data.message != null) {
2398
2241
  contents.message = __expectString(data.message);
2399
2242
  }
2400
2243
  exception = new TooManyTagsException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2404,9 +2247,9 @@ var deserializeAws_restJson1TooManyTagsExceptionResponse = function (parsedOutpu
2404
2247
  var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2405
2248
  var contents, data, exception;
2406
2249
  return __generator(this, function (_a) {
2407
- contents = {};
2250
+ contents = map({});
2408
2251
  data = parsedOutput.body;
2409
- if (data.message !== undefined && data.message !== null) {
2252
+ if (data.message != null) {
2410
2253
  contents.message = __expectString(data.message);
2411
2254
  }
2412
2255
  exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2417,9 +2260,6 @@ var serializeAws_restJson1ManagedPolicyList = function (input, context) {
2417
2260
  return input
2418
2261
  .filter(function (e) { return e != null; })
2419
2262
  .map(function (entry) {
2420
- if (entry === null) {
2421
- return null;
2422
- }
2423
2263
  return entry;
2424
2264
  });
2425
2265
  };
@@ -2427,9 +2267,6 @@ var serializeAws_restJson1RoleArnList = function (input, context) {
2427
2267
  return input
2428
2268
  .filter(function (e) { return e != null; })
2429
2269
  .map(function (entry) {
2430
- if (entry === null) {
2431
- return null;
2432
- }
2433
2270
  return entry;
2434
2271
  });
2435
2272
  };
@@ -2450,9 +2287,6 @@ var serializeAws_restJson1TagKeyList = function (input, context) {
2450
2287
  return input
2451
2288
  .filter(function (e) { return e != null; })
2452
2289
  .map(function (entry) {
2453
- if (entry === null) {
2454
- return null;
2455
- }
2456
2290
  return entry;
2457
2291
  });
2458
2292
  };
@@ -2460,9 +2294,6 @@ var serializeAws_restJson1TagList = function (input, context) {
2460
2294
  return input
2461
2295
  .filter(function (e) { return e != null; })
2462
2296
  .map(function (entry) {
2463
- if (entry === null) {
2464
- return null;
2465
- }
2466
2297
  return serializeAws_restJson1Tag(entry, context);
2467
2298
  });
2468
2299
  };