@aws-sdk/client-codeguru-reviewer 3.187.0 → 3.190.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.
Files changed (32) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist-es/CodeGuruReviewer.js +58 -65
  3. package/dist-es/CodeGuruReviewerClient.js +22 -28
  4. package/dist-es/commands/AssociateRepositoryCommand.js +21 -28
  5. package/dist-es/commands/CreateCodeReviewCommand.js +21 -28
  6. package/dist-es/commands/DescribeCodeReviewCommand.js +21 -28
  7. package/dist-es/commands/DescribeRecommendationFeedbackCommand.js +21 -28
  8. package/dist-es/commands/DescribeRepositoryAssociationCommand.js +21 -28
  9. package/dist-es/commands/DisassociateRepositoryCommand.js +21 -28
  10. package/dist-es/commands/ListCodeReviewsCommand.js +21 -28
  11. package/dist-es/commands/ListRecommendationFeedbackCommand.js +21 -28
  12. package/dist-es/commands/ListRecommendationsCommand.js +21 -28
  13. package/dist-es/commands/ListRepositoryAssociationsCommand.js +21 -28
  14. package/dist-es/commands/ListTagsForResourceCommand.js +21 -28
  15. package/dist-es/commands/PutRecommendationFeedbackCommand.js +21 -28
  16. package/dist-es/commands/TagResourceCommand.js +21 -28
  17. package/dist-es/commands/UntagResourceCommand.js +21 -28
  18. package/dist-es/endpoints.js +8 -8
  19. package/dist-es/models/CodeGuruReviewerServiceException.js +5 -10
  20. package/dist-es/models/models_0.js +246 -139
  21. package/dist-es/pagination/ListCodeReviewsPaginator.js +25 -68
  22. package/dist-es/pagination/ListRecommendationFeedbackPaginator.js +25 -68
  23. package/dist-es/pagination/ListRecommendationsPaginator.js +25 -68
  24. package/dist-es/pagination/ListRepositoryAssociationsPaginator.js +25 -68
  25. package/dist-es/protocols/Aws_restJson1.js +1180 -1577
  26. package/dist-es/runtimeConfig.browser.js +26 -12
  27. package/dist-es/runtimeConfig.js +30 -12
  28. package/dist-es/runtimeConfig.native.js +8 -5
  29. package/dist-es/runtimeConfig.shared.js +8 -11
  30. package/dist-es/waiters/waitForCodeReviewCompleted.js +45 -65
  31. package/dist-es/waiters/waitForRepositoryAssociationSucceeded.js +45 -65
  32. package/package.json +34 -34
@@ -1,1556 +1,1176 @@
1
- import { __assign, __awaiter, __generator, __read } from "tslib";
2
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
2
  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
3
  import { v4 as generateIdempotencyToken } from "uuid";
5
4
  import { CodeGuruReviewerServiceException as __BaseException } from "../models/CodeGuruReviewerServiceException";
6
5
  import { AccessDeniedException, ConflictException, InternalServerException, NotFoundException, ResourceNotFoundException, ThrottlingException, ValidationException, } from "../models/models_0";
7
- export var serializeAws_restJson1AssociateRepositoryCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
8
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
9
- var _c;
10
- return __generator(this, function (_d) {
11
- switch (_d.label) {
12
- case 0: return [4, context.endpoint()];
13
- case 1:
14
- _a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
15
- headers = {
16
- "content-type": "application/json",
17
- };
18
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/associations";
19
- body = JSON.stringify(__assign(__assign(__assign({ ClientRequestToken: (_c = input.ClientRequestToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.KMSKeyDetails != null && {
20
- KMSKeyDetails: serializeAws_restJson1KMSKeyDetails(input.KMSKeyDetails, context),
21
- })), (input.Repository != null && { Repository: serializeAws_restJson1Repository(input.Repository, context) })), (input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) })));
22
- return [2, new __HttpRequest({
23
- protocol: protocol,
24
- hostname: hostname,
25
- port: port,
26
- method: "POST",
27
- headers: headers,
28
- path: resolvedPath,
29
- body: body,
30
- })];
31
- }
32
- });
33
- }); };
34
- export var serializeAws_restJson1CreateCodeReviewCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
35
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
36
- var _c;
37
- return __generator(this, function (_d) {
38
- switch (_d.label) {
39
- case 0: return [4, context.endpoint()];
40
- case 1:
41
- _a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
42
- headers = {
43
- "content-type": "application/json",
44
- };
45
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/codereviews";
46
- body = JSON.stringify(__assign(__assign(__assign({ ClientRequestToken: (_c = input.ClientRequestToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.Name != null && { Name: input.Name })), (input.RepositoryAssociationArn != null && { RepositoryAssociationArn: input.RepositoryAssociationArn })), (input.Type != null && { Type: serializeAws_restJson1CodeReviewType(input.Type, context) })));
47
- return [2, new __HttpRequest({
48
- protocol: protocol,
49
- hostname: hostname,
50
- port: port,
51
- method: "POST",
52
- headers: headers,
53
- path: resolvedPath,
54
- body: body,
55
- })];
56
- }
57
- });
58
- }); };
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, body;
61
- return __generator(this, function (_c) {
62
- switch (_c.label) {
63
- case 0: return [4, context.endpoint()];
64
- case 1:
65
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
66
- headers = {};
67
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/codereviews/{CodeReviewArn}";
68
- resolvedPath = __resolvedPath(resolvedPath, input, "CodeReviewArn", function () { return input.CodeReviewArn; }, "{CodeReviewArn}", false);
69
- return [2, new __HttpRequest({
70
- protocol: protocol,
71
- hostname: hostname,
72
- port: port,
73
- method: "GET",
74
- headers: headers,
75
- path: resolvedPath,
76
- body: body,
77
- })];
78
- }
79
- });
80
- }); };
81
- export var serializeAws_restJson1DescribeRecommendationFeedbackCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
82
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
83
- return __generator(this, function (_c) {
84
- switch (_c.label) {
85
- case 0: return [4, context.endpoint()];
86
- case 1:
87
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
88
- headers = {};
89
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/feedback/{CodeReviewArn}";
90
- resolvedPath = __resolvedPath(resolvedPath, input, "CodeReviewArn", function () { return input.CodeReviewArn; }, "{CodeReviewArn}", false);
91
- query = map({
92
- RecommendationId: [, input.RecommendationId],
93
- UserId: [, input.UserId],
94
- });
95
- return [2, new __HttpRequest({
96
- protocol: protocol,
97
- hostname: hostname,
98
- port: port,
99
- method: "GET",
100
- headers: headers,
101
- path: resolvedPath,
102
- query: query,
103
- body: body,
104
- })];
105
- }
106
- });
107
- }); };
108
- export var serializeAws_restJson1DescribeRepositoryAssociationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
109
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
110
- return __generator(this, function (_c) {
111
- switch (_c.label) {
112
- case 0: return [4, context.endpoint()];
113
- case 1:
114
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
115
- headers = {};
116
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/associations/{AssociationArn}";
117
- resolvedPath = __resolvedPath(resolvedPath, input, "AssociationArn", function () { return input.AssociationArn; }, "{AssociationArn}", false);
118
- return [2, new __HttpRequest({
119
- protocol: protocol,
120
- hostname: hostname,
121
- port: port,
122
- method: "GET",
123
- headers: headers,
124
- path: resolvedPath,
125
- body: body,
126
- })];
127
- }
6
+ export const serializeAws_restJson1AssociateRepositoryCommand = async (input, context) => {
7
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
8
+ const headers = {
9
+ "content-type": "application/json",
10
+ };
11
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/associations";
12
+ let body;
13
+ body = JSON.stringify({
14
+ ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(),
15
+ ...(input.KMSKeyDetails != null && {
16
+ KMSKeyDetails: serializeAws_restJson1KMSKeyDetails(input.KMSKeyDetails, context),
17
+ }),
18
+ ...(input.Repository != null && { Repository: serializeAws_restJson1Repository(input.Repository, context) }),
19
+ ...(input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }),
128
20
  });
129
- }); };
130
- export var serializeAws_restJson1DisassociateRepositoryCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
131
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
132
- return __generator(this, function (_c) {
133
- switch (_c.label) {
134
- case 0: return [4, context.endpoint()];
135
- case 1:
136
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
137
- headers = {};
138
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/associations/{AssociationArn}";
139
- resolvedPath = __resolvedPath(resolvedPath, input, "AssociationArn", function () { return input.AssociationArn; }, "{AssociationArn}", false);
140
- return [2, new __HttpRequest({
141
- protocol: protocol,
142
- hostname: hostname,
143
- port: port,
144
- method: "DELETE",
145
- headers: headers,
146
- path: resolvedPath,
147
- body: body,
148
- })];
149
- }
21
+ return new __HttpRequest({
22
+ protocol,
23
+ hostname,
24
+ port,
25
+ method: "POST",
26
+ headers,
27
+ path: resolvedPath,
28
+ body,
150
29
  });
151
- }); };
152
- export var serializeAws_restJson1ListCodeReviewsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
153
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
154
- return __generator(this, function (_c) {
155
- switch (_c.label) {
156
- case 0: return [4, context.endpoint()];
157
- case 1:
158
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
159
- headers = {};
160
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/codereviews";
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
- });
175
- return [2, new __HttpRequest({
176
- protocol: protocol,
177
- hostname: hostname,
178
- port: port,
179
- method: "GET",
180
- headers: headers,
181
- path: resolvedPath,
182
- query: query,
183
- body: body,
184
- })];
185
- }
30
+ };
31
+ export const serializeAws_restJson1CreateCodeReviewCommand = async (input, context) => {
32
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
33
+ const headers = {
34
+ "content-type": "application/json",
35
+ };
36
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/codereviews";
37
+ let body;
38
+ body = JSON.stringify({
39
+ ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(),
40
+ ...(input.Name != null && { Name: input.Name }),
41
+ ...(input.RepositoryAssociationArn != null && { RepositoryAssociationArn: input.RepositoryAssociationArn }),
42
+ ...(input.Type != null && { Type: serializeAws_restJson1CodeReviewType(input.Type, context) }),
186
43
  });
187
- }); };
188
- export var serializeAws_restJson1ListRecommendationFeedbackCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
189
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
190
- return __generator(this, function (_c) {
191
- switch (_c.label) {
192
- case 0: return [4, context.endpoint()];
193
- case 1:
194
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
195
- headers = {};
196
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
197
- "/feedback/{CodeReviewArn}/RecommendationFeedback";
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
- });
208
- return [2, new __HttpRequest({
209
- protocol: protocol,
210
- hostname: hostname,
211
- port: port,
212
- method: "GET",
213
- headers: headers,
214
- path: resolvedPath,
215
- query: query,
216
- body: body,
217
- })];
218
- }
44
+ return new __HttpRequest({
45
+ protocol,
46
+ hostname,
47
+ port,
48
+ method: "POST",
49
+ headers,
50
+ path: resolvedPath,
51
+ body,
219
52
  });
