Skip to content

Update docs for non aws-config config builders #3960

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading