Client Test

Client Test

rev. 000b37a512bd3be1a17b4f3d5bf60e5446dbc2dd

Files changed:

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_test_get_no_payload.rs

@@ -11,11 +51,53 @@
   31     31   
        output.build()
   32     32   
    })
   33     33   
}
   34     34   
   35     35   
pub fn ser_test_get_no_payload_headers(
   36     36   
    input: &crate::operation::test_get_no_payload::TestGetNoPayloadInput,
   37     37   
    mut builder: ::http::request::Builder,
   38     38   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   39     39   
    if let ::std::option::Option::Some(inner_1) = &input.test_id {
   40     40   
        let formatted_2 = inner_1.as_str();
   41         -
        let header_value = formatted_2;
   42         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   43         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   44         -
                "test_id",
   45         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   46         -
            )
   47         -
        })?;
   48         -
        builder = builder.header("X-Amz-Test-Id", header_value);
          41  +
        if !formatted_2.is_empty() {
          42  +
            let header_value = formatted_2;
          43  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          44  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          45  +
                    "test_id",
          46  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          47  +
                )
          48  +
            })?;
          49  +
            builder = builder.header("X-Amz-Test-Id", header_value);
          50  +
        }
   49     51   
    }
   50     52   
    Ok(builder)
   51     53   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_test_payload_blob.rs

@@ -10,10 +50,52 @@
   30     30   
        output.build()
   31     31   
    })
   32     32   
}
   33     33   
   34     34   
pub fn ser_test_payload_blob_headers(
   35     35   
    input: &crate::operation::test_payload_blob::TestPayloadBlobInput,
   36     36   
    mut builder: ::http::request::Builder,
   37     37   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   38     38   
    if let ::std::option::Option::Some(inner_1) = &input.content_type {
   39     39   
        let formatted_2 = inner_1.as_str();
   40         -
        let header_value = formatted_2;
   41         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   42         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   43         -
                "content_type",
   44         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   45         -
            )
   46         -
        })?;
   47         -
        builder = builder.header("Content-Type", header_value);
          40  +
        if !formatted_2.is_empty() {
          41  +
            let header_value = formatted_2;
          42  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          43  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          44  +
                    "content_type",
          45  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          46  +
                )
          47  +
            })?;
          48  +
            builder = builder.header("Content-Type", header_value);
          49  +
        }
   48     50   
    }
   49     51   
    Ok(builder)
   50     52   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_test_payload_structure.rs

@@ -18,18 +58,60 @@
   38     38   
        output.build()
   39     39   
    })
   40     40   
}
   41     41   
   42     42   
pub fn ser_test_payload_structure_headers(
   43     43   
    input: &crate::operation::test_payload_structure::TestPayloadStructureInput,
   44     44   
    mut builder: ::http::request::Builder,
   45     45   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   46     46   
    if let ::std::option::Option::Some(inner_1) = &input.test_id {
   47     47   
        let formatted_2 = inner_1.as_str();
   48         -
        let header_value = formatted_2;
   49         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   50         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   51         -
                "test_id",
   52         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   53         -
            )
   54         -
        })?;
   55         -
        builder = builder.header("x-amz-test-id", header_value);
          48  +
        if !formatted_2.is_empty() {
          49  +
            let header_value = formatted_2;
          50  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          51  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          52  +
                    "test_id",
          53  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          54  +
                )
          55  +
            })?;
          56  +
            builder = builder.header("x-amz-test-id", header_value);
          57  +
        }
   56     58   
    }
   57     59   
    Ok(builder)
   58     60   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_test_post_no_payload.rs

@@ -15,15 +55,57 @@
   35     35   
        output.build()
   36     36   
    })
   37     37   
}
   38     38   
   39     39   
pub fn ser_test_post_no_payload_headers(
   40     40   
    input: &crate::operation::test_post_no_payload::TestPostNoPayloadInput,
   41     41   
    mut builder: ::http::request::Builder,
   42     42   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   43     43   
    if let ::std::option::Option::Some(inner_1) = &input.test_id {
   44     44   
        let formatted_2 = inner_1.as_str();
   45         -
        let header_value = formatted_2;
   46         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   47         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   48         -
                "test_id",
   49         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   50         -
            )
   51         -
        })?;
   52         -
        builder = builder.header("X-Amz-Test-Id", header_value);
          45  +
        if !formatted_2.is_empty() {
          46  +
            let header_value = formatted_2;
          47  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          48  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          49  +
                    "test_id",
          50  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          51  +
                )
          52  +
            })?;
          53  +
            builder = builder.header("X-Amz-Test-Id", header_value);
          54  +
        }
   53     55   
    }
   54     56   
    Ok(builder)
   55     57   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_timestamp_format_headers.rs

@@ -59,59 +165,179 @@
   79     79   
        output.build()
   80     80   
    })
   81     81   
}
   82     82   
   83     83   
pub fn ser_timestamp_format_headers_headers(
   84     84   
    input: &crate::operation::timestamp_format_headers::TimestampFormatHeadersInput,
   85     85   
    mut builder: ::http::request::Builder,
   86     86   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   87     87   
    if let ::std::option::Option::Some(inner_1) = &input.member_epoch_seconds {
   88     88   
        let formatted_2 = inner_1.fmt(::aws_smithy_types::date_time::Format::EpochSeconds)?;
   89         -
        let header_value = formatted_2;
   90         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   91         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   92         -
                "member_epoch_seconds",
   93         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   94         -
            )
   95         -
        })?;
   96         -
        builder = builder.header("X-memberEpochSeconds", header_value);
          89  +
        if !formatted_2.is_empty() {
          90  +
            let header_value = formatted_2;
          91  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          92  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          93  +
                    "member_epoch_seconds",
          94  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          95  +
                )
          96  +
            })?;
          97  +
            builder = builder.header("X-memberEpochSeconds", header_value);
          98  +
        }
   97     99   
    }
   98    100   
    if let ::std::option::Option::Some(inner_3) = &input.member_http_date {
   99    101   
        let formatted_4 = inner_3.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
  100         -
        let header_value = formatted_4;
  101         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  102         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  103         -
                "member_http_date",
  104         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  105         -
            )
  106         -
        })?;
  107         -
        builder = builder.header("X-memberHttpDate", header_value);
         102  +
        if !formatted_4.is_empty() {
         103  +
            let header_value = formatted_4;
         104  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         105  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         106  +
                    "member_http_date",
         107  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         108  +
                )
         109  +
            })?;
         110  +
            builder = builder.header("X-memberHttpDate", header_value);
         111  +
        }
  108    112   
    }
  109    113   
    if let ::std::option::Option::Some(inner_5) = &input.member_date_time {
  110    114   
        let formatted_6 = inner_5.fmt(::aws_smithy_types::date_time::Format::DateTime)?;
  111         -
        let header_value = formatted_6;
  112         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  113         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  114         -
                "member_date_time",
  115         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  116         -
            )
  117         -
        })?;
  118         -
        builder = builder.header("X-memberDateTime", header_value);
         115  +
        if !formatted_6.is_empty() {
         116  +
            let header_value = formatted_6;
         117  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         118  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         119  +
                    "member_date_time",
         120  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         121  +
                )
         122  +
            })?;
         123  +
            builder = builder.header("X-memberDateTime", header_value);
         124  +
        }
  119    125   
    }
  120    126   
    if let ::std::option::Option::Some(inner_7) = &input.default_format {
  121    127   
        let formatted_8 = inner_7.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
  122         -
        let header_value = formatted_8;
  123         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  124         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  125         -
                "default_format",
  126         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  127         -
            )
  128         -
        })?;
  129         -
        builder = builder.header("X-defaultFormat", header_value);
         128  +
        if !formatted_8.is_empty() {
         129  +
            let header_value = formatted_8;
         130  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         131  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         132  +
                    "default_format",
         133  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         134  +
                )
         135  +
            })?;
         136  +
            builder = builder.header("X-defaultFormat", header_value);
         137  +
        }
  130    138   
    }
  131    139   
    if let ::std::option::Option::Some(inner_9) = &input.target_epoch_seconds {
  132    140   
        let formatted_10 = inner_9.fmt(::aws_smithy_types::date_time::Format::EpochSeconds)?;
  133         -
        let header_value = formatted_10;
  134         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  135         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  136         -
                "target_epoch_seconds",
  137         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  138         -
            )
  139         -
        })?;
  140         -
        builder = builder.header("X-targetEpochSeconds", header_value);
         141  +
        if !formatted_10.is_empty() {
         142  +
            let header_value = formatted_10;
         143  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         144  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         145  +
                    "target_epoch_seconds",
         146  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         147  +
                )
         148  +
            })?;
         149  +
            builder = builder.header("X-targetEpochSeconds", header_value);
         150  +
        }
  141    151   
    }
  142    152   
    if let ::std::option::Option::Some(inner_11) = &input.target_http_date {
  143    153   
        let formatted_12 = inner_11.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
  144         -
        let header_value = formatted_12;
  145         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  146         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  147         -
                "target_http_date",
  148         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  149         -
            )
  150         -
        })?;
  151         -
        builder = builder.header("X-targetHttpDate", header_value);
         154  +
        if !formatted_12.is_empty() {
         155  +
            let header_value = formatted_12;
         156  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         157  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         158  +
                    "target_http_date",
         159  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         160  +
                )
         161  +
            })?;
         162  +
            builder = builder.header("X-targetHttpDate", header_value);
         163  +
        }
  152    164   
    }
  153    165   
    if let ::std::option::Option::Some(inner_13) = &input.target_date_time {
  154    166   
        let formatted_14 = inner_13.fmt(::aws_smithy_types::date_time::Format::DateTime)?;
  155         -
        let header_value = formatted_14;
  156         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  157         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  158         -
                "target_date_time",
  159         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  160         -
            )
  161         -
        })?;
  162         -
        builder = builder.header("X-targetDateTime", header_value);
         167  +
        if !formatted_14.is_empty() {
         168  +
            let header_value = formatted_14;
         169  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         170  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         171  +
                    "target_date_time",
         172  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         173  +
                )
         174  +
            })?;
         175  +
            builder = builder.header("X-targetDateTime", header_value);
         176  +
        }
  163    177   
    }
  164    178   
    Ok(builder)
  165    179   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/client.rs