220
- }); };
221
- export var serializeAws_restJson1ListRecommendationsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
222
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
223
- return __generator(this, function (_c) {
224
- switch (_c.label) {
225
- case 0: return [4, context.endpoint()];
226
- case 1:
227
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
228
- headers = {};
229
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
230
- "/codereviews/{CodeReviewArn}/Recommendations";
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
- });
236
- return [2, new __HttpRequest({
237
- protocol: protocol,
238
- hostname: hostname,
239
- port: port,
240
- method: "GET",
241
- headers: headers,
242
- path: resolvedPath,
243
- query: query,
244
- body: body,
245
- })];
246
- }
53
+ };
54
+ export const serializeAws_restJson1DescribeCodeReviewCommand = async (input, context) => {
55
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
56
+ const headers = {};
57
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/codereviews/{CodeReviewArn}";
58
+ resolvedPath = __resolvedPath(resolvedPath, input, "CodeReviewArn", () => input.CodeReviewArn, "{CodeReviewArn}", false);
59
+ let body;
60
+ return new __HttpRequest({
61
+ protocol,
62
+ hostname,
63
+ port,
64
+ method: "GET",
65
+ headers,
66
+ path: resolvedPath,
67
+ body,
247
68
  });
248
- }); };
249
- export var serializeAws_restJson1ListRepositoryAssociationsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
250
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
251
- return __generator(this, function (_c) {
252
- switch (_c.label) {
253
- case 0: return [4, context.endpoint()];
254
- case 1:
255
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
256
- headers = {};
257
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/associations";
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
- });
269
- return [2, new __HttpRequest({
270
- protocol: protocol,
271
- hostname: hostname,
272
- port: port,
273
- method: "GET",
274
- headers: headers,
275
- path: resolvedPath,
276
- query: query,
277
- body: body,
278
- })];
279
- }
69
+ };
70
+ export const serializeAws_restJson1DescribeRecommendationFeedbackCommand = async (input, context) => {
71
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
72
+ const headers = {};
73
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/feedback/{CodeReviewArn}";
74
+ resolvedPath = __resolvedPath(resolvedPath, input, "CodeReviewArn", () => input.CodeReviewArn, "{CodeReviewArn}", false);
75
+ const query = map({
76
+ RecommendationId: [, input.RecommendationId],
77
+ UserId: [, input.UserId],
280
78
  });
281
- }); };
282
- export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
283
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
284
- return __generator(this, function (_c) {
285
- switch (_c.label) {
286
- case 0: return [4, context.endpoint()];
287
- case 1:
288
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
289
- headers = {};
290
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
291
- resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
292
- return [2, new __HttpRequest({
293
- protocol: protocol,
294
- hostname: hostname,
295
- port: port,
296
- method: "GET",
297
- headers: headers,
298
- path: resolvedPath,
299
- body: body,
300
- })];
301
- }
79
+ let body;
80
+ return new __HttpRequest({
81
+ protocol,
82
+ hostname,
83
+ port,
84
+ method: "GET",
85
+ headers,
86
+ path: resolvedPath,
87
+ query,
88
+ body,
302
89
  });
303
- }); };
304
- export var serializeAws_restJson1PutRecommendationFeedbackCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
305
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
306
- return __generator(this, function (_c) {
307
- switch (_c.label) {
308
- case 0: return [4, context.endpoint()];
309
- case 1:
310
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
311
- headers = {
312
- "content-type": "application/json",
313
- };
314
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/feedback";
315
- body = JSON.stringify(__assign(__assign(__assign({}, (input.CodeReviewArn != null && { CodeReviewArn: input.CodeReviewArn })), (input.Reactions != null && { Reactions: serializeAws_restJson1Reactions(input.Reactions, context) })), (input.RecommendationId != null && { RecommendationId: input.RecommendationId })));
316
- return [2, new __HttpRequest({
317
- protocol: protocol,
318
- hostname: hostname,
319
- port: port,
320
- method: "PUT",
321
- headers: headers,
322
- path: resolvedPath,
323
- body: body,
324
- })];
325
- }
90
+ };
91
+ export const serializeAws_restJson1DescribeRepositoryAssociationCommand = async (input, context) => {
92
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
93
+ const headers = {};
94
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/associations/{AssociationArn}";
95
+ resolvedPath = __resolvedPath(resolvedPath, input, "AssociationArn", () => input.AssociationArn, "{AssociationArn}", false);
96
+ let body;
97
+ return new __HttpRequest({
98
+ protocol,
99
+ hostname,
100
+ port,
101
+ method: "GET",
102
+ headers,
103
+ path: resolvedPath,
104
+ body,
326
105
  });
327
- }); };
328
- export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
329
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
330
- return __generator(this, function (_c) {
331
- switch (_c.label) {
332
- case 0: return [4, context.endpoint()];
333
- case 1:
334
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
335
- headers = {
336
- "content-type": "application/json",
337
- };
338
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
339
- resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
340
- body = JSON.stringify(__assign({}, (input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) })));
341
- return [2, new __HttpRequest({
342
- protocol: protocol,
343
- hostname: hostname,
344
- port: port,
345
- method: "POST",
346
- headers: headers,
347
- path: resolvedPath,
348
- body: body,
349
- })];
350
- }
106
+ };
107
+ export const serializeAws_restJson1DisassociateRepositoryCommand = async (input, context) => {
108
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
109
+ const headers = {};
110
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/associations/{AssociationArn}";
111
+ resolvedPath = __resolvedPath(resolvedPath, input, "AssociationArn", () => input.AssociationArn, "{AssociationArn}", false);
112
+ let body;
113
+ return new __HttpRequest({
114
+ protocol,
115
+ hostname,
116
+ port,
117
+ method: "DELETE",
118
+ headers,
119
+ path: resolvedPath,
120
+ body,
351
121
  });
352
- }); };
353
- export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
354
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
355
- return __generator(this, function (_c) {
356
- switch (_c.label) {
357
- case 0: return [4, context.endpoint()];
358
- case 1:
359
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
360
- headers = {};
361
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
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
- });
366
- return [2, new __HttpRequest({
367
- protocol: protocol,
368
- hostname: hostname,
369
- port: port,
370
- method: "DELETE",
371
- headers: headers,
372
- path: resolvedPath,
373
- query: query,
374
- body: body,
375
- })];
376
- }
122
+ };
123
+ export const serializeAws_restJson1ListCodeReviewsCommand = async (input, context) => {
124
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
125
+ const headers = {};
126
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/codereviews";
127
+ const query = map({
128
+ ProviderTypes: [
129
+ () => input.ProviderTypes !== void 0,
130
+ () => (input.ProviderTypes || []).map((_entry) => _entry),
131
+ ],
132
+ States: [() => input.States !== void 0, () => (input.States || []).map((_entry) => _entry)],
133
+ RepositoryNames: [
134
+ () => input.RepositoryNames !== void 0,
135
+ () => (input.RepositoryNames || []).map((_entry) => _entry),
136
+ ],
137
+ Type: [, input.Type],
138
+ MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
139
+ NextToken: [, input.NextToken],
377
140
  });
378
- }); };
379
- export var deserializeAws_restJson1AssociateRepositoryCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
380
- var contents, data, _a, _b;
381
- return __generator(this, function (_c) {
382
- switch (_c.label) {
383
- case 0:
384
- if (output.statusCode !== 200 && output.statusCode >= 300) {
385
- return [2, deserializeAws_restJson1AssociateRepositoryCommandError(output, context)];
386
- }
387
- contents = map({
388
- $metadata: deserializeMetadata(output),
389
- });
390
- _a = __expectNonNull;
391
- _b = __expectObject;
392
- return [4, parseBody(output.body, context)];
393
- case 1:
394
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
395
- if (data.RepositoryAssociation != null) {
396
- contents.RepositoryAssociation = deserializeAws_restJson1RepositoryAssociation(data.RepositoryAssociation, context);
397
- }
398
- if (data.Tags != null) {
399
- contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
400
- }
401
- return [2, contents];
402
- }
141
+ let body;
142
+ return new __HttpRequest({
143
+ protocol,
144
+ hostname,
145
+ port,
146
+ method: "GET",
147
+ headers,
148
+ path: resolvedPath,
149
+ query,
150
+ body,
403
151
  });
404
- }); };
405
- var deserializeAws_restJson1AssociateRepositoryCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
406
- var parsedOutput, _a, errorCode, _b, parsedBody;
407
- var _c;
408
- return __generator(this, function (_d) {
409
- switch (_d.label) {
410
- case 0:
411
- _a = [__assign({}, output)];
412
- _c = {};
413
- return [4, parseErrorBody(output.body, context)];
414
- case 1:
415
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
416
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
417
- _b = errorCode;
418
- switch (_b) {
419
- case "AccessDeniedException": return [3, 2];
420
- case "com.amazonaws.codegurureviewer#AccessDeniedException": return [3, 2];
421
- case "ConflictException": return [3, 4];
422
- case "com.amazonaws.codegurureviewer#ConflictException": return [3, 4];
423
- case "InternalServerException": return [3, 6];
424
- case "com.amazonaws.codegurureviewer#InternalServerException": return [3, 6];
425
- case "ThrottlingException": return [3, 8];
426
- case "com.amazonaws.codegurureviewer#ThrottlingException": return [3, 8];
427
- case "ValidationException": return [3, 10];
428
- case "com.amazonaws.codegurureviewer#ValidationException": return [3, 10];
429
- }
430
- return [3, 12];
431
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
432
- case 3: throw _d.sent();
433
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
434
- case 5: throw _d.sent();
435
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
436
- case 7: throw _d.sent();
437
- case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
438
- case 9: throw _d.sent();
439
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
440
- case 11: throw _d.sent();
441
- case 12:
442
- parsedBody = parsedOutput.body;
443
- throwDefaultError({
444
- output: output,
445
- parsedBody: parsedBody,
446
- exceptionCtor: __BaseException,
447
- errorCode: errorCode,
448
- });
449
- _d.label = 13;
450
- case 13: return [2];
451
- }
152
+ };
153
+ export const serializeAws_restJson1ListRecommendationFeedbackCommand = async (input, context) => {
154
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
155
+ const headers = {};
156
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
157
+ "/feedback/{CodeReviewArn}/RecommendationFeedback";
158
+ resolvedPath = __resolvedPath(resolvedPath, input, "CodeReviewArn", () => input.CodeReviewArn, "{CodeReviewArn}", false);
159
+ const query = map({
160
+ NextToken: [, input.NextToken],
161
+ MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
162
+ UserIds: [() => input.UserIds !== void 0, () => (input.UserIds || []).map((_entry) => _entry)],
163
+ RecommendationIds: [
164
+ () => input.RecommendationIds !== void 0,
165
+ () => (input.RecommendationIds || []).map((_entry) => _entry),
166
+ ],
452
167
  });
453
- }); };
454
- export var deserializeAws_restJson1CreateCodeReviewCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
455
- var contents, data, _a, _b;
456
- return __generator(this, function (_c) {
457
- switch (_c.label) {
458
- case 0:
459
- if (output.statusCode !== 200 && output.statusCode >= 300) {
460
- return [2, deserializeAws_restJson1CreateCodeReviewCommandError(output, context)];
461
- }
462
- contents = map({
463
- $metadata: deserializeMetadata(output),
464
- });
465
- _a = __expectNonNull;
466
- _b = __expectObject;
467
- return [4, parseBody(output.body, context)];
468
- case 1:
469
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
470
- if (data.CodeReview != null) {
471
- contents.CodeReview = deserializeAws_restJson1CodeReview(data.CodeReview, context);
472
- }
473
- return [2, contents];
474
- }
168
+ let body;
169
+ return new __HttpRequest({
170
+ protocol,
171
+ hostname,
172
+ port,
173
+ method: "GET",
174
+ headers,
175
+ path: resolvedPath,
176
+ query,
177
+ body,
475
178
  });
476
- }); };
477
- var deserializeAws_restJson1CreateCodeReviewCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
478
- var parsedOutput, _a, errorCode, _b, parsedBody;
479
- var _c;
480
- return __generator(this, function (_d) {
481
- switch (_d.label) {
482
- case 0:
483
- _a = [__assign({}, output)];
484
- _c = {};
485
- return [4, parseErrorBody(output.body, context)];
486
- case 1:
487
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
488
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
489
- _b = errorCode;
490
- switch (_b) {
491
- case "AccessDeniedException": return [3, 2];
492
- case "com.amazonaws.codegurureviewer#AccessDeniedException": return [3, 2];
493
- case "ConflictException": return [3, 4];
494
- case "com.amazonaws.codegurureviewer#ConflictException": return [3, 4];
495
- case "InternalServerException": return [3, 6];
496
- case "com.amazonaws.codegurureviewer#InternalServerException": return [3, 6];
497
- case "ResourceNotFoundException": return [3, 8];
498
- case "com.amazonaws.codegurureviewer#ResourceNotFoundException": return [3, 8];
499
- case "ThrottlingException": return [3, 10];
500
- case "com.amazonaws.codegurureviewer#ThrottlingException": return [3, 10];
501
- case "ValidationException": return [3, 12];
502
- case "com.amazonaws.codegurureviewer#ValidationException": return [3, 12];
503
- }
504
- return [3, 14];
505
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
506
- case 3: throw _d.sent();
507
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
508
- case 5: throw _d.sent();
509
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
510
- case 7: throw _d.sent();
511
- case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
512
- case 9: throw _d.sent();
513
- case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
514
- case 11: throw _d.sent();
515
- case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
516
- case 13: throw _d.sent();
517
- case 14:
518
- parsedBody = parsedOutput.body;
519
- throwDefaultError({
520
- output: output,
521
- parsedBody: parsedBody,
522
- exceptionCtor: __BaseException,
523
- errorCode: errorCode,
524
- });
525
- _d.label = 15;
526
- case 15: return [2];
527
- }
179
+ };
180
+ export const serializeAws_restJson1ListRecommendationsCommand = async (input, context) => {
181
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
182
+ const headers = {};
183
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
184
+ "/codereviews/{CodeReviewArn}/Recommendations";
185
+ resolvedPath = __resolvedPath(resolvedPath, input, "CodeReviewArn", () => input.CodeReviewArn, "{CodeReviewArn}", false);
186
+ const query = map({
187
+ NextToken: [, input.NextToken],
188
+ MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
528
189
  });
529
- }); };
530
- export var deserializeAws_restJson1DescribeCodeReviewCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
531
- var contents, data, _a, _b;
532
- return __generator(this, function (_c) {
533
- switch (_c.label) {
534
- case 0:
535
- if (output.statusCode !== 200 && output.statusCode >= 300) {
536
- return [2, deserializeAws_restJson1DescribeCodeReviewCommandError(output, context)];
537
- }
538
- contents = map({
539
- $metadata: deserializeMetadata(output),
540
- });
541
- _a = __expectNonNull;
542
- _b = __expectObject;
543
- return [4, parseBody(output.body, context)];
544
- case 1:
545
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
546
- if (data.CodeReview != null) {
547
- contents.CodeReview = deserializeAws_restJson1CodeReview(data.CodeReview, context);
548
- }
549
- return [2, contents];
550
- }
190
+ let body;
191
+ return new __HttpRequest({
192
+ protocol,
193
+ hostname,
194
+ port,
195
+ method: "GET",
196
+ headers,
197
+ path: resolvedPath,
198
+ query,
199
+ body,
551
200
  });
552
- }); };
553
- var deserializeAws_restJson1DescribeCodeReviewCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
554
- var parsedOutput, _a, errorCode, _b, parsedBody;
555
- var _c;
556
- return __generator(this, function (_d) {
557
- switch (_d.label) {
558
- case 0:
559
- _a = [__assign({}, output)];
560
- _c = {};
561
- return [4, parseErrorBody(output.body, context)];
562
- case 1:
563
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
564
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
565
- _b = errorCode;
566
- switch (_b) {
567
- case "AccessDeniedException": return [3, 2];
568
- case "com.amazonaws.codegurureviewer#AccessDeniedException": return [3, 2];
569
- case "InternalServerException": return [3, 4];
570
- case "com.amazonaws.codegurureviewer#InternalServerException": return [3, 4];
571
- case "ResourceNotFoundException": return [3, 6];
572
- case "com.amazonaws.codegurureviewer#ResourceNotFoundException": return [3, 6];
573
- case "ThrottlingException": return [3, 8];
574
- case "com.amazonaws.codegurureviewer#ThrottlingException": return [3, 8];
575
- case "ValidationException": return [3, 10];
576
- case "com.amazonaws.codegurureviewer#ValidationException": return [3, 10];
577
- }
578
- return [3, 12];
579
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
580
- case 3: throw _d.sent();
581
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
582
- case 5: throw _d.sent();
583
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
584
- case 7: throw _d.sent();
585
- case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
586
- case 9: throw _d.sent();
587
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
588
- case 11: throw _d.sent();
589
- case 12:
590
- parsedBody = parsedOutput.body;
591
- throwDefaultError({
592
- output: output,
593
- parsedBody: parsedBody,
594
- exceptionCtor: __BaseException,
595
- errorCode: errorCode,
596
- });
597
- _d.label = 13;
598
- case 13: return [2];
599
- }
201
+ };
202
+ export const serializeAws_restJson1ListRepositoryAssociationsCommand = async (input, context) => {
203
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
204
+ const headers = {};
205
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/associations";
206
+ const query = map({
207
+ ProviderType: [
208
+ () => input.ProviderTypes !== void 0,
209
+ () => (input.ProviderTypes || []).map((_entry) => _entry),
210
+ ],
211
+ State: [() => input.States !== void 0, () => (input.States || []).map((_entry) => _entry)],
212
+ Name: [() => input.Names !== void 0, () => (input.Names || []).map((_entry) => _entry)],
213
+ Owner: [() => input.Owners !== void 0, () => (input.Owners || []).map((_entry) => _entry)],
214
+ MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
215
+ NextToken: [, input.NextToken],
600
216
  });
601
- }); };
602
- export var deserializeAws_restJson1DescribeRecommendationFeedbackCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
603
- var contents, data, _a, _b;
604
- return __generator(this, function (_c) {
605
- switch (_c.label) {
606
- case 0:
607
- if (output.statusCode !== 200 && output.statusCode >= 300) {
608
- return [2, deserializeAws_restJson1DescribeRecommendationFeedbackCommandError(output, context)];
609
- }
610
- contents = map({
611
- $metadata: deserializeMetadata(output),
612
- });
613
- _a = __expectNonNull;
614
- _b = __expectObject;
615
- return [4, parseBody(output.body, context)];
616
- case 1:
617
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
618
- if (data.RecommendationFeedback != null) {
619
- contents.RecommendationFeedback = deserializeAws_restJson1RecommendationFeedback(data.RecommendationFeedback, context);
620
- }
621
- return [2, contents];
622
- }
217
+ let body;
218
+ return new __HttpRequest({
219
+ protocol,
220
+ hostname,
221
+ port,
222
+ method: "GET",
223
+ headers,
224
+ path: resolvedPath,
225
+ query,
226
+ body,
623
227
  });
624
- }); };
625
- var deserializeAws_restJson1DescribeRecommendationFeedbackCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
626
- var parsedOutput, _a, errorCode, _b, parsedBody;
627
- var _c;
628
- return __generator(this, function (_d) {
629
- switch (_d.label) {
630
- case 0:
631
- _a = [__assign({}, output)];
632
- _c = {};
633
- return [4, parseErrorBody(output.body, context)];
634
- case 1:
635
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
636
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
637
- _b = errorCode;
638
- switch (_b) {
639
- case "AccessDeniedException": return [3, 2];
640
- case "com.amazonaws.codegurureviewer#AccessDeniedException": return [3, 2];
641
- case "InternalServerException": return [3, 4];
642
- case "com.amazonaws.codegurureviewer#InternalServerException": return [3, 4];
643
- case "ResourceNotFoundException": return [3, 6];
644
- case "com.amazonaws.codegurureviewer#ResourceNotFoundException": return [3, 6];
645
- case "ThrottlingException": return [3, 8];
646
- case "com.amazonaws.codegurureviewer#ThrottlingException": return [3, 8];
647
- case "ValidationException": return [3, 10];
648
- case "com.amazonaws.codegurureviewer#ValidationException": return [3, 10];
649
- }
650
- return [3, 12];
651
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
652
- case 3: throw _d.sent();
653
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
654
- case 5: throw _d.sent();
655
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
656
- case 7: throw _d.sent();
657
- case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
658
- case 9: throw _d.sent();
659
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
660
- case 11: throw _d.sent();
661
- case 12:
662
- parsedBody = parsedOutput.body;
663
- throwDefaultError({
664
- output: output,
665
- parsedBody: parsedBody,
666
- exceptionCtor: __BaseException,
667
- errorCode: errorCode,
668
- });
669
- _d.label = 13;
670
- case 13: return [2];
671
- }
228
+ };
229
+ export const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
230
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
231
+ const headers = {};
232
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
233
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
234
+ let body;
235
+ return new __HttpRequest({
236
+ protocol,
237
+ hostname,
238
+ port,
239
+ method: "GET",
240
+ headers,
241
+ path: resolvedPath,
242
+ body,
672
243
  });
673
- }); };
674
- export var deserializeAws_restJson1DescribeRepositoryAssociationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
675
- var contents, data, _a, _b;
676
- return __generator(this, function (_c) {
677
- switch (_c.label) {
678
- case 0:
679
- if (output.statusCode !== 200 && output.statusCode >= 300) {
680
- return [2, deserializeAws_restJson1DescribeRepositoryAssociationCommandError(output, context)];
681
- }
682
- contents = map({
683
- $metadata: deserializeMetadata(output),
684
- });
685
- _a = __expectNonNull;
686
- _b = __expectObject;
687
- return [4, parseBody(output.body, context)];
688
- case 1:
689
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
690
- if (data.RepositoryAssociation != null) {
691
- contents.RepositoryAssociation = deserializeAws_restJson1RepositoryAssociation(data.RepositoryAssociation, context);
692
- }
693
- if (data.Tags != null) {
694
- contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
695
- }
696
- return [2, contents];
697
- }
244
+ };
245
+ export const serializeAws_restJson1PutRecommendationFeedbackCommand = async (input, context) => {
246
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
247
+ const headers = {
248
+ "content-type": "application/json",
249
+ };
250
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/feedback";
251
+ let body;
252
+ body = JSON.stringify({
253
+ ...(input.CodeReviewArn != null && { CodeReviewArn: input.CodeReviewArn }),
254
+ ...(input.Reactions != null && { Reactions: serializeAws_restJson1Reactions(input.Reactions, context) }),
255
+ ...(input.RecommendationId != null && { RecommendationId: input.RecommendationId }),
698
256
  });
699
- }); };
700
- var deserializeAws_restJson1DescribeRepositoryAssociationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
701
- var parsedOutput, _a, errorCode, _b, parsedBody;
702
- var _c;
703
- return __generator(this, function (_d) {
704
- switch (_d.label) {
705
- case 0:
706
- _a = [__assign({}, output)];
707
- _c = {};
708
- return [4, parseErrorBody(output.body, context)];
709
- case 1:
710
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
711
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
712
- _b = errorCode;
713
- switch (_b) {
714
- case "AccessDeniedException": return [3, 2];
715
- case "com.amazonaws.codegurureviewer#AccessDeniedException": return [3, 2];
716
- case "InternalServerException": return [3, 4];
717
- case "com.amazonaws.codegurureviewer#InternalServerException": return [3, 4];
718
- case "NotFoundException": return [3, 6];
719
- case "com.amazonaws.codegurureviewer#NotFoundException": return [3, 6];
720
- case "ThrottlingException": return [3, 8];
721
- case "com.amazonaws.codegurureviewer#ThrottlingException": return [3, 8];
722
- case "ValidationException": return [3, 10];
723
- case "com.amazonaws.codegurureviewer#ValidationException": return [3, 10];
724
- }
725
- return [3, 12];
726
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
727
- case 3: throw _d.sent();
728
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
729
- case 5: throw _d.sent();
730
- case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
731
- case 7: throw _d.sent();
732
- case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
733
- case 9: throw _d.sent();
734
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
735
- case 11: throw _d.sent();
736
- case 12:
737
- parsedBody = parsedOutput.body;
738
- throwDefaultError({
739
- output: output,
740
- parsedBody: parsedBody,
741
- exceptionCtor: __BaseException,
742
- errorCode: errorCode,
743
- });
744
- _d.label = 13;
745
- case 13: return [2];
746
- }
257
+ return new __HttpRequest({
258
+ protocol,
259
+ hostname,
260
+ port,
261
+ method: "PUT",
262
+ headers,
263
+ path: resolvedPath,
264
+ body,
747
265
  });
748
- }); };
749
- export var deserializeAws_restJson1DisassociateRepositoryCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
750
- var contents, data, _a, _b;
751
- return __generator(this, function (_c) {
752
- switch (_c.label) {
753
- case 0:
754
- if (output.statusCode !== 200 && output.statusCode >= 300) {
755
- return [2, deserializeAws_restJson1DisassociateRepositoryCommandError(output, context)];
756
- }
757
- contents = map({
758
- $metadata: deserializeMetadata(output),
759
- });
760
- _a = __expectNonNull;
761
- _b = __expectObject;
762
- return [4, parseBody(output.body, context)];
763
- case 1:
764
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
765
- if (data.RepositoryAssociation != null) {
766
- contents.RepositoryAssociation = deserializeAws_restJson1RepositoryAssociation(data.RepositoryAssociation, context);
767
- }
768
- if (data.Tags != null) {
769
- contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
770
- }
771
- return [2, contents];
772
- }
266
+ };
267
+ export const serializeAws_restJson1TagResourceCommand = async (input, context) => {
268
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
269
+ const headers = {
270
+ "content-type": "application/json",
271
+ };
272
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
273
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
274
+ let body;
275
+ body = JSON.stringify({
276
+ ...(input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }),
773
277
  });
774
- }); };
775
- var deserializeAws_restJson1DisassociateRepositoryCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
776
- var parsedOutput, _a, errorCode, _b, parsedBody;
777
- var _c;
778
- return __generator(this, function (_d) {
779
- switch (_d.label) {
780
- case 0:
781
- _a = [__assign({}, output)];
782
- _c = {};
783
- return [4, parseErrorBody(output.body, context)];
784
- case 1:
785
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
786
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
787
- _b = errorCode;
788
- switch (_b) {
789
- case "AccessDeniedException": return [3, 2];
790
- case "com.amazonaws.codegurureviewer#AccessDeniedException": return [3, 2];
791
- case "ConflictException": return [3, 4];
792
- case "com.amazonaws.codegurureviewer#ConflictException": return [3, 4];
793
- case "InternalServerException": return [3, 6];
794
- case "com.amazonaws.codegurureviewer#InternalServerException": return [3, 6];
795
- case "NotFoundException": return [3, 8];
796
- case "com.amazonaws.codegurureviewer#NotFoundException": return [3, 8];
797
- case "ThrottlingException": return [3, 10];
798
- case "com.amazonaws.codegurureviewer#ThrottlingException": return [3, 10];
799
- case "ValidationException": return [3, 12];
800
- case "com.amazonaws.codegurureviewer#ValidationException": return [3, 12];
801
- }
802
- return [3, 14];
803
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
804
- case 3: throw _d.sent();
805
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
806
- case 5: throw _d.sent();
807
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
808
- case 7: throw _d.sent();
809
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
810
- case 9: throw _d.sent();
811
- case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
812
- case 11: throw _d.sent();
813
- case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
814
- case 13: throw _d.sent();
815
- case 14:
816
- parsedBody = parsedOutput.body;
817
- throwDefaultError({
818
- output: output,
819
- parsedBody: parsedBody,
820
- exceptionCtor: __BaseException,
821
- errorCode: errorCode,
822
- });
823
- _d.label = 15;
824
- case 15: return [2];
825
- }
278
+ return new __HttpRequest({
279
+ protocol,
280
+ hostname,
281
+ port,
282
+ method: "POST",
283
+ headers,
284
+ path: resolvedPath,
285
+ body,
826
286
  });
827
- }); };
828
- export var deserializeAws_restJson1ListCodeReviewsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
829
- var contents, data, _a, _b;
830
- return __generator(this, function (_c) {
831
- switch (_c.label) {
832
- case 0:
833
- if (output.statusCode !== 200 && output.statusCode >= 300) {
834
- return [2, deserializeAws_restJson1ListCodeReviewsCommandError(output, context)];
835
- }
836
- contents = map({
837
- $metadata: deserializeMetadata(output),
838
- });
839
- _a = __expectNonNull;
840
- _b = __expectObject;
841
- return [4, parseBody(output.body, context)];
842
- case 1:
843
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
844
- if (data.CodeReviewSummaries != null) {
845
- contents.CodeReviewSummaries = deserializeAws_restJson1CodeReviewSummaries(data.CodeReviewSummaries, context);
846
- }
847
- if (data.NextToken != null) {
848
- contents.NextToken = __expectString(data.NextToken);
849
- }
850
- return [2, contents];
851
- }
287
+ };
288
+ export const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
289
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
290
+ const headers = {};
291
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
292
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
293
+ const query = map({
294
+ tagKeys: [() => input.TagKeys !== void 0, () => (input.TagKeys || []).map((_entry) => _entry)],
852
295
  });
853
- }); };
854
- var deserializeAws_restJson1ListCodeReviewsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
855
- var parsedOutput, _a, errorCode, _b, parsedBody;
856
- var _c;
857
- return __generator(this, function (_d) {
858
- switch (_d.label) {
859
- case 0:
860
- _a = [__assign({}, output)];
861
- _c = {};
862
- return [4, parseErrorBody(output.body, context)];
863
- case 1:
864
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
865
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
866
- _b = errorCode;
867
- switch (_b) {
868
- case "AccessDeniedException": return [3, 2];
869
- case "com.amazonaws.codegurureviewer#AccessDeniedException": return [3, 2];
870
- case "InternalServerException": return [3, 4];
871
- case "com.amazonaws.codegurureviewer#InternalServerException": return [3, 4];
872
- case "ThrottlingException": return [3, 6];
873
- case "com.amazonaws.codegurureviewer#ThrottlingException": return [3, 6];
874
- case "ValidationException": return [3, 8];
875
- case "com.amazonaws.codegurureviewer#ValidationException": return [3, 8];
876
- }
877
- return [3, 10];
878
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
879
- case 3: throw _d.sent();
880
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
881
- case 5: throw _d.sent();
882
- case 6: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
883
- case 7: throw _d.sent();
884
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
885
- case 9: throw _d.sent();
886
- case 10:
887
- parsedBody = parsedOutput.body;
888
- throwDefaultError({
889
- output: output,
890
- parsedBody: parsedBody,
891
- exceptionCtor: __BaseException,
892
- errorCode: errorCode,
893
- });
894
- _d.label = 11;
895
- case 11: return [2];
896
- }
296
+ let body;
297
+ return new __HttpRequest({
298
+ protocol,
299
+ hostname,
300
+ port,
301
+ method: "DELETE",
302
+ headers,
303
+ path: resolvedPath,
304
+ query,
305
+ body,
897
306
  });
898
- }); };
899
- export var deserializeAws_restJson1ListRecommendationFeedbackCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
900
- var contents, data, _a, _b;
901
- return __generator(this, function (_c) {
902
- switch (_c.label) {
903
- case 0:
904
- if (output.statusCode !== 200 && output.statusCode >= 300) {
905
- return [2, deserializeAws_restJson1ListRecommendationFeedbackCommandError(output, context)];
906
- }
907
- contents = map({
908
- $metadata: deserializeMetadata(output),
909
- });
910
- _a = __expectNonNull;
911
- _b = __expectObject;
912
- return [4, parseBody(output.body, context)];
913
- case 1:
914
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
915
- if (data.NextToken != null) {
916
- contents.NextToken = __expectString(data.NextToken);
917
- }
918
- if (data.RecommendationFeedbackSummaries != null) {
919
- contents.RecommendationFeedbackSummaries = deserializeAws_restJson1RecommendationFeedbackSummaries(data.RecommendationFeedbackSummaries, context);
920
- }
921
- return [2, contents];
922
- }
307
+ };
308
+ export const deserializeAws_restJson1AssociateRepositoryCommand = async (output, context) => {
309
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
310
+ return deserializeAws_restJson1AssociateRepositoryCommandError(output, context);
311
+ }
312
+ const contents = map({
313
+ $metadata: deserializeMetadata(output),
923
314
  });
924
- }); };
925
- var deserializeAws_restJson1ListRecommendationFeedbackCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
926
- var parsedOutput, _a, errorCode, _b, parsedBody;
927
- var _c;
928
- return __generator(this, function (_d) {
929
- switch (_d.label) {
930
- case 0:
931
- _a = [__assign({}, output)];
932
- _c = {};
933
- return [4, parseErrorBody(output.body, context)];
934
- case 1:
935
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
936
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
937
- _b = errorCode;
938
- switch (_b) {
939
- case "AccessDeniedException": return [3, 2];
940
- case "com.amazonaws.codegurureviewer#AccessDeniedException": return [3, 2];
941
- case "InternalServerException": return [3, 4];
942
- case "com.amazonaws.codegurureviewer#InternalServerException": return [3, 4];
943
- case "ResourceNotFoundException": return [3, 6];
944
- case "com.amazonaws.codegurureviewer#ResourceNotFoundException": return [3, 6];
945
- case "ThrottlingException": return [3, 8];
946
- case "com.amazonaws.codegurureviewer#ThrottlingException": return [3, 8];
947
- case "ValidationException": return [3, 10];
948
- case "com.amazonaws.codegurureviewer#ValidationException": return [3, 10];
949
- }
950
- return [3, 12];
951
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
952
- case 3: throw _d.sent();
953
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
954
- case 5: throw _d.sent();
955
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
956
- case 7: throw _d.sent();
957
- case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
958
- case 9: throw _d.sent();
959
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
960
- case 11: throw _d.sent();
961
- case 12:
962
- parsedBody = parsedOutput.body;
963
- throwDefaultError({
964
- output: output,
965
- parsedBody: parsedBody,
966
- exceptionCtor: __BaseException,
967
- errorCode: errorCode,
968
- });
969
- _d.label = 13;
970
- case 13: return [2];
971
- }
315
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
316
+ if (data.RepositoryAssociation != null) {
317
+ contents.RepositoryAssociation = deserializeAws_restJson1RepositoryAssociation(data.RepositoryAssociation, context);
318
+ }
319
+ if (data.Tags != null) {
320
+ contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
321
+ }
322
+ return contents;
323
+ };
324
+ const deserializeAws_restJson1AssociateRepositoryCommandError = async (output, context) => {
325
+ const parsedOutput = {
326
+ ...output,
327
+ body: await parseErrorBody(output.body, context),
328
+ };
329
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
330
+ switch (errorCode) {
331
+ case "AccessDeniedException":
332
+ case "com.amazonaws.codegurureviewer#AccessDeniedException":
333
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
334
+ case "ConflictException":
335
+ case "com.amazonaws.codegurureviewer#ConflictException":
336
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
337
+ case "InternalServerException":
338
+ case "com.amazonaws.codegurureviewer#InternalServerException":
339
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
340
+ case "ThrottlingException":
341
+ case "com.amazonaws.codegurureviewer#ThrottlingException":
342
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
343
+ case "ValidationException":
344
+ case "com.amazonaws.codegurureviewer#ValidationException":
345
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
346
+ default:
347
+ const parsedBody = parsedOutput.body;
348
+ throwDefaultError({
349
+ output,
350
+ parsedBody,
351
+ exceptionCtor: __BaseException,
352
+ errorCode,
353
+ });
354
+ }
355
+ };
356
+ export const deserializeAws_restJson1CreateCodeReviewCommand = async (output, context) => {
357
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
358
+ return deserializeAws_restJson1CreateCodeReviewCommandError(output, context);
359
+ }
360
+ const contents = map({
361
+ $metadata: deserializeMetadata(output),
972
362
  });
973
- }); };
974
- export var deserializeAws_restJson1ListRecommendationsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
975
- var contents, data, _a, _b;
976
- return __generator(this, function (_c) {
977
- switch (_c.label) {
978
- case 0:
979
- if (output.statusCode !== 200 && output.statusCode >= 300) {
980
- return [2, deserializeAws_restJson1ListRecommendationsCommandError(output, context)];
981
- }
982
- contents = map({
983
- $metadata: deserializeMetadata(output),
984
- });
985
- _a = __expectNonNull;
986
- _b = __expectObject;
987
- return [4, parseBody(output.body, context)];
988
- case 1:
989
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
990
- if (data.NextToken != null) {
991
- contents.NextToken = __expectString(data.NextToken);
992
- }
993
- if (data.RecommendationSummaries != null) {
994
- contents.RecommendationSummaries = deserializeAws_restJson1RecommendationSummaries(data.RecommendationSummaries, context);
995
- }
996
- return [2, contents];
997
- }
363
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
364
+ if (data.CodeReview != null) {
365
+ contents.CodeReview = deserializeAws_restJson1CodeReview(data.CodeReview, context);
366
+ }
367
+ return contents;
368
+ };
369
+ const deserializeAws_restJson1CreateCodeReviewCommandError = async (output, context) => {
370
+ const parsedOutput = {
371
+ ...output,
372
+ body: await parseErrorBody(output.body, context),
373
+ };
374
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
375
+ switch (errorCode) {
376
+ case "AccessDeniedException":
377
+ case "com.amazonaws.codegurureviewer#AccessDeniedException":
378
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
379
+ case "ConflictException":
380
+ case "com.amazonaws.codegurureviewer#ConflictException":
381
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
382
+ case "InternalServerException":
383
+ case "com.amazonaws.codegurureviewer#InternalServerException":
384
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
385
+ case "ResourceNotFoundException":
386
+ case "com.amazonaws.codegurureviewer#ResourceNotFoundException":
387
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
388
+ case "ThrottlingException":
389
+ case "com.amazonaws.codegurureviewer#ThrottlingException":
390
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
391
+ case "ValidationException":
392
+ case "com.amazonaws.codegurureviewer#ValidationException":
393
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
394
+ default:
395
+ const parsedBody = parsedOutput.body;
396
+ throwDefaultError({
397
+ output,
398
+ parsedBody,
399
+ exceptionCtor: __BaseException,
400
+ errorCode,
401
+ });
402
+ }
403
+ };
404
+ export const deserializeAws_restJson1DescribeCodeReviewCommand = async (output, context) => {
405
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
406
+ return deserializeAws_restJson1DescribeCodeReviewCommandError(output, context);
407
+ }
408
+ const contents = map({
409
+ $metadata: deserializeMetadata(output),
998
410
  });
999
- }); };
1000
- var deserializeAws_restJson1ListRecommendationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1001
- var parsedOutput, _a, errorCode, _b, parsedBody;
1002
- var _c;
1003
- return __generator(this, function (_d) {
1004
- switch (_d.label) {
1005
- case 0:
1006
- _a = [__assign({}, output)];
1007
- _c = {};
1008
- return [4, parseErrorBody(output.body, context)];
1009
- case 1:
1010
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1011
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1012
- _b = errorCode;
1013
- switch (_b) {
1014
- case "AccessDeniedException": return [3, 2];
1015
- case "com.amazonaws.codegurureviewer#AccessDeniedException": return [3, 2];
1016
- case "InternalServerException": return [3, 4];
1017
- case "com.amazonaws.codegurureviewer#InternalServerException": return [3, 4];
1018
- case "ResourceNotFoundException": return [3, 6];
1019
- case "com.amazonaws.codegurureviewer#ResourceNotFoundException": return [3, 6];
1020
- case "ThrottlingException": return [3, 8];
1021
- case "com.amazonaws.codegurureviewer#ThrottlingException": return [3, 8];
1022
- case "ValidationException": return [3, 10];
1023
- case "com.amazonaws.codegurureviewer#ValidationException": return [3, 10];
1024
- }
1025
- return [3, 12];
1026
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1027
- case 3: throw _d.sent();
1028
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1029
- case 5: throw _d.sent();
1030
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1031
- case 7: throw _d.sent();
1032
- case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1033
- case 9: throw _d.sent();
1034
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1035
- case 11: throw _d.sent();
1036
- case 12:
1037
- parsedBody = parsedOutput.body;
1038
- throwDefaultError({
1039
- output: output,
1040
- parsedBody: parsedBody,
1041
- exceptionCtor: __BaseException,
1042
- errorCode: errorCode,
1043
- });
1044
- _d.label = 13;
1045
- case 13: return [2];
1046
- }
411
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
412
+ if (data.CodeReview != null) {
413
+ contents.CodeReview = deserializeAws_restJson1CodeReview(data.CodeReview, context);
414
+ }
415
+ return contents;
416
+ };
417
+ const deserializeAws_restJson1DescribeCodeReviewCommandError = async (output, context) => {
418
+ const parsedOutput = {
419
+ ...output,
420
+ body: await parseErrorBody(output.body, context),
421
+ };
422
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
423
+ switch (errorCode) {
424
+ case "AccessDeniedException":
425
+ case "com.amazonaws.codegurureviewer#AccessDeniedException":
426
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
427
+ case "InternalServerException":
428
+ case "com.amazonaws.codegurureviewer#InternalServerException":
429
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
430
+ case "ResourceNotFoundException":
431
+ case "com.amazonaws.codegurureviewer#ResourceNotFoundException":
432
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
433
+ case "ThrottlingException":
434
+ case "com.amazonaws.codegurureviewer#ThrottlingException":
435
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
436
+ case "ValidationException":
437
+ case "com.amazonaws.codegurureviewer#ValidationException":
438
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
439
+ default:
440
+ const parsedBody = parsedOutput.body;
441
+ throwDefaultError({
442
+ output,
443
+ parsedBody,
444
+ exceptionCtor: __BaseException,
445
+ errorCode,
446
+ });
447
+ }
448
+ };
449
+ export const deserializeAws_restJson1DescribeRecommendationFeedbackCommand = async (output, context) => {
450
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
451
+ return deserializeAws_restJson1DescribeRecommendationFeedbackCommandError(output, context);
452
+ }
453
+ const contents = map({
454
+ $metadata: deserializeMetadata(output),
1047
455
  });
1048
- }); };
1049
- export var deserializeAws_restJson1ListRepositoryAssociationsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1050
- var contents, data, _a, _b;
1051
- return __generator(this, function (_c) {
1052
- switch (_c.label) {
1053
- case 0:
1054
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1055
- return [2, deserializeAws_restJson1ListRepositoryAssociationsCommandError(output, context)];
1056
- }
1057
- contents = map({
1058
- $metadata: deserializeMetadata(output),
1059
- });
1060
- _a = __expectNonNull;
1061
- _b = __expectObject;
1062
- return [4, parseBody(output.body, context)];
1063
- case 1:
1064
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1065
- if (data.NextToken != null) {
1066
- contents.NextToken = __expectString(data.NextToken);
1067
- }
1068
- if (data.RepositoryAssociationSummaries != null) {
1069
- contents.RepositoryAssociationSummaries = deserializeAws_restJson1RepositoryAssociationSummaries(data.RepositoryAssociationSummaries, context);
1070
- }
1071
- return [2, contents];
1072
- }
456
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
457
+ if (data.RecommendationFeedback != null) {
458
+ contents.RecommendationFeedback = deserializeAws_restJson1RecommendationFeedback(data.RecommendationFeedback, context);
459
+ }
460
+ return contents;
461
+ };
462
+ const deserializeAws_restJson1DescribeRecommendationFeedbackCommandError = async (output, context) => {
463
+ const parsedOutput = {
464
+ ...output,
465
+ body: await parseErrorBody(output.body, context),
466
+ };
467
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
468
+ switch (errorCode) {
469
+ case "AccessDeniedException":
470
+ case "com.amazonaws.codegurureviewer#AccessDeniedException":
471
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
472
+ case "InternalServerException":
473
+ case "com.amazonaws.codegurureviewer#InternalServerException":
474
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
475
+ case "ResourceNotFoundException":
476
+ case "com.amazonaws.codegurureviewer#ResourceNotFoundException":
477
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
478
+ case "ThrottlingException":
479
+ case "com.amazonaws.codegurureviewer#ThrottlingException":
480
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
481
+ case "ValidationException":
482
+ case "com.amazonaws.codegurureviewer#ValidationException":
483
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
484
+ default:
485
+ const parsedBody = parsedOutput.body;
486
+ throwDefaultError({
487
+ output,
488
+ parsedBody,
489
+ exceptionCtor: __BaseException,
490
+ errorCode,
491
+ });
492
+ }
493
+ };
494
+ export const deserializeAws_restJson1DescribeRepositoryAssociationCommand = async (output, context) => {
495
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
496
+ return deserializeAws_restJson1DescribeRepositoryAssociationCommandError(output, context);
497
+ }
498
+ const contents = map({
499
+ $metadata: deserializeMetadata(output),
1073
500
  });
