Server Test

Server Test

rev. 1e97119a72cca00d8bb36bfb45586578ea2adb4d

Files changed:

tmp-codegen-diff/codegen-server-test/constraints/rust-server-codegen/src/protocol_serde/shape_event_streams_operation_input.rs

@@ -1,1 +12,14 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub fn de_events_payload(
    3      3   
    body: &mut ::aws_smithy_types::body::SdkBody,
    4      4   
) -> std::result::Result<
    5      5   
    ::aws_smithy_http::event_stream::Receiver<crate::model::Event, crate::error::EventError>,
    6      6   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      7   
> {
    8      8   
    let unmarshaller = crate::event_stream_serde::EventUnmarshaller::new();
    9      9   
    let body = std::mem::replace(body, ::aws_smithy_types::body::SdkBody::taken());
   10         -
    let receiver = ::aws_smithy_http::event_stream::Receiver::new(unmarshaller, body);
   11         -
    Ok(receiver)
          10  +
    Ok(::aws_smithy_http::event_stream::Receiver::new(
          11  +
        unmarshaller,
          12  +
        body,
          13  +
    ))
   12     14   
}

tmp-codegen-diff/codegen-server-test/constraints_without_public_constrained_types/rust-server-codegen/src/protocol_serde/shape_event_streams_operation_input.rs

@@ -1,1 +12,14 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub fn de_events_payload(
    3      3   
    body: &mut ::aws_smithy_types::body::SdkBody,
    4      4   
) -> std::result::Result<
    5      5   
    ::aws_smithy_http::event_stream::Receiver<crate::model::Event, crate::error::EventError>,
    6      6   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      7   
> {
    8      8   
    let unmarshaller = crate::event_stream_serde::EventUnmarshaller::new();
    9      9   
    let body = std::mem::replace(body, ::aws_smithy_types::body::SdkBody::taken());
   10         -
    let receiver = ::aws_smithy_http::event_stream::Receiver::new(unmarshaller, body);
   11         -
    Ok(receiver)
          10  +
    Ok(::aws_smithy_http::event_stream::Receiver::new(
          11  +
        unmarshaller,
          12  +
        body,
          13  +
    ))
   12     14   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk/rust-server-codegen/src/protocol_serde/shape_capture_pokemon_input.rs

@@ -1,1 +15,17 @@
    3      3   
    body: &mut ::aws_smithy_types::body::SdkBody,
    4      4   
) -> std::result::Result<
    5      5   
    ::aws_smithy_http::event_stream::Receiver<
    6      6   
        crate::model::AttemptCapturingPokemonEvent,
    7      7   
        crate::error::AttemptCapturingPokemonEventError,
    8      8   
    >,
    9      9   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   10     10   
> {
   11     11   
    let unmarshaller = crate::event_stream_serde::AttemptCapturingPokemonEventUnmarshaller::new();
   12     12   
    let body = std::mem::replace(body, ::aws_smithy_types::body::SdkBody::taken());
   13         -
    let receiver = ::aws_smithy_http::event_stream::Receiver::new(unmarshaller, body);
   14         -
    Ok(receiver)
          13  +
    Ok(::aws_smithy_http::event_stream::Receiver::new(
          14  +
        unmarshaller,
          15  +
        body,
          16  +
    ))
   15     17   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk/rust-server-codegen/src/protocol_serde/shape_capture_pokemon_input.rs

@@ -1,1 +27,29 @@
    3      3   
    body: &mut ::aws_smithy_types::body::SdkBody,
    4      4   
) -> std::result::Result<
    5      5   
    ::aws_smithy_http::event_stream::Receiver<
    6      6   
        crate::model::AttemptCapturingPokemonEvent,
    7      7   
        crate::error::AttemptCapturingPokemonEventError,
    8      8   
    >,
    9      9   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   10     10   
> {
   11     11   
    let unmarshaller = crate::event_stream_serde::AttemptCapturingPokemonEventUnmarshaller::new();
   12     12   
    let body = std::mem::replace(body, ::aws_smithy_types::body::SdkBody::taken());
   13         -
    let receiver = ::aws_smithy_http::event_stream::Receiver::new(unmarshaller, body);
   14         -
    Ok(receiver)
          13  +
    Ok(::aws_smithy_http::event_stream::Receiver::new(
          14  +
        unmarshaller,
          15  +
        body,
          16  +
    ))
   15     17   
}
   16     18   
   17     19   
pub fn de_region(
   18     20   
    value: &str,
   19     21   
) -> std::result::Result<
   20     22   
    ::std::string::String,
   21     23   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   22     24   
> {
   23     25   
    let value = ::percent_encoding::percent_decode_str(value)
   24     26   
        .decode_utf8()?

tmp-codegen-diff/codegen-server-test/rpcv2Cbor_extras/rust-server-codegen/Cargo.toml

@@ -1,1 +53,52 @@
   13     13   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-cbor"
   14     14   
[dependencies.aws-smithy-eventstream]
   15     15   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-eventstream"
   16     16   
[dependencies.aws-smithy-http]
   17     17   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-http"
   18     18   
features = ["event-stream"]
   19     19   
[dependencies.aws-smithy-http-server]
   20     20   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-http-server"
   21     21   
[dependencies.aws-smithy-runtime-api]
   22     22   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-runtime-api"
   23         -
features = ["client", "http-02x"]
   24     23   
[dependencies.aws-smithy-types]
   25     24   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-types"
   26     25   
[dependencies.bytes]
   27     26   
version = "1.4.0"
   28     27   
[dependencies.futures-util]
   29     28   
version = "0.3"
   30     29   
[dependencies.http]
   31     30   
version = "0.2.9"
   32     31   
[dependencies.hyper]
   33     32   
version = "0.14.26"

tmp-codegen-diff/codegen-server-test/rpcv2Cbor_extras/rust-server-codegen/src/input.rs

@@ -1,1 +150,166 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(missing_docs)] // documentation missing in model
    3      3   
#[derive(::std::fmt::Debug)]
    4      4   
pub struct StreamingOperationWithOptionalDataInput {
    5      5   
    #[allow(missing_docs)] // documentation missing in model
    6      6   
    pub optional_data: ::std::option::Option<::std::string::String>,
    7      7   
    #[allow(missing_docs)] // documentation missing in model
    8         -
    pub events: crate::sigv4_event_stream::SigV4Receiver<
    9         -
        crate::model::Events,
   10         -
        ::aws_smithy_http::event_stream::MessageStreamError,
           8  +
    pub events: ::aws_smithy_http::event_stream::Receiver<
           9  +
        crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
          10  +
        crate::sigv4_event_stream::SignedEventError<
          11  +
            ::aws_smithy_http::event_stream::MessageStreamError,
          12  +
        >,
   11     13   
    >,
   12     14   
}
   13     15   
impl StreamingOperationWithOptionalDataInput {
   14     16   
    #[allow(missing_docs)] // documentation missing in model
   15     17   
    pub fn optional_data(&self) -> ::std::option::Option<&str> {
   16     18   
        self.optional_data.as_deref()
   17     19   
    }
   18     20   
    #[allow(missing_docs)] // documentation missing in model
   19     21   
    pub fn events(
   20     22   
        &self,
   21         -
    ) -> &crate::sigv4_event_stream::SigV4Receiver<
   22         -
        crate::model::Events,
   23         -
        ::aws_smithy_http::event_stream::MessageStreamError,
          23  +
    ) -> &::aws_smithy_http::event_stream::Receiver<
          24  +
        crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
          25  +
        crate::sigv4_event_stream::SignedEventError<
          26  +
            ::aws_smithy_http::event_stream::MessageStreamError,
          27  +
        >,
   24     28   
    > {
   25     29   
        &self.events
   26     30   
    }
   27     31   
}
   28     32   
impl StreamingOperationWithOptionalDataInput {
   29     33   
    /// Creates a new builder-style object to manufacture [`StreamingOperationWithOptionalDataInput`](crate::input::StreamingOperationWithOptionalDataInput).
   30     34   
    pub fn builder() -> crate::input::streaming_operation_with_optional_data_input::Builder {
   31     35   
        crate::input::streaming_operation_with_optional_data_input::Builder::default()
   32     36   
    }
   33     37   
}
   34     38   
impl crate::constrained::Constrained for crate::input::StreamingOperationWithOptionalDataInput {
   35     39   
    type Unconstrained = crate::input::streaming_operation_with_optional_data_input::Builder;
   36     40   
}
   37     41   
   38     42   
#[allow(missing_docs)] // documentation missing in model
   39     43   
#[derive(::std::fmt::Debug)]
   40     44   
pub struct StreamingOperationWithInitialResponseInput {
   41     45   
    #[allow(missing_docs)] // documentation missing in model
   42         -
    pub events: crate::sigv4_event_stream::SigV4Receiver<
   43         -
        crate::model::Events,
   44         -
        ::aws_smithy_http::event_stream::MessageStreamError,
          46  +
    pub events: ::aws_smithy_http::event_stream::Receiver<
          47  +
        crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
          48  +
        crate::sigv4_event_stream::SignedEventError<
          49  +
            ::aws_smithy_http::event_stream::MessageStreamError,
          50  +
        >,
   45     51   
    >,
   46     52   
}
   47     53   
