@aws-sdk/client-codeguru-reviewer 3.476.0 → 3.477.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,17 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
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 protocol_http_1 = require("@smithy/protocol-http");
4
+ const core_1 = require("@smithy/core");
5
5
  const smithy_client_1 = require("@smithy/smithy-client");
6
6
  const uuid_1 = require("uuid");
7
7
  const CodeGuruReviewerServiceException_1 = require("../models/CodeGuruReviewerServiceException");
8
8
  const models_0_1 = require("../models/models_0");
9
9
  const se_AssociateRepositoryCommand = async (input, context) => {
10
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
10
+ const b = (0, core_1.requestBuilder)(input, context);
11
11
  const headers = {
12
12
  "content-type": "application/json",
13
13
  };
14
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/associations";
14
+ b.bp("/associations");
15
15
  let body;
16
16
  body = JSON.stringify((0, smithy_client_1.take)(input, {
17
17
  ClientRequestToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
@@ -19,23 +19,16 @@ const se_AssociateRepositoryCommand = async (input, context) => {
19
19
  Repository: (_) => (0, smithy_client_1._json)(_),
20
20
  Tags: (_) => (0, smithy_client_1._json)(_),
21
21
  }));
22
- return new protocol_http_1.HttpRequest({
23
- protocol,
24
- hostname,
25
- port,
26
- method: "POST",
27
- headers,
28
- path: resolvedPath,
29
- body,
30
- });
22
+ b.m("POST").h(headers).b(body);
23
+ return b.build();
31
24
  };
32
25
  exports.se_AssociateRepositoryCommand = se_AssociateRepositoryCommand;
33
26
  const se_CreateCodeReviewCommand = async (input, context) => {
34
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
27
+ const b = (0, core_1.requestBuilder)(input, context);
35
28
  const headers = {
36
29
  "content-type": "application/json",
37
30
  };
38
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/codereviews";
31
+ b.bp("/codereviews");
39
32
  let body;
40
33
  body = JSON.stringify((0, smithy_client_1.take)(input, {
41
34
  ClientRequestToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
@@ -43,284 +36,173 @@ const se_CreateCodeReviewCommand = async (input, context) => {
43
36
  RepositoryAssociationArn: [],
44
37
  Type: (_) => (0, smithy_client_1._json)(_),
45
38
  }));
46
- return new protocol_http_1.HttpRequest({
47
- protocol,
48
- hostname,
49
- port,
50
- method: "POST",
51
- headers,
52
- path: resolvedPath,
53
- body,
54
- });
39
+ b.m("POST").h(headers).b(body);
40
+ return b.build();
55
41
  };
56
42
  exports.se_CreateCodeReviewCommand = se_CreateCodeReviewCommand;
57
43
  const se_DescribeCodeReviewCommand = async (input, context) => {
58
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
44
+ const b = (0, core_1.requestBuilder)(input, context);
59
45
  const headers = {};
60
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/codereviews/{CodeReviewArn}";
61
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "CodeReviewArn", () => input.CodeReviewArn, "{CodeReviewArn}", false);
46
+ b.bp("/codereviews/{CodeReviewArn}");
47
+ b.p("CodeReviewArn", () => input.CodeReviewArn, "{CodeReviewArn}", false);
62
48
  let body;
63
- return new protocol_http_1.HttpRequest({
64
- protocol,
65
- hostname,
66
- port,
67
- method: "GET",
68
- headers,
69
- path: resolvedPath,
70
- body,
71
- });
49
+ b.m("GET").h(headers).b(body);
50
+ return b.build();
72
51
  };
73
52
  exports.se_DescribeCodeReviewCommand = se_DescribeCodeReviewCommand;
74
53
  const se_DescribeRecommendationFeedbackCommand = async (input, context) => {
75
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
54
+ const b = (0, core_1.requestBuilder)(input, context);
76
55
  const headers = {};
77
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/feedback/{CodeReviewArn}";
78
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "CodeReviewArn", () => input.CodeReviewArn, "{CodeReviewArn}", false);
56
+ b.bp("/feedback/{CodeReviewArn}");
57
+ b.p("CodeReviewArn", () => input.CodeReviewArn, "{CodeReviewArn}", false);
79
58
  const query = (0, smithy_client_1.map)({
80
- RecommendationId: [, (0, smithy_client_1.expectNonNull)(input.RecommendationId, `RecommendationId`)],
81
- UserId: [, input.UserId],
59
+ [_RI]: [, (0, smithy_client_1.expectNonNull)(input[_RI], `RecommendationId`)],
60
+ [_UI]: [, input[_UI]],
82
61
  });
83
62
  let body;
84
- return new protocol_http_1.HttpRequest({
85
- protocol,
86
- hostname,
87
- port,
88
- method: "GET",
89
- headers,
90
- path: resolvedPath,
91
- query,
92
- body,
93
- });
63
+ b.m("GET").h(headers).q(query).b(body);
64
+ return b.build();
94
65
  };