@@ -170,170 +231,229 @@
  190    190   
mod http_request_with_labels_and_timestamp_format;
  191    191   
  192    192   
mod http_response_code;
  193    193   
  194    194   
mod http_string_payload;
  195    195   
  196    196   
mod ignore_query_params_in_response;
  197    197   
  198    198   
mod input_and_output_with_headers;
  199    199   
  200         -
mod nested_xml_map_with_xml_name;
  201         -
  202    200   
mod nested_xml_maps;
  203    201   
  204    202   
mod no_input_and_no_output;
  205    203   
  206    204   
mod no_input_and_output;
  207    205   
  208    206   
mod null_and_empty_headers_client;
  209    207   
  210    208   
mod null_and_empty_headers_server;
  211    209   

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/client/nested_xml_map_with_xml_name.rs

@@ -1,0 +13,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
impl super::Client {
    3         -
    /// Constructs a fluent builder for the [`NestedXmlMapWithXmlName`](crate::operation::nested_xml_map_with_xml_name::builders::NestedXmlMapWithXmlNameFluentBuilder) operation.
    4         -
    ///
    5         -
    /// - The fluent builder is configurable:
    6         -
    ///   - [`nested_xml_map_with_xml_name_map(impl Into<String>, HashMap::<String, String>)`](crate::operation::nested_xml_map_with_xml_name::builders::NestedXmlMapWithXmlNameFluentBuilder::nested_xml_map_with_xml_name_map) / [`set_nested_xml_map_with_xml_name_map(Option<HashMap::<String, HashMap::<String, String>>>)`](crate::operation::nested_xml_map_with_xml_name::builders::NestedXmlMapWithXmlNameFluentBuilder::set_nested_xml_map_with_xml_name_map):<br>required: **false**<br>(undocumented)<br>
    7         -
    /// - On success, responds with [`NestedXmlMapWithXmlNameOutput`](crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameOutput) with field(s):
    8         -
    ///   - [`nested_xml_map_with_xml_name_map(Option<HashMap::<String, HashMap::<String, String>>>)`](crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameOutput::nested_xml_map_with_xml_name_map): (undocumented)
    9         -
    /// - On failure, responds with [`SdkError<NestedXmlMapWithXmlNameError>`](crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameError)
   10         -
    pub fn nested_xml_map_with_xml_name(&self) -> crate::operation::nested_xml_map_with_xml_name::builders::NestedXmlMapWithXmlNameFluentBuilder {
   11         -
        crate::operation::nested_xml_map_with_xml_name::builders::NestedXmlMapWithXmlNameFluentBuilder::new(self.handle.clone())
   12         -
    }
   13         -
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/error_meta.rs

@@ -883,883 +966,942 @@
  903    903   
        }
  904    904   
    }
  905    905   
}
  906    906   
impl From<crate::operation::nested_xml_maps::NestedXmlMapsError> for Error {
  907    907   
    fn from(err: crate::operation::nested_xml_maps::NestedXmlMapsError) -> Self {
  908    908   
        match err {
  909    909   
            crate::operation::nested_xml_maps::NestedXmlMapsError::Unhandled(inner) => Error::Unhandled(inner),
  910    910   
        }
  911    911   
    }
  912    912   
}
  913         -
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameError, R>>
  914         -
    for Error
  915         -
where
  916         -
    R: Send + Sync + std::fmt::Debug + 'static,
  917         -
{
  918         -
    fn from(
  919         -
        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameError, R>,
  920         -
    ) -> Self {
  921         -
        match err {
  922         -
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
  923         -
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
  924         -
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
  925         -
                source: err.into(),
  926         -
            }),
  927         -
        }
  928         -
    }
  929         -
}
  930         -
impl From<crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameError> for Error {
  931         -
    fn from(err: crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameError) -> Self {
  932         -
        match err {
  933         -
            crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameError::Unhandled(inner) => Error::Unhandled(inner),
  934         -
        }
  935         -
    }
  936         -
}
  937    913   
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::no_input_and_no_output::NoInputAndNoOutputError, R>> for Error
  938    914   
