@aws-sdk/client-amplifybackend 3.141.0 → 3.142.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
1
  import { __assign, __awaiter, __generator } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, limitedParseDouble as __limitedParseDouble, serializeFloat as __serializeFloat, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, map as __map, resolvedPath as __resolvedPath, serializeFloat as __serializeFloat, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { AmplifyBackendServiceException as __BaseException } from "../models/AmplifyBackendServiceException";
5
5
  import { BadRequestException, GatewayTimeoutException, NotFoundException, TooManyRequestsException, } from "../models/models_0";
6
6
  export var serializeAws_restJson1CloneBackendCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
7
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
8
8
  return __generator(this, function (_c) {
9
9
  switch (_c.label) {
10
10
  case 0: return [4, context.endpoint()];
@@ -15,26 +15,8 @@ export var serializeAws_restJson1CloneBackendCommand = function (input, context)
15
15
  };
16
16
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
17
17
  "/backend/{AppId}/environments/{BackendEnvironmentName}/clone";
18
- if (input.AppId !== undefined) {
19
- labelValue = input.AppId;
20
- if (labelValue.length <= 0) {
21
- throw new Error("Empty value provided for input HTTP label: AppId.");
22
- }
23
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
24
- }
25
- else {
26
- throw new Error("No value provided for input HTTP label: AppId.");
27
- }
28
- if (input.BackendEnvironmentName !== undefined) {
29
- labelValue = input.BackendEnvironmentName;
30
- if (labelValue.length <= 0) {
31
- throw new Error("Empty value provided for input HTTP label: BackendEnvironmentName.");
32
- }
33
- resolvedPath = resolvedPath.replace("{BackendEnvironmentName}", __extendedEncodeURIComponent(labelValue));
34
- }
35
- else {
36
- throw new Error("No value provided for input HTTP label: BackendEnvironmentName.");
37
- }
18
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
19
+ resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", function () { return input.BackendEnvironmentName; }, "{BackendEnvironmentName}", false);
38
20
  body = JSON.stringify(__assign({}, (input.TargetEnvironmentName != null && { targetEnvironmentName: input.TargetEnvironmentName })));
39
21
  return [2, new __HttpRequest({
40
22
  protocol: protocol,
@@ -75,7 +57,7 @@ export var serializeAws_restJson1CreateBackendCommand = function (input, context
75
57
  });
76
58
  }); };
77
59
  export var serializeAws_restJson1CreateBackendAPICommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
78
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
60
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
79
61
  return __generator(this, function (_c) {
80
62
  switch (_c.label) {
81
63
  case 0: return [4, context.endpoint()];
@@ -85,16 +67,7 @@ export var serializeAws_restJson1CreateBackendAPICommand = function (input, cont
85
67
  "content-type": "application/json",
86
68
  };
87
69
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/backend/{AppId}/api";
88
- if (input.AppId !== undefined) {
89
- labelValue = input.AppId;
90
- if (labelValue.length <= 0) {
91
- throw new Error("Empty value provided for input HTTP label: AppId.");
92
- }
93
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
94
- }
95
- else {
96
- throw new Error("No value provided for input HTTP label: AppId.");
97
- }
70
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
98
71
  body = JSON.stringify(__assign(__assign(__assign({}, (input.BackendEnvironmentName != null && { backendEnvironmentName: input.BackendEnvironmentName })), (input.ResourceConfig != null && {
99
72
  resourceConfig: serializeAws_restJson1BackendAPIResourceConfig(input.ResourceConfig, context),
100
73
  })), (input.ResourceName != null && { resourceName: input.ResourceName })));
@@ -111,7 +84,7 @@ export var serializeAws_restJson1CreateBackendAPICommand = function (input, cont
111
84
  });
112
85
  }); };
113
86
  export var serializeAws_restJson1CreateBackendAuthCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
114
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
87
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
115
88
  return __generator(this, function (_c) {
116
89
  switch (_c.label) {
117
90
  case 0: return [4, context.endpoint()];
@@ -121,16 +94,7 @@ export var serializeAws_restJson1CreateBackendAuthCommand = function (input, con
121
94
  "content-type": "application/json",
122
95
  };
123
96
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/backend/{AppId}/auth";
124
- if (input.AppId !== undefined) {
125
- labelValue = input.AppId;
126
- if (labelValue.length <= 0) {
127
- throw new Error("Empty value provided for input HTTP label: AppId.");
128
- }
129
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
130
- }
131
- else {
132
- throw new Error("No value provided for input HTTP label: AppId.");
133
- }
97
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
134
98
  body = JSON.stringify(__assign(__assign(__assign({}, (input.BackendEnvironmentName != null && { backendEnvironmentName: input.BackendEnvironmentName })), (input.ResourceConfig != null && {
135
99
  resourceConfig: serializeAws_restJson1CreateBackendAuthResourceConfig(input.ResourceConfig, context),
136
100
  })), (input.ResourceName != null && { resourceName: input.ResourceName })));
@@ -147,7 +111,7 @@ export var serializeAws_restJson1CreateBackendAuthCommand = function (input, con
147
111
  });
148
112
  }); };
149
113
  export var serializeAws_restJson1CreateBackendConfigCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
