Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

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

@@ -1,1 +334,538 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServiceErrorGenerator.kt:252 */
    2      3   
/// All possible error types for this service.
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::fmt::Debug)]
    5         -
pub enum Error {
           8  +
pub /* ServiceErrorGenerator.kt:257 */ enum Error {
           9  +
    /* ServiceErrorGenerator.kt:259 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
          11  +
    /* ServiceErrorGenerator.kt:262 */
    7     12   
    CaseInsensitiveError(crate::types::error::CaseInsensitiveError),
          13  +
    /* ServiceErrorGenerator.kt:259 */
    8     14   
    #[allow(missing_docs)] // documentation missing in model
          15  +
    /* ServiceErrorGenerator.kt:262 */
    9     16   
    ExtraError(crate::types::error::ExtraError),
   10         -
    /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
          17  +
    /// /* ServiceErrorGenerator.kt:259 */A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
          18  +
    /* ServiceErrorGenerator.kt:262 */
   11     19   
    ValidationError(crate::types::error::ValidationError),
   12         -
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
          20  +
    /// /* ServiceErrorGenerator.kt:264 */An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
          21  +
    /* ServiceErrorGenerator.kt:320 */
   13     22   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
   14     23   
    variable wildcard pattern and check `.code()`:
   15     24   
     \
   16     25   
       `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
   17     26   
     \
   18     27   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")]
   19         -
    Unhandled(crate::error::sealed_unhandled::Unhandled),
          28  +
    /* ServiceErrorGenerator.kt:266 */
          29  +
    Unhandled(crate::error::sealed_unhandled::Unhandled), /* ServiceErrorGenerator.kt:257 */
   20     30   
}
          31  +
/* ServiceErrorGenerator.kt:131 */
   21     32   
impl ::std::fmt::Display for Error {
          33  +
    /* ServiceErrorGenerator.kt:132 */
   22     34   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
          35  +
        /* ServiceErrorGenerator.kt:133 */
   23     36   
        match self {
   24         -
            Error::CaseInsensitiveError(inner) => inner.fmt(f),
   25         -
            Error::ExtraError(inner) => inner.fmt(f),
   26         -
            Error::ValidationError(inner) => inner.fmt(f),
          37  +
            /* ServiceErrorGenerator.kt:135 */ Error::CaseInsensitiveError(inner) => inner.fmt(f),
          38  +
            /* ServiceErrorGenerator.kt:135 */ Error::ExtraError(inner) => inner.fmt(f),
          39  +
            /* ServiceErrorGenerator.kt:135 */ Error::ValidationError(inner) => inner.fmt(f),
          40  +
            /* ServiceErrorGenerator.kt:137 */
   27     41   
            Error::Unhandled(_) => {
   28     42   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
   29     43   
                    write!(f, "unhandled error ({code})")
   30     44   
                } else {
   31     45   
                    f.write_str("unhandled error")
   32     46   
                }
   33         -
            }
          47  +
            } /* ServiceErrorGenerator.kt:133 */
   34     48   
        }
          49  +
        /* ServiceErrorGenerator.kt:132 */
   35     50   
    }
          51  +
    /* ServiceErrorGenerator.kt:131 */
   36     52   
}
          53  +
/* ServiceErrorGenerator.kt:154 */
   37     54   
impl From<::aws_smithy_types::error::operation::BuildError> for Error {
   38     55   
    fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
   39     56   
        Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
   40     57   
            source: value.into(),
   41     58   
            meta: ::std::default::Default::default(),
   42     59   
        })
   43     60   
    }
   44     61   
}
          62  +
/* ServiceErrorGenerator.kt:223 */
   45     63   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
   46     64   
    fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
   47     65   
        match self {
   48     66   
            Self::CaseInsensitiveError(inner) => inner.meta(),
   49     67   
            Self::ExtraError(inner) => inner.meta(),
   50     68   
            Self::ValidationError(inner) => inner.meta(),
   51     69   
            Self::Unhandled(inner) => &inner.meta,
   52     70   
        }
   53     71   
    }
   54     72   
}
          73  +
/* ServiceErrorGenerator.kt:174 */
   55     74   
impl<R>
   56     75   
    From<
   57     76   
        ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError, R>,
   58     77   
    > for Error
   59     78   
where
   60     79   
    R: Send + Sync + std::fmt::Debug + 'static,
   61     80   
{
          81  +
    /* ServiceErrorGenerator.kt:179 */
   62     82   
    fn from(
   63     83   
        err: ::aws_smithy_runtime_api::client::result::SdkError<
   64     84   
            crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError,
   65     85   
            R,
   66     86   
        >,
   67     87   
    ) -> Self {
          88  +
        /* ServiceErrorGenerator.kt:184 */
   68     89   
        match err {
          90  +
            /* ServiceErrorGenerator.kt:185 */
   69     91   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
          92  +
            /* ServiceErrorGenerator.kt:186 */
   70     93   
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
   71     94   
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
   72     95   
                source: err.into(),
   73     96   
            }),
          97  +
            /* ServiceErrorGenerator.kt:184 */
   74     98   
        }
          99  +
        /* ServiceErrorGenerator.kt:179 */
   75    100   
    }
         101  +
    /* ServiceErrorGenerator.kt:174 */
   76    102   
}
         103  +
/* ServiceErrorGenerator.kt:202 */
   77    104   
impl From<crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError> for Error {
         105  +
    /* ServiceErrorGenerator.kt:203 */
   78    106   
    fn from(err: crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError) -> Self {
         107  +
        /* ServiceErrorGenerator.kt:204 */
   79    108   
        match err {
         109  +
            /* ServiceErrorGenerator.kt:207 */
   80    110   
            crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError::CaseInsensitiveError(inner) => {
   81    111   
                Error::CaseInsensitiveError(inner)
   82    112   
            }
         113  +
            /* ServiceErrorGenerator.kt:207 */
   83    114   
            crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError::ExtraError(inner) => Error::ExtraError(inner),
         115  +
            /* ServiceErrorGenerator.kt:212 */
   84    116   
            crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError::Unhandled(inner) => Error::Unhandled(inner),
         117  +
            /* ServiceErrorGenerator.kt:204 */
   85    118   
        }
         119  +
        /* ServiceErrorGenerator.kt:203 */
   86    120   
    }
         121  +
    /* ServiceErrorGenerator.kt:202 */
   87    122   
}
         123  +
/* ServiceErrorGenerator.kt:174 */
   88    124   
impl<R>
   89    125   
    From<
   90    126   
        ::aws_smithy_runtime_api::client::result::SdkError<
   91    127   
            crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError,
   92    128   
            R,
   93    129   
        >,
   94    130   
    > for Error
   95    131   
where
   96    132   
    R: Send + Sync + std::fmt::Debug + 'static,
   97    133   
{
         134  +
    /* ServiceErrorGenerator.kt:179 */
   98    135   
    fn from(
   99    136   
        err: ::aws_smithy_runtime_api::client::result::SdkError<
  100    137   
            crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError,
  101    138   
            R,
  102    139   
        >,
  103    140   
    ) -> Self {
         141  +
        /* ServiceErrorGenerator.kt:184 */
  104    142   
        match err {
         143  +
            /* ServiceErrorGenerator.kt:185 */
  105    144   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
         145  +
            /* ServiceErrorGenerator.kt:186 */
  106    146   
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
  107    147   
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
  108    148   
                source: err.into(),
  109    149   
            }),
         150  +
            /* ServiceErrorGenerator.kt:184 */
  110    151   
        }
         152  +
        /* ServiceErrorGenerator.kt:179 */
  111    153   
    }
         154  +
    /* ServiceErrorGenerator.kt:174 */
  112    155   
}
         156  +
/* ServiceErrorGenerator.kt:202 */
  113    157   
impl From<crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError> for Error {
         158  +
    /* ServiceErrorGenerator.kt:203 */
  114    159   
    fn from(err: crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError) -> Self {
         160  +
        /* ServiceErrorGenerator.kt:204 */
  115    161   
        match err {
         162  +
            /* ServiceErrorGenerator.kt:207 */
  116    163   
            crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError::ExtraError(inner) => {
  117    164   
                Error::ExtraError(inner)
  118    165   
            }
         166  +
            /* ServiceErrorGenerator.kt:212 */
  119    167   
            crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError::Unhandled(inner) => Error::Unhandled(inner),
         168  +
            /* ServiceErrorGenerator.kt:204 */
  120    169   
        }
         170  +
        /* ServiceErrorGenerator.kt:203 */
  121    171   
    }
         172  +
    /* ServiceErrorGenerator.kt:202 */
  122    173   
}
         174  +
/* ServiceErrorGenerator.kt:174 */
  123    175   
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::enum_query::EnumQueryError, R>> for Error
  124    176   
where
  125    177   
    R: Send + Sync + std::fmt::Debug + 'static,
  126    178   
{
         179  +
    /* ServiceErrorGenerator.kt:179 */
  127    180   
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::enum_query::EnumQueryError, R>) -> Self {
         181  +
        /* ServiceErrorGenerator.kt:184 */
  128    182   
        match err {
         183  +
            /* ServiceErrorGenerator.kt:185 */
  129    184   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
         185  +
            /* ServiceErrorGenerator.kt:186 */
  130    186   
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
  131    187   
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
  132    188   
                source: err.into(),
  133    189   
            }),
         190  +
            /* ServiceErrorGenerator.kt:184 */
  134    191   
        }
         192  +
        /* ServiceErrorGenerator.kt:179 */
  135    193   
    }
         194  +
    /* ServiceErrorGenerator.kt:174 */
  136    195   
}
         196  +
/* ServiceErrorGenerator.kt:202 */
  137    197   
impl From<crate::operation::enum_query::EnumQueryError> for Error {
         198  +
    /* ServiceErrorGenerator.kt:203 */
  138    199   
    fn from(err: crate::operation::enum_query::EnumQueryError) -> Self {
         200  +
        /* ServiceErrorGenerator.kt:204 */
  139    201   
        match err {
         202  +
            /* ServiceErrorGenerator.kt:207 */
  140    203   
            crate::operation::enum_query::EnumQueryError::ValidationError(inner) => Error::ValidationError(inner),
  141         -
            crate::operation::enum_query::EnumQueryError::ExtraError(inner) => Error::ExtraError(inner),
         204  +
            /* ServiceErrorGenerator.kt:207 */ crate::operation::enum_query::EnumQueryError::ExtraError(inner) => Error::ExtraError(inner),
         205  +
            /* ServiceErrorGenerator.kt:212 */
  142    206   
            crate::operation::enum_query::EnumQueryError::Unhandled(inner) => Error::Unhandled(inner),
         207  +
            /* ServiceErrorGenerator.kt:204 */
  143    208   
        }
         209  +
        /* ServiceErrorGenerator.kt:203 */
  144    210   
    }
         211  +
    /* ServiceErrorGenerator.kt:202 */
  145    212   
}
         213  +
/* ServiceErrorGenerator.kt:174 */
  146    214   
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::escaped_string_values::EscapedStringValuesError, R>> for Error
  147    215   
where
  148    216   
    R: Send + Sync + std::fmt::Debug + 'static,
  149    217   
{
         218  +
    /* ServiceErrorGenerator.kt:179 */
  150    219   
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::escaped_string_values::EscapedStringValuesError, R>) -> Self {
         220  +
        /* ServiceErrorGenerator.kt:184 */
  151    221   
        match err {
         222  +
            /* ServiceErrorGenerator.kt:185 */
  152    223   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
         224  +
            /* ServiceErrorGenerator.kt:186 */
  153    225   
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
  154    226   
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
  155    227   
                source: err.into(),
  156    228   
            }),
         229  +
            /* ServiceErrorGenerator.kt:184 */
  157    230   
        }
         231  +
        /* ServiceErrorGenerator.kt:179 */
  158    232   
    }
         233  +
    /* ServiceErrorGenerator.kt:174 */
  159    234   
}
         235  +
/* ServiceErrorGenerator.kt:202 */
  160    236   
impl From<crate::operation::escaped_string_values::EscapedStringValuesError> for Error {
         237  +
    /* ServiceErrorGenerator.kt:203 */
  161    238   
    fn from(err: crate::operation::escaped_string_values::EscapedStringValuesError) -> Self {
         239  +
        /* ServiceErrorGenerator.kt:204 */
  162    240   
        match err {
         241  +
            /* ServiceErrorGenerator.kt:207 */
  163    242   
            crate::operation::escaped_string_values::EscapedStringValuesError::ValidationError(inner) => Error::ValidationError(inner),
         243  +
            /* ServiceErrorGenerator.kt:207 */
  164    244   
            crate::operation::escaped_string_values::EscapedStringValuesError::ExtraError(inner) => Error::ExtraError(inner),
         245  +
            /* ServiceErrorGenerator.kt:212 */
  165    246   
            crate::operation::escaped_string_values::EscapedStringValuesError::Unhandled(inner) => Error::Unhandled(inner),
         247  +
            /* ServiceErrorGenerator.kt:204 */
  166    248   
        }
         249  +
        /* ServiceErrorGenerator.kt:203 */
  167    250   
    }
         251  +
    /* ServiceErrorGenerator.kt:202 */
  168    252   
}
         253  +
/* ServiceErrorGenerator.kt:174 */
  169    254   
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError, R>> for Error
  170    255   
where
  171    256   
    R: Send + Sync + std::fmt::Debug + 'static,
  172    257   
{
         258  +
    /* ServiceErrorGenerator.kt:179 */
  173    259   
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError, R>) -> Self {
         260  +
        /* ServiceErrorGenerator.kt:184 */
  174    261   
        match err {
         262  +
            /* ServiceErrorGenerator.kt:185 */
  175    263   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
         264  +
            /* ServiceErrorGenerator.kt:186 */
  176    265   
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
  177    266   
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
  178    267   
                source: err.into(),
  179    268   
            }),
         269  +
            /* ServiceErrorGenerator.kt:184 */
  180    270   
        }
         271  +
        /* ServiceErrorGenerator.kt:179 */
  181    272   
    }
         273  +
    /* ServiceErrorGenerator.kt:174 */
  182    274   
}
         275  +
/* ServiceErrorGenerator.kt:202 */
  183    276   
impl From<crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError> for Error {
         277  +
    /* ServiceErrorGenerator.kt:203 */
  184    278   
    fn from(err: crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError) -> Self {
         279  +
        /* ServiceErrorGenerator.kt:204 */
  185    280   
        match err {
         281  +
            /* ServiceErrorGenerator.kt:207 */
  186    282   
            crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError::ValidationError(inner) => Error::ValidationError(inner),
         283  +
            /* ServiceErrorGenerator.kt:207 */
  187    284   
            crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError::ExtraError(inner) => Error::ExtraError(inner),
         285  +
            /* ServiceErrorGenerator.kt:212 */
  188    286   
            crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError::Unhandled(inner) => Error::Unhandled(inner),
         287  +
            /* ServiceErrorGenerator.kt:204 */
  189    288   
        }
         289  +
        /* ServiceErrorGenerator.kt:203 */
  190    290   
    }
         291  +
    /* ServiceErrorGenerator.kt:202 */
  191    292   
}
         293  +
/* ServiceErrorGenerator.kt:174 */
  192    294   
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::null_in_non_sparse::NullInNonSparseError, R>> for Error
  193    295   
where
  194    296   
    R: Send + Sync + std::fmt::Debug + 'static,
  195    297   
{
         298  +
    /* ServiceErrorGenerator.kt:179 */
  196    299   
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::null_in_non_sparse::NullInNonSparseError, R>) -> Self {
         300  +
        /* ServiceErrorGenerator.kt:184 */
  197    301   
        match err {
         302  +
            /* ServiceErrorGenerator.kt:185 */
  198    303   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
         304  +
            /* ServiceErrorGenerator.kt:186 */
  199    305   
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
  200    306   
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
  201    307   
                source: err.into(),
  202    308   
            }),
         309  +
            /* ServiceErrorGenerator.kt:184 */
  203    310   
        }
         311  +
        /* ServiceErrorGenerator.kt:179 */
  204    312   
    }
         313  +
    /* ServiceErrorGenerator.kt:174 */
  205    314   
}
         315  +
/* ServiceErrorGenerator.kt:202 */
  206    316   
impl From<crate::operation::null_in_non_sparse::NullInNonSparseError> for Error {
         317  +
    /* ServiceErrorGenerator.kt:203 */
  207    318   
    fn from(err: crate::operation::null_in_non_sparse::NullInNonSparseError) -> Self {
         319  +
        /* ServiceErrorGenerator.kt:204 */
  208    320   
        match err {
         321  +
            /* ServiceErrorGenerator.kt:207 */
  209    322   
            crate::operation::null_in_non_sparse::NullInNonSparseError::ExtraError(inner) => Error::ExtraError(inner),
         323  +
            /* ServiceErrorGenerator.kt:212 */
  210    324   
            crate::operation::null_in_non_sparse::NullInNonSparseError::Unhandled(inner) => Error::Unhandled(inner),
         325  +
            /* ServiceErrorGenerator.kt:204 */
  211    326   
        }
         327  +
        /* ServiceErrorGenerator.kt:203 */
  212    328   
    }
         329  +
    /* ServiceErrorGenerator.kt:202 */
  213    330   
}
         331  +
/* ServiceErrorGenerator.kt:174 */
  214    332   
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::primitive_int_header::PrimitiveIntHeaderError, R>> for Error
  215    333   
where
  216    334   
    R: Send + Sync + std::fmt::Debug + 'static,
  217    335   
{
         336  +
    /* ServiceErrorGenerator.kt:179 */
  218    337   
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::primitive_int_header::PrimitiveIntHeaderError, R>) -> Self {
         338  +
        /* ServiceErrorGenerator.kt:184 */
  219    339   
        match err {
         340  +
            /* ServiceErrorGenerator.kt:185 */
  220    341   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
         342  +
            /* ServiceErrorGenerator.kt:186 */
  221    343   
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
  222    344   
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
  223    345   
                source: err.into(),
  224    346   
            }),
         347  +
            /* ServiceErrorGenerator.kt:184 */
  225    348   
        }
         349  +
        /* ServiceErrorGenerator.kt:179 */
  226    350   
    }
         351  +
    /* ServiceErrorGenerator.kt:174 */
  227    352   
}
         353  +
/* ServiceErrorGenerator.kt:202 */
  228    354   
impl From<crate::operation::primitive_int_header::PrimitiveIntHeaderError> for Error {
         355  +
    /* ServiceErrorGenerator.kt:203 */
  229    356   
    fn from(err: crate::operation::primitive_int_header::PrimitiveIntHeaderError) -> Self {
         357  +
        /* ServiceErrorGenerator.kt:204 */
  230    358   
        match err {
         359  +
            /* ServiceErrorGenerator.kt:207 */
  231    360   
            crate::operation::primitive_int_header::PrimitiveIntHeaderError::ValidationError(inner) => Error::ValidationError(inner),
         361  +
            /* ServiceErrorGenerator.kt:207 */
  232    362   
            crate::operation::primitive_int_header::PrimitiveIntHeaderError::ExtraError(inner) => Error::ExtraError(inner),
         363  +
            /* ServiceErrorGenerator.kt:212 */
  233    364   
            crate::operation::primitive_int_header::PrimitiveIntHeaderError::Unhandled(inner) => Error::Unhandled(inner),
         365  +
            /* ServiceErrorGenerator.kt:204 */
  234    366   
        }
         367  +
        /* ServiceErrorGenerator.kt:203 */
  235    368   
    }
         369  +
    /* ServiceErrorGenerator.kt:202 */
  236    370   
}
         371  +
/* ServiceErrorGenerator.kt:174 */
  237    372   
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::primitive_int_op::PrimitiveIntOpError, R>> for Error
  238    373   
where
  239    374   
    R: Send + Sync + std::fmt::Debug + 'static,
  240    375   
{
         376  +
    /* ServiceErrorGenerator.kt:179 */
  241    377   
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::primitive_int_op::PrimitiveIntOpError, R>) -> Self {
         378  +
        /* ServiceErrorGenerator.kt:184 */
  242    379   
        match err {
         380  +
            /* ServiceErrorGenerator.kt:185 */
  243    381   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
         382  +
            /* ServiceErrorGenerator.kt:186 */
  244    383   
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
  245    384   
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
  246    385   
                source: err.into(),
  247    386   
            }),
         387  +
            /* ServiceErrorGenerator.kt:184 */
  248    388   
        }
         389  +
        /* ServiceErrorGenerator.kt:179 */
  249    390   
    }
         391  +
    /* ServiceErrorGenerator.kt:174 */
  250    392   
}
         393  +
/* ServiceErrorGenerator.kt:202 */
  251    394   
impl From<crate::operation::primitive_int_op::PrimitiveIntOpError> for Error {
         395  +
    /* ServiceErrorGenerator.kt:203 */
  252    396   
    fn from(err: crate::operation::primitive_int_op::PrimitiveIntOpError) -> Self {
         397  +
        /* ServiceErrorGenerator.kt:204 */
  253    398   
        match err {
         399  +
            /* ServiceErrorGenerator.kt:207 */
  254    400   
            crate::operation::primitive_int_op::PrimitiveIntOpError::ExtraError(inner) => Error::ExtraError(inner),
         401  +
            /* ServiceErrorGenerator.kt:212 */
  255    402   
            crate::operation::primitive_int_op::PrimitiveIntOpError::Unhandled(inner) => Error::Unhandled(inner),
         403  +
            /* ServiceErrorGenerator.kt:204 */
  256    404   
        }
         405  +
        /* ServiceErrorGenerator.kt:203 */
  257    406   
    }
         407  +
    /* ServiceErrorGenerator.kt:202 */
  258    408   
}
         409  +
/* ServiceErrorGenerator.kt:174 */
  259    410   
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::query_precedence::QueryPrecedenceError, R>> for Error
  260    411   
where
  261    412   
    R: Send + Sync + std::fmt::Debug + 'static,
  262    413   
{
         414  +
    /* ServiceErrorGenerator.kt:179 */
  263    415   
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::query_precedence::QueryPrecedenceError, R>) -> Self {
         416  +
        /* ServiceErrorGenerator.kt:184 */
  264    417   
        match err {
         418  +
            /* ServiceErrorGenerator.kt:185 */
  265    419   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
         420  +
            /* ServiceErrorGenerator.kt:186 */
  266    421   
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
  267    422   
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
  268    423   
                source: err.into(),
  269    424   
            }),
         425  +
            /* ServiceErrorGenerator.kt:184 */
  270    426   
        }
         427  +
        /* ServiceErrorGenerator.kt:179 */
  271    428   
    }
         429  +
    /* ServiceErrorGenerator.kt:174 */
  272    430   
}
         431  +
/* ServiceErrorGenerator.kt:202 */
  273    432   
impl From<crate::operation::query_precedence::QueryPrecedenceError> for Error {
         433  +
    /* ServiceErrorGenerator.kt:203 */
  274    434   
    fn from(err: crate::operation::query_precedence::QueryPrecedenceError) -> Self {
         435  +
        /* ServiceErrorGenerator.kt:204 */
  275    436   
        match err {
         437  +
            /* ServiceErrorGenerator.kt:207 */
  276    438   
            crate::operation::query_precedence::QueryPrecedenceError::ExtraError(inner) => Error::ExtraError(inner),
         439  +
            /* ServiceErrorGenerator.kt:212 */
  277    440   
            crate::operation::query_precedence::QueryPrecedenceError::Unhandled(inner) => Error::Unhandled(inner),
         441  +
            /* ServiceErrorGenerator.kt:204 */
  278    442   
        }
         443  +
        /* ServiceErrorGenerator.kt:203 */
  279    444   
    }
         445  +
    /* ServiceErrorGenerator.kt:202 */
  280    446   
}
         447  +
/* ServiceErrorGenerator.kt:174 */
  281    448   
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::status_response::StatusResponseError, R>> for Error
  282    449   
where
  283    450   
    R: Send + Sync + std::fmt::Debug + 'static,
  284    451   
{
         452  +
    /* ServiceErrorGenerator.kt:179 */
  285    453   
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::status_response::StatusResponseError, R>) -> Self {
         454  +
        /* ServiceErrorGenerator.kt:184 */
  286    455   
        match err {
         456  +
            /* ServiceErrorGenerator.kt:185 */
  287    457   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
         458  +
            /* ServiceErrorGenerator.kt:186 */
  288    459   
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
  289    460   
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
  290    461   
                source: err.into(),
  291    462   
            }),
         463  +
            /* ServiceErrorGenerator.kt:184 */
  292    464   
        }
         465  +
        /* ServiceErrorGenerator.kt:179 */
  293    466   
    }
         467  +
    /* ServiceErrorGenerator.kt:174 */
  294    468   
}
         469  +
/* ServiceErrorGenerator.kt:202 */
  295    470   
impl From<crate::operation::status_response::StatusResponseError> for Error {
         471  +
    /* ServiceErrorGenerator.kt:203 */
  296    472   
    fn from(err: crate::operation::status_response::StatusResponseError) -> Self {
         473  +
        /* ServiceErrorGenerator.kt:204 */
  297    474   
        match err {
         475  +
            /* ServiceErrorGenerator.kt:207 */
  298    476   
            crate::operation::status_response::StatusResponseError::ExtraError(inner) => Error::ExtraError(inner),
         477  +
            /* ServiceErrorGenerator.kt:212 */
  299    478   
            crate::operation::status_response::StatusResponseError::Unhandled(inner) => Error::Unhandled(inner),
         479  +
            /* ServiceErrorGenerator.kt:204 */
  300    480   
        }
         481  +
        /* ServiceErrorGenerator.kt:203 */
  301    482   
    }
         483  +
    /* ServiceErrorGenerator.kt:202 */
  302    484   
}
         485  +
/* ServiceErrorGenerator.kt:174 */
  303    486   
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::string_payload::StringPayloadError, R>> for Error
  304    487   
where
  305    488   
    R: Send + Sync + std::fmt::Debug + 'static,
  306    489   
{
         490  +
    /* ServiceErrorGenerator.kt:179 */
  307    491   
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::string_payload::StringPayloadError, R>) -> Self {
         492  +
        /* ServiceErrorGenerator.kt:184 */
  308    493   
        match err {
         494  +
            /* ServiceErrorGenerator.kt:185 */
  309    495   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
         496  +
            /* ServiceErrorGenerator.kt:186 */
  310    497   
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
  311    498   
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
  312    499   
                source: err.into(),
  313    500   
            }),
         501  +
            /* ServiceErrorGenerator.kt:184 */
  314    502   
        }
         503  +
        /* ServiceErrorGenerator.kt:179 */
  315    504   
    }
         505  +
    /* ServiceErrorGenerator.kt:174 */
  316    506   
}
         507  +
/* ServiceErrorGenerator.kt:202 */
  317    508   
impl From<crate::operation::string_payload::StringPayloadError> for Error {
         509  +
    /* ServiceErrorGenerator.kt:203 */
  318    510   
    fn from(err: crate::operation::string_payload::StringPayloadError) -> Self {
         511  +
        /* ServiceErrorGenerator.kt:204 */
  319    512   
        match err {
         513  +
            /* ServiceErrorGenerator.kt:207 */
  320    514   
            crate::operation::string_payload::StringPayloadError::ExtraError(inner) => Error::ExtraError(inner),
         515  +
            /* ServiceErrorGenerator.kt:212 */
  321    516   
            crate::operation::string_payload::StringPayloadError::Unhandled(inner) => Error::Unhandled(inner),
         517  +
            /* ServiceErrorGenerator.kt:204 */
  322    518   
        }
         519  +
        /* ServiceErrorGenerator.kt:203 */
  323    520   
    }
         521  +
    /* ServiceErrorGenerator.kt:202 */
  324    522   
}
         523  +
/* ServiceErrorGenerator.kt:115 */
  325    524   
impl ::std::error::Error for Error {
         525  +
    /* ServiceErrorGenerator.kt:116 */
  326    526   
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
         527  +
        /* ServiceErrorGenerator.kt:117 */
  327    528   
        match self {
  328         -
            Error::CaseInsensitiveError(inner) => inner.source(),
  329         -
            Error::ExtraError(inner) => inner.source(),
  330         -
            Error::ValidationError(inner) => inner.source(),
  331         -
            Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
         529  +
            /* ServiceErrorGenerator.kt:119 */ Error::CaseInsensitiveError(inner) => inner.source(),
         530  +
            /* ServiceErrorGenerator.kt:119 */ Error::ExtraError(inner) => inner.source(),
         531  +
            /* ServiceErrorGenerator.kt:119 */ Error::ValidationError(inner) => inner.source(),
         532  +
            /* ServiceErrorGenerator.kt:121 */
         533  +
            Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source), /* ServiceErrorGenerator.kt:117 */
  332    534   
        }
         535  +
        /* ServiceErrorGenerator.kt:116 */
  333    536   
    }
         537  +
    /* ServiceErrorGenerator.kt:115 */
  334    538   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/lib.rs

@@ -18,18 +132,142 @@
   38     38   
//! The [`operation`](crate::operation) module has a submodule for every API, and in each submodule
   39     39   
//! is the input, output, and error type for that API, as well as builders to construct each of those.
   40     40   
//!
   41     41   
//! There is a top-level [`Error`](crate::Error) type that encompasses all the errors that the
   42     42   
//! client can return. Any other error type can be converted to this `Error` type via the
   43     43   
//! [`From`](std::convert::From) trait.
   44     44   
//!
   45     45   
//! The other modules within this crate are not required for normal usage.
   46     46   
   47     47   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
          48  +
/* ServiceErrorGenerator.kt:127 */
   48     49   
pub use error_meta::Error;
   49     50   
          51  +
/* RustType.kt:516 */
   50     52   
#[doc(inline)]
          53  +
/* ServiceGenerator.kt:63 */
   51     54   
pub use config::Config;
   52     55   
   53         -
/// Client for calling the service.
          56  +
/// /* FluentClientDocs.kt:24 */Client for calling the service.
   54     57   
///
   55     58   
/// ## Constructing a `Client`
   56     59   
///
   57     60   
/// A `Client` requires a config in order to be constructed. With the default set of Cargo features,
   58     61   
/// this config will only require an endpoint to produce a functioning client. However, some Smithy
   59     62   
/// features will require additional configuration. For example, `@auth` requires some kind of identity
   60     63   
/// or identity resolver to be configured. The config is used to customize various aspects of the client,
   61     64   
/// such as:
   62     65   
///
   63     66   
///   - [The underlying HTTP client](crate::config::Builder::http_client)
   64     67   
///   - [Retries](crate::config::Builder::retry_config)
   65     68   
///   - [Timeouts](crate::config::Builder::timeout_config)
   66     69   
///   - [... and more](crate::config::Builder)
   67     70   
///
   68     71   
/// Below is a minimal example of how to create a client:
   69     72   
///
   70     73   
/// ```rust,no_run
   71     74   
/// let config = rest_json_extras::Config::builder()
   72     75   
///     .endpoint_url("http://localhost:1234")
   73     76   
///     .build();
   74     77   
/// let client = rest_json_extras::Client::from_conf(config);
   75     78   
/// ```
   76     79   
///
   77     80   
/// _Note:_ Client construction is expensive due to connection thread pool initialization, and should be done
   78     81   
/// once at application start-up. Cloning a client is cheap (it's just an [`Arc`](std::sync::Arc) under the hood),
   79     82   
/// so creating it once at start-up and cloning it around the application as needed is recommended.
   80         -
/// # Using the `Client`
          83  +
/// /* FluentClientDocs.kt:79 */# Using the `Client`
   81     84   
///
   82     85   
/// A client has a function for every operation that can be performed by the service.
   83     86   
/// For example, the [`EnumQuery`](crate::operation::enum_query) operation has
   84     87   
/// a [`Client::enum_query`], function which returns a builder for that operation.
   85     88   
/// The fluent builder ultimately has a `send()` function that returns an async future that
   86     89   
/// returns a result, as illustrated below:
   87     90   
///
   88     91   
/// ```rust,ignore
   89     92   
/// let result = client.enum_query()
   90     93   
///     .r#enum("example")
   91     94   
///     .send()
   92     95   
///     .await;
   93     96   
/// ```
   94     97   
///
   95     98   
/// The underlying HTTP requests that get made by this can be modified with the `customize_operation`
   96     99   
/// function on the fluent builder. See the [`customize`](crate::client::customize) module for more
   97    100   
/// information.
   98    101   
pub mod client;
   99    102   
  100         -
/// Configuration for the service.
         103  +
/// /* ClientRustModule.kt:121 */Configuration for the service.
  101    104   
pub mod config;
  102    105   
  103         -
/// Common errors and error handling utilities.
         106  +
/// /* ClientRustModule.kt:121 */Common errors and error handling utilities.
  104    107   
pub mod error;
  105    108   
         109  +
/* RustModule.kt:172 */
  106    110   
mod error_meta;
  107    111   
  108         -
/// Information about this crate.
         112  +
/// /* ClientRustModule.kt:121 */Information about this crate.
  109    113   
pub mod meta;
  110    114   
  111         -
/// Primitives such as `Blob` or `DateTime` used by other types.
         115  +
/// /* ClientRustModule.kt:121 */Primitives such as `Blob` or `DateTime` used by other types.
  112    116   
pub mod primitives;
  113    117   
  114         -
/// Data structures used by operation inputs/outputs.
         118  +
/// /* ClientRustModule.kt:121 */Data structures used by operation inputs/outputs.
  115    119   
pub mod types;
  116    120   
         121  +
/* RustModule.kt:172 */
  117    122   
mod auth_plugin;
  118    123   
  119         -
/// All operations that this crate can perform.
         124  +
/// /* ClientRustModule.kt:121 */All operations that this crate can perform.
  120    125   
pub mod operation;
  121    126   
  122    127   
pub(crate) mod protocol_serde;
  123    128   
         129  +
/* RustModule.kt:172 */
  124    130   
mod sdk_feature_tracker;
  125    131   
         132  +
/* RustModule.kt:172 */
  126    133   
mod serialization_settings;
  127    134   
         135  +
/* RustModule.kt:172 */
  128    136   
mod serde_util;
  129    137   
         138  +
/* RustModule.kt:172 */
  130    139   
mod json_errors;
  131    140   
         141  +
/* FluentClientDecorator.kt:76 */
  132    142   
pub use client::Client;

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/meta.rs

@@ -1,1 +4,5 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
           3  +
/* CrateVersionCustomization.kt:23 */
    3      4   
/// Crate version number.
    4      5   
pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION");

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

@@ -1,1 +34,34 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// Types for the `CaseInsensitiveErrorOperation` operation.
           2  +
/* CodegenDelegator.kt:51 */
           3  +
/// /* CodegenDelegator.kt:51 */Types for the `CaseInsensitiveErrorOperation` operation.
    4      4   
pub mod case_insensitive_error_operation;
    5      5   
    6         -
/// Types for the `EmptyStructWithContentOnWireOp` operation.
           6  +
/// /* CodegenDelegator.kt:51 */Types for the `EmptyStructWithContentOnWireOp` operation.
    7      7   
pub mod empty_struct_with_content_on_wire_op;
    8      8   
    9         -
/// Types for the `EnumQuery` operation.
           9  +
/// /* CodegenDelegator.kt:51 */Types for the `EnumQuery` operation.
   10     10   
pub mod enum_query;
   11     11   
   12         -
/// Types for the `EscapedStringValues` operation.
          12  +
/// /* CodegenDelegator.kt:51 */Types for the `EscapedStringValues` operation.
   13     13   
pub mod escaped_string_values;
   14     14   
   15         -
/// Types for the `MapWithEnumKeyOp` operation.
          15  +
/// /* CodegenDelegator.kt:51 */Types for the `MapWithEnumKeyOp` operation.
   16     16   
pub mod map_with_enum_key_op;
   17     17   
   18         -
/// Types for the `NullInNonSparse` operation.
          18  +
/// /* CodegenDelegator.kt:51 */Types for the `NullInNonSparse` operation.
   19     19   
pub mod null_in_non_sparse;
   20     20   
   21         -
/// Types for the `PrimitiveIntHeader` operation.
          21  +
/// /* CodegenDelegator.kt:51 */Types for the `PrimitiveIntHeader` operation.
   22     22   
pub mod primitive_int_header;
   23     23   
   24         -
/// Types for the `PrimitiveIntOp` operation.
          24  +
/// /* CodegenDelegator.kt:51 */Types for the `PrimitiveIntOp` operation.
   25     25   
pub mod primitive_int_op;
   26     26   
   27         -
/// Types for the `QueryPrecedence` operation.
          27  +
/// /* CodegenDelegator.kt:51 */Types for the `QueryPrecedence` operation.
   28     28   
pub mod query_precedence;
   29     29   
   30         -
/// Types for the `StatusResponse` operation.
          30  +
/// /* CodegenDelegator.kt:51 */Types for the `StatusResponse` operation.
   31     31   
pub mod status_response;
   32     32   
   33         -
/// Types for the `StringPayload` operation.
          33  +
/// /* CodegenDelegator.kt:51 */Types for the `StringPayload` operation.
   34     34   
pub mod string_payload;

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

@@ -1,1 +40,49 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* OperationGenerator.kt:77 */
    2      3   
/// Orchestration and serialization glue logic for `CaseInsensitiveErrorOperation`.
           4  +
/* RustType.kt:516 */
    3      5   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
           6  +
/* RustType.kt:516 */
    4      7   
#[non_exhaustive]
           8  +
/* OperationGenerator.kt:84 */
    5      9   
pub struct CaseInsensitiveErrorOperation;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl CaseInsensitiveErrorOperation {
    7         -
    /// Creates a new `CaseInsensitiveErrorOperation`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `CaseInsensitiveErrorOperation`
          13  +
    /* OperationGenerator.kt:87 */
    8     14   
    pub fn new() -> Self {
          15  +
        /* OperationGenerator.kt:88 */
    9     16   
        Self
          17  +
        /* OperationGenerator.kt:87 */
   10     18   
    }
          19  +
    /* OperationGenerator.kt:138 */
   11     20   
    pub(crate) async fn orchestrate(
   12     21   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     22   
        input: crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +265,282 @@
   83     92   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   84     93   
            }
   85     94   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   86     95   
                config_override,
   87     96   
                client_config.config.clone(),
   88     97   
                &client_config.runtime_components,
   89     98   
            ));
   90     99   
        }
   91    100   
        runtime_plugins
   92    101   
    }
         102  +
    /* OperationGenerator.kt:85 */
   93    103   
}
         104  +