where
  939    915   
    R: Send + Sync + std::fmt::Debug + 'static,
  940    916   
{
  941    917   
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::no_input_and_no_output::NoInputAndNoOutputError, R>) -> Self {
  942    918   
        match err {
  943    919   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
  944    920   
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
  945    921   
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
  946    922   
                source: err.into(),

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

@@ -72,72 +134,131 @@
   92     92   
   93     93   
/// Types for the `HttpStringPayload` operation.
   94     94   
pub mod http_string_payload;
   95     95   
   96     96   
/// Types for the `IgnoreQueryParamsInResponse` operation.
   97     97   
pub mod ignore_query_params_in_response;
   98     98   
   99     99   
/// Types for the `InputAndOutputWithHeaders` operation.
  100    100   
pub mod input_and_output_with_headers;
  101    101   
  102         -
/// Types for the `NestedXmlMapWithXmlName` operation.
  103         -
pub mod nested_xml_map_with_xml_name;
  104         -
  105    102   
/// Types for the `NestedXmlMaps` operation.
  106    103   
pub mod nested_xml_maps;
  107    104   
  108    105   
/// Types for the `NoInputAndNoOutput` operation.
  109    106   
pub mod no_input_and_no_output;
  110    107   
  111    108   
/// Types for the `NoInputAndOutput` operation.
  112    109   
pub mod no_input_and_output;
  113    110   
  114    111   
/// Types for the `NullAndEmptyHeadersClient` operation.

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_prefix_headers.rs

@@ -226,226 +342,312 @@
  246    246   
        let expected_headers = [("X-Foo", "Foo"), ("X-Foo-Abc", "Abc value"), ("X-Foo-Def", "Def value")];
  247    247   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  248    248   
        let body = http_request.body().bytes().expect("body should be strict");
  249    249   
        // No body.
  250    250   
        ::pretty_assertions::assert_eq!(&body, &bytes::Bytes::new());
  251    251   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  252    252   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  253    253   
        ::pretty_assertions::assert_eq!(uri.path(), "/HttpPrefixHeaders", "path was incorrect");
  254    254   
    }
  255    255   
  256         -
    /// No prefix headers are serialized because the value is not present
         256  +
    /// No prefix headers are serialized because the value is empty
  257    257   
    /// Test ID: HttpPrefixHeadersAreNotPresent
  258    258   
    #[::tokio::test]
  259    259   
    #[::tracing_test::traced_test]
  260    260   
    async fn http_prefix_headers_are_not_present_request() {
  261    261   
        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
  262    262   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  263    263   
  264    264   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  265    265   
        let result = client
  266    266   
            .http_prefix_headers()
  267    267   
            .set_foo(::std::option::Option::Some("Foo".to_owned()))
  268    268   
            .set_foo_map(::std::option::Option::Some(::std::collections::HashMap::new()))
  269    269   
            .send()
  270    270   
            .await;
  271    271   
        let _ = dbg!(result);
  272    272   
        let http_request = request_receiver.expect_request();
  273    273   
        let expected_headers = [("X-Foo", "Foo")];
  274    274   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  275    275   
        let body = http_request.body().bytes().expect("body should be strict");
  276    276   
        // No body.
  277    277   
        ::pretty_assertions::assert_eq!(&body, &bytes::Bytes::new());
  278    278   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  279    279   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  280    280   
        ::pretty_assertions::assert_eq!(uri.path(), "/HttpPrefixHeaders", "path was incorrect");
  281    281   
    }
  282    282   
  283         -
    /// Serialize prefix headers were the value is present but empty
  284         -
    /// Test ID: HttpPrefixEmptyHeaders
  285         -
    #[::tokio::test]
  286         -
    #[::tracing_test::traced_test]
  287         -
    async fn http_prefix_empty_headers_request() {
  288         -
        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
  289         -
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  290         -
  291         -
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  292         -
        let result = client
  293         -
            .http_prefix_headers()
  294         -
            .set_foo_map(::std::option::Option::Some({
  295         -
                let mut ret = ::std::collections::HashMap::new();
  296         -
                ret.insert("Abc".to_owned().to_ascii_lowercase(), "".to_owned());
  297         -
                ret
  298         -
            }))
  299         -
            .send()
  300         -
            .await;
  301         -
        let _ = dbg!(result);
  302         -
        let http_request = request_receiver.expect_request();
  303         -
        let expected_headers = [("X-Foo-Abc", "")];
  304         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  305         -
        let body = http_request.body().bytes().expect("body should be strict");
  306         -
        // No body.
  307         -
        ::pretty_assertions::assert_eq!(&body, &bytes::Bytes::new());
  308         -
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  309         -
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  310         -
        ::pretty_assertions::assert_eq!(uri.path(), "/HttpPrefixHeaders", "path was incorrect");
  311         -
    }
  312         -
  313    283   
    /// Adds headers by prefix
  314    284   
    /// Test ID: HttpPrefixHeadersArePresent
  315    285   
    #[::tokio::test]
  316    286   
    #[::tracing_test::traced_test]
  317    287   
    async fn http_prefix_headers_are_present_response() {
  318    288   
        let expected_output = crate::operation::http_prefix_headers::HttpPrefixHeadersOutput::builder()
  319    289   
            .set_foo(::std::option::Option::Some("Foo".to_owned()))
  320    290   
            .set_foo_map(::std::option::Option::Some({
  321    291   
                let mut ret = ::std::collections::HashMap::new();
  322    292   
                ret.insert("Abc".to_owned().to_ascii_lowercase(), "Abc value".to_owned());

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/nested_xml_map_with_xml_name.rs

@@ -1,0 +537,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
/// Orchestration and serialization glue logic for `NestedXmlMapWithXmlName`.
    3         -
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4         -
#[non_exhaustive]
    5         -
pub struct NestedXmlMapWithXmlName;
    6         -
impl NestedXmlMapWithXmlName {
    7         -
    /// Creates a new `NestedXmlMapWithXmlName`
    8         -
    pub fn new() -> Self {
    9         -
        Self
   10         -
    }
   11         -
    pub(crate) async fn orchestrate(
   12         -
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13         -
        input: crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameInput,
   14         -
    ) -> ::std::result::Result<
   15         -
        crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameOutput,
   16         -
        ::aws_smithy_runtime_api::client::result::SdkError<
   17         -
            crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameError,
   18         -
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19         -
        >,
   20         -
    > {
   21         -
        let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
   22         -
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
   23         -
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   24         -
        >| {
   25         -
            err.map_service_error(|err| {
   26         -
                err.downcast::<crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameError>()
   27         -
                    .expect("correct error type")
   28         -
            })
   29         -
        };
   30         -
        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
   31         -
            .await
   32         -
            .map_err(map_err)?;
   33         -
        let output = context.finalize().map_err(map_err)?;
   34         -
        ::std::result::Result::Ok(
   35         -
            output
   36         -
                .downcast::<crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameOutput>()
   37         -
                .expect("correct output type"),
   38         -
        )
   39         -
    }
   40         -
   41         -
    pub(crate) async fn orchestrate_with_stop_point(
   42         -
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   43         -
        input: crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameInput,
   44         -
        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
   45         -
    ) -> ::std::result::Result<
   46         -
        ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
   47         -
        ::aws_smithy_runtime_api::client::result::SdkError<
   48         -
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
   49         -
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   50         -
        >,
   51         -
    > {
   52         -
        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
   53         -
        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point(
   54         -
            "restxmlprotocol",
   55         -
            "NestedXmlMapWithXmlName",
   56         -
            input,
   57         -
            runtime_plugins,
   58         -
            stop_point,
   59         -
        )
   60         -
        .await
   61         -
    }
   62         -
   63         -
    pub(crate) fn operation_runtime_plugins(
   64         -
        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   65         -
        client_config: &crate::config::Config,
   66         -
        config_override: ::std::option::Option<crate::config::Builder>,
   67         -
    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
   68         -
        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
   69         -
        runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![
   70         -
            ::aws_smithy_runtime::client::auth::no_auth::NO_AUTH_SCHEME_ID,
   71         -
        ]));
   72         -
        if let ::std::option::Option::Some(config_override) = config_override {
   73         -
            for plugin in config_override.runtime_plugins.iter().cloned() {
   74         -
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   75         -
            }
   76         -
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   77         -
                config_override,
   78         -
                client_config.config.clone(),
   79         -
                &client_config.runtime_components,
   80         -
            ));
   81         -
        }
   82         -
        runtime_plugins
   83         -
    }
   84         -
}
   85         -
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for NestedXmlMapWithXmlName {
   86         -
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
   87         -
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("NestedXmlMapWithXmlName");
   88         -
   89         -
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   90         -
            NestedXmlMapWithXmlNameRequestSerializer,
   91         -
        ));
   92         -
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   93         -
            NestedXmlMapWithXmlNameResponseDeserializer,
   94         -
        ));
   95         -
   96         -
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
   97         -
            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
   98         -
        ));
   99         -
  100         -
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
  101         -
            "NestedXmlMapWithXmlName",
  102         -
            "restxmlprotocol",
  103         -
        ));
  104         -
  105         -
        ::std::option::Option::Some(cfg.freeze())
  106         -
    }
  107         -
  108         -
    fn runtime_components(
  109         -
        &self,
  110         -
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  111         -
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  112         -
        #[allow(unused_mut)]
  113         -
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("NestedXmlMapWithXmlName")
  114         -
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  115         -
            .with_interceptor(NestedXmlMapWithXmlNameEndpointParamsInterceptor)
  116         -
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  117         -
                crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameError,
  118         -
            >::new())
  119         -
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  120         -
                crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameError,
  121         -
            >::new());
  122         -
  123         -
        ::std::borrow::Cow::Owned(rcb)
  124         -
    }
  125         -
}
  126         -
  127         -