150
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
114
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
151
115
  return __generator(this, function (_c) {
152
116
  switch (_c.label) {
153
117
  case 0: return [4, context.endpoint()];
@@ -157,16 +121,7 @@ export var serializeAws_restJson1CreateBackendConfigCommand = function (input, c
157
121
  "content-type": "application/json",
158
122
  };
159
123
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/backend/{AppId}/config";
160
- if (input.AppId !== undefined) {
161
- labelValue = input.AppId;
162
- if (labelValue.length <= 0) {
163
- throw new Error("Empty value provided for input HTTP label: AppId.");
164
- }
165
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
166
- }
167
- else {
168
- throw new Error("No value provided for input HTTP label: AppId.");
169
- }
124
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
170
125
  body = JSON.stringify(__assign({}, (input.BackendManagerAppId != null && { backendManagerAppId: input.BackendManagerAppId })));
171
126
  return [2, new __HttpRequest({
172
127
  protocol: protocol,
@@ -181,7 +136,7 @@ export var serializeAws_restJson1CreateBackendConfigCommand = function (input, c
181
136
  });
182
137
  }); };
183
138
  export var serializeAws_restJson1CreateBackendStorageCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
184
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
139
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
185
140
  return __generator(this, function (_c) {
186
141
  switch (_c.label) {
187
142
  case 0: return [4, context.endpoint()];
@@ -191,16 +146,7 @@ export var serializeAws_restJson1CreateBackendStorageCommand = function (input,
191
146
  "content-type": "application/json",
192
147
  };
193
148
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/backend/{AppId}/storage";
194
- if (input.AppId !== undefined) {
195
- labelValue = input.AppId;
196
- if (labelValue.length <= 0) {
197
- throw new Error("Empty value provided for input HTTP label: AppId.");
198
- }
199
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
200
- }
201
- else {
202
- throw new Error("No value provided for input HTTP label: AppId.");
203
- }
149
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
204
150
  body = JSON.stringify(__assign(__assign(__assign({}, (input.BackendEnvironmentName != null && { backendEnvironmentName: input.BackendEnvironmentName })), (input.ResourceConfig != null && {
205
151
  resourceConfig: serializeAws_restJson1CreateBackendStorageResourceConfig(input.ResourceConfig, context),
206
152
  })), (input.ResourceName != null && { resourceName: input.ResourceName })));
@@ -217,7 +163,7 @@ export var serializeAws_restJson1CreateBackendStorageCommand = function (input,
217
163
  });
218
164
  }); };
219
165
  export var serializeAws_restJson1CreateTokenCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
220
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
166
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
221
167
  return __generator(this, function (_c) {
222
168
  switch (_c.label) {
223
169
  case 0: return [4, context.endpoint()];
@@ -225,16 +171,7 @@ export var serializeAws_restJson1CreateTokenCommand = function (input, context)
225
171
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
226
172
  headers = {};
227
173
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/backend/{AppId}/challenge";
228
- if (input.AppId !== undefined) {
229
- labelValue = input.AppId;
230
- if (labelValue.length <= 0) {
231
- throw new Error("Empty value provided for input HTTP label: AppId.");
232
- }
233
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
234
- }
235
- else {
236
- throw new Error("No value provided for input HTTP label: AppId.");
237
- }
174
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
238
175
  return [2, new __HttpRequest({
239
176
  protocol: protocol,
240
177
  hostname: hostname,
@@ -248,7 +185,7 @@ export var serializeAws_restJson1CreateTokenCommand = function (input, context)
248
185
  });
249
186
  }); };
250
187
  export var serializeAws_restJson1DeleteBackendCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
251
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
188
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
252
189
  return __generator(this, function (_c) {
253
190
  switch (_c.label) {
254
191
  case 0: return [4, context.endpoint()];
@@ -257,26 +194,8 @@ export var serializeAws_restJson1DeleteBackendCommand = function (input, context
257
194
  headers = {};
258
195
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
259
196
  "/backend/{AppId}/environments/{BackendEnvironmentName}/remove";
260
- if (input.AppId !== undefined) {
261
- labelValue = input.AppId;
262
- if (labelValue.length <= 0) {
263
- throw new Error("Empty value provided for input HTTP label: AppId.");
264
- }
265
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
266
- }
267
- else {
268
- throw new Error("No value provided for input HTTP label: AppId.");
269
- }
270
- if (input.BackendEnvironmentName !== undefined) {
271
- labelValue = input.BackendEnvironmentName;
272
- if (labelValue.length <= 0) {
273
- throw new Error("Empty value provided for input HTTP label: BackendEnvironmentName.");
274
- }
275
- resolvedPath = resolvedPath.replace("{BackendEnvironmentName}", __extendedEncodeURIComponent(labelValue));
276
- }
277
- else {
278
- throw new Error("No value provided for input HTTP label: BackendEnvironmentName.");
279
- }
197
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
198
+ resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", function () { return input.BackendEnvironmentName; }, "{BackendEnvironmentName}", false);
280
199
  return [2, new __HttpRequest({
281
200
  protocol: protocol,
282
201
  hostname: hostname,
@@ -290,7 +209,7 @@ export var serializeAws_restJson1DeleteBackendCommand = function (input, context
290
209
  });
291
210
  }); };
292
211
  export var serializeAws_restJson1DeleteBackendAPICommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
293
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
212
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
294
213
  return __generator(this, function (_c) {
295
214
  switch (_c.label) {
296
215
  case 0: return [4, context.endpoint()];
@@ -301,26 +220,8 @@ export var serializeAws_restJson1DeleteBackendAPICommand = function (input, cont
301
220
  };
302
221
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
303
222
  "/backend/{AppId}/api/{BackendEnvironmentName}/remove";
304
- if (input.AppId !== undefined) {
305
- labelValue = input.AppId;
306
- if (labelValue.length <= 0) {
307
- throw new Error("Empty value provided for input HTTP label: AppId.");
308
- }
309
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
310
- }
311
- else {
312
- throw new Error("No value provided for input HTTP label: AppId.");
313
- }
314
- if (input.BackendEnvironmentName !== undefined) {
315
- labelValue = input.BackendEnvironmentName;
316
- if (labelValue.length <= 0) {
317
- throw new Error("Empty value provided for input HTTP label: BackendEnvironmentName.");
318
- }
319
- resolvedPath = resolvedPath.replace("{BackendEnvironmentName}", __extendedEncodeURIComponent(labelValue));
320
- }
321
- else {
322
- throw new Error("No value provided for input HTTP label: BackendEnvironmentName.");
323
- }
223
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
224
+ resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", function () { return input.BackendEnvironmentName; }, "{BackendEnvironmentName}", false);
324
225
  body = JSON.stringify(__assign(__assign({}, (input.ResourceConfig != null && {
325
226
  resourceConfig: serializeAws_restJson1BackendAPIResourceConfig(input.ResourceConfig, context),
326
227
  })), (input.ResourceName != null && { resourceName: input.ResourceName })));
@@ -337,7 +238,7 @@ export var serializeAws_restJson1DeleteBackendAPICommand = function (input, cont
337
238
  });
338
239
  }); };
339
240
  export var serializeAws_restJson1DeleteBackendAuthCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
340
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
241
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
341
242
  return __generator(this, function (_c) {
342
243
  switch (_c.label) {
343
244
  case 0: return [4, context.endpoint()];
@@ -348,26 +249,8 @@ export var serializeAws_restJson1DeleteBackendAuthCommand = function (input, con
348
249
  };
349
250
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
350
251
  "/backend/{AppId}/auth/{BackendEnvironmentName}/remove";
351
- if (input.AppId !== undefined) {
352
- labelValue = input.AppId;
353
- if (labelValue.length <= 0) {
354
- throw new Error("Empty value provided for input HTTP label: AppId.");
355
- }
356
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
357
- }
358
- else {
359
- throw new Error("No value provided for input HTTP label: AppId.");
360
- }
361
- if (input.BackendEnvironmentName !== undefined) {
362
- labelValue = input.BackendEnvironmentName;
363
- if (labelValue.length <= 0) {
364
- throw new Error("Empty value provided for input HTTP label: BackendEnvironmentName.");
365
- }
366
- resolvedPath = resolvedPath.replace("{BackendEnvironmentName}", __extendedEncodeURIComponent(labelValue));
367
- }
368
- else {
369
- throw new Error("No value provided for input HTTP label: BackendEnvironmentName.");
370
- }
252
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
253
+ resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", function () { return input.BackendEnvironmentName; }, "{BackendEnvironmentName}", false);
371
254
  body = JSON.stringify(__assign({}, (input.ResourceName != null && { resourceName: input.ResourceName })));
372
255
  return [2, new __HttpRequest({
373
256
  protocol: protocol,
@@ -382,7 +265,7 @@ export var serializeAws_restJson1DeleteBackendAuthCommand = function (input, con
382
265
  });
383
266
  }); };
384
267
  export var serializeAws_restJson1DeleteBackendStorageCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
385
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
268
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
386
269
  return __generator(this, function (_c) {
387
270
  switch (_c.label) {
388
271
  case 0: return [4, context.endpoint()];
@@ -393,26 +276,8 @@ export var serializeAws_restJson1DeleteBackendStorageCommand = function (input,
393
276
  };
394
277
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
395
278
  "/backend/{AppId}/storage/{BackendEnvironmentName}/remove";
396
- if (input.AppId !== undefined) {
397
- labelValue = input.AppId;
398
- if (labelValue.length <= 0) {
399
- throw new Error("Empty value provided for input HTTP label: AppId.");
400
- }
401
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
402
- }
403
- else {
404
- throw new Error("No value provided for input HTTP label: AppId.");
405
- }
406
- if (input.BackendEnvironmentName !== undefined) {
407
- labelValue = input.BackendEnvironmentName;
408
- if (labelValue.length <= 0) {
409
- throw new Error("Empty value provided for input HTTP label: BackendEnvironmentName.");
410
- }
411
- resolvedPath = resolvedPath.replace("{BackendEnvironmentName}", __extendedEncodeURIComponent(labelValue));
412
- }
413
- else {
414
- throw new Error("No value provided for input HTTP label: BackendEnvironmentName.");
415
- }
279
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
280
+ resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", function () { return input.BackendEnvironmentName; }, "{BackendEnvironmentName}", false);
416
281
  body = JSON.stringify(__assign(__assign({}, (input.ResourceName != null && { resourceName: input.ResourceName })), (input.ServiceName != null && { serviceName: input.ServiceName })));
417
282
  return [2, new __HttpRequest({
418
283
  protocol: protocol,
@@ -427,7 +292,7 @@ export var serializeAws_restJson1DeleteBackendStorageCommand = function (input,
427
292
  });
428
293
  }); };
429
294
  export var serializeAws_restJson1DeleteTokenCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
430
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
295
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
431
296
  return __generator(this, function (_c) {
432
297
  switch (_c.label) {
433
298
  case 0: return [4, context.endpoint()];
@@ -436,26 +301,8 @@ export var serializeAws_restJson1DeleteTokenCommand = function (input, context)
436
301
  headers = {};
437
302
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
438
303
  "/backend/{AppId}/challenge/{SessionId}/remove";
439
- if (input.AppId !== undefined) {
440
- labelValue = input.AppId;
441
- if (labelValue.length <= 0) {
442
- throw new Error("Empty value provided for input HTTP label: AppId.");
443
- }
444
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
445
- }
446
- else {
447
- throw new Error("No value provided for input HTTP label: AppId.");
448
- }
449
- if (input.SessionId !== undefined) {
450
- labelValue = input.SessionId;
451
- if (labelValue.length <= 0) {
452
- throw new Error("Empty value provided for input HTTP label: SessionId.");
453
- }
454
- resolvedPath = resolvedPath.replace("{SessionId}", __extendedEncodeURIComponent(labelValue));
455
- }
456
- else {
457
- throw new Error("No value provided for input HTTP label: SessionId.");
458
- }
304
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
305
+ resolvedPath = __resolvedPath(resolvedPath, input, "SessionId", function () { return input.SessionId; }, "{SessionId}", false);
459
306
  return [2, new __HttpRequest({
460
307
  protocol: protocol,
461
308
  hostname: hostname,
@@ -469,7 +316,7 @@ export var serializeAws_restJson1DeleteTokenCommand = function (input, context)
469
316
  });
470
317
  }); };
471
318
  export var serializeAws_restJson1GenerateBackendAPIModelsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
472
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
319
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
473
320
  return __generator(this, function (_c) {
474
321
  switch (_c.label) {
475
322
  case 0: return [4, context.endpoint()];
@@ -480,26 +327,8 @@ export var serializeAws_restJson1GenerateBackendAPIModelsCommand = function (inp
480
327
  };
481
328
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
482
329
  "/backend/{AppId}/api/{BackendEnvironmentName}/generateModels";
483
- if (input.AppId !== undefined) {
484
- labelValue = input.AppId;
485
- if (labelValue.length <= 0) {
486
- throw new Error("Empty value provided for input HTTP label: AppId.");
487
- }
488
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
489
- }
490
- else {
491
- throw new Error("No value provided for input HTTP label: AppId.");
492
- }
493
- if (input.BackendEnvironmentName !== undefined) {
494
- labelValue = input.BackendEnvironmentName;
495
- if (labelValue.length <= 0) {
496
- throw new Error("Empty value provided for input HTTP label: BackendEnvironmentName.");
497
- }
498
- resolvedPath = resolvedPath.replace("{BackendEnvironmentName}", __extendedEncodeURIComponent(labelValue));
499
- }
500
- else {
501
- throw new Error("No value provided for input HTTP label: BackendEnvironmentName.");
502
- }
330
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
331
+ resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", function () { return input.BackendEnvironmentName; }, "{BackendEnvironmentName}", false);
503
332
  body = JSON.stringify(__assign({}, (input.ResourceName != null && { resourceName: input.ResourceName })));
504
333
  return [2, new __HttpRequest({
505
334
  protocol: protocol,
@@ -514,7 +343,7 @@ export var serializeAws_restJson1GenerateBackendAPIModelsCommand = function (inp
514
343
  });
515
344
  }); };
516
345
  export var serializeAws_restJson1GetBackendCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
517
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
346
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
518
347
  return __generator(this, function (_c) {
519
348
  switch (_c.label) {
520
349
  case 0: return [4, context.endpoint()];
@@ -524,16 +353,7 @@ export var serializeAws_restJson1GetBackendCommand = function (input, context) {
524
353
  "content-type": "application/json",
525
354
  };
526
355
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/backend/{AppId}/details";
527
- if (input.AppId !== undefined) {
528
- labelValue = input.AppId;
529
- if (labelValue.length <= 0) {
530
- throw new Error("Empty value provided for input HTTP label: AppId.");
531
- }
532
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
533
- }
534
- else {
535
- throw new Error("No value provided for input HTTP label: AppId.");
536
- }
356
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
537
357
  body = JSON.stringify(__assign({}, (input.BackendEnvironmentName != null && { backendEnvironmentName: input.BackendEnvironmentName })));
538
358
  return [2, new __HttpRequest({
539
359
  protocol: protocol,
@@ -548,7 +368,7 @@ export var serializeAws_restJson1GetBackendCommand = function (input, context) {
548
368
  });
549
369
  }); };
550
370
  export var serializeAws_restJson1GetBackendAPICommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
551
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
371
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
552
372
  return __generator(this, function (_c) {
553
373
  switch (_c.label) {
554
374
  case 0: return [4, context.endpoint()];
@@ -559,26 +379,8 @@ export var serializeAws_restJson1GetBackendAPICommand = function (input, context
559
379
  };
560
380
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
561
381
  "/backend/{AppId}/api/{BackendEnvironmentName}/details";
562
- if (input.AppId !== undefined) {
563
- labelValue = input.AppId;
564
- if (labelValue.length <= 0) {
565
- throw new Error("Empty value provided for input HTTP label: AppId.");
566
- }
567
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
568
- }
569
- else {
570
- throw new Error("No value provided for input HTTP label: AppId.");
571
- }
572
- if (input.BackendEnvironmentName !== undefined) {
573
- labelValue = input.BackendEnvironmentName;
574
- if (labelValue.length <= 0) {
575
- throw new Error("Empty value provided for input HTTP label: BackendEnvironmentName.");
576
- }
577
- resolvedPath = resolvedPath.replace("{BackendEnvironmentName}", __extendedEncodeURIComponent(labelValue));
578
- }
579
- else {
580
- throw new Error("No value provided for input HTTP label: BackendEnvironmentName.");
581
- }
382
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
383
+ resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", function () { return input.BackendEnvironmentName; }, "{BackendEnvironmentName}", false);
582
384
  body = JSON.stringify(__assign(__assign({}, (input.ResourceConfig != null && {
583
385
  resourceConfig: serializeAws_restJson1BackendAPIResourceConfig(input.ResourceConfig, context),
584
386
  })), (input.ResourceName != null && { resourceName: input.ResourceName })));
@@ -595,7 +397,7 @@ export var serializeAws_restJson1GetBackendAPICommand = function (input, context
595
397
  });
596
398
  }); };
597
399
  export var serializeAws_restJson1GetBackendAPIModelsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
598
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
400
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
599
401
  return __generator(this, function (_c) {
600
402
  switch (_c.label) {
601
403
  case 0: return [4, context.endpoint()];
@@ -606,26 +408,8 @@ export var serializeAws_restJson1GetBackendAPIModelsCommand = function (input, c
606
408
  };
607
409
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
608
410
  "/backend/{AppId}/api/{BackendEnvironmentName}/getModels";
609
- if (input.AppId !== undefined) {
610
- labelValue = input.AppId;
611
- if (labelValue.length <= 0) {
612
- throw new Error("Empty value provided for input HTTP label: AppId.");
613
- }
614
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
615
- }
616
- else {
617
- throw new Error("No value provided for input HTTP label: AppId.");
618
- }
619
- if (input.BackendEnvironmentName !== undefined) {
620
- labelValue = input.BackendEnvironmentName;
621
- if (labelValue.length <= 0) {
622
- throw new Error("Empty value provided for input HTTP label: BackendEnvironmentName.");
623
- }
624
- resolvedPath = resolvedPath.replace("{BackendEnvironmentName}", __extendedEncodeURIComponent(labelValue));
625
- }
626
- else {
627
- throw new Error("No value provided for input HTTP label: BackendEnvironmentName.");
628
- }
411
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
412
+ resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", function () { return input.BackendEnvironmentName; }, "{BackendEnvironmentName}", false);
629
413
  body = JSON.stringify(__assign({}, (input.ResourceName != null && { resourceName: input.ResourceName })));
630
414
  return [2, new __HttpRequest({
631
415
  protocol: protocol,
@@ -640,7 +424,7 @@ export var serializeAws_restJson1GetBackendAPIModelsCommand = function (input, c
640
424
  });
641
425
  }); };
642
426
  export var serializeAws_restJson1GetBackendAuthCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
643
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
427
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
644
428
  return __generator(this, function (_c) {
645
429
  switch (_c.label) {
646
430
  case 0: return [4, context.endpoint()];
@@ -651,26 +435,8 @@ export var serializeAws_restJson1GetBackendAuthCommand = function (input, contex
651
435
  };
652
436
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
653
437
  "/backend/{AppId}/auth/{BackendEnvironmentName}/details";
654
- if (input.AppId !== undefined) {
655
- labelValue = input.AppId;
656
- if (labelValue.length <= 0) {
657
- throw new Error("Empty value provided for input HTTP label: AppId.");
658
- }
659
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
660
- }
661
- else {
662
- throw new Error("No value provided for input HTTP label: AppId.");
663
- }
664
- if (input.BackendEnvironmentName !== undefined) {
665
- labelValue = input.BackendEnvironmentName;
666
- if (labelValue.length <= 0) {
667
- throw new Error("Empty value provided for input HTTP label: BackendEnvironmentName.");
668
- }
669
- resolvedPath = resolvedPath.replace("{BackendEnvironmentName}", __extendedEncodeURIComponent(labelValue));
670
- }
671
- else {
672
- throw new Error("No value provided for input HTTP label: BackendEnvironmentName.");
673
- }
438
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
439
+ resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", function () { return input.BackendEnvironmentName; }, "{BackendEnvironmentName}", false);
674
440
  body = JSON.stringify(__assign({}, (input.ResourceName != null && { resourceName: input.ResourceName })));
675
441
  return [2, new __HttpRequest({
676
442
  protocol: protocol,
@@ -685,7 +451,7 @@ export var serializeAws_restJson1GetBackendAuthCommand = function (input, contex
685
451
  });
686
452
  }); };
687
453
  export var serializeAws_restJson1GetBackendJobCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
688
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, body;
454
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
689
455
  return __generator(this, function (_c) {
690
456
  switch (_c.label) {
691
457
  case 0: return [4, context.endpoint()];
@@ -694,36 +460,9 @@ export var serializeAws_restJson1GetBackendJobCommand = function (input, context
694
460
  headers = {};
695
461
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
696
462
  "/backend/{AppId}/job/{BackendEnvironmentName}/{JobId}";
697
- if (input.AppId !== undefined) {
698
- labelValue = input.AppId;
699
- if (labelValue.length <= 0) {
700
- throw new Error("Empty value provided for input HTTP label: AppId.");
701
- }
702
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
703
- }
704
- else {
705
- throw new Error("No value provided for input HTTP label: AppId.");
706
- }
707
- if (input.BackendEnvironmentName !== undefined) {
708
- labelValue = input.BackendEnvironmentName;
709
- if (labelValue.length <= 0) {
710
- throw new Error("Empty value provided for input HTTP label: BackendEnvironmentName.");
711
- }
712
- resolvedPath = resolvedPath.replace("{BackendEnvironmentName}", __extendedEncodeURIComponent(labelValue));
713
- }
714
- else {
715
- throw new Error("No value provided for input HTTP label: BackendEnvironmentName.");
716
- }
717
- if (input.JobId !== undefined) {
718
- labelValue = input.JobId;
719
- if (labelValue.length <= 0) {
720
- throw new Error("Empty value provided for input HTTP label: JobId.");
721
- }
722
- resolvedPath = resolvedPath.replace("{JobId}", __extendedEncodeURIComponent(labelValue));
723
- }
724
- else {
725
- throw new Error("No value provided for input HTTP label: JobId.");
726
- }
463
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
464
+ resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", function () { return input.BackendEnvironmentName; }, "{BackendEnvironmentName}", false);
465
+ resolvedPath = __resolvedPath(resolvedPath, input, "JobId", function () { return input.JobId; }, "{JobId}", false);
727
466
  return [2, new __HttpRequest({
728
467
  protocol: protocol,
729
468
  hostname: hostname,
@@ -737,7 +476,7 @@ export var serializeAws_restJson1GetBackendJobCommand = function (input, context
737
476
  });
738
477
  }); };
739
478
  export var serializeAws_restJson1GetBackendStorageCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
740
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
479
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
741
480
  return __generator(this, function (_c) {
742
481
  switch (_c.label) {
743
482
  case 0: return [4, context.endpoint()];
@@ -748,26 +487,8 @@ export var serializeAws_restJson1GetBackendStorageCommand = function (input, con
748
487
  };
749
488
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
750
489
  "/backend/{AppId}/storage/{BackendEnvironmentName}/details";
751
- if (input.AppId !== undefined) {
752
- labelValue = input.AppId;
753
- if (labelValue.length <= 0) {
754
- throw new Error("Empty value provided for input HTTP label: AppId.");
755
- }
756
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
757
- }
758
- else {
759
- throw new Error("No value provided for input HTTP label: AppId.");
760
- }
761
- if (input.BackendEnvironmentName !== undefined) {
762
- labelValue = input.BackendEnvironmentName;
763
- if (labelValue.length <= 0) {
764
- throw new Error("Empty value provided for input HTTP label: BackendEnvironmentName.");
765
- }
766
- resolvedPath = resolvedPath.replace("{BackendEnvironmentName}", __extendedEncodeURIComponent(labelValue));
767
- }
768
- else {
769
- throw new Error("No value provided for input HTTP label: BackendEnvironmentName.");
770
- }
490
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
491
+ resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", function () { return input.BackendEnvironmentName; }, "{BackendEnvironmentName}", false);
771
492
  body = JSON.stringify(__assign({}, (input.ResourceName != null && { resourceName: input.ResourceName })));
772
493
  return [2, new __HttpRequest({
773
494
  protocol: protocol,
@@ -782,7 +503,7 @@ export var serializeAws_restJson1GetBackendStorageCommand = function (input, con
782
503
  });
783
504
  }); };
784
505
  export var serializeAws_restJson1GetTokenCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
785
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
506
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
786
507
  return __generator(this, function (_c) {
787
508
  switch (_c.label) {
788
509
  case 0: return [4, context.endpoint()];
@@ -790,26 +511,8 @@ export var serializeAws_restJson1GetTokenCommand = function (input, context) { r
790
511
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
791
512
  headers = {};
792
513
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/backend/{AppId}/challenge/{SessionId}";
793
- if (input.AppId !== undefined) {
794
- labelValue = input.AppId;
795
- if (labelValue.length <= 0) {
796
- throw new Error("Empty value provided for input HTTP label: AppId.");
797
- }
798
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
799
- }
800
- else {
801
- throw new Error("No value provided for input HTTP label: AppId.");
802
- }
803
- if (input.SessionId !== undefined) {
804
- labelValue = input.SessionId;
805
- if (labelValue.length <= 0) {
806
- throw new Error("Empty value provided for input HTTP label: SessionId.");
807
- }
808
- resolvedPath = resolvedPath.replace("{SessionId}", __extendedEncodeURIComponent(labelValue));
809
- }
810
- else {
811
- throw new Error("No value provided for input HTTP label: SessionId.");
812
- }
514
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
515
+ resolvedPath = __resolvedPath(resolvedPath, input, "SessionId", function () { return input.SessionId; }, "{SessionId}", false);
813
516
  return [2, new __HttpRequest({
814
517
  protocol: protocol,
815
518
  hostname: hostname,
@@ -823,7 +526,7 @@ export var serializeAws_restJson1GetTokenCommand = function (input, context) { r
823
526
  });
824
527
  }); };
825
528
  export var serializeAws_restJson1ImportBackendAuthCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
826
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
529
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
827
530
  return __generator(this, function (_c) {
828
531
  switch (_c.label) {
829
532
  case 0: return [4, context.endpoint()];
@@ -834,26 +537,8 @@ export var serializeAws_restJson1ImportBackendAuthCommand = function (input, con
834
537
  };
835
538
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
836
539
  "/backend/{AppId}/auth/{BackendEnvironmentName}/import";
837
- if (input.AppId !== undefined) {
838
- labelValue = input.AppId;
839
- if (labelValue.length <= 0) {
840
- throw new Error("Empty value provided for input HTTP label: AppId.");
841
- }
842
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
843
- }
844
- else {
845
- throw new Error("No value provided for input HTTP label: AppId.");
846
- }
847
- if (input.BackendEnvironmentName !== undefined) {
848
- labelValue = input.BackendEnvironmentName;
849
- if (labelValue.length <= 0) {
850
- throw new Error("Empty value provided for input HTTP label: BackendEnvironmentName.");
851
- }
852
- resolvedPath = resolvedPath.replace("{BackendEnvironmentName}", __extendedEncodeURIComponent(labelValue));
853
- }
854
- else {
855
- throw new Error("No value provided for input HTTP label: BackendEnvironmentName.");
856
- }
540
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
541
+ resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", function () { return input.BackendEnvironmentName; }, "{BackendEnvironmentName}", false);
857
542
  body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.IdentityPoolId != null && { identityPoolId: input.IdentityPoolId })), (input.NativeClientId != null && { nativeClientId: input.NativeClientId })), (input.UserPoolId != null && { userPoolId: input.UserPoolId })), (input.WebClientId != null && { webClientId: input.WebClientId })));
858
543
  return [2, new __HttpRequest({
859
544
  protocol: protocol,
@@ -868,7 +553,7 @@ export var serializeAws_restJson1ImportBackendAuthCommand = function (input, con
868
553
  });
869
554
  }); };
870
555
  export var serializeAws_restJson1ImportBackendStorageCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
871
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
556
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
872
557
  return __generator(this, function (_c) {
873
558
  switch (_c.label) {
874
559
  case 0: return [4, context.endpoint()];
@@ -879,26 +564,8 @@ export var serializeAws_restJson1ImportBackendStorageCommand = function (input,
879
564
  };
880
565
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
881
566
  "/backend/{AppId}/storage/{BackendEnvironmentName}/import";
882
- if (input.AppId !== undefined) {
883
- labelValue = input.AppId;
884
- if (labelValue.length <= 0) {
885
- throw new Error("Empty value provided for input HTTP label: AppId.");
886
- }
887
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
888
- }
889
- else {
890
- throw new Error("No value provided for input HTTP label: AppId.");
891
- }
892
- if (input.BackendEnvironmentName !== undefined) {
893
- labelValue = input.BackendEnvironmentName;
894
- if (labelValue.length <= 0) {
895
- throw new Error("Empty value provided for input HTTP label: BackendEnvironmentName.");
896
- }
897
- resolvedPath = resolvedPath.replace("{BackendEnvironmentName}", __extendedEncodeURIComponent(labelValue));
898
- }
899
- else {
900
- throw new Error("No value provided for input HTTP label: BackendEnvironmentName.");
901
- }
567
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
568
+ resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", function () { return input.BackendEnvironmentName; }, "{BackendEnvironmentName}", false);
902
569
  body = JSON.stringify(__assign(__assign({}, (input.BucketName != null && { bucketName: input.BucketName })), (input.ServiceName != null && { serviceName: input.ServiceName })));
903
570
  return [2, new __HttpRequest({
904
571
  protocol: protocol,
@@ -913,7 +580,7 @@ export var serializeAws_restJson1ImportBackendStorageCommand = function (input,
913
580
  });
914
581
  }); };
915
582
  export var serializeAws_restJson1ListBackendJobsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
916
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
583
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
917
584
  return __generator(this, function (_c) {
918
585
  switch (_c.label) {
919
586
  case 0: return [4, context.endpoint()];
@@ -924,26 +591,8 @@ export var serializeAws_restJson1ListBackendJobsCommand = function (input, conte
924
591
  };
925
592
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
926
593
  "/backend/{AppId}/job/{BackendEnvironmentName}";
927
- if (input.AppId !== undefined) {
928
- labelValue = input.AppId;
929
- if (labelValue.length <= 0) {
930
- throw new Error("Empty value provided for input HTTP label: AppId.");
931
- }
932
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
933
- }
934
- else {
935
- throw new Error("No value provided for input HTTP label: AppId.");
936
- }
937
- if (input.BackendEnvironmentName !== undefined) {
938
- labelValue = input.BackendEnvironmentName;
939
- if (labelValue.length <= 0) {
940
- throw new Error("Empty value provided for input HTTP label: BackendEnvironmentName.");
941
- }
942
- resolvedPath = resolvedPath.replace("{BackendEnvironmentName}", __extendedEncodeURIComponent(labelValue));
943
- }
944
- else {
945
- throw new Error("No value provided for input HTTP label: BackendEnvironmentName.");
946
- }
594
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
595
+ resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", function () { return input.BackendEnvironmentName; }, "{BackendEnvironmentName}", false);
947
596
  body = JSON.stringify(__assign(__assign(__assign(__assign(__assign({}, (input.JobId != null && { jobId: input.JobId })), (input.MaxResults != null && { maxResults: input.MaxResults })), (input.NextToken != null && { nextToken: input.NextToken })), (input.Operation != null && { operation: input.Operation })), (input.Status != null && { status: input.Status })));
948
597
  return [2, new __HttpRequest({
949
598
  protocol: protocol,
@@ -982,7 +631,7 @@ export var serializeAws_restJson1ListS3BucketsCommand = function (input, context
982
631
  });
983
632
  }); };
984
633
  export var serializeAws_restJson1RemoveAllBackendsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
985
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
634
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
986
635
  return __generator(this, function (_c) {
987
636
  switch (_c.label) {
988
637
  case 0: return [4, context.endpoint()];
@@ -992,16 +641,7 @@ export var serializeAws_restJson1RemoveAllBackendsCommand = function (input, con
992
641
  "content-type": "application/json",
993
642
  };
994
643
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/backend/{AppId}/remove";
995
- if (input.AppId !== undefined) {
996
- labelValue = input.AppId;
997
- if (labelValue.length <= 0) {
998
- throw new Error("Empty value provided for input HTTP label: AppId.");
999
- }
1000
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
1001
- }
1002
- else {
1003
- throw new Error("No value provided for input HTTP label: AppId.");
1004
- }
644
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
1005
645
  body = JSON.stringify(__assign({}, (input.CleanAmplifyApp != null && { cleanAmplifyApp: input.CleanAmplifyApp })));
1006
646
  return [2, new __HttpRequest({
1007
647
  protocol: protocol,
@@ -1016,7 +656,7 @@ export var serializeAws_restJson1RemoveAllBackendsCommand = function (input, con
1016
656
  });
1017
657
  }); };
1018
658
  export var serializeAws_restJson1RemoveBackendConfigCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1019
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
659
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1020
660
  return __generator(this, function (_c) {
1021
661
  switch (_c.label) {
1022
662
  case 0: return [4, context.endpoint()];
@@ -1024,16 +664,7 @@ export var serializeAws_restJson1RemoveBackendConfigCommand = function (input, c
1024
664
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
1025
665
  headers = {};
1026
666
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/backend/{AppId}/config/remove";
1027
- if (input.AppId !== undefined) {
1028
- labelValue = input.AppId;
1029
- if (labelValue.length <= 0) {
1030
- throw new Error("Empty value provided for input HTTP label: AppId.");
1031
- }
1032
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
1033
- }
1034
- else {
1035
- throw new Error("No value provided for input HTTP label: AppId.");
1036
- }
667
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
1037
668
  return [2, new __HttpRequest({
1038
669
  protocol: protocol,
1039
670
  hostname: hostname,
@@ -1047,7 +678,7 @@ export var serializeAws_restJson1RemoveBackendConfigCommand = function (input, c
1047
678
  });
1048
679
  }); };
1049
680
  export var serializeAws_restJson1UpdateBackendAPICommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1050
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
681
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1051
682
  return __generator(this, function (_c) {
1052
683
  switch (_c.label) {
1053
684
  case 0: return [4, context.endpoint()];
@@ -1058,26 +689,8 @@ export var serializeAws_restJson1UpdateBackendAPICommand = function (input, cont
1058
689
  };
1059
690
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1060
691
  "/backend/{AppId}/api/{BackendEnvironmentName}";
1061
- if (input.AppId !== undefined) {
1062
- labelValue = input.AppId;
1063
- if (labelValue.length <= 0) {
1064
- throw new Error("Empty value provided for input HTTP label: AppId.");
1065
- }
1066
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
1067
- }
1068
- else {
1069
- throw new Error("No value provided for input HTTP label: AppId.");
1070
- }
1071
- if (input.BackendEnvironmentName !== undefined) {
1072
- labelValue = input.BackendEnvironmentName;
1073
- if (labelValue.length <= 0) {
1074
- throw new Error("Empty value provided for input HTTP label: BackendEnvironmentName.");
1075
- }
1076
- resolvedPath = resolvedPath.replace("{BackendEnvironmentName}", __extendedEncodeURIComponent(labelValue));
1077
- }
1078
- else {
1079
- throw new Error("No value provided for input HTTP label: BackendEnvironmentName.");
1080
- }
692
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
693
+ resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", function () { return input.BackendEnvironmentName; }, "{BackendEnvironmentName}", false);
1081
694
  body = JSON.stringify(__assign(__assign({}, (input.ResourceConfig != null && {
1082
695
  resourceConfig: serializeAws_restJson1BackendAPIResourceConfig(input.ResourceConfig, context),
1083
696
  })), (input.ResourceName != null && { resourceName: input.ResourceName })));
@@ -1094,7 +707,7 @@ export var serializeAws_restJson1UpdateBackendAPICommand = function (input, cont
1094
707
  });
1095
708
  }); };
1096
709
  export var serializeAws_restJson1UpdateBackendAuthCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1097
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
710
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1098
711
  return __generator(this, function (_c) {
1099
712
  switch (_c.label) {
1100
713
  case 0: return [4, context.endpoint()];
@@ -1105,26 +718,8 @@ export var serializeAws_restJson1UpdateBackendAuthCommand = function (input, con
1105
718
  };
1106
719
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1107
720
  "/backend/{AppId}/auth/{BackendEnvironmentName}";
1108
- if (input.AppId !== undefined) {
1109
- labelValue = input.AppId;
1110
- if (labelValue.length <= 0) {
1111
- throw new Error("Empty value provided for input HTTP label: AppId.");
1112
- }
1113
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
1114
- }
1115
- else {
1116
- throw new Error("No value provided for input HTTP label: AppId.");
1117
- }
1118
- if (input.BackendEnvironmentName !== undefined) {
1119
- labelValue = input.BackendEnvironmentName;
1120
- if (labelValue.length <= 0) {
1121
- throw new Error("Empty value provided for input HTTP label: BackendEnvironmentName.");
1122
- }
1123
- resolvedPath = resolvedPath.replace("{BackendEnvironmentName}", __extendedEncodeURIComponent(labelValue));
1124
- }
1125
- else {
1126
- throw new Error("No value provided for input HTTP label: BackendEnvironmentName.");
1127
- }
721
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
722
+ resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", function () { return input.BackendEnvironmentName; }, "{BackendEnvironmentName}", false);
1128
723
  body = JSON.stringify(__assign(__assign({}, (input.ResourceConfig != null && {
1129
724
  resourceConfig: serializeAws_restJson1UpdateBackendAuthResourceConfig(input.ResourceConfig, context),
1130
725
  })), (input.ResourceName != null && { resourceName: input.ResourceName })));
@@ -1141,7 +736,7 @@ export var serializeAws_restJson1UpdateBackendAuthCommand = function (input, con
1141
736
  });
1142
737
  }); };
1143
738
  export var serializeAws_restJson1UpdateBackendConfigCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1144
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
739
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1145
740
  return __generator(this, function (_c) {
1146
741
  switch (_c.label) {
1147
742
  case 0: return [4, context.endpoint()];
@@ -1151,16 +746,7 @@ export var serializeAws_restJson1UpdateBackendConfigCommand = function (input, c
1151
746
  "content-type": "application/json",
1152
747
  };
1153
748
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/backend/{AppId}/config/update";
1154
- if (input.AppId !== undefined) {
1155
- labelValue = input.AppId;
1156
- if (labelValue.length <= 0) {
1157
- throw new Error("Empty value provided for input HTTP label: AppId.");
1158
- }
1159
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
1160
- }
1161
- else {
1162
- throw new Error("No value provided for input HTTP label: AppId.");
1163
- }
749
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
1164
750
  body = JSON.stringify(__assign({}, (input.LoginAuthConfig != null && {
1165
751
  loginAuthConfig: serializeAws_restJson1LoginAuthConfigReqObj(input.LoginAuthConfig, context),
1166
752
  })));
@@ -1177,7 +763,7 @@ export var serializeAws_restJson1UpdateBackendConfigCommand = function (input, c
1177
763
  });
1178
764
  }); };
1179
765
  export var serializeAws_restJson1UpdateBackendJobCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1180
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, body;
766
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1181
767
  return __generator(this, function (_c) {
1182
768
  switch (_c.label) {
1183
769
  case 0: return [4, context.endpoint()];
@@ -1188,36 +774,9 @@ export var serializeAws_restJson1UpdateBackendJobCommand = function (input, cont
1188
774
  };
1189
775
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1190
776
  "/backend/{AppId}/job/{BackendEnvironmentName}/{JobId}";
1191
- if (input.AppId !== undefined) {
1192
- labelValue = input.AppId;
1193
- if (labelValue.length <= 0) {
1194
- throw new Error("Empty value provided for input HTTP label: AppId.");
1195
- }
1196
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
1197
- }
1198
- else {
1199
- throw new Error("No value provided for input HTTP label: AppId.");
1200
- }
1201
- if (input.BackendEnvironmentName !== undefined) {
1202
- labelValue = input.BackendEnvironmentName;
1203
- if (labelValue.length <= 0) {
1204
- throw new Error("Empty value provided for input HTTP label: BackendEnvironmentName.");
1205
- }
1206
- resolvedPath = resolvedPath.replace("{BackendEnvironmentName}", __extendedEncodeURIComponent(labelValue));
1207
- }
1208
- else {
1209
- throw new Error("No value provided for input HTTP label: BackendEnvironmentName.");
1210
- }
1211
- if (input.JobId !== undefined) {
1212
- labelValue = input.JobId;
1213
- if (labelValue.length <= 0) {
1214
- throw new Error("Empty value provided for input HTTP label: JobId.");
1215
- }
1216
- resolvedPath = resolvedPath.replace("{JobId}", __extendedEncodeURIComponent(labelValue));
1217
- }
1218
- else {
1219
- throw new Error("No value provided for input HTTP label: JobId.");
1220
- }
777
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
778
+ resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", function () { return input.BackendEnvironmentName; }, "{BackendEnvironmentName}", false);
779
+ resolvedPath = __resolvedPath(resolvedPath, input, "JobId", function () { return input.JobId; }, "{JobId}", false);
1221
780
  body = JSON.stringify(__assign(__assign({}, (input.Operation != null && { operation: input.Operation })), (input.Status != null && { status: input.Status })));
1222
781
  return [2, new __HttpRequest({
1223
782
  protocol: protocol,
@@ -1232,7 +791,7 @@ export var serializeAws_restJson1UpdateBackendJobCommand = function (input, cont
1232
791
  });
1233
792
  }); };
1234
793
  export var serializeAws_restJson1UpdateBackendStorageCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1235
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
794
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1236
795
  return __generator(this, function (_c) {
1237
796
  switch (_c.label) {
1238
797
  case 0: return [4, context.endpoint()];
@@ -1243,26 +802,8 @@ export var serializeAws_restJson1UpdateBackendStorageCommand = function (input,
1243
802
  };
1244
803
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1245
804
  "/backend/{AppId}/storage/{BackendEnvironmentName}";
1246
- if (input.AppId !== undefined) {
1247
- labelValue = input.AppId;
1248
- if (labelValue.length <= 0) {
1249
- throw new Error("Empty value provided for input HTTP label: AppId.");
1250
- }
1251
- resolvedPath = resolvedPath.replace("{AppId}", __extendedEncodeURIComponent(labelValue));
1252
- }
1253
- else {
1254
- throw new Error("No value provided for input HTTP label: AppId.");
1255
- }
1256
- if (input.BackendEnvironmentName !== undefined) {
1257
- labelValue = input.BackendEnvironmentName;
1258
- if (labelValue.length <= 0) {
1259
- throw new Error("Empty value provided for input HTTP label: BackendEnvironmentName.");
1260
- }
1261
- resolvedPath = resolvedPath.replace("{BackendEnvironmentName}", __extendedEncodeURIComponent(labelValue));
1262
- }
1263
- else {
1264
- throw new Error("No value provided for input HTTP label: BackendEnvironmentName.");
1265
- }
805
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppId", function () { return input.AppId; }, "{AppId}", false);
806
+ resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", function () { return input.BackendEnvironmentName; }, "{BackendEnvironmentName}", false);
1266
807
  body = JSON.stringify(__assign(__assign({}, (input.ResourceConfig != null && {
1267
808
  resourceConfig: serializeAws_restJson1UpdateBackendStorageResourceConfig(input.ResourceConfig, context),
1268
809
  })), (input.ResourceName != null && { resourceName: input.ResourceName })));
@@ -1286,44 +827,38 @@ export var deserializeAws_restJson1CloneBackendCommand = function (output, conte
1286
827
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1287
828
  return [2, deserializeAws_restJson1CloneBackendCommandError(output, context)];
1288
829
  }
1289
- contents = {
830
+ contents = map({
1290
831
  $metadata: deserializeMetadata(output),
1291
- AppId: undefined,
1292
- BackendEnvironmentName: undefined,
1293
- Error: undefined,
1294
- JobId: undefined,
1295
- Operation: undefined,
1296
- Status: undefined,
1297
- };
832
+ });
1298
833
  _a = __expectNonNull;
1299
834
  _b = __expectObject;
1300
835
  return [4, parseBody(output.body, context)];
1301
836
  case 1:
1302
837
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1303
- if (data.appId !== undefined && data.appId !== null) {
838
+ if (data.appId != null) {
1304
839
  contents.AppId = __expectString(data.appId);
1305
840
  }
1306
- if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
841
+ if (data.backendEnvironmentName != null) {
1307
842
  contents.BackendEnvironmentName = __expectString(data.backendEnvironmentName);
1308
843
  }
1309
- if (data.error !== undefined && data.error !== null) {
844
+ if (data.error != null) {
1310
845
  contents.Error = __expectString(data.error);
1311
846
  }
1312
- if (data.jobId !== undefined && data.jobId !== null) {
847
+ if (data.jobId != null) {
1313
848
  contents.JobId = __expectString(data.jobId);
1314
849
  }
1315
- if (data.operation !== undefined && data.operation !== null) {
850
+ if (data.operation != null) {
1316
851
  contents.Operation = __expectString(data.operation);
1317
852
  }
1318
- if (data.status !== undefined && data.status !== null) {
853
+ if (data.status != null) {
1319
854
  contents.Status = __expectString(data.status);
1320
855
  }
1321
- return [2, Promise.resolve(contents)];
856
+ return [2, contents];
1322
857
  }
1323
858
  });
1324
859
  }); };
1325
860
  var deserializeAws_restJson1CloneBackendCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1326
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
861
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1327
862
  var _c;
1328
863
  return __generator(this, function (_d) {
1329
864
  switch (_d.label) {
@@ -1356,14 +891,14 @@ var deserializeAws_restJson1CloneBackendCommandError = function (output, context
1356
891
  case 9: throw _d.sent();
1357
892
  case 10:
1358
893
  parsedBody = parsedOutput.body;
1359
- $metadata = deserializeMetadata(output);
1360
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1361
- response = new __BaseException({
1362
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1363
- $fault: "client",
1364
- $metadata: $metadata,
894
+ throwDefaultError({
895
+ output: output,
896
+ parsedBody: parsedBody,
897
+ exceptionCtor: __BaseException,
898
+ errorCode: errorCode,
1365
899
  });
1366
- throw __decorateServiceException(response, parsedBody);
900
+ _d.label = 11;
901
+ case 11: return [2];
1367
902
  }
1368
903
  });
1369
904
  }); };
@@ -1375,44 +910,38 @@ export var deserializeAws_restJson1CreateBackendCommand = function (output, cont
1375
910
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1376
911
  return [2, deserializeAws_restJson1CreateBackendCommandError(output, context)];
1377
912
  }
1378
- contents = {
913
+ contents = map({
1379
914
  $metadata: deserializeMetadata(output),
1380
- AppId: undefined,
1381
- BackendEnvironmentName: undefined,
1382
- Error: undefined,
1383
- JobId: undefined,
1384
- Operation: undefined,
1385
- Status: undefined,
1386
- };
915
+ });
1387
916
  _a = __expectNonNull;
1388
917
  _b = __expectObject;
1389
918
  return [4, parseBody(output.body, context)];
1390
919
  case 1:
1391
920
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1392
- if (data.appId !== undefined && data.appId !== null) {
921
+ if (data.appId != null) {
1393
922
  contents.AppId = __expectString(data.appId);
1394
923
  }
1395
- if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
924
+ if (data.backendEnvironmentName != null) {
1396
925
  contents.BackendEnvironmentName = __expectString(data.backendEnvironmentName);
1397
926
  }
1398
- if (data.error !== undefined && data.error !== null) {
927
+ if (data.error != null) {
1399
928
  contents.Error = __expectString(data.error);
1400
929
  }
1401
- if (data.jobId !== undefined && data.jobId !== null) {
930
+ if (data.jobId != null) {
1402
931
  contents.JobId = __expectString(data.jobId);
1403
932
  }
1404
- if (data.operation !== undefined && data.operation !== null) {
933
+ if (data.operation != null) {
1405
934
  contents.Operation = __expectString(data.operation);
1406
935
  }
1407
- if (data.status !== undefined && data.status !== null) {
936
+ if (data.status != null) {
1408
937
  contents.Status = __expectString(data.status);
1409
938
  }
1410
- return [2, Promise.resolve(contents)];
939
+ return [2, contents];
1411
940
  }
1412
941
  });
1413
942
  }); };
1414
943
  var deserializeAws_restJson1CreateBackendCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1415
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
944
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1416
945
  var _c;
1417
946
  return __generator(this, function (_d) {
1418
947
  switch (_d.label) {
@@ -1445,14 +974,14 @@ var deserializeAws_restJson1CreateBackendCommandError = function (output, contex
1445
974
  case 9: throw _d.sent();
1446
975
  case 10:
1447
976
  parsedBody = parsedOutput.body;
1448
- $metadata = deserializeMetadata(output);
1449
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1450
- response = new __BaseException({
1451
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1452
- $fault: "client",
1453
- $metadata: $metadata,
977
+ throwDefaultError({
978
+ output: output,
979
+ parsedBody: parsedBody,
980
+ exceptionCtor: __BaseException,
981
+ errorCode: errorCode,
1454
982
  });
1455
- throw __decorateServiceException(response, parsedBody);
983
+ _d.label = 11;
984
+ case 11: return [2];
1456
985
  }
1457
986
  });
1458
987
  }); };
@@ -1464,44 +993,38 @@ export var deserializeAws_restJson1CreateBackendAPICommand = function (output, c
1464
993
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1465
994
  return [2, deserializeAws_restJson1CreateBackendAPICommandError(output, context)];
1466
995
  }
1467
- contents = {
996
+ contents = map({
1468
997
  $metadata: deserializeMetadata(output),
1469
- AppId: undefined,
1470
- BackendEnvironmentName: undefined,
1471
- Error: undefined,
1472
- JobId: undefined,
1473
- Operation: undefined,
1474
- Status: undefined,
1475
- };
998
+ });
1476
999
  _a = __expectNonNull;
1477
1000
  _b = __expectObject;
1478
1001
  return [4, parseBody(output.body, context)];
1479
1002
  case 1:
1480
1003
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1481
- if (data.appId !== undefined && data.appId !== null) {
1004
+ if (data.appId != null) {
1482
1005
  contents.AppId = __expectString(data.appId);
1483
1006
  }
1484
- if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
1007
+ if (data.backendEnvironmentName != null) {
1485
1008
  contents.BackendEnvironmentName = __expectString(data.backendEnvironmentName);
1486
1009
  }
1487
- if (data.error !== undefined && data.error !== null) {
1010
+ if (data.error != null) {
1488
1011
  contents.Error = __expectString(data.error);
1489
1012
  }
1490
- if (data.jobId !== undefined && data.jobId !== null) {
1013
+ if (data.jobId != null) {
1491
1014
  contents.JobId = __expectString(data.jobId);
1492
1015
  }
1493
- if (data.operation !== undefined && data.operation !== null) {
1016
+ if (data.operation != null) {
1494
1017
  contents.Operation = __expectString(data.operation);
1495
1018
  }
1496
- if (data.status !== undefined && data.status !== null) {
1019
+ if (data.status != null) {
1497
1020
  contents.Status = __expectString(data.status);
1498
1021
  }
1499
- return [2, Promise.resolve(contents)];
1022
+ return [2, contents];
1500
1023
  }
1501
1024
  });
1502
1025
  }); };
1503
1026
  var deserializeAws_restJson1CreateBackendAPICommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1504
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1027
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1505
1028
  var _c;
1506
1029
  return __generator(this, function (_d) {
1507
1030
  switch (_d.label) {
@@ -1534,14 +1057,14 @@ var deserializeAws_restJson1CreateBackendAPICommandError = function (output, con
1534
1057
  case 9: throw _d.sent();
1535
1058
  case 10:
1536
1059
  parsedBody = parsedOutput.body;
1537
- $metadata = deserializeMetadata(output);
1538
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1539
- response = new __BaseException({
1540
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1541
- $fault: "client",
1542
- $metadata: $metadata,
1060
+ throwDefaultError({
1061
+ output: output,
1062
+ parsedBody: parsedBody,
1063
+ exceptionCtor: __BaseException,
1064
+ errorCode: errorCode,
1543
1065
  });
1544
- throw __decorateServiceException(response, parsedBody);
1066
+ _d.label = 11;
1067
+ case 11: return [2];
1545
1068
  }
1546
1069
  });
1547
1070
  }); };
@@ -1553,44 +1076,38 @@ export var deserializeAws_restJson1CreateBackendAuthCommand = function (output,
1553
1076
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1554
1077
  return [2, deserializeAws_restJson1CreateBackendAuthCommandError(output, context)];
1555
1078
  }
1556
- contents = {
1079
+ contents = map({
1557
1080
  $metadata: deserializeMetadata(output),
1558
- AppId: undefined,
1559
- BackendEnvironmentName: undefined,
1560
- Error: undefined,
1561
- JobId: undefined,
1562
- Operation: undefined,
1563
- Status: undefined,
1564
- };
1081
+ });
1565
1082
  _a = __expectNonNull;
1566
1083
  _b = __expectObject;
1567
1084
  return [4, parseBody(output.body, context)];
1568
1085
  case 1:
1569
1086
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1570
- if (data.appId !== undefined && data.appId !== null) {
1087
+ if (data.appId != null) {
1571
1088
  contents.AppId = __expectString(data.appId);
1572
1089
  }
1573
- if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
1090
+ if (data.backendEnvironmentName != null) {
1574
1091
  contents.BackendEnvironmentName = __expectString(data.backendEnvironmentName);
1575
1092
  }
1576
- if (data.error !== undefined && data.error !== null) {
1093
+ if (data.error != null) {
1577
1094
  contents.Error = __expectString(data.error);
1578
1095
  }
1579
- if (data.jobId !== undefined && data.jobId !== null) {
1096
+ if (data.jobId != null) {
1580
1097
  contents.JobId = __expectString(data.jobId);
1581
1098
  }
1582
- if (data.operation !== undefined && data.operation !== null) {
1099
+ if (data.operation != null) {
1583
1100
  contents.Operation = __expectString(data.operation);
1584
1101
  }
1585
- if (data.status !== undefined && data.status !== null) {
1102
+ if (data.status != null) {
1586
1103
  contents.Status = __expectString(data.status);
1587
1104
  }
1588
- return [2, Promise.resolve(contents)];
1105
+ return [2, contents];
1589
1106
  }
1590
1107
  });
1591
1108
  }); };
1592
1109
  var deserializeAws_restJson1CreateBackendAuthCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1593
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1110
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1594
1111
  var _c;
1595
1112
  return __generator(this, function (_d) {
1596
1113
  switch (_d.label) {
@@ -1623,14 +1140,14 @@ var deserializeAws_restJson1CreateBackendAuthCommandError = function (output, co
1623
1140
  case 9: throw _d.sent();
1624
1141
  case 10:
1625
1142
  parsedBody = parsedOutput.body;
1626
- $metadata = deserializeMetadata(output);
1627
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1628
- response = new __BaseException({
1629
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1630
- $fault: "client",
1631
- $metadata: $metadata,
1143
+ throwDefaultError({
1144
+ output: output,
1145
+ parsedBody: parsedBody,
1146
+ exceptionCtor: __BaseException,
1147
+ errorCode: errorCode,
1632
1148
  });
1633
- throw __decorateServiceException(response, parsedBody);
1149
+ _d.label = 11;
1150
+ case 11: return [2];
1634
1151
  }
1635
1152
  });
1636
1153
  }); };
@@ -1642,36 +1159,32 @@ export var deserializeAws_restJson1CreateBackendConfigCommand = function (output
1642
1159
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1643
1160
  return [2, deserializeAws_restJson1CreateBackendConfigCommandError(output, context)];
1644
1161
  }
1645
- contents = {
1162
+ contents = map({
1646
1163
  $metadata: deserializeMetadata(output),
1647
- AppId: undefined,
1648
- BackendEnvironmentName: undefined,
1649
- JobId: undefined,
1650
- Status: undefined,
1651
- };
1164
+ });
1652
1165
  _a = __expectNonNull;
1653
1166
  _b = __expectObject;
1654
1167
  return [4, parseBody(output.body, context)];
1655
1168
  case 1:
1656
1169
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1657
- if (data.appId !== undefined && data.appId !== null) {
1170
+ if (data.appId != null) {
1658
1171
  contents.AppId = __expectString(data.appId);
1659
1172
  }
1660
- if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
1173
+ if (data.backendEnvironmentName != null) {
1661
1174
  contents.BackendEnvironmentName = __expectString(data.backendEnvironmentName);
1662
1175
  }
1663
- if (data.jobId !== undefined && data.jobId !== null) {
1176
+ if (data.jobId != null) {
1664
1177
  contents.JobId = __expectString(data.jobId);
1665
1178
  }
1666
- if (data.status !== undefined && data.status !== null) {
1179
+ if (data.status != null) {
1667
1180
  contents.Status = __expectString(data.status);
1668
1181
  }
1669
- return [2, Promise.resolve(contents)];
1182
+ return [2, contents];
1670
1183
  }
1671
1184
  });
1672
1185
  }); };
1673
1186
  var deserializeAws_restJson1CreateBackendConfigCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1674
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1187
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1675
1188
  var _c;
1676
1189
  return __generator(this, function (_d) {
1677
1190
  switch (_d.label) {
@@ -1704,14 +1217,14 @@ var deserializeAws_restJson1CreateBackendConfigCommandError = function (output,
1704
1217
  case 9: throw _d.sent();
1705
1218
  case 10:
1706
1219
  parsedBody = parsedOutput.body;
1707
- $metadata = deserializeMetadata(output);
1708
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1709
- response = new __BaseException({
1710
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1711
- $fault: "client",
1712
- $metadata: $metadata,
1220
+ throwDefaultError({
1221
+ output: output,
1222
+ parsedBody: parsedBody,
1223
+ exceptionCtor: __BaseException,
1224
+ errorCode: errorCode,
1713
1225
  });
1714
- throw __decorateServiceException(response, parsedBody);
1226
+ _d.label = 11;
1227
+ case 11: return [2];
1715
1228
  }
1716
1229
  });
1717
1230
  }); };
@@ -1723,36 +1236,32 @@ export var deserializeAws_restJson1CreateBackendStorageCommand = function (outpu
1723
1236
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1724
1237
  return [2, deserializeAws_restJson1CreateBackendStorageCommandError(output, context)];
1725
1238
  }
1726
- contents = {
1239
+ contents = map({
1727
1240
  $metadata: deserializeMetadata(output),
1728
- AppId: undefined,
1729
- BackendEnvironmentName: undefined,
1730
- JobId: undefined,
1731
- Status: undefined,
1732
- };
1241
+ });
1733
1242
  _a = __expectNonNull;
1734
1243
  _b = __expectObject;
1735
1244
  return [4, parseBody(output.body, context)];
1736
1245
  case 1:
1737
1246
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1738
- if (data.appId !== undefined && data.appId !== null) {
1247
+ if (data.appId != null) {
1739
1248
  contents.AppId = __expectString(data.appId);
1740
1249
  }
1741
- if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
1250
+ if (data.backendEnvironmentName != null) {
1742
1251
  contents.BackendEnvironmentName = __expectString(data.backendEnvironmentName);
1743
1252
  }
1744
- if (data.jobId !== undefined && data.jobId !== null) {
1253
+ if (data.jobId != null) {
1745
1254
  contents.JobId = __expectString(data.jobId);
1746
1255
  }
1747
- if (data.status !== undefined && data.status !== null) {
1256
+ if (data.status != null) {
1748
1257
  contents.Status = __expectString(data.status);
1749
1258
  }
1750
- return [2, Promise.resolve(contents)];
1259
+ return [2, contents];
1751
1260
  }
1752
1261
  });
1753
1262
  }); };
1754
1263
  var deserializeAws_restJson1CreateBackendStorageCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1755
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1264
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1756
1265
  var _c;
1757
1266
  return __generator(this, function (_d) {
1758
1267
  switch (_d.label) {
@@ -1785,14 +1294,14 @@ var deserializeAws_restJson1CreateBackendStorageCommandError = function (output,
1785
1294
  case 9: throw _d.sent();
1786
1295
  case 10:
1787
1296
  parsedBody = parsedOutput.body;
1788
- $metadata = deserializeMetadata(output);
1789
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1790
- response = new __BaseException({
1791
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1792
- $fault: "client",
1793
- $metadata: $metadata,
1297
+ throwDefaultError({
1298
+ output: output,
1299
+ parsedBody: parsedBody,
1300
+ exceptionCtor: __BaseException,
1301
+ errorCode: errorCode,
1794
1302
  });
1795
- throw __decorateServiceException(response, parsedBody);
1303
+ _d.label = 11;
1304
+ case 11: return [2];
1796
1305
  }
1797
1306
  });
1798
1307
  }); };
@@ -1804,36 +1313,32 @@ export var deserializeAws_restJson1CreateTokenCommand = function (output, contex
1804
1313
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1805
1314
  return [2, deserializeAws_restJson1CreateTokenCommandError(output, context)];
1806
1315
  }
1807
- contents = {
1316
+ contents = map({
1808
1317
  $metadata: deserializeMetadata(output),
1809
- AppId: undefined,
1810
- ChallengeCode: undefined,
1811
- SessionId: undefined,
1812
- Ttl: undefined,
1813
- };
1318
+ });
1814
1319
  _a = __expectNonNull;
1815
1320
  _b = __expectObject;
1816
1321
  return [4, parseBody(output.body, context)];
1817
1322
  case 1:
1818
1323
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1819
- if (data.appId !== undefined && data.appId !== null) {
1324
+ if (data.appId != null) {
1820
1325
  contents.AppId = __expectString(data.appId);
1821
1326
  }
1822
- if (data.challengeCode !== undefined && data.challengeCode !== null) {
1327
+ if (data.challengeCode != null) {
1823
1328
  contents.ChallengeCode = __expectString(data.challengeCode);
1824
1329
  }
1825
- if (data.sessionId !== undefined && data.sessionId !== null) {
1330
+ if (data.sessionId != null) {
1826
1331
  contents.SessionId = __expectString(data.sessionId);
1827
1332
  }
1828
- if (data.ttl !== undefined && data.ttl !== null) {
1333
+ if (data.ttl != null) {
1829
1334
  contents.Ttl = __expectString(data.ttl);
1830
1335
  }
1831
- return [2, Promise.resolve(contents)];
1336
+ return [2, contents];
1832
1337
  }
1833
1338
  });
1834
1339
  }); };
1835
1340
  var deserializeAws_restJson1CreateTokenCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1836
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1341
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1837
1342
  var _c;
1838
1343
  return __generator(this, function (_d) {
1839
1344
  switch (_d.label) {
@@ -1866,14 +1371,14 @@ var deserializeAws_restJson1CreateTokenCommandError = function (output, context)
1866
1371
  case 9: throw _d.sent();
1867
1372
  case 10:
1868
1373
  parsedBody = parsedOutput.body;
1869
- $metadata = deserializeMetadata(output);
1870
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1871
- response = new __BaseException({
1872
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1873
- $fault: "client",
1874
- $metadata: $metadata,
1374
+ throwDefaultError({
1375
+ output: output,
1376
+ parsedBody: parsedBody,
1377
+ exceptionCtor: __BaseException,
1378
+ errorCode: errorCode,
1875
1379
  });
1876
- throw __decorateServiceException(response, parsedBody);
1380
+ _d.label = 11;
1381
+ case 11: return [2];
1877
1382
  }
1878
1383
  });
1879
1384
  }); };
@@ -1885,44 +1390,38 @@ export var deserializeAws_restJson1DeleteBackendCommand = function (output, cont
1885
1390
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1886
1391
  return [2, deserializeAws_restJson1DeleteBackendCommandError(output, context)];
1887
1392
  }
1888
- contents = {
1393
+ contents = map({
1889
1394
  $metadata: deserializeMetadata(output),
1890
- AppId: undefined,
1891
- BackendEnvironmentName: undefined,
1892
- Error: undefined,
1893
- JobId: undefined,
1894
- Operation: undefined,
1895
- Status: undefined,
1896
- };
1395
+ });
1897
1396
  _a = __expectNonNull;
1898
1397
  _b = __expectObject;
1899
1398
  return [4, parseBody(output.body, context)];
1900
1399
  case 1:
1901
1400
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1902
- if (data.appId !== undefined && data.appId !== null) {
1401
+ if (data.appId != null) {
1903
1402
  contents.AppId = __expectString(data.appId);
1904
1403
  }
1905
- if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
1404
+ if (data.backendEnvironmentName != null) {
1906
1405
  contents.BackendEnvironmentName = __expectString(data.backendEnvironmentName);
1907
1406
  }
1908
- if (data.error !== undefined && data.error !== null) {
1407
+ if (data.error != null) {
1909
1408
  contents.Error = __expectString(data.error);
1910
1409
  }
1911
- if (data.jobId !== undefined && data.jobId !== null) {
1410
+ if (data.jobId != null) {
1912
1411
  contents.JobId = __expectString(data.jobId);
1913
1412
  }
1914
- if (data.operation !== undefined && data.operation !== null) {
1413
+ if (data.operation != null) {
1915
1414
  contents.Operation = __expectString(data.operation);
1916
1415
  }
1917
- if (data.status !== undefined && data.status !== null) {
1416
+ if (data.status != null) {
1918
1417
  contents.Status = __expectString(data.status);
1919
1418
  }
1920
- return [2, Promise.resolve(contents)];
1419
+ return [2, contents];
1921
1420
  }
1922
1421
  });
1923
1422
  }); };
1924
1423
  var deserializeAws_restJson1DeleteBackendCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1925
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1424
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1926
1425
  var _c;
1927
1426
  return __generator(this, function (_d) {
1928
1427
  switch (_d.label) {
@@ -1955,14 +1454,14 @@ var deserializeAws_restJson1DeleteBackendCommandError = function (output, contex
1955
1454
  case 9: throw _d.sent();
1956
1455
  case 10:
1957
1456
  parsedBody = parsedOutput.body;
1958
- $metadata = deserializeMetadata(output);
1959
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1960
- response = new __BaseException({
1961
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1962
- $fault: "client",
1963
- $metadata: $metadata,
1457
+ throwDefaultError({
1458
+ output: output,
1459
+ parsedBody: parsedBody,
1460
+ exceptionCtor: __BaseException,
1461
+ errorCode: errorCode,
1964
1462
  });
1965
- throw __decorateServiceException(response, parsedBody);
1463
+ _d.label = 11;
1464
+ case 11: return [2];
1966
1465
  }
1967
1466
  });
1968
1467
  }); };
@@ -1974,44 +1473,38 @@ export var deserializeAws_restJson1DeleteBackendAPICommand = function (output, c
1974
1473
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1975
1474
  return [2, deserializeAws_restJson1DeleteBackendAPICommandError(output, context)];
1976
1475
  }
1977
- contents = {
1476
+ contents = map({
1978
1477
  $metadata: deserializeMetadata(output),
1979
- AppId: undefined,
1980
- BackendEnvironmentName: undefined,
1981
- Error: undefined,
1982
- JobId: undefined,
1983
- Operation: undefined,
1984
- Status: undefined,
1985
- };
1478
+ });
1986
1479
  _a = __expectNonNull;
1987
1480
  _b = __expectObject;
1988
1481
  return [4, parseBody(output.body, context)];
1989
1482
  case 1:
1990
1483
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1991
- if (data.appId !== undefined && data.appId !== null) {
1484
+ if (data.appId != null) {
1992
1485
  contents.AppId = __expectString(data.appId);
1993
1486
  }
1994
- if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
1487
+ if (data.backendEnvironmentName != null) {
1995
1488
  contents.BackendEnvironmentName = __expectString(data.backendEnvironmentName);
1996
1489
  }
1997
- if (data.error !== undefined && data.error !== null) {
1490
+ if (data.error != null) {
1998
1491
  contents.Error = __expectString(data.error);
1999
1492
  }
2000
- if (data.jobId !== undefined && data.jobId !== null) {
1493
+ if (data.jobId != null) {
2001
1494
  contents.JobId = __expectString(data.jobId);
2002
1495
  }
2003
- if (data.operation !== undefined && data.operation !== null) {
1496
+ if (data.operation != null) {
2004
1497
  contents.Operation = __expectString(data.operation);
2005
1498
  }
2006
- if (data.status !== undefined && data.status !== null) {
1499
+ if (data.status != null) {
2007
1500
  contents.Status = __expectString(data.status);
2008
1501
  }
2009
- return [2, Promise.resolve(contents)];
1502
+ return [2, contents];
2010
1503
  }
2011
1504
  });
2012
1505
  }); };
2013
1506
  var deserializeAws_restJson1DeleteBackendAPICommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2014
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1507
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2015
1508
  var _c;
2016
1509
  return __generator(this, function (_d) {
2017
1510
  switch (_d.label) {
@@ -2044,14 +1537,14 @@ var deserializeAws_restJson1DeleteBackendAPICommandError = function (output, con
2044
1537
  case 9: throw _d.sent();
2045
1538
  case 10:
2046
1539
  parsedBody = parsedOutput.body;
2047
- $metadata = deserializeMetadata(output);
2048
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2049
- response = new __BaseException({
2050
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2051
- $fault: "client",
2052
- $metadata: $metadata,
1540
+ throwDefaultError({
1541
+ output: output,
1542
+ parsedBody: parsedBody,
1543
+ exceptionCtor: __BaseException,
1544
+ errorCode: errorCode,
2053
1545
  });
2054
- throw __decorateServiceException(response, parsedBody);
1546
+ _d.label = 11;
1547
+ case 11: return [2];
2055
1548
  }
2056
1549
  });
2057
1550
  }); };
@@ -2063,44 +1556,38 @@ export var deserializeAws_restJson1DeleteBackendAuthCommand = function (output,
2063
1556
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2064
1557
  return [2, deserializeAws_restJson1DeleteBackendAuthCommandError(output, context)];
2065
1558
  }
2066
- contents = {
1559
+ contents = map({
2067
1560
  $metadata: deserializeMetadata(output),
2068
- AppId: undefined,
2069
- BackendEnvironmentName: undefined,
2070
- Error: undefined,
2071
- JobId: undefined,
2072
- Operation: undefined,
2073
- Status: undefined,
2074
- };
1561
+ });
2075
1562
  _a = __expectNonNull;
2076
1563
  _b = __expectObject;
2077
1564
  return [4, parseBody(output.body, context)];
2078
1565
  case 1:
2079
1566
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2080
- if (data.appId !== undefined && data.appId !== null) {
1567
+ if (data.appId != null) {
2081
1568
  contents.AppId = __expectString(data.appId);
2082
1569
  }
2083
- if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
1570
+ if (data.backendEnvironmentName != null) {
2084
1571
  contents.BackendEnvironmentName = __expectString(data.backendEnvironmentName);
2085
1572
  }
2086
- if (data.error !== undefined && data.error !== null) {
1573
+ if (data.error != null) {
2087
1574
  contents.Error = __expectString(data.error);
2088
1575
  }
2089
- if (data.jobId !== undefined && data.jobId !== null) {
1576
+ if (data.jobId != null) {
2090
1577
  contents.JobId = __expectString(data.jobId);
2091
1578
  }
2092
- if (data.operation !== undefined && data.operation !== null) {
1579
+ if (data.operation != null) {
2093
1580
  contents.Operation = __expectString(data.operation);
2094
1581
  }
2095
- if (data.status !== undefined && data.status !== null) {
1582
+ if (data.status != null) {
2096
1583
  contents.Status = __expectString(data.status);
2097
1584
  }
2098
- return [2, Promise.resolve(contents)];
1585
+ return [2, contents];
2099
1586
  }
2100
1587
  });
2101
1588
  }); };
2102
1589
  var deserializeAws_restJson1DeleteBackendAuthCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2103
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1590
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2104
1591
  var _c;
2105
1592
  return __generator(this, function (_d) {
2106
1593
  switch (_d.label) {
@@ -2133,14 +1620,14 @@ var deserializeAws_restJson1DeleteBackendAuthCommandError = function (output, co
2133
1620
  case 9: throw _d.sent();
2134
1621
  case 10:
2135
1622
  parsedBody = parsedOutput.body;
2136
- $metadata = deserializeMetadata(output);
2137
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2138
- response = new __BaseException({
2139
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2140
- $fault: "client",
2141
- $metadata: $metadata,
1623
+ throwDefaultError({
1624
+ output: output,
1625
+ parsedBody: parsedBody,
1626
+ exceptionCtor: __BaseException,
1627
+ errorCode: errorCode,
2142
1628
  });
2143
- throw __decorateServiceException(response, parsedBody);
1629
+ _d.label = 11;
1630
+ case 11: return [2];
2144
1631
  }
2145
1632
  });
2146
1633
  }); };
@@ -2152,36 +1639,32 @@ export var deserializeAws_restJson1DeleteBackendStorageCommand = function (outpu
2152
1639
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2153
1640
  return [2, deserializeAws_restJson1DeleteBackendStorageCommandError(output, context)];
2154
1641
  }
2155
- contents = {
1642
+ contents = map({
2156
1643
  $metadata: deserializeMetadata(output),
2157
- AppId: undefined,
2158
- BackendEnvironmentName: undefined,
2159
- JobId: undefined,
2160
- Status: undefined,
2161
- };
1644
+ });
2162
1645
  _a = __expectNonNull;
2163
1646
  _b = __expectObject;
2164
1647
  return [4, parseBody(output.body, context)];
2165
1648
  case 1:
2166
1649
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2167
- if (data.appId !== undefined && data.appId !== null) {
1650
+ if (data.appId != null) {
2168
1651
  contents.AppId = __expectString(data.appId);
2169
1652
  }
2170
- if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
1653
+ if (data.backendEnvironmentName != null) {
2171
1654
  contents.BackendEnvironmentName = __expectString(data.backendEnvironmentName);
2172
1655
  }
2173
- if (data.jobId !== undefined && data.jobId !== null) {
1656
+ if (data.jobId != null) {
2174
1657
  contents.JobId = __expectString(data.jobId);
2175
1658
  }
2176
- if (data.status !== undefined && data.status !== null) {
1659
+ if (data.status != null) {
2177
1660
  contents.Status = __expectString(data.status);
2178
1661
  }
2179
- return [2, Promise.resolve(contents)];
1662
+ return [2, contents];
2180
1663
  }
2181
1664
  });
2182
1665
  }); };
2183
1666
  var deserializeAws_restJson1DeleteBackendStorageCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2184
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1667
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2185
1668
  var _c;
2186
1669
  return __generator(this, function (_d) {
2187
1670
  switch (_d.label) {
@@ -2214,14 +1697,14 @@ var deserializeAws_restJson1DeleteBackendStorageCommandError = function (output,
2214
1697
  case 9: throw _d.sent();
2215
1698
  case 10:
2216
1699
  parsedBody = parsedOutput.body;
2217
- $metadata = deserializeMetadata(output);
2218
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2219
- response = new __BaseException({
2220
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2221
- $fault: "client",
2222
- $metadata: $metadata,
1700
+ throwDefaultError({
1701
+ output: output,
1702
+ parsedBody: parsedBody,
1703
+ exceptionCtor: __BaseException,
1704
+ errorCode: errorCode,
2223
1705
  });
2224
- throw __decorateServiceException(response, parsedBody);
1706
+ _d.label = 11;
1707
+ case 11: return [2];
2225
1708
  }
2226
1709
  });
2227
1710
  }); };
@@ -2233,24 +1716,23 @@ export var deserializeAws_restJson1DeleteTokenCommand = function (output, contex
2233
1716
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2234
1717
  return [2, deserializeAws_restJson1DeleteTokenCommandError(output, context)];
2235
1718
  }
2236
- contents = {
1719
+ contents = map({
2237
1720
  $metadata: deserializeMetadata(output),
2238
- IsSuccess: undefined,
2239
- };
1721
+ });
2240
1722
  _a = __expectNonNull;
2241
1723
  _b = __expectObject;
2242
1724
  return [4, parseBody(output.body, context)];
2243
1725
  case 1:
2244
1726
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2245
- if (data.isSuccess !== undefined && data.isSuccess !== null) {
1727
+ if (data.isSuccess != null) {
2246
1728
  contents.IsSuccess = __expectBoolean(data.isSuccess);
2247
1729
  }
2248
- return [2, Promise.resolve(contents)];
1730
+ return [2, contents];
2249
1731
  }
2250
1732
  });
2251
1733
  }); };
2252
1734
  var deserializeAws_restJson1DeleteTokenCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2253
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1735
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2254
1736
  var _c;
2255
1737
  return __generator(this, function (_d) {
2256
1738
  switch (_d.label) {
@@ -2283,14 +1765,14 @@ var deserializeAws_restJson1DeleteTokenCommandError = function (output, context)
2283
1765
  case 9: throw _d.sent();
2284
1766
  case 10:
2285
1767
  parsedBody = parsedOutput.body;
2286
- $metadata = deserializeMetadata(output);
2287
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2288
- response = new __BaseException({
2289
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2290
- $fault: "client",
2291
- $metadata: $metadata,
1768
+ throwDefaultError({
1769
+ output: output,
1770
+ parsedBody: parsedBody,
1771
+ exceptionCtor: __BaseException,
1772
+ errorCode: errorCode,
2292
1773
  });
2293
- throw __decorateServiceException(response, parsedBody);
1774
+ _d.label = 11;
1775
+ case 11: return [2];
2294
1776
  }
2295
1777
  });
2296
1778
  }); };
@@ -2302,44 +1784,38 @@ export var deserializeAws_restJson1GenerateBackendAPIModelsCommand = function (o
2302
1784
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2303
1785
  return [2, deserializeAws_restJson1GenerateBackendAPIModelsCommandError(output, context)];
2304
1786
  }
2305
- contents = {
1787
+ contents = map({
2306
1788
  $metadata: deserializeMetadata(output),
2307
- AppId: undefined,
2308
- BackendEnvironmentName: undefined,
2309
- Error: undefined,
2310
- JobId: undefined,
2311
- Operation: undefined,
2312
- Status: undefined,
2313
- };
1789
+ });
2314
1790
  _a = __expectNonNull;
2315
1791
  _b = __expectObject;
2316
1792
  return [4, parseBody(output.body, context)];
2317
1793
  case 1:
2318
1794
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2319
- if (data.appId !== undefined && data.appId !== null) {
1795
+ if (data.appId != null) {
2320
1796
  contents.AppId = __expectString(data.appId);
2321
1797
  }
2322
- if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
1798
+ if (data.backendEnvironmentName != null) {
2323
1799
  contents.BackendEnvironmentName = __expectString(data.backendEnvironmentName);
2324
1800
  }
2325
- if (data.error !== undefined && data.error !== null) {
1801
+ if (data.error != null) {
2326
1802
  contents.Error = __expectString(data.error);
2327
1803
  }
2328
- if (data.jobId !== undefined && data.jobId !== null) {
1804
+ if (data.jobId != null) {
2329
1805
  contents.JobId = __expectString(data.jobId);
2330
1806
  }
2331
- if (data.operation !== undefined && data.operation !== null) {
1807
+ if (data.operation != null) {
2332
1808
  contents.Operation = __expectString(data.operation);
2333
1809
  }
2334
- if (data.status !== undefined && data.status !== null) {
1810
+ if (data.status != null) {
2335
1811
  contents.Status = __expectString(data.status);
2336
1812
  }
2337
- return [2, Promise.resolve(contents)];
1813
+ return [2, contents];
2338
1814
  }
2339
1815
  });
2340
1816
  }); };
2341
1817
  var deserializeAws_restJson1GenerateBackendAPIModelsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2342
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1818
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2343
1819
  var _c;
2344
1820
  return __generator(this, function (_d) {
2345
1821
  switch (_d.label) {
@@ -2372,14 +1848,14 @@ var deserializeAws_restJson1GenerateBackendAPIModelsCommandError = function (out
2372
1848
  case 9: throw _d.sent();
2373
1849
  case 10:
2374
1850
  parsedBody = parsedOutput.body;
2375
- $metadata = deserializeMetadata(output);
2376
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2377
- response = new __BaseException({
2378
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2379
- $fault: "client",
2380
- $metadata: $metadata,
1851
+ throwDefaultError({
1852
+ output: output,
1853
+ parsedBody: parsedBody,
1854
+ exceptionCtor: __BaseException,
1855
+ errorCode: errorCode,
2381
1856
  });
2382
- throw __decorateServiceException(response, parsedBody);
1857
+ _d.label = 11;
1858
+ case 11: return [2];
2383
1859
  }
2384
1860
  });
2385
1861
  }); };
@@ -2391,48 +1867,41 @@ export var deserializeAws_restJson1GetBackendCommand = function (output, context
2391
1867
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2392
1868
  return [2, deserializeAws_restJson1GetBackendCommandError(output, context)];
2393
1869
  }
2394
- contents = {
1870
+ contents = map({
2395
1871
  $metadata: deserializeMetadata(output),
2396
- AmplifyFeatureFlags: undefined,
2397
- AmplifyMetaConfig: undefined,
2398
- AppId: undefined,
2399
- AppName: undefined,
2400
- BackendEnvironmentList: undefined,
2401
- BackendEnvironmentName: undefined,
2402
- Error: undefined,
2403
- };
1872
+ });
2404
1873
  _a = __expectNonNull;
2405
1874
  _b = __expectObject;
2406
1875
  return [4, parseBody(output.body, context)];
2407
1876
  case 1:
2408
1877
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2409
- if (data.amplifyFeatureFlags !== undefined && data.amplifyFeatureFlags !== null) {
1878
+ if (data.amplifyFeatureFlags != null) {
2410
1879
  contents.AmplifyFeatureFlags = __expectString(data.amplifyFeatureFlags);
2411
1880
  }
2412
- if (data.amplifyMetaConfig !== undefined && data.amplifyMetaConfig !== null) {
1881
+ if (data.amplifyMetaConfig != null) {
2413
1882
  contents.AmplifyMetaConfig = __expectString(data.amplifyMetaConfig);
2414
1883
  }
2415
- if (data.appId !== undefined && data.appId !== null) {
1884
+ if (data.appId != null) {
2416
1885
  contents.AppId = __expectString(data.appId);
2417
1886
  }
2418
- if (data.appName !== undefined && data.appName !== null) {
1887
+ if (data.appName != null) {
2419
1888
  contents.AppName = __expectString(data.appName);
2420
1889
  }
2421
- if (data.backendEnvironmentList !== undefined && data.backendEnvironmentList !== null) {
1890
+ if (data.backendEnvironmentList != null) {
2422
1891
  contents.BackendEnvironmentList = deserializeAws_restJson1ListOf__string(data.backendEnvironmentList, context);
2423
1892
  }
2424
- if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
1893
+ if (data.backendEnvironmentName != null) {
2425
1894
  contents.BackendEnvironmentName = __expectString(data.backendEnvironmentName);
2426
1895
  }
2427
- if (data.error !== undefined && data.error !== null) {
1896
+ if (data.error != null) {
2428
1897
  contents.Error = __expectString(data.error);
2429
1898
  }
2430
- return [2, Promise.resolve(contents)];
1899
+ return [2, contents];
2431
1900
  }
2432
1901
  });
2433
1902
  }); };
2434
1903
  var deserializeAws_restJson1GetBackendCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2435
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1904
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2436
1905
  var _c;
2437
1906
  return __generator(this, function (_d) {
2438
1907
  switch (_d.label) {
@@ -2465,14 +1934,14 @@ var deserializeAws_restJson1GetBackendCommandError = function (output, context)
2465
1934
  case 9: throw _d.sent();
2466
1935
  case 10:
2467
1936
  parsedBody = parsedOutput.body;
2468
- $metadata = deserializeMetadata(output);
2469
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2470
- response = new __BaseException({
2471
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2472
- $fault: "client",
2473
- $metadata: $metadata,
1937
+ throwDefaultError({
1938
+ output: output,
1939
+ parsedBody: parsedBody,
1940
+ exceptionCtor: __BaseException,
1941
+ errorCode: errorCode,
2474
1942
  });
2475
- throw __decorateServiceException(response, parsedBody);
1943
+ _d.label = 11;
1944
+ case 11: return [2];
2476
1945
  }
2477
1946
  });
2478
1947
  }); };
@@ -2484,40 +1953,35 @@ export var deserializeAws_restJson1GetBackendAPICommand = function (output, cont
2484
1953
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2485
1954
  return [2, deserializeAws_restJson1GetBackendAPICommandError(output, context)];
2486
1955
  }
2487
- contents = {
1956
+ contents = map({
2488
1957
  $metadata: deserializeMetadata(output),
2489
- AppId: undefined,
2490
- BackendEnvironmentName: undefined,
2491
- Error: undefined,
2492
- ResourceConfig: undefined,
2493
- ResourceName: undefined,
2494
- };
1958
+ });
2495
1959
  _a = __expectNonNull;
2496
1960
  _b = __expectObject;
2497
1961
  return [4, parseBody(output.body, context)];
2498
1962
  case 1:
2499
1963
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2500
- if (data.appId !== undefined && data.appId !== null) {
1964
+ if (data.appId != null) {
2501
1965
  contents.AppId = __expectString(data.appId);
2502
1966
  }
2503
- if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
1967
+ if (data.backendEnvironmentName != null) {
2504
1968
  contents.BackendEnvironmentName = __expectString(data.backendEnvironmentName);
2505
1969
  }
2506
- if (data.error !== undefined && data.error !== null) {
1970
+ if (data.error != null) {
2507
1971
  contents.Error = __expectString(data.error);
2508
1972
  }
2509
- if (data.resourceConfig !== undefined && data.resourceConfig !== null) {
1973
+ if (data.resourceConfig != null) {
2510
1974
  contents.ResourceConfig = deserializeAws_restJson1BackendAPIResourceConfig(data.resourceConfig, context);
2511
1975
  }
2512
- if (data.resourceName !== undefined && data.resourceName !== null) {
1976
+ if (data.resourceName != null) {
2513
1977
  contents.ResourceName = __expectString(data.resourceName);
2514
1978
  }
2515
- return [2, Promise.resolve(contents)];
1979
+ return [2, contents];
2516
1980
  }
2517
1981
  });
2518
1982
  }); };
2519
1983
  var deserializeAws_restJson1GetBackendAPICommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2520
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1984
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2521
1985
  var _c;
2522
1986
  return __generator(this, function (_d) {
2523
1987
  switch (_d.label) {
@@ -2550,14 +2014,14 @@ var deserializeAws_restJson1GetBackendAPICommandError = function (output, contex
2550
2014
  case 9: throw _d.sent();
2551
2015
  case 10:
2552
2016
  parsedBody = parsedOutput.body;
2553
- $metadata = deserializeMetadata(output);
2554
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2555
- response = new __BaseException({
2556
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2557
- $fault: "client",
2558
- $metadata: $metadata,
2017
+ throwDefaultError({
2018
+ output: output,
2019
+ parsedBody: parsedBody,
2020
+ exceptionCtor: __BaseException,
2021
+ errorCode: errorCode,
2559
2022
  });
2560
- throw __decorateServiceException(response, parsedBody);
2023
+ _d.label = 11;
2024
+ case 11: return [2];
2561
2025
  }
2562
2026
  });
2563
2027
  }); };
@@ -2569,28 +2033,26 @@ export var deserializeAws_restJson1GetBackendAPIModelsCommand = function (output
2569
2033
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2570
2034
  return [2, deserializeAws_restJson1GetBackendAPIModelsCommandError(output, context)];
2571
2035
  }
2572
- contents = {
2036
+ contents = map({
2573
2037
  $metadata: deserializeMetadata(output),
2574
- Models: undefined,
2575
- Status: undefined,
2576
- };
2038
+ });
2577
2039
  _a = __expectNonNull;
2578
2040
  _b = __expectObject;
2579
2041
  return [4, parseBody(output.body, context)];
2580
2042
  case 1:
2581
2043
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2582
- if (data.models !== undefined && data.models !== null) {
2044
+ if (data.models != null) {
2583
2045
  contents.Models = __expectString(data.models);
2584
2046
  }
2585
- if (data.status !== undefined && data.status !== null) {
2047
+ if (data.status != null) {
2586
2048
  contents.Status = __expectString(data.status);
2587
2049
  }
2588
- return [2, Promise.resolve(contents)];
2050
+ return [2, contents];
2589
2051
  }
2590
2052
  });
2591
2053
  }); };
