Skip to content

Commit

Permalink
[examples] Sync SDK examples from awsdocs/aws-doc-sdk-examples
Browse files Browse the repository at this point in the history
Includes commit(s):
  7a22a0314672afe7c6818fcff083c724c40f4d47

Co-authored-by: David Souther <[email protected]>
  • Loading branch information
aws-sdk-rust-ci and DavidSouther committed Aug 14, 2024
1 parent 581c441 commit e6c354f
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 19 deletions.
8 changes: 4 additions & 4 deletions examples/examples/bedrock-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ edition = "2021"
publish = false

[dependencies]
aws-config = { version = "1.5.5", path = "../../../sdk/aws-config" }
aws-sdk-bedrockruntime = { version = "1.43.0", path = "../../../sdk/bedrockruntime" }
aws-smithy-runtime-api = { version = "1.7.2", path = "../../../sdk/aws-smithy-runtime-api" }
aws-smithy-types = { version = "1.2.0", path = "../../../sdk/aws-smithy-types" }
reqwest = "0.12.5"
serde = "1.0.204"
serde_json = "1.0.120"
tracing = "0.1.40"
tracing-subscriber = "0.3.18"
aws-config= { version = "1.5.5", path = "../../../sdk/aws-config" }
aws-sdk-bedrockruntime= { version = "1.43.0", path = "../../../sdk/bedrockruntime" }
aws-smithy-runtime-api= { version = "1.7.2", path = "../../../sdk/aws-smithy-runtime-api" }
aws-smithy-types= { version = "1.2.0", path = "../../../sdk/aws-smithy-types" }

[dependencies.tokio]
version = "1.38.1"
Expand Down
2 changes: 1 addition & 1 deletion examples/examples/cloudwatchlogs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ path = "../../test-utils"
version = "0.1.0"

[dev-dependencies]
aws-smithy-mocks-experimental= { version = "0.2.1", path = "../../../sdk/aws-smithy-mocks-experimental" }
aws-smithy-mocks-experimental = { version = "0.2.1", path = "../../../sdk/aws-smithy-mocks-experimental" }
6 changes: 3 additions & 3 deletions examples/examples/ec2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ publish = false

[dependencies]
tracing = "0.1.40"
aws-smithy-runtime-api = { version = "1.7.2", path = "../../../sdk/aws-smithy-runtime-api" }
mockall = "0.13.0"
inquire = "0.7.5"
reqwest = "0.12.5"
aws-smithy-runtime-api= { version = "1.7.2", path = "../../../sdk/aws-smithy-runtime-api" }
aws-sdk-ssm= { version = "1.42.0", path = "../../../sdk/ssm" }
aws-smithy-async= { version = "1.2.1", path = "../../../sdk/aws-smithy-async" }
aws-sdk-ssm = { version = "1.42.0", path = "../../../sdk/ssm" }
aws-smithy-async = { version = "1.2.1", path = "../../../sdk/aws-smithy-async" }
aws-config= { version = "1.5.5", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] }
aws-sdk-ec2= { version = "1.65.0", path = "../../../sdk/ec2" }
aws-types= { version = "1.3.3", path = "../../../sdk/aws-types" }
Expand Down
4 changes: 2 additions & 2 deletions examples/examples/ses/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ publish = false
anyhow = "1.0.81"
tracing = "0.1.40"
tmpfile = "0.0.2"
aws-smithy-http = { version = "0.60.9", path = "../../../sdk/aws-smithy-http" }
aws-smithy-mocks-experimental = { version = "0.2.1", path = "../../../sdk/aws-smithy-mocks-experimental" }
open = "5.1.2"
aws-smithy-http= { version = "0.60.9", path = "../../../sdk/aws-smithy-http" }
aws-smithy-mocks-experimental= { version = "0.2.1", path = "../../../sdk/aws-smithy-mocks-experimental" }
aws-config= { version = "1.5.5", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] }
aws-sdk-sesv2= { version = "1.40.0", path = "../../../sdk/sesv2", features = ["test-util"] }

Expand Down
17 changes: 9 additions & 8 deletions examples/webassembly/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,15 @@ impl MakeRequestBrowser for BrowserHttpClient {
use js_sys::{Array, ArrayBuffer, Reflect, Uint8Array};
use wasm_bindgen_futures::JsFuture;

let mut opts = web_sys::RequestInit::new();
opts.method(req.method());
opts.mode(web_sys::RequestMode::Cors);

let body_pinned = std::pin::Pin::new(req.body().bytes().unwrap());
if body_pinned.len() > 0 {
let uint_8_array = unsafe { Uint8Array::view(&body_pinned) };
opts.body(Some(&uint_8_array));
let opts = web_sys::RequestInit::new();
opts.set_method(req.method());
opts.set_mode(web_sys::RequestMode::Cors);

if let Some(body) = req.body().bytes() {
let body_str =
String::from_utf8(body.into()).map_err(|e| JsValue::from_str(&format!("{e:?}")))?;
let js_body = JsValue::from_str(&body_str);
opts.set_body(&js_body);
}

let request = web_sys::Request::new_with_str_and_init(req.uri(), &opts)?;
Expand Down
2 changes: 1 addition & 1 deletion versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
smithy_rs_revision = 'c1eeb4eacd8347991b5a7442688b135a67871069'
aws_doc_sdk_examples_revision = '3bd4107474f9fdeac4e54e250506e59f2cc3701f'
aws_doc_sdk_examples_revision = '7a22a0314672afe7c6818fcff083c724c40f4d47'

[manual_interventions]
crates_to_remove = []
Expand Down

0 comments on commit e6c354f

Please sign in to comment.