Client Test

Client Test

rev. ec7b2441254af868911fccffe8d8dca83aff0045 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/required_header_collection_operation/_required_header_collection_operation_output.rs

@@ -5,5 +172,255 @@
   25     25   
    "aws.protocoltests.misc.synthetic",
   26     26   
    "RequiredHeaderCollectionOperationOutput",
   27     27   
);
   28     28   
static REQUIREDHEADERCOLLECTIONOPERATIONOUTPUT_MEMBER_REQUIRED_HEADER_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   29     29   
    ::aws_smithy_schema::ShapeId::from_static(
   30     30   
        "aws.protocoltests.misc.synthetic#RequiredHeaderCollectionOperationOutput$requiredHeaderList",
   31     31   
        "aws.protocoltests.misc.synthetic",
   32     32   
        "RequiredHeaderCollectionOperationOutput",
   33     33   
    ),
   34     34   
    ::aws_smithy_schema::ShapeType::List,
   35         -
    "required_header_list",
          35  +
    "requiredHeaderList",
   36     36   
    0,
   37     37   
)
   38     38   
.with_http_header("X-Required-List");
   39     39   
static REQUIREDHEADERCOLLECTIONOPERATIONOUTPUT_MEMBER_REQUIRED_HEADER_SET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   40     40   
    ::aws_smithy_schema::ShapeId::from_static(
   41     41   
        "aws.protocoltests.misc.synthetic#RequiredHeaderCollectionOperationOutput$requiredHeaderSet",
   42     42   
        "aws.protocoltests.misc.synthetic",
   43     43   
        "RequiredHeaderCollectionOperationOutput",
   44     44   
    ),
   45     45   
    ::aws_smithy_schema::ShapeType::List,
   46         -
    "required_header_set",
          46  +
    "requiredHeaderSet",
   47     47   
    1,
   48     48   
)
   49     49   
.with_http_header("X-Required-Set");
   50     50   
static REQUIREDHEADERCOLLECTIONOPERATIONOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   51     51   
    REQUIREDHEADERCOLLECTIONOPERATIONOUTPUT_SCHEMA_ID,
   52     52   
    ::aws_smithy_schema::ShapeType::Structure,
   53     53   
    &[
   54     54   
        &REQUIREDHEADERCOLLECTIONOPERATIONOUTPUT_MEMBER_REQUIRED_HEADER_LIST,
   55     55   
        &REQUIREDHEADERCOLLECTIONOPERATIONOUTPUT_MEMBER_REQUIRED_HEADER_SET,
   56     56   
    ],
   57     57   
);
   58     58   
impl RequiredHeaderCollectionOperationOutput {
   59     59   
    /// The schema for this shape.
   60     60   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &REQUIREDHEADERCOLLECTIONOPERATIONOUTPUT_SCHEMA;
   61     61   
}
   62     62   
impl ::aws_smithy_schema::serde::SerializableStruct for RequiredHeaderCollectionOperationOutput {
   63     63   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   64     64   
    fn serialize_members(
   65     65   
        &self,
   66     66   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   67     67   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   68     68   
        {
   69     69   
            let val = &self.required_header_list;
   70     70   
   71     71   
            ser.write_list(
   72     72   
                &REQUIREDHEADERCOLLECTIONOPERATIONOUTPUT_MEMBER_REQUIRED_HEADER_LIST,
   73     73   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   74     74   
                    for item in val {
   75     75   
                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
   76     76   
                    }
   77     77   
                    Ok(())
   78     78   
                },
   79     79   
            )?;
   80     80   
        }
   81     81   
        {
   82     82   
            let val = &self.required_header_set;
   83     83   
   84     84   
            ser.write_list(
   85     85   
                &REQUIREDHEADERCOLLECTIONOPERATIONOUTPUT_MEMBER_REQUIRED_HEADER_SET,
   86     86   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   87     87   
                    for item in val {
   88     88   
                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
   89     89   
                    }
   90     90   
                    Ok(())
   91     91   
                },
   92     92   
            )?;
   93     93   
        }
   94     94   
        Ok(())
   95     95   
    }
   96     96   
}
   97     97   
impl RequiredHeaderCollectionOperationOutput {
   98     98   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   99         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  100         -
        deserializer: &mut D,
          99  +
    pub fn deserialize(
         100  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  101    101   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  102    102   
        #[allow(unused_variables, unused_mut)]
  103    103   
        let mut builder = Self::builder();
  104    104   
        #[allow(
  105    105   
            unused_variables,
  106    106   
            unreachable_code,
  107    107   
            clippy::single_match,
  108    108   
            clippy::match_single_binding,
  109    109   
            clippy::diverging_sub_expression
  110    110   
        )]
  111         -
        deserializer.read_struct(&REQUIREDHEADERCOLLECTIONOPERATIONOUTPUT_SCHEMA, (), |_, member, deser| {
         111  +
        deserializer.read_struct(&REQUIREDHEADERCOLLECTIONOPERATIONOUTPUT_SCHEMA, &mut |member, deser| {
  112    112   
            match member.member_index() {
  113    113   
                Some(0) => {
  114         -
                    builder.required_header_list = Some({
  115         -
                        let container = if let Some(cap) = deser.container_size() {
  116         -
                            Vec::with_capacity(cap)
  117         -
                        } else {
  118         -
                            Vec::new()
  119         -
                        };
  120         -
                        deser.read_list(member, container, |mut list, deser| {
  121         -
                            list.push(deser.read_string(member)?);
  122         -
                            Ok(list)
  123         -
                        })?
  124         -
                    });
         114  +
                    builder.required_header_list = Some(deser.read_string_list(member)?);
  125    115   
                }
  126    116   
                Some(1) => {
  127         -
                    builder.required_header_set = Some({
  128         -
                        let container = if let Some(cap) = deser.container_size() {
  129         -
                            Vec::with_capacity(cap)
  130         -
                        } else {
  131         -
                            Vec::new()
  132         -
                        };
  133         -
                        deser.read_list(member, container, |mut list, deser| {
  134         -
                            list.push(deser.read_string(member)?);
  135         -
                            Ok(list)
  136         -
                        })?
  137         -
                    });
         117  +
                    builder.required_header_set = Some(deser.read_string_list(member)?);
  138    118   
                }
  139    119   
                _ => {}
  140    120   
            }
  141    121   
            Ok(())
  142    122   
        })?;
         123  +
        builder.required_header_list = builder.required_header_list.or(Some(Vec::new()));
         124  +
        builder.required_header_set = builder.required_header_set.or(Some(Vec::new()));
         125  +
        builder
         126  +
            .build()
         127  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
         128  +
    }
         129  +
}
         130  +
impl RequiredHeaderCollectionOperationOutput {
         131  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         132  +
    /// Header-bound members are read directly from headers, avoiding runtime
         133  +
    /// member iteration overhead. Body members are read via the deserializer.
         134  +
    pub fn deserialize_with_response(
         135  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         136  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         137  +
        _status: u16,
         138  +
        _body: &[u8],
         139  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         140  +
        #[allow(unused_variables, unused_mut)]
         141  +
        let mut builder = Self::builder();
         142  +
        if let Some(val) = headers.get("X-Required-List") {
         143  +
            builder.required_header_list = {
         144  +
                let mut items = Vec::new();
         145  +
                let mut chars = val.chars().peekable();
         146  +
                while chars.peek().is_some() {
         147  +
                    // Skip whitespace
         148  +
                    while chars.peek() == Some(&' ') {
         149  +
                        chars.next();
         150  +
                    }
         151  +
                    if chars.peek() == Some(&'"') {
         152  +
                        chars.next(); // skip opening quote
         153  +
                        let mut s = String::new();
         154  +
                        while let Some(&c) = chars.peek() {
         155  +
                            if c == '\\' {
         156  +
                                chars.next();
         157  +
                                if let Some(escaped) = chars.next() {
         158  +
                                    s.push(escaped);
         159  +
                                }
         160  +
                            } else if c == '"' {
         161  +
                                chars.next();
         162  +
                                break;
         163  +
                            } else {
         164  +
                                s.push(c);
         165  +
                                chars.next();
         166  +
                            }
         167  +
                        }
         168  +
                        items.push(s);
         169  +
                    } else {
         170  +
                        let s: String = chars.by_ref().take_while(|&c| c != ',').collect();
         171  +
                        let trimmed = s.trim();
         172  +
                        if !trimmed.is_empty() {
         173  +
                            items.push(trimmed.to_string());
         174  +
                        }
         175  +
                    }
         176  +
                    // Skip comma separator
         177  +
                    while chars.peek() == Some(&',') || chars.peek() == Some(&' ') {
         178  +
                        chars.next();
         179  +
                    }
         180  +
                }
         181  +
                Some(items)
         182  +
            };
         183  +
        }
         184  +
        if let Some(val) = headers.get("X-Required-Set") {
         185  +
            builder.required_header_set = {
         186  +
                let mut items = Vec::new();
         187  +
                let mut chars = val.chars().peekable();
         188  +
                while chars.peek().is_some() {
         189  +
                    // Skip whitespace
         190  +
                    while chars.peek() == Some(&' ') {
         191  +
                        chars.next();
         192  +
                    }
         193  +
                    if chars.peek() == Some(&'"') {
         194  +
                        chars.next(); // skip opening quote
         195  +
                        let mut s = String::new();
         196  +
                        while let Some(&c) = chars.peek() {
         197  +
                            if c == '\\' {
         198  +
                                chars.next();
         199  +
                                if let Some(escaped) = chars.next() {
         200  +
                                    s.push(escaped);
         201  +
                                }
         202  +
                            } else if c == '"' {
         203  +
                                chars.next();
         204  +
                                break;
         205  +
                            } else {
         206  +
                                s.push(c);
         207  +
                                chars.next();
         208  +
                            }
         209  +
                        }
         210  +
                        items.push(s);
         211  +
                    } else {
         212  +
                        let s: String = chars.by_ref().take_while(|&c| c != ',').collect();
         213  +
                        let trimmed = s.trim();
         214  +
                        if !trimmed.is_empty() {
         215  +
                            items.push(trimmed.to_string());
         216  +
                        }
         217  +
                    }
         218  +
                    // Skip comma separator
         219  +
                    while chars.peek() == Some(&',') || chars.peek() == Some(&' ') {
         220  +
                        chars.next();
         221  +
                    }
         222  +
                }
         223  +
                Some(items)
         224  +
            };
         225  +
        }
  143    226   
        builder
  144    227   
            .build()
  145    228   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  146    229   
    }
  147    230   
}
  148    231   
