Server Test

Server Test

rev. 4086b1854579bc6eae24dce129090ceaa6b97f5e

Files changed:

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

@@ -1,1 +14,12 @@
    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         -
    Ok(::aws_smithy_http::event_stream::Receiver::new(
   11         -
        unmarshaller,
   12         -
        body,
   13         -
    ))
          10  +
    let receiver = ::aws_smithy_http::event_stream::Receiver::new(unmarshaller, body);
          11  +
    Ok(receiver)
   14     12   
}

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 +14,12 @@
    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         -
    Ok(::aws_smithy_http::event_stream::Receiver::new(
   11         -
        unmarshaller,
   12         -
        body,
   13         -
    ))
          10  +
    let receiver = ::aws_smithy_http::event_stream::Receiver::new(unmarshaller, body);
          11  +
    Ok(receiver)
   14     12   
}

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

@@ -1,1 +17,15 @@
    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         -
    Ok(::aws_smithy_http::event_stream::Receiver::new(
   14         -
        unmarshaller,
   15         -
        body,
   16         -
    ))
          13  +
    let receiver = ::aws_smithy_http::event_stream::Receiver::new(unmarshaller, body);
          14  +
    Ok(receiver)
   17     15   
}

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

@@ -1,1 +29,27 @@
    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         -
    Ok(::aws_smithy_http::event_stream::Receiver::new(
   14         -
        unmarshaller,
   15         -
        body,
   16         -
    ))
          13  +
    let receiver = ::aws_smithy_http::event_stream::Receiver::new(unmarshaller, body);
          14  +
    Ok(receiver)
   17     15   
}
   18     16   
   19     17   
pub fn de_region(
   20     18   
    value: &str,
   21     19   
) -> std::result::Result<
   22     20   
    ::std::string::String,
   23     21   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   24     22   
