Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions CHANGELOG.next.toml
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,9 @@ An example from the SDK is in [transcribe streaming](https://github.com/awslabs/
references = ["smithy-rs#1157"]
meta = { "breaking" = true, "tada" = false, "bug" = false }
author = "82marbag"

[[aws-sdk-rust]]
message = "SDK crate READMEs now include an example of creating a client"
references = ["smithy-rs#1571", "smithy-rs#1385"]
meta = { "breaking" = false, "tada" = true, "bug" = false }
author = "jdisanti"
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class AwsReadmeDecorator : RustCodegenDecorator<ClientCodegenContext> {
codegenContext.settings.getService(codegenContext.model).getTrait<DocumentationTrait>()?.value ?: ""
)
val moduleName = codegenContext.settings.moduleName
val snakeCaseModuleName = moduleName.replace('-', '_')
val shortModuleName = moduleName.removePrefix("aws-sdk-")

writer.raw(
"""
Expand All @@ -68,6 +70,25 @@ class AwsReadmeDecorator : RustCodegenDecorator<ClientCodegenContext> {
tokio = { version = "1", features = ["full"] }
```

Then in code, a client can be created with the following:

```rust
use $snakeCaseModuleName as $shortModuleName;

#[tokio::main]
async fn main() -> Result<(), $shortModuleName::Error> {
let config = aws_config::load_from_env().await;
let client = $shortModuleName::Client::new(&config);

// ... make some calls with the client

Ok(())
}
```

See the [client documentation](https://docs.rs/$moduleName/latest/$snakeCaseModuleName/client/struct.Client.html)
for information on what calls can be made, and the inputs and outputs for each of those calls.

## Using the SDK

Until the SDK is released, we will be adding information about using the SDK to the
Expand Down