@aws-sdk/client-accessanalyzer 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,119 +1,84 @@
1
1
  import { awsExpectUnion as __expectUnion } from "@aws-sdk/core";
2
- import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
3
- import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, resolvedPath as __resolvedPath, strictParseInt32 as __strictParseInt32, take, withBaseException, } from "@smithy/smithy-client";
2
+ import { requestBuilder as rb } from "@smithy/core";
3
+ import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, strictParseInt32 as __strictParseInt32, take, withBaseException, } from "@smithy/smithy-client";
4
4
  import { v4 as generateIdempotencyToken } from "uuid";
5
5
  import { AccessAnalyzerServiceException as __BaseException } from "../models/AccessAnalyzerServiceException";
6
6
  import { AccessDeniedException, ConflictException, InternalServerException, InvalidParameterException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, UnprocessableEntityException, ValidationException, } from "../models/models_0";
7
7
  export const se_ApplyArchiveRuleCommand = async (input, context) => {
8
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
8
+ const b = rb(input, context);
9
9
  const headers = {
10
10
  "content-type": "application/json",
11
11
  };
12
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/archive-rule";
12
+ b.bp("/archive-rule");
13
13
  let body;
14
14
  body = JSON.stringify(take(input, {
15
15
  analyzerArn: [],
16
16
  clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
17
17
  ruleName: [],
18
18
  }));
19
- return new __HttpRequest({
20
- protocol,
21
- hostname,
22
- port,
23
- method: "PUT",
24
- headers,
25
- path: resolvedPath,
26
- body,
27
- });
19
+ b.m("PUT").h(headers).b(body);
20
+ return b.build();
28
21
  };
29
22
  export const se_CancelPolicyGenerationCommand = 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
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/policy/generation/{jobId}";
33
- resolvedPath = __resolvedPath(resolvedPath, input, "jobId", () => input.jobId, "{jobId}", false);
25
+ b.bp("/policy/generation/{jobId}");
26
+ b.p("jobId", () => input.jobId, "{jobId}", false);
34
27
  let body;
35
- return new __HttpRequest({
36
- protocol,
37
- hostname,
38
- port,
39
- method: "PUT",
40
- headers,
41
- path: resolvedPath,
42
- body,
43
- });
28
+ b.m("PUT").h(headers).b(body);
29
+ return b.build();
44
30
  };
45
31
  export const se_CheckAccessNotGrantedCommand = async (input, context) => {
46
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
32
+ const b = rb(input, context);
47
33
  const headers = {
48
34
  "content-type": "application/json",
49
35
  };
50
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/policy/check-access-not-granted";
36
+ b.bp("/policy/check-access-not-granted");
51
37
  let body;
52
38
  body = JSON.stringify(take(input, {
53
39
  access: (_) => _json(_),
54
40
  policyDocument: [],
55
41
  policyType: [],
56
42
  }));
57
- return new __HttpRequest({
58
- protocol,
59
- hostname,
60
- port,
61
- method: "POST",
62
- headers,
63
- path: resolvedPath,
64
- body,
65
- });
43
+ b.m("POST").h(headers).b(body);
44
+ return b.build();
66
45
  };
67
46
  export const se_CheckNoNewAccessCommand = async (input, context) => {
68
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
47
+ const b = rb(input, context);
69
48
  const headers = {
70
49
  "content-type": "application/json",
71
50
  };
72
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/policy/check-no-new-access";
51
+ b.bp("/policy/check-no-new-access");
73
52
  let body;
74
53
  body = JSON.stringify(take(input, {
75
54
  existingPolicyDocument: [],
76
55
  newPolicyDocument: [],
77
56
  policyType: [],
78
57
  }));
79
- return new __HttpRequest({
80
- protocol,
81
- hostname,
82
- port,
83
- method: "POST",
84
- headers,
85
- path: resolvedPath,
86
- body,
87
- });
58
+ b.m("POST").h(headers).b(body);
59
+ return b.build();
88
60
  };