/* OperationRuntimePluginGenerator.kt:55 */
   94    105   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CaseInsensitiveErrorOperation {
   95    106   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
   96    107   
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("CaseInsensitiveErrorOperation");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            CaseInsensitiveErrorOperationRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            CaseInsensitiveErrorOperationResponseDeserializer,
  103    114   
        ));
  104    115   
  105    116   
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
  106    117   
            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
  107    118   
        ));
  108    119   
  109    120   
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
  110    121   
            "CaseInsensitiveErrorOperation",
  111    122   
            "Rest Json Protocol",
  112    123   
        ));
  113    124   
  114    125   
        ::std::option::Option::Some(cfg.freeze())
  115    126   
    }
  116    127   
  117    128   
    fn runtime_components(
  118    129   
        &self,
  119    130   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  120    131   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  121    132   
        #[allow(unused_mut)]
  122    133   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CaseInsensitiveErrorOperation")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(CaseInsensitiveErrorOperationEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError,
  130    141   
            >::new());
  131    142   
  132    143   
        ::std::borrow::Cow::Owned(rcb)
  133    144   
    }
  134    145   
}
  135    146   
         147  +
/* ResponseDeserializerGenerator.kt:64 */
  136    148   
#[derive(Debug)]
  137    149   
struct CaseInsensitiveErrorOperationResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CaseInsensitiveErrorOperationResponseDeserializer {
  139    151   
    fn deserialize_nonstreaming(
  140    152   
        &self,
  141    153   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  142    154   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  143    155   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  144    156   
        let headers = response.headers();
  145    157   
        let body = response.body().bytes().expect("body loaded");
  146    158   
        #[allow(unused_mut)]
  147    159   
        let mut force_error = false;
  148    160   
  149    161   
        let parse_result = if !success && status != 200 || force_error {
  150    162   
            crate::protocol_serde::shape_case_insensitive_error_operation::de_case_insensitive_error_operation_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_case_insensitive_error_operation::de_case_insensitive_error_operation_http_response(status, headers, body)
  153    165   
        };
  154    166   
        crate::protocol_serde::type_erase_result(parse_result)
  155    167   
    }
  156    168   
}
         169  +