1074
- }); };
1075
- var deserializeAws_restJson1ListRepositoryAssociationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1076
- var parsedOutput, _a, errorCode, _b, parsedBody;
1077
- var _c;
1078
- return __generator(this, function (_d) {
1079
- switch (_d.label) {
1080
- case 0:
1081
- _a = [__assign({}, output)];
1082
- _c = {};
1083
- return [4, parseErrorBody(output.body, context)];
1084
- case 1:
1085
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1086
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1087
- _b = errorCode;
1088
- switch (_b) {
1089
- case "InternalServerException": return [3, 2];
1090
- case "com.amazonaws.codegurureviewer#InternalServerException": return [3, 2];
1091
- case "ThrottlingException": return [3, 4];
1092
- case "com.amazonaws.codegurureviewer#ThrottlingException": return [3, 4];
1093
- case "ValidationException": return [3, 6];
1094
- case "com.amazonaws.codegurureviewer#ValidationException": return [3, 6];
1095
- }
1096
- return [3, 8];
1097
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1098
- case 3: throw _d.sent();
1099
- case 4: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1100
- case 5: throw _d.sent();
1101
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1102
- case 7: throw _d.sent();
1103
- case 8:
1104
- parsedBody = parsedOutput.body;
1105
- throwDefaultError({
1106
- output: output,
1107
- parsedBody: parsedBody,
1108
- exceptionCtor: __BaseException,
1109
- errorCode: errorCode,
1110
- });
1111
- _d.label = 9;
1112
- case 9: return [2];
1113
- }
501
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
502
+ if (data.RepositoryAssociation != null) {
503
+ contents.RepositoryAssociation = deserializeAws_restJson1RepositoryAssociation(data.RepositoryAssociation, context);
504
+ }
505
+ if (data.Tags != null) {
506
+ contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
507
+ }
508
+ return contents;
509
+ };
510
+ const deserializeAws_restJson1DescribeRepositoryAssociationCommandError = async (output, context) => {
511
+ const parsedOutput = {
512
+ ...output,
513
+ body: await parseErrorBody(output.body, context),
514
+ };
515
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
516
+ switch (errorCode) {
517
+ case "AccessDeniedException":
518
+ case "com.amazonaws.codegurureviewer#AccessDeniedException":
519
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
520
+ case "InternalServerException":
521
+ case "com.amazonaws.codegurureviewer#InternalServerException":
522
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
523
+ case "NotFoundException":
524
+ case "com.amazonaws.codegurureviewer#NotFoundException":
525
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
526
+ case "ThrottlingException":
527
+ case "com.amazonaws.codegurureviewer#ThrottlingException":
528
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
529
+ case "ValidationException":
530
+ case "com.amazonaws.codegurureviewer#ValidationException":
531
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
532
+ default:
533
+ const parsedBody = parsedOutput.body;
534
+ throwDefaultError({
535
+ output,
536
+ parsedBody,
537
+ exceptionCtor: __BaseException,
538
+ errorCode,
539
+ });
540
+ }
541
+ };
542
+ export const deserializeAws_restJson1DisassociateRepositoryCommand = async (output, context) => {
543
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
544
+ return deserializeAws_restJson1DisassociateRepositoryCommandError(output, context);
545
+ }
546
+ const contents = map({
547
+ $metadata: deserializeMetadata(output),
1114
548
  });
1115
- }); };
1116
- export var deserializeAws_restJson1ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1117
- var contents, data, _a, _b;
1118
- return __generator(this, function (_c) {
1119
- switch (_c.label) {
1120
- case 0:
1121
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1122
- return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
1123
- }
1124
- contents = map({
1125
- $metadata: deserializeMetadata(output),
1126
- });
1127
- _a = __expectNonNull;
1128
- _b = __expectObject;
1129
- return [4, parseBody(output.body, context)];
1130
- case 1:
1131
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1132
- if (data.Tags != null) {
1133
- contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
1134
- }
1135
- return [2, contents];
1136
- }
549
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
550
+ if (data.RepositoryAssociation != null) {
551
+ contents.RepositoryAssociation = deserializeAws_restJson1RepositoryAssociation(data.RepositoryAssociation, context);
552
+ }
553
+ if (data.Tags != null) {
554
+ contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
555
+ }
556
+ return contents;
557
+ };
558
+ const deserializeAws_restJson1DisassociateRepositoryCommandError = async (output, context) => {
559
+ const parsedOutput = {
560
+ ...output,
561
+ body: await parseErrorBody(output.body, context),
562
+ };
563
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
564
+ switch (errorCode) {
565
+ case "AccessDeniedException":
566
+ case "com.amazonaws.codegurureviewer#AccessDeniedException":
567
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
568
+ case "ConflictException":
569
+ case "com.amazonaws.codegurureviewer#ConflictException":
570
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
571
+ case "InternalServerException":
572
+ case "com.amazonaws.codegurureviewer#InternalServerException":
573
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
574
+ case "NotFoundException":
575
+ case "com.amazonaws.codegurureviewer#NotFoundException":
576
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
577
+ case "ThrottlingException":
578
+ case "com.amazonaws.codegurureviewer#ThrottlingException":
579
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
580
+ case "ValidationException":
581
+ case "com.amazonaws.codegurureviewer#ValidationException":
582
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
583
+ default:
584
+ const parsedBody = parsedOutput.body;
585
+ throwDefaultError({
586
+ output,
587
+ parsedBody,
588
+ exceptionCtor: __BaseException,
589
+ errorCode,
590
+ });
591
+ }
592
+ };
593
+ export const deserializeAws_restJson1ListCodeReviewsCommand = async (output, context) => {
594
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
595
+ return deserializeAws_restJson1ListCodeReviewsCommandError(output, context);
596
+ }
597
+ const contents = map({
598
+ $metadata: deserializeMetadata(output),
1137
599
  });
