@aws-sdk/client-codeguru-reviewer 3.490.0 → 3.496.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 (35) hide show
  1. package/dist-cjs/CodeGuruReviewer.js +1 -39
  2. package/dist-cjs/CodeGuruReviewerClient.js +1 -43
  3. package/dist-cjs/commands/AssociateRepositoryCommand.js +1 -28
  4. package/dist-cjs/commands/CreateCodeReviewCommand.js +1 -28
  5. package/dist-cjs/commands/DescribeCodeReviewCommand.js +1 -28
  6. package/dist-cjs/commands/DescribeRecommendationFeedbackCommand.js +1 -28
  7. package/dist-cjs/commands/DescribeRepositoryAssociationCommand.js +1 -28
  8. package/dist-cjs/commands/DisassociateRepositoryCommand.js +1 -28
  9. package/dist-cjs/commands/ListCodeReviewsCommand.js +1 -28
  10. package/dist-cjs/commands/ListRecommendationFeedbackCommand.js +1 -28
  11. package/dist-cjs/commands/ListRecommendationsCommand.js +1 -28
  12. package/dist-cjs/commands/ListRepositoryAssociationsCommand.js +1 -28
  13. package/dist-cjs/commands/ListTagsForResourceCommand.js +1 -28
  14. package/dist-cjs/commands/PutRecommendationFeedbackCommand.js +1 -28
  15. package/dist-cjs/commands/TagResourceCommand.js +1 -28
  16. package/dist-cjs/commands/UntagResourceCommand.js +1 -28
  17. package/dist-cjs/commands/index.js +1 -17
  18. package/dist-cjs/endpoint/EndpointParameters.js +1 -18
  19. package/dist-cjs/extensionConfiguration.js +1 -2
  20. package/dist-cjs/index.js +1840 -12
  21. package/dist-cjs/models/CodeGuruReviewerServiceException.js +1 -12
  22. package/dist-cjs/models/index.js +1 -4
  23. package/dist-cjs/models/models_0.js +1 -168
  24. package/dist-cjs/pagination/Interfaces.js +1 -2
  25. package/dist-cjs/pagination/ListCodeReviewsPaginator.js +1 -7
  26. package/dist-cjs/pagination/ListRecommendationFeedbackPaginator.js +1 -7
  27. package/dist-cjs/pagination/ListRecommendationsPaginator.js +1 -7
  28. package/dist-cjs/pagination/ListRepositoryAssociationsPaginator.js +1 -7
  29. package/dist-cjs/pagination/index.js +1 -8
  30. package/dist-cjs/protocols/Aws_restJson1.js +1 -1077
  31. package/dist-cjs/runtimeExtensions.js +1 -22
  32. package/dist-cjs/waiters/index.js +1 -5
  33. package/dist-cjs/waiters/waitForCodeReviewCompleted.js +1 -54
  34. package/dist-cjs/waiters/waitForRepositoryAssociationSucceeded.js +1 -54
  35. package/package.json +41 -41