/* RequestSerializerGenerator.kt:67 */
  157    170   
#[derive(Debug)]
  158    171   
struct CaseInsensitiveErrorOperationRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CaseInsensitiveErrorOperationRequestSerializer {
  160    173   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  161    174   
    fn serialize_input(
  162    175   
        &self,
  163    176   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  164    177   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  165    178   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  166    179   
        let input = input
  167    180   
            .downcast::<crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationInput>()
  168    181   
            .expect("correct type");
  169    182   
        let _header_serialization_settings = _cfg
  170    183   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  171    184   
            .cloned()
  172    185   
            .unwrap_or_default();
  173    186   
        let mut request_builder = {
  174    187   
            fn uri_base(
  175    188   
                _input: &crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationInput,
  176    189   
                output: &mut ::std::string::String,
  177    190   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  178    191   
                use ::std::fmt::Write as _;
  179    192   
                ::std::write!(output, "/error-sensitive").expect("formatting should succeed");
  180    193   
                ::std::result::Result::Ok(())
  181    194   
            }
  182    195   
            #[allow(clippy::unnecessary_wraps)]
  183    196   
            fn update_http_builder(
  184    197   
                input: &crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationInput,
  185    198   
                builder: ::http::request::Builder,
  186    199   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  187    200   
                let mut uri = ::std::string::String::new();
  188    201   
                uri_base(input, &mut uri)?;
  189    202   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  190    203   
            }
  191    204   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  192    205   
            builder
  193    206   
        };
  194    207   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  195    208   
  196    209   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  197    210   
    }
  198    211   
}
         212  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  199    213   
#[derive(Debug)]
  200    214   
struct CaseInsensitiveErrorOperationEndpointParamsInterceptor;
  201    215   
  202    216   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CaseInsensitiveErrorOperationEndpointParamsInterceptor {
  203    217   
    fn name(&self) -> &'static str {
  204    218   
        "CaseInsensitiveErrorOperationEndpointParamsInterceptor"
  205    219   
    }
  206    220   
  207    221   
    fn read_before_execution(
  208    222   
        &self,
  209    223   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  210    224   
            '_,
  211    225   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  212    226   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  213    227   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  214    228   
        >,
  215    229   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  216    230   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  217    231   
        let _input = context
  218    232   
            .input()
  219    233   
            .downcast_ref::<CaseInsensitiveErrorOperationInput>()
  220    234   
            .ok_or("failed to downcast to CaseInsensitiveErrorOperationInput")?;
  221    235   
  222    236   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  223    237   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  224    238   
        })?;
  225    239   
        cfg.interceptor_state()
  226    240   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  227    241   
        ::std::result::Result::Ok(())
  228    242   
    }
  229    243   
}
  230    244   
  231    245   
// The get_* functions below are generated from JMESPath expressions in the
  232    246   
// operationContextParams trait. They target the operation's input shape.
  233    247   
         248  +
/* RustType.kt:516 */
  234    249   
#[allow(unreachable_code, unused_variables)]
         250  +
/* RustType.kt:516 */
  235    251   
#[cfg(test)]
         252  +
/* ProtocolTestGenerator.kt:98 */
  236    253   
mod case_insensitive_error_operation_test {
  237    254   
  238    255   
    /// Upper case error modeled lower case. See: https://github.com/smithy-lang/smithy-rs/blob/6c21fb0eb377c7120a8179f4537ba99a4b50ba96/rust-runtime/inlineable/src/json_errors.rs#L51-L51
  239    256   
    /// Test ID: UpperErrorModeledLower
  240    257   
    #[::tokio::test]
  241    258   
    #[::tracing_test::traced_test]
  242    259   
    async fn upper_error_modeled_lower_response() {
  243    260   
        let expected_output = crate::types::error::CaseInsensitiveError::builder()
  244    261   
            .set_message(::std::option::Option::Some("hello".to_owned()))
  245    262   
            .build();
@@ -295,312 +444,569 @@
  315    332   
        });
  316    333   
        let parsed = parsed.expect_err("should be error response");
  317    334   
        let parsed: &crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError =
  318    335   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  319    336   
        if let crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError::ExtraError(parsed) = parsed {
  320    337   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  321    338   
        } else {
  322    339   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  323    340   
        }
  324    341   
    }
         342  +
         343  +
    /* ProtocolTestGenerator.kt:98 */
  325    344   
}
  326    345   
         346  +
/* OperationErrorGenerator.kt:79 */
  327    347   
/// Error type for the `CaseInsensitiveErrorOperationError` operation.
         348  +
/* RustType.kt:516 */
  328    349   
#[non_exhaustive]
         350  +
/* RustType.kt:516 */
  329    351   
#[derive(::std::fmt::Debug)]
  330         -