#[derive(Debug)]
  128         -
struct NestedXmlMapWithXmlNameResponseDeserializer;
  129         -
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for NestedXmlMapWithXmlNameResponseDeserializer {
  130         -
    fn deserialize_nonstreaming(
  131         -
        &self,
  132         -
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  133         -
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  134         -
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  135         -
        let headers = response.headers();
  136         -
        let body = response.body().bytes().expect("body loaded");
  137         -
        #[allow(unused_mut)]
  138         -
        let mut force_error = false;
  139         -
  140         -
        let parse_result = if !success && status != 200 || force_error {
  141         -
            crate::protocol_serde::shape_nested_xml_map_with_xml_name::de_nested_xml_map_with_xml_name_http_error(status, headers, body)
  142         -
        } else {
  143         -
            crate::protocol_serde::shape_nested_xml_map_with_xml_name::de_nested_xml_map_with_xml_name_http_response(status, headers, body)
  144         -
        };
  145         -
        crate::protocol_serde::type_erase_result(parse_result)
  146         -
    }
  147         -
}
  148         -
#[derive(Debug)]
  149         -
struct NestedXmlMapWithXmlNameRequestSerializer;
  150         -
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for NestedXmlMapWithXmlNameRequestSerializer {
  151         -
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  152         -
    fn serialize_input(
  153         -
        &self,
  154         -
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  155         -
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  156         -
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  157         -
        let input = input
  158         -
            .downcast::<crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameInput>()
  159         -
            .expect("correct type");
  160         -
        let _header_serialization_settings = _cfg
  161         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  162         -
            .cloned()
  163         -
            .unwrap_or_default();
  164         -
        let mut request_builder = {
  165         -
            fn uri_base(
  166         -
                _input: &crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameInput,
  167         -
                output: &mut ::std::string::String,
  168         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  169         -
                use ::std::fmt::Write as _;
  170         -
                ::std::write!(output, "/NestedXmlMapWithXmlName").expect("formatting should succeed");
  171         -
                ::std::result::Result::Ok(())
  172         -
            }
  173         -
            #[allow(clippy::unnecessary_wraps)]
  174         -
            fn update_http_builder(
  175         -
                input: &crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameInput,
  176         -
                builder: ::http::request::Builder,
  177         -
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  178         -
                let mut uri = ::std::string::String::new();
  179         -
                uri_base(input, &mut uri)?;
  180         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  181         -
            }
  182         -
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  183         -
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/xml");
  184         -
            builder
  185         -
        };
  186         -
        let body = ::aws_smithy_types::body::SdkBody::from(
  187         -
            crate::protocol_serde::shape_nested_xml_map_with_xml_name::ser_nested_xml_map_with_xml_name_op_input(&input)?,
  188         -
        );
  189         -
        if let Some(content_length) = body.content_length() {
  190         -
            let content_length = content_length.to_string();
  191         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  192         -
        }
  193         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  194         -
    }
  195         -
}
  196         -
#[derive(Debug)]
  197         -
struct NestedXmlMapWithXmlNameEndpointParamsInterceptor;
  198         -
  199         -
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for NestedXmlMapWithXmlNameEndpointParamsInterceptor {
  200         -
    fn name(&self) -> &'static str {
  201         -
        "NestedXmlMapWithXmlNameEndpointParamsInterceptor"
  202         -
    }
  203         -
  204         -
    fn read_before_execution(
  205         -
        &self,
  206         -
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  207         -
            '_,
  208         -
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  209         -
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  210         -
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  211         -
        >,
  212         -
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  213         -
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  214         -
        let _input = context
  215         -
            .input()
  216         -
            .downcast_ref::<NestedXmlMapWithXmlNameInput>()
  217         -
            .ok_or("failed to downcast to NestedXmlMapWithXmlNameInput")?;
  218         -
  219         -
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  220         -
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  221         -
        })?;
  222         -
        cfg.interceptor_state()
  223         -
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  224         -
        ::std::result::Result::Ok(())
  225         -
    }
  226         -
}
  227         -
  228         -
// The get_* functions below are generated from JMESPath expressions in the
  229         -
// operationContextParams trait. They target the operation's input shape.
  230         -
  231         -
#[allow(unreachable_code, unused_variables)]
  232         -
#[cfg(test)]
  233         -
mod nested_xml_map_with_xml_name_test {
  234         -
  235         -
    /// Serializes nested XML Maps in requests that have xmlName on members
  236         -
    /// Test ID: NestedXmlMapWithXmlNameSerializes
  237         -
    #[::tokio::test]
  238         -
    #[::tracing_test::traced_test]
  239         -
    #[should_panic]
  240         -
    async fn nested_xml_map_with_xml_name_serializes_request() {
  241         -
        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
  242         -
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  243         -
  244         -
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  245         -
        let result = client
  246         -
            .nested_xml_map_with_xml_name()
  247         -
            .set_nested_xml_map_with_xml_name_map(::std::option::Option::Some({
  248         -
                let mut ret = ::std::collections::HashMap::new();
  249         -
                ret.insert("foo".to_owned(), {
  250         -
                    let mut ret = ::std::collections::HashMap::new();
  251         -
                    ret.insert("bar".to_owned(), "Baz".to_owned());
  252         -
                    ret.insert("fizz".to_owned(), "Buzz".to_owned());
  253         -
                    ret
  254         -
                });
  255         -
                ret.insert("qux".to_owned(), {
  256         -
                    let mut ret = ::std::collections::HashMap::new();
  257         -
                    ret.insert("foobar".to_owned(), "Bar".to_owned());
  258         -
                    ret.insert("fizzbuzz".to_owned(), "Buzz".to_owned());
  259         -
                    ret
  260         -
                });
  261         -
                ret
  262         -
            }))
  263         -
            .send()
  264         -
            .await;
  265         -
        let _ = dbg!(result);
  266         -
        let http_request = request_receiver.expect_request();
  267         -
        let expected_headers = [("Content-Type", "application/xml")];
  268         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  269         -
        let body = http_request.body().bytes().expect("body should be strict");
  270         -
        ::aws_smithy_protocol_test::assert_ok(
  271         -
        ::aws_smithy_protocol_test::validate_body(body, "    <NestedXmlMapWithXmlNameRequest>\n        <nestedXmlMapWithXmlNameMap>\n            <entry>\n                <OuterKey>foo</OuterKey>\n                <value>\n                    <entry>\n                        <InnerKey>bar</InnerKey>\n                        <InnerValue>Baz</InnerValue>\n                    </entry>\n                    <entry>\n                        <InnerKey>fizz</InnerKey>\n                        <InnerValue>Buzz</InnerValue>\n                    </entry>\n                </value>\n            </entry>\n            <entry>\n                <OuterKey>qux</OuterKey>\n                <value>\n                    <entry>\n                        <InnerKey>foobar</InnerKey>\n                        <InnerValue>Bar</InnerValue>\n                    </entry>\n                    <entry>\n                        <InnerKey>fizzbuzz</InnerKey>\n                        <InnerValue>Buzz</InnerValue>\n                    </entry>\n                </value>\n            </entry>\n        </nestedXmlMapWithXmlNameMap>\n    </NestedXmlMapWithXmlNameRequest>\n", ::aws_smithy_protocol_test::MediaType::from("application/xml"))
  272         -
        );
  273         -
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  274         -
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  275         -
        ::pretty_assertions::assert_eq!(uri.path(), "/NestedXmlMapWithXmlName", "path was incorrect");
  276         -
    }
  277         -
  278         -
    /// Serializes nested XML Maps in requests that have xmlName on members
  279         -
    /// Test ID: NestedXmlMapWithXmlNameSerializes_hotfixed
  280         -
    #[::tokio::test]
  281         -
    #[::tracing_test::traced_test]
  282         -
    async fn nested_xml_map_with_xml_name_serializes_hotfixed_request() {
  283         -
        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
  284         -
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  285         -
  286         -
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  287         -
        let result = client
  288         -
            .nested_xml_map_with_xml_name()
  289         -
            .set_nested_xml_map_with_xml_name_map(::std::option::Option::Some({
  290         -
                let mut ret = ::std::collections::HashMap::new();
  291         -
                ret.insert("foo".to_owned(), {
  292         -
                    let mut ret = ::std::collections::HashMap::new();
  293         -
                    ret.insert("bar".to_owned(), "Baz".to_owned());
  294         -
                    ret.insert("fizz".to_owned(), "Buzz".to_owned());
  295         -
                    ret
  296         -
                });
  297         -
                ret.insert("qux".to_owned(), {
  298         -
                    let mut ret = ::std::collections::HashMap::new();
  299         -
                    ret.insert("foobar".to_owned(), "Bar".to_owned());
  300         -
                    ret.insert("fizzbuzz".to_owned(), "Buzz".to_owned());
  301         -
                    ret
  302         -
                });
  303         -
                ret
  304         -
            }))
  305         -
            .send()
  306         -
            .await;
  307         -
        let _ = dbg!(result);
  308         -
        let http_request = request_receiver.expect_request();
  309         -
        let expected_headers = [("Content-Type", "application/xml")];
  310         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  311         -
        let body = http_request.body().bytes().expect("body should be strict");
  312         -
        ::aws_smithy_protocol_test::assert_ok(
  313         -
        ::aws_smithy_protocol_test::validate_body(body, "    <NestedXmlMapWithXmlNameInputOutput>\n        <nestedXmlMapWithXmlNameMap>\n            <entry>\n                <OuterKey>foo</OuterKey>\n                <value>\n                    <entry>\n                        <InnerKey>bar</InnerKey>\n                        <InnerValue>Baz</InnerValue>\n                    </entry>\n                    <entry>\n                        <InnerKey>fizz</InnerKey>\n                        <InnerValue>Buzz</InnerValue>\n                    </entry>\n                </value>\n            </entry>\n            <entry>\n                <OuterKey>qux</OuterKey>\n                <value>\n                    <entry>\n                        <InnerKey>foobar</InnerKey>\n                        <InnerValue>Bar</InnerValue>\n                    </entry>\n                    <entry>\n                        <InnerKey>fizzbuzz</InnerKey>\n                        <InnerValue>Buzz</InnerValue>\n                    </entry>\n                </value>\n            </entry>\n        </nestedXmlMapWithXmlNameMap>\n    </NestedXmlMapWithXmlNameInputOutput>\n", ::aws_smithy_protocol_test::MediaType::from("application/xml"))
  314         -
        );
  315         -
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  316         -
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  317         -
        ::pretty_assertions::assert_eq!(uri.path(), "/NestedXmlMapWithXmlName", "path was incorrect");
  318         -
    }
  319         -
  320         -
    /// Serializes nested XML maps in responses that have xmlName on members
  321         -
    /// Test ID: NestedXmlMapWithXmlNameDeserializes
  322         -
    #[::tokio::test]
  323         -
    #[::tracing_test::traced_test]
  324         -
    #[should_panic]
  325         -
    async fn nested_xml_map_with_xml_name_deserializes_response() {
  326         -
        let expected_output = crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameOutput::builder()
  327         -
            .set_nested_xml_map_with_xml_name_map(::std::option::Option::Some({
  328         -
                let mut ret = ::std::collections::HashMap::new();
  329         -
                ret.insert("foo".to_owned(), {
  330         -
                    let mut ret = ::std::collections::HashMap::new();
  331         -
                    ret.insert("bar".to_owned(), "Baz".to_owned());
  332         -
                    ret.insert("fizz".to_owned(), "Buzz".to_owned());
  333         -
                    ret
  334         -
                });
  335         -
                ret.insert("qux".to_owned(), {
  336         -
                    let mut ret = ::std::collections::HashMap::new();
  337         -
                    ret.insert("foobar".to_owned(), "Bar".to_owned());
  338         -
                    ret.insert("fizzbuzz".to_owned(), "Buzz".to_owned());
  339         -
                    ret
  340         -
                });
  341         -
                ret
  342         -
            }))
  343         -
            .build();
  344         -
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(::http::response::Builder::new()
  345         -
        .header("Content-Type", "application/xml")
  346         -
        .status(200)
  347         -
                    .body(::aws_smithy_types::body::SdkBody::from("    <NestedXmlMapWithXmlNameResponse>\n        <nestedXmlMapWithXmlNameMap>\n            <entry>\n                <OuterKey>foo</OuterKey>\n                <value>\n                    <entry>\n                        <InnerKey>bar</InnerKey>\n                        <InnerValue>Baz</InnerValue>\n                    </entry>\n                    <entry>\n                        <InnerKey>fizz</InnerKey>\n                        <InnerValue>Buzz</InnerValue>\n                    </entry>\n                </value>\n            </entry>\n            <entry>\n                <OuterKey>qux</OuterKey>\n                <value>\n                    <entry>\n                        <InnerKey>foobar</InnerKey>\n                        <InnerValue>Bar</InnerValue>\n                    </entry>\n                    <entry>\n                        <InnerKey>fizzbuzz</InnerKey>\n                        <InnerValue>Buzz</InnerValue>\n                    </entry>\n                </value>\n            </entry>\n        </nestedXmlMapWithXmlNameMap>\n    </NestedXmlMapWithXmlNameResponse>\n"))
  348         -
                    .unwrap()
  349         -
                    ).unwrap();
  350         -
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  351         -
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  352         -
  353         -
        let op = crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlName::new();
  354         -
        let config = op.config().expect("the operation has config");
  355         -
        let de = config
  356         -
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  357         -
            .expect("the config must have a deserializer");
  358         -
  359         -
        let parsed = de.deserialize_streaming(&mut http_response);
  360         -
        let parsed = parsed.unwrap_or_else(|| {
  361         -
            let http_response = http_response.map(|body| {
  362         -
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  363         -
                    body.bytes().unwrap(),
  364         -
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  365         -
                )))
  366         -
            });
  367         -
            de.deserialize_nonstreaming(&http_response)
  368         -
        });
  369         -
        let parsed = parsed
  370         -
            .expect("should be successful response")
  371         -
            .downcast::<crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameOutput>()
  372         -
            .unwrap();
  373         -
        ::pretty_assertions::assert_eq!(
  374         -
            parsed.nested_xml_map_with_xml_name_map,
  375         -
            expected_output.nested_xml_map_with_xml_name_map,
  376         -
            "Unexpected value for `nested_xml_map_with_xml_name_map`"
  377         -
        );
  378         -
    }
  379         -
  380         -
    /// Serializes nested XML maps in responses that have xmlName on members
  381         -
    /// Test ID: NestedXmlMapWithXmlNameDeserializes_hotfixed
  382         -
    #[::tokio::test]
  383         -
    #[::tracing_test::traced_test]
  384         -
    async fn nested_xml_map_with_xml_name_deserializes_hotfixed_response() {
  385         -
        let expected_output = crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameOutput::builder()
  386         -
            .set_nested_xml_map_with_xml_name_map(::std::option::Option::Some({
  387         -
                let mut ret = ::std::collections::HashMap::new();
  388         -
                ret.insert("foo".to_owned(), {
  389         -
                    let mut ret = ::std::collections::HashMap::new();
  390         -
                    ret.insert("bar".to_owned(), "Baz".to_owned());
  391         -
                    ret.insert("fizz".to_owned(), "Buzz".to_owned());
  392         -
                    ret
  393         -
                });
  394         -
                ret.insert("qux".to_owned(), {
  395         -
                    let mut ret = ::std::collections::HashMap::new();
  396         -
                    ret.insert("foobar".to_owned(), "Bar".to_owned());
  397         -
                    ret.insert("fizzbuzz".to_owned(), "Buzz".to_owned());
  398         -
                    ret
  399         -
                });
  400         -
                ret
  401         -
            }))
  402         -
            .build();
  403         -
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(::http::response::Builder::new()
  404         -
        .header("Content-Type", "application/xml")
  405         -
        .status(200)
  406         -
                    .body(::aws_smithy_types::body::SdkBody::from("    <NestedXmlMapWithXmlNameInputOutput>\n        <nestedXmlMapWithXmlNameMap>\n            <entry>\n                <OuterKey>foo</OuterKey>\n                <value>\n                    <entry>\n                        <InnerKey>bar</InnerKey>\n                        <InnerValue>Baz</InnerValue>\n                    </entry>\n                    <entry>\n                        <InnerKey>fizz</InnerKey>\n                        <InnerValue>Buzz</InnerValue>\n                    </entry>\n                </value>\n            </entry>\n            <entry>\n                <OuterKey>qux</OuterKey>\n                <value>\n                    <entry>\n                        <InnerKey>foobar</InnerKey>\n                        <InnerValue>Bar</InnerValue>\n                    </entry>\n                    <entry>\n                        <InnerKey>fizzbuzz</InnerKey>\n                        <InnerValue>Buzz</InnerValue>\n                    </entry>\n                </value>\n            </entry>\n        </nestedXmlMapWithXmlNameMap>\n    </NestedXmlMapWithXmlNameInputOutput>\n"))
  407         -
                    .unwrap()
  408         -
                    ).unwrap();
  409         -
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  410         -
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  411         -
  412         -
        let op = crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlName::new();
  413         -
        let config = op.config().expect("the operation has config");
  414         -
        let de = config
  415         -
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  416         -
            .expect("the config must have a deserializer");
  417         -
  418         -
        let parsed = de.deserialize_streaming(&mut http_response);
  419         -
        let parsed = parsed.unwrap_or_else(|| {
  420         -
            let http_response = http_response.map(|body| {
  421         -
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  422         -
                    body.bytes().unwrap(),
  423         -
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  424         -
                )))
  425         -
            });
  426         -
            de.deserialize_nonstreaming(&http_response)
  427         -
        });
  428         -
        let parsed = parsed
  429         -
            .expect("should be successful response")
  430         -
            .downcast::<crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameOutput>()
  431         -
            .unwrap();
  432         -
        ::pretty_assertions::assert_eq!(
  433         -
            parsed.nested_xml_map_with_xml_name_map,
  434         -
            expected_output.nested_xml_map_with_xml_name_map,
  435         -
            "Unexpected value for `nested_xml_map_with_xml_name_map`"
  436         -
        );
  437         -
    }
  438         -
}
  439         -
  440         -
