Skip to content

Commit 1baf47b

Browse files
jdisantiaws-sdk-rust-ci
authored andcommitted
Add feature flag for the crate reorganization (#2388)
1 parent c56e5af commit 1baf47b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientRustSettings.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ data class ClientCodegenConfig(
8686
val addMessageToErrors: Boolean = defaultAddMessageToErrors,
8787
// TODO(EventStream): [CLEANUP] Remove this property when turning on Event Stream for all services
8888
val eventStreamAllowList: Set<String> = defaultEventStreamAllowList,
89+
// TODO(CrateReorganization): Remove this once we commit to the breaking change
90+
val enableNewCrateOrganizationScheme: Boolean = defaultEnableNewCrateOrganizationScheme,
8991
) : CoreCodegenConfig(
9092
formatTimeoutSeconds, debugMode,
9193
) {
@@ -94,6 +96,7 @@ data class ClientCodegenConfig(
9496
private const val defaultIncludeFluentClient = true
9597
private const val defaultAddMessageToErrors = true
9698
private val defaultEventStreamAllowList: Set<String> = emptySet()
99+
private const val defaultEnableNewCrateOrganizationScheme = false
97100

98101
fun fromCodegenConfigAndNode(coreCodegenConfig: CoreCodegenConfig, node: Optional<ObjectNode>) =
99102
if (node.isPresent) {
@@ -106,12 +109,14 @@ data class ClientCodegenConfig(
106109
renameExceptions = node.get().getBooleanMemberOrDefault("renameErrors", defaultRenameExceptions),
107110
includeFluentClient = node.get().getBooleanMemberOrDefault("includeFluentClient", defaultIncludeFluentClient),
108111
addMessageToErrors = node.get().getBooleanMemberOrDefault("addMessageToErrors", defaultAddMessageToErrors),
112+
enableNewCrateOrganizationScheme = node.get().getBooleanMemberOrDefault("enableNewCrateOrganizationScheme", false),
109113
)
110114
} else {
111115
ClientCodegenConfig(
112116
formatTimeoutSeconds = coreCodegenConfig.formatTimeoutSeconds,
113117
debugMode = coreCodegenConfig.debugMode,
114118
eventStreamAllowList = defaultEventStreamAllowList,
119+
enableNewCrateOrganizationScheme = defaultEnableNewCrateOrganizationScheme,
115120
)
116121
}
117122
}

0 commit comments

Comments
 (0)