Skip to content

Commit e8e08a7

Browse files
[examples] Sync SDK examples from awsdocs/aws-doc-sdk-examples
Includes commit(s): 46c2187478902e72891354b87435d7c72fe20680 Co-authored-by: David Souther <[email protected]>
1 parent f8c6614 commit e8e08a7

File tree

10 files changed

+22
-23
lines changed

10 files changed

+22
-23
lines changed

examples/cross_service/photo_asset_management/src/chunked_uploader.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
3-
use std::io::Read;
4-
53
use anyhow::anyhow;
64
use aws_sdk_dynamodb::primitives::DateTime;
75
use aws_sdk_s3::{operation::get_object::GetObjectOutput, types::CompletedPart};
86
use aws_smithy_types_convert::date_time::DateTimeExt;
97
use chrono::NaiveDateTime;
108
use pipe::{pipe, PipeReader, PipeWriter};
9+
use std::io::Read;
1110
use streaming_zip::{Archive, CompressionMode};
1211
use uuid::Uuid;
1312

@@ -37,7 +36,7 @@ pub struct ZipUpload<'a> {
3736
s3_client: &'a aws_sdk_s3::Client,
3837
}
3938

40-
impl<'a> std::fmt::Debug for ZipUpload<'a> {
39+
impl std::fmt::Debug for ZipUpload<'_> {
4140
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4241
f.debug_struct("ZipUpload")
4342
.field("key", &self.key)
@@ -117,9 +116,9 @@ impl<'a> ZipUploadBuilder<'a> {
117116
}
118117
}
119118

