Skip to content

Commit 71f20e9

Browse files
authored
misc: add support for downstream endpoint url config feature (#946)
1 parent 7594a4d commit 71f20e9

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"id": "d477286c-f799-426b-947c-7cc6982fbcfe",
3+
"type": "misc",
4+
"description": "Expose SDK ID in service companion object section writer."
5+
}

codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/ServiceClientGenerator.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ class ServiceClientGenerator(private val ctx: RenderingContext<ServiceShape>) {
4141
* Context key for the service symbol
4242
*/
4343
val ServiceSymbol: SectionKey<Symbol> = SectionKey("ServiceSymbol")
44+
45+
/**
46+
* Context key for the SDK ID
47+
*/
48+
val SdkId: SectionKey<String> = SectionKey("SdkId")
4449
}
4550

4651
/**
@@ -88,7 +93,10 @@ class ServiceClientGenerator(private val ctx: RenderingContext<ServiceShape>) {
8893
writer.write("")
8994
writer.declareSection(
9095
Sections.CompanionObject,
91-
context = mapOf(Sections.CompanionObject.ServiceSymbol to serviceSymbol),
96+
context = mapOf(
97+
Sections.CompanionObject.ServiceSymbol to serviceSymbol,
98+
Sections.CompanionObject.SdkId to ctx.settings.sdkId,
99+
),
92100
) {
93101
renderCompanionObject()
94102
}

0 commit comments

Comments
 (0)