pub enum CaseInsensitiveErrorOperationError {
         352  +
pub /* OperationErrorGenerator.kt:81 */ enum CaseInsensitiveErrorOperationError {
         353  +
    /* OperationErrorGenerator.kt:83 */
  331    354   
    #[allow(missing_docs)] // documentation missing in model
         355  +
    /* OperationErrorGenerator.kt:86 */
  332    356   
    CaseInsensitiveError(crate::types::error::CaseInsensitiveError),
         357  +
    /* OperationErrorGenerator.kt:83 */
  333    358   
    #[allow(missing_docs)] // documentation missing in model
         359  +
    /* OperationErrorGenerator.kt:86 */
  334    360   
    ExtraError(crate::types::error::ExtraError),
         361  +
    /* OperationErrorGenerator.kt:88 */
  335    362   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  336    363   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  337    364   
    variable wildcard pattern and check `.code()`:
  338    365   
     \
  339    366   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  340    367   
     \
  341    368   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CaseInsensitiveErrorOperationError) for what information is available for the error.")]
  342    369   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         370  +
    /* OperationErrorGenerator.kt:81 */
  343    371   
}
         372  +
/* OperationErrorGenerator.kt:218 */
  344    373   
impl CaseInsensitiveErrorOperationError {
         374  +
    /* OperationErrorGenerator.kt:219 */
  345    375   
    /// Creates the `CaseInsensitiveErrorOperationError::Unhandled` variant from any error type.
  346    376   
    pub fn unhandled(
  347    377   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  348    378   
    ) -> Self {
  349    379   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  350    380   
            source: err.into(),
  351    381   
            meta: ::std::default::Default::default(),
  352    382   
        })
  353    383   
    }
  354    384   
  355    385   
    /// Creates the `CaseInsensitiveErrorOperationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  356    386   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  357    387   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  358    388   
            source: err.clone().into(),
  359    389   
            meta: err,
  360    390   
        })
  361    391   
    }
  362         -
    ///
         392  +
    /// /* OperationErrorGenerator.kt:236 */
  363    393   
    /// Returns error metadata, which includes the error code, message,
  364    394   
    /// request ID, and potentially additional information.
  365    395   
    ///
         396  +
    /* OperationErrorGenerator.kt:242 */
  366    397   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         398  +
        /* OperationErrorGenerator.kt:243 */
  367    399   
        match self {
         400  +
            /* OperationErrorGenerator.kt:246 */
  368    401   
            Self::CaseInsensitiveError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  369         -
            Self::ExtraError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  370         -
            Self::Unhandled(e) => &e.meta,
         402  +
            /* OperationErrorGenerator.kt:246 */ Self::ExtraError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         403  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         404  +
            /* OperationErrorGenerator.kt:243 */
  371    405   
        }
         406  +
        /* OperationErrorGenerator.kt:242 */
  372    407   
    }
         408  +
    /* OperationErrorGenerator.kt:257 */
  373    409   
    /// Returns `true` if the error kind is `CaseInsensitiveErrorOperationError::CaseInsensitiveError`.
         410  +
    /* OperationErrorGenerator.kt:258 */
  374    411   
    pub fn is_case_insensitive_error(&self) -> bool {
         412  +
        /* OperationErrorGenerator.kt:259 */
  375    413   
        matches!(self, Self::CaseInsensitiveError(_))
         414  +
        /* OperationErrorGenerator.kt:258 */
  376    415   
    }
         416  +
    /* OperationErrorGenerator.kt:257 */
  377    417   
    /// Returns `true` if the error kind is `CaseInsensitiveErrorOperationError::ExtraError`.
         418  +
    /* OperationErrorGenerator.kt:258 */
  378    419   
    pub fn is_extra_error(&self) -> bool {
         420  +
        /* OperationErrorGenerator.kt:259 */
  379    421   
        matches!(self, Self::ExtraError(_))
         422  +
        /* OperationErrorGenerator.kt:258 */
  380    423   
    }
         424  +
    /* OperationErrorGenerator.kt:218 */
  381    425   
}
         426  +
/* OperationErrorGenerator.kt:269 */
  382    427   
impl ::std::error::Error for CaseInsensitiveErrorOperationError {
         428  +
    /* OperationErrorGenerator.kt:270 */
  383    429   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         430  +
        /* OperationErrorGenerator.kt:318 */
  384    431   
        match self {
  385         -
            Self::CaseInsensitiveError(_inner) => ::std::option::Option::Some(_inner),
  386         -
            Self::ExtraError(_inner) => ::std::option::Option::Some(_inner),
  387         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         432  +
            /* OperationErrorGenerator.kt:321 */
         433  +
            Self::CaseInsensitiveError(_inner) =>
         434  +
            /* OperationErrorGenerator.kt:283 */
         435  +
            {
         436  +
                ::std::option::Option::Some(_inner)
         437  +
            }
         438  +
            ,
         439  +
            /* OperationErrorGenerator.kt:321 */
         440  +
            Self::ExtraError(_inner) =>
         441  +
            /* OperationErrorGenerator.kt:283 */
         442  +
            {
         443  +
                ::std::option::Option::Some(_inner)
         444  +
            }
         445  +
            ,
         446  +
            /* OperationErrorGenerator.kt:326 */
         447  +
            Self::Unhandled(_inner) => {
         448  +
                /* OperationErrorGenerator.kt:279 */
         449  +
                ::std::option::Option::Some(&*_inner.source)
         450  +
                /* OperationErrorGenerator.kt:326 */
         451  +
            } /* OperationErrorGenerator.kt:318 */
  388    452   
        }
         453  +
        /* OperationErrorGenerator.kt:270 */
  389    454   
    }
         455  +
    /* OperationErrorGenerator.kt:269 */
  390    456   
}
         457  +
/* OperationErrorGenerator.kt:133 */
  391    458   
impl ::std::fmt::Display for CaseInsensitiveErrorOperationError {
         459  +
    /* OperationErrorGenerator.kt:134 */
  392    460   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         461  +
        /* OperationErrorGenerator.kt:318 */
  393    462   
        match self {
  394         -
            Self::CaseInsensitiveError(_inner) => _inner.fmt(f),
  395         -
            Self::ExtraError(_inner) => _inner.fmt(f),
         463  +
            /* OperationErrorGenerator.kt:321 */
         464  +
            Self::CaseInsensitiveError(_inner) =>
         465  +
            /* OperationErrorGenerator.kt:151 */
         466  +
            {
         467  +
                _inner.fmt(f)
         468  +
            }
         469  +
            ,
         470  +
            /* OperationErrorGenerator.kt:321 */
         471  +
            Self::ExtraError(_inner) =>
         472  +
            /* OperationErrorGenerator.kt:151 */
         473  +
            {
         474  +
                _inner.fmt(f)
         475  +
            }
         476  +
            ,
         477  +
            /* OperationErrorGenerator.kt:326 */
  396    478   
            Self::Unhandled(_inner) => {
         479  +
                /* OperationErrorGenerator.kt:139 */
  397    480   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  398    481   
                    write!(f, "unhandled error ({code})")
  399    482   
                } else {
  400    483   
                    f.write_str("unhandled error")
  401    484   
                }
  402         -
            }
         485  +
                /* OperationErrorGenerator.kt:326 */
         486  +
            } /* OperationErrorGenerator.kt:318 */
  403    487   
        }
         488  +
        /* OperationErrorGenerator.kt:134 */
  404    489   
    }
         490  +
    /* OperationErrorGenerator.kt:133 */
  405    491   
}
         492  +
/* OperationErrorGenerator.kt:182 */
  406    493   
impl ::aws_smithy_types::retry::ProvideErrorKind for CaseInsensitiveErrorOperationError {
         494  +
    /* OperationErrorGenerator.kt:186 */
  407    495   
    fn code(&self) -> ::std::option::Option<&str> {
         496  +
        /* OperationErrorGenerator.kt:187 */
  408    497   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         498  +
        /* OperationErrorGenerator.kt:186 */
  409    499   
    }
         500  +
    /* OperationErrorGenerator.kt:190 */
  410    501   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         502  +
        /* OperationErrorGenerator.kt:197 */
  411    503   
        ::std::option::Option::None
         504  +
        /* OperationErrorGenerator.kt:190 */
  412    505   
    }
         506  +
    /* OperationErrorGenerator.kt:182 */
  413    507   
}
         508  +
/* OperationErrorGenerator.kt:163 */
  414    509   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CaseInsensitiveErrorOperationError {
         510  +
    /* OperationErrorGenerator.kt:164 */
  415    511   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         512  +
        /* OperationErrorGenerator.kt:318 */
  416    513   
        match self {
  417         -
            Self::CaseInsensitiveError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  418         -
            Self::ExtraError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  419         -
            Self::Unhandled(_inner) => &_inner.meta,
         514  +
            /* OperationErrorGenerator.kt:321 */
         515  +
            Self::CaseInsensitiveError(_inner) =>
         516  +
            /* OperationErrorGenerator.kt:169 */
         517  +
            {
         518  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         519  +
            }
         520  +
            ,
         521  +
            /* OperationErrorGenerator.kt:321 */
         522  +
            Self::ExtraError(_inner) =>
         523  +
            /* OperationErrorGenerator.kt:169 */
         524  +
            {
         525  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         526  +
            }
         527  +
            ,
         528  +
            /* OperationErrorGenerator.kt:326 */
         529  +
            Self::Unhandled(_inner) => {
         530  +
                /* OperationErrorGenerator.kt:168 */
         531  +
                &_inner.meta
         532  +
                /* OperationErrorGenerator.kt:326 */
         533  +
            } /* OperationErrorGenerator.kt:318 */
  420    534   
        }
         535  +
        /* OperationErrorGenerator.kt:164 */
  421    536   
    }
         537  +
    /* OperationErrorGenerator.kt:163 */
  422    538   
}
         539  +
/* OperationErrorGenerator.kt:109 */
  423    540   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CaseInsensitiveErrorOperationError {
         541  +
    /* OperationErrorGenerator.kt:110 */
  424    542   
    fn create_unhandled_error(
  425    543   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  426    544   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  427    545   
    ) -> Self {
         546  +
        /* OperationErrorGenerator.kt:121 */
  428    547   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  429    548   
            source,
  430    549   
            meta: meta.unwrap_or_default(),
  431    550   
        })
         551  +
        /* OperationErrorGenerator.kt:110 */
  432    552   
    }
         553  +
    /* OperationErrorGenerator.kt:109 */
  433    554   
}
  434    555   
         556  +
/* CodegenDelegator.kt:255 */
  435    557   
pub use crate::operation::case_insensitive_error_operation::_case_insensitive_error_operation_output::CaseInsensitiveErrorOperationOutput;
  436    558   
         559  +
/* CodegenDelegator.kt:255 */
  437    560   
pub use crate::operation::case_insensitive_error_operation::_case_insensitive_error_operation_input::CaseInsensitiveErrorOperationInput;
  438    561   
         562  +
/* RustModule.kt:172 */
  439    563   
mod _case_insensitive_error_operation_input;
  440    564   
         565  +
/* RustModule.kt:172 */
  441    566   
mod _case_insensitive_error_operation_output;
  442    567   
  443         -
/// Builders
         568  +
/// /* CodegenDelegator.kt:51 */Builders
  444    569   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/case_insensitive_error_operation/_case_insensitive_error_operation_input.rs

@@ -1,1 +27,47 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct CaseInsensitiveErrorOperationInput {}
           8  +
pub /* StructureGenerator.kt:201 */ struct CaseInsensitiveErrorOperationInput {/* StructureGenerator.kt:201 */}
           9  +
/* ClientCodegenVisitor.kt:237 */
    6     10   
impl CaseInsensitiveErrorOperationInput {
    7         -
    /// Creates a new builder-style object to manufacture [`CaseInsensitiveErrorOperationInput`](crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationInput).
          11  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`CaseInsensitiveErrorOperationInput`](crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationInput).
          12  +
    /* BuilderGenerator.kt:175 */
    8     13   
    pub fn builder() -> crate::operation::case_insensitive_error_operation::builders::CaseInsensitiveErrorOperationInputBuilder {
          14  +
        /* BuilderGenerator.kt:176 */
    9     15   
        crate::operation::case_insensitive_error_operation::builders::CaseInsensitiveErrorOperationInputBuilder::default()
          16  +
        /* BuilderGenerator.kt:175 */
   10     17   
    }
          18  +
    /* ClientCodegenVisitor.kt:237 */
   11     19   
}
   12     20   
   13         -
/// A builder for [`CaseInsensitiveErrorOperationInput`](crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationInput).
          21  +
/// /* BuilderGenerator.kt:342 */A builder for [`CaseInsensitiveErrorOperationInput`](crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationInput).
          22  +
/* RustType.kt:516 */
   14     23   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          24  +
/* RustType.kt:516 */
   15     25   
#[non_exhaustive]
   16         -
pub struct CaseInsensitiveErrorOperationInputBuilder {}
          26  +
/* BuilderGenerator.kt:345 */
          27  +
pub struct CaseInsensitiveErrorOperationInputBuilder {/* BuilderGenerator.kt:345 */}
          28  +
/* BuilderGenerator.kt:355 */
   17     29   
impl CaseInsensitiveErrorOperationInputBuilder {
   18         -
    /// Consumes the builder and constructs a [`CaseInsensitiveErrorOperationInput`](crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationInput).
          30  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`CaseInsensitiveErrorOperationInput`](crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationInput).
          31  +
    /* BuilderGenerator.kt:253 */
   19     32   
    pub fn build(
   20     33   
        self,
   21     34   
    ) -> ::std::result::Result<
   22     35   
        crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationInput,
   23     36   
        ::aws_smithy_types::error::operation::BuildError,
   24     37   
    > {
   25         -
        ::std::result::Result::Ok(crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationInput {})
          38  +
        /* BuilderGenerator.kt:254 */
          39  +
        ::std::result::Result::Ok(
          40  +
            /* BuilderGenerator.kt:477 */
          41  +
            crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationInput {
          42  +
            /* BuilderGenerator.kt:477 */}, /* BuilderGenerator.kt:254 */
          43  +
        )
          44  +
        /* BuilderGenerator.kt:253 */
   26     45   
    }
          46  +
    /* BuilderGenerator.kt:355 */
   27     47   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/case_insensitive_error_operation/_case_insensitive_error_operation_output.rs

@@ -1,1 +22,39 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct CaseInsensitiveErrorOperationOutput {}
           8  +
pub /* StructureGenerator.kt:201 */ struct CaseInsensitiveErrorOperationOutput {/* StructureGenerator.kt:201 */}
           9  +
/* ClientCodegenVisitor.kt:237 */
    6     10   
impl CaseInsensitiveErrorOperationOutput {
    7         -
    /// Creates a new builder-style object to manufacture [`CaseInsensitiveErrorOperationOutput`](crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationOutput).
          11  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`CaseInsensitiveErrorOperationOutput`](crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationOutput).
          12  +
    /* BuilderGenerator.kt:175 */
    8     13   
    pub fn builder() -> crate::operation::case_insensitive_error_operation::builders::CaseInsensitiveErrorOperationOutputBuilder {
          14  +
        /* BuilderGenerator.kt:176 */
    9     15   
        crate::operation::case_insensitive_error_operation::builders::CaseInsensitiveErrorOperationOutputBuilder::default()
          16  +
        /* BuilderGenerator.kt:175 */
   10     17   
    }
          18  +
    /* ClientCodegenVisitor.kt:237 */
   11     19   
}
   12     20   
   13         -
