Skip to content

Commit

Permalink
SDK Import 6/1/2021 target v0.0.6-alpha (#95)
Browse files Browse the repository at this point in the history
* Update AWS_SERVICES_SUPPORTED.md and README.md

* SDK Import smithy-rs v0.11
  • Loading branch information
rcoh committed Jun 1, 2021
1 parent 86cbc50 commit b0049d2
Show file tree
Hide file tree
Showing 222 changed files with 96,516 additions and 28,759 deletions.
4 changes: 2 additions & 2 deletions AWS_SERVICES_SUPPORTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ The alpha SDK for Rust currently supports the checked services below. If you wan
- [X] Amazon Lambda
- [x] [Amazon S3](https://github.com/awslabs/aws-sdk-rust/issues/16)
- [x] [Amazon SSM](https://github.com/awslabs/aws-sdk-rust/issues/22)
- [x] [Amazon SQS](https://github.com/awslabs/aws-sdk-rust/issues/19)
- [x] [Amazon ECS](https://github.com/awslabs/aws-sdk-rust/issues/28)

------
- [ ] Amazon Access Analyzer
Expand Down Expand Up @@ -88,7 +90,6 @@ The alpha SDK for Rust currently supports the checked services below. If you wan
- [ ] [Amazon Ec2](https://github.com/awslabs/aws-sdk-rust/issues/18)
- [ ] Amazon Ec2-Instance-Connect
- [ ] [Amazon ECR](https://github.com/awslabs/aws-sdk-rust/issues/34)
- [ ] [Amazon ECS](https://github.com/awslabs/aws-sdk-rust/issues/28)
- [ ] Amazon Eks
- [ ] Amazon Elasticache
- [ ] Amazon Elastic Beanstalk
Expand Down Expand Up @@ -218,7 +219,6 @@ The alpha SDK for Rust currently supports the checked services below. If you wan
- [ ] Amazon Sms-Voice
- [ ] Amazon Snowball
- [ ] [Amazon SNS](https://github.com/awslabs/aws-sdk-rust/issues/26)
- [ ] [Amazon SQS](https://github.com/awslabs/aws-sdk-rust/issues/19)
- [ ] Amazon SSO
- [ ] Amazon Sso-Admin
- [ ] Amazon Sso-Oidc
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The new AWS SDK for Rust is built with one crate per AWS service. [Tokio](https:

```toml
[dependencies]
dynamodb = { git = "https://github.com/awslabs/aws-sdk-rust", tag = "v0.0.4-alpha", package = "aws-sdk-dynamodb" }
dynamodb = { git = "https://github.com/awslabs/aws-sdk-rust", tag = "v0.0.6-alpha", package = "aws-sdk-dynamodb" }
tokio = { version = "1", features = ["full"] }
```
3. Provide your AWS credentials as environment variables:
Expand Down
2 changes: 1 addition & 1 deletion sdk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[workspace]
members = [
"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"
"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"
]
4 changes: 3 additions & 1 deletion sdk/apigateway/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
[package]
name = "aws-sdk-apigateway"
version = "0.0.5-alpha"
version = "0.0.6-alpha"
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>"
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>", "Russell Cohen <rcoh@amazon.com>"]
license = "Apache-2.0"
Expand Down Expand Up @@ -34,6 +34,8 @@ version = "1"
[dependencies.serde_json]
version = "1"
features = ["float_roundtrip"]
[dependencies.smithy-json]
path = "..//smithy-json"
[features]
client = ["aws-hyper"]
rustls = ["aws-hyper/rustls"]
Expand Down
45 changes: 23 additions & 22 deletions sdk/apigateway/src/aws_json_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,30 @@ pub fn parse_generic_error<B>(
response: &http::Response<B>,
body: &serde_json::Value,
) -> smithy_types::Error {
let mut err_builder = smithy_types::Error::builder();
let code = error_type_from_header(&response)
.unwrap_or(Some("header was not valid UTF-8"))
.or_else(|| error_type_from_body(body))
.map(|s| sanitize_error_code(s).to_string());
.map(|s| sanitize_error_code(s));
if let Some(code) = code {
err_builder.code(code);
}
let message = body
.get("message")
.or_else(|| body.get("Message"))
.or_else(|| body.get("errorMessage"))
.and_then(|v| v.as_str())
.map(|s| s.to_string());
.and_then(|v| v.as_str());
if let Some(message) = message {
err_builder.message(message);
}
let request_id = response
.headers()
.get("X-Amzn-Requestid")
.and_then(|v| v.to_str().ok())
.map(|s| s.to_string());
smithy_types::Error {
code,
message,
request_id,
.and_then(|v| v.to_str().ok());
if let Some(request_id) = request_id {
err_builder.request_id(request_id);
}
err_builder.build()
}

#[cfg(test)]
Expand All @@ -85,11 +89,11 @@ mod test {
.unwrap();
assert_eq!(
parse_generic_error(&response, response.body()),
Error {
code: Some("FooError".to_string()),
message: Some("Go to foo".to_string()),
request_id: Some("1234".to_string()),
}
Error::builder()
.code("FooError")
.message("Go to foo")
.request_id("1234")
.build()
)
}

Expand Down Expand Up @@ -152,13 +156,10 @@ mod test {
.unwrap();
assert_eq!(
parse_generic_error(&response, response.body()),
Error {
code: Some("ResourceNotFoundException".to_string()),
message: Some(
"Functions from 'us-west-2' are not reachable from us-east-1".to_string()
),
request_id: None,
}
)
Error::builder()
.code("ResourceNotFoundException")
.message("Functions from 'us-west-2' are not reachable from us-east-1")
.build()
);
}
}

0 comments on commit b0049d2

Please sign in to comment.