impl RequiredHeaderCollectionOperationOutput {
  149    232   
    /// Creates a new builder-style object to manufacture [`RequiredHeaderCollectionOperationOutput`](crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationOutput).
  150    233   
    pub fn builder() -> crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationOutputBuilder {
  151    234   
        crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationOutputBuilder::default()
  152    235   
    }

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/required_inner_shape_operation.rs

@@ -1,1 +40,46 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `RequiredInnerShapeOperation`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct RequiredInnerShapeOperation;
    6      6   
impl RequiredInnerShapeOperation {
    7      7   
    /// Creates a new `RequiredInnerShapeOperation`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          13  +
        crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput::SCHEMA;
   11     17   
    pub(crate) async fn orchestrate(
   12     18   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     19   
        input: crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +234,277 @@
  130    136   
                crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError,
  131    137   
            >::new());
  132    138   
  133    139   
        ::std::borrow::Cow::Owned(rcb)
  134    140   
    }
  135    141   
}
  136    142   
  137    143   
#[derive(Debug)]
  138    144   
struct RequiredInnerShapeOperationResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for RequiredInnerShapeOperationResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         146  +
    fn deserialize_nonstreaming_with_config(
  141    147   
        &self,
  142    148   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         149  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    150   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    151   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         152  +
        #[allow(unused_mut)]
         153  +
        let mut force_error = false;
         154  +
         155  +
        if !success && status != 200 || force_error {
  145    156   
            let headers = response.headers();
  146    157   
            let body = response.body().bytes().expect("body loaded");
  147    158   
            #[allow(unused_mut)]
  148         -
        let mut force_error = false;
         159  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         160  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         161  +
            })?;
  149    162   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_required_inner_shape_operation::de_required_inner_shape_operation_http_error(status, headers, body)
  152         -
        } else {
  153         -
            crate::protocol_serde::shape_required_inner_shape_operation::de_required_inner_shape_operation_http_response(status, headers, body)
         163  +
            let generic = generic_builder.build();
         164  +
            let error_code = match generic.code() {
         165  +
                ::std::option::Option::Some(code) => code,
         166  +
                ::std::option::Option::None => {
         167  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         168  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(
         169  +
                            crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::unhandled(generic),
         170  +
                        ),
         171  +
                    ))
         172  +
                }
         173  +
            };
         174  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         175  +
            let protocol = _cfg
         176  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         177  +
                .expect("a SharedClientProtocol is required");
         178  +
            let err = match error_code {
         179  +
                "ValidationException" => crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::ValidationError({
         180  +
                    let mut tmp = match protocol
         181  +
                        .deserialize_response(response, crate::types::error::ValidationError::SCHEMA, _cfg)
         182  +
                        .and_then(|mut deser| {
         183  +
                            crate::types::error::ValidationError::deserialize_with_response(
         184  +
                                &mut *deser,
         185  +
                                response.headers(),
         186  +
                                response.status().into(),
         187  +
                                body,
         188  +
                            )
         189  +
                        }) {
         190  +
                        ::std::result::Result::Ok(val) => val,
         191  +
                        ::std::result::Result::Err(e) => {
         192  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         193  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         194  +
                            ))
         195  +
                        }
         196  +
                    };
         197  +
                    tmp.meta = generic;
         198  +
                    tmp
         199  +
                }),
         200  +
                _ => crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::generic(generic),
  154    201   
            };
  155         -
        crate::protocol_serde::type_erase_result(parse_result)
         202  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         203  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         204  +
            ))
         205  +
        } else {
         206  +
            let protocol = _cfg
         207  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         208  +
                .expect("a SharedClientProtocol is required");
         209  +
            let mut deser = protocol
         210  +
                .deserialize_response(response, RequiredInnerShapeOperation::OUTPUT_SCHEMA, _cfg)
         211  +
                .map_err(|e| {
         212  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         213  +
                })?;
         214  +
            let body = response.body().bytes().expect("body loaded");
         215  +
            let output = crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput::deserialize_with_response(
         216  +
                &mut *deser,
         217  +
                response.headers(),
         218  +
                response.status().into(),
         219  +
                body,
         220  +
            )
         221  +
            .map_err(|e| {
         222  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         223  +
            })?;
         224  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         225  +
        }
  156    226   
    }
  157    227   
}
  158    228   
#[derive(Debug)]
  159    229   
struct RequiredInnerShapeOperationRequestSerializer;
  160    230   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for RequiredInnerShapeOperationRequestSerializer {
  161    231   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  162    232   
    fn serialize_input(
  163    233   
        &self,
  164    234   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  165    235   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  166    236   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  167    237   
        let input = input
  168    238   
            .downcast::<crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput>()
  169    239   
            .expect("correct type");
  170         -
        let _header_serialization_settings = _cfg
  171         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  172         -
            .cloned()
  173         -
            .unwrap_or_default();
  174         -
        let mut request_builder = {
  175         -
            #[allow(clippy::uninlined_format_args)]
  176         -
            fn uri_base(
  177         -
                _input: &crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput,
  178         -
                output: &mut ::std::string::String,
  179         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180         -
                use ::std::fmt::Write as _;
  181         -
                ::std::write!(output, "/requiredInnerShapeOperation").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput,
  187         -
                builder: ::http_1x::request::Builder,
  188         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189         -
                let mut uri = ::std::string::String::new();
  190         -
                uri_base(input, &mut uri)?;
  191         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  192         -
            }
  193         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  194         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
  195         -
            builder
  196         -
        };
  197         -
        let body = ::aws_smithy_types::body::SdkBody::from(
  198         -
            crate::protocol_serde::shape_required_inner_shape_operation::ser_required_inner_shape_operation_input(&input)?,
  199         -
        );
  200         -
        if let Some(content_length) = body.content_length() {
  201         -
            let content_length = content_length.to_string();
  202         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  203         -
        }
  204         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         240  +
        let protocol = _cfg
         241  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         242  +
            .expect("a SharedClientProtocol is required");
         243  +
        let mut request = protocol
         244  +
            .serialize_request(&input, RequiredInnerShapeOperation::INPUT_SCHEMA, "", _cfg)
         245  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         246  +
         247  +
        return ::std::result::Result::Ok(request);
  205    248   
    }
  206    249   
}
  207    250   
#[derive(Debug)]
  208    251   
struct RequiredInnerShapeOperationEndpointParamsInterceptor;
  209    252   
  210    253   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for RequiredInnerShapeOperationEndpointParamsInterceptor {
  211    254   
    fn name(&self) -> &'static str {
  212    255   
        "RequiredInnerShapeOperationEndpointParamsInterceptor"
  213    256   
    }
  214    257   

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/required_inner_shape_operation/_required_inner_shape_operation_input.rs

@@ -4,4 +108,120 @@
   24     24   
        "RequiredInnerShapeOperationInput",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::Structure,
   27     27   
    "inner",
   28     28   
    0,
   29     29   
);
   30     30   
static REQUIREDINNERSHAPEOPERATIONINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   31     31   
    REQUIREDINNERSHAPEOPERATIONINPUT_SCHEMA_ID,
   32     32   
    ::aws_smithy_schema::ShapeType::Structure,
   33     33   
    &[&REQUIREDINNERSHAPEOPERATIONINPUT_MEMBER_INNER],
   34         -
);
          34  +
)
          35  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/requiredInnerShapeOperation", None));
   35     36   
impl RequiredInnerShapeOperationInput {
   36     37   
    /// The schema for this shape.
   37     38   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &REQUIREDINNERSHAPEOPERATIONINPUT_SCHEMA;
   38     39   
}
   39     40   
impl ::aws_smithy_schema::serde::SerializableStruct for RequiredInnerShapeOperationInput {
   40     41   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   41     42   
    fn serialize_members(
   42     43   
        &self,
   43     44   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   44     45   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   45     46   
        if let Some(ref val) = self.inner {
   46     47   
            ser.write_struct(&REQUIREDINNERSHAPEOPERATIONINPUT_MEMBER_INNER, val)?;
   47     48   
        }
   48     49   
        Ok(())
   49     50   
    }
   50     51   
}
   51     52   
impl RequiredInnerShapeOperationInput {
   52     53   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   53         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   54         -
        deserializer: &mut D,
          54  +
    pub fn deserialize(
          55  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   55     56   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   56     57   
        #[allow(unused_variables, unused_mut)]
   57     58   
        let mut builder = Self::builder();
   58     59   
        #[allow(
   59     60   
            unused_variables,
   60     61   
            unreachable_code,
   61     62   
            clippy::single_match,
   62     63   
            clippy::match_single_binding,
   63     64   
            clippy::diverging_sub_expression
   64     65   
        )]
   65         -
        deserializer.read_struct(&REQUIREDINNERSHAPEOPERATIONINPUT_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&REQUIREDINNERSHAPEOPERATIONINPUT_SCHEMA, &mut |member, deser| {
   66     67   
            match member.member_index() {
   67     68   
                Some(0) => {
   68     69   
                    builder.inner = Some(crate::types::InnerShape::deserialize(deser)?);
   69     70   
                }
   70     71   
                _ => {}
   71     72   
            }
   72     73   
            Ok(())
   73     74   
        })?;
   74     75   
        builder
   75     76   
            .build()
   76     77   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   77     78   
    }
   78     79   
}
          80  +
impl RequiredInnerShapeOperationInput {
          81  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          82  +
    pub fn deserialize_with_response(
          83  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          84  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          85  +
        _status: u16,
          86  +
        _body: &[u8],
          87  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          88  +
        Self::deserialize(deserializer)
          89  +
    }
          90  +
}
   79     91   