/// A builder for [`CaseInsensitiveErrorOperationOutput`](crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationOutput).
          21  +
/// /* BuilderGenerator.kt:342 */A builder for [`CaseInsensitiveErrorOperationOutput`](crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationOutput).
          22  +
/* RustType.kt:516 */
   14     23   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          24  +
/* RustType.kt:516 */
   15     25   
#[non_exhaustive]
   16         -
pub struct CaseInsensitiveErrorOperationOutputBuilder {}
          26  +
/* BuilderGenerator.kt:345 */
          27  +
pub struct CaseInsensitiveErrorOperationOutputBuilder {/* BuilderGenerator.kt:345 */}
          28  +
/* BuilderGenerator.kt:355 */
   17     29   
impl CaseInsensitiveErrorOperationOutputBuilder {
   18         -
    /// Consumes the builder and constructs a [`CaseInsensitiveErrorOperationOutput`](crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationOutput).
          30  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`CaseInsensitiveErrorOperationOutput`](crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationOutput).
          31  +
    /* BuilderGenerator.kt:253 */
   19     32   
    pub fn build(self) -> crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationOutput {
   20         -
        crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationOutput {}
          33  +
        /* BuilderGenerator.kt:477 */
          34  +
        crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationOutput {
          35  +
        /* BuilderGenerator.kt:477 */}
          36  +
        /* BuilderGenerator.kt:253 */
   21     37   
    }
          38  +
    /* BuilderGenerator.kt:355 */
   22     39   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/case_insensitive_error_operation/builders.rs

@@ -1,1 +110,122 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::operation::case_insensitive_error_operation::_case_insensitive_error_operation_output::CaseInsensitiveErrorOperationOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::case_insensitive_error_operation::_case_insensitive_error_operation_input::CaseInsensitiveErrorOperationInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::case_insensitive_error_operation::builders::CaseInsensitiveErrorOperationInputBuilder {
    7     10   
    /// Sends a request with this input using the given client.
    8     11   
    pub async fn send_with(
    9     12   
        self,
   10     13   
        client: &crate::Client,
   11     14   
    ) -> ::std::result::Result<
   12     15   
        crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.case_insensitive_error_operation();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `CaseInsensitiveErrorOperation`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `CaseInsensitiveErrorOperation`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct CaseInsensitiveErrorOperationFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::case_insensitive_error_operation::builders::CaseInsensitiveErrorOperationInputBuilder,
   29     34   
    config_override: ::std::option::Option<crate::config::Builder>,
   30     35   
}
          36  +
/* FluentBuilderGenerator.kt:381 */
   31     37   
impl
   32     38   
    crate::client::customize::internal::CustomizableSend<
   33     39   
        crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationOutput,
   34     40   
        crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError,
   35     41   
    > for CaseInsensitiveErrorOperationFluentBuilder
   36     42   
{
   37     43   
    fn send(
   38     44   
        self,
   39     45   
        config_override: crate::config::Builder,
   40     46   
    ) -> crate::client::customize::internal::BoxFuture<
   41     47   
        crate::client::customize::internal::SendResult<
   42     48   
            crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationOutput,
   43     49   
            crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError,
   44     50   
        >,
   45     51   
    > {
   46     52   
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
   47     53   
    }
   48     54   
}
          55  +
/* FluentBuilderGenerator.kt:282 */
   49     56   
impl CaseInsensitiveErrorOperationFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `CaseInsensitiveErrorOperationFluentBuilder`.
   51     59   
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
   52     60   
        Self {
   53     61   
            handle,
   54     62   
            inner: ::std::default::Default::default(),
   55     63   
            config_override: ::std::option::Option::None,
   56     64   
        }
   57     65   
    }
          66  +
    /* FluentBuilderGenerator.kt:301 */
   58     67   
    /// Access the CaseInsensitiveErrorOperation as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::case_insensitive_error_operation::builders::CaseInsensitiveErrorOperationInputBuilder {
   60     69   
        &self.inner
   61     70   
    }
          71  +
    /* FluentBuilderGenerator.kt:145 */
   62     72   
    /// Sends the request and returns the response.
   63     73   
    ///
   64     74   
    /// If an error occurs, an `SdkError` will be returned with additional details that
   65     75   
    /// can be matched against.
   66     76   
    ///
   67     77   
    /// By default, any retryable failures will be retried twice. Retry behavior
   68     78   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   69     79   
    /// set when configuring the client.
   70     80   
    pub async fn send(
   71     81   
        self,
   72     82   
    ) -> ::std::result::Result<
   73     83   
        crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError,
   76     86   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   77     87   
        >,
   78     88   
    > {
   79     89   
        let input = self
   80     90   
            .inner
   81     91   
            .build()
   82     92   
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
   83     93   
        let runtime_plugins = crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperation::operation_runtime_plugins(
   84     94   
            self.handle.runtime_plugins.clone(),
   85     95   
            &self.handle.conf,
   86     96   
            self.config_override,
   87     97   
        );
   88     98   
        crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperation::orchestrate(&runtime_plugins, input).await
   89     99   
    }
   90    100   
   91    101   
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
   92    102   
    pub fn customize(
   93    103   
        self,
   94    104   
    ) -> crate::client::customize::CustomizableOperation<
   95    105   
        crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationOutput,
   96    106   
        crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError,
   97    107   
        Self,
   98    108   
    > {
   99    109   
        crate::client::customize::CustomizableOperation::new(self)
  100    110   
    }
         111  +
    /* FluentBuilderGenerator.kt:315 */
  101    112   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  102    113   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  103    114   
        self
  104    115   
    }
  105    116   
  106    117   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  107    118   
        self.config_override = config_override;
  108    119   
        self
  109    120   
    }
         121  +
    /* FluentBuilderGenerator.kt:282 */
  110    122   
}

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

@@ -1,1 +40,49 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* OperationGenerator.kt:77 */
    2      3   
/// Orchestration and serialization glue logic for `EmptyStructWithContentOnWireOp`.
           4  +
/* RustType.kt:516 */
    3      5   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
           6  +
/* RustType.kt:516 */
    4      7   
#[non_exhaustive]
           8  +
/* OperationGenerator.kt:84 */
    5      9   
pub struct EmptyStructWithContentOnWireOp;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl EmptyStructWithContentOnWireOp {
    7         -
    /// Creates a new `EmptyStructWithContentOnWireOp`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `EmptyStructWithContentOnWireOp`
          13  +
    /* OperationGenerator.kt:87 */
    8     14   
    pub fn new() -> Self {
          15  +
        /* OperationGenerator.kt:88 */
    9     16   
        Self
          17  +
        /* OperationGenerator.kt:87 */
   10     18   
    }
          19  +
    /* OperationGenerator.kt:138 */
   11     20   
    pub(crate) async fn orchestrate(
   12     21   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     22   
        input: crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +269,286 @@
   83     92   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   84     93   
            }
   85     94   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   86     95   
                config_override,
   87     96   
                client_config.config.clone(),
   88     97   
                &client_config.runtime_components,
   89     98   
            ));
   90     99   
        }
   91    100   
        runtime_plugins
   92    101   
    }
         102  +
    /* OperationGenerator.kt:85 */
   93    103   
}
         104  +
/* OperationRuntimePluginGenerator.kt:55 */
   94    105   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for EmptyStructWithContentOnWireOp {
   95    106   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
   96    107   
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("EmptyStructWithContentOnWireOp");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            EmptyStructWithContentOnWireOpRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            EmptyStructWithContentOnWireOpResponseDeserializer,
  103    114   
        ));
  104    115   
  105    116   
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
  106    117   
            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
  107    118   
        ));
  108    119   
  109    120   
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
  110    121   
            "EmptyStructWithContentOnWireOp",
  111    122   
            "Rest Json Protocol",
  112    123   
        ));
  113    124   
  114    125   
        ::std::option::Option::Some(cfg.freeze())
  115    126   
    }
  116    127   
  117    128   
    fn runtime_components(
  118    129   
        &self,
  119    130   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  120    131   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  121    132   
        #[allow(unused_mut)]
  122    133   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("EmptyStructWithContentOnWireOp")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(EmptyStructWithContentOnWireOpEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError,
  130    141   
            >::new());
  131    142   
  132    143   
        ::std::borrow::Cow::Owned(rcb)
  133    144   
    }
  134    145   
}
  135    146   
         147  +
/* ResponseDeserializerGenerator.kt:64 */
  136    148   
#[derive(Debug)]
  137    149   
struct EmptyStructWithContentOnWireOpResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for EmptyStructWithContentOnWireOpResponseDeserializer {
  139    151   
    fn deserialize_nonstreaming(
  140    152   
        &self,
  141    153   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  142    154   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  143    155   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  144    156   
        let headers = response.headers();
  145    157   
        let body = response.body().bytes().expect("body loaded");
  146    158   
        #[allow(unused_mut)]
  147    159   
        let mut force_error = false;
  148    160   
  149    161   
        let parse_result = if !success && status != 200 || force_error {
  150    162   
            crate::protocol_serde::shape_empty_struct_with_content_on_wire_op::de_empty_struct_with_content_on_wire_op_http_error(
  151    163   
                status, headers, body,
  152    164   
            )
  153    165   
        } else {
  154    166   
            crate::protocol_serde::shape_empty_struct_with_content_on_wire_op::de_empty_struct_with_content_on_wire_op_http_response(
  155    167   
                status, headers, body,
  156    168   
            )
  157    169   
        };
  158    170   
        crate::protocol_serde::type_erase_result(parse_result)
  159    171   
    }
  160    172   
}
         173  +
/* RequestSerializerGenerator.kt:67 */
  161    174   
#[derive(Debug)]
  162    175   
struct EmptyStructWithContentOnWireOpRequestSerializer;
  163    176   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for EmptyStructWithContentOnWireOpRequestSerializer {
  164    177   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  165    178   
    fn serialize_input(
  166    179   
        &self,
  167    180   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  168    181   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  169    182   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  170    183   
        let input = input
  171    184   
            .downcast::<crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpInput>()
  172    185   
            .expect("correct type");
  173    186   
        let _header_serialization_settings = _cfg
  174    187   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  175    188   
            .cloned()
  176    189   
            .unwrap_or_default();
  177    190   
        let mut request_builder = {
  178    191   
            fn uri_base(
  179    192   
                _input: &crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpInput,
  180    193   
                output: &mut ::std::string::String,
  181    194   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  182    195   
                use ::std::fmt::Write as _;
  183    196   
                ::std::write!(output, "/empty-struct-with-content-on-wire-op").expect("formatting should succeed");
  184    197   
                ::std::result::Result::Ok(())
  185    198   
            }
  186    199   
            #[allow(clippy::unnecessary_wraps)]
  187    200   
            fn update_http_builder(
  188    201   
                input: &crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpInput,
  189    202   
                builder: ::http::request::Builder,
  190    203   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  191    204   
                let mut uri = ::std::string::String::new();
  192    205   
                uri_base(input, &mut uri)?;
  193    206   
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  194    207   
            }
  195    208   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  196    209   
            builder
  197    210   
        };
  198    211   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  199    212   
  200    213   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  201    214   
    }
  202    215   
}
         216  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  203    217   
#[derive(Debug)]
  204    218   
struct EmptyStructWithContentOnWireOpEndpointParamsInterceptor;
  205    219   
  206    220   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for EmptyStructWithContentOnWireOpEndpointParamsInterceptor {
  207    221   
    fn name(&self) -> &'static str {
  208    222   
        "EmptyStructWithContentOnWireOpEndpointParamsInterceptor"
  209    223   
    }
  210    224   
  211    225   
    fn read_before_execution(
  212    226   
        &self,
  213    227   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  214    228   
            '_,
  215    229   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  216    230   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  217    231   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  218    232   
        >,
  219    233   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  220    234   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  221    235   
        let _input = context
  222    236   
            .input()
  223    237   
            .downcast_ref::<EmptyStructWithContentOnWireOpInput>()
  224    238   
            .ok_or("failed to downcast to EmptyStructWithContentOnWireOpInput")?;
  225    239   
  226    240   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  227    241   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  228    242   
        })?;
  229    243   
        cfg.interceptor_state()
  230    244   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  231    245   
        ::std::result::Result::Ok(())
  232    246   
    }
  233    247   
}
  234    248   
  235    249   
// The get_* functions below are generated from JMESPath expressions in the
  236    250   
// operationContextParams trait. They target the operation's input shape.
  237    251   
         252  +
/* RustType.kt:516 */
  238    253   
#[allow(unreachable_code, unused_variables)]
         254  +
/* RustType.kt:516 */
  239    255   
#[cfg(test)]
         256  +
/* ProtocolTestGenerator.kt:98 */
  240    257   
mod empty_struct_with_content_on_wire_op_test {
  241    258   
  242    259   
    /// Test ID: EmptyStructWithContentOnWire
  243    260   
    #[::tokio::test]
  244    261   
    #[::tracing_test::traced_test]
  245    262   
    async fn empty_struct_with_content_on_wire_response() {
  246    263   
        let expected_output = crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpOutput::builder()
  247    264   
            .set_empty(::std::option::Option::Some(crate::types::EmptyStruct::builder().build()))
  248    265   
            .build();
  249    266   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
@@ -294,311 +433,533 @@
  314    331   
        });
  315    332   
        let parsed = parsed.expect_err("should be error response");
  316    333   
        let parsed: &crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError =
  317    334   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  318    335   
        if let crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError::ExtraError(parsed) = parsed {
  319    336   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  320    337   
        } else {
  321    338   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  322    339   
        }
  323    340   
    }
         341  +
         342  +
    /* ProtocolTestGenerator.kt:98 */
  324    343   
}
  325    344   
         345  +
/* OperationErrorGenerator.kt:79 */
  326    346   
/// Error type for the `EmptyStructWithContentOnWireOpError` operation.
         347  +
/* RustType.kt:516 */
  327    348   
#[non_exhaustive]
         349  +
/* RustType.kt:516 */
  328    350   
#[derive(::std::fmt::Debug)]
  329         -
pub enum EmptyStructWithContentOnWireOpError {
         351  +
pub /* OperationErrorGenerator.kt:81 */ enum EmptyStructWithContentOnWireOpError {
         352  +
    /* OperationErrorGenerator.kt:83 */
  330    353   
    #[allow(missing_docs)] // documentation missing in model
         354  +
    /* OperationErrorGenerator.kt:86 */
  331    355   
    ExtraError(crate::types::error::ExtraError),
         356  +
    /* OperationErrorGenerator.kt:88 */
  332    357   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  333    358   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  334    359   
    variable wildcard pattern and check `.code()`:
  335    360   
     \
  336    361   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  337    362   
     \
  338    363   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-EmptyStructWithContentOnWireOpError) for what information is available for the error.")]
  339    364   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         365  +
    /* OperationErrorGenerator.kt:81 */
  340    366   
}
         367  +
