Skip to content

Commit 03d6230

Browse files
author
Steven Yuan
authored
feat(experimentalIdentityAndAuth): add endpointRuleSet trait to generic client test (aws#5573)
1 parent cdcbe7a commit 03d6230

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

codegen/generic-client-test-codegen/build.gradle.kts

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ plugins {
3737
dependencies {
3838
implementation("software.amazon.smithy:smithy-aws-protocol-tests:$smithyVersion")
3939
implementation("software.amazon.smithy:smithy-aws-traits:$smithyVersion")
40+
implementation("software.amazon.smithy:smithy-rules-engine:$smithyVersion")
4041
implementation(project(":smithy-aws-typescript-codegen"))
4142
}
4243

codegen/generic-client-test-codegen/model/weather.smithy

+29
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ $version: "2.0"
33
namespace example.weather
44

55
use aws.auth#sigv4
6+
use aws.api#service
67

78
@authDefinition
89
@trait
@@ -12,6 +13,7 @@ structure customAuth {}
1213
@protocolDefinition
1314
structure fakeProtocol {}
1415

16+
@service(sdkId: "weather")
1517
@fakeProtocol
1618
@httpApiKeyAuth(name: "X-Api-Key", in: "header")
1719
@httpBearerAuth
@@ -86,3 +88,30 @@ operation SameAsService {
8688
service: String
8789
}
8890
}
91+
92+
apply Weather @smithy.rules#endpointRuleSet({
93+
"version": "1.3",
94+
"parameters": {
95+
"Region": {
96+
"required": true,
97+
"type": "String",
98+
"documentation": "docs"
99+
}
100+
},
101+
"rules": [
102+
{
103+
"conditions": [],
104+
"documentation": "base rule",
105+
"endpoint": {
106+
"url": "https://{Region}.amazonaws.com",
107+
"properties": {},
108+
"headers": {}
109+
},
110+
"type": "endpoint"
111+
}
112+
]
113+
})
114+
115+
apply Weather @smithy.rules#clientContextParams(
116+
Region: {type: "string", documentation: "docs"}
117+
)

0 commit comments

Comments
 (0)