impl StreamingOperationWithInitialResponseInput {
   48     54   
    #[allow(missing_docs)] // documentation missing in model
   49     55   
    pub fn events(
   50     56   
        &self,
   51         -
    ) -> &crate::sigv4_event_stream::SigV4Receiver<
   52         -
        crate::model::Events,
   53         -
        ::aws_smithy_http::event_stream::MessageStreamError,
          57  +
    ) -> &::aws_smithy_http::event_stream::Receiver<
          58  +
        crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
          59  +
        crate::sigv4_event_stream::SignedEventError<
          60  +
            ::aws_smithy_http::event_stream::MessageStreamError,
          61  +
        >,
   54     62   
    > {
   55     63   
        &self.events
   56     64   
    }
   57     65   
}
   58     66   
impl StreamingOperationWithInitialResponseInput {
   59     67   
    /// Creates a new builder-style object to manufacture [`StreamingOperationWithInitialResponseInput`](crate::input::StreamingOperationWithInitialResponseInput).
   60     68   
    pub fn builder() -> crate::input::streaming_operation_with_initial_response_input::Builder {
   61     69   
        crate::input::streaming_operation_with_initial_response_input::Builder::default()
   62     70   
    }
   63     71   
}
   64     72   
impl crate::constrained::Constrained for crate::input::StreamingOperationWithInitialResponseInput {
   65     73   
    type Unconstrained = crate::input::streaming_operation_with_initial_response_input::Builder;
   66     74   
}
   67     75   
   68     76   
#[allow(missing_docs)] // documentation missing in model
   69     77   
#[derive(::std::fmt::Debug)]
   70     78   
pub struct StreamingOperationWithInitialDataInput {
   71     79   
    #[allow(missing_docs)] // documentation missing in model
   72     80   
    pub initial_data: ::std::string::String,
   73     81   
    #[allow(missing_docs)] // documentation missing in model
   74         -
    pub events: crate::sigv4_event_stream::SigV4Receiver<
   75         -
        crate::model::Events,
   76         -
        ::aws_smithy_http::event_stream::MessageStreamError,
          82  +
    pub events: ::aws_smithy_http::event_stream::Receiver<
          83  +
        crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
          84  +
        crate::sigv4_event_stream::SignedEventError<
          85  +
            ::aws_smithy_http::event_stream::MessageStreamError,
          86  +
        >,
   77     87   
    >,
   78     88   
}
   79     89   
impl StreamingOperationWithInitialDataInput {
   80     90   
    #[allow(missing_docs)] // documentation missing in model
   81     91   
    pub fn initial_data(&self) -> &str {
   82     92   
        use std::ops::Deref;
   83     93   
        self.initial_data.deref()
   84     94   
    }
   85     95   
    #[allow(missing_docs)] // documentation missing in model
   86     96   
    pub fn events(
   87     97   
        &self,
   88         -
    ) -> &crate::sigv4_event_stream::SigV4Receiver<
   89         -
        crate::model::Events,
   90         -
        ::aws_smithy_http::event_stream::MessageStreamError,
          98  +
    ) -> &::aws_smithy_http::event_stream::Receiver<
          99  +
        crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
         100  +
        crate::sigv4_event_stream::SignedEventError<
         101  +
            ::aws_smithy_http::event_stream::MessageStreamError,
         102  +
        >,
   91    103   
    > {
   92    104   
        &self.events
   93    105   
    }
   94    106   
}
   95    107   
impl StreamingOperationWithInitialDataInput {
   96    108   
    /// Creates a new builder-style object to manufacture [`StreamingOperationWithInitialDataInput`](crate::input::StreamingOperationWithInitialDataInput).
   97    109   
    pub fn builder() -> crate::input::streaming_operation_with_initial_data_input::Builder {
   98    110   
        crate::input::streaming_operation_with_initial_data_input::Builder::default()
   99    111   
    }
  100    112   
}
  101    113   
impl crate::constrained::Constrained for crate::input::StreamingOperationWithInitialDataInput {
  102    114   
    type Unconstrained = crate::input::streaming_operation_with_initial_data_input::Builder;
  103    115   
}
  104    116   
  105    117   
#[allow(missing_docs)] // documentation missing in model
  106    118   
#[derive(::std::fmt::Debug)]
  107    119   
pub struct StreamingOperationInput {
  108    120   
    #[allow(missing_docs)] // documentation missing in model
  109         -
    pub events: crate::sigv4_event_stream::SigV4Receiver<
  110         -
        crate::model::Events,
  111         -
        ::aws_smithy_http::event_stream::MessageStreamError,
         121  +
    pub events: ::aws_smithy_http::event_stream::Receiver<
         122  +
        crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
         123  +
        crate::sigv4_event_stream::SignedEventError<
         124  +
            ::aws_smithy_http::event_stream::MessageStreamError,
         125  +
        >,
  112    126   
    >,
  113    127   
}
  114    128   
impl StreamingOperationInput {
  115    129   
    #[allow(missing_docs)] // documentation missing in model
  116    130   
    pub fn events(
  117    131   
        &self,
  118         -
    ) -> &crate::sigv4_event_stream::SigV4Receiver<
  119         -
        crate::model::Events,
  120         -
        ::aws_smithy_http::event_stream::MessageStreamError,
         132  +
    ) -> &::aws_smithy_http::event_stream::Receiver<
         133  +
        crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
         134  +
        crate::sigv4_event_stream::SignedEventError<
         135  +
            ::aws_smithy_http::event_stream::MessageStreamError,
         136  +
        >,
  121    137   
    > {
  122    138   
        &self.events
  123    139   
    }
  124    140   
}
  125    141   