2592
2054
  var deserializeAws_restJson1GetBackendAPIModelsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2593
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2055
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2594
2056
  var _c;
2595
2057
  return __generator(this, function (_d) {
2596
2058
  switch (_d.label) {
@@ -2623,14 +2085,14 @@ var deserializeAws_restJson1GetBackendAPIModelsCommandError = function (output,
2623
2085
  case 9: throw _d.sent();
2624
2086
  case 10:
2625
2087
  parsedBody = parsedOutput.body;
2626
- $metadata = deserializeMetadata(output);
2627
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2628
- response = new __BaseException({
2629
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2630
- $fault: "client",
2631
- $metadata: $metadata,
2088
+ throwDefaultError({
2089
+ output: output,
2090
+ parsedBody: parsedBody,
2091
+ exceptionCtor: __BaseException,
2092
+ errorCode: errorCode,
2632
2093
  });
2633
- throw __decorateServiceException(response, parsedBody);
2094
+ _d.label = 11;
2095
+ case 11: return [2];
2634
2096
  }
2635
2097
  });
2636
2098
  }); };
@@ -2642,40 +2104,35 @@ export var deserializeAws_restJson1GetBackendAuthCommand = function (output, con
2642
2104
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2643
2105
  return [2, deserializeAws_restJson1GetBackendAuthCommandError(output, context)];
2644
2106
  }
