-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make
RustReservedWordsSymbolProvider
configurable
- Loading branch information
Showing
11 changed files
with
227 additions
and
49 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
.../src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientReservedWords.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package software.amazon.smithy.rust.codegen.client.smithy | ||
|
||
import software.amazon.smithy.rust.codegen.core.rustlang.RustReservedWordConfig | ||
import software.amazon.smithy.rust.codegen.core.smithy.generators.StructureGenerator | ||
import software.amazon.smithy.rust.codegen.core.smithy.generators.UnionGenerator | ||
|
||
val ClientReservedWords = RustReservedWordConfig( | ||
structMemberMap = StructureGenerator.structMemberMap + | ||
mapOf( | ||
"send" to "send_value", | ||
// To avoid conflicts with the `make_operation` and `presigned` functions on generated inputs | ||
"make_operation" to "make_operation_value", | ||
"presigned" to "presigned_value", | ||
"customize" to "customize_value", | ||
// To avoid conflicts with the error metadata `meta` field | ||
"meta" to "meta_value", | ||
), | ||
unionMemberMap = mapOf( | ||
// Unions contain an `Unknown` variant. This exists to support parsing data returned from the server | ||
// that represent union variants that have been added since this SDK was generated. | ||
UnionGenerator.UnknownVariantName to "${UnionGenerator.UnknownVariantName}Value", | ||
"${UnionGenerator.UnknownVariantName}Value" to "${UnionGenerator.UnknownVariantName}Value_", | ||
), | ||
enumMemberMap = mapOf( | ||
// Unknown is used as the name of the variant containing unexpected values | ||
"Unknown" to "UnknownValue", | ||
// Real models won't end in `_` so it's safe to stop here | ||
"UnknownValue" to "UnknownValue_", | ||
), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.