impl RequiredInnerShapeOperationInput {
   80     92   
    /// Creates a new builder-style object to manufacture [`RequiredInnerShapeOperationInput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput).
   81     93   
    pub fn builder() -> crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationInputBuilder {
   82     94   
        crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationInputBuilder::default()
   83     95   
    }
   84     96   
}
   85     97   
   86     98   
/// A builder for [`RequiredInnerShapeOperationInput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput).
   87     99   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   88    100   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/required_inner_shape_operation/_required_inner_shape_operation_output.rs

@@ -23,23 +106,117 @@
   43     43   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   44     44   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   45     45   
        if let Some(ref val) = self.inner {
   46     46   
            ser.write_struct(&REQUIREDINNERSHAPEOPERATIONOUTPUT_MEMBER_INNER, val)?;
   47     47   
        }
   48     48   
        Ok(())
   49     49   
    }
   50     50   
}
   51     51   
impl RequiredInnerShapeOperationOutput {
   52     52   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   53         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   54         -
        deserializer: &mut D,
          53  +
    pub fn deserialize(
          54  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   55     55   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   56     56   
        #[allow(unused_variables, unused_mut)]
   57     57   
        let mut builder = Self::builder();
   58     58   
        #[allow(
   59     59   
            unused_variables,
   60     60   
            unreachable_code,
   61     61   
            clippy::single_match,
   62     62   
            clippy::match_single_binding,
   63     63   
            clippy::diverging_sub_expression
   64     64   
        )]
   65         -
        deserializer.read_struct(&REQUIREDINNERSHAPEOPERATIONOUTPUT_SCHEMA, (), |_, member, deser| {
          65  +
        deserializer.read_struct(&REQUIREDINNERSHAPEOPERATIONOUTPUT_SCHEMA, &mut |member, deser| {
   66     66   
            match member.member_index() {
   67     67   
                Some(0) => {
   68     68   
                    builder.inner = Some(crate::types::InnerShape::deserialize(deser)?);
   69     69   
                }
   70     70   
                _ => {}
   71     71   
            }
   72     72   
            Ok(())
   73     73   
        })?;
   74     74   
        Ok(builder.build())
   75     75   
    }
   76     76   
}
          77  +
impl RequiredInnerShapeOperationOutput {
          78  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          79  +
    pub fn deserialize_with_response(
          80  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          81  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          82  +
        _status: u16,
          83  +
        _body: &[u8],
          84  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          85  +
        Self::deserialize(deserializer)
          86  +
    }
          87  +
}
   77     88   
impl RequiredInnerShapeOperationOutput {
   78     89   
    /// Creates a new builder-style object to manufacture [`RequiredInnerShapeOperationOutput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput).
   79     90   
    pub fn builder() -> crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationOutputBuilder {
   80     91   
        crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationOutputBuilder::default()
   81     92   
    }
   82     93   
}
   83     94   
   84     95   
/// A builder for [`RequiredInnerShapeOperationOutput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput).
   85     96   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   86     97   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/response_code_default_operation.rs

@@ -1,1 +40,46 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `ResponseCodeDefaultOperation`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct ResponseCodeDefaultOperation;
    6      6   
impl ResponseCodeDefaultOperation {
    7      7   
    /// Creates a new `ResponseCodeDefaultOperation`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          13  +
        crate::operation::response_code_default_operation::ResponseCodeDefaultOperationInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput::SCHEMA;
   11     17   
    pub(crate) async fn orchestrate(
   12     18   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     19   
        input: crate::operation::response_code_default_operation::ResponseCodeDefaultOperationInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::response_code_default_operation::ResponseCodeDefaultOperationError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +228,241 @@
  130    136   
                crate::operation::response_code_default_operation::ResponseCodeDefaultOperationError,
  131    137   
            >::new());
  132    138   
  133    139   
        ::std::borrow::Cow::Owned(rcb)
  134    140   
    }
  135    141   
}
  136    142   
  137    143   
#[derive(Debug)]
  138    144   
struct ResponseCodeDefaultOperationResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ResponseCodeDefaultOperationResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         146  +
    fn deserialize_nonstreaming_with_config(
  141    147   
        &self,
  142    148   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         149  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    150   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    151   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         152  +
        #[allow(unused_mut)]
         153  +
        let mut force_error = false;
         154  +
         155  +
        if !success && status != 200 || force_error {
  145    156   
            let headers = response.headers();
  146    157   
            let body = response.body().bytes().expect("body loaded");
  147    158   
            #[allow(unused_mut)]
  148         -
        let mut force_error = false;
         159  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         160  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         161  +
            })?;
  149    162   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_response_code_default_operation::de_response_code_default_operation_http_error(status, headers, body)
         163  +
            let generic = generic_builder.build();
         164  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         165  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         166  +
                    crate::operation::response_code_default_operation::ResponseCodeDefaultOperationError::generic(generic),
         167  +
                ),
         168  +
            ))
  152    169   
        } else {
  153         -
            crate::protocol_serde::shape_response_code_default_operation::de_response_code_default_operation_http_response(status, headers, body)
  154         -
        };
  155         -
        crate::protocol_serde::type_erase_result(parse_result)
         170  +
            let protocol = _cfg
         171  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         172  +
                .expect("a SharedClientProtocol is required");
         173  +
            let mut deser = protocol
         174  +
                .deserialize_response(response, ResponseCodeDefaultOperation::OUTPUT_SCHEMA, _cfg)
         175  +
                .map_err(|e| {
         176  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         177  +
                })?;
         178  +
            let body = response.body().bytes().expect("body loaded");
         179  +
            let output = crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput::deserialize_with_response(
         180  +
                &mut *deser,
         181  +
                response.headers(),
         182  +
                response.status().into(),
         183  +
                body,
         184  +
            )
         185  +
            .map_err(|e| {
         186  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         187  +
            })?;
         188  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         189  +
        }
  156    190   
    }
  157    191   
}
  158    192   
#[derive(Debug)]
  159    193   
struct ResponseCodeDefaultOperationRequestSerializer;
  160    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ResponseCodeDefaultOperationRequestSerializer {
  161    195   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  162    196   
    fn serialize_input(
  163    197   
        &self,
  164    198   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  165    199   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  166    200   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  167    201   
        let input = input
  168    202   
            .downcast::<crate::operation::response_code_default_operation::ResponseCodeDefaultOperationInput>()
  169    203   
            .expect("correct type");
  170         -
        let _header_serialization_settings = _cfg
  171         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  172         -
            .cloned()
  173         -
            .unwrap_or_default();
  174         -
        let mut request_builder = {
  175         -
            #[allow(clippy::uninlined_format_args)]
  176         -
            fn uri_base(
  177         -
                _input: &crate::operation::response_code_default_operation::ResponseCodeDefaultOperationInput,
  178         -
                output: &mut ::std::string::String,
  179         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180         -
                use ::std::fmt::Write as _;
  181         -
                ::std::write!(output, "/responseCodeDefaultOperation").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::response_code_default_operation::ResponseCodeDefaultOperationInput,
  187         -
                builder: ::http_1x::request::Builder,
  188         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189         -
                let mut uri = ::std::string::String::new();
  190         -
                uri_base(input, &mut uri)?;
  191         -
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  192         -
            }
  193         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  194         -
            builder
  195         -
        };
  196         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
         204  +
        let protocol = _cfg
         205  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         206  +
            .expect("a SharedClientProtocol is required");
         207  +
        let mut request = protocol
         208  +
            .serialize_request(&input, ResponseCodeDefaultOperation::INPUT_SCHEMA, "", _cfg)
         209  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  197    210   
  198         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         211  +
        return ::std::result::Result::Ok(request);
  199    212   
    }
  200    213   
}
  201    214   
#[derive(Debug)]
  202    215   
struct ResponseCodeDefaultOperationEndpointParamsInterceptor;
  203    216   
  204    217   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ResponseCodeDefaultOperationEndpointParamsInterceptor {
  205    218   
    fn name(&self) -> &'static str {
  206    219   
        "ResponseCodeDefaultOperationEndpointParamsInterceptor"
  207    220   
    }
  208    221   
@@ -239,252 +299,322 @@
  259    272   
            .expect("the config must have a deserializer");
  260    273   
  261    274   
        let parsed = de.deserialize_streaming(&mut http_response);
  262    275   
        let parsed = parsed.unwrap_or_else(|| {
  263    276   
            let http_response = http_response.map(|body| {
  264    277   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  265    278   
                    body.bytes().unwrap(),
  266    279   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  267    280   
                )))
  268    281   
            });
  269         -
            de.deserialize_nonstreaming(&http_response)
         282  +
            // Build a config bag with the protocol for schema-based deserialization
         283  +
            #[allow(unused_mut)]
         284  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         285  +
            {
         286  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         287  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         288  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         289  +
                ));
         290  +
                test_cfg.push_shared_layer(layer.freeze());
         291  +
            }
         292  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  270    293   
        });
  271    294   
        let parsed = parsed
  272    295   
            .expect("should be successful response")
  273    296   
            .downcast::<crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput>()
  274    297   
            .unwrap();
  275    298   
    }
  276    299   
}
  277    300   
  278    301   
/// Error type for the `ResponseCodeDefaultOperationError` operation.
  279    302   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/response_code_default_operation/_response_code_default_operation_input.rs

@@ -1,1 +75,89 @@
    5      5   
pub struct ResponseCodeDefaultOperationInput {}
    6      6   
static RESPONSECODEDEFAULTOPERATIONINPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static(
    7      7   
    "aws.protocoltests.misc.synthetic#ResponseCodeDefaultOperationInput",
    8      8   
    "aws.protocoltests.misc.synthetic",
    9      9   
    "ResponseCodeDefaultOperationInput",
   10     10   
);
   11     11   
static RESPONSECODEDEFAULTOPERATIONINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   12     12   
    RESPONSECODEDEFAULTOPERATIONINPUT_SCHEMA_ID,
   13     13   
    ::aws_smithy_schema::ShapeType::Structure,
   14     14   
    &[],
   15         -
);
          15  +
)
          16  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("GET", "/responseCodeDefaultOperation", None));
   16     17   