2645
- contents = {
2107
+ contents = map({
2646
2108
  $metadata: deserializeMetadata(output),
2647
- AppId: undefined,
2648
- BackendEnvironmentName: undefined,
2649
- Error: undefined,
2650
- ResourceConfig: undefined,
2651
- ResourceName: undefined,
2652
- };
2109
+ });
2653
2110
  _a = __expectNonNull;
2654
2111
  _b = __expectObject;
2655
2112
  return [4, parseBody(output.body, context)];
2656
2113
  case 1:
2657
2114
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2658
- if (data.appId !== undefined && data.appId !== null) {
2115
+ if (data.appId != null) {
2659
2116
  contents.AppId = __expectString(data.appId);
2660
2117
  }
2661
- if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
2118
+ if (data.backendEnvironmentName != null) {
2662
2119
  contents.BackendEnvironmentName = __expectString(data.backendEnvironmentName);
2663
2120
  }
2664
- if (data.error !== undefined && data.error !== null) {
2121
+ if (data.error != null) {
2665
2122
  contents.Error = __expectString(data.error);
2666
2123
  }
2667
- if (data.resourceConfig !== undefined && data.resourceConfig !== null) {
2124
+ if (data.resourceConfig != null) {
2668
2125
  contents.ResourceConfig = deserializeAws_restJson1CreateBackendAuthResourceConfig(data.resourceConfig, context);
2669
2126
  }
2670
- if (data.resourceName !== undefined && data.resourceName !== null) {
2127
+ if (data.resourceName != null) {
2671
2128
  contents.ResourceName = __expectString(data.resourceName);
2672
2129
  }
2673
- return [2, Promise.resolve(contents)];
2130
+ return [2, contents];
2674
2131
  }
2675
2132
  });
2676
2133
  }); };
