Skip to content

Commit 08c9420

Browse files
authored
fix: move endpoint resolution to the serializers (#1106)
* fix: move endpoint resolution to the serializers * feat: codegen * test: update endpoint test
1 parent fde80bf commit 08c9420

File tree

221 files changed

+16340
-11216
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

221 files changed

+16340
-11216
lines changed

Diff for: clients/client-accessanalyzer/protocols/Aws_restJson1_1.ts

+115-79
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,15 @@ export async function serializeAws_restJson1_1CreateAnalyzerCommand(
136136
bodyParams["type"] = input.type;
137137
}
138138
body = JSON.stringify(bodyParams);
139+
const { hostname, protocol = "https", port } = await context.endpoint();
139140
return new __HttpRequest({
140-
protocol: "https",
141+
protocol,
142+
hostname,
143+
port,
141144
method: "PUT",
142-
headers: headers,
145+
headers,
143146
path: resolvedPath,
144-
body: body,
145-
...context.endpoint
147+
body
146148
});
147149
}
148150

@@ -185,13 +187,15 @@ export async function serializeAws_restJson1_1CreateArchiveRuleCommand(
185187
bodyParams["ruleName"] = input.ruleName;
186188
}
187189
body = JSON.stringify(bodyParams);
190+
const { hostname, protocol = "https", port } = await context.endpoint();
188191
return new __HttpRequest({
189-
protocol: "https",
192+
protocol,
193+
hostname,
194+
port,
190195
method: "PUT",
191-
headers: headers,
196+
headers,
192197
path: resolvedPath,
193-
body: body,
194-
...context.endpoint
198+
body
195199
});
196200
}
197201

@@ -221,14 +225,16 @@ export async function serializeAws_restJson1_1DeleteAnalyzerCommand(
221225
query["clientToken"] = input.clientToken;
222226
}
223227
let body: any;
228+
const { hostname, protocol = "https", port } = await context.endpoint();
224229
return new __HttpRequest({
225-
protocol: "https",
230+
protocol,
231+
hostname,
232+
port,
226233
method: "DELETE",
227-
headers: headers,
234+
headers,
228235
path: resolvedPath,
229-
query: query,
230-
body: body,
231-
...context.endpoint
236+
query,
237+
body
232238
});
233239
}
234240

@@ -270,14 +276,16 @@ export async function serializeAws_restJson1_1DeleteArchiveRuleCommand(
270276
query["clientToken"] = input.clientToken;
271277
}
272278
let body: any;
279+
const { hostname, protocol = "https", port } = await context.endpoint();
273280
return new __HttpRequest({
274-
protocol: "https",
281+
protocol,
282+
hostname,
283+
port,
275284
method: "DELETE",
276-
headers: headers,
285+
headers,
277286
path: resolvedPath,
278-
query: query,
279-
body: body,
280-
...context.endpoint
287+
query,
288+
body
281289
});
282290
}
283291

@@ -296,14 +304,16 @@ export async function serializeAws_restJson1_1GetAnalyzedResourceCommand(
296304
query["resourceArn"] = input.resourceArn;
297305
}
298306
let body: any;
307+
const { hostname, protocol = "https", port } = await context.endpoint();
299308
return new __HttpRequest({
300-
protocol: "https",
309+
protocol,
310+
hostname,
311+
port,
301312
method: "GET",
302-
headers: headers,
313+
headers,
303314
path: resolvedPath,
304-
query: query,
305-
body: body,
306-
...context.endpoint
315+
query,
316+
body
307317
});
308318
}
309319

@@ -329,13 +339,15 @@ export async function serializeAws_restJson1_1GetAnalyzerCommand(
329339
throw new Error("No value provided for input HTTP label: analyzerName.");
330340
}
331341
let body: any;
342+
const { hostname, protocol = "https", port } = await context.endpoint();
332343
return new __HttpRequest({
333-
protocol: "https",
344+
protocol,
345+
hostname,
346+
port,
334347
method: "GET",
335-
headers: headers,
348+
headers,
336349
path: resolvedPath,
337-
body: body,
338-
...context.endpoint
350+
body
339351
});
340352
}
341353

@@ -373,13 +385,15 @@ export async function serializeAws_restJson1_1GetArchiveRuleCommand(
373385
throw new Error("No value provided for input HTTP label: ruleName.");
374386
}
375387
let body: any;
388+
const { hostname, protocol = "https", port } = await context.endpoint();
376389
return new __HttpRequest({
377-
protocol: "https",
390+
protocol,
391+
hostname,
392+
port,
378393
method: "GET",
379-
headers: headers,
394+
headers,
380395
path: resolvedPath,
381-
body: body,
382-
...context.endpoint
396+
body
383397
});
384398
}
385399

@@ -407,14 +421,16 @@ export async function serializeAws_restJson1_1GetFindingCommand(
407421
query["analyzerArn"] = input.analyzerArn;
408422
}
409423
let body: any;
424+
const { hostname, protocol = "https", port } = await context.endpoint();
410425
return new __HttpRequest({
411-
protocol: "https",
426+
protocol,
427+
hostname,
428+
port,
412429
method: "GET",
413-
headers: headers,
430+
headers,
414431
path: resolvedPath,
415-
query: query,
416-
body: body,
417-
...context.endpoint
432+
query,
433+
body
418434
});
419435
}
420436

@@ -440,13 +456,15 @@ export async function serializeAws_restJson1_1ListAnalyzedResourcesCommand(
440456
bodyParams["resourceType"] = input.resourceType;
441457
}
442458
body = JSON.stringify(bodyParams);
459+
const { hostname, protocol = "https", port } = await context.endpoint();
443460
return new __HttpRequest({
444-
protocol: "https",
461+
protocol,
462+
hostname,
463+
port,
445464
method: "POST",
446-
headers: headers,
465+
headers,
447466
path: resolvedPath,
448-
body: body,
449-
...context.endpoint
467+
body
450468
});
451469
}
452470

