@aws-sdk/client-codeguru-reviewer 3.141.0 → 3.150.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { __assign, __awaiter, __generator, __read } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, parseEpochTimestamp as __parseEpochTimestamp, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map as __map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { v4 as generateIdempotencyToken } from "uuid";
5
5
  import { CodeGuruReviewerServiceException as __BaseException } from "../models/CodeGuruReviewerServiceException";
6
6
  import { AccessDeniedException, ConflictException, InternalServerException, NotFoundException, ResourceNotFoundException, ThrottlingException, ValidationException, } from "../models/models_0";
@@ -57,7 +57,7 @@ export var serializeAws_restJson1CreateCodeReviewCommand = function (input, cont
57
57
  });
58
58
  }); };
59
59
  export var serializeAws_restJson1DescribeCodeReviewCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
60
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
60
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
61
61
  return __generator(this, function (_c) {
62
62
  switch (_c.label) {
63
63
  case 0: return [4, context.endpoint()];
@@ -65,16 +65,7 @@ export var serializeAws_restJson1DescribeCodeReviewCommand = function (input, co
65
65
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
66
66
  headers = {};
67
67
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/codereviews/{CodeReviewArn}";
68
- if (input.CodeReviewArn !== undefined) {
69
- labelValue = input.CodeReviewArn;
70
- if (labelValue.length <= 0) {
71
- throw new Error("Empty value provided for input HTTP label: CodeReviewArn.");
72
- }
73
- resolvedPath = resolvedPath.replace("{CodeReviewArn}", __extendedEncodeURIComponent(labelValue));
74
- }
75
- else {
76
- throw new Error("No value provided for input HTTP label: CodeReviewArn.");
77
- }
68
+ resolvedPath = __resolvedPath(resolvedPath, input, "CodeReviewArn", function () { return input.CodeReviewArn; }, "{CodeReviewArn}", false);
78
69
  return [2, new __HttpRequest({
79
70
  protocol: protocol,
80
71
  hostname: hostname,
@@ -88,7 +79,7 @@ export var serializeAws_restJson1DescribeCodeReviewCommand = function (input, co
88
79
  });
89
80
  }); };
90
81
  export var serializeAws_restJson1DescribeRecommendationFeedbackCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
91
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
82
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
92
83
  return __generator(this, function (_c) {
93
84
  switch (_c.label) {
94
85
  case 0: return [4, context.endpoint()];
@@ -96,17 +87,11 @@ export var serializeAws_restJson1DescribeRecommendationFeedbackCommand = functio
96
87
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
97
88
  headers = {};
98
89
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/feedback/{CodeReviewArn}";
99
- if (input.CodeReviewArn !== undefined) {
100
- labelValue = input.CodeReviewArn;
101
- if (labelValue.length <= 0) {
102
- throw new Error("Empty value provided for input HTTP label: CodeReviewArn.");
103
- }
104
- resolvedPath = resolvedPath.replace("{CodeReviewArn}", __extendedEncodeURIComponent(labelValue));
105
- }
106
- else {
107
- throw new Error("No value provided for input HTTP label: CodeReviewArn.");
108
- }
109
- query = __assign(__assign({}, (input.RecommendationId !== undefined && { RecommendationId: input.RecommendationId })), (input.UserId !== undefined && { UserId: input.UserId }));
90
+ resolvedPath = __resolvedPath(resolvedPath, input, "CodeReviewArn", function () { return input.CodeReviewArn; }, "{CodeReviewArn}", false);
91
+ query = map({
92
+ RecommendationId: [, input.RecommendationId],
93
+ UserId: [, input.UserId],
94
+ });
110
95
  return [2, new __HttpRequest({
111
96
  protocol: protocol,
112
97
  hostname: hostname,
@@ -121,7 +106,7 @@ export var serializeAws_restJson1DescribeRecommendationFeedbackCommand = functio
121
106
  });
122
107
  }); };
123
108
  export var serializeAws_restJson1DescribeRepositoryAssociationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
124
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
109
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
125
110
  return __generator(this, function (_c) {
126
111
  switch (_c.label) {
127
112
  case 0: return [4, context.endpoint()];
@@ -129,16 +114,7 @@ export var serializeAws_restJson1DescribeRepositoryAssociationCommand = function
129
114
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
130
115
  headers = {};
131
116
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/associations/{AssociationArn}";
132
- if (input.AssociationArn !== undefined) {
133
- labelValue = input.AssociationArn;
134
- if (labelValue.length <= 0) {
135
- throw new Error("Empty value provided for input HTTP label: AssociationArn.");
136
- }
137
- resolvedPath = resolvedPath.replace("{AssociationArn}", __extendedEncodeURIComponent(labelValue));
138
- }
139
- else {
140
- throw new Error("No value provided for input HTTP label: AssociationArn.");
141
- }
117
+ resolvedPath = __resolvedPath(resolvedPath, input, "AssociationArn", function () { return input.AssociationArn; }, "{AssociationArn}", false);
142
118
  return [2, new __HttpRequest({
143
119
  protocol: protocol,
144
120
  hostname: hostname,
@@ -152,7 +128,7 @@ export var serializeAws_restJson1DescribeRepositoryAssociationCommand = function
152
128
  });
153
129
  }); };
154
130
  export var serializeAws_restJson1DisassociateRepositoryCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
155
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
131
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
156
132
  return __generator(this, function (_c) {
157
133
  switch (_c.label) {
158
134
  case 0: return [4, context.endpoint()];
@@ -160,16 +136,7 @@ export var serializeAws_restJson1DisassociateRepositoryCommand = function (input
160
136
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
161
137
  headers = {};
162
138
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/associations/{AssociationArn}";
163
- if (input.AssociationArn !== undefined) {
164
- labelValue = input.AssociationArn;
165
- if (labelValue.length <= 0) {
166
- throw new Error("Empty value provided for input HTTP label: AssociationArn.");
167
- }
168
- resolvedPath = resolvedPath.replace("{AssociationArn}", __extendedEncodeURIComponent(labelValue));
169
- }
170
- else {
171
- throw new Error("No value provided for input HTTP label: AssociationArn.");
172
- }
139
+ resolvedPath = __resolvedPath(resolvedPath, input, "AssociationArn", function () { return input.AssociationArn; }, "{AssociationArn}", false);
173
140
  return [2, new __HttpRequest({
174
141
  protocol: protocol,
175
142
  hostname: hostname,
@@ -191,11 +158,20 @@ export var serializeAws_restJson1ListCodeReviewsCommand = function (input, conte
191
158
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
192
159
  headers = {};
193
160
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/codereviews";
194
- query = __assign(__assign(__assign(__assign(__assign(__assign({}, (input.ProviderTypes !== undefined && {
195
- ProviderTypes: (input.ProviderTypes || []).map(function (_entry) { return _entry; }),
196
- })), (input.States !== undefined && { States: (input.States || []).map(function (_entry) { return _entry; }) })), (input.RepositoryNames !== undefined && {
197
- RepositoryNames: (input.RepositoryNames || []).map(function (_entry) { return _entry; }),
198
- })), (input.Type !== undefined && { Type: input.Type })), (input.MaxResults !== undefined && { MaxResults: input.MaxResults.toString() })), (input.NextToken !== undefined && { NextToken: input.NextToken }));
161
+ query = map({
162
+ ProviderTypes: [
163
+ function () { return input.ProviderTypes !== void 0; },
164
+ function () { return (input.ProviderTypes || []).map(function (_entry) { return _entry; }); },
165
+ ],
166
+ States: [function () { return input.States !== void 0; }, function () { return (input.States || []).map(function (_entry) { return _entry; }); }],
167
+ RepositoryNames: [
168
+ function () { return input.RepositoryNames !== void 0; },
169
+ function () { return (input.RepositoryNames || []).map(function (_entry) { return _entry; }); },
170
+ ],
171
+ Type: [, input.Type],
172
+ MaxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
173
+ NextToken: [, input.NextToken],
174
+ });
199
175
  return [2, new __HttpRequest({
200
176
  protocol: protocol,
201
177
  hostname: hostname,
@@ -210,7 +186,7 @@ export var serializeAws_restJson1ListCodeReviewsCommand = function (input, conte
210
186
  });
211
187
  }); };
212
188
  export var serializeAws_restJson1ListRecommendationFeedbackCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
213
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
189
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
214
190
  return __generator(this, function (_c) {
215
191
  switch (_c.label) {
216
192
  case 0: return [4, context.endpoint()];
@@ -219,19 +195,16 @@ export var serializeAws_restJson1ListRecommendationFeedbackCommand = function (i
219
195
  headers = {};
220
196
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
221
197
  "/feedback/{CodeReviewArn}/RecommendationFeedback";
222
- if (input.CodeReviewArn !== undefined) {
223
- labelValue = input.CodeReviewArn;
224
- if (labelValue.length <= 0) {
225
- throw new Error("Empty value provided for input HTTP label: CodeReviewArn.");
226
- }
227
- resolvedPath = resolvedPath.replace("{CodeReviewArn}", __extendedEncodeURIComponent(labelValue));
228
- }
229
- else {
230
- throw new Error("No value provided for input HTTP label: CodeReviewArn.");
231
- }
232
- query = __assign(__assign(__assign(__assign({}, (input.NextToken !== undefined && { NextToken: input.NextToken })), (input.MaxResults !== undefined && { MaxResults: input.MaxResults.toString() })), (input.UserIds !== undefined && { UserIds: (input.UserIds || []).map(function (_entry) { return _entry; }) })), (input.RecommendationIds !== undefined && {
233
- RecommendationIds: (input.RecommendationIds || []).map(function (_entry) { return _entry; }),
234
- }));
198
+ resolvedPath = __resolvedPath(resolvedPath, input, "CodeReviewArn", function () { return input.CodeReviewArn; }, "{CodeReviewArn}", false);
199
+ query = map({
200
+ NextToken: [, input.NextToken],
201
+ MaxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
202
+ UserIds: [function () { return input.UserIds !== void 0; }, function () { return (input.UserIds || []).map(function (_entry) { return _entry; }); }],
203
+ RecommendationIds: [
204
+ function () { return input.RecommendationIds !== void 0; },
205
+ function () { return (input.RecommendationIds || []).map(function (_entry) { return _entry; }); },
206
+ ],
207
+ });
235
208
  return [2, new __HttpRequest({
236
209
  protocol: protocol,
237
210
  hostname: hostname,
@@ -246,7 +219,7 @@ export var serializeAws_restJson1ListRecommendationFeedbackCommand = function (i
246
219
  });
247
220
  }); };
248
221
  export var serializeAws_restJson1ListRecommendationsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
249
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
222
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
250
223
  return __generator(this, function (_c) {
251
224
  switch (_c.label) {
252
225
  case 0: return [4, context.endpoint()];
@@ -255,17 +228,11 @@ export var serializeAws_restJson1ListRecommendationsCommand = function (input, c
255
228
  headers = {};
256
229
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
257
230
  "/codereviews/{CodeReviewArn}/Recommendations";
258
- if (input.CodeReviewArn !== undefined) {
259
- labelValue = input.CodeReviewArn;
260
- if (labelValue.length <= 0) {
261
- throw new Error("Empty value provided for input HTTP label: CodeReviewArn.");
262
- }
263
- resolvedPath = resolvedPath.replace("{CodeReviewArn}", __extendedEncodeURIComponent(labelValue));
264
- }
265
- else {
266
- throw new Error("No value provided for input HTTP label: CodeReviewArn.");
267
- }
268
- query = __assign(__assign({}, (input.NextToken !== undefined && { NextToken: input.NextToken })), (input.MaxResults !== undefined && { MaxResults: input.MaxResults.toString() }));
231
+ resolvedPath = __resolvedPath(resolvedPath, input, "CodeReviewArn", function () { return input.CodeReviewArn; }, "{CodeReviewArn}", false);
232
+ query = map({
233
+ NextToken: [, input.NextToken],
234
+ MaxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
235
+ });
269
236
  return [2, new __HttpRequest({
270
237
  protocol: protocol,
271
238
  hostname: hostname,
@@ -288,9 +255,17 @@ export var serializeAws_restJson1ListRepositoryAssociationsCommand = function (i
288
255
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
289
256
  headers = {};
290
257
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/associations";
291
- query = __assign(__assign(__assign(__assign(__assign(__assign({}, (input.ProviderTypes !== undefined && {
292
- ProviderType: (input.ProviderTypes || []).map(function (_entry) { return _entry; }),
293
- })), (input.States !== undefined && { State: (input.States || []).map(function (_entry) { return _entry; }) })), (input.Names !== undefined && { Name: (input.Names || []).map(function (_entry) { return _entry; }) })), (input.Owners !== undefined && { Owner: (input.Owners || []).map(function (_entry) { return _entry; }) })), (input.MaxResults !== undefined && { MaxResults: input.MaxResults.toString() })), (input.NextToken !== undefined && { NextToken: input.NextToken }));
258
+ query = map({
259
+ ProviderType: [
260
+ function () { return input.ProviderTypes !== void 0; },
261
+ function () { return (input.ProviderTypes || []).map(function (_entry) { return _entry; }); },
262
+ ],
263
+ State: [function () { return input.States !== void 0; }, function () { return (input.States || []).map(function (_entry) { return _entry; }); }],
264
+ Name: [function () { return input.Names !== void 0; }, function () { return (input.Names || []).map(function (_entry) { return _entry; }); }],
265
+ Owner: [function () { return input.Owners !== void 0; }, function () { return (input.Owners || []).map(function (_entry) { return _entry; }); }],
266
+ MaxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
267
+ NextToken: [, input.NextToken],
268
+ });
294
269
  return [2, new __HttpRequest({
295
270
  protocol: protocol,
296
271
  hostname: hostname,
@@ -305,7 +280,7 @@ export var serializeAws_restJson1ListRepositoryAssociationsCommand = function (i
305
280
  });
306
281
  }); };
307
282
  export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
308
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
283
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
309
284
  return __generator(this, function (_c) {
310
285
  switch (_c.label) {
311
286
  case 0: return [4, context.endpoint()];
@@ -313,16 +288,7 @@ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, c
313
288
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
314
289
  headers = {};
315
290
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
316
- if (input.resourceArn !== undefined) {
317
- labelValue = input.resourceArn;
318
- if (labelValue.length <= 0) {
319
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
320
- }
321
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
322
- }
323
- else {
324
- throw new Error("No value provided for input HTTP label: resourceArn.");
325
- }
291
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
326
292
  return [2, new __HttpRequest({
327
293
  protocol: protocol,
328
294
  hostname: hostname,
@@ -360,7 +326,7 @@ export var serializeAws_restJson1PutRecommendationFeedbackCommand = function (in
360
326
  });
361
327
  }); };
362
328
  export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
363
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
329
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
364
330
  return __generator(this, function (_c) {
365
331
  switch (_c.label) {
366
332
  case 0: return [4, context.endpoint()];
@@ -370,16 +336,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
370
336
  "content-type": "application/json",
371
337
  };
372
338
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
373
- if (input.resourceArn !== undefined) {
374
- labelValue = input.resourceArn;
375
- if (labelValue.length <= 0) {
376
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
377
- }
378
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
379
- }
380
- else {
381
- throw new Error("No value provided for input HTTP label: resourceArn.");
382
- }
339
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
383
340
  body = JSON.stringify(__assign({}, (input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) })));
384
341
  return [2, new __HttpRequest({
385
342
  protocol: protocol,
@@ -394,7 +351,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
394
351
  });
395
352
  }); };
396
353
  export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
397
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
354
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
398
355
  return __generator(this, function (_c) {
399
356
  switch (_c.label) {
400
357
  case 0: return [4, context.endpoint()];
@@ -402,17 +359,10 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
402
359
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
403
360
  headers = {};
404
361
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
405
- if (input.resourceArn !== undefined) {
406
- labelValue = input.resourceArn;
407
- if (labelValue.length <= 0) {
408
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
409
- }
410
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
411
- }
412
- else {
413
- throw new Error("No value provided for input HTTP label: resourceArn.");
414
- }
415
- query = __assign({}, (input.TagKeys !== undefined && { tagKeys: (input.TagKeys || []).map(function (_entry) { return _entry; }) }));
362
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
363
+ query = map({
364
+ tagKeys: [function () { return input.TagKeys !== void 0; }, function () { return (input.TagKeys || []).map(function (_entry) { return _entry; }); }],
365
+ });
416
366
  return [2, new __HttpRequest({
417
367
  protocol: protocol,
418
368
  hostname: hostname,
@@ -434,28 +384,26 @@ export var deserializeAws_restJson1AssociateRepositoryCommand = function (output
434
384
  if (output.statusCode !== 200 && output.statusCode >= 300) {
435
385
  return [2, deserializeAws_restJson1AssociateRepositoryCommandError(output, context)];
436
386
  }
437
- contents = {
387
+ contents = map({
438
388
  $metadata: deserializeMetadata(output),
439
- RepositoryAssociation: undefined,
440
- Tags: undefined,
441
- };
389
+ });
442
390
  _a = __expectNonNull;
443
391
  _b = __expectObject;
444
392
  return [4, parseBody(output.body, context)];
445
393
  case 1:
446
394
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
447
- if (data.RepositoryAssociation !== undefined && data.RepositoryAssociation !== null) {
395
+ if (data.RepositoryAssociation != null) {
448
396
  contents.RepositoryAssociation = deserializeAws_restJson1RepositoryAssociation(data.RepositoryAssociation, context);
449
397
  }
450
- if (data.Tags !== undefined && data.Tags !== null) {
398
+ if (data.Tags != null) {
451
399
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
452
400
  }
453
- return [2, Promise.resolve(contents)];
401
+ return [2, contents];
454
402
  }
455
403
  });
456
404
  }); };
457
405
  var deserializeAws_restJson1AssociateRepositoryCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
458
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
406
+ var parsedOutput, _a, errorCode, _b, parsedBody;
459
407
  var _c;
460
408
  return __generator(this, function (_d) {
461
409
  switch (_d.label) {
@@ -492,14 +440,14 @@ var deserializeAws_restJson1AssociateRepositoryCommandError = function (output,
492
440
  case 11: throw _d.sent();
493
441
  case 12:
494
442
  parsedBody = parsedOutput.body;
495
- $metadata = deserializeMetadata(output);
496
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
497
- response = new __BaseException({
498
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
499
- $fault: "client",
500
- $metadata: $metadata,
443
+ throwDefaultError({
444
+ output: output,
445
+ parsedBody: parsedBody,
446
+ exceptionCtor: __BaseException,
447
+ errorCode: errorCode,
501
448
  });
502
- throw __decorateServiceException(response, parsedBody);
449
+ _d.label = 13;
450
+ case 13: return [2];
503
451
  }
504
452
  });
505
453
  }); };
@@ -511,24 +459,23 @@ export var deserializeAws_restJson1CreateCodeReviewCommand = function (output, c
511
459
  if (output.statusCode !== 200 && output.statusCode >= 300) {
512
460
  return [2, deserializeAws_restJson1CreateCodeReviewCommandError(output, context)];
513
461
  }
514
- contents = {
462
+ contents = map({
515
463
  $metadata: deserializeMetadata(output),
516
- CodeReview: undefined,
517
- };
464
+ });
518
465
  _a = __expectNonNull;
519
466
  _b = __expectObject;
520
467
  return [4, parseBody(output.body, context)];
521
468
  case 1:
522
469
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
523
- if (data.CodeReview !== undefined && data.CodeReview !== null) {
470
+ if (data.CodeReview != null) {
524
471
  contents.CodeReview = deserializeAws_restJson1CodeReview(data.CodeReview, context);
525
472
  }
526
- return [2, Promise.resolve(contents)];
473
+ return [2, contents];
527
474
  }
528
475
  });
529
476
  }); };
530
477
  var deserializeAws_restJson1CreateCodeReviewCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
531
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
478
+ var parsedOutput, _a, errorCode, _b, parsedBody;
532
479
  var _c;
533
480
  return __generator(this, function (_d) {
534
481
  switch (_d.label) {
@@ -569,14 +516,14 @@ var deserializeAws_restJson1CreateCodeReviewCommandError = function (output, con
569
516
  case 13: throw _d.sent();
570
517
  case 14:
571
518
  parsedBody = parsedOutput.body;
572
- $metadata = deserializeMetadata(output);
573
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
574
- response = new __BaseException({
575
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
576
- $fault: "client",
577
- $metadata: $metadata,
519
+ throwDefaultError({
520
+ output: output,
521
+ parsedBody: parsedBody,
522
+ exceptionCtor: __BaseException,
523
+ errorCode: errorCode,
578
524
  });
579
- throw __decorateServiceException(response, parsedBody);
525
+ _d.label = 15;
526
+ case 15: return [2];
580
527
  }
581
528
  });
582
529
  }); };
@@ -588,24 +535,23 @@ export var deserializeAws_restJson1DescribeCodeReviewCommand = function (output,
588
535
  if (output.statusCode !== 200 && output.statusCode >= 300) {
589
536
  return [2, deserializeAws_restJson1DescribeCodeReviewCommandError(output, context)];
590
537
  }
591
- contents = {
538
+ contents = map({
592
539
  $metadata: deserializeMetadata(output),
593
- CodeReview: undefined,
594
- };
540
+ });
595
541
  _a = __expectNonNull;
596
542
  _b = __expectObject;
597
543
  return [4, parseBody(output.body, context)];
598
544
  case 1:
599
545
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
600
- if (data.CodeReview !== undefined && data.CodeReview !== null) {
546
+ if (data.CodeReview != null) {
601
547
  contents.CodeReview = deserializeAws_restJson1CodeReview(data.CodeReview, context);
602
548
  }
603
- return [2, Promise.resolve(contents)];
549
+ return [2, contents];
604
550
  }
605
551
  });
606
552
  }); };
607
553
  var deserializeAws_restJson1DescribeCodeReviewCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
608
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
554
+ var parsedOutput, _a, errorCode, _b, parsedBody;
609
555
  var _c;
610
556
  return __generator(this, function (_d) {
611
557
  switch (_d.label) {
@@ -642,14 +588,14 @@ var deserializeAws_restJson1DescribeCodeReviewCommandError = function (output, c
642
588
  case 11: throw _d.sent();
643
589
  case 12:
644
590
  parsedBody = parsedOutput.body;
645
- $metadata = deserializeMetadata(output);
646
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
647
- response = new __BaseException({
648
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
649
- $fault: "client",
650
- $metadata: $metadata,
591
+ throwDefaultError({
592
+ output: output,
593
+ parsedBody: parsedBody,
594
+ exceptionCtor: __BaseException,
595
+ errorCode: errorCode,
651
596
  });
652
- throw __decorateServiceException(response, parsedBody);
597
+ _d.label = 13;
598
+ case 13: return [2];
653
599
  }
654
600
  });
655
601
  }); };
@@ -661,24 +607,23 @@ export var deserializeAws_restJson1DescribeRecommendationFeedbackCommand = funct
661
607
  if (output.statusCode !== 200 && output.statusCode >= 300) {
662
608
  return [2, deserializeAws_restJson1DescribeRecommendationFeedbackCommandError(output, context)];
663
609
  }
664
- contents = {
610
+ contents = map({
665
611
  $metadata: deserializeMetadata(output),
666
- RecommendationFeedback: undefined,
667
- };
612
+ });
668
613
  _a = __expectNonNull;
669
614
  _b = __expectObject;
670
615
  return [4, parseBody(output.body, context)];
671
616
  case 1:
672
617
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
673
- if (data.RecommendationFeedback !== undefined && data.RecommendationFeedback !== null) {
618
+ if (data.RecommendationFeedback != null) {
674
619
  contents.RecommendationFeedback = deserializeAws_restJson1RecommendationFeedback(data.RecommendationFeedback, context);
675
620
  }
676
- return [2, Promise.resolve(contents)];
621
+ return [2, contents];
677
622
  }
678
623
  });
679
624
  }); };
680
625
  var deserializeAws_restJson1DescribeRecommendationFeedbackCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
681
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
626
+ var parsedOutput, _a, errorCode, _b, parsedBody;
682
627
  var _c;
683
628
  return __generator(this, function (_d) {
684
629
  switch (_d.label) {
@@ -715,14 +660,14 @@ var deserializeAws_restJson1DescribeRecommendationFeedbackCommandError = functio
715
660
  case 11: throw _d.sent();
716
661
  case 12:
717
662
  parsedBody = parsedOutput.body;
718
- $metadata = deserializeMetadata(output);
719
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
720
- response = new __BaseException({
721
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
722
- $fault: "client",
723
- $metadata: $metadata,
663
+ throwDefaultError({
664
+ output: output,
665
+ parsedBody: parsedBody,
666
+ exceptionCtor: __BaseException,
667
+ errorCode: errorCode,
724
668
  });
725
- throw __decorateServiceException(response, parsedBody);
669
+ _d.label = 13;
670
+ case 13: return [2];
726
671
  }
727
672
  });
728
673
  }); };
@@ -734,28 +679,26 @@ export var deserializeAws_restJson1DescribeRepositoryAssociationCommand = functi
734
679
  if (output.statusCode !== 200 && output.statusCode >= 300) {
735
680
  return [2, deserializeAws_restJson1DescribeRepositoryAssociationCommandError(output, context)];
736
681
  }
737
- contents = {
682
+ contents = map({
738
683
  $metadata: deserializeMetadata(output),
739
- RepositoryAssociation: undefined,
740
- Tags: undefined,
741
- };
684
+ });
742
685
  _a = __expectNonNull;
743
686
  _b = __expectObject;
744
687
  return [4, parseBody(output.body, context)];
745
688
  case 1:
746
689
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
747
- if (data.RepositoryAssociation !== undefined && data.RepositoryAssociation !== null) {
690
+ if (data.RepositoryAssociation != null) {
748
691
  contents.RepositoryAssociation = deserializeAws_restJson1RepositoryAssociation(data.RepositoryAssociation, context);
749
692
  }
750
- if (data.Tags !== undefined && data.Tags !== null) {
693
+ if (data.Tags != null) {
751
694
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
752
695
  }
753
- return [2, Promise.resolve(contents)];
696
+ return [2, contents];
754
697
  }
755
698
  });
756
699
  }); };
757
700
  var deserializeAws_restJson1DescribeRepositoryAssociationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
758
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
701
+ var parsedOutput, _a, errorCode, _b, parsedBody;
759
702
  var _c;
760
703
  return __generator(this, function (_d) {
761
704
  switch (_d.label) {
@@ -792,14 +735,14 @@ var deserializeAws_restJson1DescribeRepositoryAssociationCommandError = function
792
735
  case 11: throw _d.sent();
793
736
  case 12:
794
737
  parsedBody = parsedOutput.body;
795
- $metadata = deserializeMetadata(output);
796
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
797
- response = new __BaseException({
798
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
799
- $fault: "client",
800
- $metadata: $metadata,
738
+ throwDefaultError({
739
+ output: output,
740
+ parsedBody: parsedBody,
741
+ exceptionCtor: __BaseException,
742
+ errorCode: errorCode,
801
743
  });
802
- throw __decorateServiceException(response, parsedBody);
744
+ _d.label = 13;
745
+ case 13: return [2];
803
746
  }
804
747
  });
805
748
  }); };
@@ -811,28 +754,26 @@ export var deserializeAws_restJson1DisassociateRepositoryCommand = function (out
811
754
  if (output.statusCode !== 200 && output.statusCode >= 300) {
812
755
  return [2, deserializeAws_restJson1DisassociateRepositoryCommandError(output, context)];
813
756
  }
814
- contents = {
757
+ contents = map({
815
758
  $metadata: deserializeMetadata(output),
816
- RepositoryAssociation: undefined,
817
- Tags: undefined,
818
- };
759
+ });
819
760
  _a = __expectNonNull;
820
761
  _b = __expectObject;
821
762
  return [4, parseBody(output.body, context)];
822
763
  case 1:
823
764
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
824
- if (data.RepositoryAssociation !== undefined && data.RepositoryAssociation !== null) {
765
+ if (data.RepositoryAssociation != null) {
825
766
  contents.RepositoryAssociation = deserializeAws_restJson1RepositoryAssociation(data.RepositoryAssociation, context);
826
767
  }
827
- if (data.Tags !== undefined && data.Tags !== null) {
768
+ if (data.Tags != null) {
828
769
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
829
770
  }
830
- return [2, Promise.resolve(contents)];
771
+ return [2, contents];
831
772
  }
832
773
  });
833
774
  }); };
834
775
  var deserializeAws_restJson1DisassociateRepositoryCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
835
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
776
+ var parsedOutput, _a, errorCode, _b, parsedBody;
836
777
  var _c;
837
778
  return __generator(this, function (_d) {
838
779
  switch (_d.label) {
@@ -873,14 +814,14 @@ var deserializeAws_restJson1DisassociateRepositoryCommandError = function (outpu
873
814
  case 13: throw _d.sent();
874
815
  case 14:
875
816
  parsedBody = parsedOutput.body;
876
- $metadata = deserializeMetadata(output);
877
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
878
- response = new __BaseException({
879
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
880
- $fault: "client",
881
- $metadata: $metadata,
817
+ throwDefaultError({
818
+ output: output,
819
+ parsedBody: parsedBody,
820
+ exceptionCtor: __BaseException,
821
+ errorCode: errorCode,
882
822
  });
883
- throw __decorateServiceException(response, parsedBody);
823
+ _d.label = 15;
824
+ case 15: return [2];
884
825
  }
885
826
  });
886
827
  }); };
@@ -892,28 +833,26 @@ export var deserializeAws_restJson1ListCodeReviewsCommand = function (output, co
892
833
  if (output.statusCode !== 200 && output.statusCode >= 300) {
893
834
  return [2, deserializeAws_restJson1ListCodeReviewsCommandError(output, context)];
894
835
  }
895
- contents = {
836
+ contents = map({
896
837
  $metadata: deserializeMetadata(output),
897
- CodeReviewSummaries: undefined,
898
- NextToken: undefined,
899
- };
838
+ });
900
839
  _a = __expectNonNull;
901
840
  _b = __expectObject;
902
841
  return [4, parseBody(output.body, context)];
903
842
  case 1:
904
843
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
905
- if (data.CodeReviewSummaries !== undefined && data.CodeReviewSummaries !== null) {
844
+ if (data.CodeReviewSummaries != null) {
906
845
  contents.CodeReviewSummaries = deserializeAws_restJson1CodeReviewSummaries(data.CodeReviewSummaries, context);
907
846
  }
908
- if (data.NextToken !== undefined && data.NextToken !== null) {
847
+ if (data.NextToken != null) {
909
848
  contents.NextToken = __expectString(data.NextToken);
910
849
  }
911
- return [2, Promise.resolve(contents)];
850
+ return [2, contents];
912
851
  }
913
852
  });
914
853
  }); };