/* OperationErrorGenerator.kt:218 */
  341    368   
impl EmptyStructWithContentOnWireOpError {
         369  +
    /* OperationErrorGenerator.kt:219 */
  342    370   
    /// Creates the `EmptyStructWithContentOnWireOpError::Unhandled` variant from any error type.
  343    371   
    pub fn unhandled(
  344    372   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  345    373   
    ) -> Self {
  346    374   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  347    375   
            source: err.into(),
  348    376   
            meta: ::std::default::Default::default(),
  349    377   
        })
  350    378   
    }
  351    379   
  352    380   
    /// Creates the `EmptyStructWithContentOnWireOpError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  353    381   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  354    382   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  355    383   
            source: err.clone().into(),
  356    384   
            meta: err,
  357    385   
        })
  358    386   
    }
  359         -
    ///
         387  +
    /// /* OperationErrorGenerator.kt:236 */
  360    388   
    /// Returns error metadata, which includes the error code, message,
  361    389   
    /// request ID, and potentially additional information.
  362    390   
    ///
         391  +
    /* OperationErrorGenerator.kt:242 */
  363    392   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         393  +
        /* OperationErrorGenerator.kt:243 */
  364    394   
        match self {
  365         -
            Self::ExtraError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  366         -
            Self::Unhandled(e) => &e.meta,
         395  +
            /* OperationErrorGenerator.kt:246 */ Self::ExtraError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         396  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         397  +
            /* OperationErrorGenerator.kt:243 */
  367    398   
        }
         399  +
        /* OperationErrorGenerator.kt:242 */
  368    400   
    }
         401  +
    /* OperationErrorGenerator.kt:257 */
  369    402   
    /// Returns `true` if the error kind is `EmptyStructWithContentOnWireOpError::ExtraError`.
         403  +
    /* OperationErrorGenerator.kt:258 */
  370    404   
    pub fn is_extra_error(&self) -> bool {
         405  +
        /* OperationErrorGenerator.kt:259 */
  371    406   
        matches!(self, Self::ExtraError(_))
         407  +
        /* OperationErrorGenerator.kt:258 */
  372    408   
    }
         409  +
    /* OperationErrorGenerator.kt:218 */
  373    410   
}
         411  +
/* OperationErrorGenerator.kt:269 */
  374    412   
impl ::std::error::Error for EmptyStructWithContentOnWireOpError {
         413  +
    /* OperationErrorGenerator.kt:270 */
  375    414   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         415  +
        /* OperationErrorGenerator.kt:318 */
  376    416   
        match self {
  377         -
            Self::ExtraError(_inner) => ::std::option::Option::Some(_inner),
  378         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         417  +
            /* OperationErrorGenerator.kt:321 */
         418  +
            Self::ExtraError(_inner) =>
         419  +
            /* OperationErrorGenerator.kt:283 */
         420  +
            {
         421  +
                ::std::option::Option::Some(_inner)
         422  +
            }
         423  +
            ,
         424  +
            /* OperationErrorGenerator.kt:326 */
         425  +
            Self::Unhandled(_inner) => {
         426  +
                /* OperationErrorGenerator.kt:279 */
         427  +
                ::std::option::Option::Some(&*_inner.source)
         428  +
                /* OperationErrorGenerator.kt:326 */
         429  +
            } /* OperationErrorGenerator.kt:318 */
  379    430   
        }
         431  +
        /* OperationErrorGenerator.kt:270 */
  380    432   
    }
         433  +
    /* OperationErrorGenerator.kt:269 */
  381    434   
}
         435  +
/* OperationErrorGenerator.kt:133 */
  382    436   
impl ::std::fmt::Display for EmptyStructWithContentOnWireOpError {
         437  +
    /* OperationErrorGenerator.kt:134 */
  383    438   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         439  +
        /* OperationErrorGenerator.kt:318 */
  384    440   
        match self {
  385         -
            Self::ExtraError(_inner) => _inner.fmt(f),
         441  +
            /* OperationErrorGenerator.kt:321 */
         442  +
            Self::ExtraError(_inner) =>
         443  +
            /* OperationErrorGenerator.kt:151 */
         444  +
            {
         445  +
                _inner.fmt(f)
         446  +
            }
         447  +
            ,
         448  +
            /* OperationErrorGenerator.kt:326 */
  386    449   
            Self::Unhandled(_inner) => {
         450  +
                /* OperationErrorGenerator.kt:139 */
  387    451   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  388    452   
                    write!(f, "unhandled error ({code})")
  389    453   
                } else {
  390    454   
                    f.write_str("unhandled error")
  391    455   
                }
  392         -
            }
         456  +
                /* OperationErrorGenerator.kt:326 */
         457  +
            } /* OperationErrorGenerator.kt:318 */
  393    458   
        }
         459  +
        /* OperationErrorGenerator.kt:134 */
  394    460   
    }
         461  +
    /* OperationErrorGenerator.kt:133 */
  395    462   
}
         463  +
/* OperationErrorGenerator.kt:182 */
  396    464   
impl ::aws_smithy_types::retry::ProvideErrorKind for EmptyStructWithContentOnWireOpError {
         465  +
    /* OperationErrorGenerator.kt:186 */
  397    466   
    fn code(&self) -> ::std::option::Option<&str> {
         467  +
        /* OperationErrorGenerator.kt:187 */
  398    468   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         469  +
        /* OperationErrorGenerator.kt:186 */
  399    470   
    }
         471  +
    /* OperationErrorGenerator.kt:190 */
  400    472   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         473  +
        /* OperationErrorGenerator.kt:197 */
  401    474   
        ::std::option::Option::None
         475  +
        /* OperationErrorGenerator.kt:190 */
  402    476   
    }
         477  +
    /* OperationErrorGenerator.kt:182 */
  403    478   
}
         479  +
/* OperationErrorGenerator.kt:163 */
  404    480   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for EmptyStructWithContentOnWireOpError {
         481  +
    /* OperationErrorGenerator.kt:164 */
  405    482   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         483  +
        /* OperationErrorGenerator.kt:318 */
  406    484   
        match self {
  407         -
            Self::ExtraError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  408         -
            Self::Unhandled(_inner) => &_inner.meta,
         485  +
            /* OperationErrorGenerator.kt:321 */
         486  +
            Self::ExtraError(_inner) =>
         487  +
            /* OperationErrorGenerator.kt:169 */
         488  +
            {
         489  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         490  +
            }
         491  +
            ,
         492  +
            /* OperationErrorGenerator.kt:326 */
         493  +
            Self::Unhandled(_inner) => {
         494  +
                /* OperationErrorGenerator.kt:168 */
         495  +
                &_inner.meta
         496  +
                /* OperationErrorGenerator.kt:326 */
         497  +
            } /* OperationErrorGenerator.kt:318 */
  409    498   
        }
         499  +
        /* OperationErrorGenerator.kt:164 */
  410    500   
    }
         501  +
    /* OperationErrorGenerator.kt:163 */
  411    502   
}
         503  +
/* OperationErrorGenerator.kt:109 */
  412    504   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for EmptyStructWithContentOnWireOpError {
         505  +
    /* OperationErrorGenerator.kt:110 */
  413    506   
    fn create_unhandled_error(
  414    507   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  415    508   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  416    509   
    ) -> Self {
         510  +
        /* OperationErrorGenerator.kt:121 */
  417    511   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  418    512   
            source,
  419    513   
            meta: meta.unwrap_or_default(),
  420    514   
        })
         515  +
        /* OperationErrorGenerator.kt:110 */
  421    516   
    }
         517  +
    /* OperationErrorGenerator.kt:109 */
  422    518   
}
  423    519   
         520  +
/* CodegenDelegator.kt:255 */
  424    521   
pub use crate::operation::empty_struct_with_content_on_wire_op::_empty_struct_with_content_on_wire_op_output::EmptyStructWithContentOnWireOpOutput;
  425    522   
         523  +
/* CodegenDelegator.kt:255 */
  426    524   
pub use crate::operation::empty_struct_with_content_on_wire_op::_empty_struct_with_content_on_wire_op_input::EmptyStructWithContentOnWireOpInput;
  427    525   
         526  +
/* RustModule.kt:172 */
  428    527   
mod _empty_struct_with_content_on_wire_op_input;
  429    528   
         529  +
/* RustModule.kt:172 */
  430    530   
mod _empty_struct_with_content_on_wire_op_output;
  431    531   
  432         -
/// Builders
         532  +
/// /* CodegenDelegator.kt:51 */Builders
  433    533   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/empty_struct_with_content_on_wire_op/_empty_struct_with_content_on_wire_op_input.rs

@@ -1,1 +27,47 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct EmptyStructWithContentOnWireOpInput {}
           8  +
pub /* StructureGenerator.kt:201 */ struct EmptyStructWithContentOnWireOpInput {/* StructureGenerator.kt:201 */}
           9  +
/* ClientCodegenVisitor.kt:237 */
    6     10   
impl EmptyStructWithContentOnWireOpInput {
    7         -
    /// Creates a new builder-style object to manufacture [`EmptyStructWithContentOnWireOpInput`](crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpInput).
          11  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`EmptyStructWithContentOnWireOpInput`](crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpInput).
          12  +
    /* BuilderGenerator.kt:175 */
    8     13   
    pub fn builder() -> crate::operation::empty_struct_with_content_on_wire_op::builders::EmptyStructWithContentOnWireOpInputBuilder {
          14  +
        /* BuilderGenerator.kt:176 */
    9     15   
        crate::operation::empty_struct_with_content_on_wire_op::builders::EmptyStructWithContentOnWireOpInputBuilder::default()
          16  +
        /* BuilderGenerator.kt:175 */
   10     17   
    }
          18  +
    /* ClientCodegenVisitor.kt:237 */
   11     19   
}
   12     20   
   13         -
/// A builder for [`EmptyStructWithContentOnWireOpInput`](crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpInput).
          21  +
/// /* BuilderGenerator.kt:342 */A builder for [`EmptyStructWithContentOnWireOpInput`](crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpInput).
          22  +
/* RustType.kt:516 */
   14     23   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          24  +
/* RustType.kt:516 */
   15     25   
#[non_exhaustive]
   16         -
pub struct EmptyStructWithContentOnWireOpInputBuilder {}
          26  +
/* BuilderGenerator.kt:345 */
          27  +
pub struct EmptyStructWithContentOnWireOpInputBuilder {/* BuilderGenerator.kt:345 */}
          28  +
/* BuilderGenerator.kt:355 */
   17     29   
impl EmptyStructWithContentOnWireOpInputBuilder {
   18         -
    /// Consumes the builder and constructs a [`EmptyStructWithContentOnWireOpInput`](crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpInput).
          30  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`EmptyStructWithContentOnWireOpInput`](crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpInput).
          31  +
    /* BuilderGenerator.kt:253 */
   19     32   
    pub fn build(
   20     33   
        self,
   21     34   
    ) -> ::std::result::Result<
   22     35   
        crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpInput,
   23     36   
        ::aws_smithy_types::error::operation::BuildError,
   24     37   
    > {
   25         -
        ::std::result::Result::Ok(crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpInput {})
          38  +
        /* BuilderGenerator.kt:254 */
          39  +
        ::std::result::Result::Ok(
          40  +
            /* BuilderGenerator.kt:477 */
          41  +
            crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpInput {
          42  +
            /* BuilderGenerator.kt:477 */}, /* BuilderGenerator.kt:254 */
          43  +
        )
          44  +
        /* BuilderGenerator.kt:253 */
   26     45   
    }
          46  +
    /* BuilderGenerator.kt:355 */
   27     47   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/empty_struct_with_content_on_wire_op/_empty_struct_with_content_on_wire_op_output.rs

