Skip to content

Commit

Permalink
Update docs for non aws-config config builders (#3960)
Browse files Browse the repository at this point in the history
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
Partially addresses awslabs/aws-sdk-rust#1226,
although we might want to look into going further and actually
deprecating or warning on these builder methods.

## Description
<!--- Describe your changes in detail -->

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
Doc only update

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
  • Loading branch information
landonxjames authored Jan 3, 2025
1 parent 845bb91 commit f003000
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,13 @@ class ServiceConfigGenerator(
}

fun render(writer: RustWriter) {
val configDocs = """
Constructs a config builder.
<div class="warning">
Note that a config created from this builder will not have the same safe defaults as one created by
the <a href="https://crates.io/crates/aws-config" target="_blank">aws-config</a> crate.
</div>
"""
writer.docs("Configuration for a $moduleUseName service client.\n")
customizations.forEach {
it.section(ServiceConfig.ConfigStructAdditionalDocs)(writer)
Expand All @@ -424,9 +431,9 @@ class ServiceConfigGenerator(
}

writer.rustBlock("impl Config") {
writer.docs(configDocs)
writer.rustTemplate(
"""
/// Constructs a config builder.
pub fn builder() -> Builder { Builder::default() }
""",
)
Expand Down Expand Up @@ -483,7 +490,7 @@ class ServiceConfigGenerator(
}

writer.rustBlock("impl Builder") {
writer.docs("Constructs a config builder.")
writer.docs(configDocs)
writer.rust("pub fn new() -> Self { Self::default() }")

builderFromConfigBag()(this)
Expand Down

0 comments on commit f003000

Please sign in to comment.