Skip to content

Commit e6c354f

Browse files
[examples] Sync SDK examples from awsdocs/aws-doc-sdk-examples
Includes commit(s): 7a22a0314672afe7c6818fcff083c724c40f4d47 Co-authored-by: David Souther <[email protected]>
1 parent 581c441 commit e6c354f

File tree

6 files changed

+20
-19
lines changed

6 files changed

+20
-19
lines changed

examples/examples/bedrock-runtime/Cargo.toml

Lines changed: 4 additions & 4 deletions
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.5", path = "../../../sdk/aws-config" }
10+
aws-sdk-bedrockruntime = { version = "1.43.0", path = "../../../sdk/bedrockruntime" }
11+
aws-smithy-runtime-api = { version = "1.7.2", path = "../../../sdk/aws-smithy-runtime-api" }
12+
aws-smithy-types = { version = "1.2.0", 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.5", path = "../../../sdk/aws-config" }
15-
aws-sdk-bedrockruntime= { version = "1.43.0", path = "../../../sdk/bedrockruntime" }
16-
aws-smithy-runtime-api= { version = "1.7.2", path = "../../../sdk/aws-smithy-runtime-api" }
17-
aws-smithy-types= { version = "1.2.0", path = "../../../sdk/aws-smithy-types" }
1818

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

examples/examples/cloudwatchlogs/Cargo.toml

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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.2", 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.2", path = "../../../sdk/aws-smithy-runtime-api" }
15-
aws-sdk-ssm= { version = "1.42.0", path = "../../../sdk/ssm" }
16-
aws-smithy-async= { version = "1.2.1", path = "../../../sdk/aws-smithy-async" }
15+
aws-sdk-ssm = { version = "1.42.0", path = "../../../sdk/ssm" }
16+
aws-smithy-async = { version = "1.2.1", path = "../../../sdk/aws-smithy-async" }
1717
aws-config= { version = "1.5.5", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] }
1818
aws-sdk-ec2= { version = "1.65.0", path = "../../../sdk/ec2" }
1919
aws-types= { version = "1.3.3", path = "../../../sdk/aws-types" }

examples/examples/ses/Cargo.toml

Lines changed: 2 additions & 2 deletions
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.9", 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.9", 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.5", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] }
1717
aws-sdk-sesv2= { version = "1.40.0", path = "../../../sdk/sesv2", features = ["test-util"] }
1818

examples/webassembly/src/lib.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,15 @@ impl MakeRequestBrowser for BrowserHttpClient {
152152
use js_sys::{Array, ArrayBuffer, Reflect, Uint8Array};
153153
use wasm_bindgen_futures::JsFuture;
154154

155-
let mut opts = web_sys::RequestInit::new();
156-
opts.method(req.method());
157-
opts.mode(web_sys::RequestMode::Cors);
158-
159-
let body_pinned = std::pin::Pin::new(req.body().bytes().unwrap());
160-
if body_pinned.len() > 0 {
161-
let uint_8_array = unsafe { Uint8Array::view(&body_pinned) };
162-
opts.body(Some(&uint_8_array));
155+
let opts = web_sys::RequestInit::new();
156+
opts.set_method(req.method());
157+
opts.set_mode(web_sys::RequestMode::Cors);
158+
159+
if let Some(body) = req.body().bytes() {
160+
let body_str =
161+
String::from_utf8(body.into()).map_err(|e| JsValue::from_str(&format!("{e:?}")))?;
162+
let js_body = JsValue::from_str(&body_str);
163+
opts.set_body(&js_body);
163164
}
164165

165166
let request = web_sys::Request::new_with_str_and_init(req.uri(), &opts)?;

versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
smithy_rs_revision = 'c1eeb4eacd8347991b5a7442688b135a67871069'
2-
aws_doc_sdk_examples_revision = '3bd4107474f9fdeac4e54e250506e59f2cc3701f'
2+
aws_doc_sdk_examples_revision = '7a22a0314672afe7c6818fcff083c724c40f4d47'
33

44
[manual_interventions]
55
crates_to_remove = []

0 commit comments

Comments
 (0)