1138
- }); };
1139
- var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1140
- var parsedOutput, _a, errorCode, _b, parsedBody;
1141
- var _c;
1142
- return __generator(this, function (_d) {
1143
- switch (_d.label) {
1144
- case 0:
1145
- _a = [__assign({}, output)];
1146
- _c = {};
1147
- return [4, parseErrorBody(output.body, context)];
1148
- case 1:
1149
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1150
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1151
- _b = errorCode;
1152
- switch (_b) {
1153
- case "InternalServerException": return [3, 2];
1154
- case "com.amazonaws.codegurureviewer#InternalServerException": return [3, 2];
1155
- case "ResourceNotFoundException": return [3, 4];
1156
- case "com.amazonaws.codegurureviewer#ResourceNotFoundException": return [3, 4];
1157
- case "ValidationException": return [3, 6];
1158
- case "com.amazonaws.codegurureviewer#ValidationException": return [3, 6];
1159
- }
1160
- return [3, 8];
1161
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1162
- case 3: throw _d.sent();
1163
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1164
- case 5: throw _d.sent();
1165
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1166
- case 7: throw _d.sent();
1167
- case 8:
1168
- parsedBody = parsedOutput.body;
1169
- throwDefaultError({
1170
- output: output,
1171
- parsedBody: parsedBody,
1172
- exceptionCtor: __BaseException,
1173
- errorCode: errorCode,
1174
- });
1175
- _d.label = 9;
1176
- case 9: return [2];
1177
- }
600
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
601
+ if (data.CodeReviewSummaries != null) {
602
+ contents.CodeReviewSummaries = deserializeAws_restJson1CodeReviewSummaries(data.CodeReviewSummaries, context);
603
+ }
604
+ if (data.NextToken != null) {
605
+ contents.NextToken = __expectString(data.NextToken);
606
+ }
607
+ return contents;
608
+ };
609
+ const deserializeAws_restJson1ListCodeReviewsCommandError = async (output, context) => {
610
+ const parsedOutput = {
611
+ ...output,
612
+ body: await parseErrorBody(output.body, context),
613
+ };
614
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
615
+ switch (errorCode) {
616
+ case "AccessDeniedException":
617
+ case "com.amazonaws.codegurureviewer#AccessDeniedException":
618
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
619
+ case "InternalServerException":
620
+ case "com.amazonaws.codegurureviewer#InternalServerException":
621
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
622
+ case "ThrottlingException":
623
+ case "com.amazonaws.codegurureviewer#ThrottlingException":
624
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
625
+ case "ValidationException":
626
+ case "com.amazonaws.codegurureviewer#ValidationException":
627
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
628
+ default:
629
+ const parsedBody = parsedOutput.body;
630
+ throwDefaultError({
631
+ output,
632
+ parsedBody,
633
+ exceptionCtor: __BaseException,
634
+ errorCode,
635
+ });
636
+ }
637
+ };
638
+ export const deserializeAws_restJson1ListRecommendationFeedbackCommand = async (output, context) => {
639
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
640
+ return deserializeAws_restJson1ListRecommendationFeedbackCommandError(output, context);
641
+ }
642
+ const contents = map({
643
+ $metadata: deserializeMetadata(output),
1178
644
  });
1179
- }); };
1180
- export var deserializeAws_restJson1PutRecommendationFeedbackCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1181
- var contents;
1182
- return __generator(this, function (_a) {
1183
- switch (_a.label) {
1184
- case 0:
1185
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1186
- return [2, deserializeAws_restJson1PutRecommendationFeedbackCommandError(output, context)];
1187
- }
1188
- contents = map({
1189
- $metadata: deserializeMetadata(output),
1190
- });
1191
- return [4, collectBody(output.body, context)];
1192
- case 1:
1193
- _a.sent();
1194
- return [2, contents];
1195
- }
645
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
646
+ if (data.NextToken != null) {
647
+ contents.NextToken = __expectString(data.NextToken);
648
+ }
649
+ if (data.RecommendationFeedbackSummaries != null) {
650
+ contents.RecommendationFeedbackSummaries = deserializeAws_restJson1RecommendationFeedbackSummaries(data.RecommendationFeedbackSummaries, context);
651
+ }
652
+ return contents;
653
+ };
654
+ const deserializeAws_restJson1ListRecommendationFeedbackCommandError = async (output, context) => {
655
+ const parsedOutput = {
656
+ ...output,
657
+ body: await parseErrorBody(output.body, context),
658
+ };
659
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
660
+ switch (errorCode) {
661
+ case "AccessDeniedException":
662
+ case "com.amazonaws.codegurureviewer#AccessDeniedException":
663
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
664
+ case "InternalServerException":
665
+ case "com.amazonaws.codegurureviewer#InternalServerException":
666
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
667
+ case "ResourceNotFoundException":
668
+ case "com.amazonaws.codegurureviewer#ResourceNotFoundException":
669
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
670
+ case "ThrottlingException":
671
+ case "com.amazonaws.codegurureviewer#ThrottlingException":
672
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
673
+ case "ValidationException":
674
+ case "com.amazonaws.codegurureviewer#ValidationException":
675
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
676
+ default:
677
+ const parsedBody = parsedOutput.body;
678
+ throwDefaultError({
679
+ output,
680
+ parsedBody,
681
+ exceptionCtor: __BaseException,
682
+ errorCode,
683
+ });
684
+ }
685
+ };
686
+ export const deserializeAws_restJson1ListRecommendationsCommand = async (output, context) => {
687
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
688
+ return deserializeAws_restJson1ListRecommendationsCommandError(output, context);
689
+ }
690
+ const contents = map({
691
+ $metadata: deserializeMetadata(output),
1196
692
  });