/// Error type for the `NestedXmlMapWithXmlNameError` operation.
  441         -
#[non_exhaustive]
  442         -
#[derive(::std::fmt::Debug)]
  443         -
pub enum NestedXmlMapWithXmlNameError {
  444         -
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  445         -
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  446         -
    variable wildcard pattern and check `.code()`:
  447         -
     \
  448         -
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  449         -
     \
  450         -
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-NestedXmlMapWithXmlNameError) for what information is available for the error.")]
  451         -
    Unhandled(crate::error::sealed_unhandled::Unhandled),
  452         -
}
  453         -
impl NestedXmlMapWithXmlNameError {
  454         -
    /// Creates the `NestedXmlMapWithXmlNameError::Unhandled` variant from any error type.
  455         -
    pub fn unhandled(
  456         -
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  457         -
    ) -> Self {
  458         -
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  459         -
            source: err.into(),
  460         -
            meta: ::std::default::Default::default(),
  461         -
        })
  462         -
    }
  463         -
  464         -
    /// Creates the `NestedXmlMapWithXmlNameError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  465         -
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  466         -
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  467         -
            source: err.clone().into(),
  468         -
            meta: err,
  469         -
        })
  470         -
    }
  471         -
    ///
  472         -
    /// Returns error metadata, which includes the error code, message,
  473         -
    /// request ID, and potentially additional information.
  474         -
    ///
  475         -
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
  476         -
        match self {
  477         -
            Self::Unhandled(e) => &e.meta,
  478         -
        }
  479         -
    }
  480         -
}
  481         -
impl ::std::error::Error for NestedXmlMapWithXmlNameError {
  482         -
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
  483         -
        match self {
  484         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
  485         -
        }
  486         -
    }
  487         -
}
  488         -
impl ::std::fmt::Display for NestedXmlMapWithXmlNameError {
  489         -
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  490         -
        match self {
  491         -
            Self::Unhandled(_inner) => {
  492         -
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  493         -
                    write!(f, "unhandled error ({code})")
  494         -
                } else {
  495         -
                    f.write_str("unhandled error")
  496         -
                }
  497         -
            }
  498         -
        }
  499         -
    }
  500         -
}
  501         -
impl ::aws_smithy_types::retry::ProvideErrorKind for NestedXmlMapWithXmlNameError {
  502         -
    fn code(&self) -> ::std::option::Option<&str> {
  503         -
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
  504         -
    }
  505         -
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
  506         -
        ::std::option::Option::None
  507         -
    }
  508         -
}
  509         -
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for NestedXmlMapWithXmlNameError {
  510         -
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
  511         -
        match self {
  512         -
            Self::Unhandled(_inner) => &_inner.meta,
  513         -
        }
  514         -
    }
  515         -
}
  516         -
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for NestedXmlMapWithXmlNameError {
  517         -
    fn create_unhandled_error(
  518         -
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  519         -
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  520         -
    ) -> Self {
  521         -
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  522         -
            source,
  523         -
            meta: meta.unwrap_or_default(),
  524         -
        })
  525         -
    }
  526         -
}
  527         -
  528         -