915
854
  var deserializeAws_restJson1ListCodeReviewsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
916
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
855
+ var parsedOutput, _a, errorCode, _b, parsedBody;
917
856
  var _c;
918
857
  return __generator(this, function (_d) {
919
858
  switch (_d.label) {
@@ -946,14 +885,14 @@ var deserializeAws_restJson1ListCodeReviewsCommandError = function (output, cont
946
885
  case 9: throw _d.sent();
947
886
  case 10:
948
887
  parsedBody = parsedOutput.body;
949
- $metadata = deserializeMetadata(output);
950
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
951
- response = new __BaseException({
952
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
953
- $fault: "client",
954
- $metadata: $metadata,
888
+ throwDefaultError({
889
+ output: output,
890
+ parsedBody: parsedBody,
891
+ exceptionCtor: __BaseException,
892
+ errorCode: errorCode,
955
893
  });
956
- throw __decorateServiceException(response, parsedBody);
894
+ _d.label = 11;
895
+ case 11: return [2];
957
896
  }
958
897
  });
959
898
  }); };
@@ -965,28 +904,26 @@ export var deserializeAws_restJson1ListRecommendationFeedbackCommand = function
965
904
  if (output.statusCode !== 200 && output.statusCode >= 300) {
966
905
  return [2, deserializeAws_restJson1ListRecommendationFeedbackCommandError(output, context)];
967
906
  }