1197
- }); };
1198
- var deserializeAws_restJson1PutRecommendationFeedbackCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1199
- var parsedOutput, _a, errorCode, _b, parsedBody;
1200
- var _c;
1201
- return __generator(this, function (_d) {
1202
- switch (_d.label) {
1203
- case 0:
1204
- _a = [__assign({}, output)];
1205
- _c = {};
1206
- return [4, parseErrorBody(output.body, context)];
1207
- case 1:
1208
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1209
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1210
- _b = errorCode;
1211
- switch (_b) {
1212
- case "AccessDeniedException": return [3, 2];
1213
- case "com.amazonaws.codegurureviewer#AccessDeniedException": return [3, 2];
1214
- case "InternalServerException": return [3, 4];
1215
- case "com.amazonaws.codegurureviewer#InternalServerException": return [3, 4];
1216
- case "ResourceNotFoundException": return [3, 6];
1217
- case "com.amazonaws.codegurureviewer#ResourceNotFoundException": return [3, 6];
1218
- case "ThrottlingException": return [3, 8];
1219
- case "com.amazonaws.codegurureviewer#ThrottlingException": return [3, 8];
1220
- case "ValidationException": return [3, 10];
1221
- case "com.amazonaws.codegurureviewer#ValidationException": return [3, 10];
1222
- }
1223
- return [3, 12];
1224
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1225
- case 3: throw _d.sent();
1226
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1227
- case 5: throw _d.sent();
1228
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1229
- case 7: throw _d.sent();
1230
- case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1231
- case 9: throw _d.sent();
1232
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1233
- case 11: throw _d.sent();
1234
- case 12:
1235
- parsedBody = parsedOutput.body;
1236
- throwDefaultError({
1237
- output: output,
1238
- parsedBody: parsedBody,
1239
- exceptionCtor: __BaseException,
1240
- errorCode: errorCode,
1241
- });
1242
- _d.label = 13;
1243
- case 13: return [2];
1244
- }
693
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
694
+ if (data.NextToken != null) {
695
+ contents.NextToken = __expectString(data.NextToken);
696
+ }
697
+ if (data.RecommendationSummaries != null) {
698
+ contents.RecommendationSummaries = deserializeAws_restJson1RecommendationSummaries(data.RecommendationSummaries, context);
699
+ }
700
+ return contents;
701
+ };
702
+ const deserializeAws_restJson1ListRecommendationsCommandError = async (output, context) => {
703
+ const parsedOutput = {
704
+ ...output,
705
+ body: await parseErrorBody(output.body, context),
706
+ };
707
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
708
+ switch (errorCode) {
709
+ case "AccessDeniedException":
710
+ case "com.amazonaws.codegurureviewer#AccessDeniedException":
711
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
712
+ case "InternalServerException":
713
+ case "com.amazonaws.codegurureviewer#InternalServerException":
714
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
715
+ case "ResourceNotFoundException":
716
+ case "com.amazonaws.codegurureviewer#ResourceNotFoundException":
717
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
718
+ case "ThrottlingException":
719
+ case "com.amazonaws.codegurureviewer#ThrottlingException":
720
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
721
+ case "ValidationException":
722
+ case "com.amazonaws.codegurureviewer#ValidationException":
723
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
724
+ default:
725
+ const parsedBody = parsedOutput.body;
726
+ throwDefaultError({
727
+ output,
728
+ parsedBody,
729
+ exceptionCtor: __BaseException,
730
+ errorCode,
731
+ });
732
+ }
733
+ };
734
+ export const deserializeAws_restJson1ListRepositoryAssociationsCommand = async (output, context) => {
735
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
736
+ return deserializeAws_restJson1ListRepositoryAssociationsCommandError(output, context);
737
+ }
738
+ const contents = map({
739
+ $metadata: deserializeMetadata(output),
1245
740
  });
1246
- }); };
1247
- export var deserializeAws_restJson1TagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1248
- var contents;
1249
- return __generator(this, function (_a) {
1250
- switch (_a.label) {
1251
- case 0:
1252
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1253
- return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
1254
- }
1255
- contents = map({
1256
- $metadata: deserializeMetadata(output),
1257
- });
1258
- return [4, collectBody(output.body, context)];
1259
- case 1:
1260
- _a.sent();
1261
- return [2, contents];
1262
- }
741
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
742
+ if (data.NextToken != null) {
743
+ contents.NextToken = __expectString(data.NextToken);
744
+ }
745
+ if (data.RepositoryAssociationSummaries != null) {
746
+ contents.RepositoryAssociationSummaries = deserializeAws_restJson1RepositoryAssociationSummaries(data.RepositoryAssociationSummaries, context);
747
+ }
748
+ return contents;
749
+ };
750
+ const deserializeAws_restJson1ListRepositoryAssociationsCommandError = async (output, context) => {
751
+ const parsedOutput = {
752
+ ...output,
753
+ body: await parseErrorBody(output.body, context),
754
+ };
755
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
756
+ switch (errorCode) {
757
+ case "InternalServerException":
758
+ case "com.amazonaws.codegurureviewer#InternalServerException":
759
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
760
+ case "ThrottlingException":
761
+ case "com.amazonaws.codegurureviewer#ThrottlingException":
762
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
763
+ case "ValidationException":
764
+ case "com.amazonaws.codegurureviewer#ValidationException":
765
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
766
+ default:
767
+ const parsedBody = parsedOutput.body;
768
+ throwDefaultError({
769
+ output,
770
+ parsedBody,
771
+ exceptionCtor: __BaseException,
772
+ errorCode,
773
+ });
774
+ }
775
+ };
776
+ export const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
777
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
778
+ return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
779
+ }
780
+ const contents = map({
781
+ $metadata: deserializeMetadata(output),
1263
782
  });
1264
- }); };
1265
- var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1266
- var parsedOutput, _a, errorCode, _b, parsedBody;
1267
- var _c;
1268
- return __generator(this, function (_d) {
1269
- switch (_d.label) {
1270
- case 0:
1271
- _a = [__assign({}, output)];
1272
- _c = {};
1273
- return [4, parseErrorBody(output.body, context)];
1274
- case 1:
1275
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1276
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1277
- _b = errorCode;
1278
- switch (_b) {
1279
- case "InternalServerException": return [3, 2];
1280
- case "com.amazonaws.codegurureviewer#InternalServerException": return [3, 2];
1281
- case "ResourceNotFoundException": return [3, 4];
1282
- case "com.amazonaws.codegurureviewer#ResourceNotFoundException": return [3, 4];
1283
- case "ValidationException": return [3, 6];
1284
- case "com.amazonaws.codegurureviewer#ValidationException": return [3, 6];
1285
- }
1286
- return [3, 8];
1287
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1288
- case 3: throw _d.sent();
1289
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1290
- case 5: throw _d.sent();
1291
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1292
- case 7: throw _d.sent();
1293
- case 8:
1294
- parsedBody = parsedOutput.body;
1295
- throwDefaultError({
1296
- output: output,
1297
- parsedBody: parsedBody,
1298
- exceptionCtor: __BaseException,
1299
- errorCode: errorCode,
1300
- });
1301
- _d.label = 9;
1302
- case 9: return [2];
1303
- }
783
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
784
+ if (data.Tags != null) {
785
+ contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
786
+ }
787
+ return contents;
788
+ };
789
+ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
790
+ const parsedOutput = {
791
+ ...output,
792
+ body: await parseErrorBody(output.body, context),
793
+ };
794
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
795
+ switch (errorCode) {
796
+ case "InternalServerException":
797
+ case "com.amazonaws.codegurureviewer#InternalServerException":
798
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
799
+ case "ResourceNotFoundException":
800
+ case "com.amazonaws.codegurureviewer#ResourceNotFoundException":
801
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
802
+ case "ValidationException":
803
+ case "com.amazonaws.codegurureviewer#ValidationException":
804
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
805
+ default:
806
+ const parsedBody = parsedOutput.body;
807
+ throwDefaultError({
808
+ output,
809
+ parsedBody,
810
+ exceptionCtor: __BaseException,
811
+ errorCode,
812
+ });
813
+ }
814
+ };
815
+ export const deserializeAws_restJson1PutRecommendationFeedbackCommand = async (output, context) => {
816
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
817
+ return deserializeAws_restJson1PutRecommendationFeedbackCommandError(output, context);
818
+ }
819
+ const contents = map({
820
+ $metadata: deserializeMetadata(output),
1304
821
  });