@@ -1,1 +47,88 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct EmptyStructWithContentOnWireOpOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct EmptyStructWithContentOnWireOpOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub empty: ::std::option::Option<crate::types::EmptyStruct>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl EmptyStructWithContentOnWireOpOutput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn empty(&self) -> ::std::option::Option<&crate::types::EmptyStruct> {
          20  +
        /* StructureGenerator.kt:170 */
   12     21   
        self.empty.as_ref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl EmptyStructWithContentOnWireOpOutput {
   16         -
    /// Creates a new builder-style object to manufacture [`EmptyStructWithContentOnWireOpOutput`](crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpOutput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`EmptyStructWithContentOnWireOpOutput`](crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpOutput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::empty_struct_with_content_on_wire_op::builders::EmptyStructWithContentOnWireOpOutputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::empty_struct_with_content_on_wire_op::builders::EmptyStructWithContentOnWireOpOutputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`EmptyStructWithContentOnWireOpOutput`](crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpOutput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`EmptyStructWithContentOnWireOpOutput`](crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpOutput).
          39  +
/* RustType.kt:516 */
   23     40   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          41  +
/* RustType.kt:516 */
   24     42   
#[non_exhaustive]
          43  +
/* BuilderGenerator.kt:345 */
   25     44   
pub struct EmptyStructWithContentOnWireOpOutputBuilder {
   26         -
    pub(crate) empty: ::std::option::Option<crate::types::EmptyStruct>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) empty: ::std::option::Option<crate::types::EmptyStruct>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl EmptyStructWithContentOnWireOpOutputBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
          52  +
                           /* BuilderGenerator.kt:291 */
   30     53   
    pub fn empty(mut self, input: crate::types::EmptyStruct) -> Self {
          54  +
        /* BuilderGenerator.kt:292 */
   31     55   
        self.empty = ::std::option::Option::Some(input);
          56  +
        /* BuilderGenerator.kt:293 */
   32     57   
        self
          58  +
        /* BuilderGenerator.kt:291 */
   33     59   
    }
          60  +
    /* BuilderGenerator.kt:312 */
   34     61   
    #[allow(missing_docs)] // documentation missing in model
          62  +
                           /* BuilderGenerator.kt:314 */
   35     63   
    pub fn set_empty(mut self, input: ::std::option::Option<crate::types::EmptyStruct>) -> Self {
          64  +
        /* BuilderGenerator.kt:315 */
   36     65   
        self.empty = input;
   37     66   
        self
          67  +
        /* BuilderGenerator.kt:314 */
   38     68   
    }
          69  +
    /* BuilderGenerator.kt:334 */
   39     70   
    #[allow(missing_docs)] // documentation missing in model
          71  +
                           /* BuilderGenerator.kt:336 */
   40     72   
    pub fn get_empty(&self) -> &::std::option::Option<crate::types::EmptyStruct> {
          73  +
        /* BuilderGenerator.kt:337 */
   41     74   
        &self.empty
          75  +
        /* BuilderGenerator.kt:336 */
   42     76   
    }
   43         -
    /// Consumes the builder and constructs a [`EmptyStructWithContentOnWireOpOutput`](crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpOutput).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`EmptyStructWithContentOnWireOpOutput`](crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpOutput).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(self) -> crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpOutput {
   45         -
        crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpOutput { empty: self.empty }
          80  +
        /* BuilderGenerator.kt:477 */
          81  +
        crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpOutput {
          82  +
            /* BuilderGenerator.kt:481 */ empty: self.empty,
          83  +
            /* BuilderGenerator.kt:477 */
          84  +
        }
          85  +
        /* BuilderGenerator.kt:253 */
   46     86   
    }
          87  +
    /* BuilderGenerator.kt:355 */
   47     88   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/empty_struct_with_content_on_wire_op/builders.rs

@@ -1,1 +110,122 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::operation::empty_struct_with_content_on_wire_op::_empty_struct_with_content_on_wire_op_output::EmptyStructWithContentOnWireOpOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::empty_struct_with_content_on_wire_op::_empty_struct_with_content_on_wire_op_input::EmptyStructWithContentOnWireOpInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::empty_struct_with_content_on_wire_op::builders::EmptyStructWithContentOnWireOpInputBuilder {
    7     10   
    /// Sends a request with this input using the given client.
    8     11   
    pub async fn send_with(
    9     12   
        self,
   10     13   
        client: &crate::Client,
   11     14   
    ) -> ::std::result::Result<
   12     15   
        crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.empty_struct_with_content_on_wire_op();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `EmptyStructWithContentOnWireOp`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `EmptyStructWithContentOnWireOp`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct EmptyStructWithContentOnWireOpFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::empty_struct_with_content_on_wire_op::builders::EmptyStructWithContentOnWireOpInputBuilder,
   29     34   
    config_override: ::std::option::Option<crate::config::Builder>,
   30     35   
}
          36  +
/* FluentBuilderGenerator.kt:381 */
   31     37   
impl
   32     38   
    crate::client::customize::internal::CustomizableSend<
   33     39   
        crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpOutput,
   34     40   
        crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError,
   35     41   
    > for EmptyStructWithContentOnWireOpFluentBuilder
   36     42   
{
   37     43   
    fn send(
   38     44   
        self,
   39     45   
        config_override: crate::config::Builder,
   40     46   
    ) -> crate::client::customize::internal::BoxFuture<
   41     47   
        crate::client::customize::internal::SendResult<
   42     48   
            crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpOutput,
   43     49   
            crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError,
   44     50   
        >,
   45     51   
    > {
   46     52   
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
   47     53   
    }
   48     54   
}
          55  +
/* FluentBuilderGenerator.kt:282 */
   49     56   
impl EmptyStructWithContentOnWireOpFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `EmptyStructWithContentOnWireOpFluentBuilder`.
   51     59   
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
   52     60   
        Self {
   53     61   
            handle,
   54     62   
            inner: ::std::default::Default::default(),
   55     63   
            config_override: ::std::option::Option::None,
   56     64   
        }
   57     65   
    }
          66  +
    /* FluentBuilderGenerator.kt:301 */
   58     67   
    /// Access the EmptyStructWithContentOnWireOp as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::empty_struct_with_content_on_wire_op::builders::EmptyStructWithContentOnWireOpInputBuilder {
   60     69   
        &self.inner
   61     70   
    }
          71  +
    /* FluentBuilderGenerator.kt:145 */
   62     72   
    /// Sends the request and returns the response.
   63     73   
    ///
   64     74   
    /// If an error occurs, an `SdkError` will be returned with additional details that
   65     75   
    /// can be matched against.
   66     76   
    ///
   67     77   
    /// By default, any retryable failures will be retried twice. Retry behavior
   68     78   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   69     79   
    /// set when configuring the client.
   70     80   
    pub async fn send(
   71     81   
        self,
   72     82   
    ) -> ::std::result::Result<
   73     83   
        crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError,
   76     86   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   77     87   
        >,
   78     88   
    > {
   79     89   
        let input = self
   80     90   
            .inner
   81     91   
            .build()
   82     92   
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
   83     93   
        let runtime_plugins = crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOp::operation_runtime_plugins(
   84     94   
            self.handle.runtime_plugins.clone(),
   85     95   
            &self.handle.conf,
   86     96   
            self.config_override,
   87     97   
        );
   88     98   
        crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOp::orchestrate(&runtime_plugins, input).await
   89     99   
    }
   90    100   
   91    101   
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
   92    102   
    pub fn customize(
   93    103   
        self,
   94    104   
    ) -> crate::client::customize::CustomizableOperation<
   95    105   
        crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpOutput,
   96    106   
        crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError,
   97    107   
        Self,
   98    108   
    > {
   99    109   
        crate::client::customize::CustomizableOperation::new(self)
  100    110   
    }
         111  +
    /* FluentBuilderGenerator.kt:315 */
  101    112   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  102    113   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  103    114   
        self
  104    115   
    }
  105    116   
  106    117   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  107    118   
        self.config_override = config_override;
  108    119   
        self
  109    120   
    }
         121  +
    /* FluentBuilderGenerator.kt:282 */
  110    122   
}

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

@@ -1,1 +40,49 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* OperationGenerator.kt:77 */
    2      3   
/// Orchestration and serialization glue logic for `EnumQuery`.
           4  +
/* RustType.kt:516 */
    3      5   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
           6  +
/* RustType.kt:516 */
    4      7   
#[non_exhaustive]
           8  +
/* OperationGenerator.kt:84 */
    5      9   
pub struct EnumQuery;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl EnumQuery {
    7         -
    /// Creates a new `EnumQuery`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `EnumQuery`
          13  +
    /* OperationGenerator.kt:87 */
    8     14   
    pub fn new() -> Self {
          15  +
        /* OperationGenerator.kt:88 */
    9     16   
        Self
          17  +
        /* OperationGenerator.kt:87 */
   10     18   
    }
          19  +
    /* OperationGenerator.kt:138 */
   11     20   
    pub(crate) async fn orchestrate(
   12     21   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     22   
        input: crate::operation::enum_query::EnumQueryInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::enum_query::EnumQueryOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::enum_query::EnumQueryError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -57,66 +268,285 @@
   77     86   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   78     87   
            }
   79     88   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   80     89   
                config_override,
   81     90   
                client_config.config.clone(),
   82     91   
                &client_config.runtime_components,
   83     92   
            ));
   84     93   
        }
   85     94   
        runtime_plugins
   86     95   
    }
          96  +
    /* OperationGenerator.kt:85 */
   87     97   
}
          98  +
/* OperationRuntimePluginGenerator.kt:55 */
   88     99   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for EnumQuery {
   89    100   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
   90    101   
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("EnumQuery");
   91    102   
   92    103   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   93    104   
            EnumQueryRequestSerializer,
   94    105   
        ));
   95    106   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   96    107   
            EnumQueryResponseDeserializer,
   97    108   
        ));
   98    109   
   99    110   
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
  100    111   
            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
  101    112   
        ));
  102    113   
  103    114   
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
  104    115   
            "EnumQuery",
  105    116   
            "Rest Json Protocol",
  106    117   
        ));
  107    118   
  108    119   
        ::std::option::Option::Some(cfg.freeze())
  109    120   
    }
  110    121   
  111    122   
    fn runtime_components(
  112    123   
        &self,
  113    124   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  114    125   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  115    126   
        #[allow(unused_mut)]
  116    127   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("EnumQuery")
  117    128   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  118    129   
            .with_interceptor(EnumQueryEndpointParamsInterceptor)
  119    130   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  120    131   
                crate::operation::enum_query::EnumQueryError,
  121    132   
            >::new())
  122    133   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  123    134   
                crate::operation::enum_query::EnumQueryError,
  124    135   
            >::new());
  125    136   
  126    137   
        ::std::borrow::Cow::Owned(rcb)
  127    138   
    }
  128    139   
}
  129    140   
         141  +
/* ResponseDeserializerGenerator.kt:64 */
  130    142   
#[derive(Debug)]
  131    143   
struct EnumQueryResponseDeserializer;
  132    144   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for EnumQueryResponseDeserializer {
  133    145   
    fn deserialize_nonstreaming(
  134    146   
        &self,
  135    147   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  136    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  137    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  138    150   
        let headers = response.headers();
  139    151   
        let body = response.body().bytes().expect("body loaded");
  140    152   
        #[allow(unused_mut)]
  141    153   
        let mut force_error = false;
  142    154   
  143    155   
        let parse_result = if !success && status != 200 || force_error {
  144    156   
            crate::protocol_serde::shape_enum_query::de_enum_query_http_error(status, headers, body)
  145    157   
        } else {
  146    158   
            crate::protocol_serde::shape_enum_query::de_enum_query_http_response(status, headers, body)
  147    159   
        };
  148    160   
        crate::protocol_serde::type_erase_result(parse_result)
  149    161   
    }
  150    162   
}
         163  +
/* RequestSerializerGenerator.kt:67 */
  151    164   
#[derive(Debug)]
  152    165   
struct EnumQueryRequestSerializer;
  153    166   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for EnumQueryRequestSerializer {
  154    167   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  155    168   
    fn serialize_input(
  156    169   
        &self,
  157    170   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  158    171   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  159    172   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  160    173   
        let input = input.downcast::<crate::operation::enum_query::EnumQueryInput>().expect("correct type");
  161    174   
        let _header_serialization_settings = _cfg
  162    175   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  163    176   
            .cloned()
  164    177   
            .unwrap_or_default();
  165    178   
        let mut request_builder = {
  166    179   
            fn uri_base(
  167    180   
                _input: &crate::operation::enum_query::EnumQueryInput,
  168    181   
                output: &mut ::std::string::String,
  169    182   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  170    183   
                use ::std::fmt::Write as _;
  171    184   
                let input_1 = &_input.r#enum;
  172    185   
                let input_1 = input_1
  173    186   
                    .as_ref()
  174    187   
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("r#enum", "cannot be empty or unset"))?;
  175    188   
                let r#enum = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
  176    189   
                if r#enum.is_empty() {
  177    190   
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
  178    191   
                        "r#enum",
  179    192   
                        "cannot be empty or unset",
  180    193   
                    ));
  181    194   
                }
  182    195   
                ::std::write!(output, "/foo/{enum}", enum = r#enum).expect("formatting should succeed");
  183    196   
                ::std::result::Result::Ok(())
  184    197   
            }
  185    198   
            #[allow(clippy::unnecessary_wraps)]
  186    199   
            fn update_http_builder(
  187    200   
                input: &crate::operation::enum_query::EnumQueryInput,
  188    201   
                builder: ::http::request::Builder,
  189    202   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  190    203   
                let mut uri = ::std::string::String::new();
  191    204   
                uri_base(input, &mut uri)?;
  192    205   
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  193    206   
            }
  194    207   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  195    208   
            builder
  196    209   
        };
  197    210   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  198    211   
  199    212   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  200    213   
    }
  201    214   
}
         215  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  202    216   
#[derive(Debug)]
  203    217   
struct EnumQueryEndpointParamsInterceptor;
  204    218   
  205    219   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for EnumQueryEndpointParamsInterceptor {
  206    220   
    fn name(&self) -> &'static str {
  207    221   
        "EnumQueryEndpointParamsInterceptor"
  208    222   
    }
  209    223   
  210    224   
    fn read_before_execution(
  211    225   
        &self,
  212    226   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  213    227   
            '_,
  214    228   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  215    229   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  216    230   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  217    231   
        >,
  218    232   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  219    233   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  220    234   
        let _input = context
  221    235   
            .input()
  222    236   
            .downcast_ref::<EnumQueryInput>()
  223    237   
            .ok_or("failed to downcast to EnumQueryInput")?;
  224    238   
  225    239   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  226    240   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  227    241   
        })?;
  228    242   
        cfg.interceptor_state()
  229    243   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  230    244   
        ::std::result::Result::Ok(())
  231    245   
    }
  232    246   
}
  233    247   
  234    248   
// The get_* functions below are generated from JMESPath expressions in the
  235    249   
// operationContextParams trait. They target the operation's input shape.
  236    250   
         251  +
/* RustType.kt:516 */
  237    252   
#[allow(unreachable_code, unused_variables)]
         253  +
/* RustType.kt:516 */
  238    254   
#[cfg(test)]
         255  +
/* ProtocolTestGenerator.kt:98 */
  239    256   
mod enum_query_test {
  240    257   
  241    258   
    /// Test ID: EnumQueryRequest
  242    259   
    #[::tokio::test]
  243    260   
    #[::tracing_test::traced_test]
  244    261   
    async fn enum_query_request_request() {
  245    262   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  246    263   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  247    264   
  248    265   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
@@ -274,291 +423,546 @@
  294    311   
            de.deserialize_nonstreaming(&http_response)
  295    312   
        });
  296    313   
        let parsed = parsed.expect_err("should be error response");
  297    314   
        let parsed: &crate::operation::enum_query::EnumQueryError = parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  298    315   
        if let crate::operation::enum_query::EnumQueryError::ExtraError(parsed) = parsed {
  299    316   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  300    317   
        } else {
  301    318   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  302    319   
        }
  303    320   
    }
         321  +
         322  +
    /* ProtocolTestGenerator.kt:98 */
  304    323   
}
  305    324   
         325  +
/* OperationErrorGenerator.kt:79 */
  306    326   
/// Error type for the `EnumQueryError` operation.
         327  +
/* RustType.kt:516 */
  307    328   
#[non_exhaustive]
         329  +
/* RustType.kt:516 */
  308    330   
#[derive(::std::fmt::Debug)]
  309         -
pub enum EnumQueryError {
  310         -
    /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
         331  +
pub /* OperationErrorGenerator.kt:81 */ enum EnumQueryError {
         332  +
    /// /* OperationErrorGenerator.kt:83 */A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
         333  +
    /* OperationErrorGenerator.kt:86 */
  311    334   
    ValidationError(crate::types::error::ValidationError),
         335  +
    /* OperationErrorGenerator.kt:83 */
  312    336   
    #[allow(missing_docs)] // documentation missing in model
         337  +
    /* OperationErrorGenerator.kt:86 */
  313    338   
    ExtraError(crate::types::error::ExtraError),
         339  +
    /* OperationErrorGenerator.kt:88 */
  314    340   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  315    341   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  316    342   
    variable wildcard pattern and check `.code()`:
  317    343   
     \
  318    344   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  319    345   
     \
  320    346   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-EnumQueryError) for what information is available for the error.")]
  321    347   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         348  +
    /* OperationErrorGenerator.kt:81 */
  322    349   
}
         350  +
/* OperationErrorGenerator.kt:218 */
  323    351   