@@ -1,1077 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_PutRecommendationFeedbackCommand = exports.de_ListTagsForResourceCommand = exports.de_ListRepositoryAssociationsCommand = exports.de_ListRecommendationsCommand = exports.de_ListRecommendationFeedbackCommand = exports.de_ListCodeReviewsCommand = exports.de_DisassociateRepositoryCommand = exports.de_DescribeRepositoryAssociationCommand = exports.de_DescribeRecommendationFeedbackCommand = exports.de_DescribeCodeReviewCommand = exports.de_CreateCodeReviewCommand = exports.de_AssociateRepositoryCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_PutRecommendationFeedbackCommand = exports.se_ListTagsForResourceCommand = exports.se_ListRepositoryAssociationsCommand = exports.se_ListRecommendationsCommand = exports.se_ListRecommendationFeedbackCommand = exports.se_ListCodeReviewsCommand = exports.se_DisassociateRepositoryCommand = exports.se_DescribeRepositoryAssociationCommand = exports.se_DescribeRecommendationFeedbackCommand = exports.se_DescribeCodeReviewCommand = exports.se_CreateCodeReviewCommand = exports.se_AssociateRepositoryCommand = void 0;
4
- const core_1 = require("@smithy/core");
5
- const smithy_client_1 = require("@smithy/smithy-client");
6
- const uuid_1 = require("uuid");
7
- const CodeGuruReviewerServiceException_1 = require("../models/CodeGuruReviewerServiceException");
8
- const models_0_1 = require("../models/models_0");
9
- const se_AssociateRepositoryCommand = async (input, context) => {
10
- const b = (0, core_1.requestBuilder)(input, context);
11
- const headers = {
12
- "content-type": "application/json",
13
- };
14
- b.bp("/associations");
15
- let body;
16
- body = JSON.stringify((0, smithy_client_1.take)(input, {
17
- ClientRequestToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
18
- KMSKeyDetails: (_) => (0, smithy_client_1._json)(_),
19
- Repository: (_) => (0, smithy_client_1._json)(_),
20
- Tags: (_) => (0, smithy_client_1._json)(_),
21
- }));
22
- b.m("POST").h(headers).b(body);
23
- return b.build();
24
- };
25
- exports.se_AssociateRepositoryCommand = se_AssociateRepositoryCommand;
26
- const se_CreateCodeReviewCommand = async (input, context) => {
27
- const b = (0, core_1.requestBuilder)(input, context);
28
- const headers = {
29
- "content-type": "application/json",
30
- };
31
- b.bp("/codereviews");
32
- let body;
33
- body = JSON.stringify((0, smithy_client_1.take)(input, {
34
- ClientRequestToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
35
- Name: [],
36
- RepositoryAssociationArn: [],
37
- Type: (_) => (0, smithy_client_1._json)(_),
38
- }));
39
- b.m("POST").h(headers).b(body);
40
- return b.build();
41
- };
42
- exports.se_CreateCodeReviewCommand = se_CreateCodeReviewCommand;
43
- const se_DescribeCodeReviewCommand = async (input, context) => {
44
- const b = (0, core_1.requestBuilder)(input, context);
45
- const headers = {};
46
- b.bp("/codereviews/{CodeReviewArn}");
47
- b.p("CodeReviewArn", () => input.CodeReviewArn, "{CodeReviewArn}", false);
48
- let body;
49
- b.m("GET").h(headers).b(body);
50
- return b.build();
51
- };
52
- exports.se_DescribeCodeReviewCommand = se_DescribeCodeReviewCommand;
53
- const se_DescribeRecommendationFeedbackCommand = async (input, context) => {
54
- const b = (0, core_1.requestBuilder)(input, context);
55
- const headers = {};
56
- b.bp("/feedback/{CodeReviewArn}");
57
- b.p("CodeReviewArn", () => input.CodeReviewArn, "{CodeReviewArn}", false);
58
- const query = (0, smithy_client_1.map)({
59
- [_RI]: [, (0, smithy_client_1.expectNonNull)(input[_RI], `RecommendationId`)],
60
- [_UI]: [, input[_UI]],
61
- });
62
- let body;
63
- b.m("GET").h(headers).q(query).b(body);
64
- return b.build();
65
- };
66
- exports.se_DescribeRecommendationFeedbackCommand = se_DescribeRecommendationFeedbackCommand;
67
- const se_DescribeRepositoryAssociationCommand = async (input, context) => {
68
- const b = (0, core_1.requestBuilder)(input, context);
69
- const headers = {};
70
- b.bp("/associations/{AssociationArn}");
71
- b.p("AssociationArn", () => input.AssociationArn, "{AssociationArn}", false);
72
- let body;
73
- b.m("GET").h(headers).b(body);
74
- return b.build();
75
- };
76
- exports.se_DescribeRepositoryAssociationCommand = se_DescribeRepositoryAssociationCommand;
77
- const se_DisassociateRepositoryCommand = async (input, context) => {
78
- const b = (0, core_1.requestBuilder)(input, context);
79
- const headers = {};
80
- b.bp("/associations/{AssociationArn}");
81
- b.p("AssociationArn", () => input.AssociationArn, "{AssociationArn}", false);
82
- let body;
83
- b.m("DELETE").h(headers).b(body);
84
- return b.build();
85
- };
86
- exports.se_DisassociateRepositoryCommand = se_DisassociateRepositoryCommand;
87
- const se_ListCodeReviewsCommand = async (input, context) => {
88
- const b = (0, core_1.requestBuilder)(input, context);
89
- const headers = {};
90
- b.bp("/codereviews");
91
- const query = (0, smithy_client_1.map)({
92
- [_PT]: [() => input.ProviderTypes !== void 0, () => (input[_PT] || []).map((_entry) => _entry)],
93
- [_S]: [() => input.States !== void 0, () => (input[_S] || []).map((_entry) => _entry)],
94
- [_RN]: [() => input.RepositoryNames !== void 0, () => (input[_RN] || []).map((_entry) => _entry)],
95
- [_T]: [, (0, smithy_client_1.expectNonNull)(input[_T], `Type`)],
96
- [_MR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
97
- [_NT]: [, input[_NT]],
98
- });
99
- let body;
100
- b.m("GET").h(headers).q(query).b(body);
101
- return b.build();
102
- };
103
- exports.se_ListCodeReviewsCommand = se_ListCodeReviewsCommand;
104
- const se_ListRecommendationFeedbackCommand = async (input, context) => {
105
- const b = (0, core_1.requestBuilder)(input, context);
106
- const headers = {};
107
- b.bp("/feedback/{CodeReviewArn}/RecommendationFeedback");
108
- b.p("CodeReviewArn", () => input.CodeReviewArn, "{CodeReviewArn}", false);
109
- const query = (0, smithy_client_1.map)({
110
- [_NT]: [, input[_NT]],
111
- [_MR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
112
- [_UIs]: [() => input.UserIds !== void 0, () => (input[_UIs] || []).map((_entry) => _entry)],
113
- [_RIe]: [() => input.RecommendationIds !== void 0, () => (input[_RIe] || []).map((_entry) => _entry)],
114
- });
115
- let body;
116
- b.m("GET").h(headers).q(query).b(body);
117
- return b.build();
118
- };
119
- exports.se_ListRecommendationFeedbackCommand = se_ListRecommendationFeedbackCommand;
120
- const se_ListRecommendationsCommand = async (input, context) => {
121
- const b = (0, core_1.requestBuilder)(input, context);
122
- const headers = {};
123
- b.bp("/codereviews/{CodeReviewArn}/Recommendations");
124
- b.p("CodeReviewArn", () => input.CodeReviewArn, "{CodeReviewArn}", false);
125
- const query = (0, smithy_client_1.map)({
126
- [_NT]: [, input[_NT]],
127
- [_MR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
128
- });
129
- let body;
130
- b.m("GET").h(headers).q(query).b(body);
131
- return b.build();
132
- };
133
- exports.se_ListRecommendationsCommand = se_ListRecommendationsCommand;
134
- const se_ListRepositoryAssociationsCommand = async (input, context) => {
135
- const b = (0, core_1.requestBuilder)(input, context);
136
- const headers = {};
137
- b.bp("/associations");
138
- const query = (0, smithy_client_1.map)({
139
- [_PTr]: [() => input.ProviderTypes !== void 0, () => (input[_PT] || []).map((_entry) => _entry)],
140
- [_St]: [() => input.States !== void 0, () => (input[_S] || []).map((_entry) => _entry)],
141
- [_Na]: [() => input.Names !== void 0, () => (input[_N] || []).map((_entry) => _entry)],
142
- [_Ow]: [() => input.Owners !== void 0, () => (input[_O] || []).map((_entry) => _entry)],
143
- [_MR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
144
- [_NT]: [, input[_NT]],
145
- });
146
- let body;
147
- b.m("GET").h(headers).q(query).b(body);
148
- return b.build();
149
- };
150
- exports.se_ListRepositoryAssociationsCommand = se_ListRepositoryAssociationsCommand;
151
- const se_ListTagsForResourceCommand = async (input, context) => {
152
- const b = (0, core_1.requestBuilder)(input, context);
153
- const headers = {};
154
- b.bp("/tags/{resourceArn}");
155
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
156
- let body;
157
- b.m("GET").h(headers).b(body);
158
- return b.build();
159
- };
160
- exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
161
- const se_PutRecommendationFeedbackCommand = async (input, context) => {
162
- const b = (0, core_1.requestBuilder)(input, context);
163
- const headers = {
164
- "content-type": "application/json",
165
- };
166
- b.bp("/feedback");
167
- let body;
168
- body = JSON.stringify((0, smithy_client_1.take)(input, {
169
- CodeReviewArn: [],
170
- Reactions: (_) => (0, smithy_client_1._json)(_),
171
- RecommendationId: [],
172
- }));
173
- b.m("PUT").h(headers).b(body);
174
- return b.build();
175
- };
176
- exports.se_PutRecommendationFeedbackCommand = se_PutRecommendationFeedbackCommand;
177
- const se_TagResourceCommand = async (input, context) => {
178
- const b = (0, core_1.requestBuilder)(input, context);
179
- const headers = {
180
- "content-type": "application/json",
181
- };
182
- b.bp("/tags/{resourceArn}");
183
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
184
- let body;
185
- body = JSON.stringify((0, smithy_client_1.take)(input, {
186
- Tags: (_) => (0, smithy_client_1._json)(_),
187
- }));
188
- b.m("POST").h(headers).b(body);
189
- return b.build();
190
- };
191
- exports.se_TagResourceCommand = se_TagResourceCommand;
192
- const se_UntagResourceCommand = async (input, context) => {
193
- const b = (0, core_1.requestBuilder)(input, context);
194
- const headers = {};
195
- b.bp("/tags/{resourceArn}");
196
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
197
- const query = (0, smithy_client_1.map)({
198
- [_tK]: [
199
- (0, smithy_client_1.expectNonNull)(input.TagKeys, `TagKeys`) != null,
200
- () => (input[_TK] || []).map((_entry) => _entry),
201
- ],
202
- });
203
- let body;
204
- b.m("DELETE").h(headers).q(query).b(body);
205
- return b.build();
206
- };
207
- exports.se_UntagResourceCommand = se_UntagResourceCommand;
208
- const de_AssociateRepositoryCommand = async (output, context) => {
209
- if (output.statusCode !== 200 && output.statusCode >= 300) {
210
- return de_AssociateRepositoryCommandError(output, context);
211
- }
212
- const contents = (0, smithy_client_1.map)({
213
- $metadata: deserializeMetadata(output),
214
- });
215
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
216
- const doc = (0, smithy_client_1.take)(data, {
217
- RepositoryAssociation: (_) => de_RepositoryAssociation(_, context),
218
- Tags: smithy_client_1._json,
219
- });
220
- Object.assign(contents, doc);
221
- return contents;
222
- };
223
- exports.de_AssociateRepositoryCommand = de_AssociateRepositoryCommand;
224
- const de_AssociateRepositoryCommandError = async (output, context) => {
225
- const parsedOutput = {
226
- ...output,
227
- body: await parseErrorBody(output.body, context),
228
- };
229
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
230
- switch (errorCode) {
231
- case "AccessDeniedException":
232
- case "com.amazonaws.codegurureviewer#AccessDeniedException":
233
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
234
- case "ConflictException":
235
- case "com.amazonaws.codegurureviewer#ConflictException":
236
- throw await de_ConflictExceptionRes(parsedOutput, context);
237
- case "InternalServerException":
238
- case "com.amazonaws.codegurureviewer#InternalServerException":
239
- throw await de_InternalServerExceptionRes(parsedOutput, context);
240
- case "ThrottlingException":
241
- case "com.amazonaws.codegurureviewer#ThrottlingException":
242
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
243
- case "ValidationException":
244
- case "com.amazonaws.codegurureviewer#ValidationException":
245
- throw await de_ValidationExceptionRes(parsedOutput, context);
246
- default:
247
- const parsedBody = parsedOutput.body;
248
- return throwDefaultError({
249
- output,
250
- parsedBody,
251
- errorCode,
252
- });
253
- }
254
- };
255
- const de_CreateCodeReviewCommand = async (output, context) => {
256
- if (output.statusCode !== 200 && output.statusCode >= 300) {
257
- return de_CreateCodeReviewCommandError(output, context);
258
- }
259
- const contents = (0, smithy_client_1.map)({
260
- $metadata: deserializeMetadata(output),
261
- });
262
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
263
- const doc = (0, smithy_client_1.take)(data, {
264
- CodeReview: (_) => de_CodeReview(_, context),
265
- });
266
- Object.assign(contents, doc);
267
- return contents;
268
- };
269
- exports.de_CreateCodeReviewCommand = de_CreateCodeReviewCommand;
270
- const de_CreateCodeReviewCommandError = async (output, context) => {
271
- const parsedOutput = {
272
- ...output,
273
- body: await parseErrorBody(output.body, context),
274
- };
275
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
276
- switch (errorCode) {
277
- case "AccessDeniedException":
278
- case "com.amazonaws.codegurureviewer#AccessDeniedException":
279
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
280
- case "ConflictException":
281
- case "com.amazonaws.codegurureviewer#ConflictException":
282
- throw await de_ConflictExceptionRes(parsedOutput, context);
283
- case "InternalServerException":
284
- case "com.amazonaws.codegurureviewer#InternalServerException":
285
- throw await de_InternalServerExceptionRes(parsedOutput, context);
286
- case "ResourceNotFoundException":
287
- case "com.amazonaws.codegurureviewer#ResourceNotFoundException":
288
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
289
- case "ThrottlingException":
290
- case "com.amazonaws.codegurureviewer#ThrottlingException":
291
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
292
- case "ValidationException":
293
- case "com.amazonaws.codegurureviewer#ValidationException":
294
- throw await de_ValidationExceptionRes(parsedOutput, context);
295
- default:
296
- const parsedBody = parsedOutput.body;
297
- return throwDefaultError({
298
- output,
299
- parsedBody,
300
- errorCode,
301
- });
302
- }
303
- };
304
- const de_DescribeCodeReviewCommand = async (output, context) => {
305
- if (output.statusCode !== 200 && output.statusCode >= 300) {
306
- return de_DescribeCodeReviewCommandError(output, context);
307
- }
308
- const contents = (0, smithy_client_1.map)({
309
- $metadata: deserializeMetadata(output),
310
- });
311
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
312
- const doc = (0, smithy_client_1.take)(data, {
313
- CodeReview: (_) => de_CodeReview(_, context),
314
- });
315
- Object.assign(contents, doc);
316
- return contents;
317
- };
318
- exports.de_DescribeCodeReviewCommand = de_DescribeCodeReviewCommand;
319
- const de_DescribeCodeReviewCommandError = async (output, context) => {
320
- const parsedOutput = {
321
- ...output,
322
- body: await parseErrorBody(output.body, context),
323
- };
324
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
325
- switch (errorCode) {
326
- case "AccessDeniedException":
327
- case "com.amazonaws.codegurureviewer#AccessDeniedException":
328
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
329
- case "InternalServerException":
330
- case "com.amazonaws.codegurureviewer#InternalServerException":
331
- throw await de_InternalServerExceptionRes(parsedOutput, context);
332
- case "ResourceNotFoundException":
333
- case "com.amazonaws.codegurureviewer#ResourceNotFoundException":
334
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
335
- case "ThrottlingException":
336
- case "com.amazonaws.codegurureviewer#ThrottlingException":
337
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
338
- case "ValidationException":
339
- case "com.amazonaws.codegurureviewer#ValidationException":
340
- throw await de_ValidationExceptionRes(parsedOutput, context);
341
- default:
342
- const parsedBody = parsedOutput.body;
343
- return throwDefaultError({
344
- output,
345
- parsedBody,
346
- errorCode,
347
- });
348
- }
349
- };
350
- const de_DescribeRecommendationFeedbackCommand = async (output, context) => {
351
- if (output.statusCode !== 200 && output.statusCode >= 300) {
352
- return de_DescribeRecommendationFeedbackCommandError(output, context);
353
- }
354
- const contents = (0, smithy_client_1.map)({
355
- $metadata: deserializeMetadata(output),
356
- });
357
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
358
- const doc = (0, smithy_client_1.take)(data, {
359
- RecommendationFeedback: (_) => de_RecommendationFeedback(_, context),
360
- });
361
- Object.assign(contents, doc);
362
- return contents;
363
- };
364
- exports.de_DescribeRecommendationFeedbackCommand = de_DescribeRecommendationFeedbackCommand;
365
- const de_DescribeRecommendationFeedbackCommandError = async (output, context) => {
366
- const parsedOutput = {
367
- ...output,
368
- body: await parseErrorBody(output.body, context),
369
- };
370
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
371
- switch (errorCode) {
372
- case "AccessDeniedException":
373
- case "com.amazonaws.codegurureviewer#AccessDeniedException":
374
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
375
- case "InternalServerException":
376
- case "com.amazonaws.codegurureviewer#InternalServerException":
377
- throw await de_InternalServerExceptionRes(parsedOutput, context);
378
- case "ResourceNotFoundException":
379
- case "com.amazonaws.codegurureviewer#ResourceNotFoundException":
380
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
381
- case "ThrottlingException":
382
- case "com.amazonaws.codegurureviewer#ThrottlingException":
383
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
384
- case "ValidationException":
385
- case "com.amazonaws.codegurureviewer#ValidationException":
386
- throw await de_ValidationExceptionRes(parsedOutput, context);
387
- default:
388
- const parsedBody = parsedOutput.body;
389
- return throwDefaultError({
390
- output,
391
- parsedBody,
392
- errorCode,
393
- });
394
- }
395
- };
396
- const de_DescribeRepositoryAssociationCommand = async (output, context) => {
397
- if (output.statusCode !== 200 && output.statusCode >= 300) {
398
- return de_DescribeRepositoryAssociationCommandError(output, context);
399
- }
400
- const contents = (0, smithy_client_1.map)({
401
- $metadata: deserializeMetadata(output),
402
- });
403
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
404
- const doc = (0, smithy_client_1.take)(data, {
405
- RepositoryAssociation: (_) => de_RepositoryAssociation(_, context),
406
- Tags: smithy_client_1._json,
407
- });
408
- Object.assign(contents, doc);
409
- return contents;
410
- };
411
- exports.de_DescribeRepositoryAssociationCommand = de_DescribeRepositoryAssociationCommand;
412
- const de_DescribeRepositoryAssociationCommandError = async (output, context) => {
413
- const parsedOutput = {
414
- ...output,
415
- body: await parseErrorBody(output.body, context),
416
- };
417
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
418
- switch (errorCode) {
419
- case "AccessDeniedException":
420
- case "com.amazonaws.codegurureviewer#AccessDeniedException":
421
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
422
- case "InternalServerException":
423
- case "com.amazonaws.codegurureviewer#InternalServerException":
424
- throw await de_InternalServerExceptionRes(parsedOutput, context);
425
- case "NotFoundException":
426
- case "com.amazonaws.codegurureviewer#NotFoundException":
427
- throw await de_NotFoundExceptionRes(parsedOutput, context);
428
- case "ThrottlingException":
429
- case "com.amazonaws.codegurureviewer#ThrottlingException":
430
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
431
- case "ValidationException":
432
- case "com.amazonaws.codegurureviewer#ValidationException":
433
- throw await de_ValidationExceptionRes(parsedOutput, context);
434
- default:
435
- const parsedBody = parsedOutput.body;
436
- return throwDefaultError({
437
- output,
438
- parsedBody,
439
- errorCode,
440
- });
441
- }
442
- };
443
- const de_DisassociateRepositoryCommand = async (output, context) => {
444
- if (output.statusCode !== 200 && output.statusCode >= 300) {
445
- return de_DisassociateRepositoryCommandError(output, context);
446
- }
447
- const contents = (0, smithy_client_1.map)({
448
- $metadata: deserializeMetadata(output),
449
- });
450
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
451
- const doc = (0, smithy_client_1.take)(data, {
452
- RepositoryAssociation: (_) => de_RepositoryAssociation(_, context),
453
- Tags: smithy_client_1._json,
454
- });
455
- Object.assign(contents, doc);
456
- return contents;
457
- };
458
- exports.de_DisassociateRepositoryCommand = de_DisassociateRepositoryCommand;
459
- const de_DisassociateRepositoryCommandError = async (output, context) => {
460
- const parsedOutput = {
461
- ...output,
462
- body: await parseErrorBody(output.body, context),
463
- };
464
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
465
- switch (errorCode) {
466
- case "AccessDeniedException":
467
- case "com.amazonaws.codegurureviewer#AccessDeniedException":
468
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
469
- case "ConflictException":
470
- case "com.amazonaws.codegurureviewer#ConflictException":
471
- throw await de_ConflictExceptionRes(parsedOutput, context);
472
- case "InternalServerException":
473
- case "com.amazonaws.codegurureviewer#InternalServerException":
474
- throw await de_InternalServerExceptionRes(parsedOutput, context);
475
- case "NotFoundException":
476
- case "com.amazonaws.codegurureviewer#NotFoundException":
477
- throw await de_NotFoundExceptionRes(parsedOutput, context);
478
- case "ThrottlingException":
479
- case "com.amazonaws.codegurureviewer#ThrottlingException":
480
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
481
- case "ValidationException":
482
- case "com.amazonaws.codegurureviewer#ValidationException":
483
- throw await de_ValidationExceptionRes(parsedOutput, context);
484
- default:
485
- const parsedBody = parsedOutput.body;
486
- return throwDefaultError({
487
- output,
488
- parsedBody,
489
- errorCode,
490
- });
491
- }
492
- };
493
- const de_ListCodeReviewsCommand = async (output, context) => {
494
- if (output.statusCode !== 200 && output.statusCode >= 300) {
495
- return de_ListCodeReviewsCommandError(output, context);
496
- }
497
- const contents = (0, smithy_client_1.map)({
498
- $metadata: deserializeMetadata(output),
499
- });
500
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
501
- const doc = (0, smithy_client_1.take)(data, {
502
- CodeReviewSummaries: (_) => de_CodeReviewSummaries(_, context),
503
- NextToken: smithy_client_1.expectString,
504
- });
505
- Object.assign(contents, doc);
506
- return contents;
507
- };
508
- exports.de_ListCodeReviewsCommand = de_ListCodeReviewsCommand;
509
- const de_ListCodeReviewsCommandError = async (output, context) => {
510
- const parsedOutput = {
511
- ...output,
512
- body: await parseErrorBody(output.body, context),
513
- };
514
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
515
- switch (errorCode) {
516
- case "AccessDeniedException":
517
- case "com.amazonaws.codegurureviewer#AccessDeniedException":
518
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
519
- case "InternalServerException":
520
- case "com.amazonaws.codegurureviewer#InternalServerException":
521
- throw await de_InternalServerExceptionRes(parsedOutput, context);
522
- case "ThrottlingException":
523
- case "com.amazonaws.codegurureviewer#ThrottlingException":
524
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
525
- case "ValidationException":
526
- case "com.amazonaws.codegurureviewer#ValidationException":
527
- throw await de_ValidationExceptionRes(parsedOutput, context);
528
- default:
529
- const parsedBody = parsedOutput.body;
530
- return throwDefaultError({
531
- output,
532
- parsedBody,
533
- errorCode,
534
- });
535
- }
536
- };
537
- const de_ListRecommendationFeedbackCommand = async (output, context) => {
538
- if (output.statusCode !== 200 && output.statusCode >= 300) {
539
- return de_ListRecommendationFeedbackCommandError(output, context);
540
- }
541
- const contents = (0, smithy_client_1.map)({
542
- $metadata: deserializeMetadata(output),
543
- });
544
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
545
- const doc = (0, smithy_client_1.take)(data, {
546
- NextToken: smithy_client_1.expectString,
547
- RecommendationFeedbackSummaries: smithy_client_1._json,
548
- });
549
- Object.assign(contents, doc);
550
- return contents;
551
- };
552
- exports.de_ListRecommendationFeedbackCommand = de_ListRecommendationFeedbackCommand;
553
- const de_ListRecommendationFeedbackCommandError = async (output, context) => {
554
- const parsedOutput = {
555
- ...output,
556
- body: await parseErrorBody(output.body, context),
557
- };
558
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
559
- switch (errorCode) {
560
- case "AccessDeniedException":
561
- case "com.amazonaws.codegurureviewer#AccessDeniedException":
562
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
563
- case "InternalServerException":
564
- case "com.amazonaws.codegurureviewer#InternalServerException":
565
- throw await de_InternalServerExceptionRes(parsedOutput, context);
566
- case "ResourceNotFoundException":
567
- case "com.amazonaws.codegurureviewer#ResourceNotFoundException":
568
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
569
- case "ThrottlingException":
570
- case "com.amazonaws.codegurureviewer#ThrottlingException":
571
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
572
- case "ValidationException":
573
- case "com.amazonaws.codegurureviewer#ValidationException":
574
- throw await de_ValidationExceptionRes(parsedOutput, context);
575
- default:
576
- const parsedBody = parsedOutput.body;
577
- return throwDefaultError({
578
- output,
579
- parsedBody,
580
- errorCode,
581
- });
582
- }
583
- };
584
- const de_ListRecommendationsCommand = async (output, context) => {
585
- if (output.statusCode !== 200 && output.statusCode >= 300) {
586
- return de_ListRecommendationsCommandError(output, context);
587
- }
588
- const contents = (0, smithy_client_1.map)({
589
- $metadata: deserializeMetadata(output),
590
- });
591
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
592
- const doc = (0, smithy_client_1.take)(data, {
593
- NextToken: smithy_client_1.expectString,
594
- RecommendationSummaries: smithy_client_1._json,
595
- });
596
- Object.assign(contents, doc);
597
- return contents;
598
- };
599
- exports.de_ListRecommendationsCommand = de_ListRecommendationsCommand;
600
- const de_ListRecommendationsCommandError = async (output, context) => {
601
- const parsedOutput = {
602
- ...output,
603
- body: await parseErrorBody(output.body, context),
604
- };
605
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
606
- switch (errorCode) {
607
- case "AccessDeniedException":
608
- case "com.amazonaws.codegurureviewer#AccessDeniedException":
609
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
610
- case "InternalServerException":
611
- case "com.amazonaws.codegurureviewer#InternalServerException":
612
- throw await de_InternalServerExceptionRes(parsedOutput, context);
613
- case "ResourceNotFoundException":
614
- case "com.amazonaws.codegurureviewer#ResourceNotFoundException":
615
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
616
- case "ThrottlingException":
617
- case "com.amazonaws.codegurureviewer#ThrottlingException":
618
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
619
- case "ValidationException":
620
- case "com.amazonaws.codegurureviewer#ValidationException":
621
- throw await de_ValidationExceptionRes(parsedOutput, context);
622
- default:
623
- const parsedBody = parsedOutput.body;
624
- return throwDefaultError({
625
- output,
626
- parsedBody,
627
- errorCode,
628
- });
629
- }
630
- };
631
- const de_ListRepositoryAssociationsCommand = async (output, context) => {
632
- if (output.statusCode !== 200 && output.statusCode >= 300) {
633
- return de_ListRepositoryAssociationsCommandError(output, context);
634
- }
635
- const contents = (0, smithy_client_1.map)({
636
- $metadata: deserializeMetadata(output),
637
- });
638
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
639
- const doc = (0, smithy_client_1.take)(data, {
640
- NextToken: smithy_client_1.expectString,
641
- RepositoryAssociationSummaries: (_) => de_RepositoryAssociationSummaries(_, context),
642
- });
643
- Object.assign(contents, doc);
644
- return contents;
645
- };
646
- exports.de_ListRepositoryAssociationsCommand = de_ListRepositoryAssociationsCommand;
647
- const de_ListRepositoryAssociationsCommandError = async (output, context) => {
648
- const parsedOutput = {
649
- ...output,
650
- body: await parseErrorBody(output.body, context),
651
- };
652
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
653
- switch (errorCode) {
654
- case "InternalServerException":
655
- case "com.amazonaws.codegurureviewer#InternalServerException":
656
- throw await de_InternalServerExceptionRes(parsedOutput, context);
657
- case "ThrottlingException":
658
- case "com.amazonaws.codegurureviewer#ThrottlingException":
659
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
660
- case "ValidationException":
661
- case "com.amazonaws.codegurureviewer#ValidationException":
662
- throw await de_ValidationExceptionRes(parsedOutput, context);
663
- default:
664
- const parsedBody = parsedOutput.body;
665
- return throwDefaultError({
666
- output,
667
- parsedBody,
668
- errorCode,
669
- });
670
- }
671
- };
672
- const de_ListTagsForResourceCommand = async (output, context) => {
673
- if (output.statusCode !== 200 && output.statusCode >= 300) {
674
- return de_ListTagsForResourceCommandError(output, context);
675
- }
676
- const contents = (0, smithy_client_1.map)({
677
- $metadata: deserializeMetadata(output),
678
- });
679
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
680
- const doc = (0, smithy_client_1.take)(data, {
681
- Tags: smithy_client_1._json,
682
- });
683
- Object.assign(contents, doc);
684
- return contents;
685
- };
686
- exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
687
- const de_ListTagsForResourceCommandError = async (output, context) => {
688
- const parsedOutput = {
689
- ...output,
690
- body: await parseErrorBody(output.body, context),
691
- };
692
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
693
- switch (errorCode) {
694
- case "InternalServerException":
695
- case "com.amazonaws.codegurureviewer#InternalServerException":
696
- throw await de_InternalServerExceptionRes(parsedOutput, context);
697
- case "ResourceNotFoundException":
698
- case "com.amazonaws.codegurureviewer#ResourceNotFoundException":
699
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
700
- case "ValidationException":
701
- case "com.amazonaws.codegurureviewer#ValidationException":
702
- throw await de_ValidationExceptionRes(parsedOutput, context);
703
- default:
704
- const parsedBody = parsedOutput.body;
705
- return throwDefaultError({
706
- output,
707
- parsedBody,
708
- errorCode,
709
- });
710
- }
711
- };
712
- const de_PutRecommendationFeedbackCommand = async (output, context) => {
713
- if (output.statusCode !== 200 && output.statusCode >= 300) {
714
- return de_PutRecommendationFeedbackCommandError(output, context);
715
- }
716
- const contents = (0, smithy_client_1.map)({
717
- $metadata: deserializeMetadata(output),
718
- });
719
- await (0, smithy_client_1.collectBody)(output.body, context);
720
- return contents;
721
- };
722
- exports.de_PutRecommendationFeedbackCommand = de_PutRecommendationFeedbackCommand;
723
- const de_PutRecommendationFeedbackCommandError = async (output, context) => {
724
- const parsedOutput = {
725
- ...output,
726
- body: await parseErrorBody(output.body, context),
727
- };
728
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
729
- switch (errorCode) {
730
- case "AccessDeniedException":
731
- case "com.amazonaws.codegurureviewer#AccessDeniedException":
732
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
733
- case "InternalServerException":
734
- case "com.amazonaws.codegurureviewer#InternalServerException":
735
- throw await de_InternalServerExceptionRes(parsedOutput, context);
736
- case "ResourceNotFoundException":
737
- case "com.amazonaws.codegurureviewer#ResourceNotFoundException":
738
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
739
- case "ThrottlingException":
740
- case "com.amazonaws.codegurureviewer#ThrottlingException":
741
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
742
- case "ValidationException":
743
- case "com.amazonaws.codegurureviewer#ValidationException":
744
- throw await de_ValidationExceptionRes(parsedOutput, context);
745
- default:
746
- const parsedBody = parsedOutput.body;
747
- return throwDefaultError({
748
- output,
749
- parsedBody,
750
- errorCode,
751
- });
752
- }
753
- };
754
- const de_TagResourceCommand = async (output, context) => {
755
- if (output.statusCode !== 200 && output.statusCode >= 300) {
756
- return de_TagResourceCommandError(output, context);
757
- }
758
- const contents = (0, smithy_client_1.map)({
759
- $metadata: deserializeMetadata(output),
760
- });
761
- await (0, smithy_client_1.collectBody)(output.body, context);
762
- return contents;
763
- };
764
- exports.de_TagResourceCommand = de_TagResourceCommand;
765
- const de_TagResourceCommandError = async (output, context) => {
766
- const parsedOutput = {
767
- ...output,
768
- body: await parseErrorBody(output.body, context),
769
- };
770
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
771
- switch (errorCode) {
772
- case "InternalServerException":
773
- case "com.amazonaws.codegurureviewer#InternalServerException":
774
- throw await de_InternalServerExceptionRes(parsedOutput, context);
775
- case "ResourceNotFoundException":
776
- case "com.amazonaws.codegurureviewer#ResourceNotFoundException":
777
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
778
- case "ValidationException":
779
- case "com.amazonaws.codegurureviewer#ValidationException":
780
- throw await de_ValidationExceptionRes(parsedOutput, context);
781
- default:
782
- const parsedBody = parsedOutput.body;
783
- return throwDefaultError({
784
- output,
785
- parsedBody,
786
- errorCode,
787
- });
788
- }
789
- };
790
- const de_UntagResourceCommand = async (output, context) => {
791
- if (output.statusCode !== 200 && output.statusCode >= 300) {
792
- return de_UntagResourceCommandError(output, context);
793
- }
794
- const contents = (0, smithy_client_1.map)({
795
- $metadata: deserializeMetadata(output),
796
- });
797
- await (0, smithy_client_1.collectBody)(output.body, context);
798
- return contents;
799
- };
800
- exports.de_UntagResourceCommand = de_UntagResourceCommand;
801
- const de_UntagResourceCommandError = async (output, context) => {
802
- const parsedOutput = {
803
- ...output,
804
- body: await parseErrorBody(output.body, context),
805
- };
806
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
807
- switch (errorCode) {
808
- case "InternalServerException":
809
- case "com.amazonaws.codegurureviewer#InternalServerException":
810
- throw await de_InternalServerExceptionRes(parsedOutput, context);
811
- case "ResourceNotFoundException":
812
- case "com.amazonaws.codegurureviewer#ResourceNotFoundException":
813
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
814
- case "ValidationException":
815
- case "com.amazonaws.codegurureviewer#ValidationException":
816
- throw await de_ValidationExceptionRes(parsedOutput, context);
817
- default:
818
- const parsedBody = parsedOutput.body;
819
- return throwDefaultError({
820
- output,
821
- parsedBody,
822
- errorCode,
823
- });
824
- }
825
- };
826
- const throwDefaultError = (0, smithy_client_1.withBaseException)(CodeGuruReviewerServiceException_1.CodeGuruReviewerServiceException);
827
- const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
828
- const contents = (0, smithy_client_1.map)({});
829
- const data = parsedOutput.body;
830
- const doc = (0, smithy_client_1.take)(data, {
831
- Message: smithy_client_1.expectString,
832
- });
833
- Object.assign(contents, doc);
834
- const exception = new models_0_1.AccessDeniedException({
835
- $metadata: deserializeMetadata(parsedOutput),
836
- ...contents,
837
- });
838
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
839
- };
840
- const de_ConflictExceptionRes = async (parsedOutput, context) => {
841
- const contents = (0, smithy_client_1.map)({});
842
- const data = parsedOutput.body;
843
- const doc = (0, smithy_client_1.take)(data, {
844
- Message: smithy_client_1.expectString,
845
- });
846
- Object.assign(contents, doc);
847
- const exception = new models_0_1.ConflictException({
848
- $metadata: deserializeMetadata(parsedOutput),
849
- ...contents,
850
- });
851
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
852
- };
853
- const de_InternalServerExceptionRes = async (parsedOutput, context) => {
854
- const contents = (0, smithy_client_1.map)({});
855
- const data = parsedOutput.body;
856
- const doc = (0, smithy_client_1.take)(data, {
857
- Message: smithy_client_1.expectString,
858
- });
859
- Object.assign(contents, doc);
860
- const exception = new models_0_1.InternalServerException({
861
- $metadata: deserializeMetadata(parsedOutput),
862
- ...contents,
863
- });
864
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
865
- };
866
- const de_NotFoundExceptionRes = async (parsedOutput, context) => {
867
- const contents = (0, smithy_client_1.map)({});
868
- const data = parsedOutput.body;
869
- const doc = (0, smithy_client_1.take)(data, {
870
- Message: smithy_client_1.expectString,
871
- });
872
- Object.assign(contents, doc);
873
- const exception = new models_0_1.NotFoundException({
874
- $metadata: deserializeMetadata(parsedOutput),
875
- ...contents,
876
- });
877
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
878
- };
879
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
880
- const contents = (0, smithy_client_1.map)({});
881
- const data = parsedOutput.body;
882
- const doc = (0, smithy_client_1.take)(data, {
883
- Message: smithy_client_1.expectString,
884
- });
885
- Object.assign(contents, doc);
886
- const exception = new models_0_1.ResourceNotFoundException({
887
- $metadata: deserializeMetadata(parsedOutput),
888
- ...contents,
889
- });
890
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
891
- };
892
- const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
893
- const contents = (0, smithy_client_1.map)({});
894
- const data = parsedOutput.body;
895
- const doc = (0, smithy_client_1.take)(data, {
896
- Message: smithy_client_1.expectString,
897
- });
898
- Object.assign(contents, doc);
899
- const exception = new models_0_1.ThrottlingException({
900
- $metadata: deserializeMetadata(parsedOutput),
901
- ...contents,
902
- });
903
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
904
- };
905
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
906
- const contents = (0, smithy_client_1.map)({});
907
- const data = parsedOutput.body;
908
- const doc = (0, smithy_client_1.take)(data, {
909
- Message: smithy_client_1.expectString,
910
- });
911
- Object.assign(contents, doc);
912
- const exception = new models_0_1.ValidationException({
913
- $metadata: deserializeMetadata(parsedOutput),
914
- ...contents,
915
- });
916
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
917
- };
918
- const de_CodeReview = (output, context) => {
919
- return (0, smithy_client_1.take)(output, {
920
- AnalysisTypes: smithy_client_1._json,
921
- AssociationArn: smithy_client_1.expectString,
922
- CodeReviewArn: smithy_client_1.expectString,
923
- ConfigFileState: smithy_client_1.expectString,
924
- CreatedTimeStamp: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
925
- LastUpdatedTimeStamp: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
926
- Metrics: smithy_client_1._json,
927
- Name: smithy_client_1.expectString,
928
- Owner: smithy_client_1.expectString,
929
- ProviderType: smithy_client_1.expectString,
930
- PullRequestId: smithy_client_1.expectString,
931
- RepositoryName: smithy_client_1.expectString,
932
- SourceCodeType: smithy_client_1._json,
933
- State: smithy_client_1.expectString,
934
- StateReason: smithy_client_1.expectString,
935
- Type: smithy_client_1.expectString,
936
- });
937
- };
938
- const de_CodeReviewSummaries = (output, context) => {
939
- const retVal = (output || [])
940
- .filter((e) => e != null)
941
- .map((entry) => {
942
- return de_CodeReviewSummary(entry, context);
943
- });
944
- return retVal;
945
- };
946
- const de_CodeReviewSummary = (output, context) => {
947
- return (0, smithy_client_1.take)(output, {
948
- CodeReviewArn: smithy_client_1.expectString,
949
- CreatedTimeStamp: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
950
- LastUpdatedTimeStamp: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
951
- MetricsSummary: smithy_client_1._json,
952
- Name: smithy_client_1.expectString,
953
- Owner: smithy_client_1.expectString,
954
- ProviderType: smithy_client_1.expectString,
955
- PullRequestId: smithy_client_1.expectString,
956
- RepositoryName: smithy_client_1.expectString,
957
- SourceCodeType: smithy_client_1._json,
958
- State: smithy_client_1.expectString,
959
- Type: smithy_client_1.expectString,
960
- });
961
- };
962
- const de_RecommendationFeedback = (output, context) => {
963
- return (0, smithy_client_1.take)(output, {
964
- CodeReviewArn: smithy_client_1.expectString,
965
- CreatedTimeStamp: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
966
- LastUpdatedTimeStamp: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
967
- Reactions: smithy_client_1._json,
968
- RecommendationId: smithy_client_1.expectString,
969
- UserId: smithy_client_1.expectString,
970
- });
971
- };
972
- const de_RepositoryAssociation = (output, context) => {
973
- return (0, smithy_client_1.take)(output, {
974
- AssociationArn: smithy_client_1.expectString,
975
- AssociationId: smithy_client_1.expectString,
976
- ConnectionArn: smithy_client_1.expectString,
977
- CreatedTimeStamp: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
978
- KMSKeyDetails: smithy_client_1._json,
979
- LastUpdatedTimeStamp: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
980
- Name: smithy_client_1.expectString,
981
- Owner: smithy_client_1.expectString,
982
- ProviderType: smithy_client_1.expectString,
983
- S3RepositoryDetails: smithy_client_1._json,
984
- State: smithy_client_1.expectString,
985
- StateReason: smithy_client_1.expectString,
986
- });
987
- };
988
- const de_RepositoryAssociationSummaries = (output, context) => {
989
- const retVal = (output || [])
990
- .filter((e) => e != null)
991
- .map((entry) => {
992
- return de_RepositoryAssociationSummary(entry, context);
993
- });
994
- return retVal;
995
- };
996
- const de_RepositoryAssociationSummary = (output, context) => {
997
- return (0, smithy_client_1.take)(output, {
998
- AssociationArn: smithy_client_1.expectString,
999
- AssociationId: smithy_client_1.expectString,
1000
- ConnectionArn: smithy_client_1.expectString,
1001
- LastUpdatedTimeStamp: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1002
- Name: smithy_client_1.expectString,
1003
- Owner: smithy_client_1.expectString,
1004
- ProviderType: smithy_client_1.expectString,
1005
- State: smithy_client_1.expectString,
1006
- });
1007
- };
1008
- const deserializeMetadata = (output) => ({
1009
- httpStatusCode: output.statusCode,
1010
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1011
- extendedRequestId: output.headers["x-amz-id-2"],
1012
- cfId: output.headers["x-amz-cf-id"],
1013
- });
1014
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
1015
- const isSerializableHeaderValue = (value) => value !== undefined &&
1016
- value !== null &&
1017
- value !== "" &&
1018
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1019
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1020
- const _MR = "MaxResults";
1021
- const _N = "Names";
1022
- const _NT = "NextToken";
1023
- const _Na = "Name";
1024
- const _O = "Owners";
1025
- const _Ow = "Owner";
1026
- const _PT = "ProviderTypes";
1027
- const _PTr = "ProviderType";
1028
- const _RI = "RecommendationId";
1029
- const _RIe = "RecommendationIds";
1030
- const _RN = "RepositoryNames";
1031
- const _S = "States";
1032
- const _St = "State";
1033
- const _T = "Type";
1034
- const _TK = "TagKeys";
1035
- const _UI = "UserId";
1036
- const _UIs = "UserIds";
1037
- const _tK = "tagKeys";
1038
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1039
- if (encoded.length) {
1040
- return JSON.parse(encoded);
1041
- }
1042
- return {};
1043
- });
1044
- const parseErrorBody = async (errorBody, context) => {
1045
- const value = await parseBody(errorBody, context);
1046
- value.message = value.message ?? value.Message;
1047
- return value;
1048
- };
1049
- const loadRestJsonErrorCode = (output, data) => {
1050
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1051
- const sanitizeErrorCode = (rawValue) => {
1052
- let cleanValue = rawValue;
1053
- if (typeof cleanValue === "number") {
1054
- cleanValue = cleanValue.toString();
1055
- }
1056
- if (cleanValue.indexOf(",") >= 0) {
1057
- cleanValue = cleanValue.split(",")[0];
1058
- }
1059
- if (cleanValue.indexOf(":") >= 0) {
1060
- cleanValue = cleanValue.split(":")[0];
1061
- }
1062
- if (cleanValue.indexOf("#") >= 0) {
1063
- cleanValue = cleanValue.split("#")[1];
1064
- }
1065
- return cleanValue;
1066
- };
1067
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1068
- if (headerKey !== undefined) {
1069
- return sanitizeErrorCode(output.headers[headerKey]);
1070
- }
1071
- if (data.code !== undefined) {
1072
- return sanitizeErrorCode(data.code);
1073
- }
1074
- if (data["__type"] !== undefined) {
1075
- return sanitizeErrorCode(data["__type"]);
1076
- }
1077
- };
1
+ module.exports = require("../index.js");