impl ResponseCodeDefaultOperationInput {
   17     18   
    /// The schema for this shape.
   18     19   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &RESPONSECODEDEFAULTOPERATIONINPUT_SCHEMA;
   19     20   
}
   20     21   
impl ::aws_smithy_schema::serde::SerializableStruct for ResponseCodeDefaultOperationInput {
   21     22   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   22     23   
    fn serialize_members(
   23     24   
        &self,
   24     25   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   25     26   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   26     27   
        Ok(())
   27     28   
    }
   28     29   
}
   29     30   
impl ResponseCodeDefaultOperationInput {
   30     31   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   31         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   32         -
        deserializer: &mut D,
          32  +
    pub fn deserialize(
          33  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   33     34   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   34     35   
        #[allow(unused_variables, unused_mut)]
   35     36   
        let mut builder = Self::builder();
   36     37   
        #[allow(
   37     38   
            unused_variables,
   38     39   
            unreachable_code,
   39     40   
            clippy::single_match,
   40     41   
            clippy::match_single_binding,
   41     42   
            clippy::diverging_sub_expression
   42     43   
        )]
   43         -
        deserializer.read_struct(&RESPONSECODEDEFAULTOPERATIONINPUT_SCHEMA, (), |_, member, deser| {
          44  +
        deserializer.read_struct(&RESPONSECODEDEFAULTOPERATIONINPUT_SCHEMA, &mut |member, deser| {
   44     45   
            match member.member_index() {
   45     46   
                _ => {}
   46     47   
            }
   47     48   
            Ok(())
   48     49   
        })?;
   49     50   
        builder
   50     51   
            .build()
   51     52   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   52     53   
    }
   53     54   
}
          55  +
impl ResponseCodeDefaultOperationInput {
          56  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          57  +
    pub fn deserialize_with_response(
          58  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          59  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          60  +
        _status: u16,
          61  +
        _body: &[u8],
          62  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          63  +
        Self::builder()
          64  +
            .build()
          65  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
          66  +
    }
          67  +
}
   54     68   
impl ResponseCodeDefaultOperationInput {
   55     69   
    /// Creates a new builder-style object to manufacture [`ResponseCodeDefaultOperationInput`](crate::operation::response_code_default_operation::ResponseCodeDefaultOperationInput).
   56     70   
    pub fn builder() -> crate::operation::response_code_default_operation::builders::ResponseCodeDefaultOperationInputBuilder {
   57     71   
        crate::operation::response_code_default_operation::builders::ResponseCodeDefaultOperationInputBuilder::default()
   58     72   
    }
   59     73   
}
   60     74   
   61     75   
/// A builder for [`ResponseCodeDefaultOperationInput`](crate::operation::response_code_default_operation::ResponseCodeDefaultOperationInput).
   62     76   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   63     77   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/response_code_default_operation/_response_code_default_operation_output.rs

@@ -1,1 +68,79 @@
   21     21   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   22     22   
    fn serialize_members(
   23     23   
        &self,
   24     24   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   25     25   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   26     26   
        Ok(())
   27     27   
    }
   28     28   
}
   29     29   
impl ResponseCodeDefaultOperationOutput {
   30     30   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   31         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   32         -
        deserializer: &mut D,
          31  +
    pub fn deserialize(
          32  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   33     33   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   34     34   
        #[allow(unused_variables, unused_mut)]
   35     35   
        let mut builder = Self::builder();
   36     36   
        #[allow(
   37     37   
            unused_variables,
   38     38   
            unreachable_code,
   39     39   
            clippy::single_match,
   40     40   
            clippy::match_single_binding,
   41     41   
            clippy::diverging_sub_expression
   42     42   
        )]
   43         -
        deserializer.read_struct(&RESPONSECODEDEFAULTOPERATIONOUTPUT_SCHEMA, (), |_, member, deser| {
          43  +
        deserializer.read_struct(&RESPONSECODEDEFAULTOPERATIONOUTPUT_SCHEMA, &mut |member, deser| {
   44     44   
            match member.member_index() {
   45     45   
                _ => {}
   46     46   
            }
   47     47   
            Ok(())
   48     48   
        })?;
   49     49   
        Ok(builder.build())
   50     50   
    }
   51     51   
}
          52  +
impl ResponseCodeDefaultOperationOutput {
          53  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          54  +
    pub fn deserialize_with_response(
          55  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          56  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          57  +
        _status: u16,
          58  +
        _body: &[u8],
          59  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          60  +
        Ok(Self::builder().build())
          61  +
    }
          62  +
}
   52     63   
impl ResponseCodeDefaultOperationOutput {
   53     64   
    /// Creates a new builder-style object to manufacture [`ResponseCodeDefaultOperationOutput`](crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput).
   54     65   
    pub fn builder() -> crate::operation::response_code_default_operation::builders::ResponseCodeDefaultOperationOutputBuilder {
   55     66   
        crate::operation::response_code_default_operation::builders::ResponseCodeDefaultOperationOutputBuilder::default()
   56     67   
    }
   57     68   
}
   58     69   
   59     70   
/// A builder for [`ResponseCodeDefaultOperationOutput`](crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput).
   60     71   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   61     72   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/response_code_http_fallback_operation.rs

@@ -1,1 +40,46 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `ResponseCodeHttpFallbackOperation`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct ResponseCodeHttpFallbackOperation;
    6      6   
impl ResponseCodeHttpFallbackOperation {
    7      7   
    /// Creates a new `ResponseCodeHttpFallbackOperation`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          13  +
        crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput::SCHEMA;
   11     17   
    pub(crate) async fn orchestrate(
   12     18   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     19   
        input: crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +232,241 @@
  130    136   
                crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationError,
  131    137   
            >::new());
  132    138   
  133    139   
        ::std::borrow::Cow::Owned(rcb)
  134    140   
    }
  135    141   
}
  136    142   
  137    143   
#[derive(Debug)]
  138    144   
struct ResponseCodeHttpFallbackOperationResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ResponseCodeHttpFallbackOperationResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         146  +
    fn deserialize_nonstreaming_with_config(
  141    147   
        &self,
  142    148   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         149  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    150   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    151   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         152  +
        #[allow(unused_mut)]
         153  +
        let mut force_error = false;
         154  +
         155  +
        if !success && status != 201 || force_error {
  145    156   
            let headers = response.headers();
  146    157   
            let body = response.body().bytes().expect("body loaded");
  147    158   
            #[allow(unused_mut)]
  148         -
        let mut force_error = false;
         159  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         160  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         161  +
            })?;
  149    162   
  150         -
        let parse_result = if !success && status != 201 || force_error {
  151         -
            crate::protocol_serde::shape_response_code_http_fallback_operation::de_response_code_http_fallback_operation_http_error(
  152         -
                status, headers, body,
  153         -
            )
         163  +
            let generic = generic_builder.build();
         164  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         165  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         166  +
                    crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationError::generic(generic),
         167  +
                ),
         168  +
            ))
  154    169   
        } else {
  155         -
            crate::protocol_serde::shape_response_code_http_fallback_operation::de_response_code_http_fallback_operation_http_response(
  156         -
                status, headers, body,
         170  +
            let protocol = _cfg
         171  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         172  +
                .expect("a SharedClientProtocol is required");
         173  +
            let mut deser = protocol
         174  +
                .deserialize_response(response, ResponseCodeHttpFallbackOperation::OUTPUT_SCHEMA, _cfg)
         175  +
                .map_err(|e| {
         176  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         177  +
                })?;
         178  +
            let body = response.body().bytes().expect("body loaded");
         179  +
            let output = crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput::deserialize_with_response(
         180  +
                &mut *deser,
         181  +
                response.headers(),
         182  +
                response.status().into(),
         183  +
                body,
  157    184   
            )
  158         -
        };
  159         -
        crate::protocol_serde::type_erase_result(parse_result)
         185  +
            .map_err(|e| {
         186  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         187  +
            })?;
         188  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         189  +
        }
  160    190   
    }
  161    191   
}
  162    192   
#[derive(Debug)]
  163    193   
struct ResponseCodeHttpFallbackOperationRequestSerializer;
  164    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ResponseCodeHttpFallbackOperationRequestSerializer {
  165    195   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  166    196   
    fn serialize_input(
  167    197   
        &self,
  168    198   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  169    199   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  170    200   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  171    201   
        let input = input
  172    202   
            .downcast::<crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationInput>()
  173    203   
            .expect("correct type");
  174         -
        let _header_serialization_settings = _cfg
  175         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  176         -
            .cloned()
  177         -
            .unwrap_or_default();
  178         -
        let mut request_builder = {
  179         -
            #[allow(clippy::uninlined_format_args)]
  180         -
            fn uri_base(
  181         -
                _input: &crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationInput,
  182         -
                output: &mut ::std::string::String,
  183         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  184         -
                use ::std::fmt::Write as _;
  185         -
                ::std::write!(output, "/responseCodeHttpFallbackOperation").expect("formatting should succeed");
  186         -
                ::std::result::Result::Ok(())
  187         -
            }
  188         -
            #[allow(clippy::unnecessary_wraps)]
  189         -
            fn update_http_builder(
  190         -
                input: &crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationInput,
  191         -
                builder: ::http_1x::request::Builder,
  192         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  193         -
                let mut uri = ::std::string::String::new();
  194         -
                uri_base(input, &mut uri)?;
  195         -
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  196         -
            }
  197         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  198         -
            builder
  199         -
        };
  200         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
         204  +
        let protocol = _cfg
         205  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         206  +
            .expect("a SharedClientProtocol is required");
         207  +
        let mut request = protocol
         208  +
            .serialize_request(&input, ResponseCodeHttpFallbackOperation::INPUT_SCHEMA, "", _cfg)
         209  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  201    210   
  202         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         211  +
        return ::std::result::Result::Ok(request);
  203    212   
    }
  204    213   
}
  205    214   