> {
   25     23   
    let value = ::percent_encoding::percent_decode_str(value)
   26     24   
        .decode_utf8()?

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

@@ -1,1 +52,53 @@
   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"]
   23     24   
[dependencies.aws-smithy-types]
   24     25   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-types"
   25     26   
[dependencies.bytes]
   26     27   
version = "1.4.0"
   27     28   
[dependencies.futures-util]
   28     29   
version = "0.3"
   29     30   
[dependencies.http]
   30     31   
version = "0.2.9"
   31     32   
[dependencies.hyper]
   32     33   
version = "0.14.26"

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

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

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

@@ -265,265 +299,300 @@
  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         -
mod sigv4_event_stream;
         295  +
/// Support structures for SigV4 signed event streams
         296  +
pub mod sigv4_event_stream;
  296    297   
  297    298   
mod event_stream_serde;
  298    299   
  299    300   
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 +20,15 @@
    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         -
    ::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         -
        >,
           5  +
    crate::sigv4_event_stream::SigV4Receiver<
           6  +
        crate::model::Events,
           7  +
        ::aws_smithy_http::event_stream::MessageStreamError,
   10      8   
    >,
   11      9   
    ::aws_smithy_cbor::decode::DeserializeError,
   12     10   
> {
   13     11   
    let unmarshaller = crate::event_stream_serde::EventsUnmarshaller::new();
   14         -
    let unmarshaller = crate::sigv4_event_stream::SigV4Unmarshaller::new(unmarshaller);
   15     12   
    let body = std::mem::replace(body, ::aws_smithy_types::body::SdkBody::taken());
   16         -
    Ok(::aws_smithy_http::event_stream::Receiver::new(
   17         -
        unmarshaller,
   18         -
        body,
   19         -
    ))
          13  +
    let receiver = crate::sigv4_event_stream::SigV4Receiver::new(unmarshaller, body);
          14  +
    Ok(receiver)
   20     15   
}

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

@@ -1,1 +20,15 @@
    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         -
    ::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         -
        >,
           5  +
    crate::sigv4_event_stream::SigV4Receiver<
           6  +
        crate::model::Events,
           7  +
        ::aws_smithy_http::event_stream::MessageStreamError,
   10      8   
    >,
   11      9   
    ::aws_smithy_cbor::decode::DeserializeError,
   12     10   
> {
   13     11   
    let unmarshaller = crate::event_stream_serde::EventsUnmarshaller::new();
   14         -
    let unmarshaller = crate::sigv4_event_stream::SigV4Unmarshaller::new(unmarshaller);
   15     12   
    let body = std::mem::replace(body, ::aws_smithy_types::body::SdkBody::taken());
   16         -
    Ok(::aws_smithy_http::event_stream::Receiver::new(
   17         -
        unmarshaller,
   18         -
        body,
   19         -
    ))
          13  +
    let receiver = crate::sigv4_event_stream::SigV4Receiver::new(unmarshaller, body);
          14  +
    Ok(receiver)
   20     15   
}

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

@@ -1,1 +20,15 @@
    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         -
    ::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         -
        >,
           5  +
    crate::sigv4_event_stream::SigV4Receiver<
           6  +
        crate::model::Events,
           7  +
        ::aws_smithy_http::event_stream::MessageStreamError,
   10      8   
    >,
   11      9   
    ::aws_smithy_cbor::decode::DeserializeError,
   12     10   
> {
   13     11   
    let unmarshaller = crate::event_stream_serde::EventsUnmarshaller::new();
   14         -
    let unmarshaller = crate::sigv4_event_stream::SigV4Unmarshaller::new(unmarshaller);
   15     12   
    let body = std::mem::replace(body, ::aws_smithy_types::body::SdkBody::taken());
   16         -
    Ok(::aws_smithy_http::event_stream::Receiver::new(
   17         -
        unmarshaller,
   18         -
        body,
   19         -
    ))
          13  +
    let receiver = crate::sigv4_event_stream::SigV4Receiver::new(unmarshaller, body);
          14  +
    Ok(receiver)
   20     15   
}

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

@@ -1,1 +20,15 @@
    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         -
    ::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         -
        >,
           5  +
    crate::sigv4_event_stream::SigV4Receiver<
           6  +
        crate::model::Events,
           7  +
        ::aws_smithy_http::event_stream::MessageStreamError,
   10      8   
    >,
   11      9   
    ::aws_smithy_cbor::decode::DeserializeError,
   12     10   
> {
   13     11   
    let unmarshaller = crate::event_stream_serde::EventsUnmarshaller::new();
   14         -
    let unmarshaller = crate::sigv4_event_stream::SigV4Unmarshaller::new(unmarshaller);
   15     12   
    let body = std::mem::replace(body, ::aws_smithy_types::body::SdkBody::taken());
   16         -
    Ok(::aws_smithy_http::event_stream::Receiver::new(
   17         -
        unmarshaller,
   18         -
        body,
   19         -
    ))
          13  +
    let receiver = crate::sigv4_event_stream::SigV4Receiver::new(unmarshaller, body);
          14  +
    Ok(receiver)
   20     15   
}

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

@@ -1,1 +155,249 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
/// Wrapper for event stream messages that may be signed
           2  +
/// Receiver wrapper that handles SigV4 signed event stream messages
    3      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  +
/// Wrapper for event stream messages that may be signed
         101  +
#[derive(Debug, Clone)]
    4    102   
pub struct SignedEvent<T> {
    5    103   
    /// The actual event message
    6    104   
    pub message: T,
    7    105   
    /// Signature information if the message was signed
    8    106   
    pub signature: ::std::option::Option<crate::sigv4_event_stream::SignatureInfo>,
    9    107   
}
   10    108   
   11    109   
/// Error wrapper for signed event stream errors
   12    110   
#[derive(Debug)]
   13    111   
pub enum SignedEventError<E> {
   14    112   
    /// Error from the underlying event stream
   15    113   
    Event(E),
   16    114   
    /// Error extracting signed message
   17    115   
    InvalidSignedEvent(crate::sigv4_event_stream::ExtractionError),
   18    116   
}
   19    117   
   20    118   
impl<E> From<E> for SignedEventError<E> {
   21    119   
    fn from(err: E) -> Self {
   22    120   
        SignedEventError::Event(err)
   23    121   
    }
   24    122   
}
   25    123   
   26    124   
/// Information extracted from a signed event stream message
   27    125   
#[non_exhaustive]
   28         -
#[derive(Debug, Clone)]
         126  +
#[derive(Debug, Clone, PartialEq)]
   29    127   
pub struct SignatureInfo {
   30    128   
    /// The chunk signature bytes from the `:chunk-signature` header
   31    129   
    pub chunk_signature: Vec<u8>,
   32    130   
    /// The timestamp from the `:date` header
   33    131   
    pub timestamp: ::std::time::SystemTime,
   34    132   
}
   35    133   
   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         -
   50    134   
/// Unmarshaller wrapper that handles SigV4 signed event stream messages
   51    135   
#[derive(Debug)]
   52    136   
pub struct SigV4Unmarshaller<T> {
   53    137   
    inner: T,
   54    138   
}
   55    139   
   56    140   
impl<T> SigV4Unmarshaller<T> {
   57    141   
    pub fn new(inner: T) -> Self {
   58    142   
        Self { inner }
   59    143   
    }
   60    144   
}
   61    145   
   62    146   
impl<T> ::aws_smithy_eventstream::frame::UnmarshallMessage for SigV4Unmarshaller<T>
   63    147   
where
   64    148   
    T: ::aws_smithy_eventstream::frame::UnmarshallMessage,
   65    149   
{
   66    150   
    type Output = crate::sigv4_event_stream::SignedEvent<T::Output>;
   67    151   
    type Error = crate::sigv4_event_stream::SignedEventError<T::Error>;
   68    152   
   69    153   
    fn unmarshall(
   70    154   
        &self,
   71    155   
        message: &::aws_smithy_types::event_stream::Message,
   72    156   
    ) -> ::std::result::Result<
   73    157   
        ::aws_smithy_eventstream::frame::UnmarshalledMessage<Self::Output, Self::Error>,
   74    158   
        ::aws_smithy_eventstream::error::Error,
   75    159   
    > {
   76    160   
        // First, try to extract the signed message
   77    161   
        match crate::sigv4_event_stream::extract_signed_message(message) {
   78         -
            Ok(MaybeSignedMessage::Signed {
         162  +
            ::std::result::Result::Ok(MaybeSignedMessage::Signed {
   79    163   
                message: inner_message,
   80    164   
                signature,
   81    165   
            }) => {
   82    166   
                // Process the inner message with the base unmarshaller
   83    167   
                match self.inner.unmarshall(&inner_message) {
   84         -
                    Ok(unmarshalled) => match unmarshalled {
         168  +
                    ::std::result::Result::Ok(unmarshalled) => match unmarshalled {
   85    169   
                        ::aws_smithy_eventstream::frame::UnmarshalledMessage::Event(event) => {
   86         -
                            Ok(::aws_smithy_eventstream::frame::UnmarshalledMessage::Event(
   87         -
                                crate::sigv4_event_stream::SignedEvent {
   88         -
                                    message: event,
   89         -
                                    signature: Some(signature),
   90         -
                                },
   91         -
                            ))
         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  +
                            )
   92    178   
                        }
   93    179   
                        ::aws_smithy_eventstream::frame::UnmarshalledMessage::Error(err) => {
   94         -
                            Ok(::aws_smithy_eventstream::frame::UnmarshalledMessage::Error(
   95         -
                                crate::sigv4_event_stream::SignedEventError::Event(err),
   96         -
                            ))
         180  +
                            ::std::result::Result::Ok(
         181  +
                                ::aws_smithy_eventstream::frame::UnmarshalledMessage::Error(
         182  +
                                    crate::sigv4_event_stream::SignedEventError::Event(err),
         183  +
                                ),
         184  +
                            )
   97    185   
                        }
   98    186   
                    },
   99         -
                    Err(err) => Err(err),
         187  +
                    ::std::result::Result::Err(err) => ::std::result::Result::Err(err),
  100    188   
                }
  101    189   
            }
  102         -
            Ok(MaybeSignedMessage::Unsigned) => {
         190  +
            ::std::result::Result::Ok(MaybeSignedMessage::Unsigned) => {
  103    191   
                // Process unsigned message directly
  104    192   
                match self.inner.unmarshall(message) {
  105         -
                    Ok(unmarshalled) => match unmarshalled {
         193  +
                    ::std::result::Result::Ok(unmarshalled) => match unmarshalled {
  106    194   
                        ::aws_smithy_eventstream::frame::UnmarshalledMessage::Event(event) => {
  107         -
                            Ok(::aws_smithy_eventstream::frame::UnmarshalledMessage::Event(
  108         -
                                crate::sigv4_event_stream::SignedEvent {
  109         -
                                    message: event,
  110         -
                                    signature: None,
  111         -
                                },
  112         -
                            ))
         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  +
                            )
  113    203   
                        }
  114    204   
                        ::aws_smithy_eventstream::frame::UnmarshalledMessage::Error(err) => {
  115         -
                            Ok(::aws_smithy_eventstream::frame::UnmarshalledMessage::Error(
  116         -
                                crate::sigv4_event_stream::SignedEventError::Event(err),
  117         -
                            ))
         205  +
                            ::std::result::Result::Ok(
         206  +
                                ::aws_smithy_eventstream::frame::UnmarshalledMessage::Error(
         207  +
                                    crate::sigv4_event_stream::SignedEventError::Event(err),
         208  +
                                ),
         209  +
                            )
  118    210   
                        }
  119    211   
                    },
  120         -
                    Err(err) => Err(err),
         212  +
                    ::std::result::Result::Err(err) => ::std::result::Result::Err(err),
  121    213   
                }
  122    214   
            }
  123         -
            Err(extraction_err) => Ok(::aws_smithy_eventstream::frame::UnmarshalledMessage::Error(
  124         -
                crate::sigv4_event_stream::SignedEventError::InvalidSignedEvent(extraction_err),
  125         -
            )),
         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  +
            ),
  126    220   
        }
  127    221   
    }
  128    222   
}
  129    223   
  130    224   
/// Result of extracting a potentially signed message
  131    225   
#[derive(Debug)]
  132    226   
pub enum MaybeSignedMessage {
  133    227   
    /// Message was signed and has been extracted
  134    228   
    Signed {
  135    229   
        /// The inner message that was signed
@@ -166,260 +0,325 @@
  186    280   
        .map_err(|err| crate::sigv4_event_stream::ExtractionError::InvalidPayload { error: err })?;
  187    281   
  188    282   
    Ok(MaybeSignedMessage::Signed {
  189    283   
        message: inner_message,
  190    284   
        signature: crate::sigv4_event_stream::SignatureInfo {
  191    285   
            chunk_signature,
  192    286   
            timestamp,
  193    287   
        },
  194    288   
    })
  195    289   
}
         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 +52,53 @@
   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"]
   23     24   
[dependencies.aws-smithy-types]
   24     25   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-types"
   25     26   
[dependencies.futures-util]
   26     27   
version = "0.3"
   27     28   
[dependencies.http]
   28     29   
version = "0.2.9"
   29     30   
[dependencies.hyper]
   30     31   
version = "0.14.26"
   31     32   
[dependencies.mime]
   32     33   
version = "0.3"

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

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

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

@@ -265,265 +299,300 @@
  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         -
mod sigv4_event_stream;
         295  +
/// Support structures for SigV4 signed event streams
         296  +
pub mod sigv4_event_stream;
  296    297   
  297    298   
mod event_stream_serde;
  298    299   
  299    300   
pub(crate) mod protocol_serde;