impl EnumQueryError {
         352  +
    /* OperationErrorGenerator.kt:219 */
  324    353   
    /// Creates the `EnumQueryError::Unhandled` variant from any error type.
  325    354   
    pub fn unhandled(
  326    355   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  327    356   
    ) -> Self {
  328    357   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  329    358   
            source: err.into(),
  330    359   
            meta: ::std::default::Default::default(),
  331    360   
        })
  332    361   
    }
  333    362   
  334    363   
    /// Creates the `EnumQueryError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  335    364   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  336    365   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  337    366   
            source: err.clone().into(),
  338    367   
            meta: err,
  339    368   
        })
  340    369   
    }
  341         -
    ///
         370  +
    /// /* OperationErrorGenerator.kt:236 */
  342    371   
    /// Returns error metadata, which includes the error code, message,
  343    372   
    /// request ID, and potentially additional information.
  344    373   
    ///
         374  +
    /* OperationErrorGenerator.kt:242 */
  345    375   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         376  +
        /* OperationErrorGenerator.kt:243 */
  346    377   
        match self {
  347         -
            Self::ValidationError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  348         -
            Self::ExtraError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  349         -
            Self::Unhandled(e) => &e.meta,
         378  +
            /* OperationErrorGenerator.kt:246 */ Self::ValidationError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         379  +
            /* OperationErrorGenerator.kt:246 */ Self::ExtraError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         380  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         381  +
            /* OperationErrorGenerator.kt:243 */
  350    382   
        }
         383  +
        /* OperationErrorGenerator.kt:242 */
  351    384   
    }
         385  +
    /* OperationErrorGenerator.kt:257 */
  352    386   
    /// Returns `true` if the error kind is `EnumQueryError::ValidationError`.
         387  +
    /* OperationErrorGenerator.kt:258 */
  353    388   
    pub fn is_validation_error(&self) -> bool {
         389  +
        /* OperationErrorGenerator.kt:259 */
  354    390   
        matches!(self, Self::ValidationError(_))
         391  +
        /* OperationErrorGenerator.kt:258 */
  355    392   
    }
         393  +
    /* OperationErrorGenerator.kt:257 */
  356    394   
    /// Returns `true` if the error kind is `EnumQueryError::ExtraError`.
         395  +
    /* OperationErrorGenerator.kt:258 */
  357    396   
    pub fn is_extra_error(&self) -> bool {
         397  +
        /* OperationErrorGenerator.kt:259 */
  358    398   
        matches!(self, Self::ExtraError(_))
         399  +
        /* OperationErrorGenerator.kt:258 */
  359    400   
    }
         401  +
    /* OperationErrorGenerator.kt:218 */
  360    402   
}
         403  +
/* OperationErrorGenerator.kt:269 */
  361    404   
impl ::std::error::Error for EnumQueryError {
         405  +
    /* OperationErrorGenerator.kt:270 */
  362    406   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         407  +
        /* OperationErrorGenerator.kt:318 */
  363    408   
        match self {
  364         -
            Self::ValidationError(_inner) => ::std::option::Option::Some(_inner),
  365         -
            Self::ExtraError(_inner) => ::std::option::Option::Some(_inner),
  366         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         409  +
            /* OperationErrorGenerator.kt:321 */
         410  +
            Self::ValidationError(_inner) =>
         411  +
            /* OperationErrorGenerator.kt:283 */
         412  +
            {
         413  +
                ::std::option::Option::Some(_inner)
         414  +
            }
         415  +
            ,
         416  +
            /* OperationErrorGenerator.kt:321 */
         417  +
            Self::ExtraError(_inner) =>
         418  +
            /* OperationErrorGenerator.kt:283 */
         419  +
            {
         420  +
                ::std::option::Option::Some(_inner)
         421  +
            }
         422  +
            ,
         423  +
            /* OperationErrorGenerator.kt:326 */
         424  +
            Self::Unhandled(_inner) => {
         425  +
                /* OperationErrorGenerator.kt:279 */
         426  +
                ::std::option::Option::Some(&*_inner.source)
         427  +
                /* OperationErrorGenerator.kt:326 */
         428  +
            } /* OperationErrorGenerator.kt:318 */
  367    429   
        }
         430  +
        /* OperationErrorGenerator.kt:270 */
  368    431   
    }
         432  +
    /* OperationErrorGenerator.kt:269 */
  369    433   
}
         434  +
/* OperationErrorGenerator.kt:133 */
  370    435   
impl ::std::fmt::Display for EnumQueryError {
         436  +
    /* OperationErrorGenerator.kt:134 */
  371    437   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         438  +
        /* OperationErrorGenerator.kt:318 */
  372    439   
        match self {
  373         -
            Self::ValidationError(_inner) => _inner.fmt(f),
  374         -
            Self::ExtraError(_inner) => _inner.fmt(f),
         440  +
            /* OperationErrorGenerator.kt:321 */
         441  +
            Self::ValidationError(_inner) =>
         442  +
            /* OperationErrorGenerator.kt:151 */
         443  +
            {
         444  +
                _inner.fmt(f)
         445  +
            }
         446  +
            ,
         447  +
            /* OperationErrorGenerator.kt:321 */
         448  +
            Self::ExtraError(_inner) =>
         449  +
            /* OperationErrorGenerator.kt:151 */
         450  +
            {
         451  +
                _inner.fmt(f)
         452  +
            }
         453  +
            ,
         454  +
            /* OperationErrorGenerator.kt:326 */
  375    455   
            Self::Unhandled(_inner) => {
         456  +
                /* OperationErrorGenerator.kt:139 */
  376    457   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  377    458   
                    write!(f, "unhandled error ({code})")
  378    459   
                } else {
  379    460   
                    f.write_str("unhandled error")
  380    461   
                }
  381         -
            }
         462  +
                /* OperationErrorGenerator.kt:326 */
         463  +
            } /* OperationErrorGenerator.kt:318 */
  382    464   
        }
         465  +
        /* OperationErrorGenerator.kt:134 */
  383    466   
    }
         467  +
    /* OperationErrorGenerator.kt:133 */
  384    468   
}
         469  +
/* OperationErrorGenerator.kt:182 */
  385    470   
impl ::aws_smithy_types::retry::ProvideErrorKind for EnumQueryError {
         471  +
    /* OperationErrorGenerator.kt:186 */
  386    472   
    fn code(&self) -> ::std::option::Option<&str> {
         473  +
        /* OperationErrorGenerator.kt:187 */
  387    474   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         475  +
        /* OperationErrorGenerator.kt:186 */
  388    476   
    }
         477  +
    /* OperationErrorGenerator.kt:190 */
  389    478   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         479  +
        /* OperationErrorGenerator.kt:197 */
  390    480   
        ::std::option::Option::None
         481  +
        /* OperationErrorGenerator.kt:190 */
  391    482   
    }
         483  +
    /* OperationErrorGenerator.kt:182 */
  392    484   
}
         485  +
/* OperationErrorGenerator.kt:163 */
  393    486   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for EnumQueryError {
         487  +
    /* OperationErrorGenerator.kt:164 */
  394    488   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         489  +
        /* OperationErrorGenerator.kt:318 */
  395    490   
        match self {
  396         -
            Self::ValidationError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  397         -
            Self::ExtraError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  398         -
            Self::Unhandled(_inner) => &_inner.meta,
         491  +
            /* OperationErrorGenerator.kt:321 */
         492  +
            Self::ValidationError(_inner) =>
         493  +
            /* OperationErrorGenerator.kt:169 */
         494  +
            {
         495  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         496  +
            }
         497  +
            ,
         498  +
            /* OperationErrorGenerator.kt:321 */
         499  +
            Self::ExtraError(_inner) =>
         500  +
            /* OperationErrorGenerator.kt:169 */
         501  +
            {
         502  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         503  +
            }
         504  +
            ,
         505  +
            /* OperationErrorGenerator.kt:326 */
         506  +
            Self::Unhandled(_inner) => {
         507  +
                /* OperationErrorGenerator.kt:168 */
         508  +
                &_inner.meta
         509  +
                /* OperationErrorGenerator.kt:326 */
         510  +
            } /* OperationErrorGenerator.kt:318 */
  399    511   
        }
         512  +
        /* OperationErrorGenerator.kt:164 */
  400    513   
    }
         514  +
    /* OperationErrorGenerator.kt:163 */
  401    515   
}
         516  +
/* OperationErrorGenerator.kt:109 */
  402    517   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for EnumQueryError {
         518  +
    /* OperationErrorGenerator.kt:110 */
  403    519   
    fn create_unhandled_error(
  404    520   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  405    521   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  406    522   
    ) -> Self {
         523  +
        /* OperationErrorGenerator.kt:121 */
  407    524   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  408    525   
            source,
  409    526   
            meta: meta.unwrap_or_default(),
  410    527   
        })
         528  +
        /* OperationErrorGenerator.kt:110 */
  411    529   
    }
         530  +
    /* OperationErrorGenerator.kt:109 */
  412    531   
}
  413    532   
         533  +
/* CodegenDelegator.kt:255 */
  414    534   
pub use crate::operation::enum_query::_enum_query_output::EnumQueryOutput;
  415    535   
         536  +
/* CodegenDelegator.kt:255 */
  416    537   
pub use crate::operation::enum_query::_enum_query_input::EnumQueryInput;
  417    538   
         539  +
/* RustModule.kt:172 */
  418    540   
mod _enum_query_input;
  419    541   
         542  +
/* RustModule.kt:172 */
  420    543   
mod _enum_query_output;
  421    544   
  422         -
/// Builders
         545  +
/// /* CodegenDelegator.kt:51 */Builders
  423    546   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/enum_query/_enum_query_input.rs

@@ -1,1 +48,92 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct EnumQueryInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct EnumQueryInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub r#enum: ::std::option::Option<crate::types::StringEnum>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl EnumQueryInput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn r#enum(&self) -> ::std::option::Option<&crate::types::StringEnum> {
          20  +
        /* StructureGenerator.kt:170 */
   12     21   
        self.r#enum.as_ref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl EnumQueryInput {
   16         -
    /// Creates a new builder-style object to manufacture [`EnumQueryInput`](crate::operation::enum_query::EnumQueryInput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`EnumQueryInput`](crate::operation::enum_query::EnumQueryInput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::enum_query::builders::EnumQueryInputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::enum_query::builders::EnumQueryInputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`EnumQueryInput`](crate::operation::enum_query::EnumQueryInput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`EnumQueryInput`](crate::operation::enum_query::EnumQueryInput).
          39  +
/* RustType.kt:516 */
   23     40   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          41  +
/* RustType.kt:516 */
   24     42   
#[non_exhaustive]
          43  +
/* BuilderGenerator.kt:345 */
   25     44   
pub struct EnumQueryInputBuilder {
   26         -
    pub(crate) r#enum: ::std::option::Option<crate::types::StringEnum>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) r#enum: ::std::option::Option<crate::types::StringEnum>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl EnumQueryInputBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
   30         -
    /// This field is required.
          52  +
    /// /* BuilderGenerator.kt:288 */This field is required.
          53  +
    /* BuilderGenerator.kt:291 */
   31     54   
    pub fn r#enum(mut self, input: crate::types::StringEnum) -> Self {
          55  +
        /* BuilderGenerator.kt:292 */
   32     56   
        self.r#enum = ::std::option::Option::Some(input);
          57  +
        /* BuilderGenerator.kt:293 */
   33     58   
        self
          59  +
        /* BuilderGenerator.kt:291 */
   34     60   
    }
          61  +
    /* BuilderGenerator.kt:312 */
   35     62   
    #[allow(missing_docs)] // documentation missing in model
          63  +
                           /* BuilderGenerator.kt:314 */
   36     64   
    pub fn set_enum(mut self, input: ::std::option::Option<crate::types::StringEnum>) -> Self {
          65  +
        /* BuilderGenerator.kt:315 */
   37     66   
        self.r#enum = input;
   38     67   
        self
          68  +
        /* BuilderGenerator.kt:314 */
   39     69   
    }
          70  +
    /* BuilderGenerator.kt:334 */
   40     71   
    #[allow(missing_docs)] // documentation missing in model
          72  +
                           /* BuilderGenerator.kt:336 */
   41     73   
    pub fn get_enum(&self) -> &::std::option::Option<crate::types::StringEnum> {
          74  +
        /* BuilderGenerator.kt:337 */
   42     75   
        &self.r#enum
          76  +
        /* BuilderGenerator.kt:336 */
   43     77   
    }
   44         -
    /// Consumes the builder and constructs a [`EnumQueryInput`](crate::operation::enum_query::EnumQueryInput).
          78  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`EnumQueryInput`](crate::operation::enum_query::EnumQueryInput).
          79  +
    /* BuilderGenerator.kt:253 */
   45     80   
    pub fn build(self) -> ::std::result::Result<crate::operation::enum_query::EnumQueryInput, ::aws_smithy_types::error::operation::BuildError> {
   46         -
        ::std::result::Result::Ok(crate::operation::enum_query::EnumQueryInput { r#enum: self.r#enum })
          81  +
        /* BuilderGenerator.kt:254 */
          82  +
        ::std::result::Result::Ok(
          83  +
            /* BuilderGenerator.kt:477 */
          84  +
            crate::operation::enum_query::EnumQueryInput {
          85  +
                /* BuilderGenerator.kt:481 */ r#enum: self.r#enum,
          86  +
                /* BuilderGenerator.kt:477 */
          87  +
            }, /* BuilderGenerator.kt:254 */
          88  +
        )
          89  +
        /* BuilderGenerator.kt:253 */
   47     90   
    }
          91  +
    /* BuilderGenerator.kt:355 */
   48     92   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/enum_query/_enum_query_output.rs

@@ -1,1 +22,39 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct EnumQueryOutput {}
           8  +
pub /* StructureGenerator.kt:201 */ struct EnumQueryOutput {/* StructureGenerator.kt:201 */}
           9  +
/* ClientCodegenVisitor.kt:237 */
    6     10   
impl EnumQueryOutput {
    7         -
    /// Creates a new builder-style object to manufacture [`EnumQueryOutput`](crate::operation::enum_query::EnumQueryOutput).
          11  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`EnumQueryOutput`](crate::operation::enum_query::EnumQueryOutput).
          12  +
    /* BuilderGenerator.kt:175 */
    8     13   
    pub fn builder() -> crate::operation::enum_query::builders::EnumQueryOutputBuilder {
          14  +
        /* BuilderGenerator.kt:176 */
    9     15   
        crate::operation::enum_query::builders::EnumQueryOutputBuilder::default()
          16  +
        /* BuilderGenerator.kt:175 */
   10     17   
    }
          18  +
    /* ClientCodegenVisitor.kt:237 */
   11     19   
}
   12     20   
   13         -
/// A builder for [`EnumQueryOutput`](crate::operation::enum_query::EnumQueryOutput).
          21  +
/// /* BuilderGenerator.kt:342 */A builder for [`EnumQueryOutput`](crate::operation::enum_query::EnumQueryOutput).
          22  +
/* RustType.kt:516 */
   14     23   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          24  +
/* RustType.kt:516 */
   15     25   
#[non_exhaustive]
   16         -
pub struct EnumQueryOutputBuilder {}
          26  +
/* BuilderGenerator.kt:345 */
          27  +
pub struct EnumQueryOutputBuilder {/* BuilderGenerator.kt:345 */}
          28  +
/* BuilderGenerator.kt:355 */
   17     29   
impl EnumQueryOutputBuilder {
   18         -
    /// Consumes the builder and constructs a [`EnumQueryOutput`](crate::operation::enum_query::EnumQueryOutput).
          30  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`EnumQueryOutput`](crate::operation::enum_query::EnumQueryOutput).
          31  +
    /* BuilderGenerator.kt:253 */
   19     32   
    pub fn build(self) -> crate::operation::enum_query::EnumQueryOutput {
   20         -
        crate::operation::enum_query::EnumQueryOutput {}
          33  +
        /* BuilderGenerator.kt:477 */
          34  +
        crate::operation::enum_query::EnumQueryOutput {
          35  +
        /* BuilderGenerator.kt:477 */}
          36  +
        /* BuilderGenerator.kt:253 */
   21     37   
    }
          38  +
    /* BuilderGenerator.kt:355 */
   22     39   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/enum_query/builders.rs

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