95
66
  exports.se_DescribeRecommendationFeedbackCommand = se_DescribeRecommendationFeedbackCommand;
96
67
  const se_DescribeRepositoryAssociationCommand = async (input, context) => {
97
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
68
+ const b = (0, core_1.requestBuilder)(input, context);
98
69
  const headers = {};
99
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/associations/{AssociationArn}";
100
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "AssociationArn", () => input.AssociationArn, "{AssociationArn}", false);
70
+ b.bp("/associations/{AssociationArn}");
71
+ b.p("AssociationArn", () => input.AssociationArn, "{AssociationArn}", false);
101
72
  let body;
102
- return new protocol_http_1.HttpRequest({
103
- protocol,
104
- hostname,
105
- port,
106
- method: "GET",
107
- headers,
108
- path: resolvedPath,
109
- body,
110
- });
73
+ b.m("GET").h(headers).b(body);
74
+ return b.build();
111
75
  };
112
76
  exports.se_DescribeRepositoryAssociationCommand = se_DescribeRepositoryAssociationCommand;
113
77
  const se_DisassociateRepositoryCommand = async (input, context) => {
114
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
78
+ const b = (0, core_1.requestBuilder)(input, context);
115
79
  const headers = {};
116
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/associations/{AssociationArn}";
117
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "AssociationArn", () => input.AssociationArn, "{AssociationArn}", false);
80
+ b.bp("/associations/{AssociationArn}");
81
+ b.p("AssociationArn", () => input.AssociationArn, "{AssociationArn}", false);
118
82
  let body;
119
- return new protocol_http_1.HttpRequest({
120
- protocol,
121
- hostname,
122
- port,
123
- method: "DELETE",
124
- headers,
125
- path: resolvedPath,
126
- body,
127
- });
83
+ b.m("DELETE").h(headers).b(body);
84
+ return b.build();
128
85
  };
129
86
  exports.se_DisassociateRepositoryCommand = se_DisassociateRepositoryCommand;
130
87
  const se_ListCodeReviewsCommand = async (input, context) => {
131
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
88
+ const b = (0, core_1.requestBuilder)(input, context);
132
89
  const headers = {};
133
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/codereviews";
90
+ b.bp("/codereviews");
134
91
  const query = (0, smithy_client_1.map)({
135
- ProviderTypes: [
136
- () => input.ProviderTypes !== void 0,
137
- () => (input.ProviderTypes || []).map((_entry) => _entry),
138
- ],
139
- States: [() => input.States !== void 0, () => (input.States || []).map((_entry) => _entry)],
140
- RepositoryNames: [
141
- () => input.RepositoryNames !== void 0,
142
- () => (input.RepositoryNames || []).map((_entry) => _entry),
143
- ],
144
- Type: [, (0, smithy_client_1.expectNonNull)(input.Type, `Type`)],
145
- MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
146
- NextToken: [, input.NextToken],
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]],
147
98
  });
148
99
  let body;
149
- return new protocol_http_1.HttpRequest({
150
- protocol,
151
- hostname,
152
- port,
153
- method: "GET",
154
- headers,
155
- path: resolvedPath,
156
- query,
157
- body,
158
- });
100
+ b.m("GET").h(headers).q(query).b(body);
101
+ return b.build();
159
102
  };
160
103
  exports.se_ListCodeReviewsCommand = se_ListCodeReviewsCommand;
