Skip to content

Commit b0049d2

Browse files
authored
SDK Import 6/1/2021 target v0.0.6-alpha (#95)
* Update AWS_SERVICES_SUPPORTED.md and README.md * SDK Import smithy-rs v0.11
1 parent 86cbc50 commit b0049d2

File tree

222 files changed

+96516
-28759
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

222 files changed

+96516
-28759
lines changed

AWS_SERVICES_SUPPORTED.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ The alpha SDK for Rust currently supports the checked services below. If you wan
1414
- [X] Amazon Lambda
1515
- [x] [Amazon S3](https://github.com/awslabs/aws-sdk-rust/issues/16)
1616
- [x] [Amazon SSM](https://github.com/awslabs/aws-sdk-rust/issues/22)
17+
- [x] [Amazon SQS](https://github.com/awslabs/aws-sdk-rust/issues/19)
18+
- [x] [Amazon ECS](https://github.com/awslabs/aws-sdk-rust/issues/28)
1719

1820
------
1921
- [ ] Amazon Access Analyzer
@@ -88,7 +90,6 @@ The alpha SDK for Rust currently supports the checked services below. If you wan
8890
- [ ] [Amazon Ec2](https://github.com/awslabs/aws-sdk-rust/issues/18)
8991
- [ ] Amazon Ec2-Instance-Connect
9092
- [ ] [Amazon ECR](https://github.com/awslabs/aws-sdk-rust/issues/34)
91-
- [ ] [Amazon ECS](https://github.com/awslabs/aws-sdk-rust/issues/28)
9293
- [ ] Amazon Eks
9394
- [ ] Amazon Elasticache
9495
- [ ] Amazon Elastic Beanstalk
@@ -218,7 +219,6 @@ The alpha SDK for Rust currently supports the checked services below. If you wan
218219
- [ ] Amazon Sms-Voice
219220
- [ ] Amazon Snowball
220221
- [ ] [Amazon SNS](https://github.com/awslabs/aws-sdk-rust/issues/26)
221-
- [ ] [Amazon SQS](https://github.com/awslabs/aws-sdk-rust/issues/19)
222222
- [ ] Amazon SSO
223223
- [ ] Amazon Sso-Admin
224224
- [ ] Amazon Sso-Oidc

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The new AWS SDK for Rust is built with one crate per AWS service. [Tokio](https:
1515

1616
```toml
1717
[dependencies]
18-
dynamodb = { git = "https://github.com/awslabs/aws-sdk-rust", tag = "v0.0.4-alpha", package = "aws-sdk-dynamodb" }
18+
dynamodb = { git = "https://github.com/awslabs/aws-sdk-rust", tag = "v0.0.6-alpha", package = "aws-sdk-dynamodb" }
1919
tokio = { version = "1", features = ["full"] }
2020
```
2121
3. Provide your AWS credentials as environment variables:

sdk/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[workspace]
22
members = [
3-
"qldb","qldbsession","secretsmanager","kms","dynamodb","kinesis","polly","ssm","lambda","apigateway","s3","smithy-types","smithy-xml","smithy-http","smithy-http-tower","protocol-test-helpers","aws-auth","aws-endpoint","aws-types","aws-hyper","aws-sig-auth","aws-http","examples/lambda-list-functions","examples/polly-synthesize-speech","examples/secretsmanager-helloworld","examples/polly-describe-voices","examples/ssm-put-parameter","examples/polly-list-lexicons","examples/kinesis-create-stream","examples/polly-helloworld","examples/lambda-invoke-function","examples/kinesis-list-streams","examples/qldbsession-helloworld","examples/kinesis-describe-stream","examples/dynamo-create-table","examples/dynamo-list-items","examples/kinesis-put-record","examples/secretsmanager-get-secret-value","examples/dynamo-movies","examples/secretsmanager-create-secret","examples/dynamo-delete-item","examples/kinesis-delete-stream","examples/secretsmanager-list-secrets","examples/s3-helloworld","examples/dynamo-add-item","examples/dynamo-delete-table","examples/polly-put-lexicon","examples/dynamo-helloworld","examples/dynamo-list-tables","examples/kms-helloworld","examples/qldb-list-ledgers"
3+
"qldb","qldbsession","sqs","secretsmanager","kms","dynamodb","kinesis","polly","ecs","ssm","lambda","apigateway","s3","smithy-types","smithy-json","smithy-query","smithy-xml","smithy-http","smithy-http-tower","protocol-test-helpers","aws-auth","aws-endpoint","aws-types","aws-hyper","aws-sig-auth","aws-http","examples/lambda-list-functions","examples/polly-synthesize-speech","examples/secretsmanager-helloworld","examples/polly-describe-voices","examples/ssm-put-parameter","examples/polly-list-lexicons","examples/kinesis-create-stream","examples/polly-helloworld","examples/lambda-invoke-function","examples/ecs","examples/sqs","examples/kinesis-list-streams","examples/qldbsession-helloworld","examples/kinesis-describe-stream","examples/dynamo-create-table","examples/dynamo-list-items","examples/kinesis-put-record","examples/secretsmanager-get-secret-value","examples/dynamo-movies","examples/secretsmanager-create-secret","examples/dynamo-delete-item","examples/kinesis-delete-stream","examples/secretsmanager-list-secrets","examples/s3-helloworld","examples/dynamo-add-item","examples/dynamo-delete-table","examples/polly-put-lexicon","examples/dynamo-helloworld","examples/dynamo-list-tables","examples/kms-helloworld","examples/qldb-list-ledgers"
44
]

sdk/apigateway/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
22
[package]
33
name = "aws-sdk-apigateway"
4-
version = "0.0.5-alpha"
4+
version = "0.0.6-alpha"
55
description = "<fullname>Amazon API Gateway</fullname>\n <p>Amazon API Gateway helps developers deliver robust, secure, and scalable mobile and web application back ends. API Gateway allows developers to securely connect mobile and web applications to APIs that run on AWS Lambda, Amazon EC2, or other publicly addressable web services that are hosted outside of AWS.</p>"
66
authors = ["AWS Rust SDK Team <[email protected]>", "Russell Cohen <[email protected]>"]
77
license = "Apache-2.0"
@@ -34,6 +34,8 @@ version = "1"
3434
[dependencies.serde_json]
3535
version = "1"
3636
features = ["float_roundtrip"]
37+
[dependencies.smithy-json]
38+
path = "..//smithy-json"
3739
[features]
3840
client = ["aws-hyper"]
3941
rustls = ["aws-hyper/rustls"]

sdk/apigateway/src/aws_json_errors.rs

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -46,26 +46,30 @@ pub fn parse_generic_error<B>(
4646
response: &http::Response<B>,
4747
body: &serde_json::Value,
4848
) -> smithy_types::Error {
49+
let mut err_builder = smithy_types::Error::builder();
4950
let code = error_type_from_header(&response)
5051
.unwrap_or(Some("header was not valid UTF-8"))
5152
.or_else(|| error_type_from_body(body))
52-
.map(|s| sanitize_error_code(s).to_string());
53+
.map(|s| sanitize_error_code(s));
54+
if let Some(code) = code {
55+
err_builder.code(code);
56+
}
5357
let message = body
5458
.get("message")
5559
.or_else(|| body.get("Message"))
5660
.or_else(|| body.get("errorMessage"))
57-
.and_then(|v| v.as_str())
58-
.map(|s| s.to_string());
61+
.and_then(|v| v.as_str());
62+
if let Some(message) = message {
63+
err_builder.message(message);
64+
}
5965
let request_id = response
6066
.headers()
6167
.get("X-Amzn-Requestid")
62-
.and_then(|v| v.to_str().ok())
63-
.map(|s| s.to_string());
64-
smithy_types::Error {
65-
code,
66-
message,
67-
request_id,
68+
.and_then(|v| v.to_str().ok());
69+
if let Some(request_id) = request_id {
70+
err_builder.request_id(request_id);
6871
}
72+
err_builder.build()
6973
}
7074

7175
#[cfg(test)]
@@ -85,11 +89,11 @@ mod test {
8589
.unwrap();
8690
assert_eq!(
8791
parse_generic_error(&response, response.body()),
88-
Error {
89-
code: Some("FooError".to_string()),
90-
message: Some("Go to foo".to_string()),
91-
request_id: Some("1234".to_string()),
92-
}
92+
Error::builder()
93+
.code("FooError")
94+
.message("Go to foo")
95+
.request_id("1234")
96+
.build()
9397
)
9498
}
9599

@@ -152,13 +156,10 @@ mod test {
152156
.unwrap();
153157
assert_eq!(
154158
parse_generic_error(&response, response.body()),
155-
Error {
156-
code: Some("ResourceNotFoundException".to_string()),
157-
message: Some(
158-
"Functions from 'us-west-2' are not reachable from us-east-1".to_string()
159-
),
160-
request_id: None,
161-
}
162-
)
159+
Error::builder()
160+
.code("ResourceNotFoundException")
161+
.message("Functions from 'us-west-2' are not reachable from us-east-1")
162+
.build()
163+
);
163164
}
164165
}

0 commit comments

Comments
 (0)