1305
- }); };
1306
- export var deserializeAws_restJson1UntagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1307
- var contents;
1308
- return __generator(this, function (_a) {
1309
- switch (_a.label) {
1310
- case 0:
1311
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1312
- return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
1313
- }
1314
- contents = map({
1315
- $metadata: deserializeMetadata(output),
1316
- });
1317
- return [4, collectBody(output.body, context)];
1318
- case 1:
1319
- _a.sent();
1320
- return [2, contents];
1321
- }
822
+ await collectBody(output.body, context);
823
+ return contents;
824
+ };
825
+ const deserializeAws_restJson1PutRecommendationFeedbackCommandError = async (output, context) => {
826
+ const parsedOutput = {
827
+ ...output,
828
+ body: await parseErrorBody(output.body, context),
829
+ };
830
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
831
+ switch (errorCode) {
832
+ case "AccessDeniedException":
833
+ case "com.amazonaws.codegurureviewer#AccessDeniedException":
834
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
835
+ case "InternalServerException":
836
+ case "com.amazonaws.codegurureviewer#InternalServerException":
837
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
838
+ case "ResourceNotFoundException":
839
+ case "com.amazonaws.codegurureviewer#ResourceNotFoundException":
840
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
841
+ case "ThrottlingException":
842
+ case "com.amazonaws.codegurureviewer#ThrottlingException":
843
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
844
+ case "ValidationException":
845
+ case "com.amazonaws.codegurureviewer#ValidationException":
846
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
847
+ default:
848
+ const parsedBody = parsedOutput.body;
849
+ throwDefaultError({
850
+ output,
851
+ parsedBody,
852
+ exceptionCtor: __BaseException,
853
+ errorCode,
854
+ });
855
+ }
856
+ };
857
+ export const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
858
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
859
+ return deserializeAws_restJson1TagResourceCommandError(output, context);
860
+ }
861
+ const contents = map({
862
+ $metadata: deserializeMetadata(output),
1322
863
  });
1323
- }); };
1324
- var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1325
- var parsedOutput, _a, errorCode, _b, parsedBody;
1326
- var _c;
1327
- return __generator(this, function (_d) {
1328
- switch (_d.label) {
1329
- case 0:
1330
- _a = [__assign({}, output)];
1331
- _c = {};
1332
- return [4, parseErrorBody(output.body, context)];
1333
- case 1:
1334
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1335
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1336
- _b = errorCode;
1337
- switch (_b) {
1338
- case "InternalServerException": return [3, 2];
1339
- case "com.amazonaws.codegurureviewer#InternalServerException": return [3, 2];
1340
- case "ResourceNotFoundException": return [3, 4];
1341
- case "com.amazonaws.codegurureviewer#ResourceNotFoundException": return [3, 4];
1342
- case "ValidationException": return [3, 6];
1343
- case "com.amazonaws.codegurureviewer#ValidationException": return [3, 6];
1344
- }
1345
- return [3, 8];
1346
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1347
- case 3: throw _d.sent();
1348
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1349
- case 5: throw _d.sent();
1350
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1351
- case 7: throw _d.sent();
1352
- case 8:
1353
- parsedBody = parsedOutput.body;
1354
- throwDefaultError({
1355
- output: output,
1356
- parsedBody: parsedBody,
1357
- exceptionCtor: __BaseException,
1358
- errorCode: errorCode,
1359
- });
1360
- _d.label = 9;
1361
- case 9: return [2];
1362
- }
864
+ await collectBody(output.body, context);
865
+ return contents;
866
+ };
867
+ const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
868
+ const parsedOutput = {
869
+ ...output,
870
+ body: await parseErrorBody(output.body, context),
871
+ };
872
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
873
+ switch (errorCode) {
874
+ case "InternalServerException":
875
+ case "com.amazonaws.codegurureviewer#InternalServerException":
876
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
877
+ case "ResourceNotFoundException":
878
+ case "com.amazonaws.codegurureviewer#ResourceNotFoundException":
879
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
880
+ case "ValidationException":
881
+ case "com.amazonaws.codegurureviewer#ValidationException":
882
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
883
+ default:
884
+ const parsedBody = parsedOutput.body;
885
+ throwDefaultError({
886
+ output,
887
+ parsedBody,
888
+ exceptionCtor: __BaseException,
889
+ errorCode,
890
+ });
891
+ }
892
+ };
893
+ export const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
894
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
895
+ return deserializeAws_restJson1UntagResourceCommandError(output, context);
896
+ }
897
+ const contents = map({
898
+ $metadata: deserializeMetadata(output),
1363
899
  });
1364
- }); };
1365
- var map = __map;
1366
- var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1367
- var contents, data, exception;
1368
- return __generator(this, function (_a) {
1369
- contents = map({});
1370
- data = parsedOutput.body;
1371
- if (data.Message != null) {
1372
- contents.Message = __expectString(data.Message);
1373
- }
1374
- exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1375
- return [2, __decorateServiceException(exception, parsedOutput.body)];
900
+ await collectBody(output.body, context);
901
+ return contents;
902
+ };
903
+ const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
904
+ const parsedOutput = {
905
+ ...output,
906
+ body: await parseErrorBody(output.body, context),
907
+ };
908
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
909
+ switch (errorCode) {
910
+ case "InternalServerException":
911
+ case "com.amazonaws.codegurureviewer#InternalServerException":
912
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
913
+ case "ResourceNotFoundException":
914
+ case "com.amazonaws.codegurureviewer#ResourceNotFoundException":
915
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
916
+ case "ValidationException":
917
+ case "com.amazonaws.codegurureviewer#ValidationException":
918
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
919
+ default:
920
+ const parsedBody = parsedOutput.body;
921
+ throwDefaultError({
922
+ output,
923
+ parsedBody,
924
+ exceptionCtor: __BaseException,
925
+ errorCode,
926
+ });
927
+ }
928
+ };
929
+ const map = __map;
930
+ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
931
+ const contents = map({});
932
+ const data = parsedOutput.body;
933
+ if (data.Message != null) {
934
+ contents.Message = __expectString(data.Message);
935
+ }
936
+ const exception = new AccessDeniedException({
937
+ $metadata: deserializeMetadata(parsedOutput),
938
+ ...contents,
1376
939
  });