161
104
  const se_ListRecommendationFeedbackCommand = async (input, context) => {
162
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
105
+ const b = (0, core_1.requestBuilder)(input, context);
163
106
  const headers = {};
164
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
165
- "/feedback/{CodeReviewArn}/RecommendationFeedback";
166
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "CodeReviewArn", () => input.CodeReviewArn, "{CodeReviewArn}", false);
107
+ b.bp("/feedback/{CodeReviewArn}/RecommendationFeedback");
108
+ b.p("CodeReviewArn", () => input.CodeReviewArn, "{CodeReviewArn}", false);
167
109
  const query = (0, smithy_client_1.map)({
168
- NextToken: [, input.NextToken],
169
- MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
170
- UserIds: [() => input.UserIds !== void 0, () => (input.UserIds || []).map((_entry) => _entry)],
171
- RecommendationIds: [
172
- () => input.RecommendationIds !== void 0,
173
- () => (input.RecommendationIds || []).map((_entry) => _entry),
174
- ],
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)],
175
114
  });
176
115
  let body;
177
- return new protocol_http_1.HttpRequest({
178
- protocol,
179
- hostname,
180
- port,
181
- method: "GET",
182
- headers,
183
- path: resolvedPath,
184
- query,
185
- body,
186
- });
116
+ b.m("GET").h(headers).q(query).b(body);
117
+ return b.build();
187
118
  };
188
119
  exports.se_ListRecommendationFeedbackCommand = se_ListRecommendationFeedbackCommand;
189
120
  const se_ListRecommendationsCommand = async (input, context) => {
190
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
121
+ const b = (0, core_1.requestBuilder)(input, context);
191
122
  const headers = {};
192
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
193
- "/codereviews/{CodeReviewArn}/Recommendations";
194
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "CodeReviewArn", () => input.CodeReviewArn, "{CodeReviewArn}", false);
123
+ b.bp("/codereviews/{CodeReviewArn}/Recommendations");
124
+ b.p("CodeReviewArn", () => input.CodeReviewArn, "{CodeReviewArn}", false);
195
125
  const query = (0, smithy_client_1.map)({
196
- NextToken: [, input.NextToken],
197
- MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
126
+ [_NT]: [, input[_NT]],
127
+ [_MR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
198
128
  });
199
129
  let body;
200
- return new protocol_http_1.HttpRequest({
201
- protocol,
202
- hostname,
203
- port,
204
- method: "GET",
205
- headers,
206
- path: resolvedPath,
207
- query,
208
- body,
209
- });
130
+ b.m("GET").h(headers).q(query).b(body);
131
+ return b.build();
210
132
  };
211
133
  exports.se_ListRecommendationsCommand = se_ListRecommendationsCommand;
212
134
  const se_ListRepositoryAssociationsCommand = async (input, context) => {
213
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
135
+ const b = (0, core_1.requestBuilder)(input, context);
214
136
  const headers = {};
215
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/associations";
137
+ b.bp("/associations");
216
138
  const query = (0, smithy_client_1.map)({
217
- ProviderType: [
218
- () => input.ProviderTypes !== void 0,
219
- () => (input.ProviderTypes || []).map((_entry) => _entry),
220
- ],
221
- State: [() => input.States !== void 0, () => (input.States || []).map((_entry) => _entry)],
222
- Name: [() => input.Names !== void 0, () => (input.Names || []).map((_entry) => _entry)],
223
- Owner: [() => input.Owners !== void 0, () => (input.Owners || []).map((_entry) => _entry)],
224
- MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
225
- NextToken: [, input.NextToken],
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]],
226
145
  });
227
146
  let body;
228
- return new protocol_http_1.HttpRequest({
229
- protocol,
230
- hostname,
231
- port,
232
- method: "GET",
233
- headers,
234
- path: resolvedPath,
235
- query,
236
- body,
237
- });
147
+ b.m("GET").h(headers).q(query).b(body);
148
+ return b.build();
238
149
  };
239
150
  exports.se_ListRepositoryAssociationsCommand = se_ListRepositoryAssociationsCommand;
240
151
  const se_ListTagsForResourceCommand = async (input, context) => {
241
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
152
+ const b = (0, core_1.requestBuilder)(input, context);
242
153
  const headers = {};
243
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
244
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
154
+ b.bp("/tags/{resourceArn}");
155
+ b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
245
156
  let body;
246
- return new protocol_http_1.HttpRequest({
247
- protocol,
248
- hostname,
249
- port,
250
- method: "GET",
251
- headers,
252
- path: resolvedPath,
253
- body,
254
- });
157
+ b.m("GET").h(headers).b(body);
158
+ return b.build();
255
159
  };