2677
2134
  var deserializeAws_restJson1GetBackendAuthCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2678
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2135
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2679
2136
  var _c;
2680
2137
  return __generator(this, function (_d) {
2681
2138
  switch (_d.label) {
@@ -2708,14 +2165,14 @@ var deserializeAws_restJson1GetBackendAuthCommandError = function (output, conte
2708
2165
  case 9: throw _d.sent();
2709
2166
  case 10:
2710
2167
  parsedBody = parsedOutput.body;
2711
- $metadata = deserializeMetadata(output);
2712
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2713
- response = new __BaseException({
2714
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2715
- $fault: "client",
2716
- $metadata: $metadata,
2168
+ throwDefaultError({
2169
+ output: output,
2170
+ parsedBody: parsedBody,
2171
+ exceptionCtor: __BaseException,
2172
+ errorCode: errorCode,
2717
2173
  });
2718
- throw __decorateServiceException(response, parsedBody);
2174
+ _d.label = 11;
2175
+ case 11: return [2];
2719
2176
  }
2720
2177
  });
2721
2178
  }); };
@@ -2727,52 +2184,44 @@ export var deserializeAws_restJson1GetBackendJobCommand = function (output, cont
2727
2184
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2728
2185
  return [2, deserializeAws_restJson1GetBackendJobCommandError(output, context)];
2729
2186
  }