89
61
  export const se_CreateAccessPreviewCommand = async (input, context) => {
90
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
62
+ const b = rb(input, context);
91
63
  const headers = {
92
64
  "content-type": "application/json",
93
65
  };
94
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/access-preview";
66
+ b.bp("/access-preview");
95
67
  let body;
96
68
  body = JSON.stringify(take(input, {
97
69
  analyzerArn: [],
98
70
  clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
99
71
  configurations: (_) => _json(_),
100
72
  }));
101
- return new __HttpRequest({
102
- protocol,
103
- hostname,
104
- port,
105
- method: "PUT",
106
- headers,
107
- path: resolvedPath,
108
- body,
109
- });
73
+ b.m("PUT").h(headers).b(body);
74
+ return b.build();
110
75
  };
111
76
  export const se_CreateAnalyzerCommand = async (input, context) => {
112
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
77
+ const b = rb(input, context);
113
78
  const headers = {
114
79
  "content-type": "application/json",
115
80
  };
116
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/analyzer";
81
+ b.bp("/analyzer");
117
82
  let body;
118
83
  body = JSON.stringify(take(input, {
119
84
  analyzerName: [],
@@ -123,231 +88,139 @@ export const se_CreateAnalyzerCommand = async (input, context) => {
123
88
  tags: (_) => _json(_),
124
89
  type: [],
125
90
  }));
126
- return new __HttpRequest({
127
- protocol,
128
- hostname,
129
- port,
130
- method: "PUT",
131
- headers,
132
- path: resolvedPath,
133
- body,
134
- });
91
+ b.m("PUT").h(headers).b(body);
92
+ return b.build();
135
93
  };
136
94
  export const se_CreateArchiveRuleCommand = async (input, context) => {
137
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
95
+ const b = rb(input, context);
138
96
  const headers = {
139
97
  "content-type": "application/json",
140
98
  };
141
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/analyzer/{analyzerName}/archive-rule";
142
- resolvedPath = __resolvedPath(resolvedPath, input, "analyzerName", () => input.analyzerName, "{analyzerName}", false);
99
+ b.bp("/analyzer/{analyzerName}/archive-rule");
100
+ b.p("analyzerName", () => input.analyzerName, "{analyzerName}", false);
143
101
  let body;
144
102
  body = JSON.stringify(take(input, {
145
103
  clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
146
104
  filter: (_) => _json(_),
147
105
  ruleName: [],
148
106
  }));
149
- return new __HttpRequest({
150
- protocol,
151
- hostname,
152
- port,
153
- method: "PUT",
154
- headers,
155
- path: resolvedPath,
156
- body,
157
- });
107
+ b.m("PUT").h(headers).b(body);
108
+ return b.build();
158
109
  };
159
110
  export const se_DeleteAnalyzerCommand = async (input, context) => {
160
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
111
+ const b = rb(input, context);
161
112
  const headers = {};
162
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/analyzer/{analyzerName}";
163
- resolvedPath = __resolvedPath(resolvedPath, input, "analyzerName", () => input.analyzerName, "{analyzerName}", false);
113
+ b.bp("/analyzer/{analyzerName}");
114
+ b.p("analyzerName", () => input.analyzerName, "{analyzerName}", false);
164
115
  const query = map({
165
- clientToken: [, input.clientToken ?? generateIdempotencyToken()],
116
+ [_cT]: [, input[_cT] ?? generateIdempotencyToken()],
166
117
  });
167
118
  let body;
168
- return new __HttpRequest({
169
- protocol,
170
- hostname,
171
- port,
172
- method: "DELETE",
173
- headers,
174
- path: resolvedPath,
175
- query,
176
- body,
177
- });
119
+ b.m("DELETE").h(headers).q(query).b(body);
120
+ return b.build();
178
121
  };
179
122
  export const se_DeleteArchiveRuleCommand = async (input, context) => {
180
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
123
+ const b = rb(input, context);
181
124
  const headers = {};
182
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
183
- "/analyzer/{analyzerName}/archive-rule/{ruleName}";
184
- resolvedPath = __resolvedPath(resolvedPath, input, "analyzerName", () => input.analyzerName, "{analyzerName}", false);
185
- resolvedPath = __resolvedPath(resolvedPath, input, "ruleName", () => input.ruleName, "{ruleName}", false);
125
+ b.bp("/analyzer/{analyzerName}/archive-rule/{ruleName}");
126
+ b.p("analyzerName", () => input.analyzerName, "{analyzerName}", false);
127
+ b.p("ruleName", () => input.ruleName, "{ruleName}", false);
186
128
  const query = map({
187
- clientToken: [, input.clientToken ?? generateIdempotencyToken()],
129
+ [_cT]: [, input[_cT] ?? generateIdempotencyToken()],
188
130
  });
189
131
  let body;
190
- return new __HttpRequest({
191
- protocol,
192
- hostname,
193
- port,
194
- method: "DELETE",
195
- headers,
196
- path: resolvedPath,
197
- query,
198
- body,
199
- });
132
+ b.m("DELETE").h(headers).q(query).b(body);
133
+ return b.build();
200
134
  };
201
135
  export const se_GetAccessPreviewCommand = async (input, context) => {
202
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
136
+ const b = rb(input, context);
203
137
  const headers = {};
204
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/access-preview/{accessPreviewId}";
205
- resolvedPath = __resolvedPath(resolvedPath, input, "accessPreviewId", () => input.accessPreviewId, "{accessPreviewId}", false);
138
+ b.bp("/access-preview/{accessPreviewId}");
139
+ b.p("accessPreviewId", () => input.accessPreviewId, "{accessPreviewId}", false);
206
140
  const query = map({
207
- analyzerArn: [, __expectNonNull(input.analyzerArn, `analyzerArn`)],
141
+ [_aA]: [, __expectNonNull(input[_aA], `analyzerArn`)],
208
142
  });
209
143
  let body;
210
- return new __HttpRequest({
211
- protocol,
212
- hostname,
213
- port,
214
- method: "GET",
215
- headers,
216
- path: resolvedPath,
217
- query,
218
- body,
219
- });
144
+ b.m("GET").h(headers).q(query).b(body);
145
+ return b.build();
220
146
  };
221
147
  export const se_GetAnalyzedResourceCommand = async (input, context) => {
222
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
148
+ const b = rb(input, context);
223
149
  const headers = {};
224
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/analyzed-resource";
150
+ b.bp("/analyzed-resource");
225
151
  const query = map({
226
- analyzerArn: [, __expectNonNull(input.analyzerArn, `analyzerArn`)],
227
- resourceArn: [, __expectNonNull(input.resourceArn, `resourceArn`)],
152
+ [_aA]: [, __expectNonNull(input[_aA], `analyzerArn`)],
153
+ [_rA]: [, __expectNonNull(input[_rA], `resourceArn`)],
228
154
  });
229
155
  let body;
230
- return new __HttpRequest({
231
- protocol,
232
- hostname,
233
- port,
234
- method: "GET",
235
- headers,
236
- path: resolvedPath,
237
- query,
238
- body,
239
- });
156
+ b.m("GET").h(headers).q(query).b(body);
157
+ return b.build();
240
158
  };
241
159
  export const se_GetAnalyzerCommand = async (input, context) => {
242
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
160
+ const b = rb(input, context);
243
161
  const headers = {};
244
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/analyzer/{analyzerName}";
245
- resolvedPath = __resolvedPath(resolvedPath, input, "analyzerName", () => input.analyzerName, "{analyzerName}", false);
162
+ b.bp("/analyzer/{analyzerName}");
163
+ b.p("analyzerName", () => input.analyzerName, "{analyzerName}", false);
246
164
  let body;
247
- return new __HttpRequest({
248
- protocol,
249
- hostname,
250
- port,
251
- method: "GET",
252
- headers,
253
- path: resolvedPath,
254
- body,
255
- });
165
+ b.m("GET").h(headers).b(body);
166
+ return b.build();
256
167
  };
257
168
  export const se_GetArchiveRuleCommand = async (input, context) => {
258
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
169
+ const b = rb(input, context);
259
170
  const headers = {};
260
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
261
- "/analyzer/{analyzerName}/archive-rule/{ruleName}";
262
- resolvedPath = __resolvedPath(resolvedPath, input, "analyzerName", () => input.analyzerName, "{analyzerName}", false);
263
- resolvedPath = __resolvedPath(resolvedPath, input, "ruleName", () => input.ruleName, "{ruleName}", false);
171
+ b.bp("/analyzer/{analyzerName}/archive-rule/{ruleName}");
172
+ b.p("analyzerName", () => input.analyzerName, "{analyzerName}", false);
173
+ b.p("ruleName", () => input.ruleName, "{ruleName}", false);
264
174
  let body;
265
- return new __HttpRequest({
266
- protocol,
267
- hostname,
268
- port,
269
- method: "GET",
270
- headers,
271
- path: resolvedPath,
272
- body,
273
- });
175
+ b.m("GET").h(headers).b(body);
176
+ return b.build();
274
177
  };
275
178
  export const se_GetFindingCommand = async (input, context) => {
276
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
179
+ const b = rb(input, context);
277
180
  const headers = {};
278
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/finding/{id}";
279
- resolvedPath = __resolvedPath(resolvedPath, input, "id", () => input.id, "{id}", false);
181
+ b.bp("/finding/{id}");
182
+ b.p("id", () => input.id, "{id}", false);
280
183
  const query = map({
281
- analyzerArn: [, __expectNonNull(input.analyzerArn, `analyzerArn`)],
184
+ [_aA]: [, __expectNonNull(input[_aA], `analyzerArn`)],
282
185
  });
283
186
  let body;
284
- return new __HttpRequest({
285
- protocol,
286
- hostname,
287
- port,
288
- method: "GET",
289
- headers,
290
- path: resolvedPath,
291
- query,
292
- body,
293
- });
187
+ b.m("GET").h(headers).q(query).b(body);
188
+ return b.build();
294
189
  };
295
190
  export const se_GetFindingV2Command = async (input, context) => {
296
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
191
+ const b = rb(input, context);
297
192
  const headers = {};
298
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/findingv2/{id}";
299
- resolvedPath = __resolvedPath(resolvedPath, input, "id", () => input.id, "{id}", false);
193
+ b.bp("/findingv2/{id}");
194
+ b.p("id", () => input.id, "{id}", false);
300
195
  const query = map({
301
- analyzerArn: [, __expectNonNull(input.analyzerArn, `analyzerArn`)],
302
- maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
303
- nextToken: [, input.nextToken],
196
+ [_aA]: [, __expectNonNull(input[_aA], `analyzerArn`)],
197
+ [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
198
+ [_nT]: [, input[_nT]],
304
199
  });
305
200
  let body;
306
- return new __HttpRequest({
307
- protocol,
308
- hostname,
309
- port,
310
- method: "GET",
311
- headers,
312
- path: resolvedPath,
313
- query,
314
- body,
315
- });
201
+ b.m("GET").h(headers).q(query).b(body);
202
+ return b.build();
316
203
  };
317
204
  export const se_GetGeneratedPolicyCommand = async (input, context) => {
318
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
205
+ const b = rb(input, context);
319
206
  const headers = {};
320
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/policy/generation/{jobId}";
321
- resolvedPath = __resolvedPath(resolvedPath, input, "jobId", () => input.jobId, "{jobId}", false);
207
+ b.bp("/policy/generation/{jobId}");
208
+ b.p("jobId", () => input.jobId, "{jobId}", false);
322
209
  const query = map({
323
- includeResourcePlaceholders: [
324
- () => input.includeResourcePlaceholders !== void 0,
325
- () => input.includeResourcePlaceholders.toString(),
326
- ],
327
- includeServiceLevelTemplate: [
328
- () => input.includeServiceLevelTemplate !== void 0,
329
- () => input.includeServiceLevelTemplate.toString(),
330
- ],
210
+ [_iRP]: [() => input.includeResourcePlaceholders !== void 0, () => input[_iRP].toString()],
211
+ [_iSLT]: [() => input.includeServiceLevelTemplate !== void 0, () => input[_iSLT].toString()],
331
212
  });
332
213
  let body;
333
- return new __HttpRequest({
334
- protocol,
335
- hostname,
336
- port,
337
- method: "GET",
338
- headers,
339
- path: resolvedPath,
340
- query,
341
- body,
342
- });
214
+ b.m("GET").h(headers).q(query).b(body);
215
+ return b.build();
343
216
  };
344
217
  export const se_ListAccessPreviewFindingsCommand = async (input, context) => {
345
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
218
+ const b = rb(input, context);
346
219
  const headers = {
347
220
  "content-type": "application/json",
348
221
  };
349
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/access-preview/{accessPreviewId}";
350
- resolvedPath = __resolvedPath(resolvedPath, input, "accessPreviewId", () => input.accessPreviewId, "{accessPreviewId}", false);
222
+ b.bp("/access-preview/{accessPreviewId}");
223
+ b.p("accessPreviewId", () => input.accessPreviewId, "{accessPreviewId}", false);
351
224
  let body;
352
225
  body = JSON.stringify(take(input, {
353
226
  analyzerArn: [],
@@ -355,43 +228,28 @@ export const se_ListAccessPreviewFindingsCommand = async (input, context) => {
355
228
  maxResults: [],
356
229
  nextToken: [],
357
230
  }));
358
- return new __HttpRequest({
359
- protocol,
360
- hostname,
361
- port,
362
- method: "POST",
363
- headers,
364
- path: resolvedPath,
365
- body,
366
- });
231
+ b.m("POST").h(headers).b(body);
232
+ return b.build();
367
233
  };
368
234
  export const se_ListAccessPreviewsCommand = async (input, context) => {
369
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
235
+ const b = rb(input, context);
370
236
  const headers = {};
371
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/access-preview";
237
+ b.bp("/access-preview");
372
238
  const query = map({
373
- analyzerArn: [, __expectNonNull(input.analyzerArn, `analyzerArn`)],
374
- nextToken: [, input.nextToken],
375
- maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
239
+ [_aA]: [, __expectNonNull(input[_aA], `analyzerArn`)],
240
+ [_nT]: [, input[_nT]],
241
+ [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
376
242
  });
377
243
  let body;
378
- return new __HttpRequest({
379
- protocol,
380
- hostname,
381
- port,
382
- method: "GET",
383
- headers,
384
- path: resolvedPath,
385
- query,
386
- body,
387
- });
244
+ b.m("GET").h(headers).q(query).b(body);
245
+ return b.build();
388
246
  };
389
247
  export const se_ListAnalyzedResourcesCommand = async (input, context) => {
390
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
248
+ const b = rb(input, context);
391
249
  const headers = {
392
250
  "content-type": "application/json",
393
251
  };
394
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/analyzed-resource";
252
+ b.bp("/analyzed-resource");
395
253
  let body;
396
254
  body = JSON.stringify(take(input, {
397
255
  analyzerArn: [],
@@ -399,64 +257,41 @@ export const se_ListAnalyzedResourcesCommand = async (input, context) => {
399
257
  nextToken: [],
400
258
  resourceType: [],
401
259
  }));
402
- return new __HttpRequest({
403
- protocol,
404
- hostname,
405
- port,
406
- method: "POST",
407
- headers,
408
- path: resolvedPath,
409
- body,
410
- });
260
+ b.m("POST").h(headers).b(body);
261
+ return b.build();
411
262
  };
412
263
  export const se_ListAnalyzersCommand = async (input, context) => {
413
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
264
+ const b = rb(input, context);
414
265
  const headers = {};
415
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/analyzer";
266
+ b.bp("/analyzer");
416
267
  const query = map({
417
- nextToken: [, input.nextToken],
418
- maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
419
- type: [, input.type],
268
+ [_nT]: [, input[_nT]],
269
+ [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
270
+ [_t]: [, input[_t]],
420
271
  });
421
272
  let body;
422
- return new __HttpRequest({
423
- protocol,
424
- hostname,
425
- port,
426
- method: "GET",
427
- headers,
428
- path: resolvedPath,
429
- query,
430
- body,
431
- });
273
+ b.m("GET").h(headers).q(query).b(body);
274
+ return b.build();
432
275
  };
433
276
  export const se_ListArchiveRulesCommand = async (input, context) => {
434
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
277
+ const b = rb(input, context);
435
278
  const headers = {};
436
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/analyzer/{analyzerName}/archive-rule";
437
- resolvedPath = __resolvedPath(resolvedPath, input, "analyzerName", () => input.analyzerName, "{analyzerName}", false);
279
+ b.bp("/analyzer/{analyzerName}/archive-rule");
280
+ b.p("analyzerName", () => input.analyzerName, "{analyzerName}", false);
438
281
  const query = map({
439
- nextToken: [, input.nextToken],
440
- maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
282
+ [_nT]: [, input[_nT]],
283
+ [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
441
284
  });
442
285
  let body;
443
- return new __HttpRequest({
444
- protocol,
445
- hostname,
446
- port,
447
- method: "GET",
448
- headers,
449
- path: resolvedPath,
450
- query,
451
- body,
452
- });
286
+ b.m("GET").h(headers).q(query).b(body);
287
+ return b.build();
453
288
  };
454
289
  export const se_ListFindingsCommand = async (input, context) => {
455
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
290
+ const b = rb(input, context);
456
291
  const headers = {
457
292
  "content-type": "application/json",
458
293
  };
459
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/finding";
294
+ b.bp("/finding");
460
295
  let body;
461
296
  body = JSON.stringify(take(input, {
462
297
  analyzerArn: [],
@@ -465,22 +300,15 @@ export const se_ListFindingsCommand = async (input, context) => {
465
300
  nextToken: [],
466
301
  sort: (_) => _json(_),
467
302
  }));
468
- return new __HttpRequest({
469
- protocol,
470
- hostname,
471
- port,
472
- method: "POST",
473
- headers,
474
- path: resolvedPath,
475
- body,
476
- });
303
+ b.m("POST").h(headers).b(body);
304
+ return b.build();
477
305
  };
478
306
  export const se_ListFindingsV2Command = async (input, context) => {
479
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
307
+ const b = rb(input, context);
480
308
  const headers = {
481
309
  "content-type": "application/json",
482
310
  };
483
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/findingv2";
311
+ b.bp("/findingv2");
484
312
  let body;
485
313
  body = JSON.stringify(take(input, {
486
314
  analyzerArn: [],
@@ -489,171 +317,112 @@ export const se_ListFindingsV2Command = async (input, context) => {
489
317
  nextToken: [],
490
318
  sort: (_) => _json(_),
491
319
  }));
492
- return new __HttpRequest({
493
- protocol,
494
- hostname,
495
- port,
496
- method: "POST",
497
- headers,
498
- path: resolvedPath,
499
- body,
500
- });
320
+ b.m("POST").h(headers).b(body);
321
+ return b.build();
501
322
  };
502
323
  export const se_ListPolicyGenerationsCommand = async (input, context) => {
503
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
324
+ const b = rb(input, context);
504
325
  const headers = {};
505
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/policy/generation";
326
+ b.bp("/policy/generation");
506
327
  const query = map({
507
- principalArn: [, input.principalArn],
508
- maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
509
- nextToken: [, input.nextToken],
328
+ [_pA]: [, input[_pA]],
329
+ [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
330
+ [_nT]: [, input[_nT]],
510
331
  });
511
332
  let body;
512
- return new __HttpRequest({
513
- protocol,
514
- hostname,
515
- port,
516
- method: "GET",
517
- headers,
518
- path: resolvedPath,
519
- query,
520
- body,
521
- });
333
+ b.m("GET").h(headers).q(query).b(body);
334
+ return b.build();
522
335
  };
523
336
  export const se_ListTagsForResourceCommand = async (input, context) => {
524
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
337
+ const b = rb(input, context);
525
338
  const headers = {};
526
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
527
- resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
339
+ b.bp("/tags/{resourceArn}");
340
+ b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
528
341
  let body;
529
- return new __HttpRequest({
530
- protocol,
531
- hostname,
532
- port,
533
- method: "GET",
534
- headers,
535
- path: resolvedPath,
536
- body,
537
- });
342
+ b.m("GET").h(headers).b(body);
343
+ return b.build();
538
344
  };
539
345
  export const se_StartPolicyGenerationCommand = async (input, context) => {
540
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
346
+ const b = rb(input, context);
541
347
  const headers = {
542
348
  "content-type": "application/json",
543
349
  };
544
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/policy/generation";
350
+ b.bp("/policy/generation");
545
351
  let body;
546
352
  body = JSON.stringify(take(input, {
547
353
  clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
548
354
  cloudTrailDetails: (_) => se_CloudTrailDetails(_, context),
549
355
  policyGenerationDetails: (_) => _json(_),
550
356
  }));
551
- return new __HttpRequest({
552
- protocol,
553
- hostname,
554
- port,
555
- method: "PUT",
556
- headers,
557
- path: resolvedPath,
558
- body,
559
- });
357
+ b.m("PUT").h(headers).b(body);
358
+ return b.build();
560
359
  };
561
360
  export const se_StartResourceScanCommand = async (input, context) => {
562
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
361
+ const b = rb(input, context);
563
362
  const headers = {
564
363
  "content-type": "application/json",
565
364
  };
566
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/resource/scan";
365
+ b.bp("/resource/scan");
567
366
  let body;
568
367
  body = JSON.stringify(take(input, {
569
368
  analyzerArn: [],
570
369
  resourceArn: [],
571
370
  resourceOwnerAccount: [],
572
371
  }));
573
- return new __HttpRequest({
574
- protocol,
575
- hostname,
576
- port,
577
- method: "POST",
578
- headers,
579
- path: resolvedPath,
580
- body,
581
- });
372
+ b.m("POST").h(headers).b(body);
373
+ return b.build();
582
374
  };
583
375
  export const se_TagResourceCommand = async (input, context) => {
584
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
376
+ const b = rb(input, context);
585
377
  const headers = {
586
378
  "content-type": "application/json",
587
379
  };
588
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
589
- resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
380
+ b.bp("/tags/{resourceArn}");
381
+ b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
590
382
  let body;
591
383
  body = JSON.stringify(take(input, {
592
384
  tags: (_) => _json(_),
593
385
  }));
594
- return new __HttpRequest({
595
- protocol,
596
- hostname,
597
- port,
598
- method: "POST",
599
- headers,
600
- path: resolvedPath,
601
- body,
602
- });
386
+ b.m("POST").h(headers).b(body);
387
+ return b.build();
603
388
  };
604
389
  export const se_UntagResourceCommand = async (input, context) => {
605
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
390
+ const b = rb(input, context);
606
391
  const headers = {};
607
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
608
- resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
392
+ b.bp("/tags/{resourceArn}");
393
+ b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
609
394
  const query = map({
610
- tagKeys: [
395
+ [_tK]: [
611
396
  __expectNonNull(input.tagKeys, `tagKeys`) != null,
612
- () => (input.tagKeys || []).map((_entry) => _entry),
397
+ () => (input[_tK] || []).map((_entry) => _entry),
613
398
  ],
614
399
  });
615
400
  let body;
616
- return new __HttpRequest({
617
- protocol,
618
- hostname,
619
- port,
620
- method: "DELETE",
621
- headers,
622
- path: resolvedPath,
623
- query,
624
- body,
625
- });
401
+ b.m("DELETE").h(headers).q(query).b(body);
402
+ return b.build();
626
403
  };
627
404
  export const se_UpdateArchiveRuleCommand = async (input, context) => {
628
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
405
+ const b = rb(input, context);
629
406
  const headers = {
630
407
  "content-type": "application/json",
631
408
  };
632
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
633
- "/analyzer/{analyzerName}/archive-rule/{ruleName}";
634
- resolvedPath = __resolvedPath(resolvedPath, input, "analyzerName", () => input.analyzerName, "{analyzerName}", false);
635
- resolvedPath = __resolvedPath(resolvedPath, input, "ruleName", () => input.ruleName, "{ruleName}", false);
409
+ b.bp("/analyzer/{analyzerName}/archive-rule/{ruleName}");
410
+ b.p("analyzerName", () => input.analyzerName, "{analyzerName}", false);
411
+ b.p("ruleName", () => input.ruleName, "{ruleName}", false);
636
412
  let body;
637
413
  body = JSON.stringify(take(input, {
638
414
  clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
639
415
  filter: (_) => _json(_),
640
416
  }));
641
- return new __HttpRequest({
642
- protocol,
643
- hostname,
644
- port,
645
- method: "PUT",
646
- headers,
647
- path: resolvedPath,
648
- body,
649
- });
417
+ b.m("PUT").h(headers).b(body);
418
+ return b.build();
650
419
  };
651
420
  export const se_UpdateFindingsCommand = async (input, context) => {
652
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
421
+ const b = rb(input, context);
653
422
  const headers = {
654
423
  "content-type": "application/json",
655
424
  };
656
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/finding";
425
+ b.bp("/finding");
657
426
  let body;
658
427
  body = JSON.stringify(take(input, {
659
428
  analyzerArn: [],
@@ -662,25 +431,18 @@ export const se_UpdateFindingsCommand = async (input, context) => {
662
431
  resourceArn: [],
663
432
  status: [],
664
433
  }));
665
- return new __HttpRequest({
666
- protocol,
667
- hostname,
668
- port,
669
- method: "PUT",
670
- headers,
671
- path: resolvedPath,
672
- body,
673
- });
434
+ b.m("PUT").h(headers).b(body);
435
+ return b.build();
674
436
  };
675
437
  export const se_ValidatePolicyCommand = async (input, context) => {
676
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
438
+ const b = rb(input, context);
677
439
  const headers = {
678
440
  "content-type": "application/json",
679
441
  };
680
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/policy/validation";
442
+ b.bp("/policy/validation");
681
443
  const query = map({
682
- maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
683
- nextToken: [, input.nextToken],
444
+ [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
445
+ [_nT]: [, input[_nT]],
684
446
  });
685
447
  let body;
686
448
  body = JSON.stringify(take(input, {
@@ -689,16 +451,8 @@ export const se_ValidatePolicyCommand = async (input, context) => {
689
451
  policyType: [],
690
452
  validatePolicyResourceType: [],
691
453
  }));
692
- return new __HttpRequest({
693
- protocol,
694
- hostname,
695
- port,
696
- method: "POST",
697
- headers,
698
- path: resolvedPath,
699
- query,
700
- body,
701
- });
454
+ b.m("POST").h(headers).q(query).b(body);
455
+ return b.build();
702
456
  };
703
457
  export const de_ApplyArchiveRuleCommand = async (output, context) => {
704
458
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2165,10 +1919,7 @@ const de_ConflictExceptionRes = async (parsedOutput, context) => {
2165
1919
  };
2166
1920
  const de_InternalServerExceptionRes = async (parsedOutput, context) => {
2167
1921
  const contents = map({
2168
- retryAfterSeconds: [
2169
- () => void 0 !== parsedOutput.headers["retry-after"],
2170
- () => __strictParseInt32(parsedOutput.headers["retry-after"]),
2171
- ],
1922
+ [_rAS]: [() => void 0 !== parsedOutput.headers[_ra], () => __strictParseInt32(parsedOutput.headers[_ra])],
2172
1923
  });
2173
1924
  const data = parsedOutput.body;
2174
1925
  const doc = take(data, {
@@ -2226,10 +1977,7 @@ const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
2226
1977
  };
2227
1978
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
2228
1979
  const contents = map({
2229
- retryAfterSeconds: [
2230
- () => void 0 !== parsedOutput.headers["retry-after"],
2231
- () => __strictParseInt32(parsedOutput.headers["retry-after"]),
2232
- ],
1980
+ [_rAS]: [() => void 0 !== parsedOutput.headers[_ra], () => __strictParseInt32(parsedOutput.headers[_ra])],
2233
1981
  });
2234
1982
  const data = parsedOutput.body;
2235
1983
  const doc = take(data, {
@@ -2582,6 +2330,18 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
2582
2330
  value !== "" &&
2583
2331
  (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
2584
2332
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
2333
+ const _aA = "analyzerArn";
2334
+ const _cT = "clientToken";
2335
+ const _iRP = "includeResourcePlaceholders";
2336
+ const _iSLT = "includeServiceLevelTemplate";
2337
+ const _mR = "maxResults";
2338
+ const _nT = "nextToken";
2339
+ const _pA = "principalArn";
2340
+ const _rA = "resourceArn";
2341
+ const _rAS = "retryAfterSeconds";
2342
+ const _ra = "retry-after";
2343
+ const _t = "type";
2344
+ const _tK = "tagKeys";
2585
2345
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
2586
2346
  if (encoded.length) {
2587
2347
  return JSON.parse(encoded);