256
160
  exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
257
161
  const se_PutRecommendationFeedbackCommand = async (input, context) => {
258
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
162
+ const b = (0, core_1.requestBuilder)(input, context);
259
163
  const headers = {
260
164
  "content-type": "application/json",
261
165
  };
262
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/feedback";
166
+ b.bp("/feedback");
263
167
  let body;
264
168
  body = JSON.stringify((0, smithy_client_1.take)(input, {
265
169
  CodeReviewArn: [],
266
170
  Reactions: (_) => (0, smithy_client_1._json)(_),
267
171
  RecommendationId: [],
268
172
  }));
269
- return new protocol_http_1.HttpRequest({
270
- protocol,
271
- hostname,
272
- port,
273
- method: "PUT",
274
- headers,
275
- path: resolvedPath,
276
- body,
277
- });
173
+ b.m("PUT").h(headers).b(body);
174
+ return b.build();
278
175
  };
279
176
  exports.se_PutRecommendationFeedbackCommand = se_PutRecommendationFeedbackCommand;
280
177
  const se_TagResourceCommand = async (input, context) => {
281
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
178
+ const b = (0, core_1.requestBuilder)(input, context);
282
179
  const headers = {
283
180
  "content-type": "application/json",
284
181
  };
285
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
286
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
182
+ b.bp("/tags/{resourceArn}");
183
+ b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
287
184
  let body;
288
185
  body = JSON.stringify((0, smithy_client_1.take)(input, {
289
186
  Tags: (_) => (0, smithy_client_1._json)(_),
290
187
  }));
291
- return new protocol_http_1.HttpRequest({
292
- protocol,
293
- hostname,
294
- port,
295
- method: "POST",
296
- headers,
297
- path: resolvedPath,
298
- body,
299
- });
188
+ b.m("POST").h(headers).b(body);
189
+ return b.build();
300
190
  };
301
191
  exports.se_TagResourceCommand = se_TagResourceCommand;