120-
impl<'a> ZipUpload<'a> {
119+
impl ZipUpload<'_> {
121120
// Start a builder for the ZipUpload.
122-
pub fn builder(common: &'a Common) -> ZipUploadBuilder {
121+
pub fn builder(common: &Common) -> ZipUploadBuilder {
123122
ZipUploadBuilder {
124123
key: None,
125124
bucket: None,

examples/cross_service/rest_ses/src/client.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl AsRef<str> for Email {
9696
}
9797
}
9898

99-
impl<'a> From<Email> for Address<'a> {
99+
impl From<Email> for Address<'_> {
100100
fn from(email: Email) -> Self {
101101
email.0.into()
102102
}

examples/cross_service/rest_ses/src/work_item/work_item_archived.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ impl<'de> Deserialize<'de> for WorkItemArchived {
104104
/// The RDS table encodes status as 1 and 0.
105105
/// This serde visit handles those disparate cases, using the try_from impls.
106106
struct Visitor;
107-
impl<'de> de::Visitor<'de> for Visitor {
107+
impl de::Visitor<'_> for Visitor {
108108
type Value = WorkItemArchived;
109109

110110
fn visit_u64<E>(self, value: u64) -> Result<Self::Value, E>

examples/examples/bedrock-runtime/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ edition = "2021"
66
publish = false
77

88
[dependencies]
9+
aws-config = { version = "1.5.11", path = "../../../sdk/aws-config" }
10+
aws-sdk-bedrockruntime = { version = "1.65.0", path = "../../../sdk/bedrockruntime" }
11+
aws-smithy-runtime-api = { version = "1.7.3", path = "../../../sdk/aws-smithy-runtime-api" }
12+
aws-smithy-types = { version = "1.2.10", path = "../../../sdk/aws-smithy-types" }
913
reqwest = "0.12.5"
1014
serde = "1.0.204"
1115
serde_json = "1.0.120"
1216
tracing = "0.1.40"
1317
tracing-subscriber = "0.3.18"
14-
aws-config= { version = "1.5.11", path = "../../../sdk/aws-config" }
15-
aws-sdk-bedrockruntime= { version = "1.65.0", path = "../../../sdk/bedrockruntime" }
16-
aws-smithy-runtime-api= { version = "1.7.3", path = "../../../sdk/aws-smithy-runtime-api" }
17-
aws-smithy-types= { version = "1.2.10", path = "../../../sdk/aws-smithy-types" }
1818

1919
[dependencies.tokio]
2020
version = "1.38.1"

examples/examples/bedrock-runtime/src/bin/tool-use.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
33

4+
//! This demo illustrates a tool use scenario using Amazon Bedrock's Converse API and a weather tool.
5+
//! The script interacts with a foundation model on Amazon Bedrock to provide weather information based on user
6+
//! input. It uses the Open-Meteo API (https://open-meteo.com) to retrieve current weather data for a given location.
7+
48
// snippet-start:[rust.bedrock-runtime.Converse_AnthropicClaude.tool-use.supporting]
59
use std::{collections::HashMap, io::stdin};
610

@@ -19,10 +23,6 @@ use aws_smithy_runtime_api::http::Response;
1923
use aws_smithy_types::Document;
2024
use tracing::debug;
2125

22-
/// This demo illustrates a tool use scenario using Amazon Bedrock's Converse API and a weather tool.
23-
/// The script interacts with a foundation model on Amazon Bedrock to provide weather information based on user
24-
/// input. It uses the Open-Meteo API (https://open-meteo.com) to retrieve current weather data for a given location.
25-
2626
// Set the model ID, e.g., Claude 3 Haiku.
2727
const MODEL_ID: &str = "anthropic.claude-3-haiku-20240307-v1:0";
2828
const CLAUDE_REGION: &str = "us-east-1";

examples/examples/cloudwatchlogs/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ path = "../../test-utils"
3232
version = "0.1.0"
3333

3434
[dev-dependencies]
35-
aws-smithy-mocks-experimental= { version = "0.2.1", path = "../../../sdk/aws-smithy-mocks-experimental" }
35+
aws-smithy-mocks-experimental = { version = "0.2.1", path = "../../../sdk/aws-smithy-mocks-experimental" }

examples/examples/ec2/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ publish = false
88

99
[dependencies]
1010
tracing = "0.1.40"
11+
aws-smithy-runtime-api = { version = "1.7.3", path = "../../../sdk/aws-smithy-runtime-api" }
1112
mockall = "0.13.0"
1213
inquire = "0.7.5"
1314
reqwest = "0.12.5"
14-
aws-smithy-runtime-api= { version = "1.7.3", path = "../../../sdk/aws-smithy-runtime-api" }
15-
aws-sdk-ssm= { version = "1.57.0", path = "../../../sdk/ssm" }
16-
aws-smithy-async= { version = "1.2.2", path = "../../../sdk/aws-smithy-async" }
15+
aws-sdk-ssm = { version = "1.57.0", path = "../../../sdk/ssm" }
16+
aws-smithy-async = { version = "1.2.2", path = "../../../sdk/aws-smithy-async" }
1717
aws-config= { version = "1.5.11", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] }
1818
aws-sdk-ec2= { version = "1.98.0", path = "../../../sdk/ec2" }
1919
aws-types= { version = "1.3.3", path = "../../../sdk/aws-types" }

examples/examples/s3/src/bin/select-object-content.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ struct Opt {
2525
bucket: String,
2626

2727
/// The object key to scan. This example expects the object to be an uncompressed CSV file with:
28-
28+
///
2929
/// Name,PhoneNumber,City,Occupation
3030
/// Person1,(nnn) nnn-nnnn,City1,Occupation1,Comment
3131
/// ...

examples/examples/ses/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ publish = false
1010
anyhow = "1.0.81"
1111
tracing = "0.1.40"
1212
tmpfile = "0.0.2"
13+
aws-smithy-http = { version = "0.60.11", path = "../../../sdk/aws-smithy-http" }
14+
aws-smithy-mocks-experimental = { version = "0.2.1", path = "../../../sdk/aws-smithy-mocks-experimental" }
1315
open = "5.1.2"
14-
aws-smithy-http= { version = "0.60.11", path = "../../../sdk/aws-smithy-http" }
15-
aws-smithy-mocks-experimental= { version = "0.2.1", path = "../../../sdk/aws-smithy-mocks-experimental" }
1616
aws-config= { version = "1.5.11", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] }
1717
aws-sdk-sesv2= { version = "1.58.0", path = "../../../sdk/sesv2", features = ["test-util"] }
1818

versions.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
smithy_rs_revision = 'd1734ecf3d17b376c4d20b2401b45a028309b165'
2-
aws_doc_sdk_examples_revision = '87d4a25d2b6ee53eecba3832dcca4e9954ee0ceb'
2+
aws_doc_sdk_examples_revision = '46c2187478902e72891354b87435d7c72fe20680'
33

44
[manual_interventions]
55
crates_to_remove = []

0 commit comments

Comments
 (0)