968
- contents = {
907
+ contents = map({
969
908
  $metadata: deserializeMetadata(output),
970
- NextToken: undefined,
971
- RecommendationFeedbackSummaries: undefined,
972
- };
909
+ });
973
910
  _a = __expectNonNull;
974
911
  _b = __expectObject;
975
912
  return [4, parseBody(output.body, context)];
976
913
  case 1:
977
914
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
978
- if (data.NextToken !== undefined && data.NextToken !== null) {
915
+ if (data.NextToken != null) {
979
916
  contents.NextToken = __expectString(data.NextToken);
980
917
  }
981
- if (data.RecommendationFeedbackSummaries !== undefined && data.RecommendationFeedbackSummaries !== null) {
918
+ if (data.RecommendationFeedbackSummaries != null) {
982
919
  contents.RecommendationFeedbackSummaries = deserializeAws_restJson1RecommendationFeedbackSummaries(data.RecommendationFeedbackSummaries, context);
983
920
  }
984
- return [2, Promise.resolve(contents)];
921
+ return [2, contents];
985
922
  }
986
923
  });
987
924
  }); };
988
925
  var deserializeAws_restJson1ListRecommendationFeedbackCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
989
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
926
+ var parsedOutput, _a, errorCode, _b, parsedBody;
990
927
  var _c;