pub use crate::operation::nested_xml_map_with_xml_name::_nested_xml_map_with_xml_name_output::NestedXmlMapWithXmlNameOutput;
  529         -
  530         -
pub use crate::operation::nested_xml_map_with_xml_name::_nested_xml_map_with_xml_name_input::NestedXmlMapWithXmlNameInput;
  531         -
  532         -
mod _nested_xml_map_with_xml_name_input;
  533         -
  534         -
mod _nested_xml_map_with_xml_name_output;
  535         -
  536         -
/// Builders
  537         -
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/nested_xml_map_with_xml_name/_nested_xml_map_with_xml_name_input.rs

@@ -1,0 +80,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(missing_docs)] // documentation missing in model
    3         -
#[non_exhaustive]
    4         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct NestedXmlMapWithXmlNameInput {
    6         -
    #[allow(missing_docs)] // documentation missing in model
    7         -
    pub nested_xml_map_with_xml_name_map: ::std::option::Option<
    8         -
        ::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    9         -
    >,
   10         -
}
   11         -
impl NestedXmlMapWithXmlNameInput {
   12         -
    #[allow(missing_docs)] // documentation missing in model
   13         -
    pub fn nested_xml_map_with_xml_name_map(
   14         -
        &self,
   15         -
    ) -> ::std::option::Option<
   16         -
        &::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, ::std::string::String>>,
   17         -
    > {
   18         -
        self.nested_xml_map_with_xml_name_map.as_ref()
   19         -
    }
   20         -
}
   21         -
impl NestedXmlMapWithXmlNameInput {
   22         -
    /// Creates a new builder-style object to manufacture [`NestedXmlMapWithXmlNameInput`](crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameInput).
   23         -
    pub fn builder() -> crate::operation::nested_xml_map_with_xml_name::builders::NestedXmlMapWithXmlNameInputBuilder {
   24         -
        crate::operation::nested_xml_map_with_xml_name::builders::NestedXmlMapWithXmlNameInputBuilder::default()
   25         -
    }
   26         -
}
   27         -
   28         -
/// A builder for [`NestedXmlMapWithXmlNameInput`](crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameInput).
   29         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   30         -
#[non_exhaustive]
   31         -
pub struct NestedXmlMapWithXmlNameInputBuilder {
   32         -
    pub(crate) nested_xml_map_with_xml_name_map: ::std::option::Option<
   33         -
        ::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, ::std::string::String>>,
   34         -
    >,
   35         -
}
   36         -
impl NestedXmlMapWithXmlNameInputBuilder {
   37         -
    /// Adds a key-value pair to `nested_xml_map_with_xml_name_map`.
   38         -
    ///
   39         -
    /// To override the contents of this collection use [`set_nested_xml_map_with_xml_name_map`](Self::set_nested_xml_map_with_xml_name_map).
   40         -
    ///
   41         -
    pub fn nested_xml_map_with_xml_name_map(
   42         -
        mut self,
   43         -
        k: impl ::std::convert::Into<::std::string::String>,
   44         -
        v: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
   45         -
    ) -> Self {
   46         -
        let mut hash_map = self.nested_xml_map_with_xml_name_map.unwrap_or_default();
   47         -
        hash_map.insert(k.into(), v);
   48         -
        self.nested_xml_map_with_xml_name_map = ::std::option::Option::Some(hash_map);
   49         -
        self
   50         -
    }
   51         -
    #[allow(missing_docs)] // documentation missing in model
   52         -
    pub fn set_nested_xml_map_with_xml_name_map(
   53         -
        mut self,
   54         -
        input: ::std::option::Option<
   55         -
            ::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, ::std::string::String>>,
   56         -
        >,
   57         -
    ) -> Self {
   58         -
        self.nested_xml_map_with_xml_name_map = input;
   59         -
        self
   60         -
    }
   61         -
    #[allow(missing_docs)] // documentation missing in model
   62         -
    pub fn get_nested_xml_map_with_xml_name_map(
   63         -
        &self,
   64         -
    ) -> &::std::option::Option<
   65         -
        ::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, ::std::string::String>>,
   66         -
    > {
   67         -
        &self.nested_xml_map_with_xml_name_map
   68         -
    }
   69         -
    /// Consumes the builder and constructs a [`NestedXmlMapWithXmlNameInput`](crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameInput).
   70         -
    pub fn build(
   71         -
        self,
   72         -
    ) -> ::std::result::Result<
   73         -
        crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameInput,
   74         -
        ::aws_smithy_types::error::operation::BuildError,
   75         -
    > {
   76         -
        ::std::result::Result::Ok(crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameInput {
   77         -
            nested_xml_map_with_xml_name_map: self.nested_xml_map_with_xml_name_map,
   78         -
        })
   79         -
    }
   80         -
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/nested_xml_map_with_xml_name/_nested_xml_map_with_xml_name_output.rs

@@ -1,0 +75,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(missing_docs)] // documentation missing in model
    3         -
#[non_exhaustive]
    4         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct NestedXmlMapWithXmlNameOutput {
    6         -
    #[allow(missing_docs)] // documentation missing in model
    7         -
    pub nested_xml_map_with_xml_name_map: ::std::option::Option<
    8         -
        ::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    9         -
    >,
   10         -
}
   11         -
impl NestedXmlMapWithXmlNameOutput {
   12         -
    #[allow(missing_docs)] // documentation missing in model
   13         -
    pub fn nested_xml_map_with_xml_name_map(
   14         -
        &self,
   15         -
    ) -> ::std::option::Option<
   16         -
        &::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, ::std::string::String>>,
   17         -
    > {
   18         -
        self.nested_xml_map_with_xml_name_map.as_ref()
   19         -
    }
   20         -
}
   21         -
impl NestedXmlMapWithXmlNameOutput {
   22         -
    /// Creates a new builder-style object to manufacture [`NestedXmlMapWithXmlNameOutput`](crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameOutput).
   23         -
    pub fn builder() -> crate::operation::nested_xml_map_with_xml_name::builders::NestedXmlMapWithXmlNameOutputBuilder {
   24         -
        crate::operation::nested_xml_map_with_xml_name::builders::NestedXmlMapWithXmlNameOutputBuilder::default()
   25         -
    }
   26         -
}
   27         -
   28         -
/// A builder for [`NestedXmlMapWithXmlNameOutput`](crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameOutput).
   29         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   30         -
#[non_exhaustive]
   31         -
pub struct NestedXmlMapWithXmlNameOutputBuilder {
   32         -
    pub(crate) nested_xml_map_with_xml_name_map: ::std::option::Option<
   33         -
        ::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, ::std::string::String>>,
   34         -
    >,
   35         -
}
   36         -