#[derive(Debug)]
  206    215   
struct ResponseCodeHttpFallbackOperationEndpointParamsInterceptor;
  207    216   
  208    217   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ResponseCodeHttpFallbackOperationEndpointParamsInterceptor {
  209    218   
    fn name(&self) -> &'static str {
  210    219   
        "ResponseCodeHttpFallbackOperationEndpointParamsInterceptor"
  211    220   
    }
  212    221   
@@ -244,253 +304,323 @@
  264    273   
            .expect("the config must have a deserializer");
  265    274   
  266    275   
        let parsed = de.deserialize_streaming(&mut http_response);
  267    276   
        let parsed = parsed.unwrap_or_else(|| {
  268    277   
            let http_response = http_response.map(|body| {
  269    278   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  270    279   
                    body.bytes().unwrap(),
  271    280   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  272    281   
                )))
  273    282   
            });
  274         -
            de.deserialize_nonstreaming(&http_response)
         283  +
            // Build a config bag with the protocol for schema-based deserialization
         284  +
            #[allow(unused_mut)]
         285  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         286  +
            {
         287  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         288  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         289  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         290  +
                ));
         291  +
                test_cfg.push_shared_layer(layer.freeze());
         292  +
            }
         293  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  275    294   
        });
  276    295   
        let parsed = parsed
  277    296   
            .expect("should be successful response")
  278    297   
            .downcast::<crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput>()
  279    298   
            .unwrap();
  280    299   
    }
  281    300   
}
  282    301   
  283    302   
/// Error type for the `ResponseCodeHttpFallbackOperationError` operation.
  284    303   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/response_code_http_fallback_operation/_response_code_http_fallback_operation_input.rs

@@ -1,1 +75,93 @@
    5      5   
pub struct ResponseCodeHttpFallbackOperationInput {}
    6      6   
static RESPONSECODEHTTPFALLBACKOPERATIONINPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static(
    7      7   
    "aws.protocoltests.misc.synthetic#ResponseCodeHttpFallbackOperationInput",
    8      8   
    "aws.protocoltests.misc.synthetic",
    9      9   
    "ResponseCodeHttpFallbackOperationInput",
   10     10   
);
   11     11   
static RESPONSECODEHTTPFALLBACKOPERATIONINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   12     12   
    RESPONSECODEHTTPFALLBACKOPERATIONINPUT_SCHEMA_ID,
   13     13   
    ::aws_smithy_schema::ShapeType::Structure,
   14     14   
    &[],
   15         -
);
          15  +
)
          16  +
.with_http(aws_smithy_schema::traits::HttpTrait::new(
          17  +
    "GET",
          18  +
    "/responseCodeHttpFallbackOperation",
          19  +
    Some(201),
          20  +
));
   16     21   
impl ResponseCodeHttpFallbackOperationInput {
   17     22   
    /// The schema for this shape.
   18     23   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &RESPONSECODEHTTPFALLBACKOPERATIONINPUT_SCHEMA;
   19     24   
}
   20     25   
impl ::aws_smithy_schema::serde::SerializableStruct for ResponseCodeHttpFallbackOperationInput {
   21     26   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   22     27   
    fn serialize_members(
   23     28   
        &self,
   24     29   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   25     30   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   26     31   
        Ok(())
   27     32   
    }
   28     33   
}
   29     34   
impl ResponseCodeHttpFallbackOperationInput {
   30     35   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   31         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   32         -
        deserializer: &mut D,
          36  +
    pub fn deserialize(
          37  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   33     38   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   34     39   
        #[allow(unused_variables, unused_mut)]
   35     40   
        let mut builder = Self::builder();
   36     41   
        #[allow(
   37     42   
            unused_variables,
   38     43   
            unreachable_code,
   39     44   
            clippy::single_match,
   40     45   
            clippy::match_single_binding,
   41     46   
            clippy::diverging_sub_expression
   42     47   
        )]
   43         -
        deserializer.read_struct(&RESPONSECODEHTTPFALLBACKOPERATIONINPUT_SCHEMA, (), |_, member, deser| {
          48  +
        deserializer.read_struct(&RESPONSECODEHTTPFALLBACKOPERATIONINPUT_SCHEMA, &mut |member, deser| {
   44     49   
            match member.member_index() {
   45     50   
                _ => {}
   46     51   
            }
   47     52   
            Ok(())
   48     53   
        })?;
   49     54   
        builder
   50     55   
            .build()
   51     56   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   52     57   
    }
   53     58   
}
          59  +
impl ResponseCodeHttpFallbackOperationInput {
          60  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          61  +
    pub fn deserialize_with_response(
          62  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          63  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          64  +
        _status: u16,
          65  +
        _body: &[u8],
          66  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          67  +
        Self::builder()
          68  +
            .build()
          69  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
          70  +
    }
          71  +
}
   54     72   
impl ResponseCodeHttpFallbackOperationInput {
   55     73   
    /// Creates a new builder-style object to manufacture [`ResponseCodeHttpFallbackOperationInput`](crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationInput).
   56     74   
    pub fn builder() -> crate::operation::response_code_http_fallback_operation::builders::ResponseCodeHttpFallbackOperationInputBuilder {
   57     75   
        crate::operation::response_code_http_fallback_operation::builders::ResponseCodeHttpFallbackOperationInputBuilder::default()
   58     76   
    }
   59     77   
}
   60     78   
   61     79   
/// A builder for [`ResponseCodeHttpFallbackOperationInput`](crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationInput).
   62     80   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   63     81   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/response_code_http_fallback_operation/_response_code_http_fallback_operation_output.rs

@@ -1,1 +68,79 @@
   21     21   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   22     22   
    fn serialize_members(
   23     23   
        &self,
   24     24   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   25     25   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   26     26   
        Ok(())
   27     27   
    }
   28     28   
}
   29     29   
impl ResponseCodeHttpFallbackOperationOutput {
   30     30   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   31         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   32         -
        deserializer: &mut D,
          31  +
    pub fn deserialize(
          32  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   33     33   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   34     34   
        #[allow(unused_variables, unused_mut)]
   35     35   
        let mut builder = Self::builder();
   36     36   
        #[allow(
   37     37   
            unused_variables,
   38     38   
            unreachable_code,
   39     39   
            clippy::single_match,
   40     40   
            clippy::match_single_binding,
   41     41   
            clippy::diverging_sub_expression
   42     42   
        )]
   43         -
        deserializer.read_struct(&RESPONSECODEHTTPFALLBACKOPERATIONOUTPUT_SCHEMA, (), |_, member, deser| {
          43  +
        deserializer.read_struct(&RESPONSECODEHTTPFALLBACKOPERATIONOUTPUT_SCHEMA, &mut |member, deser| {
   44     44   
            match member.member_index() {
   45     45   
                _ => {}
   46     46   
            }
   47     47   
            Ok(())
   48     48   
        })?;
   49     49   
        Ok(builder.build())
   50     50   
    }
   51     51   
}
          52  +
impl ResponseCodeHttpFallbackOperationOutput {
          53  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          54  +
    pub fn deserialize_with_response(
          55  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          56  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          57  +
        _status: u16,
          58  +
        _body: &[u8],
          59  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          60  +
        Ok(Self::builder().build())
          61  +
    }
          62  +
}
   52     63   
impl ResponseCodeHttpFallbackOperationOutput {
   53     64   
    /// Creates a new builder-style object to manufacture [`ResponseCodeHttpFallbackOperationOutput`](crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput).
   54     65   
    pub fn builder() -> crate::operation::response_code_http_fallback_operation::builders::ResponseCodeHttpFallbackOperationOutputBuilder {
   55     66   
        crate::operation::response_code_http_fallback_operation::builders::ResponseCodeHttpFallbackOperationOutputBuilder::default()
   56     67   
    }
   57     68   
}
   58     69   
   59     70   
/// A builder for [`ResponseCodeHttpFallbackOperationOutput`](crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput).
   60     71   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   61     72   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/response_code_required_operation.rs

@@ -1,1 +40,46 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `ResponseCodeRequiredOperation`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct ResponseCodeRequiredOperation;
    6      6   
impl ResponseCodeRequiredOperation {
    7      7   
    /// Creates a new `ResponseCodeRequiredOperation`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          13  +
        crate::operation::response_code_required_operation::ResponseCodeRequiredOperationInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput::SCHEMA;
   11     17   
    pub(crate) async fn orchestrate(
   12     18   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     19   
        input: crate::operation::response_code_required_operation::ResponseCodeRequiredOperationInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::response_code_required_operation::ResponseCodeRequiredOperationError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +228,241 @@
  130    136   
                crate::operation::response_code_required_operation::ResponseCodeRequiredOperationError,
  131    137   
            >::new());
  132    138   
  133    139   
        ::std::borrow::Cow::Owned(rcb)
  134    140   
    }
  135    141   
}
  136    142   
  137    143   
#[derive(Debug)]
  138    144   
struct ResponseCodeRequiredOperationResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ResponseCodeRequiredOperationResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         146  +
    fn deserialize_nonstreaming_with_config(
  141    147   
        &self,
  142    148   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         149  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    150   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    151   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         152  +
        #[allow(unused_mut)]
         153  +
        let mut force_error = false;
         154  +
         155  +
        if !success && status != 200 || force_error {
  145    156   
            let headers = response.headers();
  146    157   
            let body = response.body().bytes().expect("body loaded");
  147    158   
            #[allow(unused_mut)]
  148         -
        let mut force_error = false;
         159  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         160  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         161  +
            })?;
  149    162   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_response_code_required_operation::de_response_code_required_operation_http_error(status, headers, body)
         163  +
            let generic = generic_builder.build();
         164  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         165  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         166  +
                    crate::operation::response_code_required_operation::ResponseCodeRequiredOperationError::generic(generic),
         167  +
                ),
         168  +
            ))
  152    169   
        } else {
  153         -
            crate::protocol_serde::shape_response_code_required_operation::de_response_code_required_operation_http_response(status, headers, body)
  154         -
        };
  155         -
        crate::protocol_serde::type_erase_result(parse_result)
         170  +
            let protocol = _cfg
         171  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         172  +
                .expect("a SharedClientProtocol is required");
         173  +
            let mut deser = protocol
         174  +
                .deserialize_response(response, ResponseCodeRequiredOperation::OUTPUT_SCHEMA, _cfg)
         175  +
                .map_err(|e| {
         176  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         177  +
                })?;
         178  +
            let body = response.body().bytes().expect("body loaded");
         179  +
            let output = crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput::deserialize_with_response(
         180  +
                &mut *deser,
         181  +
                response.headers(),
         182  +
                response.status().into(),
         183  +
                body,
         184  +
            )
         185  +
            .map_err(|e| {
         186  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         187  +
            })?;
         188  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         189  +
        }
  156    190   
    }
  157    191   
}
  158    192   