2730
- contents = {
2187
+ contents = map({
2731
2188
  $metadata: deserializeMetadata(output),
2732
- AppId: undefined,
2733
- BackendEnvironmentName: undefined,
2734
- CreateTime: undefined,
2735
- Error: undefined,
2736
- JobId: undefined,
2737
- Operation: undefined,
2738
- Status: undefined,
2739
- UpdateTime: undefined,
2740
- };
2189
+ });
2741
2190
  _a = __expectNonNull;
2742
2191
  _b = __expectObject;
2743
2192
  return [4, parseBody(output.body, context)];
2744
2193
  case 1:
2745
2194
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2746
- if (data.appId !== undefined && data.appId !== null) {
2195
+ if (data.appId != null) {
2747
2196
  contents.AppId = __expectString(data.appId);
2748
2197
  }
2749
- if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
2198
+ if (data.backendEnvironmentName != null) {
2750
2199
  contents.BackendEnvironmentName = __expectString(data.backendEnvironmentName);
2751
2200
  }
2752
- if (data.createTime !== undefined && data.createTime !== null) {
2201
+ if (data.createTime != null) {
2753
2202
  contents.CreateTime = __expectString(data.createTime);
2754
2203
  }
2755
- if (data.error !== undefined && data.error !== null) {
2204
+ if (data.error != null) {
2756
2205
  contents.Error = __expectString(data.error);
2757
2206
  }
2758
- if (data.jobId !== undefined && data.jobId !== null) {
2207
+ if (data.jobId != null) {
2759
2208
  contents.JobId = __expectString(data.jobId);
2760
2209
  }
2761
- if (data.operation !== undefined && data.operation !== null) {
2210
+ if (data.operation != null) {
2762
2211
  contents.Operation = __expectString(data.operation);
2763
2212
  }
2764
- if (data.status !== undefined && data.status !== null) {
2213
+ if (data.status != null) {
2765
2214
  contents.Status = __expectString(data.status);
2766
2215
  }
2767
- if (data.updateTime !== undefined && data.updateTime !== null) {
2216
+ if (data.updateTime != null) {
2768
2217
  contents.UpdateTime = __expectString(data.updateTime);
2769
2218
  }
2770
- return [2, Promise.resolve(contents)];
2219
+ return [2, contents];
2771
2220
  }
2772
2221
  });
2773
2222
  }); };
2774
2223
  var deserializeAws_restJson1GetBackendJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2775
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2224
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2776
2225
  var _c;
2777
2226
  return __generator(this, function (_d) {
2778
2227
  switch (_d.label) {
@@ -2805,14 +2254,14 @@ var deserializeAws_restJson1GetBackendJobCommandError = function (output, contex
2805
2254
  case 9: throw _d.sent();
2806
2255
  case 10:
2807
2256
  parsedBody = parsedOutput.body;
2808
- $metadata = deserializeMetadata(output);
2809
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2810
- response = new __BaseException({
2811
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2812
- $fault: "client",
2813
- $metadata: $metadata,
2257
+ throwDefaultError({
2258
+ output: output,
2259
+ parsedBody: parsedBody,
2260
+ exceptionCtor: __BaseException,
2261
+ errorCode: errorCode,
2814
2262
  });
2815
- throw __decorateServiceException(response, parsedBody);
2263
+ _d.label = 11;
2264
+ case 11: return [2];
2816
2265
  }
2817
2266
  });
2818
2267
  }); };
@@ -2824,36 +2273,32 @@ export var deserializeAws_restJson1GetBackendStorageCommand = function (output,
2824
2273
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2825
2274
  return [2, deserializeAws_restJson1GetBackendStorageCommandError(output, context)];
2826
2275
  }
2827
- contents = {
2276
+ contents = map({
2828
2277
  $metadata: deserializeMetadata(output),
2829
- AppId: undefined,
2830
- BackendEnvironmentName: undefined,
2831
- ResourceConfig: undefined,
2832
- ResourceName: undefined,
2833
- };
2278
+ });
2834
2279
  _a = __expectNonNull;
2835
2280
  _b = __expectObject;
2836
2281
  return [4, parseBody(output.body, context)];
2837
2282
  case 1:
2838
2283
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2839
- if (data.appId !== undefined && data.appId !== null) {
2284
+ if (data.appId != null) {
2840
2285
  contents.AppId = __expectString(data.appId);
2841
2286
  }
2842
- if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
2287
+ if (data.backendEnvironmentName != null) {
2843
2288
  contents.BackendEnvironmentName = __expectString(data.backendEnvironmentName);
2844
2289
  }
2845
- if (data.resourceConfig !== undefined && data.resourceConfig !== null) {
2290
+ if (data.resourceConfig != null) {
2846
2291
  contents.ResourceConfig = deserializeAws_restJson1GetBackendStorageResourceConfig(data.resourceConfig, context);
2847
2292
  }
2848
- if (data.resourceName !== undefined && data.resourceName !== null) {
2293
+ if (data.resourceName != null) {
2849
2294
  contents.ResourceName = __expectString(data.resourceName);
2850
2295
  }
2851
- return [2, Promise.resolve(contents)];
2296
+ return [2, contents];
2852
2297
  }
2853
2298
  });
2854
2299
  }); };
2855
2300
  var deserializeAws_restJson1GetBackendStorageCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2856
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2301
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2857
2302
  var _c;
2858
2303
  return __generator(this, function (_d) {
2859
2304
  switch (_d.label) {
@@ -2886,14 +2331,14 @@ var deserializeAws_restJson1GetBackendStorageCommandError = function (output, co
2886
2331
  case 9: throw _d.sent();
2887
2332
  case 10:
2888
2333
  parsedBody = parsedOutput.body;
2889
- $metadata = deserializeMetadata(output);
2890
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2891
- response = new __BaseException({
2892
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2893
- $fault: "client",
2894
- $metadata: $metadata,
2334
+ throwDefaultError({
2335
+ output: output,
2336
+ parsedBody: parsedBody,
2337
+ exceptionCtor: __BaseException,
2338
+ errorCode: errorCode,
2895
2339
  });
2896
- throw __decorateServiceException(response, parsedBody);
2340
+ _d.label = 11;
2341
+ case 11: return [2];
2897
2342
  }
2898
2343
  });
2899
2344
  }); };
@@ -2905,36 +2350,32 @@ export var deserializeAws_restJson1GetTokenCommand = function (output, context)
2905
2350
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2906
2351
  return [2, deserializeAws_restJson1GetTokenCommandError(output, context)];
2907
2352
  }
2908
- contents = {
2353
+ contents = map({
2909
2354
  $metadata: deserializeMetadata(output),
2910
- AppId: undefined,
2911
- ChallengeCode: undefined,
2912
- SessionId: undefined,
2913
- Ttl: undefined,
2914
- };
2355
+ });
2915
2356
  _a = __expectNonNull;
2916
2357
  _b = __expectObject;
2917
2358
  return [4, parseBody(output.body, context)];
2918
2359
  case 1:
2919
2360
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2920
- if (data.appId !== undefined && data.appId !== null) {
2361
+ if (data.appId != null) {
2921
2362
  contents.AppId = __expectString(data.appId);
2922
2363
  }
2923
- if (data.challengeCode !== undefined && data.challengeCode !== null) {
2364
+ if (data.challengeCode != null) {
2924
2365
  contents.ChallengeCode = __expectString(data.challengeCode);
2925
2366
  }
2926
- if (data.sessionId !== undefined && data.sessionId !== null) {
2367
+ if (data.sessionId != null) {
2927
2368
  contents.SessionId = __expectString(data.sessionId);
2928
2369
  }
2929
- if (data.ttl !== undefined && data.ttl !== null) {
2370
+ if (data.ttl != null) {
2930
2371
  contents.Ttl = __expectString(data.ttl);
2931
2372
  }
2932
- return [2, Promise.resolve(contents)];
2373
+ return [2, contents];
2933
2374
  }
2934
2375
  });
2935
2376
  }); };
2936
2377
  var deserializeAws_restJson1GetTokenCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2937
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2378
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2938
2379
  var _c;
2939
2380
  return __generator(this, function (_d) {
2940
2381
  switch (_d.label) {
@@ -2967,14 +2408,14 @@ var deserializeAws_restJson1GetTokenCommandError = function (output, context) {
2967
2408
  case 9: throw _d.sent();
2968
2409
  case 10:
2969
2410
  parsedBody = parsedOutput.body;
2970
- $metadata = deserializeMetadata(output);
2971
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2972
- response = new __BaseException({
2973
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2974
- $fault: "client",
2975
- $metadata: $metadata,
2411
+ throwDefaultError({
2412
+ output: output,
2413
+ parsedBody: parsedBody,
2414
+ exceptionCtor: __BaseException,
2415
+ errorCode: errorCode,
2976
2416
  });
2977
- throw __decorateServiceException(response, parsedBody);
2417
+ _d.label = 11;
2418
+ case 11: return [2];
2978
2419
  }
2979
2420
  });
2980
2421
  }); };
@@ -2986,44 +2427,38 @@ export var deserializeAws_restJson1ImportBackendAuthCommand = function (output,
2986
2427
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2987
2428
  return [2, deserializeAws_restJson1ImportBackendAuthCommandError(output, context)];
2988
2429
  }
2989
- contents = {
2430
+ contents = map({
2990
2431
  $metadata: deserializeMetadata(output),
2991
- AppId: undefined,
2992
- BackendEnvironmentName: undefined,
2993
- Error: undefined,
2994
- JobId: undefined,
2995
- Operation: undefined,
2996
- Status: undefined,
2997
- };
2432
+ });
2998
2433
  _a = __expectNonNull;