impl NestedXmlMapWithXmlNameOutputBuilder {
   37         -
    /// Adds a key-value pair to `nested_xml_map_with_xml_name_map`.
   38         -
    ///
   39         -
    /// To override the contents of this collection use [`set_nested_xml_map_with_xml_name_map`](Self::set_nested_xml_map_with_xml_name_map).
   40         -
    ///
   41         -
    pub fn nested_xml_map_with_xml_name_map(
   42         -
        mut self,
   43         -
        k: impl ::std::convert::Into<::std::string::String>,
   44         -
        v: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
   45         -
    ) -> Self {
   46         -
        let mut hash_map = self.nested_xml_map_with_xml_name_map.unwrap_or_default();
   47         -
        hash_map.insert(k.into(), v);
   48         -
        self.nested_xml_map_with_xml_name_map = ::std::option::Option::Some(hash_map);
   49         -
        self
   50         -
    }
   51         -
    #[allow(missing_docs)] // documentation missing in model
   52         -
    pub fn set_nested_xml_map_with_xml_name_map(
   53         -
        mut self,
   54         -
        input: ::std::option::Option<
   55         -
            ::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, ::std::string::String>>,
   56         -
        >,
   57         -
    ) -> Self {
   58         -
        self.nested_xml_map_with_xml_name_map = input;
   59         -
        self
   60         -
    }
   61         -
    #[allow(missing_docs)] // documentation missing in model
   62         -
    pub fn get_nested_xml_map_with_xml_name_map(
   63         -
        &self,
   64         -
    ) -> &::std::option::Option<
   65         -
        ::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, ::std::string::String>>,
   66         -
    > {
   67         -
        &self.nested_xml_map_with_xml_name_map
   68         -
    }
   69         -
    /// Consumes the builder and constructs a [`NestedXmlMapWithXmlNameOutput`](crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameOutput).
   70         -
    pub fn build(self) -> crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameOutput {
   71         -
        crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameOutput {
   72         -
            nested_xml_map_with_xml_name_map: self.nested_xml_map_with_xml_name_map,
   73         -
        }
   74         -
    }
   75         -
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/nested_xml_map_with_xml_name/builders.rs

@@ -1,0 +143,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub use crate::operation::nested_xml_map_with_xml_name::_nested_xml_map_with_xml_name_output::NestedXmlMapWithXmlNameOutputBuilder;
    3         -
    4         -
pub use crate::operation::nested_xml_map_with_xml_name::_nested_xml_map_with_xml_name_input::NestedXmlMapWithXmlNameInputBuilder;
    5         -
    6         -
impl crate::operation::nested_xml_map_with_xml_name::builders::NestedXmlMapWithXmlNameInputBuilder {
    7         -
    /// Sends a request with this input using the given client.
    8         -
    pub async fn send_with(
    9         -
        self,
   10         -
        client: &crate::Client,
   11         -
    ) -> ::std::result::Result<
   12         -
        crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameOutput,
   13         -
        ::aws_smithy_runtime_api::client::result::SdkError<
   14         -
            crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameError,
   15         -
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16         -
        >,
   17         -
    > {
   18         -
        let mut fluent_builder = client.nested_xml_map_with_xml_name();
   19         -
        fluent_builder.inner = self;
   20         -
        fluent_builder.send().await
   21         -
    }
   22         -
}
   23         -
/// Fluent builder constructing a request to `NestedXmlMapWithXmlName`.
   24         -
///
   25         -
/// Nested Xml Maps with key/values with @xmlName
   26         -
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
   27         -
pub struct NestedXmlMapWithXmlNameFluentBuilder {
   28         -
    handle: ::std::sync::Arc<crate::client::Handle>,
   29         -
    inner: crate::operation::nested_xml_map_with_xml_name::builders::NestedXmlMapWithXmlNameInputBuilder,
   30         -
    config_override: ::std::option::Option<crate::config::Builder>,
   31         -
}
   32         -
impl
   33         -
    crate::client::customize::internal::CustomizableSend<
   34         -
        crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameOutput,
   35         -
        crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameError,
   36         -
    > for NestedXmlMapWithXmlNameFluentBuilder
   37         -
{
   38         -
    fn send(
   39         -
        self,
   40         -
        config_override: crate::config::Builder,
   41         -
    ) -> crate::client::customize::internal::BoxFuture<
   42         -
        crate::client::customize::internal::SendResult<
   43         -
            crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameOutput,
   44         -
            crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameError,
   45         -
        >,
   46         -
    > {
   47         -
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
   48         -
    }
   49         -
}
   50         -
impl NestedXmlMapWithXmlNameFluentBuilder {
   51         -
    /// Creates a new `NestedXmlMapWithXmlNameFluentBuilder`.
   52         -
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
   53         -
        Self {
   54         -
            handle,
   55         -
            inner: ::std::default::Default::default(),
   56         -
            config_override: ::std::option::Option::None,
   57         -
        }
   58         -
    }
   59         -
    /// Access the NestedXmlMapWithXmlName as a reference.
   60         -
    pub fn as_input(&self) -> &crate::operation::nested_xml_map_with_xml_name::builders::NestedXmlMapWithXmlNameInputBuilder {
   61         -
        &self.inner
   62         -
    }
   63         -
    /// Sends the request and returns the response.
   64         -
    ///
   65         -
    /// If an error occurs, an `SdkError` will be returned with additional details that
   66         -
    /// can be matched against.
   67         -
    ///
   68         -
    /// By default, any retryable failures will be retried twice. Retry behavior
   69         -
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   70         -
    /// set when configuring the client.
   71         -
    pub async fn send(
   72         -
        self,
   73         -
    ) -> ::std::result::Result<
   74         -
        crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameOutput,
   75         -
        ::aws_smithy_runtime_api::client::result::SdkError<
   76         -
            crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameError,
   77         -
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   78         -
        >,
   79         -
    > {
   80         -
        let input = self
   81         -
            .inner
   82         -
            .build()
   83         -
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
   84         -
        let runtime_plugins = crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlName::operation_runtime_plugins(
   85         -
            self.handle.runtime_plugins.clone(),
   86         -
            &self.handle.conf,
   87         -
            self.config_override,
   88         -
        );
   89         -
        crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlName::orchestrate(&runtime_plugins, input).await
   90         -
    }
   91         -
   92         -
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
   93         -
    pub fn customize(
   94         -
        self,
   95         -
    ) -> crate::client::customize::CustomizableOperation<
   96         -
        crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameOutput,
   97         -
        crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameError,
   98         -
        Self,
   99         -
    > {
  100         -
        crate::client::customize::CustomizableOperation::new(self)
  101         -
    }
  102         -
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  103         -
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  104         -
        self
  105         -
    }
  106         -
  107         -
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  108         -
        self.config_override = config_override;
  109         -
        self
  110         -
    }
  111         -
    ///
  112         -
    /// Adds a key-value pair to `nestedXmlMapWithXmlNameMap`.
  113         -
    ///
  114         -
    /// To override the contents of this collection use [`set_nested_xml_map_with_xml_name_map`](Self::set_nested_xml_map_with_xml_name_map).
  115         -
    ///
  116         -
    #[allow(missing_docs)] // documentation missing in model
  117         -
    pub fn nested_xml_map_with_xml_name_map(
  118         -
        mut self,
  119         -
        k: impl ::std::convert::Into<::std::string::String>,
  120         -
        v: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
  121         -
    ) -> Self {
  122         -
        self.inner = self.inner.nested_xml_map_with_xml_name_map(k.into(), v);
  123         -
        self
  124         -
    }
  125         -
    #[allow(missing_docs)] // documentation missing in model
  126         -
    pub fn set_nested_xml_map_with_xml_name_map(
  127         -
        mut self,
  128         -
        input: ::std::option::Option<
  129         -
            ::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, ::std::string::String>>,
  130         -
        >,
  131         -
    ) -> Self {
  132         -
        self.inner = self.inner.set_nested_xml_map_with_xml_name_map(input);
  133         -
        self
  134         -
    }
  135         -
    #[allow(missing_docs)] // documentation missing in model
  136         -
    pub fn get_nested_xml_map_with_xml_name_map(
  137         -
        &self,
  138         -
    ) -> &::std::option::Option<
  139         -
        ::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, ::std::string::String>>,
  140         -
    > {
  141         -
        self.inner.get_nested_xml_map_with_xml_name_map()
  142         -
    }
  143         -
}