1377
- }); };
1378
- var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1379
- var contents, data, exception;
1380
- return __generator(this, function (_a) {
1381
- contents = map({});
1382
- data = parsedOutput.body;
1383
- if (data.Message != null) {
1384
- contents.Message = __expectString(data.Message);
1385
- }
1386
- exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1387
- return [2, __decorateServiceException(exception, parsedOutput.body)];
940
+ return __decorateServiceException(exception, parsedOutput.body);
941
+ };
942
+ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
943
+ const contents = map({});
944
+ const data = parsedOutput.body;
945
+ if (data.Message != null) {
946
+ contents.Message = __expectString(data.Message);
947
+ }
948
+ const exception = new ConflictException({
949
+ $metadata: deserializeMetadata(parsedOutput),
950
+ ...contents,
1388
951
  });
1389
- }); };
1390
- var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1391
- var contents, data, exception;
1392
- return __generator(this, function (_a) {
1393
- contents = map({});
1394
- data = parsedOutput.body;
1395
- if (data.Message != null) {
1396
- contents.Message = __expectString(data.Message);
1397
- }
1398
- exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1399
- return [2, __decorateServiceException(exception, parsedOutput.body)];
952
+ return __decorateServiceException(exception, parsedOutput.body);
953
+ };
954
+ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
955
+ const contents = map({});
956
+ const data = parsedOutput.body;
957
+ if (data.Message != null) {
958
+ contents.Message = __expectString(data.Message);
959
+ }
960
+ const exception = new InternalServerException({
961
+ $metadata: deserializeMetadata(parsedOutput),
962
+ ...contents,
1400
963
  });
1401
- }); };
1402
- var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1403
- var contents, data, exception;
1404
- return __generator(this, function (_a) {
1405
- contents = map({});
1406
- data = parsedOutput.body;
1407
- if (data.Message != null) {
1408
- contents.Message = __expectString(data.Message);
1409
- }
1410
- exception = new NotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1411
- return [2, __decorateServiceException(exception, parsedOutput.body)];
964
+ return __decorateServiceException(exception, parsedOutput.body);
965
+ };
966
+ const deserializeAws_restJson1NotFoundExceptionResponse = async (parsedOutput, context) => {
967
+ const contents = map({});
968
+ const data = parsedOutput.body;
969
+ if (data.Message != null) {
970
+ contents.Message = __expectString(data.Message);
971
+ }
972
+ const exception = new NotFoundException({
973
+ $metadata: deserializeMetadata(parsedOutput),
974
+ ...contents,
1412
975
  });
1413
- }); };
1414
- var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1415
- var contents, data, exception;
1416
- return __generator(this, function (_a) {
1417
- contents = map({});
1418
- data = parsedOutput.body;
1419
- if (data.Message != null) {
1420
- contents.Message = __expectString(data.Message);
1421
- }
1422
- exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1423
- return [2, __decorateServiceException(exception, parsedOutput.body)];
976
+ return __decorateServiceException(exception, parsedOutput.body);
977
+ };
978
+ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
979
+ const contents = map({});
980
+ const data = parsedOutput.body;
981
+ if (data.Message != null) {
982
+ contents.Message = __expectString(data.Message);
983
+ }
984
+ const exception = new ResourceNotFoundException({
985
+ $metadata: deserializeMetadata(parsedOutput),
986
+ ...contents,
1424
987
  });
1425
- }); };
1426
- var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1427
- var contents, data, exception;
1428
- return __generator(this, function (_a) {
1429
- contents = map({});
1430
- data = parsedOutput.body;
1431
- if (data.Message != null) {
1432
- contents.Message = __expectString(data.Message);
1433
- }
1434
- exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1435
- return [2, __decorateServiceException(exception, parsedOutput.body)];
988
+ return __decorateServiceException(exception, parsedOutput.body);
989
+ };
990
+ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
991
+ const contents = map({});
992
+ const data = parsedOutput.body;
993
+ if (data.Message != null) {
994
+ contents.Message = __expectString(data.Message);
995
+ }
996
+ const exception = new ThrottlingException({
997
+ $metadata: deserializeMetadata(parsedOutput),
998
+ ...contents,
1436
999
  });
1437
- }); };
1438
- var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1439
- var contents, data, exception;
1440
- return __generator(this, function (_a) {
1441
- contents = map({});
1442
- data = parsedOutput.body;
1443
- if (data.Message != null) {
1444
- contents.Message = __expectString(data.Message);
1445
- }
1446
- exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1447
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1000
+ return __decorateServiceException(exception, parsedOutput.body);
1001
+ };
1002
+ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
1003
+ const contents = map({});
1004
+ const data = parsedOutput.body;
1005
+ if (data.Message != null) {
1006
+ contents.Message = __expectString(data.Message);
1007
+ }
1008
+ const exception = new ValidationException({
1009
+ $metadata: deserializeMetadata(parsedOutput),
1010
+ ...contents,
1448
1011
  });
1449
- }); };
1450
- var serializeAws_restJson1AnalysisTypes = function (input, context) {
1012
+ return __decorateServiceException(exception, parsedOutput.body);
1013
+ };
1014
+ const serializeAws_restJson1AnalysisTypes = (input, context) => {
1451
1015
  return input
1452
- .filter(function (e) { return e != null; })
1453
- .map(function (entry) {
1016
+ .filter((e) => e != null)
1017
+ .map((entry) => {
1454
1018
  return entry;
1455
1019
  });
1456
1020
  };
1457
- var serializeAws_restJson1BranchDiffSourceCodeType = function (input, context) {
1458
- return __assign(__assign({}, (input.DestinationBranchName != null && { DestinationBranchName: input.DestinationBranchName })), (input.SourceBranchName != null && { SourceBranchName: input.SourceBranchName }));
1021
+ const serializeAws_restJson1BranchDiffSourceCodeType = (input, context) => {
1022
+ return {
1023
+ ...(input.DestinationBranchName != null && { DestinationBranchName: input.DestinationBranchName }),
1024
+ ...(input.SourceBranchName != null && { SourceBranchName: input.SourceBranchName }),
1025
+ };
1459
1026
  };
1460
- var serializeAws_restJson1CodeArtifacts = function (input, context) {
1461
- return __assign(__assign({}, (input.BuildArtifactsObjectKey != null && { BuildArtifactsObjectKey: input.BuildArtifactsObjectKey })), (input.SourceCodeArtifactsObjectKey != null && {
1462
- SourceCodeArtifactsObjectKey: input.SourceCodeArtifactsObjectKey,
1463
- }));
1027
+ const serializeAws_restJson1CodeArtifacts = (input, context) => {
1028
+ return {
1029
+ ...(input.BuildArtifactsObjectKey != null && { BuildArtifactsObjectKey: input.BuildArtifactsObjectKey }),
1030
+ ...(input.SourceCodeArtifactsObjectKey != null && {
1031
+ SourceCodeArtifactsObjectKey: input.SourceCodeArtifactsObjectKey,
1032
+ }),
1033
+ };
1464
1034
  };
1465
- var serializeAws_restJson1CodeCommitRepository = function (input, context) {
1466
- return __assign({}, (input.Name != null && { Name: input.Name }));
1035
+ const serializeAws_restJson1CodeCommitRepository = (input, context) => {
1036
+ return {
1037
+ ...(input.Name != null && { Name: input.Name }),
1038
+ };
1467
1039
  };
1468
- var serializeAws_restJson1CodeReviewType = function (input, context) {
1469
- return __assign(__assign({}, (input.AnalysisTypes != null && {
1470
- AnalysisTypes: serializeAws_restJson1AnalysisTypes(input.AnalysisTypes, context),
1471
- })), (input.RepositoryAnalysis != null && {
1472
- RepositoryAnalysis: serializeAws_restJson1RepositoryAnalysis(input.RepositoryAnalysis, context),
1473
- }));
1040
+ const serializeAws_restJson1CodeReviewType = (input, context) => {
1041
+ return {
1042
+ ...(input.AnalysisTypes != null && {
1043
+ AnalysisTypes: serializeAws_restJson1AnalysisTypes(input.AnalysisTypes, context),
1044
+ }),
1045
+ ...(input.RepositoryAnalysis != null && {
1046
+ RepositoryAnalysis: serializeAws_restJson1RepositoryAnalysis(input.RepositoryAnalysis, context),
1047
+ }),
1048
+ };
1474
1049
  };
1475
- var serializeAws_restJson1CommitDiffSourceCodeType = function (input, context) {
1476
- return __assign(__assign(__assign({}, (input.DestinationCommit != null && { DestinationCommit: input.DestinationCommit })), (input.MergeBaseCommit != null && { MergeBaseCommit: input.MergeBaseCommit })), (input.SourceCommit != null && { SourceCommit: input.SourceCommit }));
1050
+ const serializeAws_restJson1CommitDiffSourceCodeType = (input, context) => {
1051
+ return {
1052
+ ...(input.DestinationCommit != null && { DestinationCommit: input.DestinationCommit }),
1053
+ ...(input.MergeBaseCommit != null && { MergeBaseCommit: input.MergeBaseCommit }),
1054
+ ...(input.SourceCommit != null && { SourceCommit: input.SourceCommit }),
1055
+ };
1477
1056
  };
1478
- var serializeAws_restJson1EventInfo = function (input, context) {
1479
- return __assign(__assign({}, (input.Name != null && { Name: input.Name })), (input.State != null && { State: input.State }));
1057
+ const serializeAws_restJson1EventInfo = (input, context) => {
1058
+ return {
1059
+ ...(input.Name != null && { Name: input.Name }),
1060
+ ...(input.State != null && { State: input.State }),
1061
+ };
1480
1062
  };
1481
- var serializeAws_restJson1KMSKeyDetails = function (input, context) {
1482
- return __assign(__assign({}, (input.EncryptionOption != null && { EncryptionOption: input.EncryptionOption })), (input.KMSKeyId != null && { KMSKeyId: input.KMSKeyId }));
1063
+ const serializeAws_restJson1KMSKeyDetails = (input, context) => {
1064
+ return {
1065
+ ...(input.EncryptionOption != null && { EncryptionOption: input.EncryptionOption }),
1066
+ ...(input.KMSKeyId != null && { KMSKeyId: input.KMSKeyId }),
1067
+ };
1483
1068
  };
1484
- var serializeAws_restJson1Reactions = function (input, context) {
1069
+ const serializeAws_restJson1Reactions = (input, context) => {
1485
1070
  return input
1486
- .filter(function (e) { return e != null; })
1487
- .map(function (entry) {
1071
+ .filter((e) => e != null)
1072
+ .map((entry) => {
1488
1073
  return entry;
1489
1074
  });
1490
1075
  };
1491
- var serializeAws_restJson1Repository = function (input, context) {
1492
- return __assign(__assign(__assign(__assign({}, (input.Bitbucket != null && {
1493
- Bitbucket: serializeAws_restJson1ThirdPartySourceRepository(input.Bitbucket, context),
1494
- })), (input.CodeCommit != null && {
1495
- CodeCommit: serializeAws_restJson1CodeCommitRepository(input.CodeCommit, context),
1496
- })), (input.GitHubEnterpriseServer != null && {
1497
- GitHubEnterpriseServer: serializeAws_restJson1ThirdPartySourceRepository(input.GitHubEnterpriseServer, context),
1498
- })), (input.S3Bucket != null && { S3Bucket: serializeAws_restJson1S3Repository(input.S3Bucket, context) }));
1499
- };
1500
- var serializeAws_restJson1RepositoryAnalysis = function (input, context) {
1501
- return __assign(__assign({}, (input.RepositoryHead != null && {
1502
- RepositoryHead: serializeAws_restJson1RepositoryHeadSourceCodeType(input.RepositoryHead, context),
1503
- })), (input.SourceCodeType != null && {
1504
- SourceCodeType: serializeAws_restJson1SourceCodeType(input.SourceCodeType, context),
1505
- }));
1506
- };
1507
- var serializeAws_restJson1RepositoryHeadSourceCodeType = function (input, context) {
1508
- return __assign({}, (input.BranchName != null && { BranchName: input.BranchName }));
1509
- };
1510
- var serializeAws_restJson1RequestMetadata = function (input, context) {
1511
- return __assign(__assign(__assign(__assign({}, (input.EventInfo != null && { EventInfo: serializeAws_restJson1EventInfo(input.EventInfo, context) })), (input.RequestId != null && { RequestId: input.RequestId })), (input.Requester != null && { Requester: input.Requester })), (input.VendorName != null && { VendorName: input.VendorName }));
1512
- };
1513
- var serializeAws_restJson1S3BucketRepository = function (input, context) {
1514
- return __assign(__assign({}, (input.Details != null && { Details: serializeAws_restJson1S3RepositoryDetails(input.Details, context) })), (input.Name != null && { Name: input.Name }));
1515
- };
1516
- var serializeAws_restJson1S3Repository = function (input, context) {
1517
- return __assign(__assign({}, (input.BucketName != null && { BucketName: input.BucketName })), (input.Name != null && { Name: input.Name }));
1518
- };
1519
- var serializeAws_restJson1S3RepositoryDetails = function (input, context) {
1520
- return __assign(__assign({}, (input.BucketName != null && { BucketName: input.BucketName })), (input.CodeArtifacts != null && {
1521
- CodeArtifacts: serializeAws_restJson1CodeArtifacts(input.CodeArtifacts, context),
1522
- }));
1523
- };
1524
- var serializeAws_restJson1SourceCodeType = function (input, context) {
1525
- return __assign(__assign(__assign(__assign(__assign({}, (input.BranchDiff != null && {
1526
- BranchDiff: serializeAws_restJson1BranchDiffSourceCodeType(input.BranchDiff, context),
1527
- })), (input.CommitDiff != null && {
1528
- CommitDiff: serializeAws_restJson1CommitDiffSourceCodeType(input.CommitDiff, context),
1529
- })), (input.RepositoryHead != null && {
1530
- RepositoryHead: serializeAws_restJson1RepositoryHeadSourceCodeType(input.RepositoryHead, context),
1531
- })), (input.RequestMetadata != null && {
1532
- RequestMetadata: serializeAws_restJson1RequestMetadata(input.RequestMetadata, context),
1533
- })), (input.S3BucketRepository != null && {
1534
- S3BucketRepository: serializeAws_restJson1S3BucketRepository(input.S3BucketRepository, context),
1535
- }));
1536
- };
1537
- var serializeAws_restJson1TagMap = function (input, context) {
1538
- return Object.entries(input).reduce(function (acc, _a) {
1539
- var _b;
1540
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1076
+ const serializeAws_restJson1Repository = (input, context) => {
1077
+ return {
1078
+ ...(input.Bitbucket != null && {
1079
+ Bitbucket: serializeAws_restJson1ThirdPartySourceRepository(input.Bitbucket, context),
1080
+ }),
1081
+ ...(input.CodeCommit != null && {
1082
+ CodeCommit: serializeAws_restJson1CodeCommitRepository(input.CodeCommit, context),
1083
+ }),
1084
+ ...(input.GitHubEnterpriseServer != null && {
1085
+ GitHubEnterpriseServer: serializeAws_restJson1ThirdPartySourceRepository(input.GitHubEnterpriseServer, context),
1086
+ }),
1087
+ ...(input.S3Bucket != null && { S3Bucket: serializeAws_restJson1S3Repository(input.S3Bucket, context) }),
1088
+ };
1089
+ };
1090
+ const serializeAws_restJson1RepositoryAnalysis = (input, context) => {
1091
+ return {
1092
+ ...(input.RepositoryHead != null && {
1093
+ RepositoryHead: serializeAws_restJson1RepositoryHeadSourceCodeType(input.RepositoryHead, context),
1094
+ }),
1095
+ ...(input.SourceCodeType != null && {
1096
+ SourceCodeType: serializeAws_restJson1SourceCodeType(input.SourceCodeType, context),
1097
+ }),
1098
+ };
1099
+ };
1100
+ const serializeAws_restJson1RepositoryHeadSourceCodeType = (input, context) => {
1101
+ return {
1102
+ ...(input.BranchName != null && { BranchName: input.BranchName }),
1103
+ };
1104
+ };
1105
+ const serializeAws_restJson1RequestMetadata = (input, context) => {
1106
+ return {
1107
+ ...(input.EventInfo != null && { EventInfo: serializeAws_restJson1EventInfo(input.EventInfo, context) }),
1108
+ ...(input.RequestId != null && { RequestId: input.RequestId }),
1109
+ ...(input.Requester != null && { Requester: input.Requester }),
1110
+ ...(input.VendorName != null && { VendorName: input.VendorName }),
1111
+ };
1112
+ };
1113
+ const serializeAws_restJson1S3BucketRepository = (input, context) => {
1114
+ return {
1115
+ ...(input.Details != null && { Details: serializeAws_restJson1S3RepositoryDetails(input.Details, context) }),
1116
+ ...(input.Name != null && { Name: input.Name }),
1117
+ };
1118
+ };
1119
+ const serializeAws_restJson1S3Repository = (input, context) => {
1120
+ return {
1121
+ ...(input.BucketName != null && { BucketName: input.BucketName }),
1122
+ ...(input.Name != null && { Name: input.Name }),
1123
+ };
1124
+ };
1125
+ const serializeAws_restJson1S3RepositoryDetails = (input, context) => {
1126
+ return {
1127
+ ...(input.BucketName != null && { BucketName: input.BucketName }),
1128
+ ...(input.CodeArtifacts != null && {
1129
+ CodeArtifacts: serializeAws_restJson1CodeArtifacts(input.CodeArtifacts, context),
1130
+ }),
1131
+ };
1132
+ };
1133
+ const serializeAws_restJson1SourceCodeType = (input, context) => {
1134
+ return {
1135
+ ...(input.BranchDiff != null && {
1136
+ BranchDiff: serializeAws_restJson1BranchDiffSourceCodeType(input.BranchDiff, context),
1137
+ }),
1138
+ ...(input.CommitDiff != null && {
1139
+ CommitDiff: serializeAws_restJson1CommitDiffSourceCodeType(input.CommitDiff, context),
1140
+ }),
1141
+ ...(input.RepositoryHead != null && {
1142
+ RepositoryHead: serializeAws_restJson1RepositoryHeadSourceCodeType(input.RepositoryHead, context),
1143
+ }),
1144
+ ...(input.RequestMetadata != null && {
1145
+ RequestMetadata: serializeAws_restJson1RequestMetadata(input.RequestMetadata, context),
1146
+ }),
1147
+ ...(input.S3BucketRepository != null && {
1148
+ S3BucketRepository: serializeAws_restJson1S3BucketRepository(input.S3BucketRepository, context),
1149
+ }),
1150
+ };
1151
+ };
1152
+ const serializeAws_restJson1TagMap = (input, context) => {
1153
+ return Object.entries(input).reduce((acc, [key, value]) => {
1541
1154
  if (value === null) {
1542
1155
  return acc;
1543
1156
  }
1544
- return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
1157
+ return {
1158
+ ...acc,
1159
+ [key]: value,
1160
+ };
1545
1161
  }, {});
1546
1162
  };
1547
- var serializeAws_restJson1ThirdPartySourceRepository = function (input, context) {
1548
- return __assign(__assign(__assign({}, (input.ConnectionArn != null && { ConnectionArn: input.ConnectionArn })), (input.Name != null && { Name: input.Name })), (input.Owner != null && { Owner: input.Owner }));
1163
+ const serializeAws_restJson1ThirdPartySourceRepository = (input, context) => {
1164
+ return {
1165
+ ...(input.ConnectionArn != null && { ConnectionArn: input.ConnectionArn }),
1166
+ ...(input.Name != null && { Name: input.Name }),
1167
+ ...(input.Owner != null && { Owner: input.Owner }),
1168
+ };
1549
1169
  };
1550
- var deserializeAws_restJson1AnalysisTypes = function (output, context) {
1551
- var retVal = (output || [])
1552
- .filter(function (e) { return e != null; })
1553
- .map(function (entry) {
1170
+ const deserializeAws_restJson1AnalysisTypes = (output, context) => {
1171
+ const retVal = (output || [])
1172
+ .filter((e) => e != null)
1173
+ .map((entry) => {
1554
1174
  if (entry === null) {
1555
1175
  return null;
1556
1176
  }
@@ -1558,19 +1178,19 @@ var deserializeAws_restJson1AnalysisTypes = function (output, context) {
1558
1178
  });
1559
1179
  return retVal;
1560
1180
  };
1561
- var deserializeAws_restJson1BranchDiffSourceCodeType = function (output, context) {
1181
+ const deserializeAws_restJson1BranchDiffSourceCodeType = (output, context) => {
1562
1182
  return {
1563
1183
  DestinationBranchName: __expectString(output.DestinationBranchName),
1564
1184
  SourceBranchName: __expectString(output.SourceBranchName),
1565
1185
  };
1566
1186
  };
1567
- var deserializeAws_restJson1CodeArtifacts = function (output, context) {
1187
+ const deserializeAws_restJson1CodeArtifacts = (output, context) => {
1568
1188
  return {
1569
1189
  BuildArtifactsObjectKey: __expectString(output.BuildArtifactsObjectKey),
1570
1190
  SourceCodeArtifactsObjectKey: __expectString(output.SourceCodeArtifactsObjectKey),
1571
1191
  };
1572
1192
  };
1573
- var deserializeAws_restJson1CodeReview = function (output, context) {
1193
+ const deserializeAws_restJson1CodeReview = (output, context) => {
1574
1194
  return {
1575
1195
  AnalysisTypes: output.AnalysisTypes != null ? deserializeAws_restJson1AnalysisTypes(output.AnalysisTypes, context) : undefined,
1576
1196
  AssociationArn: __expectString(output.AssociationArn),
@@ -1596,10 +1216,10 @@ var deserializeAws_restJson1CodeReview = function (output, context) {
1596
1216
  Type: __expectString(output.Type),
1597
1217
  };
1598
1218
  };
1599
- var deserializeAws_restJson1CodeReviewSummaries = function (output, context) {
1600
- var retVal = (output || [])
1601
- .filter(function (e) { return e != null; })
1602
- .map(function (entry) {
1219
+ const deserializeAws_restJson1CodeReviewSummaries = (output, context) => {
1220
+ const retVal = (output || [])
1221
+ .filter((e) => e != null)
1222
+ .map((entry) => {
1603
1223
  if (entry === null) {
1604
1224
  return null;
1605
1225
  }
@@ -1607,7 +1227,7 @@ var deserializeAws_restJson1CodeReviewSummaries = function (output, context) {
1607
1227
  });
1608
1228
  return retVal;
1609
1229
  };
1610
- var deserializeAws_restJson1CodeReviewSummary = function (output, context) {
1230
+ const deserializeAws_restJson1CodeReviewSummary = (output, context) => {
1611
1231
  return {
1612
1232
  CodeReviewArn: __expectString(output.CodeReviewArn),
1613
1233
  CreatedTimeStamp: output.CreatedTimeStamp != null
@@ -1631,43 +1251,43 @@ var deserializeAws_restJson1CodeReviewSummary = function (output, context) {
1631
1251
  Type: __expectString(output.Type),
1632
1252
  };
1633
1253
  };
1634
- var deserializeAws_restJson1CommitDiffSourceCodeType = function (output, context) {
1254
+ const deserializeAws_restJson1CommitDiffSourceCodeType = (output, context) => {
1635
1255
  return {
1636
1256
  DestinationCommit: __expectString(output.DestinationCommit),
1637
1257
  MergeBaseCommit: __expectString(output.MergeBaseCommit),
1638
1258
  SourceCommit: __expectString(output.SourceCommit),
1639
1259
  };
1640
1260
  };
1641
- var deserializeAws_restJson1EventInfo = function (output, context) {
1261
+ const deserializeAws_restJson1EventInfo = (output, context) => {
1642
1262
  return {
1643
1263
  Name: __expectString(output.Name),
1644
1264
  State: __expectString(output.State),
1645
1265
  };
1646
1266
  };
1647
- var deserializeAws_restJson1KMSKeyDetails = function (output, context) {
1267
+ const deserializeAws_restJson1KMSKeyDetails = (output, context) => {
1648
1268
  return {
1649
1269
  EncryptionOption: __expectString(output.EncryptionOption),
1650
1270
  KMSKeyId: __expectString(output.KMSKeyId),
1651
1271
  };
1652
1272
  };
1653
- var deserializeAws_restJson1Metrics = function (output, context) {
1273
+ const deserializeAws_restJson1Metrics = (output, context) => {
1654
1274
  return {
1655
1275
  FindingsCount: __expectLong(output.FindingsCount),
1656
1276
  MeteredLinesOfCodeCount: __expectLong(output.MeteredLinesOfCodeCount),
1657
1277
  SuppressedLinesOfCodeCount: __expectLong(output.SuppressedLinesOfCodeCount),
1658
1278
  };
1659
1279
  };
1660
- var deserializeAws_restJson1MetricsSummary = function (output, context) {
1280
+ const deserializeAws_restJson1MetricsSummary = (output, context) => {
1661
1281
  return {
1662
1282
  FindingsCount: __expectLong(output.FindingsCount),
1663
1283
  MeteredLinesOfCodeCount: __expectLong(output.MeteredLinesOfCodeCount),
1664
1284
  SuppressedLinesOfCodeCount: __expectLong(output.SuppressedLinesOfCodeCount),
1665
1285
  };
1666
1286
  };
1667
- var deserializeAws_restJson1Reactions = function (output, context) {
1668
- var retVal = (output || [])
1669
- .filter(function (e) { return e != null; })
1670
- .map(function (entry) {
1287
+ const deserializeAws_restJson1Reactions = (output, context) => {
1288
+ const retVal = (output || [])
1289
+ .filter((e) => e != null)
1290
+ .map((entry) => {
1671
1291
  if (entry === null) {
1672
1292
  return null;
1673
1293
  }
@@ -1675,7 +1295,7 @@ var deserializeAws_restJson1Reactions = function (output, context) {
1675
1295
  });
1676
1296
  return retVal;
1677
1297
  };
1678
- var deserializeAws_restJson1RecommendationFeedback = function (output, context) {
1298
+ const deserializeAws_restJson1RecommendationFeedback = (output, context) => {
1679
1299
  return {
1680
1300
  CodeReviewArn: __expectString(output.CodeReviewArn),
1681
1301
  CreatedTimeStamp: output.CreatedTimeStamp != null
@@ -1689,10 +1309,10 @@ var deserializeAws_restJson1RecommendationFeedback = function (output, context)
1689
1309
  UserId: __expectString(output.UserId),
1690
1310
  };
1691
1311
  };
1692
- var deserializeAws_restJson1RecommendationFeedbackSummaries = function (output, context) {
1693
- var retVal = (output || [])
1694
- .filter(function (e) { return e != null; })
1695
- .map(function (entry) {
1312
+ const deserializeAws_restJson1RecommendationFeedbackSummaries = (output, context) => {
1313
+ const retVal = (output || [])
1314
+ .filter((e) => e != null)
1315
+ .map((entry) => {
1696
1316
  if (entry === null) {
1697
1317
  return null;
1698
1318
  }
@@ -1700,17 +1320,17 @@ var deserializeAws_restJson1RecommendationFeedbackSummaries = function (output,
1700
1320
  });
1701
1321
  return retVal;
1702
1322
  };
1703
- var deserializeAws_restJson1RecommendationFeedbackSummary = function (output, context) {
1323
+ const deserializeAws_restJson1RecommendationFeedbackSummary = (output, context) => {
1704
1324
  return {
1705
1325
  Reactions: output.Reactions != null ? deserializeAws_restJson1Reactions(output.Reactions, context) : undefined,
1706
1326
  RecommendationId: __expectString(output.RecommendationId),
1707
1327
  UserId: __expectString(output.UserId),
1708
1328
  };
1709
1329
  };
1710
- var deserializeAws_restJson1RecommendationSummaries = function (output, context) {
1711
- var retVal = (output || [])
1712
- .filter(function (e) { return e != null; })
1713
- .map(function (entry) {
1330
+ const deserializeAws_restJson1RecommendationSummaries = (output, context) => {
1331
+ const retVal = (output || [])
1332
+ .filter((e) => e != null)
1333
+ .map((entry) => {
1714
1334
  if (entry === null) {
1715
1335
  return null;
1716
1336
  }
@@ -1718,7 +1338,7 @@ var deserializeAws_restJson1RecommendationSummaries = function (output, context)
1718
1338
  });
1719
1339
  return retVal;
1720
1340
  };
1721
- var deserializeAws_restJson1RecommendationSummary = function (output, context) {
1341
+ const deserializeAws_restJson1RecommendationSummary = (output, context) => {
1722
1342
  return {
1723
1343
  Description: __expectString(output.Description),
1724
1344
  EndLine: __expectInt32(output.EndLine),
@@ -1730,7 +1350,7 @@ var deserializeAws_restJson1RecommendationSummary = function (output, context) {
1730
1350
  StartLine: __expectInt32(output.StartLine),
1731
1351
  };
1732
1352
  };
1733
- var deserializeAws_restJson1RepositoryAssociation = function (output, context) {
1353
+ const deserializeAws_restJson1RepositoryAssociation = (output, context) => {
1734
1354
  return {
1735
1355
  AssociationArn: __expectString(output.AssociationArn),
1736
1356
  AssociationId: __expectString(output.AssociationId),
@@ -1752,10 +1372,10 @@ var deserializeAws_restJson1RepositoryAssociation = function (output, context) {
1752
1372
  StateReason: __expectString(output.StateReason),
1753
1373
  };
1754
1374
  };
1755
- var deserializeAws_restJson1RepositoryAssociationSummaries = function (output, context) {
1756
- var retVal = (output || [])
1757
- .filter(function (e) { return e != null; })
1758
- .map(function (entry) {
1375
+ const deserializeAws_restJson1RepositoryAssociationSummaries = (output, context) => {
1376
+ const retVal = (output || [])
1377
+ .filter((e) => e != null)
1378
+ .map((entry) => {
1759
1379
  if (entry === null) {
1760
1380
  return null;
1761
1381
  }
@@ -1763,7 +1383,7 @@ var deserializeAws_restJson1RepositoryAssociationSummaries = function (output, c
1763
1383
  });
1764
1384
  return retVal;
1765
1385
  };
1766
- var deserializeAws_restJson1RepositoryAssociationSummary = function (output, context) {
1386
+ const deserializeAws_restJson1RepositoryAssociationSummary = (output, context) => {
1767
1387
  return {
1768
1388
  AssociationArn: __expectString(output.AssociationArn),
1769
1389
  AssociationId: __expectString(output.AssociationId),
@@ -1777,12 +1397,12 @@ var deserializeAws_restJson1RepositoryAssociationSummary = function (output, con
1777
1397
  State: __expectString(output.State),
1778
1398
  };
1779
1399
  };
1780
- var deserializeAws_restJson1RepositoryHeadSourceCodeType = function (output, context) {
1400
+ const deserializeAws_restJson1RepositoryHeadSourceCodeType = (output, context) => {
1781
1401
  return {
1782
1402
  BranchName: __expectString(output.BranchName),
1783
1403
  };
1784
1404
  };
1785
- var deserializeAws_restJson1RequestMetadata = function (output, context) {
1405
+ const deserializeAws_restJson1RequestMetadata = (output, context) => {
1786
1406
  return {
1787
1407
  EventInfo: output.EventInfo != null ? deserializeAws_restJson1EventInfo(output.EventInfo, context) : undefined,
1788
1408
  RequestId: __expectString(output.RequestId),
@@ -1790,7 +1410,7 @@ var deserializeAws_restJson1RequestMetadata = function (output, context) {
1790
1410
  VendorName: __expectString(output.VendorName),
1791
1411
  };
1792
1412
  };
1793
- var deserializeAws_restJson1RuleMetadata = function (output, context) {
1413
+ const deserializeAws_restJson1RuleMetadata = (output, context) => {
1794
1414
  return {
1795
1415
  LongDescription: __expectString(output.LongDescription),
1796
1416
  RuleId: __expectString(output.RuleId),
@@ -1799,10 +1419,10 @@ var deserializeAws_restJson1RuleMetadata = function (output, context) {
1799
1419
  ShortDescription: __expectString(output.ShortDescription),
1800
1420
  };
1801
1421
  };
1802
- var deserializeAws_restJson1RuleTags = function (output, context) {
1803
- var retVal = (output || [])
1804
- .filter(function (e) { return e != null; })
1805
- .map(function (entry) {
1422
+ const deserializeAws_restJson1RuleTags = (output, context) => {
1423
+ const retVal = (output || [])
1424
+ .filter((e) => e != null)
1425
+ .map((entry) => {
1806
1426
  if (entry === null) {
1807
1427
  return null;
1808
1428
  }
@@ -1810,19 +1430,19 @@ var deserializeAws_restJson1RuleTags = function (output, context) {
1810
1430
  });
1811
1431
  return retVal;
1812
1432
  };
1813
- var deserializeAws_restJson1S3BucketRepository = function (output, context) {
1433
+ const deserializeAws_restJson1S3BucketRepository = (output, context) => {
1814
1434
  return {
1815
1435
  Details: output.Details != null ? deserializeAws_restJson1S3RepositoryDetails(output.Details, context) : undefined,
1816
1436
  Name: __expectString(output.Name),
1817
1437
  };
1818
1438
  };
1819
- var deserializeAws_restJson1S3RepositoryDetails = function (output, context) {
1439
+ const deserializeAws_restJson1S3RepositoryDetails = (output, context) => {
1820
1440
  return {
1821
1441
  BucketName: __expectString(output.BucketName),
1822
1442
  CodeArtifacts: output.CodeArtifacts != null ? deserializeAws_restJson1CodeArtifacts(output.CodeArtifacts, context) : undefined,
1823
1443
  };
1824
1444
  };
1825
- var deserializeAws_restJson1SourceCodeType = function (output, context) {
1445
+ const deserializeAws_restJson1SourceCodeType = (output, context) => {
1826
1446
  return {
1827
1447
  BranchDiff: output.BranchDiff != null
1828
1448
  ? deserializeAws_restJson1BranchDiffSourceCodeType(output.BranchDiff, context)
@@ -1841,67 +1461,50 @@ var deserializeAws_restJson1SourceCodeType = function (output, context) {
1841
1461
  : undefined,
1842
1462
  };
1843
1463
  };
1844
- var deserializeAws_restJson1TagMap = function (output, context) {
1845
- return Object.entries(output).reduce(function (acc, _a) {
1846
- var _b;
1847
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1464
+ const deserializeAws_restJson1TagMap = (output, context) => {
1465
+ return Object.entries(output).reduce((acc, [key, value]) => {
1848
1466
  if (value === null) {
1849
1467
  return acc;
1850
1468
  }
1851
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1469
+ return {
1470
+ ...acc,
1471
+ [key]: __expectString(value),
1472
+ };
1852
1473
  }, {});
1853
1474
  };
1854
- var deserializeMetadata = function (output) {
1855
- var _a, _b;
1856
- return ({
1857
- httpStatusCode: output.statusCode,
1858
- requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"],
1859
- extendedRequestId: output.headers["x-amz-id-2"],
1860
- cfId: output.headers["x-amz-cf-id"],
1861
- });
1862
- };
1863
- var collectBody = function (streamBody, context) {
1864
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
1475
+ const deserializeMetadata = (output) => ({
1476
+ httpStatusCode: output.statusCode,
1477
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1478
+ extendedRequestId: output.headers["x-amz-id-2"],
1479
+ cfId: output.headers["x-amz-cf-id"],
1480
+ });
1481
+ const collectBody = (streamBody = new Uint8Array(), context) => {
1865
1482
  if (streamBody instanceof Uint8Array) {
1866
1483
  return Promise.resolve(streamBody);
1867
1484
  }
1868
1485
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1869
1486
  };
1870
- var collectBodyString = function (streamBody, context) {
1871
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
1872
- };
1873
- var isSerializableHeaderValue = function (value) {
1874
- return value !== undefined &&
1875
- value !== null &&
1876
- value !== "" &&
1877
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1878
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1879
- };
1880
- var parseBody = function (streamBody, context) {
1881
- return collectBodyString(streamBody, context).then(function (encoded) {
1882
- if (encoded.length) {
1883
- return JSON.parse(encoded);
1884
- }
1885
- return {};
1886
- });
1487
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1488
+ const isSerializableHeaderValue = (value) => value !== undefined &&
1489
+ value !== null &&
1490
+ value !== "" &&
1491
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1492
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1493
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1494
+ if (encoded.length) {
1495
+ return JSON.parse(encoded);
1496
+ }
1497
+ return {};
1498
+ });
1499
+ const parseErrorBody = async (errorBody, context) => {
1500
+ const value = await parseBody(errorBody, context);
1501
+ value.message = value.message ?? value.Message;
1502
+ return value;
1887
1503
  };
1888
- var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
1889
- var value;
1890
- var _a;
1891
- return __generator(this, function (_b) {
1892
- switch (_b.label) {
1893
- case 0: return [4, parseBody(errorBody, context)];
1894
- case 1:
1895
- value = _b.sent();
1896
- value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
1897
- return [2, value];
1898
- }
1899
- });
1900
- }); };
1901
- var loadRestJsonErrorCode = function (output, data) {
1902
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
1903
- var sanitizeErrorCode = function (rawValue) {
1904
- var cleanValue = rawValue;
1504
+ const loadRestJsonErrorCode = (output, data) => {
1505
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1506
+ const sanitizeErrorCode = (rawValue) => {
1507
+ let cleanValue = rawValue;
1905
1508
  if (typeof cleanValue === "number") {
1906
1509
  cleanValue = cleanValue.toString();
1907
1510
  }
@@ -1916,7 +1519,7 @@ var loadRestJsonErrorCode = function (output, data) {
1916
1519
  }
1917
1520
  return cleanValue;
1918
1521
  };
1919
- var headerKey = findKey(output.headers, "x-amzn-errortype");
1522
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
1920
1523
  if (headerKey !== undefined) {
1921
1524
  return sanitizeErrorCode(output.headers[headerKey]);
1922
1525
  }