#[derive(Debug)]
  159    193   
struct ResponseCodeRequiredOperationRequestSerializer;
  160    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ResponseCodeRequiredOperationRequestSerializer {
  161    195   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  162    196   
    fn serialize_input(
  163    197   
        &self,
  164    198   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  165    199   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  166    200   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  167    201   
        let input = input
  168    202   
            .downcast::<crate::operation::response_code_required_operation::ResponseCodeRequiredOperationInput>()
  169    203   
            .expect("correct type");
  170         -
        let _header_serialization_settings = _cfg
  171         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  172         -
            .cloned()
  173         -
            .unwrap_or_default();
  174         -
        let mut request_builder = {
  175         -
            #[allow(clippy::uninlined_format_args)]
  176         -
            fn uri_base(
  177         -
                _input: &crate::operation::response_code_required_operation::ResponseCodeRequiredOperationInput,
  178         -
                output: &mut ::std::string::String,
  179         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180         -
                use ::std::fmt::Write as _;
  181         -
                ::std::write!(output, "/responseCodeRequiredOperation").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::response_code_required_operation::ResponseCodeRequiredOperationInput,
  187         -
                builder: ::http_1x::request::Builder,
  188         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189         -
                let mut uri = ::std::string::String::new();
  190         -
                uri_base(input, &mut uri)?;
  191         -
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  192         -
            }
  193         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  194         -
            builder
  195         -
        };
  196         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
         204  +
        let protocol = _cfg
         205  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         206  +
            .expect("a SharedClientProtocol is required");
         207  +
        let mut request = protocol
         208  +
            .serialize_request(&input, ResponseCodeRequiredOperation::INPUT_SCHEMA, "", _cfg)
         209  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  197    210   
  198         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         211  +
        return ::std::result::Result::Ok(request);
  199    212   
    }
  200    213   
}
  201    214   
#[derive(Debug)]
  202    215   
struct ResponseCodeRequiredOperationEndpointParamsInterceptor;
  203    216   
  204    217   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ResponseCodeRequiredOperationEndpointParamsInterceptor {
  205    218   
    fn name(&self) -> &'static str {
  206    219   
        "ResponseCodeRequiredOperationEndpointParamsInterceptor"
  207    220   
    }
  208    221   
@@ -243,256 +303,326 @@
  263    276   
            .expect("the config must have a deserializer");
  264    277   
  265    278   
        let parsed = de.deserialize_streaming(&mut http_response);
  266    279   
        let parsed = parsed.unwrap_or_else(|| {
  267    280   
            let http_response = http_response.map(|body| {
  268    281   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  269    282   
                    body.bytes().unwrap(),
  270    283   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  271    284   
                )))
  272    285   
            });
  273         -
            de.deserialize_nonstreaming(&http_response)
         286  +
            // Build a config bag with the protocol for schema-based deserialization
         287  +
            #[allow(unused_mut)]
         288  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         289  +
            {
         290  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         291  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         292  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         293  +
                ));
         294  +
                test_cfg.push_shared_layer(layer.freeze());
         295  +
            }
         296  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  274    297   
        });
  275    298   
        let parsed = parsed
  276    299   
            .expect("should be successful response")
  277    300   
            .downcast::<crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput>()
  278    301   
            .unwrap();
  279    302   
        ::pretty_assertions::assert_eq!(
  280    303   
            parsed.response_code,
  281    304   
            expected_output.response_code,
  282    305   
            "Unexpected value for `response_code`"
  283    306   
        );

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/response_code_required_operation/_response_code_required_operation_input.rs

@@ -1,1 +75,89 @@
    5      5   
pub struct ResponseCodeRequiredOperationInput {}
    6      6   
static RESPONSECODEREQUIREDOPERATIONINPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static(
    7      7   
    "aws.protocoltests.misc.synthetic#ResponseCodeRequiredOperationInput",
    8      8   
    "aws.protocoltests.misc.synthetic",
    9      9   
    "ResponseCodeRequiredOperationInput",
   10     10   
);
   11     11   
static RESPONSECODEREQUIREDOPERATIONINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   12     12   
    RESPONSECODEREQUIREDOPERATIONINPUT_SCHEMA_ID,
   13     13   
    ::aws_smithy_schema::ShapeType::Structure,
   14     14   
    &[],
   15         -
);
          15  +
)
          16  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("GET", "/responseCodeRequiredOperation", None));
   16     17   
impl ResponseCodeRequiredOperationInput {
   17     18   
    /// The schema for this shape.
   18     19   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &RESPONSECODEREQUIREDOPERATIONINPUT_SCHEMA;
   19     20   
}
   20     21   
impl ::aws_smithy_schema::serde::SerializableStruct for ResponseCodeRequiredOperationInput {
   21     22   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   22     23   
    fn serialize_members(
   23     24   
        &self,
   24     25   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   25     26   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   26     27   
        Ok(())
   27     28   
    }
   28     29   
}
   29     30   
impl ResponseCodeRequiredOperationInput {
   30     31   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   31         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   32         -
        deserializer: &mut D,
          32  +
    pub fn deserialize(
          33  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   33     34   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   34     35   
        #[allow(unused_variables, unused_mut)]
   35     36   
        let mut builder = Self::builder();
   36     37   
        #[allow(
   37     38   
            unused_variables,
   38     39   
            unreachable_code,
   39     40   
            clippy::single_match,
   40     41   
            clippy::match_single_binding,
   41     42   
            clippy::diverging_sub_expression
   42     43   
        )]
   43         -
        deserializer.read_struct(&RESPONSECODEREQUIREDOPERATIONINPUT_SCHEMA, (), |_, member, deser| {
          44  +
        deserializer.read_struct(&RESPONSECODEREQUIREDOPERATIONINPUT_SCHEMA, &mut |member, deser| {
   44     45   
            match member.member_index() {
   45     46   
                _ => {}
   46     47   
            }
   47     48   
            Ok(())
   48     49   
        })?;
   49     50   
        builder
   50     51   
            .build()
   51     52   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   52     53   
    }
   53     54   
}
          55  +
impl ResponseCodeRequiredOperationInput {
          56  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          57  +
    pub fn deserialize_with_response(
          58  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          59  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          60  +
        _status: u16,
          61  +
        _body: &[u8],
          62  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          63  +
        Self::builder()
          64  +
            .build()
          65  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
          66  +
    }
          67  +
}
   54     68   
impl ResponseCodeRequiredOperationInput {
   55     69   
    /// Creates a new builder-style object to manufacture [`ResponseCodeRequiredOperationInput`](crate::operation::response_code_required_operation::ResponseCodeRequiredOperationInput).
   56     70   
    pub fn builder() -> crate::operation::response_code_required_operation::builders::ResponseCodeRequiredOperationInputBuilder {
   57     71   
        crate::operation::response_code_required_operation::builders::ResponseCodeRequiredOperationInputBuilder::default()
   58     72   
    }
   59     73   
}
   60     74   
   61     75   
/// A builder for [`ResponseCodeRequiredOperationInput`](crate::operation::response_code_required_operation::ResponseCodeRequiredOperationInput).
   62     76   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   63     77   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/response_code_required_operation/_response_code_required_operation_output.rs

@@ -1,1 +105,124 @@
   17     17   
    "aws.protocoltests.misc.synthetic",
   18     18   
    "ResponseCodeRequiredOperationOutput",
   19     19   
);
   20     20   
static RESPONSECODEREQUIREDOPERATIONOUTPUT_MEMBER_RESPONSE_CODE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   21     21   
    ::aws_smithy_schema::ShapeId::from_static(
   22     22   
        "aws.protocoltests.misc.synthetic#ResponseCodeRequiredOperationOutput$responseCode",
   23     23   
        "aws.protocoltests.misc.synthetic",
   24     24   
        "ResponseCodeRequiredOperationOutput",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::Integer,
   27         -
    "response_code",
          27  +
    "responseCode",
   28     28   
    0,
   29     29   
)
   30     30   
.with_http_response_code();
   31     31   
static RESPONSECODEREQUIREDOPERATIONOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   32     32   
    RESPONSECODEREQUIREDOPERATIONOUTPUT_SCHEMA_ID,
   33     33   
    ::aws_smithy_schema::ShapeType::Structure,
   34     34   
    &[&RESPONSECODEREQUIREDOPERATIONOUTPUT_MEMBER_RESPONSE_CODE],
   35     35   
);
   36     36   
impl ResponseCodeRequiredOperationOutput {
   37     37   
    /// The schema for this shape.
   38     38   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &RESPONSECODEREQUIREDOPERATIONOUTPUT_SCHEMA;
   39     39   
}
   40     40   
impl ::aws_smithy_schema::serde::SerializableStruct for ResponseCodeRequiredOperationOutput {
   41     41   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   42     42   
    fn serialize_members(
   43     43   
        &self,
   44     44   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   45     45   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   46     46   
        {
   47     47   
            let val = &self.response_code;
   48     48   
            ser.write_integer(&RESPONSECODEREQUIREDOPERATIONOUTPUT_MEMBER_RESPONSE_CODE, *val)?;
   49     49   
        }
   50     50   
        Ok(())
   51     51   
    }
   52     52   
}
   53     53   