991
928
  return __generator(this, function (_d) {
992
929
  switch (_d.label) {
@@ -1023,14 +960,14 @@ var deserializeAws_restJson1ListRecommendationFeedbackCommandError = function (o
1023
960
  case 11: throw _d.sent();
1024
961
  case 12:
1025
962
  parsedBody = parsedOutput.body;
1026
- $metadata = deserializeMetadata(output);
1027
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1028
- response = new __BaseException({
1029
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1030
- $fault: "client",
1031
- $metadata: $metadata,
963
+ throwDefaultError({
964
+ output: output,
965
+ parsedBody: parsedBody,
966
+ exceptionCtor: __BaseException,
967
+ errorCode: errorCode,
1032
968
  });
1033
- throw __decorateServiceException(response, parsedBody);
969
+ _d.label = 13;
970
+ case 13: return [2];
1034
971
  }
1035
972
  });
1036
973
  }); };
@@ -1042,28 +979,26 @@ export var deserializeAws_restJson1ListRecommendationsCommand = function (output
1042
979
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1043
980
  return [2, deserializeAws_restJson1ListRecommendationsCommandError(output, context)];
1044
981
  }
1045
- contents = {
982
+ contents = map({
1046
983
  $metadata: deserializeMetadata(output),
1047
- NextToken: undefined,
1048
- RecommendationSummaries: undefined,
1049
- };
984
+ });
1050
985
  _a = __expectNonNull;