2999
2434
  _b = __expectObject;
3000
2435
  return [4, parseBody(output.body, context)];
3001
2436
  case 1:
3002
2437
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3003
- if (data.appId !== undefined && data.appId !== null) {
2438
+ if (data.appId != null) {
3004
2439
  contents.AppId = __expectString(data.appId);
3005
2440
  }
3006
- if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
2441
+ if (data.backendEnvironmentName != null) {
3007
2442
  contents.BackendEnvironmentName = __expectString(data.backendEnvironmentName);
3008
2443
  }
3009
- if (data.error !== undefined && data.error !== null) {
2444
+ if (data.error != null) {
3010
2445
  contents.Error = __expectString(data.error);
3011
2446
  }
3012
- if (data.jobId !== undefined && data.jobId !== null) {
2447
+ if (data.jobId != null) {
3013
2448
  contents.JobId = __expectString(data.jobId);
3014
2449
  }
3015
- if (data.operation !== undefined && data.operation !== null) {
2450
+ if (data.operation != null) {
3016
2451
  contents.Operation = __expectString(data.operation);
3017
2452
  }
3018
- if (data.status !== undefined && data.status !== null) {
2453
+ if (data.status != null) {
3019
2454
  contents.Status = __expectString(data.status);
3020
2455
  }
3021
- return [2, Promise.resolve(contents)];
2456
+ return [2, contents];
3022
2457
  }
3023
2458
  });
3024
2459
  }); };
3025
2460
  var deserializeAws_restJson1ImportBackendAuthCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3026
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2461
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3027
2462
  var _c;
3028
2463
  return __generator(this, function (_d) {
3029
2464
  switch (_d.label) {
@@ -3056,14 +2491,14 @@ var deserializeAws_restJson1ImportBackendAuthCommandError = function (output, co
3056
2491
  case 9: throw _d.sent();
3057
2492
  case 10:
3058
2493
  parsedBody = parsedOutput.body;
3059
- $metadata = deserializeMetadata(output);
3060
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3061
- response = new __BaseException({
3062
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3063
- $fault: "client",
3064
- $metadata: $metadata,
2494
+ throwDefaultError({
2495
+ output: output,
2496
+ parsedBody: parsedBody,
2497
+ exceptionCtor: __BaseException,
2498
+ errorCode: errorCode,
3065
2499
  });
3066
- throw __decorateServiceException(response, parsedBody);
2500
+ _d.label = 11;
2501
+ case 11: return [2];
3067
2502
  }
3068
2503
  });
3069
2504
  }); };
@@ -3075,36 +2510,32 @@ export var deserializeAws_restJson1ImportBackendStorageCommand = function (outpu
3075
2510
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3076
2511
  return [2, deserializeAws_restJson1ImportBackendStorageCommandError(output, context)];
3077
2512
  }
3078
- contents = {
2513
+ contents = map({
3079
2514
  $metadata: deserializeMetadata(output),
3080
- AppId: undefined,
3081
- BackendEnvironmentName: undefined,
3082
- JobId: undefined,
3083
- Status: undefined,
3084
- };
2515
+ });
3085
2516
  _a = __expectNonNull;
3086
2517
  _b = __expectObject;
3087
2518
  return [4, parseBody(output.body, context)];
3088
2519
  case 1:
3089
2520
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3090
- if (data.appId !== undefined && data.appId !== null) {
2521
+ if (data.appId != null) {
3091
2522
  contents.AppId = __expectString(data.appId);
3092
2523
  }
3093
- if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
2524
+ if (data.backendEnvironmentName != null) {
3094
2525
  contents.BackendEnvironmentName = __expectString(data.backendEnvironmentName);
3095
2526
  }
3096
- if (data.jobId !== undefined && data.jobId !== null) {
2527
+ if (data.jobId != null) {
3097
2528
  contents.JobId = __expectString(data.jobId);
3098
2529
  }
3099
- if (data.status !== undefined && data.status !== null) {
2530
+ if (data.status != null) {
3100
2531
  contents.Status = __expectString(data.status);
3101
2532
  }
3102
- return [2, Promise.resolve(contents)];
2533
+ return [2, contents];
3103
2534
  }
3104
2535
  });
3105
2536
  }); };
3106
2537
  var deserializeAws_restJson1ImportBackendStorageCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3107
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2538
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3108
2539
  var _c;
3109
2540
  return __generator(this, function (_d) {
3110
2541
  switch (_d.label) {
@@ -3137,14 +2568,14 @@ var deserializeAws_restJson1ImportBackendStorageCommandError = function (output,
3137
2568
  case 9: throw _d.sent();
3138
2569
  case 10:
3139
2570
  parsedBody = parsedOutput.body;
3140
- $metadata = deserializeMetadata(output);
3141
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3142
- response = new __BaseException({
3143
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3144
- $fault: "client",
3145
- $metadata: $metadata,
2571
+ throwDefaultError({
2572
+ output: output,
2573
+ parsedBody: parsedBody,
2574
+ exceptionCtor: __BaseException,
2575
+ errorCode: errorCode,
3146
2576
  });
3147
- throw __decorateServiceException(response, parsedBody);
2577
+ _d.label = 11;
2578
+ case 11: return [2];
3148
2579
  }
3149
2580
  });
3150
2581
  }); };
@@ -3156,28 +2587,26 @@ export var deserializeAws_restJson1ListBackendJobsCommand = function (output, co
3156
2587
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3157
2588
  return [2, deserializeAws_restJson1ListBackendJobsCommandError(output, context)];
3158
2589
  }
3159
- contents = {
2590
+ contents = map({
3160
2591
  $metadata: deserializeMetadata(output),
3161
- Jobs: undefined,
3162
- NextToken: undefined,
3163
- };
2592
+ });
3164
2593
  _a = __expectNonNull;
3165
2594
  _b = __expectObject;
3166
2595
  return [4, parseBody(output.body, context)];
3167
2596
  case 1:
3168
2597
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3169
- if (data.jobs !== undefined && data.jobs !== null) {
2598
+ if (data.jobs != null) {
3170
2599
  contents.Jobs = deserializeAws_restJson1ListOfBackendJobRespObj(data.jobs, context);
3171
2600
  }
3172
- if (data.nextToken !== undefined && data.nextToken !== null) {
2601
+ if (data.nextToken != null) {
3173
2602
  contents.NextToken = __expectString(data.nextToken);
3174
2603
  }
3175
- return [2, Promise.resolve(contents)];
2604
+ return [2, contents];
3176
2605
  }
3177
2606
  });
3178
2607
  }); };
3179
2608
  var deserializeAws_restJson1ListBackendJobsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3180
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2609
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3181
2610
  var _c;
3182
2611
  return __generator(this, function (_d) {
3183
2612
  switch (_d.label) {
@@ -3210,14 +2639,14 @@ var deserializeAws_restJson1ListBackendJobsCommandError = function (output, cont
3210
2639
  case 9: throw _d.sent();
3211
2640
  case 10:
3212
2641
  parsedBody = parsedOutput.body;
3213
- $metadata = deserializeMetadata(output);
3214
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3215
- response = new __BaseException({
3216
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3217
- $fault: "client",
3218
- $metadata: $metadata,
2642
+ throwDefaultError({
2643
+ output: output,
2644
+ parsedBody: parsedBody,
2645
+ exceptionCtor: __BaseException,
2646
+ errorCode: errorCode,
3219
2647
  });
3220
- throw __decorateServiceException(response, parsedBody);
2648
+ _d.label = 11;
2649
+ case 11: return [2];
3221
2650
  }
3222
2651
  });
3223
2652
  }); };
@@ -3229,28 +2658,26 @@ export var deserializeAws_restJson1ListS3BucketsCommand = function (output, cont
3229
2658
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3230
2659
  return [2, deserializeAws_restJson1ListS3BucketsCommandError(output, context)];
3231
2660
  }
3232
- contents = {
2661
+ contents = map({
3233
2662
  $metadata: deserializeMetadata(output),
3234
- Buckets: undefined,
3235
- NextToken: undefined,
3236
- };
2663
+ });
3237
2664
  _a = __expectNonNull;
3238
2665
  _b = __expectObject;
3239
2666
  return [4, parseBody(output.body, context)];
3240
2667
  case 1:
3241
2668
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3242
- if (data.buckets !== undefined && data.buckets !== null) {
2669
+ if (data.buckets != null) {
3243
2670
  contents.Buckets = deserializeAws_restJson1ListOfS3BucketInfo(data.buckets, context);
3244
2671
  }
3245
- if (data.nextToken !== undefined && data.nextToken !== null) {
2672
+ if (data.nextToken != null) {
3246
2673
  contents.NextToken = __expectString(data.nextToken);
3247
2674
  }
3248
- return [2, Promise.resolve(contents)];
2675
+ return [2, contents];
3249
2676
  }
3250
2677
  });
3251
2678
  }); };
3252
2679
  var deserializeAws_restJson1ListS3BucketsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3253
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2680
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3254
2681
  var _c;
3255
2682
  return __generator(this, function (_d) {
3256
2683
  switch (_d.label) {
@@ -3283,14 +2710,14 @@ var deserializeAws_restJson1ListS3BucketsCommandError = function (output, contex
3283
2710
  case 9: throw _d.sent();
3284
2711
  case 10:
3285
2712
  parsedBody = parsedOutput.body;
3286
- $metadata = deserializeMetadata(output);
3287
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3288
- response = new __BaseException({
3289
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3290
- $fault: "client",
3291
- $metadata: $metadata,
2713
+ throwDefaultError({
2714
+ output: output,
2715
+ parsedBody: parsedBody,
2716
+ exceptionCtor: __BaseException,
2717
+ errorCode: errorCode,
3292
2718
  });
3293
- throw __decorateServiceException(response, parsedBody);
2719
+ _d.label = 11;
2720
+ case 11: return [2];
3294
2721
  }
3295
2722
  });
3296
2723
  }); };
@@ -3302,40 +2729,35 @@ export var deserializeAws_restJson1RemoveAllBackendsCommand = function (output,
3302
2729
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3303
2730
  return [2, deserializeAws_restJson1RemoveAllBackendsCommandError(output, context)];
3304
2731
  }
3305
- contents = {
2732
+ contents = map({
3306
2733
  $metadata: deserializeMetadata(output),
3307
- AppId: undefined,
3308
- Error: undefined,
3309
- JobId: undefined,
3310
- Operation: undefined,
3311
- Status: undefined,
3312
- };
2734
+ });
3313
2735
  _a = __expectNonNull;
3314
2736
  _b = __expectObject;
3315
2737
  return [4, parseBody(output.body, context)];
3316
2738
  case 1:
3317
2739
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3318
- if (data.appId !== undefined && data.appId !== null) {
2740
+ if (data.appId != null) {
3319
2741
  contents.AppId = __expectString(data.appId);
3320
2742
  }
3321
- if (data.error !== undefined && data.error !== null) {
2743
+ if (data.error != null) {
3322
2744
  contents.Error = __expectString(data.error);
3323
2745
  }
3324
- if (data.jobId !== undefined && data.jobId !== null) {
2746
+ if (data.jobId != null) {
3325
2747
  contents.JobId = __expectString(data.jobId);
3326
2748
  }
3327
- if (data.operation !== undefined && data.operation !== null) {
2749
+ if (data.operation != null) {
3328
2750
  contents.Operation = __expectString(data.operation);
3329
2751
  }
3330
- if (data.status !== undefined && data.status !== null) {
2752
+ if (data.status != null) {
3331
2753
  contents.Status = __expectString(data.status);
3332
2754
  }
3333
- return [2, Promise.resolve(contents)];
2755
+ return [2, contents];
3334
2756
  }
3335
2757
  });
3336
2758
  }); };
3337
2759
  var deserializeAws_restJson1RemoveAllBackendsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3338
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2760
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3339
2761
  var _c;
3340
2762
  return __generator(this, function (_d) {
3341
2763
  switch (_d.label) {
@@ -3368,14 +2790,14 @@ var deserializeAws_restJson1RemoveAllBackendsCommandError = function (output, co
3368
2790
  case 9: throw _d.sent();
3369
2791
  case 10:
3370
2792
  parsedBody = parsedOutput.body;
3371
- $metadata = deserializeMetadata(output);
3372
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3373
- response = new __BaseException({
3374
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3375
- $fault: "client",
3376
- $metadata: $metadata,
2793
+ throwDefaultError({
2794
+ output: output,
2795
+ parsedBody: parsedBody,
2796
+ exceptionCtor: __BaseException,
2797
+ errorCode: errorCode,
3377
2798
  });
3378
- throw __decorateServiceException(response, parsedBody);
2799
+ _d.label = 11;
2800
+ case 11: return [2];
3379
2801
  }
3380
2802
  });
3381
2803
  }); };
@@ -3387,24 +2809,23 @@ export var deserializeAws_restJson1RemoveBackendConfigCommand = function (output
3387
2809
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3388
2810
  return [2, deserializeAws_restJson1RemoveBackendConfigCommandError(output, context)];
3389
2811
  }
3390
- contents = {
2812
+ contents = map({
3391
2813
  $metadata: deserializeMetadata(output),
3392
- Error: undefined,
3393
- };
2814
+ });
3394
2815
  _a = __expectNonNull;
3395
2816
  _b = __expectObject;
3396
2817
  return [4, parseBody(output.body, context)];
3397
2818
  case 1:
3398
2819
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3399
- if (data.error !== undefined && data.error !== null) {
2820
+ if (data.error != null) {
3400
2821
  contents.Error = __expectString(data.error);
3401
2822
  }
3402
- return [2, Promise.resolve(contents)];
2823
+ return [2, contents];
3403
2824
  }
3404
2825
  });
3405
2826
  }); };
3406
2827
  var deserializeAws_restJson1RemoveBackendConfigCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3407
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2828
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3408
2829
  var _c;
3409
2830
  return __generator(this, function (_d) {
3410
2831
  switch (_d.label) {
@@ -3437,14 +2858,14 @@ var deserializeAws_restJson1RemoveBackendConfigCommandError = function (output,
3437
2858
  case 9: throw _d.sent();
3438
2859
  case 10:
3439
2860
  parsedBody = parsedOutput.body;
3440
- $metadata = deserializeMetadata(output);
3441
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3442
- response = new __BaseException({
3443
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3444
- $fault: "client",
3445
- $metadata: $metadata,
2861
+ throwDefaultError({
2862
+ output: output,
2863
+ parsedBody: parsedBody,
2864
+ exceptionCtor: __BaseException,
2865
+ errorCode: errorCode,
3446
2866
  });
3447
- throw __decorateServiceException(response, parsedBody);
2867
+ _d.label = 11;
2868
+ case 11: return [2];
3448
2869
  }
3449
2870
  });
3450
2871
  }); };
@@ -3456,44 +2877,38 @@ export var deserializeAws_restJson1UpdateBackendAPICommand = function (output, c
3456
2877
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3457
2878
  return [2, deserializeAws_restJson1UpdateBackendAPICommandError(output, context)];
3458
2879
  }
3459
- contents = {
2880
+ contents = map({
3460
2881
  $metadata: deserializeMetadata(output),
3461
- AppId: undefined,
3462
- BackendEnvironmentName: undefined,
3463
- Error: undefined,
3464
- JobId: undefined,
3465
- Operation: undefined,
3466
- Status: undefined,
3467
- };
2882
+ });
3468
2883
  _a = __expectNonNull;
3469
2884
  _b = __expectObject;
3470
2885
  return [4, parseBody(output.body, context)];
3471
2886
  case 1:
3472
2887
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3473
- if (data.appId !== undefined && data.appId !== null) {
2888
+ if (data.appId != null) {
3474
2889
  contents.AppId = __expectString(data.appId);
3475
2890
  }
3476
- if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
2891
+ if (data.backendEnvironmentName != null) {
3477
2892
  contents.BackendEnvironmentName = __expectString(data.backendEnvironmentName);
3478
2893
  }
3479
- if (data.error !== undefined && data.error !== null) {
2894
+ if (data.error != null) {
3480
2895
  contents.Error = __expectString(data.error);
3481
2896
  }
3482
- if (data.jobId !== undefined && data.jobId !== null) {
2897
+ if (data.jobId != null) {
3483
2898
  contents.JobId = __expectString(data.jobId);
3484
2899
  }
3485
- if (data.operation !== undefined && data.operation !== null) {
2900
+ if (data.operation != null) {
3486
2901
  contents.Operation = __expectString(data.operation);
3487
2902
  }
3488
- if (data.status !== undefined && data.status !== null) {
2903
+ if (data.status != null) {
3489
2904
  contents.Status = __expectString(data.status);
3490
2905
  }
3491
- return [2, Promise.resolve(contents)];
2906
+ return [2, contents];
3492
2907
  }
3493
2908
  });
3494
2909
  }); };
3495
2910
  var deserializeAws_restJson1UpdateBackendAPICommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3496
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2911
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3497
2912
  var _c;
3498
2913
  return __generator(this, function (_d) {
3499
2914
  switch (_d.label) {
@@ -3526,14 +2941,14 @@ var deserializeAws_restJson1UpdateBackendAPICommandError = function (output, con
3526
2941
  case 9: throw _d.sent();
3527
2942
  case 10:
3528
2943
  parsedBody = parsedOutput.body;
3529
- $metadata = deserializeMetadata(output);
3530
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3531
- response = new __BaseException({
3532
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3533
- $fault: "client",
3534
- $metadata: $metadata,
2944
+ throwDefaultError({
2945
+ output: output,
2946
+ parsedBody: parsedBody,
2947
+ exceptionCtor: __BaseException,
2948
+ errorCode: errorCode,
3535
2949
  });
3536
- throw __decorateServiceException(response, parsedBody);
2950
+ _d.label = 11;
2951
+ case 11: return [2];
3537
2952
  }
3538
2953
  });
3539
2954
  }); };