@@ -468,14 +486,16 @@ export async function serializeAws_restJson1_1ListAnalyzersCommand(
468486
query["type"] = input.type;
469487
}
470488
let body: any;
489+
const { hostname, protocol = "https", port } = await context.endpoint();
471490
return new __HttpRequest({
472-
protocol: "https",
491+
protocol,
492+
hostname,
493+
port,
473494
method: "GET",
474-
headers: headers,
495+
headers,
475496
path: resolvedPath,
476-
query: query,
477-
body: body,
478-
...context.endpoint
497+
query,
498+
body
479499
});
480500
}
481501

@@ -508,14 +528,16 @@ export async function serializeAws_restJson1_1ListArchiveRulesCommand(
508528
query["nextToken"] = input.nextToken;
509529
}
510530
let body: any;
531+
const { hostname, protocol = "https", port } = await context.endpoint();
511532
return new __HttpRequest({
512-
protocol: "https",
533+
protocol,
534+
hostname,
535+
port,
513536
method: "GET",
514-
headers: headers,
537+
headers,
515538
path: resolvedPath,
516-
query: query,
517-
body: body,
518-
...context.endpoint
539+
query,
540+
body
519541
});
520542
}
521543

@@ -550,13 +572,15 @@ export async function serializeAws_restJson1_1ListFindingsCommand(
550572
);
551573
}
552574
body = JSON.stringify(bodyParams);
575+
const { hostname, protocol = "https", port } = await context.endpoint();
553576
return new __HttpRequest({
554-
protocol: "https",
577+
protocol,
578+
hostname,
579+
port,
555580
method: "POST",
556-
headers: headers,
581+
headers,
557582
path: resolvedPath,
558-
body: body,
559-
...context.endpoint
583+
body
560584
});
561585
}
562586

@@ -582,13 +606,15 @@ export async function serializeAws_restJson1_1ListTagsForResourceCommand(
582606
throw new Error("No value provided for input HTTP label: resourceArn.");
583607
}
584608
let body: any;
609+
const { hostname, protocol = "https", port } = await context.endpoint();
585610
return new __HttpRequest({
586-
protocol: "https",
611+
protocol,
612+
hostname,
613+
port,
587614
method: "GET",
588-
headers: headers,
615+
headers,
589616
path: resolvedPath,
590-
body: body,
591-
...context.endpoint
617+
body
592618
});
593619
}
594620

@@ -608,13 +634,15 @@ export async function serializeAws_restJson1_1StartResourceScanCommand(
608634
bodyParams["resourceArn"] = input.resourceArn;
609635
}
610636
body = JSON.stringify(bodyParams);
637+
const { hostname, protocol = "https", port } = await context.endpoint();
611638
return new __HttpRequest({
612-
protocol: "https",
639+
protocol,
640+
hostname,
641+
port,
613642
method: "POST",
614-
headers: headers,
643+
headers,
615644
path: resolvedPath,
616-
body: body,
617-
...context.endpoint
645+
body
618646
});
619647
}
620648

@@ -645,13 +673,15 @@ export async function serializeAws_restJson1_1TagResourceCommand(
645673
bodyParams["tags"] = serializeAws_restJson1_1TagsMap(input.tags, context);
646674
}
647675
body = JSON.stringify(bodyParams);
676+
const { hostname, protocol = "https", port } = await context.endpoint();
648677
return new __HttpRequest({
649-
protocol: "https",
678+
protocol,
679+
hostname,
680+
port,
650681
method: "POST",
651-
headers: headers,
682+
headers,
652683
path: resolvedPath,
653-
body: body,
654-
...context.endpoint
684+
body
655685
});
656686
}
657687

@@ -681,14 +711,16 @@ export async function serializeAws_restJson1_1UntagResourceCommand(
681711
query["tagKeys"] = (input.tagKeys || []).map(_entry => _entry);
682712
}
683713
let body: any;
714+
const { hostname, protocol = "https", port } = await context.endpoint();
684715
return new __HttpRequest({
685-
protocol: "https",
716+
protocol,
717+
hostname,
718+
port,
686719
method: "DELETE",
687-
headers: headers,
720+
headers,
688721
path: resolvedPath,
689-
query: query,
690-
body: body,
691-
...context.endpoint
722+
query,
723+
body
692724
});
693725
}
694726

@@ -740,13 +772,15 @@ export async function serializeAws_restJson1_1UpdateArchiveRuleCommand(
740772
);
741773
}
742774
body = JSON.stringify(bodyParams);
775+
const { hostname, protocol = "https", port } = await context.endpoint();
743776
return new __HttpRequest({
744-
protocol: "https",
777+
protocol,
778+
hostname,
779+
port,
745780
method: "PUT",
746-
headers: headers,
781+
headers,
747782
path: resolvedPath,
748-
body: body,
749-
...context.endpoint
783+
body
750784
});
751785
}
752786

@@ -781,13 +815,15 @@ export async function serializeAws_restJson1_1UpdateFindingsCommand(
781815
bodyParams["status"] = input.status;
782816
}
783817
body = JSON.stringify(bodyParams);
818+
const { hostname, protocol = "https", port } = await context.endpoint();
784819
return new __HttpRequest({
785-
protocol: "https",
820+
protocol,
821+
hostname,
822+
port,
786823
method: "PUT",
787-
headers: headers,
824+
headers,
788825
path: resolvedPath,
789-
body: body,
790-
...context.endpoint
826+
body
791827
});
792828
}
793829

0 commit comments

Comments
 (0)