1051
986
  _b = __expectObject;
1052
987
  return [4, parseBody(output.body, context)];
1053
988
  case 1:
1054
989
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1055
- if (data.NextToken !== undefined && data.NextToken !== null) {
990
+ if (data.NextToken != null) {
1056
991
  contents.NextToken = __expectString(data.NextToken);
1057
992
  }
1058
- if (data.RecommendationSummaries !== undefined && data.RecommendationSummaries !== null) {
993
+ if (data.RecommendationSummaries != null) {
1059
994
  contents.RecommendationSummaries = deserializeAws_restJson1RecommendationSummaries(data.RecommendationSummaries, context);
1060
995
  }
1061
- return [2, Promise.resolve(contents)];
996
+ return [2, contents];
1062
997
  }
1063
998
  });
1064
999
  }); };
1065
1000
  var deserializeAws_restJson1ListRecommendationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1066
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1001
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1067
1002
  var _c;
1068
1003
  return __generator(this, function (_d) {
1069
1004
  switch (_d.label) {
@@ -1100,14 +1035,14 @@ var deserializeAws_restJson1ListRecommendationsCommandError = function (output,
1100
1035
  case 11: throw _d.sent();
1101
1036
  case 12:
1102
1037
  parsedBody = parsedOutput.body;
1103
- $metadata = deserializeMetadata(output);
1104
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1105
- response = new __BaseException({
1106
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1107
- $fault: "client",
1108
- $metadata: $metadata,
1038
+ throwDefaultError({
1039
+ output: output,
1040
+ parsedBody: parsedBody,
1041
+ exceptionCtor: __BaseException,
1042
+ errorCode: errorCode,
1109
1043
  });
1110
- throw __decorateServiceException(response, parsedBody);
1044
+ _d.label = 13;
1045
+ case 13: return [2];
1111
1046
  }
1112
1047
  });
1113
1048
  }); };
