Unverified Commit 42c1f215 authored by Russell Cohen's avatar Russell Cohen Committed by GitHub
Browse files

Http Protocol Refactor & Streaming Request bodies (breaking change) (#359)

* Refactor HttpProtocolGenerator body construction

* Well that was easy... (add streaming input support)

* Fix tests, clippy warning

* One more clippy wrap ignore

* Fix test that used private API

* Add test for default value
parent 99693db0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ extra["moduleName"] = "software.amazon.smithy.kotlin.codegen.test"
tasks["jar"].enabled = false

plugins {
    id("software.amazon.smithy").version("0.5.2")
    id("software.amazon.smithy").version("0.5.3")
}

val smithyVersion: String by project
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ extra["moduleName"] = "software.amazon.smithy.rust.awssdk"
tasks["jar"].enabled = false

plugins {
    id("software.amazon.smithy").version("0.5.2")
    id("software.amazon.smithy").version("0.5.3")
}

val smithyVersion: String by project
+1 −0
Original line number Diff line number Diff line
@@ -17,3 +17,4 @@ aws-auth = { path = "../../build/aws-sdk/aws-auth" }
aws-http = { path = "../../build/aws-sdk/aws-http" }
tokio = { version = "1", features = ["full"]}
tracing-subscriber = "0.2.16"
bytes = "1"
+8 −4
Original line number Diff line number Diff line
@@ -5,12 +5,14 @@

use aws_http::AwsErrorRetryPolicy;
use aws_sdk_kms as kms;
use bytes::Bytes;
use kms::error::CreateAliasError;
use kms::operation::{CreateAlias, GenerateRandom};
use kms::output::GenerateRandomOutput;
use kms::Blob;
use smithy_http::body::SdkBody;
use smithy_http::operation::Parts;
use smithy_http::response::ParseStrictResponse;
use smithy_http::result::SdkError;
use smithy_http::retry::ClassifyResponse;
use smithy_types::retry::{ErrorKind, RetryKind};
@@ -69,11 +71,13 @@ fn errors_are_retryable() {
    let op = create_alias_op();
    let http_response = http::Response::builder()
        .status(400)
        .body(r#"{ "code": "LimitExceededException" }"#)
        .body(Bytes::from_static(
            br#"{ "code": "LimitExceededException" }"#,
        ))
        .unwrap();
    let err = op
        .response_handler
        .parse_response(&http_response)
        .parse(&http_response)
        .map_err(|e| SdkError::ServiceError {
            err: e,
            raw: http_response.map(SdkBody::from),
@@ -87,11 +91,11 @@ fn unmodeled_errors_are_retryable() {
    let op = create_alias_op();
    let http_response = http::Response::builder()
        .status(400)
        .body(r#"{ "code": "ThrottlingException" }"#)
        .body(Bytes::from_static(br#"{ "code": "ThrottlingException" }"#))
        .unwrap();
    let err = op
        .response_handler
        .parse_response(&http_response)
        .parse(&http_response)
        .map_err(|e| SdkError::ServiceError {
            err: e,
            raw: http_response.map(SdkBody::from),
+1 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ extra["moduleName"] = "software.amazon.smithy.kotlin.codegen.test"
tasks["jar"].enabled = false

plugins {
    id("software.amazon.smithy").version("0.5.2")
    id("software.amazon.smithy").version("0.5.3")
}

val smithyVersion: String by project
Loading