impl ResponseCodeRequiredOperationOutput {
   54     54   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   55         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   56         -
        deserializer: &mut D,
          55  +
    pub fn deserialize(
          56  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   57     57   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   58     58   
        #[allow(unused_variables, unused_mut)]
   59     59   
        let mut builder = Self::builder();
   60     60   
        #[allow(
   61     61   
            unused_variables,
   62     62   
            unreachable_code,
   63     63   
            clippy::single_match,
   64     64   
            clippy::match_single_binding,
   65     65   
            clippy::diverging_sub_expression
   66     66   
        )]
   67         -
        deserializer.read_struct(&RESPONSECODEREQUIREDOPERATIONOUTPUT_SCHEMA, (), |_, member, deser| {
          67  +
        deserializer.read_struct(&RESPONSECODEREQUIREDOPERATIONOUTPUT_SCHEMA, &mut |member, deser| {
   68     68   
            match member.member_index() {
   69     69   
                Some(0) => {
   70     70   
                    builder.response_code = Some(deser.read_integer(member)?);
   71     71   
                }
   72     72   
                _ => {}
   73     73   
            }
   74     74   
            Ok(())
   75     75   
        })?;
          76  +
        builder.response_code = builder.response_code.or(Some(0i32));
          77  +
        builder
          78  +
            .build()
          79  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
          80  +
    }
          81  +
}
          82  +
impl ResponseCodeRequiredOperationOutput {
          83  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          84  +
    /// Header-bound members are read directly from headers, avoiding runtime
          85  +
    /// member iteration overhead. Body members are read via the deserializer.
          86  +
    pub fn deserialize_with_response(
          87  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          88  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          89  +
        _status: u16,
          90  +
        _body: &[u8],
          91  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          92  +
        #[allow(unused_variables, unused_mut)]
          93  +
        let mut builder = Self::builder();
          94  +
        builder.response_code = Some(_status as i32);
   76     95   
        builder
   77     96   
            .build()
   78     97   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   79     98   
    }
   80     99   
}
   81    100   
impl ResponseCodeRequiredOperationOutput {
   82    101   
    /// Creates a new builder-style object to manufacture [`ResponseCodeRequiredOperationOutput`](crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput).
   83    102   
    pub fn builder() -> crate::operation::response_code_required_operation::builders::ResponseCodeRequiredOperationOutputBuilder {
   84    103   
        crate::operation::response_code_required_operation::builders::ResponseCodeRequiredOperationOutputBuilder::default()
   85    104   
    }

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/type_complexity_operation.rs

@@ -1,1 +40,45 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `TypeComplexityOperation`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct TypeComplexityOperation;
    6      6   
impl TypeComplexityOperation {
    7      7   
    /// Creates a new `TypeComplexityOperation`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::type_complexity_operation::TypeComplexityOperationInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          15  +
        crate::operation::type_complexity_operation::TypeComplexityOperationOutput::SCHEMA;
   11     16   
    pub(crate) async fn orchestrate(
   12     17   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     18   
        input: crate::operation::type_complexity_operation::TypeComplexityOperationInput,
   14     19   
    ) -> ::std::result::Result<
   15     20   
        crate::operation::type_complexity_operation::TypeComplexityOperationOutput,
   16     21   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     22   
            crate::operation::type_complexity_operation::TypeComplexityOperationError,
   18     23   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     24   
        >,
   20     25   
    > {
@@ -110,115 +234,240 @@
  130    135   
                crate::operation::type_complexity_operation::TypeComplexityOperationError,
  131    136   
            >::new());
  132    137   
  133    138   
        ::std::borrow::Cow::Owned(rcb)
  134    139   
    }
  135    140   
}
  136    141   
  137    142   
#[derive(Debug)]
  138    143   
struct TypeComplexityOperationResponseDeserializer;
  139    144   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for TypeComplexityOperationResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         145  +
    fn deserialize_nonstreaming_with_config(
  141    146   
        &self,
  142    147   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         148  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    149   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    150   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         151  +
        #[allow(unused_mut)]
         152  +
        let mut force_error = false;
         153  +
         154  +
        if !success && status != 200 || force_error {
  145    155   
            let headers = response.headers();
  146    156   
            let body = response.body().bytes().expect("body loaded");
  147    157   
            #[allow(unused_mut)]
  148         -
        let mut force_error = false;
         158  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         159  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         160  +
            })?;
  149    161   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_type_complexity_operation::de_type_complexity_operation_http_error(status, headers, body)
         162  +
            let generic = generic_builder.build();
         163  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         164  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         165  +
                    crate::operation::type_complexity_operation::TypeComplexityOperationError::generic(generic),
         166  +
                ),
         167  +
            ))
  152    168   
        } else {
  153         -
            crate::protocol_serde::shape_type_complexity_operation::de_type_complexity_operation_http_response(status, headers, body)
  154         -
        };
  155         -
        crate::protocol_serde::type_erase_result(parse_result)
         169  +
            let protocol = _cfg
         170  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         171  +
                .expect("a SharedClientProtocol is required");
         172  +
            let mut deser = protocol
         173  +
                .deserialize_response(response, TypeComplexityOperation::OUTPUT_SCHEMA, _cfg)
         174  +
                .map_err(|e| {
         175  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         176  +
                })?;
         177  +
            let body = response.body().bytes().expect("body loaded");
         178  +
            let output = crate::operation::type_complexity_operation::TypeComplexityOperationOutput::deserialize_with_response(
         179  +
                &mut *deser,
         180  +
                response.headers(),
         181  +
                response.status().into(),
         182  +
                body,
         183  +
            )
         184  +
            .map_err(|e| {
         185  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         186  +
            })?;
         187  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         188  +
        }
  156    189   
    }
  157    190   
}
  158    191   
#[derive(Debug)]
  159    192   
struct TypeComplexityOperationRequestSerializer;
  160    193   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for TypeComplexityOperationRequestSerializer {
  161    194   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  162    195   
    fn serialize_input(
  163    196   
        &self,
  164    197   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  165    198   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  166    199   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  167    200   
        let input = input
  168    201   
            .downcast::<crate::operation::type_complexity_operation::TypeComplexityOperationInput>()
  169    202   
            .expect("correct type");
  170         -
        let _header_serialization_settings = _cfg
  171         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  172         -
            .cloned()
  173         -
            .unwrap_or_default();
  174         -
        let mut request_builder = {
  175         -
            #[allow(clippy::uninlined_format_args)]
  176         -
            fn uri_base(
  177         -
                _input: &crate::operation::type_complexity_operation::TypeComplexityOperationInput,
  178         -
                output: &mut ::std::string::String,
  179         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180         -
                use ::std::fmt::Write as _;
  181         -
                ::std::write!(output, "/typeComplexityOperation").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::type_complexity_operation::TypeComplexityOperationInput,
  187         -
                builder: ::http_1x::request::Builder,
  188         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189         -
                let mut uri = ::std::string::String::new();
  190         -
                uri_base(input, &mut uri)?;
  191         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  192         -
            }
  193         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  194         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
  195         -
            builder
  196         -
        };
  197         -
        let body = ::aws_smithy_types::body::SdkBody::from(
  198         -
            crate::protocol_serde::shape_type_complexity_operation::ser_type_complexity_operation_input(&input)?,
  199         -
        );
  200         -
        if let Some(content_length) = body.content_length() {
  201         -
            let content_length = content_length.to_string();
  202         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  203         -
        }
  204         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         203  +
        let protocol = _cfg
         204  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         205  +
            .expect("a SharedClientProtocol is required");
         206  +
        let mut request = protocol
         207  +
            .serialize_request(&input, TypeComplexityOperation::INPUT_SCHEMA, "", _cfg)
         208  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         209  +
         210  +
        return ::std::result::Result::Ok(request);
  205    211   
    }
  206    212   
}
  207    213   
#[derive(Debug)]
  208    214   
struct TypeComplexityOperationEndpointParamsInterceptor;
  209    215   
  210    216   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for TypeComplexityOperationEndpointParamsInterceptor {
  211    217   
    fn name(&self) -> &'static str {
  212    218   
        "TypeComplexityOperationEndpointParamsInterceptor"
  213    219   
    }
  214    220   

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/type_complexity_operation/_type_complexity_operation_input.rs

@@ -8,8 +130,186 @@
   28     28   
        "TypeComplexityOperationInput",
   29     29   
    ),
   30     30   
    ::aws_smithy_schema::ShapeType::List,
   31     31   
    "list",
   32     32   
    0,
   33     33   
);
   34     34   
static TYPECOMPLEXITYOPERATIONINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   35     35   
    TYPECOMPLEXITYOPERATIONINPUT_SCHEMA_ID,
   36     36   
    ::aws_smithy_schema::ShapeType::Structure,
   37     37   
    &[&TYPECOMPLEXITYOPERATIONINPUT_MEMBER_LIST],
   38         -
);
          38  +
)
          39  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/typeComplexityOperation", None));
   39     40   
impl TypeComplexityOperationInput {
   40     41   
    /// The schema for this shape.
   41     42   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &TYPECOMPLEXITYOPERATIONINPUT_SCHEMA;
   42     43   
}
   43     44   
impl ::aws_smithy_schema::serde::SerializableStruct for TypeComplexityOperationInput {
   44     45   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   45     46   
    fn serialize_members(
   46     47   
        &self,
   47     48   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   48     49   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   49     50   
        if let Some(ref val) = self.list {
   50     51   
            ser.write_list(
   51     52   
                &TYPECOMPLEXITYOPERATIONINPUT_MEMBER_LIST,
   52     53   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   53     54   
                    for item in val {
   54         -
                        todo!("schema: unsupported list element type");
          55  +
                        ser.write_list(
          56  +
                            &::aws_smithy_schema::prelude::DOCUMENT,
          57  +
                            &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
          58  +
                                for item in item {
          59  +
                                    ser.write_list(
          60  +
                                        &::aws_smithy_schema::prelude::DOCUMENT,
          61  +
                                        &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
          62  +
                                            for item in item {
          63  +
                                                ser.write_map(
          64  +
                                                    &::aws_smithy_schema::prelude::DOCUMENT,
          65  +
                                                    &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
          66  +
                                                        for (key, value) in item {
          67  +
                                                            ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
          68  +
                                                            ser.write_struct(crate::types::EmptyStructure::SCHEMA, value)?;
          69  +
                                                        }
          70  +
                                                        Ok(())
          71  +
                                                    },
          72  +
                                                )?;
          73  +
                                            }
          74  +
                                            Ok(())
          75  +
                                        },
          76  +
                                    )?;
          77  +
                                }
          78  +
                                Ok(())
          79  +
                            },
          80  +
                        )?;
   55     81   
                    }
   56     82   
                    Ok(())
   57     83   
                },
   58     84   
            )?;
   59     85   
        }
   60     86   
        Ok(())
   61     87   
    }
   62     88   
}
   63     89   