@@ -1119,28 +1054,26 @@ export var deserializeAws_restJson1ListRepositoryAssociationsCommand = function
1119
1054
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1120
1055
  return [2, deserializeAws_restJson1ListRepositoryAssociationsCommandError(output, context)];
1121
1056
  }
1122
- contents = {
1057
+ contents = map({
1123
1058
  $metadata: deserializeMetadata(output),
1124
- NextToken: undefined,
1125
- RepositoryAssociationSummaries: undefined,
1126
- };
1059
+ });
1127
1060
  _a = __expectNonNull;
1128
1061
  _b = __expectObject;
1129
1062
  return [4, parseBody(output.body, context)];
1130
1063
  case 1:
1131
1064
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1132
- if (data.NextToken !== undefined && data.NextToken !== null) {
1065
+ if (data.NextToken != null) {
1133
1066
  contents.NextToken = __expectString(data.NextToken);
1134
1067
  }
1135
- if (data.RepositoryAssociationSummaries !== undefined && data.RepositoryAssociationSummaries !== null) {
1068
+ if (data.RepositoryAssociationSummaries != null) {
1136
1069
  contents.RepositoryAssociationSummaries = deserializeAws_restJson1RepositoryAssociationSummaries(data.RepositoryAssociationSummaries, context);
1137
1070
  }
1138
- return [2, Promise.resolve(contents)];
1071
+ return [2, contents];
1139
1072
  }
1140
1073
  });