@@ -3545,44 +2960,38 @@ export var deserializeAws_restJson1UpdateBackendAuthCommand = function (output,
3545
2960
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3546
2961
  return [2, deserializeAws_restJson1UpdateBackendAuthCommandError(output, context)];
3547
2962
  }
3548
- contents = {
2963
+ contents = map({
3549
2964
  $metadata: deserializeMetadata(output),
3550
- AppId: undefined,
3551
- BackendEnvironmentName: undefined,
3552
- Error: undefined,
3553
- JobId: undefined,
3554
- Operation: undefined,
3555
- Status: undefined,
3556
- };
2965
+ });
3557
2966
  _a = __expectNonNull;
3558
2967
  _b = __expectObject;
3559
2968
  return [4, parseBody(output.body, context)];
3560
2969
  case 1:
3561
2970
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3562
- if (data.appId !== undefined && data.appId !== null) {
2971
+ if (data.appId != null) {
3563
2972
  contents.AppId = __expectString(data.appId);
3564
2973
  }
3565
- if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
2974
+ if (data.backendEnvironmentName != null) {
3566
2975
  contents.BackendEnvironmentName = __expectString(data.backendEnvironmentName);
3567
2976
  }
3568
- if (data.error !== undefined && data.error !== null) {
2977
+ if (data.error != null) {
3569
2978
  contents.Error = __expectString(data.error);
3570
2979
  }
3571
- if (data.jobId !== undefined && data.jobId !== null) {
2980
+ if (data.jobId != null) {
3572
2981
  contents.JobId = __expectString(data.jobId);
3573
2982
  }
3574
- if (data.operation !== undefined && data.operation !== null) {
2983
+ if (data.operation != null) {
3575
2984
  contents.Operation = __expectString(data.operation);
3576
2985
  }
3577
- if (data.status !== undefined && data.status !== null) {
2986
+ if (data.status != null) {
3578
2987
  contents.Status = __expectString(data.status);
3579
2988
  }
3580
- return [2, Promise.resolve(contents)];
2989
+ return [2, contents];
3581
2990
  }
3582
2991
  });
3583
2992
  }); };
3584
2993
  var deserializeAws_restJson1UpdateBackendAuthCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3585
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2994
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3586
2995
  var _c;
3587
2996
  return __generator(this, function (_d) {
3588
2997
  switch (_d.label) {
@@ -3615,14 +3024,14 @@ var deserializeAws_restJson1UpdateBackendAuthCommandError = function (output, co
3615
3024
  case 9: throw _d.sent();
3616
3025
  case 10:
3617
3026
  parsedBody = parsedOutput.body;
3618
- $metadata = deserializeMetadata(output);
3619
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3620
- response = new __BaseException({
3621
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3622
- $fault: "client",
3623
- $metadata: $metadata,
3027
+ throwDefaultError({
3028
+ output: output,
3029
+ parsedBody: parsedBody,
3030
+ exceptionCtor: __BaseException,
3031
+ errorCode: errorCode,
3624
3032
  });
3625
- throw __decorateServiceException(response, parsedBody);
3033
+ _d.label = 11;
3034
+ case 11: return [2];
3626
3035
  }
3627
3036
  });
3628
3037
  }); };
@@ -3634,36 +3043,32 @@ export var deserializeAws_restJson1UpdateBackendConfigCommand = function (output
3634
3043
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3635
3044
  return [2, deserializeAws_restJson1UpdateBackendConfigCommandError(output, context)];
3636
3045
  }
3637
- contents = {
3046
+ contents = map({
3638
3047
  $metadata: deserializeMetadata(output),
3639
- AppId: undefined,
3640
- BackendManagerAppId: undefined,
3641
- Error: undefined,
3642
- LoginAuthConfig: undefined,
3643
- };
3048
+ });
3644
3049
  _a = __expectNonNull;
3645
3050
  _b = __expectObject;
3646
3051
  return [4, parseBody(output.body, context)];
3647
3052
  case 1:
3648
3053
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3649
- if (data.appId !== undefined && data.appId !== null) {
3054
+ if (data.appId != null) {
3650
3055
  contents.AppId = __expectString(data.appId);
3651
3056
  }
3652
- if (data.backendManagerAppId !== undefined && data.backendManagerAppId !== null) {
3057
+ if (data.backendManagerAppId != null) {
3653
3058
  contents.BackendManagerAppId = __expectString(data.backendManagerAppId);
3654
3059
  }
3655
- if (data.error !== undefined && data.error !== null) {
3060
+ if (data.error != null) {
3656
3061
  contents.Error = __expectString(data.error);
3657
3062
  }
3658
- if (data.loginAuthConfig !== undefined && data.loginAuthConfig !== null) {
3063
+ if (data.loginAuthConfig != null) {
3659
3064
  contents.LoginAuthConfig = deserializeAws_restJson1LoginAuthConfigReqObj(data.loginAuthConfig, context);
3660
3065
  }
3661
- return [2, Promise.resolve(contents)];
3066
+ return [2, contents];
3662
3067
  }
3663
3068
  });
3664
3069
  }); };
3665
3070
  var deserializeAws_restJson1UpdateBackendConfigCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3666
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3071
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3667
3072
  var _c;
3668
3073
  return __generator(this, function (_d) {
3669
3074
  switch (_d.label) {
@@ -3696,14 +3101,14 @@ var deserializeAws_restJson1UpdateBackendConfigCommandError = function (output,
3696
3101
  case 9: throw _d.sent();
3697
3102
  case 10:
3698
3103
  parsedBody = parsedOutput.body;
3699
- $metadata = deserializeMetadata(output);
3700
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3701
- response = new __BaseException({
3702
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3703
- $fault: "client",
3704
- $metadata: $metadata,
3104
+ throwDefaultError({
3105
+ output: output,
3106
+ parsedBody: parsedBody,
3107
+ exceptionCtor: __BaseException,
3108
+ errorCode: errorCode,
3705
3109
  });
3706
- throw __decorateServiceException(response, parsedBody);
3110
+ _d.label = 11;
3111
+ case 11: return [2];
3707
3112
  }
3708
3113
  });
3709
3114
  }); };
@@ -3715,52 +3120,44 @@ export var deserializeAws_restJson1UpdateBackendJobCommand = function (output, c
3715
3120
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3716
3121
  return [2, deserializeAws_restJson1UpdateBackendJobCommandError(output, context)];
3717
3122
  }
3718
- contents = {
3123
+ contents = map({
3719
3124
  $metadata: deserializeMetadata(output),
3720
- AppId: undefined,
3721
- BackendEnvironmentName: undefined,
3722
- CreateTime: undefined,
3723
- Error: undefined,
3724
- JobId: undefined,
3725
- Operation: undefined,
3726
- Status: undefined,
3727
- UpdateTime: undefined,
3728
- };
3125
+ });
3729
3126
  _a = __expectNonNull;
3730
3127
  _b = __expectObject;
3731
3128
  return [4, parseBody(output.body, context)];
3732
3129
  case 1:
3733
3130
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3734
- if (data.appId !== undefined && data.appId !== null) {
3131
+ if (data.appId != null) {
3735
3132
  contents.AppId = __expectString(data.appId);
3736
3133
  }
3737
- if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
3134
+ if (data.backendEnvironmentName != null) {
3738
3135
  contents.BackendEnvironmentName = __expectString(data.backendEnvironmentName);
3739
3136
  }
3740
- if (data.createTime !== undefined && data.createTime !== null) {
3137
+ if (data.createTime != null) {
3741
3138
  contents.CreateTime = __expectString(data.createTime);
3742
3139
  }
3743
- if (data.error !== undefined && data.error !== null) {
3140
+ if (data.error != null) {
3744
3141
  contents.Error = __expectString(data.error);
3745
3142
  }
3746
- if (data.jobId !== undefined && data.jobId !== null) {
3143
+ if (data.jobId != null) {
3747
3144
  contents.JobId = __expectString(data.jobId);
3748
3145
  }
3749
- if (data.operation !== undefined && data.operation !== null) {
3146
+ if (data.operation != null) {
3750
3147
  contents.Operation = __expectString(data.operation);
3751
3148
  }
3752
- if (data.status !== undefined && data.status !== null) {
3149
+ if (data.status != null) {
3753
3150
  contents.Status = __expectString(data.status);
3754
3151
  }
3755
- if (data.updateTime !== undefined && data.updateTime !== null) {
3152
+ if (data.updateTime != null) {
3756
3153
  contents.UpdateTime = __expectString(data.updateTime);
3757
3154
  }
3758
- return [2, Promise.resolve(contents)];
3155
+ return [2, contents];
3759
3156
  }
3760
3157
  });
3761
3158
  }); };
3762
3159
  var deserializeAws_restJson1UpdateBackendJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3763
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3160
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3764
3161
  var _c;
3765
3162
  return __generator(this, function (_d) {
3766
3163
  switch (_d.label) {
@@ -3793,14 +3190,14 @@ var deserializeAws_restJson1UpdateBackendJobCommandError = function (output, con
3793
3190
  case 9: throw _d.sent();
3794
3191
  case 10:
3795
3192
  parsedBody = parsedOutput.body;
3796
- $metadata = deserializeMetadata(output);
3797
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3798
- response = new __BaseException({
3799
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3800
- $fault: "client",
3801
- $metadata: $metadata,
3193
+ throwDefaultError({
3194
+ output: output,
3195
+ parsedBody: parsedBody,
3196
+ exceptionCtor: __BaseException,
3197
+ errorCode: errorCode,
3802
3198
  });
3803
- throw __decorateServiceException(response, parsedBody);
3199
+ _d.label = 11;
3200
+ case 11: return [2];
3804
3201
  }
3805
3202
  });
3806
3203
  }); };
@@ -3812,36 +3209,32 @@ export var deserializeAws_restJson1UpdateBackendStorageCommand = function (outpu
3812
3209
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3813
3210
  return [2, deserializeAws_restJson1UpdateBackendStorageCommandError(output, context)];
3814
3211
  }
3815
- contents = {
3212
+ contents = map({
3816
3213
  $metadata: deserializeMetadata(output),
3817
- AppId: undefined,
3818
- BackendEnvironmentName: undefined,
3819
- JobId: undefined,
3820
- Status: undefined,
3821
- };
3214
+ });
3822
3215
  _a = __expectNonNull;
3823
3216
  _b = __expectObject;
3824
3217
  return [4, parseBody(output.body, context)];
3825
3218
  case 1:
3826
3219
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3827
- if (data.appId !== undefined && data.appId !== null) {
3220
+ if (data.appId != null) {
3828
3221
  contents.AppId = __expectString(data.appId);
3829
3222
  }
3830
- if (data.backendEnvironmentName !== undefined && data.backendEnvironmentName !== null) {
3223
+ if (data.backendEnvironmentName != null) {
3831
3224
  contents.BackendEnvironmentName = __expectString(data.backendEnvironmentName);
3832
3225
  }
3833
- if (data.jobId !== undefined && data.jobId !== null) {
3226
+ if (data.jobId != null) {
3834
3227
  contents.JobId = __expectString(data.jobId);
3835
3228
  }
3836
- if (data.status !== undefined && data.status !== null) {
3229
+ if (data.status != null) {
3837
3230
  contents.Status = __expectString(data.status);
3838
3231
  }
3839
- return [2, Promise.resolve(contents)];
3232
+ return [2, contents];
3840
3233
  }
3841
3234
  });
3842
3235
  }); };
3843
3236
  var deserializeAws_restJson1UpdateBackendStorageCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3844
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3237
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3845
3238
  var _c;
3846
3239
  return __generator(this, function (_d) {
3847
3240
  switch (_d.label) {
@@ -3874,23 +3267,24 @@ var deserializeAws_restJson1UpdateBackendStorageCommandError = function (output,
3874
3267
  case 9: throw _d.sent();
3875
3268
  case 10:
3876
3269
  parsedBody = parsedOutput.body;
3877
- $metadata = deserializeMetadata(output);
3878
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3879
- response = new __BaseException({
3880
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3881
- $fault: "client",
3882
- $metadata: $metadata,
3270
+ throwDefaultError({
3271
+ output: output,
3272
+ parsedBody: parsedBody,
3273
+ exceptionCtor: __BaseException,
3274
+ errorCode: errorCode,
3883
3275
  });
3884
- throw __decorateServiceException(response, parsedBody);
3276
+ _d.label = 11;
3277
+ case 11: return [2];
3885
3278
  }
3886
3279
  });
3887
3280
  }); };
3281
+ var map = __map;
3888
3282
  var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3889
3283
  var contents, data, exception;
3890
3284
  return __generator(this, function (_a) {
3891
- contents = {};
3285
+ contents = map({});
3892
3286
  data = parsedOutput.body;
3893
- if (data.message !== undefined && data.message !== null) {
3287
+ if (data.message != null) {
3894
3288
  contents.Message = __expectString(data.message);
3895
3289
  }
3896
3290
  exception = new BadRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3900,9 +3294,9 @@ var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput
3900
3294
  var deserializeAws_restJson1GatewayTimeoutExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3901
3295
  var contents, data, exception;
3902
3296
  return __generator(this, function (_a) {
3903
- contents = {};
3297
+ contents = map({});
3904
3298
  data = parsedOutput.body;
3905
- if (data.message !== undefined && data.message !== null) {
3299
+ if (data.message != null) {
3906
3300
  contents.Message = __expectString(data.message);
3907
3301
  }
3908
3302
  exception = new GatewayTimeoutException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3912,12 +3306,12 @@ var deserializeAws_restJson1GatewayTimeoutExceptionResponse = function (parsedOu
3912
3306
  var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3913
3307
  var contents, data, exception;
3914
3308
  return __generator(this, function (_a) {
3915
- contents = {};
3309
+ contents = map({});
3916
3310
  data = parsedOutput.body;
3917
- if (data.message !== undefined && data.message !== null) {
3311
+ if (data.message != null) {
3918
3312
  contents.Message = __expectString(data.message);
3919
3313
  }
3920
- if (data.resourceType !== undefined && data.resourceType !== null) {
3314
+ if (data.resourceType != null) {
3921
3315
  contents.ResourceType = __expectString(data.resourceType);
3922
3316
  }
3923
3317
  exception = new NotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3927,12 +3321,12 @@ var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput,
3927
3321
  var deserializeAws_restJson1TooManyRequestsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3928
3322
  var contents, data, exception;
3929
3323
  return __generator(this, function (_a) {
3930
- contents = {};
3324
+ contents = map({});
3931
3325
  data = parsedOutput.body;
3932
- if (data.limitType !== undefined && data.limitType !== null) {
3326
+ if (data.limitType != null) {
3933
3327
  contents.LimitType = __expectString(data.limitType);
3934
3328
  }
3935
- if (data.message !== undefined && data.message !== null) {
3329
+ if (data.message != null) {
3936
3330
  contents.Message = __expectString(data.message);
3937
3331
  }
3938
3332
  exception = new TooManyRequestsException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -4034,9 +3428,6 @@ var serializeAws_restJson1ListOf__string = function (input, context) {
4034
3428
  return input
4035
3429
  .filter(function (e) { return e != null; })
4036
3430
  .map(function (entry) {
4037
- if (entry === null) {
4038
- return null;
4039
- }
4040
3431
  return entry;
4041
3432
  });
4042
3433
  };
@@ -4044,9 +3435,6 @@ var serializeAws_restJson1ListOfAdditionalConstraintsElement = function (input,
4044
3435
  return input
4045
3436
  .filter(function (e) { return e != null; })
4046
3437
  .map(function (entry) {
4047
- if (entry === null) {
4048
- return null;
4049
- }
4050
3438
  return entry;
4051
3439
  });
4052
3440
  };
@@ -4054,9 +3442,6 @@ var serializeAws_restJson1ListOfAuthenticatedElement = function (input, context)
4054
3442
  return input
4055
3443
  .filter(function (e) { return e != null; })
4056
3444
  .map(function (entry) {
4057
- if (entry === null) {
4058
- return null;
4059
- }
4060
3445
  return entry;
4061
3446
  });
4062
3447
  };
@@ -4064,9 +3449,6 @@ var serializeAws_restJson1ListOfBackendAPIAuthType = function (input, context) {
4064
3449
  return input
4065
3450
  .filter(function (e) { return e != null; })
4066
3451
  .map(function (entry) {
4067
- if (entry === null) {
4068
- return null;
4069
- }
4070
3452
  return serializeAws_restJson1BackendAPIAuthType(entry, context);
4071
3453
  });
4072
3454
  };
@@ -4074,9 +3456,6 @@ var serializeAws_restJson1ListOfMfaTypesElement = function (input, context) {
4074
3456
  return input
4075
3457
  .filter(function (e) { return e != null; })
4076
3458
  .map(function (entry) {
4077
- if (entry === null) {
4078
- return null;
4079
- }
4080
3459
  return entry;
4081
3460
  });
4082
3461
  };
@@ -4084,9 +3463,6 @@ var serializeAws_restJson1ListOfOAuthScopesElement = function (input, context) {
4084
3463
  return input
4085
3464
  .filter(function (e) { return e != null; })
4086
3465
  .map(function (entry) {
4087
- if (entry === null) {
4088
- return null;
4089
- }
4090
3466
  return entry;
4091
3467
  });
4092
3468
  };
@@ -4094,9 +3470,6 @@ var serializeAws_restJson1ListOfRequiredSignUpAttributesElement = function (inpu
4094
3470
  return input
4095
3471
  .filter(function (e) { return e != null; })
4096
3472
  .map(function (entry) {
4097
- if (entry === null) {
4098
- return null;
4099
- }
4100
3473
  return entry;
4101
3474
  });
4102
3475
  };
@@ -4104,9 +3477,6 @@ var serializeAws_restJson1ListOfUnAuthenticatedElement = function (input, contex
4104
3477
  return input
4105
3478
  .filter(function (e) { return e != null; })
4106
3479
  .map(function (entry) {
4107
- if (entry === null) {
4108
- return null;
4109
- }
4110
3480
  return entry;
4111
3481
  });
4112
3482
  };