impl TypeComplexityOperationInput {
   64     90   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   65         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   66         -
        deserializer: &mut D,
          91  +
    pub fn deserialize(
          92  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   67     93   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   68     94   
        #[allow(unused_variables, unused_mut)]
   69     95   
        let mut builder = Self::builder();
   70     96   
        #[allow(
   71     97   
            unused_variables,
   72     98   
            unreachable_code,
   73     99   
            clippy::single_match,
   74    100   
            clippy::match_single_binding,
   75    101   
            clippy::diverging_sub_expression
   76    102   
        )]
   77         -
        deserializer.read_struct(&TYPECOMPLEXITYOPERATIONINPUT_SCHEMA, (), |_, member, deser| {
         103  +
        deserializer.read_struct(&TYPECOMPLEXITYOPERATIONINPUT_SCHEMA, &mut |member, deser| {
   78    104   
            match member.member_index() {
   79    105   
                Some(0) => {
   80    106   
                    builder.list = Some({
   81         -
                        let container = if let Some(cap) = deser.container_size() {
   82         -
                            Vec::with_capacity(cap)
   83         -
                        } else {
   84         -
                            Vec::new()
   85         -
                        };
   86         -
                        deser.read_list(member, container, |mut list, deser| {
   87         -
                            list.push(todo!("deserialize nested aggregate"));
   88         -
                            Ok(list)
   89         -
                        })?
         107  +
                        let mut container = Vec::new();
         108  +
                        deser.read_list(member, &mut |deser| {
         109  +
                            container.push({
         110  +
                                let mut list = Vec::new();
         111  +
                                deser.read_list(member, &mut |deser| {
         112  +
                                    list.push({
         113  +
                                        let mut list = Vec::new();
         114  +
                                        deser.read_list(member, &mut |deser| {
         115  +
                                            list.push({
         116  +
                                                let mut map = ::std::collections::HashMap::new();
         117  +
                                                deser.read_map(member, &mut |key, deser| {
         118  +
                                                    let value = crate::types::EmptyStructure::deserialize(deser)?;
         119  +
                                                    map.insert(key, value);
         120  +
                                                    Ok(())
         121  +
                                                })?;
         122  +
                                                map
         123  +
                                            });
         124  +
                                            Ok(())
         125  +
                                        })?;
         126  +
                                        list
         127  +
                                    });
         128  +
                                    Ok(())
         129  +
                                })?;
         130  +
                                list
         131  +
                            });
         132  +
                            Ok(())
         133  +
                        })?;
         134  +
                        container
   90    135   
                    });
   91    136   
                }
   92    137   
                _ => {}
   93    138   
            }
   94    139   
            Ok(())
   95    140   
        })?;
   96    141   
        builder
   97    142   
            .build()
   98    143   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   99    144   
    }
  100    145   
}
         146  +
impl TypeComplexityOperationInput {
         147  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         148  +
    pub fn deserialize_with_response(
         149  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         150  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         151  +
        _status: u16,
         152  +
        _body: &[u8],
         153  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         154  +
        Self::deserialize(deserializer)
         155  +
    }
         156  +
}
  101    157   
impl TypeComplexityOperationInput {
  102    158   
    /// Creates a new builder-style object to manufacture [`TypeComplexityOperationInput`](crate::operation::type_complexity_operation::TypeComplexityOperationInput).
  103    159   
    pub fn builder() -> crate::operation::type_complexity_operation::builders::TypeComplexityOperationInputBuilder {
  104    160   
        crate::operation::type_complexity_operation::builders::TypeComplexityOperationInputBuilder::default()
  105    161   
    }
  106    162   
}
  107    163   
  108    164   
/// A builder for [`TypeComplexityOperationInput`](crate::operation::type_complexity_operation::TypeComplexityOperationInput).
  109    165   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  110    166   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/type_complexity_operation/_type_complexity_operation_output.rs

@@ -24,24 +128,183 @@
   44     44   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   45     45   
    fn serialize_members(
   46     46   
        &self,
   47     47   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   48     48   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   49     49   
        if let Some(ref val) = self.list {
   50     50   
            ser.write_list(
   51     51   
                &TYPECOMPLEXITYOPERATIONOUTPUT_MEMBER_LIST,
   52     52   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   53     53   
                    for item in val {
   54         -
                        todo!("schema: unsupported list element type");
          54  +
                        ser.write_list(
          55  +
                            &::aws_smithy_schema::prelude::DOCUMENT,
          56  +
                            &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
          57  +
                                for item in item {
          58  +
                                    ser.write_list(
          59  +
                                        &::aws_smithy_schema::prelude::DOCUMENT,
          60  +
                                        &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
          61  +
                                            for item in item {
          62  +
                                                ser.write_map(
          63  +
                                                    &::aws_smithy_schema::prelude::DOCUMENT,
          64  +
                                                    &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
          65  +
                                                        for (key, value) in item {
          66  +
                                                            ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
          67  +
                                                            ser.write_struct(crate::types::EmptyStructure::SCHEMA, value)?;
          68  +
                                                        }
          69  +
                                                        Ok(())
          70  +
                                                    },
          71  +
                                                )?;
          72  +
                                            }
          73  +
                                            Ok(())
          74  +
                                        },
          75  +
                                    )?;
          76  +
                                }
          77  +
                                Ok(())
          78  +
                            },
          79  +
                        )?;
   55     80   
                    }
   56     81   
                    Ok(())
   57     82   
                },
   58     83   
            )?;
   59     84   
        }
   60     85   
        Ok(())
   61     86   
    }
   62     87   
}
   63     88   
impl TypeComplexityOperationOutput {
   64     89   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   65         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   66         -
        deserializer: &mut D,
          90  +
    pub fn deserialize(
          91  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   67     92   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   68     93   
        #[allow(unused_variables, unused_mut)]
   69     94   
        let mut builder = Self::builder();
   70     95   
        #[allow(
   71     96   
            unused_variables,
   72     97   
            unreachable_code,
   73     98   
            clippy::single_match,
   74     99   
            clippy::match_single_binding,
   75    100   
            clippy::diverging_sub_expression
   76    101   
        )]
   77         -
        deserializer.read_struct(&TYPECOMPLEXITYOPERATIONOUTPUT_SCHEMA, (), |_, member, deser| {
         102  +
        deserializer.read_struct(&TYPECOMPLEXITYOPERATIONOUTPUT_SCHEMA, &mut |member, deser| {
   78    103   
            match member.member_index() {
   79    104   
                Some(0) => {
   80    105   
                    builder.list = Some({
   81         -
                        let container = if let Some(cap) = deser.container_size() {
   82         -
                            Vec::with_capacity(cap)
   83         -
                        } else {
   84         -
                            Vec::new()
   85         -
                        };
   86         -
                        deser.read_list(member, container, |mut list, deser| {
   87         -
                            list.push(todo!("deserialize nested aggregate"));
   88         -
                            Ok(list)
   89         -
                        })?
         106  +
                        let mut container = Vec::new();
         107  +
                        deser.read_list(member, &mut |deser| {
         108  +
                            container.push({
         109  +
                                let mut list = Vec::new();
         110  +
                                deser.read_list(member, &mut |deser| {
         111  +
                                    list.push({
         112  +
                                        let mut list = Vec::new();
         113  +
                                        deser.read_list(member, &mut |deser| {
         114  +
                                            list.push({
         115  +
                                                let mut map = ::std::collections::HashMap::new();
         116  +
                                                deser.read_map(member, &mut |key, deser| {
         117  +
                                                    let value = crate::types::EmptyStructure::deserialize(deser)?;
         118  +
                                                    map.insert(key, value);
         119  +
                                                    Ok(())
         120  +
                                                })?;
         121  +
                                                map
         122  +
                                            });
         123  +
                                            Ok(())
         124  +
                                        })?;
         125  +
                                        list
         126  +
                                    });
         127  +
                                    Ok(())
         128  +
                                })?;
         129  +
                                list
         130  +
                            });
         131  +
                            Ok(())
         132  +
                        })?;
         133  +
                        container
   90    134   
                    });
   91    135   
                }
   92    136   
                _ => {}
   93    137   
            }
   94    138   
            Ok(())
   95    139   
        })?;
   96    140   
        Ok(builder.build())
   97    141   
    }
   98    142   
}
         143  +
impl TypeComplexityOperationOutput {
         144  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         145  +
    pub fn deserialize_with_response(
         146  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         147  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         148  +
        _status: u16,
         149  +
        _body: &[u8],
         150  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         151  +
        Self::deserialize(deserializer)
         152  +
    }
         153  +
}
   99    154   
impl TypeComplexityOperationOutput {
  100    155   
    /// Creates a new builder-style object to manufacture [`TypeComplexityOperationOutput`](crate::operation::type_complexity_operation::TypeComplexityOperationOutput).
  101    156   
    pub fn builder() -> crate::operation::type_complexity_operation::builders::TypeComplexityOperationOutputBuilder {
  102    157   
        crate::operation::type_complexity_operation::builders::TypeComplexityOperationOutputBuilder::default()
  103    158   
    }
  104    159   
}
  105    160   
  106    161   
/// A builder for [`TypeComplexityOperationOutput`](crate::operation::type_complexity_operation::TypeComplexityOperationOutput).
  107    162   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  108    163   
#[non_exhaustive]