1141
1074
  }); };
1142
1075
  var deserializeAws_restJson1ListRepositoryAssociationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1143
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1076
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1144
1077
  var _c;
1145
1078
  return __generator(this, function (_d) {
1146
1079
  switch (_d.label) {
@@ -1169,14 +1102,14 @@ var deserializeAws_restJson1ListRepositoryAssociationsCommandError = function (o
1169
1102
  case 7: throw _d.sent();
1170
1103
  case 8:
1171
1104
  parsedBody = parsedOutput.body;
1172
- $metadata = deserializeMetadata(output);
1173
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1174
- response = new __BaseException({
1175
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1176
- $fault: "client",
1177
- $metadata: $metadata,
1105
+ throwDefaultError({
1106
+ output: output,
1107
+ parsedBody: parsedBody,
1108
+ exceptionCtor: __BaseException,
1109
+ errorCode: errorCode,
1178
1110
  });
1179
- throw __decorateServiceException(response, parsedBody);
1111
+ _d.label = 9;
1112
+ case 9: return [2];
1180
1113
  }
1181
1114
  });
1182
1115
  }); };
@@ -1188,24 +1121,23 @@ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output
1188
1121
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1189
1122
  return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
1190
1123
  }
1191
- contents = {
1124
+ contents = map({
1192
1125
  $metadata: deserializeMetadata(output),
1193
- Tags: undefined,
1194
- };
1126
+ });
1195
1127
  _a = __expectNonNull;
1196
1128
  _b = __expectObject;
1197
1129
  return [4, parseBody(output.body, context)];
1198
1130
  case 1:
1199
1131
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1200
- if (data.Tags !== undefined && data.Tags !== null) {
1132
+ if (data.Tags != null) {
1201
1133
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
1202
1134
  }
1203
- return [2, Promise.resolve(contents)];
1135
+ return [2, contents];
1204
1136
  }
1205
1137
  });
1206
1138
  }); };
1207
1139
  var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1208
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1140
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1209
1141
  var _c;
1210
1142
  return __generator(this, function (_d) {
1211
1143
  switch (_d.label) {
@@ -1234,14 +1166,14 @@ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output,
1234
1166
  case 7: throw _d.sent();
1235
1167
  case 8:
1236
1168
  parsedBody = parsedOutput.body;
1237
- $metadata = deserializeMetadata(output);
1238
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1239
- response = new __BaseException({
1240
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1241
- $fault: "client",
1242
- $metadata: $metadata,
1169
+ throwDefaultError({
1170
+ output: output,
1171
+ parsedBody: parsedBody,
1172
+ exceptionCtor: __BaseException,
1173
+ errorCode: errorCode,
1243
1174
  });
1244
- throw __decorateServiceException(response, parsedBody);
1175
+ _d.label = 9;
1176
+ case 9: return [2];
1245
1177
  }
1246
1178
  });
1247
1179
  }); };
@@ -1253,18 +1185,18 @@ export var deserializeAws_restJson1PutRecommendationFeedbackCommand = function (
1253
1185
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1254
1186
  return [2, deserializeAws_restJson1PutRecommendationFeedbackCommandError(output, context)];
1255
1187
  }
1256
- contents = {
1188
+ contents = map({
1257
1189
  $metadata: deserializeMetadata(output),
1258
- };
1190
+ });
1259
1191
  return [4, collectBody(output.body, context)];
1260
1192
  case 1:
1261
1193
  _a.sent();
1262
- return [2, Promise.resolve(contents)];
1194
+ return [2, contents];
1263
1195
  }
1264
1196
  });
1265
1197
  }); };
1266
1198
  var deserializeAws_restJson1PutRecommendationFeedbackCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1267
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1199
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1268
1200
  var _c;
1269
1201
  return __generator(this, function (_d) {
1270
1202
  switch (_d.label) {
@@ -1301,14 +1233,14 @@ var deserializeAws_restJson1PutRecommendationFeedbackCommandError = function (ou
1301
1233
  case 11: throw _d.sent();
1302
1234
  case 12:
1303
1235
  parsedBody = parsedOutput.body;
1304
- $metadata = deserializeMetadata(output);
1305
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1306
- response = new __BaseException({
1307
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1308
- $fault: "client",
1309
- $metadata: $metadata,
1236
+ throwDefaultError({
1237
+ output: output,
1238
+ parsedBody: parsedBody,
1239
+ exceptionCtor: __BaseException,
1240
+ errorCode: errorCode,
1310
1241
  });
1311
- throw __decorateServiceException(response, parsedBody);
1242
+ _d.label = 13;
1243
+ case 13: return [2];
1312
1244
  }
1313
1245
  });
1314
1246
  }); };
@@ -1320,18 +1252,18 @@ export var deserializeAws_restJson1TagResourceCommand = function (output, contex
1320
1252
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1321
1253
  return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
1322
1254
  }
1323
- contents = {
1255
+ contents = map({
1324
1256
  $metadata: deserializeMetadata(output),
1325
- };
1257
+ });
1326
1258
  return [4, collectBody(output.body, context)];
1327
1259
  case 1:
1328
1260
  _a.sent();
1329
- return [2, Promise.resolve(contents)];
1261
+ return [2, contents];
1330
1262
  }
1331
1263
  });
1332
1264
  }); };
1333
1265
  var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1334
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1266
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1335
1267
  var _c;