impl StreamingOperationInput {
  126    142   
    /// Creates a new builder-style object to manufacture [`StreamingOperationInput`](crate::input::StreamingOperationInput).
  127    143   
    pub fn builder() -> crate::input::streaming_operation_input::Builder {
  128    144   
        crate::input::streaming_operation_input::Builder::default()
  129    145   
    }
  130    146   
}
@@ -625,641 +725,747 @@
  645    661   
  646    662   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  647    663   
            builder.build()
  648    664   
        }
  649    665   
    }
  650    666   
    /// A builder for [`StreamingOperationWithOptionalDataInput`](crate::input::StreamingOperationWithOptionalDataInput).
  651    667   
    #[derive(::std::default::Default, ::std::fmt::Debug)]
  652    668   
    pub struct Builder {
  653    669   
        pub(crate) optional_data: ::std::option::Option<::std::string::String>,
  654    670   
        pub(crate) events: ::std::option::Option<
  655         -
            crate::sigv4_event_stream::SigV4Receiver<
  656         -
                crate::model::Events,
  657         -
                ::aws_smithy_http::event_stream::MessageStreamError,
         671  +
            ::aws_smithy_http::event_stream::Receiver<
         672  +
                crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
         673  +
                crate::sigv4_event_stream::SignedEventError<
         674  +
                    ::aws_smithy_http::event_stream::MessageStreamError,
         675  +
                >,
  658    676   
            >,
  659    677   
        >,
  660    678   
    }
  661    679   
    impl Builder {
  662    680   
        #[allow(missing_docs)] // documentation missing in model
  663    681   
        pub fn optional_data(
  664    682   
            mut self,
  665    683   
            input: ::std::option::Option<::std::string::String>,
  666    684   
        ) -> Self {
  667    685   
            self.optional_data = input;
  668    686   
            self
  669    687   
        }
  670    688   
        #[allow(missing_docs)] // documentation missing in model
  671    689   
        pub(crate) fn set_optional_data(
  672    690   
            mut self,
  673    691   
            input: Option<impl ::std::convert::Into<::std::string::String>>,
  674    692   
        ) -> Self {
  675    693   
            self.optional_data = input.map(|v| v.into());
  676    694   
            self
  677    695   
        }
  678    696   
        #[allow(missing_docs)] // documentation missing in model
  679    697   
        pub fn events(
  680    698   
            mut self,
  681         -
            input: crate::sigv4_event_stream::SigV4Receiver<
  682         -
                crate::model::Events,
  683         -
                ::aws_smithy_http::event_stream::MessageStreamError,
         699  +
            input: ::aws_smithy_http::event_stream::Receiver<
         700  +
                crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
         701  +
                crate::sigv4_event_stream::SignedEventError<
         702  +
                    ::aws_smithy_http::event_stream::MessageStreamError,
         703  +
                >,
  684    704   
            >,
  685    705   
        ) -> Self {
  686    706   
            self.events = Some(input);
  687    707   
            self
  688    708   
        }
  689    709   
        #[allow(missing_docs)] // documentation missing in model
  690    710   
        pub(crate) fn set_events(
  691    711   
            mut self,
  692    712   
            input: impl ::std::convert::Into<
  693         -
                crate::sigv4_event_stream::SigV4Receiver<
  694         -
                    crate::model::Events,
  695         -
                    ::aws_smithy_http::event_stream::MessageStreamError,
         713  +
                ::aws_smithy_http::event_stream::Receiver<
         714  +
                    crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
         715  +
                    crate::sigv4_event_stream::SignedEventError<
         716  +
                        ::aws_smithy_http::event_stream::MessageStreamError,
         717  +
                    >,
  696    718   
                >,
  697    719   
            >,
  698    720   
        ) -> Self {
  699    721   
            self.events = Some(input.into());
  700    722   
            self
  701    723   
        }
  702    724   
        /// Consumes the builder and constructs a [`StreamingOperationWithOptionalDataInput`](crate::input::StreamingOperationWithOptionalDataInput).
  703    725   
        ///
  704    726   
        /// The builder fails to construct a [`StreamingOperationWithOptionalDataInput`](crate::input::StreamingOperationWithOptionalDataInput) if a [`ConstraintViolation`] occurs.
  705    727   
        ///
@@ -764,786 +848,876 @@
  784    806   
        type Error = ConstraintViolation;
  785    807   
  786    808   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  787    809   
            builder.build()
  788    810   
        }
  789    811   
    }
  790    812   
    /// A builder for [`StreamingOperationWithInitialResponseInput`](crate::input::StreamingOperationWithInitialResponseInput).
  791    813   
    #[derive(::std::default::Default, ::std::fmt::Debug)]
  792    814   
    pub struct Builder {
  793    815   
        pub(crate) events: ::std::option::Option<
  794         -
            crate::sigv4_event_stream::SigV4Receiver<
  795         -
                crate::model::Events,
  796         -
                ::aws_smithy_http::event_stream::MessageStreamError,
         816  +
            ::aws_smithy_http::event_stream::Receiver<
         817  +
                crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
         818  +
                crate::sigv4_event_stream::SignedEventError<
         819  +
                    ::aws_smithy_http::event_stream::MessageStreamError,
         820  +
                >,
  797    821   
            >,
  798    822   
        >,
  799    823   
    }
  800    824   
    impl Builder {
  801    825   
        #[allow(missing_docs)] // documentation missing in model
  802    826   
        pub fn events(
  803    827   
            mut self,
  804         -
            input: crate::sigv4_event_stream::SigV4Receiver<
  805         -
                crate::model::Events,
  806         -
                ::aws_smithy_http::event_stream::MessageStreamError,
         828  +
            input: ::aws_smithy_http::event_stream::Receiver<
         829  +
                crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
         830  +
                crate::sigv4_event_stream::SignedEventError<
         831  +
                    ::aws_smithy_http::event_stream::MessageStreamError,
         832  +
                >,
  807    833   
            >,
  808    834   
        ) -> Self {
  809    835   
            self.events = Some(input);
  810    836   
            self
  811    837   
        }
  812    838   
        #[allow(missing_docs)] // documentation missing in model
  813    839   
        pub(crate) fn set_events(
  814    840   
            mut self,
  815    841   
            input: impl ::std::convert::Into<
  816         -
                crate::sigv4_event_stream::SigV4Receiver<
  817         -
                    crate::model::Events,
  818         -
                    ::aws_smithy_http::event_stream::MessageStreamError,
         842  +
                ::aws_smithy_http::event_stream::Receiver<
         843  +
                    crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
         844  +
                    crate::sigv4_event_stream::SignedEventError<
         845  +
                        ::aws_smithy_http::event_stream::MessageStreamError,
         846  +
                    >,
  819    847   
                >,
  820    848   
            >,
  821    849   
        ) -> Self {
  822    850   
            self.events = Some(input.into());
  823    851   
            self
  824    852   
        }
  825    853   
        /// Consumes the builder and constructs a [`StreamingOperationWithInitialResponseInput`](crate::input::StreamingOperationWithInitialResponseInput).
  826    854   
        ///
  827    855   
        /// The builder fails to construct a [`StreamingOperationWithInitialResponseInput`](crate::input::StreamingOperationWithInitialResponseInput) if a [`ConstraintViolation`] occurs.
  828    856   
        ///
@@ -894,922 +991,1025 @@
  914    942   
  915    943   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  916    944   
            builder.build()
  917    945   
        }
  918    946   
    }
  919    947   
    /// A builder for [`StreamingOperationWithInitialDataInput`](crate::input::StreamingOperationWithInitialDataInput).
  920    948   
    #[derive(::std::default::Default, ::std::fmt::Debug)]
  921    949   
    pub struct Builder {
  922    950   
        pub(crate) initial_data: ::std::option::Option<::std::string::String>,
  923    951   
        pub(crate) events: ::std::option::Option<
  924         -
            crate::sigv4_event_stream::SigV4Receiver<
  925         -
                crate::model::Events,
  926         -
                ::aws_smithy_http::event_stream::MessageStreamError,
         952  +
            ::aws_smithy_http::event_stream::Receiver<
         953  +
                crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
         954  +
                crate::sigv4_event_stream::SignedEventError<
         955  +
                    ::aws_smithy_http::event_stream::MessageStreamError,
         956  +
                >,
  927    957   
            >,
  928    958   
        >,
  929    959   
    }
  930    960   
    impl Builder {
  931    961   
        #[allow(missing_docs)] // documentation missing in model
  932    962   
        pub fn initial_data(mut self, input: ::std::string::String) -> Self {
  933    963   
            self.initial_data = Some(input);
  934    964   
            self
  935    965   
        }
  936    966   
        #[allow(missing_docs)] // documentation missing in model
  937    967   
        pub(crate) fn set_initial_data(
  938    968   
            mut self,
  939    969   
            input: impl ::std::convert::Into<::std::string::String>,
  940    970   
        ) -> Self {
  941    971   
            self.initial_data = Some(input.into());
  942    972   
            self
  943    973   
        }
  944    974   
        #[allow(missing_docs)] // documentation missing in model
  945    975   
        pub fn events(
  946    976   
            mut self,
  947         -
            input: crate::sigv4_event_stream::SigV4Receiver<
  948         -
                crate::model::Events,
  949         -
                ::aws_smithy_http::event_stream::MessageStreamError,
         977  +
            input: ::aws_smithy_http::event_stream::Receiver<
         978  +
                crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
         979  +
                crate::sigv4_event_stream::SignedEventError<
         980  +
                    ::aws_smithy_http::event_stream::MessageStreamError,
         981  +
                >,
  950    982   
            >,
  951    983   
        ) -> Self {
  952    984   
            self.events = Some(input);
  953    985   
            self
  954    986   
        }
  955    987   
        #[allow(missing_docs)] // documentation missing in model
  956    988   
        pub(crate) fn set_events(
  957    989   
            mut self,
  958    990   
            input: impl ::std::convert::Into<
  959         -
                crate::sigv4_event_stream::SigV4Receiver<
  960         -
                    crate::model::Events,
  961         -
                    ::aws_smithy_http::event_stream::MessageStreamError,
         991  +
                ::aws_smithy_http::event_stream::Receiver<
         992  +
                    crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
         993  +
                    crate::sigv4_event_stream::SignedEventError<
         994  +
                        ::aws_smithy_http::event_stream::MessageStreamError,
         995  +
                    >,
  962    996   
                >,
  963    997   
            >,
  964    998   
        ) -> Self {
  965    999   
            self.events = Some(input.into());
  966   1000   
            self
  967   1001   
        }
  968   1002   
        /// Consumes the builder and constructs a [`StreamingOperationWithInitialDataInput`](crate::input::StreamingOperationWithInitialDataInput).
  969   1003   
        ///
  970   1004   
        /// The builder fails to construct a [`StreamingOperationWithInitialDataInput`](crate::input::StreamingOperationWithInitialDataInput) if a [`ConstraintViolation`] occurs.
  971   1005   
        ///
@@ -1031,1065 +1115,1155 @@
 1051   1085   
        type Error = ConstraintViolation;
 1052   1086   
 1053   1087   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
 1054   1088   
            builder.build()
 1055   1089   
        }
 1056   1090   
    }
 1057   1091   
    /// A builder for [`StreamingOperationInput`](crate::input::StreamingOperationInput).
 1058   1092   
    #[derive(::std::default::Default, ::std::fmt::Debug)]
 1059   1093   
    pub struct Builder {
 1060   1094   
        pub(crate) events: ::std::option::Option<
 1061         -
            crate::sigv4_event_stream::SigV4Receiver<
 1062         -
                crate::model::Events,
 1063         -
                ::aws_smithy_http::event_stream::MessageStreamError,
        1095  +
            ::aws_smithy_http::event_stream::Receiver<
        1096  +
                crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
        1097  +
                crate::sigv4_event_stream::SignedEventError<
        1098  +
                    ::aws_smithy_http::event_stream::MessageStreamError,
        1099  +
                >,
 1064   1100   
            >,
 1065   1101   
        >,
 1066   1102   
    }
 1067   1103   
    impl Builder {
 1068   1104   
        #[allow(missing_docs)] // documentation missing in model
 1069   1105   
        pub fn events(
 1070   1106   
            mut self,
 1071         -
            input: crate::sigv4_event_stream::SigV4Receiver<
 1072         -
                crate::model::Events,
 1073         -
                ::aws_smithy_http::event_stream::MessageStreamError,
        1107  +
            input: ::aws_smithy_http::event_stream::Receiver<
        1108  +
                crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
        1109  +
                crate::sigv4_event_stream::SignedEventError<
        1110  +
                    ::aws_smithy_http::event_stream::MessageStreamError,
        1111  +
                >,
 1074   1112   
            >,
 1075   1113   
        ) -> Self {
 1076   1114   
            self.events = Some(input);
 1077   1115   
            self
 1078   1116   
        }
 1079   1117   
        #[allow(missing_docs)] // documentation missing in model
 1080   1118   
        pub(crate) fn set_events(
 1081   1119   
            mut self,
 1082   1120   
            input: impl ::std::convert::Into<
 1083         -
                crate::sigv4_event_stream::SigV4Receiver<
 1084         -
                    crate::model::Events,
 1085         -
                    ::aws_smithy_http::event_stream::MessageStreamError,
        1121  +
                ::aws_smithy_http::event_stream::Receiver<
        1122  +
                    crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
        1123  +
                    crate::sigv4_event_stream::SignedEventError<
        1124  +
                        ::aws_smithy_http::event_stream::MessageStreamError,
        1125  +
                    >,
 1086   1126   
                >,
 1087   1127   
            >,
 1088   1128   
        ) -> Self {
 1089   1129   
            self.events = Some(input.into());
 1090   1130   
            self
 1091   1131   
        }
 1092   1132   
        /// Consumes the builder and constructs a [`StreamingOperationInput`](crate::input::StreamingOperationInput).
 1093   1133   
        ///
 1094   1134   
        /// The builder fails to construct a [`StreamingOperationInput`](crate::input::StreamingOperationInput) if a [`ConstraintViolation`] occurs.
 1095   1135   
        ///

tmp-codegen-diff/codegen-server-test/rpcv2Cbor_extras/rust-server-codegen/src/lib.rs

@@ -265,265 +300,299 @@
  285    285   
mod service;
  286    286   
  287    287   
/// Data primitives referenced by other data types.
  288    288   
pub mod types;
  289    289   
  290    290   
/// Unconstrained types for constrained shapes.
  291    291   
mod unconstrained;
  292    292   
  293    293   
mod mimes;
  294    294   
  295         -
/// Support structures for SigV4 signed event streams
  296         -
pub mod sigv4_event_stream;
         295  +
mod sigv4_event_stream;
  297    296   
  298    297   
mod event_stream_serde;
  299    298   
  300    299   
pub(crate) mod protocol_serde;

tmp-codegen-diff/codegen-server-test/rpcv2Cbor_extras/rust-server-codegen/src/protocol_serde/shape_streaming_operation_input.rs

@@ -1,1 +15,20 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub fn de_events_payload(
    3      3   
    body: &mut ::aws_smithy_types::body::SdkBody,
    4      4   
) -> std::result::Result<
    5         -
    crate::sigv4_event_stream::SigV4Receiver<
    6         -
        crate::model::Events,
    7         -
        ::aws_smithy_http::event_stream::MessageStreamError,
           5  +
    ::aws_smithy_http::event_stream::Receiver<
           6  +
        crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
           7  +
        crate::sigv4_event_stream::SignedEventError<
           8  +
            ::aws_smithy_http::event_stream::MessageStreamError,
           9  +
        >,
    8     10   
    >,
    9     11   
    ::aws_smithy_cbor::decode::DeserializeError,
   10     12   
> {
   11     13   
    let unmarshaller = crate::event_stream_serde::EventsUnmarshaller::new();
          14  +
    let unmarshaller = crate::sigv4_event_stream::SigV4Unmarshaller::new(unmarshaller);
   12     15   
    let body = std::mem::replace(body, ::aws_smithy_types::body::SdkBody::taken());
   13         -
    let receiver = crate::sigv4_event_stream::SigV4Receiver::new(unmarshaller, body);
   14         -
    Ok(receiver)
          16  +
    Ok(::aws_smithy_http::event_stream::Receiver::new(
          17  +
        unmarshaller,
          18  +
        body,
          19  +
    ))
   15     20   
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor_extras/rust-server-codegen/src/protocol_serde/shape_streaming_operation_with_initial_data_input.rs

@@ -1,1 +15,20 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub fn de_events_payload(
    3      3   
    body: &mut ::aws_smithy_types::body::SdkBody,
    4      4   
) -> std::result::Result<
    5         -
    crate::sigv4_event_stream::SigV4Receiver<
    6         -
        crate::model::Events,
    7         -
        ::aws_smithy_http::event_stream::MessageStreamError,
           5  +
    ::aws_smithy_http::event_stream::Receiver<
           6  +
        crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
           7  +
        crate::sigv4_event_stream::SignedEventError<
           8  +
            ::aws_smithy_http::event_stream::MessageStreamError,
           9  +
        >,
    8     10   
    >,
    9     11   
    ::aws_smithy_cbor::decode::DeserializeError,
   10     12   
> {
   11     13   
    let unmarshaller = crate::event_stream_serde::EventsUnmarshaller::new();
          14  +
    let unmarshaller = crate::sigv4_event_stream::SigV4Unmarshaller::new(unmarshaller);
   12     15   
    let body = std::mem::replace(body, ::aws_smithy_types::body::SdkBody::taken());
   13         -
    let receiver = crate::sigv4_event_stream::SigV4Receiver::new(unmarshaller, body);
   14         -
    Ok(receiver)
          16  +
    Ok(::aws_smithy_http::event_stream::Receiver::new(
          17  +
        unmarshaller,
          18  +
        body,
          19  +
    ))
   15     20   
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor_extras/rust-server-codegen/src/protocol_serde/shape_streaming_operation_with_initial_response_input.rs

@@ -1,1 +15,20 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub fn de_events_payload(
    3      3   
    body: &mut ::aws_smithy_types::body::SdkBody,
    4      4   
) -> std::result::Result<
    5         -
    crate::sigv4_event_stream::SigV4Receiver<
    6         -
        crate::model::Events,
    7         -
        ::aws_smithy_http::event_stream::MessageStreamError,
           5  +
    ::aws_smithy_http::event_stream::Receiver<
           6  +
        crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
           7  +
        crate::sigv4_event_stream::SignedEventError<
           8  +
            ::aws_smithy_http::event_stream::MessageStreamError,
           9  +
        >,
    8     10   
    >,
    9     11   
    ::aws_smithy_cbor::decode::DeserializeError,
   10     12   
> {
   11     13   
    let unmarshaller = crate::event_stream_serde::EventsUnmarshaller::new();
          14  +
    let unmarshaller = crate::sigv4_event_stream::SigV4Unmarshaller::new(unmarshaller);
   12     15   
    let body = std::mem::replace(body, ::aws_smithy_types::body::SdkBody::taken());
   13         -
    let receiver = crate::sigv4_event_stream::SigV4Receiver::new(unmarshaller, body);
   14         -
    Ok(receiver)
          16  +
    Ok(::aws_smithy_http::event_stream::Receiver::new(
          17  +
        unmarshaller,
          18  +
        body,
          19  +
    ))
   15     20   
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor_extras/rust-server-codegen/src/protocol_serde/shape_streaming_operation_with_optional_data_input.rs

@@ -1,1 +15,20 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub fn de_events_payload(
    3      3   
    body: &mut ::aws_smithy_types::body::SdkBody,
    4      4   
) -> std::result::Result<
    5         -
    crate::sigv4_event_stream::SigV4Receiver<
    6         -
        crate::model::Events,
    7         -
        ::aws_smithy_http::event_stream::MessageStreamError,
           5  +
    ::aws_smithy_http::event_stream::Receiver<
           6  +
        crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
           7  +
        crate::sigv4_event_stream::SignedEventError<
           8  +
            ::aws_smithy_http::event_stream::MessageStreamError,
           9  +
        >,
    8     10   
    >,
    9     11   
    ::aws_smithy_cbor::decode::DeserializeError,
   10     12   
> {
   11     13   
    let unmarshaller = crate::event_stream_serde::EventsUnmarshaller::new();
          14  +
    let unmarshaller = crate::sigv4_event_stream::SigV4Unmarshaller::new(unmarshaller);
   12     15   
    let body = std::mem::replace(body, ::aws_smithy_types::body::SdkBody::taken());
   13         -
    let receiver = crate::sigv4_event_stream::SigV4Receiver::new(unmarshaller, body);
   14         -
    Ok(receiver)
          16  +
    Ok(::aws_smithy_http::event_stream::Receiver::new(
          17  +
        unmarshaller,
          18  +
        body,
          19  +
    ))
   15     20   
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor_extras/rust-server-codegen/src/sigv4_event_stream.rs

@@ -1,1 +249,155 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
/// Receiver wrapper that handles SigV4 signed event stream messages
    3         -
#[derive(Debug)]
    4         -
pub struct SigV4Receiver<T, E> {
    5         -
    inner: ::aws_smithy_http::event_stream::Receiver<
    6         -
        crate::sigv4_event_stream::SignedEvent<T>,
    7         -
        crate::sigv4_event_stream::SignedEventError<E>,
    8         -
    >,
    9         -
    initial_signature: ::std::option::Option<crate::sigv4_event_stream::SignatureInfo>,
   10         -
}
   11         -
   12         -
impl<T, E> SigV4Receiver<T, E> {
   13         -
    pub fn new(
   14         -
        unmarshaller: impl ::aws_smithy_eventstream::frame::UnmarshallMessage<Output = T, Error = E>
   15         -
            + ::std::marker::Send
   16         -
            + ::std::marker::Sync
   17         -
            + 'static,
   18         -
        body: ::aws_smithy_types::body::SdkBody,
   19         -
    ) -> Self {
   20         -
        let sigv4_unmarshaller = crate::sigv4_event_stream::SigV4Unmarshaller::new(unmarshaller);
   21         -
        Self {
   22         -
            inner: ::aws_smithy_http::event_stream::Receiver::new(sigv4_unmarshaller, body),
   23         -
            initial_signature: ::std::option::Option::None,
   24         -
        }
   25         -
    }
   26         -
   27         -
    /// Get the signature from the initial message, if it was signed
   28         -
    pub fn initial_signature(
   29         -
        &self,
   30         -
    ) -> ::std::option::Option<&crate::sigv4_event_stream::SignatureInfo> {
   31         -
        self.initial_signature.as_ref()
   32         -
    }
   33         -
   34         -
    /// Try to receive an initial message of the given type.
   35         -
    /// Handles SigV4-wrapped messages by extracting the inner message first.
   36         -
    pub async fn try_recv_initial(
   37         -
        &mut self,
   38         -
        message_type: ::aws_smithy_http::event_stream::InitialMessageType,
   39         -
    ) -> ::std::result::Result<
   40         -
        ::std::option::Option<::aws_smithy_types::event_stream::Message>,
   41         -
        ::aws_smithy_runtime_api::client::result::SdkError<
   42         -
            crate::sigv4_event_stream::SignedEventError<E>,
   43         -
            ::aws_smithy_types::event_stream::RawMessage,
   44         -
        >,
   45         -
    >
   46         -
    where
   47         -
        E: std::error::Error + 'static,
   48         -
    {
   49         -
        let result = self
   50         -
            .inner
   51         -
            .try_recv_initial_with_preprocessor(message_type, |message| {
   52         -
                match crate::sigv4_event_stream::extract_signed_message(&message) {
   53         -
                    ::std::result::Result::Ok(MaybeSignedMessage::Signed {
   54         -
                        message: inner,
   55         -
                        signature,
   56         -
                    }) => {
   57         -
                        ::std::result::Result::Ok((inner, ::std::option::Option::Some(signature)))
   58         -
                    }
   59         -
                    ::std::result::Result::Ok(MaybeSignedMessage::Unsigned) => {
   60         -
                        ::std::result::Result::Ok((message, ::std::option::Option::None))
   61         -
                    }
   62         -
                    ::std::result::Result::Err(err) => ::std::result::Result::Err(
   63         -
                        ::aws_smithy_runtime_api::client::result::ResponseError::builder()
   64         -
                            .raw(::aws_smithy_types::event_stream::RawMessage::Decoded(
   65         -
                                message,
   66         -
                            ))
   67         -
                            .source(err)
   68         -
                            .build(),
   69         -
                    ),
   70         -
                }
   71         -
            })
   72         -
            .await?;
   73         -
        match result {
   74         -
            ::std::option::Option::Some((message, signature)) => {
   75         -
                self.initial_signature = signature;
   76         -
                ::std::result::Result::Ok(::std::option::Option::Some(message))
   77         -
            }
   78         -
            ::std::option::Option::None => ::std::result::Result::Ok(::std::option::Option::None),
   79         -
        }
   80         -
    }
   81         -
   82         -
    /// Receive the next event from the stream
   83         -
    /// The SigV4Unmarshaller handles unwrapping, so we just pass through
   84         -
    pub async fn recv(
   85         -
        &mut self,
   86         -
    ) -> ::std::result::Result<
   87         -
        ::std::option::Option<crate::sigv4_event_stream::SignedEvent<T>>,
   88         -
        ::aws_smithy_runtime_api::client::result::SdkError<
   89         -
            crate::sigv4_event_stream::SignedEventError<E>,
   90         -
            ::aws_smithy_types::event_stream::RawMessage,
   91         -
        >,
   92         -
    >
   93         -
    where
   94         -
        E: std::error::Error + 'static,
   95         -
    {
   96         -
        self.inner.recv().await
   97         -
    }
   98         -
}
   99         -
  100      2   
/// Wrapper for event stream messages that may be signed
  101         -
#[derive(Debug, Clone)]
           3  +
#[derive(Debug)]
  102      4   
pub struct SignedEvent<T> {
  103      5   
    /// The actual event message
  104      6   
    pub message: T,
  105      7   
    /// Signature information if the message was signed
  106      8   
    pub signature: ::std::option::Option<crate::sigv4_event_stream::SignatureInfo>,
  107      9   
}
  108     10   
  109     11   
/// Error wrapper for signed event stream errors
  110     12   
#[derive(Debug)]
  111     13   
pub enum SignedEventError<E> {
  112     14   
    /// Error from the underlying event stream
  113     15   
    Event(E),
  114     16   
    /// Error extracting signed message
  115     17   
    InvalidSignedEvent(crate::sigv4_event_stream::ExtractionError),
  116     18   
}
  117     19   
  118     20   
impl<E> From<E> for SignedEventError<E> {
  119     21   
    fn from(err: E) -> Self {
  120     22   
        SignedEventError::Event(err)
  121     23   
    }
  122     24   
}
  123     25   
  124     26   
/// Information extracted from a signed event stream message
  125     27   
#[non_exhaustive]
  126         -
#[derive(Debug, Clone, PartialEq)]
          28  +
#[derive(Debug, Clone)]
  127     29   
pub struct SignatureInfo {
  128     30   
    /// The chunk signature bytes from the `:chunk-signature` header
  129     31   
    pub chunk_signature: Vec<u8>,
  130     32   
    /// The timestamp from the `:date` header
  131     33   
    pub timestamp: ::std::time::SystemTime,
  132     34   
}
  133     35   
          36  +
/// Error type for signed message extraction operations
          37  +
#[non_exhaustive]
          38  +
#[derive(Debug)]
          39  +
pub enum ExtractionError {
          40  +
    /// The payload could not be decoded as a valid message
          41  +
    #[non_exhaustive]
          42  +
    InvalidPayload {
          43  +
        error: ::aws_smithy_eventstream::error::Error,
          44  +
    },
          45  +
    /// The timestamp header is missing or has an invalid format
          46  +
    #[non_exhaustive]
          47  +
    InvalidTimestamp,
          48  +
}
          49  +
  134     50   
/// Unmarshaller wrapper that handles SigV4 signed event stream messages
  135     51   
#[derive(Debug)]
  136     52   
pub struct SigV4Unmarshaller<T> {
  137     53   
    inner: T,
  138     54   
}
  139     55   
  140     56   
impl<T> SigV4Unmarshaller<T> {
  141     57   
    pub fn new(inner: T) -> Self {
  142     58   
        Self { inner }
  143     59   
    }
  144     60   
}
  145     61   
  146     62   
impl<T> ::aws_smithy_eventstream::frame::UnmarshallMessage for SigV4Unmarshaller<T>
  147     63   
where
  148     64   
    T: ::aws_smithy_eventstream::frame::UnmarshallMessage,
  149     65   
{
  150     66   
    type Output = crate::sigv4_event_stream::SignedEvent<T::Output>;
  151     67   
    type Error = crate::sigv4_event_stream::SignedEventError<T::Error>;
  152     68   
  153     69   
    fn unmarshall(
  154     70   
        &self,
  155     71   
        message: &::aws_smithy_types::event_stream::Message,
  156     72   
    ) -> ::std::result::Result<
  157     73   
        ::aws_smithy_eventstream::frame::UnmarshalledMessage<Self::Output, Self::Error>,
  158     74   
        ::aws_smithy_eventstream::error::Error,
  159     75   
    > {
  160     76   
        // First, try to extract the signed message
  161     77   
        match crate::sigv4_event_stream::extract_signed_message(message) {
  162         -
            ::std::result::Result::Ok(MaybeSignedMessage::Signed {
          78  +
            Ok(MaybeSignedMessage::Signed {
  163     79   
                message: inner_message,
  164     80   
                signature,
  165     81   
            }) => {
  166     82   
                // Process the inner message with the base unmarshaller
  167     83   
                match self.inner.unmarshall(&inner_message) {
  168         -
                    ::std::result::Result::Ok(unmarshalled) => match unmarshalled {
          84  +
                    Ok(unmarshalled) => match unmarshalled {
  169     85   
                        ::aws_smithy_eventstream::frame::UnmarshalledMessage::Event(event) => {
  170         -
                            ::std::result::Result::Ok(
  171         -
                                ::aws_smithy_eventstream::frame::UnmarshalledMessage::Event(
  172         -
                                    crate::sigv4_event_stream::SignedEvent {
  173         -
                                        message: event,
  174         -
                                        signature: ::std::option::Option::Some(signature),
  175         -
                                    },
  176         -
                                ),
  177         -
                            )
          86  +
                            Ok(::aws_smithy_eventstream::frame::UnmarshalledMessage::Event(
          87  +
                                crate::sigv4_event_stream::SignedEvent {
          88  +
                                    message: event,
          89  +
                                    signature: Some(signature),
          90  +
                                },
          91  +
                            ))
  178     92   
                        }
  179     93   
                        ::aws_smithy_eventstream::frame::UnmarshalledMessage::Error(err) => {
  180         -
                            ::std::result::Result::Ok(
  181         -
                                ::aws_smithy_eventstream::frame::UnmarshalledMessage::Error(
  182         -
                                    crate::sigv4_event_stream::SignedEventError::Event(err),
  183         -
                                ),
  184         -
                            )
          94  +
                            Ok(::aws_smithy_eventstream::frame::UnmarshalledMessage::Error(
          95  +
                                crate::sigv4_event_stream::SignedEventError::Event(err),
          96  +
                            ))
  185     97   
                        }
  186     98   
                    },
  187         -
                    ::std::result::Result::Err(err) => ::std::result::Result::Err(err),
          99  +
                    Err(err) => Err(err),
  188    100   
                }
  189    101   
            }
  190         -
            ::std::result::Result::Ok(MaybeSignedMessage::Unsigned) => {
         102  +
            Ok(MaybeSignedMessage::Unsigned) => {
  191    103   
                // Process unsigned message directly
  192    104   
                match self.inner.unmarshall(message) {
  193         -
                    ::std::result::Result::Ok(unmarshalled) => match unmarshalled {
         105  +
                    Ok(unmarshalled) => match unmarshalled {
  194    106   
                        ::aws_smithy_eventstream::frame::UnmarshalledMessage::Event(event) => {
  195         -
                            ::std::result::Result::Ok(
  196         -
                                ::aws_smithy_eventstream::frame::UnmarshalledMessage::Event(
  197         -
                                    crate::sigv4_event_stream::SignedEvent {
  198         -
                                        message: event,
  199         -
                                        signature: ::std::option::Option::None,
  200         -
                                    },
  201         -
                                ),
  202         -
                            )
         107  +
                            Ok(::aws_smithy_eventstream::frame::UnmarshalledMessage::Event(
         108  +
                                crate::sigv4_event_stream::SignedEvent {
         109  +
                                    message: event,
         110  +
                                    signature: None,
         111  +
                                },
         112  +
                            ))
  203    113   
                        }
  204    114   
                        ::aws_smithy_eventstream::frame::UnmarshalledMessage::Error(err) => {
  205         -
                            ::std::result::Result::Ok(
  206         -
                                ::aws_smithy_eventstream::frame::UnmarshalledMessage::Error(
  207         -
                                    crate::sigv4_event_stream::SignedEventError::Event(err),
  208         -
                                ),
  209         -
                            )
         115  +
                            Ok(::aws_smithy_eventstream::frame::UnmarshalledMessage::Error(
         116  +
                                crate::sigv4_event_stream::SignedEventError::Event(err),
         117  +
                            ))
  210    118   
                        }
  211    119   
                    },
  212         -
                    ::std::result::Result::Err(err) => ::std::result::Result::Err(err),
         120  +
                    Err(err) => Err(err),
  213    121   
                }
  214    122   
            }
  215         -
            ::std::result::Result::Err(extraction_err) => ::std::result::Result::Ok(
  216         -
                ::aws_smithy_eventstream::frame::UnmarshalledMessage::Error(
  217         -
                    crate::sigv4_event_stream::SignedEventError::InvalidSignedEvent(extraction_err),
  218         -
                ),
  219         -
            ),
         123  +
            Err(extraction_err) => Ok(::aws_smithy_eventstream::frame::UnmarshalledMessage::Error(
         124  +
                crate::sigv4_event_stream::SignedEventError::InvalidSignedEvent(extraction_err),
         125  +
            )),
  220    126   
        }
  221    127   
    }
  222    128   
}
  223    129   
  224    130   
/// Result of extracting a potentially signed message
  225    131   
#[derive(Debug)]
  226    132   
pub enum MaybeSignedMessage {
  227    133   
    /// Message was signed and has been extracted
  228    134   
    Signed {
  229    135   
        /// The inner message that was signed
@@ -260,166 +325,0 @@
  280    186   
        .map_err(|err| crate::sigv4_event_stream::ExtractionError::InvalidPayload { error: err })?;
  281    187   
  282    188   
    Ok(MaybeSignedMessage::Signed {
  283    189   
        message: inner_message,
  284    190   
        signature: crate::sigv4_event_stream::SignatureInfo {
  285    191   
            chunk_signature,
  286    192   
            timestamp,
  287    193   
        },
  288    194   
    })
  289    195   
}
  290         -
  291         -
/// Error type for signed message extraction operations
  292         -
#[non_exhaustive]
  293         -
#[derive(Debug)]
  294         -
pub enum ExtractionError {
  295         -
    /// The payload could not be decoded as a valid message
  296         -
    #[non_exhaustive]
  297         -
    InvalidPayload {
  298         -
        error: ::aws_smithy_eventstream::error::Error,
  299         -
    },
  300         -
    /// The timestamp header is missing or has an invalid format
  301         -
    #[non_exhaustive]
  302         -
    InvalidTimestamp,
  303         -
}
  304         -
  305         -
impl ::std::fmt::Display for ExtractionError {
  306         -
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  307         -
        match self {
  308         -
            ExtractionError::InvalidPayload { error } => {
  309         -
                write!(f, "invalid payload: {}", error)
  310         -
            }
  311         -
            ExtractionError::InvalidTimestamp => {
  312         -
                write!(f, "invalid or missing timestamp header")
  313         -
            }
  314         -
        }
  315         -
    }
  316         -
}
  317         -
  318         -
impl ::std::error::Error for ExtractionError {
  319         -
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
  320         -
        match self {
  321         -
            ExtractionError::InvalidPayload { error } => ::std::option::Option::Some(error),
  322         -
            ExtractionError::InvalidTimestamp => ::std::option::Option::None,
  323         -
        }
  324         -
    }
  325         -
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor_extras_no_initial_response/rust-server-codegen/Cargo.toml

@@ -1,1 +53,52 @@
   13     13   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-cbor"
   14     14   
[dependencies.aws-smithy-eventstream]
   15     15   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-eventstream"
   16     16   
[dependencies.aws-smithy-http]
   17     17   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-http"
   18     18   
features = ["event-stream"]
   19     19   
[dependencies.aws-smithy-http-server]
   20     20   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-http-server"
   21     21   
[dependencies.aws-smithy-runtime-api]
   22     22   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-runtime-api"
   23         -
features = ["client", "http-02x"]
   24     23   
[dependencies.aws-smithy-types]
   25     24   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-types"
   26     25   
[dependencies.futures-util]
   27     26   
version = "0.3"
   28     27   
[dependencies.http]
   29     28   
version = "0.2.9"
   30     29   
[dependencies.hyper]
   31     30   
version = "0.14.26"
   32     31   
[dependencies.mime]
   33     32   
version = "0.3"

tmp-codegen-diff/codegen-server-test/rpcv2Cbor_extras_no_initial_response/rust-server-codegen/src/input.rs

@@ -1,1 +150,166 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(missing_docs)] // documentation missing in model
    3      3   
#[derive(::std::fmt::Debug)]
    4      4   
pub struct StreamingOperationWithOptionalDataInput {
    5      5   
    #[allow(missing_docs)] // documentation missing in model
    6      6   
    pub optional_data: ::std::option::Option<::std::string::String>,
    7      7   
    #[allow(missing_docs)] // documentation missing in model
    8         -
    pub events: crate::sigv4_event_stream::SigV4Receiver<
    9         -
        crate::model::Events,
   10         -
        ::aws_smithy_http::event_stream::MessageStreamError,
           8  +
    pub events: ::aws_smithy_http::event_stream::Receiver<
           9  +
        crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
          10  +
        crate::sigv4_event_stream::SignedEventError<
          11  +
            ::aws_smithy_http::event_stream::MessageStreamError,
          12  +
        >,
   11     13   
    >,
   12     14   
}
   13     15   
impl StreamingOperationWithOptionalDataInput {
   14     16   
    #[allow(missing_docs)] // documentation missing in model
   15     17   
    pub fn optional_data(&self) -> ::std::option::Option<&str> {
   16     18   
        self.optional_data.as_deref()
   17     19   
    }
   18     20   
    #[allow(missing_docs)] // documentation missing in model
   19     21   
    pub fn events(
   20     22   
        &self,
   21         -
    ) -> &crate::sigv4_event_stream::SigV4Receiver<
   22         -
        crate::model::Events,
   23         -
        ::aws_smithy_http::event_stream::MessageStreamError,
          23  +
    ) -> &::aws_smithy_http::event_stream::Receiver<
          24  +
        crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
          25  +
        crate::sigv4_event_stream::SignedEventError<
          26  +
            ::aws_smithy_http::event_stream::MessageStreamError,
          27  +
        >,
   24     28   
    > {
   25     29   
        &self.events
   26     30   
    }
   27     31   
}
   28     32   
impl StreamingOperationWithOptionalDataInput {
   29     33   
    /// Creates a new builder-style object to manufacture [`StreamingOperationWithOptionalDataInput`](crate::input::StreamingOperationWithOptionalDataInput).
   30     34   
    pub fn builder() -> crate::input::streaming_operation_with_optional_data_input::Builder {
   31     35   
        crate::input::streaming_operation_with_optional_data_input::Builder::default()
   32     36   
    }
   33     37   
}
   34     38   
impl crate::constrained::Constrained for crate::input::StreamingOperationWithOptionalDataInput {
   35     39   
    type Unconstrained = crate::input::streaming_operation_with_optional_data_input::Builder;
   36     40   
}
   37     41   
   38     42   
#[allow(missing_docs)] // documentation missing in model
   39     43   
#[derive(::std::fmt::Debug)]
   40     44   
pub struct StreamingOperationWithInitialResponseInput {
   41     45   
    #[allow(missing_docs)] // documentation missing in model
   42         -
    pub events: crate::sigv4_event_stream::SigV4Receiver<
   43         -
        crate::model::Events,
   44         -
        ::aws_smithy_http::event_stream::MessageStreamError,
          46  +
    pub events: ::aws_smithy_http::event_stream::Receiver<
          47  +
        crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
          48  +
        crate::sigv4_event_stream::SignedEventError<
          49  +
            ::aws_smithy_http::event_stream::MessageStreamError,
          50  +
        >,
   45     51   
    >,
   46     52   
}
   47     53   
impl StreamingOperationWithInitialResponseInput {
   48     54   
    #[allow(missing_docs)] // documentation missing in model
   49     55   
    pub fn events(
   50     56   
        &self,
   51         -
    ) -> &crate::sigv4_event_stream::SigV4Receiver<
   52         -
        crate::model::Events,
   53         -
        ::aws_smithy_http::event_stream::MessageStreamError,
          57  +
    ) -> &::aws_smithy_http::event_stream::Receiver<
          58  +
        crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
          59  +
        crate::sigv4_event_stream::SignedEventError<
          60  +
            ::aws_smithy_http::event_stream::MessageStreamError,
          61  +
        >,
   54     62   
    > {
   55     63   
        &self.events
   56     64   
    }
   57     65   
}
   58     66   
impl StreamingOperationWithInitialResponseInput {
   59     67   
    /// Creates a new builder-style object to manufacture [`StreamingOperationWithInitialResponseInput`](crate::input::StreamingOperationWithInitialResponseInput).
   60     68   
    pub fn builder() -> crate::input::streaming_operation_with_initial_response_input::Builder {
   61     69   
        crate::input::streaming_operation_with_initial_response_input::Builder::default()
   62     70   
    }
   63     71   
}
   64     72   
impl crate::constrained::Constrained for crate::input::StreamingOperationWithInitialResponseInput {
   65     73   
    type Unconstrained = crate::input::streaming_operation_with_initial_response_input::Builder;
   66     74   
}
   67     75   
   68     76   
#[allow(missing_docs)] // documentation missing in model
   69     77   
#[derive(::std::fmt::Debug)]
   70     78   
pub struct StreamingOperationWithInitialDataInput {
   71     79   
    #[allow(missing_docs)] // documentation missing in model
   72     80   
    pub initial_data: ::std::string::String,
   73     81   
    #[allow(missing_docs)] // documentation missing in model
   74         -
    pub events: crate::sigv4_event_stream::SigV4Receiver<
   75         -
        crate::model::Events,
   76         -
        ::aws_smithy_http::event_stream::MessageStreamError,
          82  +
    pub events: ::aws_smithy_http::event_stream::Receiver<
          83  +
        crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
          84  +
        crate::sigv4_event_stream::SignedEventError<
          85  +
            ::aws_smithy_http::event_stream::MessageStreamError,
          86  +
        >,
   77     87   
    >,
   78     88   
}
   79     89   
impl StreamingOperationWithInitialDataInput {
   80     90   
    #[allow(missing_docs)] // documentation missing in model
   81     91   
    pub fn initial_data(&self) -> &str {
   82     92   
        use std::ops::Deref;
   83     93   
        self.initial_data.deref()
   84     94   
    }
   85     95   
    #[allow(missing_docs)] // documentation missing in model
   86     96   
    pub fn events(
   87     97   
        &self,
   88         -
    ) -> &crate::sigv4_event_stream::SigV4Receiver<
   89         -
        crate::model::Events,
   90         -
        ::aws_smithy_http::event_stream::MessageStreamError,
          98  +
    ) -> &::aws_smithy_http::event_stream::Receiver<
          99  +
        crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
         100  +
        crate::sigv4_event_stream::SignedEventError<
         101  +
            ::aws_smithy_http::event_stream::MessageStreamError,
         102  +
        >,
   91    103   
    > {
   92    104   
        &self.events
   93    105   
    }
   94    106   
}
   95    107   
impl StreamingOperationWithInitialDataInput {
   96    108   
    /// Creates a new builder-style object to manufacture [`StreamingOperationWithInitialDataInput`](crate::input::StreamingOperationWithInitialDataInput).
   97    109   
    pub fn builder() -> crate::input::streaming_operation_with_initial_data_input::Builder {
   98    110   
        crate::input::streaming_operation_with_initial_data_input::Builder::default()
   99    111   
    }
  100    112   
}
  101    113   
impl crate::constrained::Constrained for crate::input::StreamingOperationWithInitialDataInput {
  102    114   
    type Unconstrained = crate::input::streaming_operation_with_initial_data_input::Builder;
  103    115   
}
  104    116   
  105    117   
#[allow(missing_docs)] // documentation missing in model
  106    118   
#[derive(::std::fmt::Debug)]
  107    119   
pub struct StreamingOperationInput {
  108    120   
    #[allow(missing_docs)] // documentation missing in model
  109         -
    pub events: crate::sigv4_event_stream::SigV4Receiver<
  110         -
        crate::model::Events,
  111         -
        ::aws_smithy_http::event_stream::MessageStreamError,
         121  +
    pub events: ::aws_smithy_http::event_stream::Receiver<
         122  +
        crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
         123  +
        crate::sigv4_event_stream::SignedEventError<
         124  +
            ::aws_smithy_http::event_stream::MessageStreamError,
         125  +
        >,
  112    126   
    >,
  113    127   
}
  114    128   
impl StreamingOperationInput {
  115    129   
    #[allow(missing_docs)] // documentation missing in model
  116    130   
    pub fn events(
  117    131   
        &self,
  118         -
    ) -> &crate::sigv4_event_stream::SigV4Receiver<
  119         -
        crate::model::Events,
  120         -
        ::aws_smithy_http::event_stream::MessageStreamError,
         132  +
    ) -> &::aws_smithy_http::event_stream::Receiver<
         133  +
        crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
         134  +
        crate::sigv4_event_stream::SignedEventError<
         135  +
            ::aws_smithy_http::event_stream::MessageStreamError,
         136  +
        >,
  121    137   
    > {
  122    138   
        &self.events
  123    139   
    }
  124    140   
}
  125    141   
impl StreamingOperationInput {
  126    142   
    /// Creates a new builder-style object to manufacture [`StreamingOperationInput`](crate::input::StreamingOperationInput).
  127    143   
    pub fn builder() -> crate::input::streaming_operation_input::Builder {
  128    144   
        crate::input::streaming_operation_input::Builder::default()
  129    145   
    }
  130    146   
}
@@ -625,641 +725,747 @@
  645    661   
  646    662   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  647    663   
            builder.build()
  648    664   
        }
  649    665   
    }
  650    666   
    /// A builder for [`StreamingOperationWithOptionalDataInput`](crate::input::StreamingOperationWithOptionalDataInput).
  651    667   
    #[derive(::std::default::Default, ::std::fmt::Debug)]
  652    668   
    pub struct Builder {
  653    669   
        pub(crate) optional_data: ::std::option::Option<::std::string::String>,
  654    670   
        pub(crate) events: ::std::option::Option<
  655         -
            crate::sigv4_event_stream::SigV4Receiver<
  656         -
                crate::model::Events,
  657         -
                ::aws_smithy_http::event_stream::MessageStreamError,
         671  +
            ::aws_smithy_http::event_stream::Receiver<
         672  +
                crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
         673  +
                crate::sigv4_event_stream::SignedEventError<
         674  +
                    ::aws_smithy_http::event_stream::MessageStreamError,
         675  +
                >,
  658    676   
            >,
  659    677   
        >,
  660    678   
    }
  661    679   
    impl Builder {
  662    680   
        #[allow(missing_docs)] // documentation missing in model
  663    681   
        pub fn optional_data(
  664    682   
            mut self,
  665    683   
            input: ::std::option::Option<::std::string::String>,
  666    684   
        ) -> Self {
  667    685   
            self.optional_data = input;
  668    686   
            self
  669    687   
        }
  670    688   
        #[allow(missing_docs)] // documentation missing in model
  671    689   
        pub(crate) fn set_optional_data(
  672    690   
            mut self,
  673    691   
            input: Option<impl ::std::convert::Into<::std::string::String>>,
  674    692   
        ) -> Self {
  675    693   
            self.optional_data = input.map(|v| v.into());
  676    694   
            self
  677    695   
        }
  678    696   
        #[allow(missing_docs)] // documentation missing in model
  679    697   
        pub fn events(
  680    698   
            mut self,
  681         -
            input: crate::sigv4_event_stream::SigV4Receiver<
  682         -
                crate::model::Events,
  683         -
                ::aws_smithy_http::event_stream::MessageStreamError,
         699  +
            input: ::aws_smithy_http::event_stream::Receiver<
         700  +
                crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
         701  +
                crate::sigv4_event_stream::SignedEventError<
         702  +
                    ::aws_smithy_http::event_stream::MessageStreamError,
         703  +
                >,
  684    704   
            >,
  685    705   
        ) -> Self {
  686    706   
            self.events = Some(input);
  687    707   
            self
  688    708   
        }
  689    709   
        #[allow(missing_docs)] // documentation missing in model
  690    710   
        pub(crate) fn set_events(
  691    711   
            mut self,
  692    712   
            input: impl ::std::convert::Into<
  693         -
                crate::sigv4_event_stream::SigV4Receiver<
  694         -
                    crate::model::Events,
  695         -
                    ::aws_smithy_http::event_stream::MessageStreamError,
         713  +
                ::aws_smithy_http::event_stream::Receiver<
         714  +
                    crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
         715  +
                    crate::sigv4_event_stream::SignedEventError<
         716  +
                        ::aws_smithy_http::event_stream::MessageStreamError,
         717  +
                    >,
  696    718   
                >,
  697    719   
            >,
  698    720   
        ) -> Self {
  699    721   
            self.events = Some(input.into());
  700    722   
            self
  701    723   
        }
  702    724   
        /// Consumes the builder and constructs a [`StreamingOperationWithOptionalDataInput`](crate::input::StreamingOperationWithOptionalDataInput).
  703    725   
        ///
  704    726   
        /// The builder fails to construct a [`StreamingOperationWithOptionalDataInput`](crate::input::StreamingOperationWithOptionalDataInput) if a [`ConstraintViolation`] occurs.
  705    727   
        ///
@@ -764,786 +848,876 @@
  784    806   
        type Error = ConstraintViolation;
  785    807   
  786    808   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  787    809   
            builder.build()
  788    810   
        }
  789    811   
    }
  790    812   
    /// A builder for [`StreamingOperationWithInitialResponseInput`](crate::input::StreamingOperationWithInitialResponseInput).
  791    813   
    #[derive(::std::default::Default, ::std::fmt::Debug)]
  792    814   
    pub struct Builder {
  793    815   
        pub(crate) events: ::std::option::Option<
  794         -
            crate::sigv4_event_stream::SigV4Receiver<
  795         -
                crate::model::Events,
  796         -
                ::aws_smithy_http::event_stream::MessageStreamError,
         816  +
            ::aws_smithy_http::event_stream::Receiver<
         817  +
                crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
         818  +
                crate::sigv4_event_stream::SignedEventError<
         819  +
                    ::aws_smithy_http::event_stream::MessageStreamError,
         820  +
                >,
  797    821   
            >,
  798    822   
        >,
  799    823   
    }
  800    824   
    impl Builder {
  801    825   
        #[allow(missing_docs)] // documentation missing in model
  802    826   
        pub fn events(
  803    827   
            mut self,
  804         -
            input: crate::sigv4_event_stream::SigV4Receiver<
  805         -
                crate::model::Events,
  806         -
                ::aws_smithy_http::event_stream::MessageStreamError,
         828  +
            input: ::aws_smithy_http::event_stream::Receiver<
         829  +
                crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
         830  +
                crate::sigv4_event_stream::SignedEventError<
         831  +
                    ::aws_smithy_http::event_stream::MessageStreamError,
         832  +
                >,
  807    833   
            >,
  808    834   
        ) -> Self {
  809    835   
            self.events = Some(input);
  810    836   
            self
  811    837   
        }
  812    838   
        #[allow(missing_docs)] // documentation missing in model
  813    839   
        pub(crate) fn set_events(
  814    840   
            mut self,
  815    841   
            input: impl ::std::convert::Into<
  816         -
                crate::sigv4_event_stream::SigV4Receiver<
  817         -
                    crate::model::Events,
  818         -
                    ::aws_smithy_http::event_stream::MessageStreamError,
         842  +
                ::aws_smithy_http::event_stream::Receiver<
         843  +
                    crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
         844  +
                    crate::sigv4_event_stream::SignedEventError<
         845  +
                        ::aws_smithy_http::event_stream::MessageStreamError,
         846  +
                    >,
  819    847   
                >,
  820    848   
            >,
  821    849   
        ) -> Self {
  822    850   
            self.events = Some(input.into());
  823    851   
            self
  824    852   
        }
  825    853   
        /// Consumes the builder and constructs a [`StreamingOperationWithInitialResponseInput`](crate::input::StreamingOperationWithInitialResponseInput).
  826    854   
        ///
  827    855   
        /// The builder fails to construct a [`StreamingOperationWithInitialResponseInput`](crate::input::StreamingOperationWithInitialResponseInput) if a [`ConstraintViolation`] occurs.
  828    856   
        ///
@@ -894,922 +991,1025 @@
  914    942   
  915    943   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  916    944   
            builder.build()
  917    945   
        }
  918    946   
    }
  919    947   
    /// A builder for [`StreamingOperationWithInitialDataInput`](crate::input::StreamingOperationWithInitialDataInput).
  920    948   
    #[derive(::std::default::Default, ::std::fmt::Debug)]
  921    949   
    pub struct Builder {
  922    950   
        pub(crate) initial_data: ::std::option::Option<::std::string::String>,
  923    951   
        pub(crate) events: ::std::option::Option<
  924         -
            crate::sigv4_event_stream::SigV4Receiver<
  925         -
                crate::model::Events,
  926         -
                ::aws_smithy_http::event_stream::MessageStreamError,
         952  +
            ::aws_smithy_http::event_stream::Receiver<
         953  +
                crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
         954  +
                crate::sigv4_event_stream::SignedEventError<
         955  +
                    ::aws_smithy_http::event_stream::MessageStreamError,
         956  +
                >,
  927    957   
            >,
  928    958   
        >,
  929    959   
    }
  930    960   
    impl Builder {
  931    961   
        #[allow(missing_docs)] // documentation missing in model
  932    962   
        pub fn initial_data(mut self, input: ::std::string::String) -> Self {
  933    963   
            self.initial_data = Some(input);
  934    964   
            self
  935    965   
        }
  936    966   
        #[allow(missing_docs)] // documentation missing in model
  937    967   
        pub(crate) fn set_initial_data(
  938    968   
            mut self,
  939    969   
            input: impl ::std::convert::Into<::std::string::String>,
  940    970   
        ) -> Self {
  941    971   
            self.initial_data = Some(input.into());
  942    972   
            self
  943    973   
        }
  944    974   
        #[allow(missing_docs)] // documentation missing in model
  945    975   
        pub fn events(
  946    976   
            mut self,
  947         -
            input: crate::sigv4_event_stream::SigV4Receiver<
  948         -
                crate::model::Events,
  949         -
                ::aws_smithy_http::event_stream::MessageStreamError,
         977  +
            input: ::aws_smithy_http::event_stream::Receiver<
         978  +
                crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
         979  +
                crate::sigv4_event_stream::SignedEventError<
         980  +
                    ::aws_smithy_http::event_stream::MessageStreamError,
         981  +
                >,
  950    982   
            >,
  951    983   
        ) -> Self {
  952    984   
            self.events = Some(input);
  953    985   
            self
  954    986   
        }
  955    987   
        #[allow(missing_docs)] // documentation missing in model
  956    988   
        pub(crate) fn set_events(
  957    989   
            mut self,
  958    990   
            input: impl ::std::convert::Into<
  959         -
                crate::sigv4_event_stream::SigV4Receiver<
  960         -
                    crate::model::Events,
  961         -
                    ::aws_smithy_http::event_stream::MessageStreamError,
         991  +
                ::aws_smithy_http::event_stream::Receiver<
         992  +
                    crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
         993  +
                    crate::sigv4_event_stream::SignedEventError<
         994  +
                        ::aws_smithy_http::event_stream::MessageStreamError,
         995  +
                    >,
  962    996   
                >,
  963    997   
            >,
  964    998   
        ) -> Self {
  965    999   
            self.events = Some(input.into());
  966   1000   
            self
  967   1001   
        }
  968   1002   
        /// Consumes the builder and constructs a [`StreamingOperationWithInitialDataInput`](crate::input::StreamingOperationWithInitialDataInput).
  969   1003   
        ///
  970   1004   
        /// The builder fails to construct a [`StreamingOperationWithInitialDataInput`](crate::input::StreamingOperationWithInitialDataInput) if a [`ConstraintViolation`] occurs.
  971   1005   
        ///
@@ -1031,1065 +1115,1155 @@
 1051   1085   
        type Error = ConstraintViolation;
 1052   1086   
 1053   1087   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
 1054   1088   
            builder.build()
 1055   1089   
        }
 1056   1090   
    }
 1057   1091   
    /// A builder for [`StreamingOperationInput`](crate::input::StreamingOperationInput).
 1058   1092   
    #[derive(::std::default::Default, ::std::fmt::Debug)]
 1059   1093   
    pub struct Builder {
 1060   1094   
        pub(crate) events: ::std::option::Option<
 1061         -
            crate::sigv4_event_stream::SigV4Receiver<
 1062         -
                crate::model::Events,
 1063         -
                ::aws_smithy_http::event_stream::MessageStreamError,
        1095  +
            ::aws_smithy_http::event_stream::Receiver<
        1096  +
                crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
        1097  +
                crate::sigv4_event_stream::SignedEventError<
        1098  +
                    ::aws_smithy_http::event_stream::MessageStreamError,
        1099  +
                >,
 1064   1100   
            >,
 1065   1101   
        >,
 1066   1102   
    }
 1067   1103   
    impl Builder {
 1068   1104   
        #[allow(missing_docs)] // documentation missing in model
 1069   1105   
        pub fn events(
 1070   1106   
            mut self,
 1071         -
            input: crate::sigv4_event_stream::SigV4Receiver<
 1072         -
                crate::model::Events,
 1073         -
                ::aws_smithy_http::event_stream::MessageStreamError,
        1107  +
            input: ::aws_smithy_http::event_stream::Receiver<
        1108  +
                crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
        1109  +
                crate::sigv4_event_stream::SignedEventError<
        1110  +
                    ::aws_smithy_http::event_stream::MessageStreamError,
        1111  +
                >,
 1074   1112   
            >,
 1075   1113   
        ) -> Self {
 1076   1114   
            self.events = Some(input);
 1077   1115   
            self
 1078   1116   
        }
 1079   1117   
        #[allow(missing_docs)] // documentation missing in model
 1080   1118   
        pub(crate) fn set_events(
 1081   1119   
            mut self,
 1082   1120   
            input: impl ::std::convert::Into<
 1083         -
                crate::sigv4_event_stream::SigV4Receiver<
 1084         -
                    crate::model::Events,
 1085         -
                    ::aws_smithy_http::event_stream::MessageStreamError,
        1121  +
                ::aws_smithy_http::event_stream::Receiver<
        1122  +
                    crate::sigv4_event_stream::SignedEvent<crate::model::Events>,
        1123  +
                    crate::sigv4_event_stream::SignedEventError<
        1124  +
                        ::aws_smithy_http::event_stream::MessageStreamError,
        1125  +
                    >,
 1086   1126   
                >,
 1087   1127   
            >,
 1088   1128   
        ) -> Self {
 1089   1129   
            self.events = Some(input.into());
 1090   1130   
            self
 1091   1131   
        }
 1092   1132   
        /// Consumes the builder and constructs a [`StreamingOperationInput`](crate::input::StreamingOperationInput).
 1093   1133   
        ///
 1094   1134   
        /// The builder fails to construct a [`StreamingOperationInput`](crate::input::StreamingOperationInput) if a [`ConstraintViolation`] occurs.
 1095   1135   
        ///

tmp-codegen-diff/codegen-server-test/rpcv2Cbor_extras_no_initial_response/rust-server-codegen/src/lib.rs

@@ -265,265 +300,299 @@
  285    285   
mod service;
  286    286   
  287    287   
/// Data primitives referenced by other data types.
  288    288   
pub mod types;
  289    289   
  290    290   
/// Unconstrained types for constrained shapes.
  291    291   
mod unconstrained;
  292    292   
  293    293   
mod mimes;
  294    294   
  295         -
/// Support structures for SigV4 signed event streams
  296         -
pub mod sigv4_event_stream;
         295  +
mod sigv4_event_stream;
  297    296   
  298    297   
mod event_stream_serde;
  299    298   
  300    299   
pub(crate) mod protocol_serde;