Skip to content

Commit 990ba2f

Browse files
authored
feat(clients): allow setting path prefix from custom endpoints (#2722)
* feat(clients): allow setting path prefix from client
1 parent 4209967 commit 990ba2f

File tree

143 files changed

+286
-286
lines changed

Some content is hidden

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

143 files changed

+286
-286
lines changed

clients/client-acm-pca/protocols/Aws_json1_1.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3757,13 +3757,13 @@ const buildHttpRpcRequest = async (
37573757
resolvedHostname: string | undefined,
37583758
body: any
37593759
): Promise<__HttpRequest> => {
3760-
const { hostname, protocol = "https", port } = await context.endpoint();
3760+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
37613761
const contents: any = {
37623762
protocol,
37633763
hostname,
37643764
port,
37653765
method: "POST",
3766-
path,
3766+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
37673767
headers,
37683768
};
37693769
if (resolvedHostname !== undefined) {

clients/client-acm/protocols/Aws_json1_1.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2428,13 +2428,13 @@ const buildHttpRpcRequest = async (
24282428
resolvedHostname: string | undefined,
24292429
body: any
24302430
): Promise<__HttpRequest> => {
2431-
const { hostname, protocol = "https", port } = await context.endpoint();
2431+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
24322432
const contents: any = {
24332433
protocol,
24342434
hostname,
24352435
port,
24362436
method: "POST",
2437-
path,
2437+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
24382438
headers,
24392439
};
24402440
if (resolvedHostname !== undefined) {

clients/client-alexa-for-business/protocols/Aws_json1_1.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -10586,13 +10586,13 @@ const buildHttpRpcRequest = async (
1058610586
resolvedHostname: string | undefined,
1058710587
body: any
1058810588
): Promise<__HttpRequest> => {
10589-
const { hostname, protocol = "https", port } = await context.endpoint();
10589+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1059010590
const contents: any = {
1059110591
protocol,
1059210592
hostname,
1059310593
port,
1059410594
method: "POST",
10595-
path,
10595+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1059610596
headers,
1059710597
};
1059810598
if (resolvedHostname !== undefined) {

clients/client-application-auto-scaling/protocols/Aws_json1_1.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1924,13 +1924,13 @@ const buildHttpRpcRequest = async (
19241924
resolvedHostname: string | undefined,
19251925
body: any
19261926
): Promise<__HttpRequest> => {
1927-
const { hostname, protocol = "https", port } = await context.endpoint();
1927+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
19281928
const contents: any = {
19291929
protocol,
19301930
hostname,
19311931
port,
19321932
method: "POST",
1933-
path,
1933+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
19341934
headers,
19351935
};
19361936
if (resolvedHostname !== undefined) {

clients/client-application-discovery-service/protocols/Aws_json1_1.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4112,13 +4112,13 @@ const buildHttpRpcRequest = async (
41124112
resolvedHostname: string | undefined,
41134113
body: any
41144114
): Promise<__HttpRequest> => {
4115-
const { hostname, protocol = "https", port } = await context.endpoint();
4115+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
41164116
const contents: any = {
41174117
protocol,
41184118
hostname,
41194119
port,
41204120
method: "POST",
4121-
path,
4121+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
41224122
headers,
41234123
};
41244124
if (resolvedHostname !== undefined) {

clients/client-application-insights/protocols/Aws_json1_1.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3548,13 +3548,13 @@ const buildHttpRpcRequest = async (
35483548
resolvedHostname: string | undefined,
35493549
body: any
35503550
): Promise<__HttpRequest> => {
3551-
const { hostname, protocol = "https", port } = await context.endpoint();
3551+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
35523552
const contents: any = {
35533553
protocol,
35543554
hostname,
35553555
port,
35563556
method: "POST",
3557-
path,
3557+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
35583558
headers,
35593559
};
35603560
if (resolvedHostname !== undefined) {

clients/client-apprunner/protocols/Aws_json1_0.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3182,13 +3182,13 @@ const buildHttpRpcRequest = async (
31823182
resolvedHostname: string | undefined,
31833183
body: any
31843184
): Promise<__HttpRequest> => {
3185-
const { hostname, protocol = "https", port } = await context.endpoint();
3185+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
31863186
const contents: any = {
31873187
protocol,
31883188
hostname,
31893189
port,
31903190
method: "POST",
3191-
path,
3191+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
31923192
headers,
31933193
};
31943194
if (resolvedHostname !== undefined) {

clients/client-appstream/protocols/Aws_json1_1.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6778,13 +6778,13 @@ const buildHttpRpcRequest = async (
67786778
resolvedHostname: string | undefined,
67796779
body: any
67806780
): Promise<__HttpRequest> => {
6781-
const { hostname, protocol = "https", port } = await context.endpoint();
6781+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
67826782
const contents: any = {
67836783
protocol,
67846784
hostname,
67856785
port,
67866786
method: "POST",
6787-
path,
6787+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
67886788
headers,
67896789
};
67906790
if (resolvedHostname !== undefined) {

clients/client-athena/protocols/Aws_json1_1.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4290,13 +4290,13 @@ const buildHttpRpcRequest = async (
42904290
resolvedHostname: string | undefined,
42914291
body: any
42924292
): Promise<__HttpRequest> => {
4293-
const { hostname, protocol = "https", port } = await context.endpoint();
4293+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
42944294
const contents: any = {
42954295
protocol,
42964296
hostname,
42974297
port,
42984298
method: "POST",
4299-
path,
4299+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
43004300
headers,
43014301
};
43024302
if (resolvedHostname !== undefined) {

clients/client-auto-scaling-plans/protocols/Aws_json1_1.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1458,13 +1458,13 @@ const buildHttpRpcRequest = async (
14581458
resolvedHostname: string | undefined,
14591459
body: any
14601460
): Promise<__HttpRequest> => {
1461-
const { hostname, protocol = "https", port } = await context.endpoint();
1461+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
14621462
const contents: any = {
14631463
protocol,
14641464
hostname,
14651465
port,
14661466
method: "POST",
1467-
path,
1467+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
14681468
headers,
14691469
};
14701470
if (resolvedHostname !== undefined) {

clients/client-auto-scaling/protocols/Aws_query.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -9986,13 +9986,13 @@ const buildHttpRpcRequest = async (
99869986
resolvedHostname: string | undefined,
99879987
body: any
99889988
): Promise<__HttpRequest> => {
9989-
const { hostname, protocol = "https", port } = await context.endpoint();
9989+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
99909990
const contents: any = {
99919991
protocol,
99929992
hostname,
99939993
port,
99949994
method: "POST",
9995-
path,
9995+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
99969996
headers,
99979997
};
99989998
if (resolvedHostname !== undefined) {

clients/client-budgets/protocols/Aws_json1_1.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3735,13 +3735,13 @@ const buildHttpRpcRequest = async (
37353735
resolvedHostname: string | undefined,
37363736
body: any
37373737
): Promise<__HttpRequest> => {
3738-
const { hostname, protocol = "https", port } = await context.endpoint();
3738+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
37393739
const contents: any = {
37403740
protocol,
37413741
hostname,
37423742
port,
37433743
method: "POST",
3744-
path,
3744+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
37453745
headers,
37463746
};
37473747
if (resolvedHostname !== undefined) {

clients/client-cloud9/protocols/Aws_json1_1.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2122,13 +2122,13 @@ const buildHttpRpcRequest = async (
21222122
resolvedHostname: string | undefined,
21232123
body: any
21242124
): Promise<__HttpRequest> => {
2125-
const { hostname, protocol = "https", port } = await context.endpoint();
2125+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
21262126
const contents: any = {
21272127
protocol,
21282128
hostname,
21292129
port,
21302130
method: "POST",
2131-
path,
2131+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
21322132
headers,
21332133
};
21342134
if (resolvedHostname !== undefined) {

clients/client-cloudformation/protocols/Aws_query.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -11124,13 +11124,13 @@ const buildHttpRpcRequest = async (
1112411124
resolvedHostname: string | undefined,
1112511125
body: any
1112611126
): Promise<__HttpRequest> => {
11127-
const { hostname, protocol = "https", port } = await context.endpoint();
11127+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1112811128
const contents: any = {
1112911129
protocol,
1113011130
hostname,
1113111131
port,
1113211132
method: "POST",
11133-
path,
11133+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1113411134
headers,
1113511135
};
1113611136
if (resolvedHostname !== undefined) {

clients/client-cloudhsm-v2/protocols/Aws_json1_1.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2296,13 +2296,13 @@ const buildHttpRpcRequest = async (
22962296
resolvedHostname: string | undefined,
22972297
body: any
22982298
): Promise<__HttpRequest> => {
2299-
const { hostname, protocol = "https", port } = await context.endpoint();
2299+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
23002300
const contents: any = {
23012301
protocol,
23022302
hostname,
23032303
port,
23042304
method: "POST",
2305-
path,
2305+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
23062306
headers,
23072307
};
23082308
if (resolvedHostname !== undefined) {

clients/client-cloudhsm/protocols/Aws_json1_1.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2339,13 +2339,13 @@ const buildHttpRpcRequest = async (
23392339
resolvedHostname: string | undefined,
23402340
body: any
23412341
): Promise<__HttpRequest> => {
2342-
const { hostname, protocol = "https", port } = await context.endpoint();
2342+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
23432343
const contents: any = {
23442344
protocol,
23452345
hostname,
23462346
port,
23472347
method: "POST",
2348-
path,
2348+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
23492349
headers,
23502350
};
23512351
if (resolvedHostname !== undefined) {

clients/client-cloudsearch/protocols/Aws_query.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4897,13 +4897,13 @@ const buildHttpRpcRequest = async (
48974897
resolvedHostname: string | undefined,
48984898
body: any
48994899
): Promise<__HttpRequest> => {
4900-
const { hostname, protocol = "https", port } = await context.endpoint();
4900+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
49014901
const contents: any = {
49024902
protocol,
49034903
hostname,
49044904
port,
49054905
method: "POST",
4906-
path,
4906+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
49074907
headers,
49084908
};
49094909
if (resolvedHostname !== undefined) {

clients/client-cloudtrail/protocols/Aws_json1_1.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4455,13 +4455,13 @@ const buildHttpRpcRequest = async (
44554455
resolvedHostname: string | undefined,
44564456
body: any
44574457
): Promise<__HttpRequest> => {
4458-
const { hostname, protocol = "https", port } = await context.endpoint();
4458+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
44594459
const contents: any = {
44604460
protocol,
44614461
hostname,
44624462
port,
44634463
method: "POST",
4464-
path,
4464+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
44654465
headers,
44664466
};
44674467
if (resolvedHostname !== undefined) {

clients/client-cloudwatch-events/protocols/Aws_json1_1.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -7671,13 +7671,13 @@ const buildHttpRpcRequest = async (
76717671
resolvedHostname: string | undefined,
76727672
body: any
76737673
): Promise<__HttpRequest> => {
7674-
const { hostname, protocol = "https", port } = await context.endpoint();
7674+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
76757675
const contents: any = {
76767676
protocol,
76777677
hostname,
76787678
port,
76797679
method: "POST",
7680-
path,
7680+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
76817681
headers,
76827682
};
76837683
if (resolvedHostname !== undefined) {

clients/client-cloudwatch-logs/protocols/Aws_json1_1.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5351,13 +5351,13 @@ const buildHttpRpcRequest = async (
53515351
resolvedHostname: string | undefined,
53525352
body: any
53535353
): Promise<__HttpRequest> => {
5354-
const { hostname, protocol = "https", port } = await context.endpoint();
5354+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
53555355
const contents: any = {
53565356
protocol,
53575357
hostname,
53585358
port,
53595359
method: "POST",
5360-
path,
5360+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
53615361
headers,
53625362
};
53635363
if (resolvedHostname !== undefined) {

clients/client-cloudwatch/protocols/Aws_query.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6346,13 +6346,13 @@ const buildHttpRpcRequest = async (
63466346
resolvedHostname: string | undefined,
63476347
body: any
63486348
): Promise<__HttpRequest> => {
6349-
const { hostname, protocol = "https", port } = await context.endpoint();
6349+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
63506350
const contents: any = {
63516351
protocol,
63526352
hostname,
63536353
port,
63546354
method: "POST",
6355-
path,
6355+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
63566356
headers,
63576357
};
63586358
if (resolvedHostname !== undefined) {

clients/client-codebuild/protocols/Aws_json1_1.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6577,13 +6577,13 @@ const buildHttpRpcRequest = async (
65776577
resolvedHostname: string | undefined,
65786578
body: any
65796579
): Promise<__HttpRequest> => {
6580-
const { hostname, protocol = "https", port } = await context.endpoint();
6580+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
65816581
const contents: any = {
65826582
protocol,
65836583
hostname,
65846584
port,
65856585
method: "POST",
6586-
path,
6586+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
65876587
headers,
65886588
};
65896589
if (resolvedHostname !== undefined) {

clients/client-codecommit/protocols/Aws_json1_1.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -21313,13 +21313,13 @@ const buildHttpRpcRequest = async (
2131321313
resolvedHostname: string | undefined,
2131421314
body: any
2131521315
): Promise<__HttpRequest> => {
21316-
const { hostname, protocol = "https", port } = await context.endpoint();
21316+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
2131721317
const contents: any = {
2131821318
protocol,
2131921319
hostname,
2132021320
port,
2132121321
method: "POST",
21322-
path,
21322+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
2132321323
headers,
2132421324
};
2132521325
if (resolvedHostname !== undefined) {

clients/client-codedeploy/protocols/Aws_json1_1.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -11290,13 +11290,13 @@ const buildHttpRpcRequest = async (
1129011290
resolvedHostname: string | undefined,
1129111291
body: any
1129211292
): Promise<__HttpRequest> => {
11293-
const { hostname, protocol = "https", port } = await context.endpoint();
11293+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1129411294
const contents: any = {
1129511295
protocol,
1129611296
hostname,
1129711297
port,
1129811298
method: "POST",
11299-
path,
11299+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1130011300
headers,
1130111301
};
1130211302
if (resolvedHostname !== undefined) {

clients/client-codepipeline/protocols/Aws_json1_1.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -7013,13 +7013,13 @@ const buildHttpRpcRequest = async (
70137013
resolvedHostname: string | undefined,
70147014
body: any
70157015
): Promise<__HttpRequest> => {
7016-
const { hostname, protocol = "https", port } = await context.endpoint();
7016+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
70177017
const contents: any = {
70187018
protocol,
70197019
hostname,
70207020
port,
70217021
method: "POST",
7022-
path,
7022+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
70237023
headers,
70247024
};
70257025
if (resolvedHostname !== undefined) {

0 commit comments

Comments
 (0)