1336
1268
  return __generator(this, function (_d) {
1337
1269
  switch (_d.label) {
@@ -1360,14 +1292,14 @@ var deserializeAws_restJson1TagResourceCommandError = function (output, context)
1360
1292
  case 7: throw _d.sent();
1361
1293
  case 8:
1362
1294
  parsedBody = parsedOutput.body;
1363
- $metadata = deserializeMetadata(output);
1364
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1365
- response = new __BaseException({
1366
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1367
- $fault: "client",
1368
- $metadata: $metadata,
1295
+ throwDefaultError({
1296
+ output: output,
1297
+ parsedBody: parsedBody,
1298
+ exceptionCtor: __BaseException,
1299
+ errorCode: errorCode,
1369
1300
  });
1370
- throw __decorateServiceException(response, parsedBody);
1301
+ _d.label = 9;
1302
+ case 9: return [2];
1371
1303
  }
1372
1304
  });
1373
1305
  }); };
@@ -1379,18 +1311,18 @@ export var deserializeAws_restJson1UntagResourceCommand = function (output, cont
1379
1311
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1380
1312
  return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
1381
1313
  }
1382
- contents = {
1314
+ contents = map({
1383
1315
  $metadata: deserializeMetadata(output),
1384
- };
1316
+ });
1385
1317
  return [4, collectBody(output.body, context)];
1386
1318
  case 1:
1387
1319
  _a.sent();
1388
- return [2, Promise.resolve(contents)];
1320
+ return [2, contents];
1389
1321
  }
1390
1322
  });
1391
1323
  }); };
1392
1324
  var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1393
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1325
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1394
1326
  var _c;
1395
1327
  return __generator(this, function (_d) {
1396
1328
  switch (_d.label) {
@@ -1419,23 +1351,24 @@ var deserializeAws_restJson1UntagResourceCommandError = function (output, contex
1419
1351
  case 7: throw _d.sent();
1420
1352
  case 8:
1421
1353
  parsedBody = parsedOutput.body;
1422
- $metadata = deserializeMetadata(output);
1423
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1424
- response = new __BaseException({
1425
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1426
- $fault: "client",
1427
- $metadata: $metadata,
1354
+ throwDefaultError({
1355
+ output: output,
1356
+ parsedBody: parsedBody,
1357
+ exceptionCtor: __BaseException,
1358
+ errorCode: errorCode,
1428
1359
  });
1429
- throw __decorateServiceException(response, parsedBody);
1360
+ _d.label = 9;
1361
+ case 9: return [2];
1430
1362
  }
1431
1363
  });
1432
1364
  }); };
1365
+ var map = __map;
1433
1366
  var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1434
1367
  var contents, data, exception;
1435
1368
  return __generator(this, function (_a) {
1436
- contents = {};
1369
+ contents = map({});
1437
1370
  data = parsedOutput.body;
1438
- if (data.Message !== undefined && data.Message !== null) {
1371
+ if (data.Message != null) {
1439
1372
  contents.Message = __expectString(data.Message);
1440
1373
  }
1441
1374
  exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1445,9 +1378,9 @@ var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutp
1445
1378
  var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1446
1379
  var contents, data, exception;
1447
1380
  return __generator(this, function (_a) {
1448
- contents = {};
1381
+ contents = map({});
1449
1382
  data = parsedOutput.body;
1450
- if (data.Message !== undefined && data.Message !== null) {
1383
+ if (data.Message != null) {
1451
1384
  contents.Message = __expectString(data.Message);
1452
1385
  }
1453
1386
  exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1457,9 +1390,9 @@ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput,
1457
1390
  var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1458
1391
  var contents, data, exception;
1459
1392
  return __generator(this, function (_a) {
1460
- contents = {};
1393
+ contents = map({});
1461
1394
  data = parsedOutput.body;
1462
- if (data.Message !== undefined && data.Message !== null) {
1395
+ if (data.Message != null) {
1463
1396
  contents.Message = __expectString(data.Message);
1464
1397
  }
1465
1398
  exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1469,9 +1402,9 @@ var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOu
1469
1402
  var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1470
1403
  var contents, data, exception;
1471
1404
  return __generator(this, function (_a) {
1472
- contents = {};
1405
+ contents = map({});
1473
1406
  data = parsedOutput.body;
1474
- if (data.Message !== undefined && data.Message !== null) {
1407
+ if (data.Message != null) {
1475
1408
  contents.Message = __expectString(data.Message);
1476
1409
  }
1477
1410
  exception = new NotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1481,9 +1414,9 @@ var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput,
1481
1414
  var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1482
1415
  var contents, data, exception;
1483
1416
  return __generator(this, function (_a) {
1484
- contents = {};
1417
+ contents = map({});
1485
1418
  data = parsedOutput.body;
1486
- if (data.Message !== undefined && data.Message !== null) {
1419
+ if (data.Message != null) {
1487
1420
  contents.Message = __expectString(data.Message);
1488
1421
  }
1489
1422
  exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1493,9 +1426,9 @@ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsed
1493
1426
  var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1494
1427
  var contents, data, exception;
1495
1428
  return __generator(this, function (_a) {
1496
- contents = {};
1429
+ contents = map({});
1497
1430
  data = parsedOutput.body;
1498
- if (data.Message !== undefined && data.Message !== null) {
1431
+ if (data.Message != null) {
1499
1432
  contents.Message = __expectString(data.Message);
1500
1433
  }
1501
1434
  exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1505,9 +1438,9 @@ var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput
1505
1438
  var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1506
1439
  var contents, data, exception;
1507
1440
  return __generator(this, function (_a) {
1508
- contents = {};
1441
+ contents = map({});
1509
1442
  data = parsedOutput.body;
1510
- if (data.Message !== undefined && data.Message !== null) {
1443
+ if (data.Message != null) {
1511
1444
  contents.Message = __expectString(data.Message);
1512
1445
  }
1513
1446
  exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1518,9 +1451,6 @@ var serializeAws_restJson1AnalysisTypes = function (input, context) {
1518
1451
  return input
1519
1452
  .filter(function (e) { return e != null; })
1520
1453
  .map(function (entry) {
1521
- if (entry === null) {
1522
- return null;
1523
- }
1524
1454
  return entry;
1525
1455
  });
1526
1456
  };
@@ -1555,9 +1485,6 @@ var serializeAws_restJson1Reactions = function (input, context) {
1555
1485
  return input
1556
1486
  .filter(function (e) { return e != null; })
1557
1487
  .map(function (entry) {
1558
- if (entry === null) {
1559
- return null;
1560
- }
1561
1488
  return entry;
1562
1489
  });
1563
1490
  };