302
192
  const se_UntagResourceCommand = async (input, context) => {
303
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
193
+ const b = (0, core_1.requestBuilder)(input, context);
304
194
  const headers = {};
305
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
306
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
195
+ b.bp("/tags/{resourceArn}");
196
+ b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
307
197
  const query = (0, smithy_client_1.map)({
308
- tagKeys: [
198
+ [_tK]: [
309
199
  (0, smithy_client_1.expectNonNull)(input.TagKeys, `TagKeys`) != null,
310
- () => (input.TagKeys || []).map((_entry) => _entry),
200
+ () => (input[_TK] || []).map((_entry) => _entry),
311
201
  ],
312
202
  });
313
203
  let body;
314
- return new protocol_http_1.HttpRequest({
315
- protocol,
316
- hostname,
317
- port,
318
- method: "DELETE",
319
- headers,
320
- path: resolvedPath,
321
- query,
322
- body,
323
- });
204
+ b.m("DELETE").h(headers).q(query).b(body);
205
+ return b.build();
324
206
  };
325
207
  exports.se_UntagResourceCommand = se_UntagResourceCommand;
326
208
  const de_AssociateRepositoryCommand = async (output, context) => {
@@ -1135,6 +1017,24 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
1135
1017
  value !== "" &&
1136
1018
  (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1137
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";
1138
1038
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1139
1039
  if (encoded.length) {
1140
1040
  return JSON.parse(encoded);
@@ -1,14 +1,14 @@
1
- import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
2
- import { _json, collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, take, withBaseException, } from "@smithy/smithy-client";
1
+ import { requestBuilder as rb } from "@smithy/core";
2
+ import { _json, collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client";
3
3
  import { v4 as generateIdempotencyToken } from "uuid";
4
4
  import { CodeGuruReviewerServiceException as __BaseException } from "../models/CodeGuruReviewerServiceException";
5
5
  import { AccessDeniedException, ConflictException, InternalServerException, NotFoundException, ResourceNotFoundException, ThrottlingException, ValidationException, } from "../models/models_0";
6
6
  export const se_AssociateRepositoryCommand = async (input, context) => {
7
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
7
+ const b = rb(input, context);
8
8
  const headers = {
9
9
  "content-type": "application/json",
10
10
  };
11
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/associations";
11
+ b.bp("/associations");
12
12
  let body;
13
13
  body = JSON.stringify(take(input, {
14
14
  ClientRequestToken: [true, (_) => _ ?? generateIdempotencyToken()],
@@ -16,22 +16,15 @@ export const se_AssociateRepositoryCommand = async (input, context) => {
16
16
  Repository: (_) => _json(_),
17
17
  Tags: (_) => _json(_),
18
18
  }));
19
- return new __HttpRequest({
20
- protocol,
21
- hostname,
22
- port,
23
- method: "POST",
24
- headers,
25
- path: resolvedPath,
26
- body,
27
- });
19
+ b.m("POST").h(headers).b(body);
20
+ return b.build();
28
21
  };
29
22
  export const se_CreateCodeReviewCommand = async (input, context) => {
30
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
23
+ const b = rb(input, context);
31
24
  const headers = {
32
25
  "content-type": "application/json",
33
26
  };
34
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/codereviews";
27
+ b.bp("/codereviews");
35
28
  let body;
36
29
  body = JSON.stringify(take(input, {
37
30
  ClientRequestToken: [true, (_) => _ ?? generateIdempotencyToken()],
@@ -39,272 +32,161 @@ export const se_CreateCodeReviewCommand = async (input, context) => {
39
32
  RepositoryAssociationArn: [],
40
33
  Type: (_) => _json(_),
41
34
  }));
42
- return new __HttpRequest({
43
- protocol,
44
- hostname,
45
- port,
46
- method: "POST",
47
- headers,
48
- path: resolvedPath,
49
- body,
50
- });
35
+ b.m("POST").h(headers).b(body);
36
+ return b.build();
51
37
  };
52
38
  export const se_DescribeCodeReviewCommand = async (input, context) => {
53
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
39
+ const b = rb(input, context);
54
40
  const headers = {};
55
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/codereviews/{CodeReviewArn}";
56
- resolvedPath = __resolvedPath(resolvedPath, input, "CodeReviewArn", () => input.CodeReviewArn, "{CodeReviewArn}", false);
41
+ b.bp("/codereviews/{CodeReviewArn}");
42
+ b.p("CodeReviewArn", () => input.CodeReviewArn, "{CodeReviewArn}", false);
57
43
  let body;
58
- return new __HttpRequest({
59
- protocol,
60
- hostname,
61
- port,
62
- method: "GET",
63
- headers,
64
- path: resolvedPath,
65
- body,
66
- });
44
+ b.m("GET").h(headers).b(body);
45
+ return b.build();
67
46
  };
68
47
  export const se_DescribeRecommendationFeedbackCommand = async (input, context) => {
69
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
48
+ const b = rb(input, context);
70
49
  const headers = {};
71
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/feedback/{CodeReviewArn}";
72
- resolvedPath = __resolvedPath(resolvedPath, input, "CodeReviewArn", () => input.CodeReviewArn, "{CodeReviewArn}", false);
50
+ b.bp("/feedback/{CodeReviewArn}");
51
+ b.p("CodeReviewArn", () => input.CodeReviewArn, "{CodeReviewArn}", false);
73
52
  const query = map({
74
- RecommendationId: [, __expectNonNull(input.RecommendationId, `RecommendationId`)],
75
- UserId: [, input.UserId],
53
+ [_RI]: [, __expectNonNull(input[_RI], `RecommendationId`)],
54
+ [_UI]: [, input[_UI]],
76
55
  });
77
56
  let body;
78
- return new __HttpRequest({
79
- protocol,
80
- hostname,
81
- port,
82
- method: "GET",
83
- headers,
84
- path: resolvedPath,
85
- query,
86
- body,
87
- });
57
+ b.m("GET").h(headers).q(query).b(body);
58
+ return b.build();
88
59
  };
89
60
  export const se_DescribeRepositoryAssociationCommand = async (input, context) => {
90
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
61
+ const b = rb(input, context);
91
62
  const headers = {};
92
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/associations/{AssociationArn}";
93
- resolvedPath = __resolvedPath(resolvedPath, input, "AssociationArn", () => input.AssociationArn, "{AssociationArn}", false);
63
+ b.bp("/associations/{AssociationArn}");
64
+ b.p("AssociationArn", () => input.AssociationArn, "{AssociationArn}", false);
94
65
  let body;
95
- return new __HttpRequest({
96
- protocol,
97
- hostname,
98
- port,
99
- method: "GET",
100
- headers,
101
- path: resolvedPath,
102
- body,
103
- });
66
+ b.m("GET").h(headers).b(body);
67
+ return b.build();
104
68
  };
105
69
  export const se_DisassociateRepositoryCommand = async (input, context) => {
106
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
70
+ const b = rb(input, context);
107
71
  const headers = {};
108
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/associations/{AssociationArn}";
109
- resolvedPath = __resolvedPath(resolvedPath, input, "AssociationArn", () => input.AssociationArn, "{AssociationArn}", false);
72
+ b.bp("/associations/{AssociationArn}");
73
+ b.p("AssociationArn", () => input.AssociationArn, "{AssociationArn}", false);
110
74
  let body;
111
- return new __HttpRequest({
112
- protocol,
113
- hostname,
114
- port,
115
- method: "DELETE",
116
- headers,
117
- path: resolvedPath,
118
- body,
119
- });
75
+ b.m("DELETE").h(headers).b(body);
76
+ return b.build();
120
77
  };
121
78
  export const se_ListCodeReviewsCommand = async (input, context) => {
122
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
79
+ const b = rb(input, context);
123
80
  const headers = {};
124
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/codereviews";
81
+ b.bp("/codereviews");
125
82
  const query = map({
126
- ProviderTypes: [
127
- () => input.ProviderTypes !== void 0,
128
- () => (input.ProviderTypes || []).map((_entry) => _entry),
129
- ],
130
- States: [() => input.States !== void 0, () => (input.States || []).map((_entry) => _entry)],
131
- RepositoryNames: [
132
- () => input.RepositoryNames !== void 0,
133
- () => (input.RepositoryNames || []).map((_entry) => _entry),
134
- ],
135
- Type: [, __expectNonNull(input.Type, `Type`)],
136
- MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
137
- NextToken: [, input.NextToken],
83
+ [_PT]: [() => input.ProviderTypes !== void 0, () => (input[_PT] || []).map((_entry) => _entry)],
84
+ [_S]: [() => input.States !== void 0, () => (input[_S] || []).map((_entry) => _entry)],
85
+ [_RN]: [() => input.RepositoryNames !== void 0, () => (input[_RN] || []).map((_entry) => _entry)],
86
+ [_T]: [, __expectNonNull(input[_T], `Type`)],
87
+ [_MR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
88
+ [_NT]: [, input[_NT]],
138
89
  });
139
90
  let body;
140
- return new __HttpRequest({
141
- protocol,
142
- hostname,
143
- port,
144
- method: "GET",
145
- headers,
146
- path: resolvedPath,
147
- query,
148
- body,
149
- });
91
+ b.m("GET").h(headers).q(query).b(body);
92
+ return b.build();
150
93
  };
151
94
  export const se_ListRecommendationFeedbackCommand = async (input, context) => {
152
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
95
+ const b = rb(input, context);
153
96
  const headers = {};
154
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
155
- "/feedback/{CodeReviewArn}/RecommendationFeedback";
156
- resolvedPath = __resolvedPath(resolvedPath, input, "CodeReviewArn", () => input.CodeReviewArn, "{CodeReviewArn}", false);
97
+ b.bp("/feedback/{CodeReviewArn}/RecommendationFeedback");
98
+ b.p("CodeReviewArn", () => input.CodeReviewArn, "{CodeReviewArn}", false);
157
99
  const query = map({
158
- NextToken: [, input.NextToken],
159
- MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
160
- UserIds: [() => input.UserIds !== void 0, () => (input.UserIds || []).map((_entry) => _entry)],
161
- RecommendationIds: [
162
- () => input.RecommendationIds !== void 0,
163
- () => (input.RecommendationIds || []).map((_entry) => _entry),
164
- ],
100
+ [_NT]: [, input[_NT]],
101
+ [_MR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
102
+ [_UIs]: [() => input.UserIds !== void 0, () => (input[_UIs] || []).map((_entry) => _entry)],
103
+ [_RIe]: [() => input.RecommendationIds !== void 0, () => (input[_RIe] || []).map((_entry) => _entry)],
165
104
  });
166
105
  let body;
167
- return new __HttpRequest({
168
- protocol,
169
- hostname,
170
- port,
171
- method: "GET",
172
- headers,
173
- path: resolvedPath,
174
- query,
175
- body,
176
- });
106
+ b.m("GET").h(headers).q(query).b(body);
107
+ return b.build();
177
108
  };
178
109
  export const se_ListRecommendationsCommand = async (input, context) => {
179
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
110
+ const b = rb(input, context);
180
111
  const headers = {};
181
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
182
- "/codereviews/{CodeReviewArn}/Recommendations";
183
- resolvedPath = __resolvedPath(resolvedPath, input, "CodeReviewArn", () => input.CodeReviewArn, "{CodeReviewArn}", false);
112
+ b.bp("/codereviews/{CodeReviewArn}/Recommendations");
113
+ b.p("CodeReviewArn", () => input.CodeReviewArn, "{CodeReviewArn}", false);
184
114
  const query = map({
185
- NextToken: [, input.NextToken],
186
- MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
115
+ [_NT]: [, input[_NT]],
116
+ [_MR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
187
117
  });
188
118
  let body;
189
- return new __HttpRequest({
190
- protocol,
191
- hostname,
192
- port,
193
- method: "GET",
194
- headers,
195
- path: resolvedPath,
196
- query,
197
- body,
198
- });
119
+ b.m("GET").h(headers).q(query).b(body);
120
+ return b.build();
199
121
  };
200
122
  export const se_ListRepositoryAssociationsCommand = async (input, context) => {
201
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
123
+ const b = rb(input, context);
202
124
  const headers = {};
203
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/associations";
125
+ b.bp("/associations");
204
126
  const query = map({
205
- ProviderType: [
206
- () => input.ProviderTypes !== void 0,
207
- () => (input.ProviderTypes || []).map((_entry) => _entry),
208
- ],
209
- State: [() => input.States !== void 0, () => (input.States || []).map((_entry) => _entry)],
210
- Name: [() => input.Names !== void 0, () => (input.Names || []).map((_entry) => _entry)],
211
- Owner: [() => input.Owners !== void 0, () => (input.Owners || []).map((_entry) => _entry)],
212
- MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
213
- NextToken: [, input.NextToken],
127
+ [_PTr]: [() => input.ProviderTypes !== void 0, () => (input[_PT] || []).map((_entry) => _entry)],
128
+ [_St]: [() => input.States !== void 0, () => (input[_S] || []).map((_entry) => _entry)],
129
+ [_Na]: [() => input.Names !== void 0, () => (input[_N] || []).map((_entry) => _entry)],
130
+ [_Ow]: [() => input.Owners !== void 0, () => (input[_O] || []).map((_entry) => _entry)],
131
+ [_MR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
132
+ [_NT]: [, input[_NT]],
214
133
  });
215
134
  let body;
216
- return new __HttpRequest({
217
- protocol,
218
- hostname,
219
- port,
220
- method: "GET",
221
- headers,
222
- path: resolvedPath,
223
- query,
224
- body,
225
- });
135
+ b.m("GET").h(headers).q(query).b(body);
136
+ return b.build();
226
137
  };
227
138
  export const se_ListTagsForResourceCommand = async (input, context) => {
228
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
139
+ const b = rb(input, context);
229
140
  const headers = {};
230
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
231
- resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
141
+ b.bp("/tags/{resourceArn}");
142
+ b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
232
143
  let body;
233
- return new __HttpRequest({
234
- protocol,
235
- hostname,
236
- port,
237
- method: "GET",
238
- headers,
239
- path: resolvedPath,
240
- body,
241
- });
144
+ b.m("GET").h(headers).b(body);
145
+ return b.build();
242
146
  };
243
147
  export const se_PutRecommendationFeedbackCommand = async (input, context) => {
244
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
148
+ const b = rb(input, context);
245
149
  const headers = {
246
150
  "content-type": "application/json",
247
151
  };
248
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/feedback";
152
+ b.bp("/feedback");
249
153
  let body;
250
154
  body = JSON.stringify(take(input, {
251
155
  CodeReviewArn: [],
252
156
  Reactions: (_) => _json(_),
253
157
  RecommendationId: [],
254
158
  }));
255
- return new __HttpRequest({
256
- protocol,
257
- hostname,
258
- port,
259
- method: "PUT",
260
- headers,
261
- path: resolvedPath,
262
- body,
263
- });
159
+ b.m("PUT").h(headers).b(body);
160
+ return b.build();
264
161
  };
265
162
  export const se_TagResourceCommand = async (input, context) => {
266
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
163
+ const b = rb(input, context);
267
164
  const headers = {
268
165
  "content-type": "application/json",
269
166
  };
270
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
271
- resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
167
+ b.bp("/tags/{resourceArn}");
168
+ b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
272
169
  let body;
273
170
  body = JSON.stringify(take(input, {
274
171
  Tags: (_) => _json(_),
275
172
  }));
276
- return new __HttpRequest({
277
- protocol,
278
- hostname,
279
- port,
280
- method: "POST",
281
- headers,
282
- path: resolvedPath,
283
- body,
284
- });
173
+ b.m("POST").h(headers).b(body);
174
+ return b.build();
285
175
  };
286
176
  export const se_UntagResourceCommand = async (input, context) => {
287
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
177
+ const b = rb(input, context);
288
178
  const headers = {};
289
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
290
- resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
179
+ b.bp("/tags/{resourceArn}");
180
+ b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
291
181
  const query = map({
292
- tagKeys: [
182
+ [_tK]: [
293
183
  __expectNonNull(input.TagKeys, `TagKeys`) != null,
294
- () => (input.TagKeys || []).map((_entry) => _entry),
184
+ () => (input[_TK] || []).map((_entry) => _entry),
295
185
  ],
296
186
  });
297
187
  let body;
298
- return new __HttpRequest({
299
- protocol,
300
- hostname,
301
- port,
302
- method: "DELETE",
303
- headers,
304
- path: resolvedPath,
305
- query,
306
- body,
307
- });
188
+ b.m("DELETE").h(headers).q(query).b(body);
189
+ return b.build();
308
190
  };
309
191
  export const de_AssociateRepositoryCommand = async (output, context) => {
310
192
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1104,6 +986,24 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
1104
986
  value !== "" &&
1105
987
  (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1106
988
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
989
+ const _MR = "MaxResults";
990
+ const _N = "Names";
991
+ const _NT = "NextToken";
992
+ const _Na = "Name";
993
+ const _O = "Owners";
994
+ const _Ow = "Owner";
995
+ const _PT = "ProviderTypes";
996
+ const _PTr = "ProviderType";
997
+ const _RI = "RecommendationId";
998
+ const _RIe = "RecommendationIds";
999
+ const _RN = "RepositoryNames";
1000
+ const _S = "States";
1001
+ const _St = "State";
1002
+ const _T = "Type";
1003
+ const _TK = "TagKeys";
1004
+ const _UI = "UserId";
1005
+ const _UIs = "UserIds";
1006
+ const _tK = "tagKeys";
1107
1007
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1108
1008
  if (encoded.length) {
1109
1009
  return JSON.parse(encoded);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-codeguru-reviewer",
3
3
  "description": "AWS SDK for JavaScript Codeguru Reviewer Client for Node.js, Browser and React Native",
4
- "version": "3.476.0",
4
+ "version": "3.477.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -20,9 +20,9 @@
20
20
  "dependencies": {
21
21
  "@aws-crypto/sha256-browser": "3.0.0",
22
22
  "@aws-crypto/sha256-js": "3.0.0",
23
- "@aws-sdk/client-sts": "3.476.0",
24
- "@aws-sdk/core": "3.476.0",
25
- "@aws-sdk/credential-provider-node": "3.476.0",
23
+ "@aws-sdk/client-sts": "3.477.0",
24
+ "@aws-sdk/core": "3.477.0",
25
+ "@aws-sdk/credential-provider-node": "3.477.0",
26
26
  "@aws-sdk/middleware-host-header": "3.468.0",
27
27
  "@aws-sdk/middleware-logger": "3.468.0",
28
28
  "@aws-sdk/middleware-recursion-detection": "3.468.0",
@@ -34,6 +34,7 @@
34
34
  "@aws-sdk/util-user-agent-browser": "3.468.0",
35
35
  "@aws-sdk/util-user-agent-node": "3.470.0",
36
36
  "@smithy/config-resolver": "^2.0.21",
37
+ "@smithy/core": "^1.2.0",
37
38
  "@smithy/fetch-http-handler": "^2.3.1",
38
39
  "@smithy/hash-node": "^2.0.17",
39
40
  "@smithy/invalid-dependency": "^2.0.15",