Server Test

Server Test

rev. 7254d43655ed63111c94f599437f2b0d3f55446e (ignoring whitespace)

Files changed:

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

@@ -1,1 +642,468 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(missing_docs)] // documentation missing in model
    3         -
#[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    4         -
pub struct HttpQueryParamsOnlyOperationInput {
    5         -
    #[allow(missing_docs)] // documentation missing in model
    6         -
    pub query_map: ::std::option::Option<
    7         -
        ::std::collections::HashMap<::std::string::String, ::std::string::String>,
    8         -
    >,
    9         -
}
   10         -
impl HttpQueryParamsOnlyOperationInput {
   11         -
    #[allow(missing_docs)] // documentation missing in model
   12         -
    pub fn query_map(
   13         -
        &self,
   14         -
    ) -> ::std::option::Option<
   15         -
        &::std::collections::HashMap<::std::string::String, ::std::string::String>,
   16         -
    > {
   17         -
        self.query_map.as_ref()
   18         -
    }
   19         -
}
   20         -
impl HttpQueryParamsOnlyOperationInput {
   21         -
    /// Creates a new builder-style object to manufacture [`HttpQueryParamsOnlyOperationInput`](crate::input::HttpQueryParamsOnlyOperationInput).
   22         -
    pub fn builder() -> crate::input::http_query_params_only_operation_input::Builder {
   23         -
        crate::input::http_query_params_only_operation_input::Builder::default()
   24         -
    }
   25         -
}
   26         -
impl crate::constrained::Constrained for crate::input::HttpQueryParamsOnlyOperationInput {
   27         -
    type Unconstrained = crate::input::http_query_params_only_operation_input::Builder;
   28         -
}
   29         -
   30         -
#[allow(missing_docs)] // documentation missing in model
   31         -
#[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
   32         -
pub struct QueryPrecedenceInput {
   33         -
    #[allow(missing_docs)] // documentation missing in model
   34         -
    pub foo: ::std::option::Option<::std::string::String>,
   35         -
    #[allow(missing_docs)] // documentation missing in model
   36         -
    pub baz: ::std::option::Option<
   37         -
        ::std::collections::HashMap<::std::string::String, ::std::string::String>,
   38         -
    >,
   39         -
}
   40         -
impl QueryPrecedenceInput {
   41         -
    #[allow(missing_docs)] // documentation missing in model
   42         -
    pub fn foo(&self) -> ::std::option::Option<&str> {
   43         -
        self.foo.as_deref()
   44         -
    }
   45         -
    #[allow(missing_docs)] // documentation missing in model
   46         -
    pub fn baz(
   47         -
        &self,
   48         -
    ) -> ::std::option::Option<
   49         -
        &::std::collections::HashMap<::std::string::String, ::std::string::String>,
   50         -
    > {
   51         -
        self.baz.as_ref()
   52         -
    }
   53         -
}
   54         -
impl QueryPrecedenceInput {
   55         -
    /// Creates a new builder-style object to manufacture [`QueryPrecedenceInput`](crate::input::QueryPrecedenceInput).
   56         -
    pub fn builder() -> crate::input::query_precedence_input::Builder {
   57         -
        crate::input::query_precedence_input::Builder::default()
   58         -
    }
   59         -
}
   60         -
impl crate::constrained::Constrained for crate::input::QueryPrecedenceInput {
   61         -
    type Unconstrained = crate::input::query_precedence_input::Builder;
   62         -
}
   63         -
   64      2   
#[allow(missing_docs)] // documentation missing in model
   65      3   
#[derive(
   66      4   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   67      5   
)]
   68         -
pub struct EmptyStructWithContentOnWireOpInput {}
   69         -
impl EmptyStructWithContentOnWireOpInput {
   70         -
    /// Creates a new builder-style object to manufacture [`EmptyStructWithContentOnWireOpInput`](crate::input::EmptyStructWithContentOnWireOpInput).
   71         -
    pub fn builder() -> crate::input::empty_struct_with_content_on_wire_op_input::Builder {
   72         -
        crate::input::empty_struct_with_content_on_wire_op_input::Builder::default()
   73         -
    }
           6  +
pub struct StringPayloadInput {
           7  +
    #[allow(missing_docs)] // documentation missing in model
           8  +
    pub payload: ::std::option::Option<::std::string::String>,
   74      9   
}
   75         -
impl crate::constrained::Constrained for crate::input::EmptyStructWithContentOnWireOpInput {
   76         -
    type Unconstrained = crate::input::empty_struct_with_content_on_wire_op_input::Builder;
          10  +
impl StringPayloadInput {
          11  +
    #[allow(missing_docs)] // documentation missing in model
          12  +
    pub fn payload(&self) -> ::std::option::Option<&str> {
          13  +
        self.payload.as_deref()
          14  +
    }
   77     15   
}
   78         -
   79         -
#[allow(missing_docs)] // documentation missing in model
   80         -
#[derive(
   81         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   82         -
)]
   83         -
pub struct CaseInsensitiveErrorOperationInput {}
   84         -
impl CaseInsensitiveErrorOperationInput {
   85         -
    /// Creates a new builder-style object to manufacture [`CaseInsensitiveErrorOperationInput`](crate::input::CaseInsensitiveErrorOperationInput).
   86         -
    pub fn builder() -> crate::input::case_insensitive_error_operation_input::Builder {
   87         -
        crate::input::case_insensitive_error_operation_input::Builder::default()
          16  +
impl StringPayloadInput {
          17  +
    /// Creates a new builder-style object to manufacture [`StringPayloadInput`](crate::input::StringPayloadInput).
          18  +
    pub fn builder() -> crate::input::string_payload_input::Builder {
          19  +
        crate::input::string_payload_input::Builder::default()
   88     20   
    }
   89     21   
}
   90         -
impl crate::constrained::Constrained for crate::input::CaseInsensitiveErrorOperationInput {
   91         -
    type Unconstrained = crate::input::case_insensitive_error_operation_input::Builder;
          22  +
impl crate::constrained::Constrained for crate::input::StringPayloadInput {
          23  +
    type Unconstrained = crate::input::string_payload_input::Builder;
   92     24   
}
   93     25   
   94     26   
#[allow(missing_docs)] // documentation missing in model
   95     27   
#[derive(
   96     28   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   97     29   
)]
   98         -
pub struct NullInNonSparseInput {}
   99         -
impl NullInNonSparseInput {
  100         -
    /// Creates a new builder-style object to manufacture [`NullInNonSparseInput`](crate::input::NullInNonSparseInput).
  101         -
    pub fn builder() -> crate::input::null_in_non_sparse_input::Builder {
  102         -
        crate::input::null_in_non_sparse_input::Builder::default()
          30  +
pub struct PrimitiveIntHeaderInput {}
          31  +
impl PrimitiveIntHeaderInput {
          32  +
    /// Creates a new builder-style object to manufacture [`PrimitiveIntHeaderInput`](crate::input::PrimitiveIntHeaderInput).
          33  +
    pub fn builder() -> crate::input::primitive_int_header_input::Builder {
          34  +
        crate::input::primitive_int_header_input::Builder::default()
  103     35   
    }
  104     36   
}
  105         -
impl crate::constrained::Constrained for crate::input::NullInNonSparseInput {
  106         -
    type Unconstrained = crate::input::null_in_non_sparse_input::Builder;
          37  +
impl crate::constrained::Constrained for crate::input::PrimitiveIntHeaderInput {
          38  +
    type Unconstrained = crate::input::primitive_int_header_input::Builder;
  107     39   
}
  108     40   
  109     41   
#[allow(missing_docs)] // documentation missing in model
  110     42   
#[derive(
  111     43   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  112     44   
)]
  113         -
pub struct EscapedStringValuesInput {
  114         -
    #[allow(missing_docs)] // documentation missing in model
  115         -
    pub r#enum: ::std::option::Option<crate::model::EnumWithEscapedChars>,
          45  +
pub struct EnumQueryInput {
  116     46   
    #[allow(missing_docs)] // documentation missing in model
  117         -
    pub some_string: ::std::option::Option<::std::string::String>,
          47  +
    pub r#enum: crate::model::StringEnum,
  118     48   
}
  119         -
impl EscapedStringValuesInput {
  120         -
    #[allow(missing_docs)] // documentation missing in model
  121         -
    pub fn r#enum(&self) -> ::std::option::Option<&crate::model::EnumWithEscapedChars> {
  122         -
        self.r#enum.as_ref()
  123         -
    }
          49  +
impl EnumQueryInput {
  124     50   
    #[allow(missing_docs)] // documentation missing in model
  125         -
    pub fn some_string(&self) -> ::std::option::Option<&str> {
  126         -
        self.some_string.as_deref()
          51  +
    pub fn r#enum(&self) -> &crate::model::StringEnum {
          52  +
        &self.r#enum
  127     53   
    }
  128     54   
}
  129         -
impl EscapedStringValuesInput {
  130         -
    /// Creates a new builder-style object to manufacture [`EscapedStringValuesInput`](crate::input::EscapedStringValuesInput).
  131         -
    pub fn builder() -> crate::input::escaped_string_values_input::Builder {
  132         -
        crate::input::escaped_string_values_input::Builder::default()
          55  +
impl EnumQueryInput {
          56  +
    /// Creates a new builder-style object to manufacture [`EnumQueryInput`](crate::input::EnumQueryInput).
          57  +
    pub fn builder() -> crate::input::enum_query_input::Builder {
          58  +
        crate::input::enum_query_input::Builder::default()
  133     59   
    }
  134     60   
}
  135         -
impl crate::constrained::Constrained for crate::input::EscapedStringValuesInput {
  136         -
    type Unconstrained = crate::input::escaped_string_values_input::Builder;
          61  +
impl crate::constrained::Constrained for crate::input::EnumQueryInput {
          62  +
    type Unconstrained = crate::input::enum_query_input::Builder;
  137     63   
}
  138     64   
  139     65   
#[allow(missing_docs)] // documentation missing in model
  140     66   
#[derive(
  141     67   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  142     68   
)]
  143         -
pub struct PrimitiveIntOpInput {
  144         -
    #[allow(missing_docs)] // documentation missing in model
  145         -
    pub value: i32,
  146         -
}
  147         -
impl PrimitiveIntOpInput {
  148         -
    #[allow(missing_docs)] // documentation missing in model
  149         -
    pub fn value(&self) -> i32 {
  150         -
        self.value
  151         -
    }
  152         -
}
  153         -
impl PrimitiveIntOpInput {
  154         -
    /// Creates a new builder-style object to manufacture [`PrimitiveIntOpInput`](crate::input::PrimitiveIntOpInput).
  155         -
    pub fn builder() -> crate::input::primitive_int_op_input::Builder {
  156         -
        crate::input::primitive_int_op_input::Builder::default()
          69  +
pub struct StatusResponseInput {}
          70  +
impl StatusResponseInput {
          71  +
    /// Creates a new builder-style object to manufacture [`StatusResponseInput`](crate::input::StatusResponseInput).
          72  +
    pub fn builder() -> crate::input::status_response_input::Builder {
          73  +
        crate::input::status_response_input::Builder::default()
  157     74   
    }
  158     75   
}
  159         -
impl crate::constrained::Constrained for crate::input::PrimitiveIntOpInput {
  160         -
    type Unconstrained = crate::input::primitive_int_op_input::Builder;
          76  +
impl crate::constrained::Constrained for crate::input::StatusResponseInput {
          77  +
    type Unconstrained = crate::input::status_response_input::Builder;
  161     78   
}
  162     79   
  163     80   
#[allow(missing_docs)] // documentation missing in model
  164     81   
#[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
  165     82   
pub struct MapWithEnumKeyOpInput {
  166     83   
    #[allow(missing_docs)] // documentation missing in model
  167     84   
    pub map: ::std::option::Option<
  168     85   
        ::std::collections::HashMap<crate::model::StringEnum, ::std::string::String>,
  169     86   
    >,
  170     87   
}
  171     88   
impl MapWithEnumKeyOpInput {
  172     89   
    #[allow(missing_docs)] // documentation missing in model
  173     90   
    pub fn map(
  174     91   
        &self,
  175     92   
    ) -> ::std::option::Option<
  176     93   
        &::std::collections::HashMap<crate::model::StringEnum, ::std::string::String>,
  177     94   
    > {
  178     95   
        self.map.as_ref()
  179     96   
    }
  180     97   
}
  181     98   
impl MapWithEnumKeyOpInput {
  182     99   
    /// Creates a new builder-style object to manufacture [`MapWithEnumKeyOpInput`](crate::input::MapWithEnumKeyOpInput).
  183    100   
    pub fn builder() -> crate::input::map_with_enum_key_op_input::Builder {
  184    101   
        crate::input::map_with_enum_key_op_input::Builder::default()
  185    102   
    }
  186    103   
}
  187    104   
impl crate::constrained::Constrained for crate::input::MapWithEnumKeyOpInput {
  188    105   
    type Unconstrained = crate::input::map_with_enum_key_op_input::Builder;
  189    106   
}
  190    107   
  191    108   
#[allow(missing_docs)] // documentation missing in model
  192    109   
#[derive(
  193    110   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  194    111   
)]
  195         -
pub struct StatusResponseInput {}
  196         -
impl StatusResponseInput {
  197         -
    /// Creates a new builder-style object to manufacture [`StatusResponseInput`](crate::input::StatusResponseInput).
  198         -
    pub fn builder() -> crate::input::status_response_input::Builder {
  199         -
        crate::input::status_response_input::Builder::default()
         112  +
pub struct PrimitiveIntOpInput {
         113  +
    #[allow(missing_docs)] // documentation missing in model
         114  +
    pub value: i32,
         115  +
}
         116  +
impl PrimitiveIntOpInput {
         117  +
    #[allow(missing_docs)] // documentation missing in model
         118  +
    pub fn value(&self) -> i32 {
         119  +
        self.value
  200    120   
    }
  201    121   
}
  202         -
impl crate::constrained::Constrained for crate::input::StatusResponseInput {
  203         -
    type Unconstrained = crate::input::status_response_input::Builder;
         122  +
impl PrimitiveIntOpInput {
         123  +
    /// Creates a new builder-style object to manufacture [`PrimitiveIntOpInput`](crate::input::PrimitiveIntOpInput).
         124  +
    pub fn builder() -> crate::input::primitive_int_op_input::Builder {
         125  +
        crate::input::primitive_int_op_input::Builder::default()
         126  +
    }
         127  +
}
         128  +
impl crate::constrained::Constrained for crate::input::PrimitiveIntOpInput {
         129  +
    type Unconstrained = crate::input::primitive_int_op_input::Builder;
  204    130   
}
  205    131   
  206    132   
#[allow(missing_docs)] // documentation missing in model
  207    133   
#[derive(
  208    134   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  209    135   
)]
  210         -
pub struct EnumQueryInput {
         136  +
pub struct EscapedStringValuesInput {
  211    137   
    #[allow(missing_docs)] // documentation missing in model
  212         -
    pub r#enum: crate::model::StringEnum,
         138  +
    pub r#enum: ::std::option::Option<crate::model::EnumWithEscapedChars>,
         139  +
    #[allow(missing_docs)] // documentation missing in model
         140  +
    pub some_string: ::std::option::Option<::std::string::String>,
  213    141   
}
  214         -
impl EnumQueryInput {
         142  +
impl EscapedStringValuesInput {
  215    143   
    #[allow(missing_docs)] // documentation missing in model
  216         -
    pub fn r#enum(&self) -> &crate::model::StringEnum {
  217         -
        &self.r#enum
         144  +
    pub fn r#enum(&self) -> ::std::option::Option<&crate::model::EnumWithEscapedChars> {
         145  +
        self.r#enum.as_ref()
         146  +
    }
         147  +
    #[allow(missing_docs)] // documentation missing in model
         148  +
    pub fn some_string(&self) -> ::std::option::Option<&str> {
         149  +
        self.some_string.as_deref()
  218    150   
    }
  219    151   
}
  220         -
impl EnumQueryInput {
  221         -
    /// Creates a new builder-style object to manufacture [`EnumQueryInput`](crate::input::EnumQueryInput).
  222         -
    pub fn builder() -> crate::input::enum_query_input::Builder {
  223         -
        crate::input::enum_query_input::Builder::default()
         152  +
impl EscapedStringValuesInput {
         153  +
    /// Creates a new builder-style object to manufacture [`EscapedStringValuesInput`](crate::input::EscapedStringValuesInput).
         154  +
    pub fn builder() -> crate::input::escaped_string_values_input::Builder {
         155  +
        crate::input::escaped_string_values_input::Builder::default()
  224    156   
    }
  225    157   
}
  226         -
impl crate::constrained::Constrained for crate::input::EnumQueryInput {
  227         -
    type Unconstrained = crate::input::enum_query_input::Builder;
         158  +
impl crate::constrained::Constrained for crate::input::EscapedStringValuesInput {
         159  +
    type Unconstrained = crate::input::escaped_string_values_input::Builder;
  228    160   
}
  229    161   
  230    162   
#[allow(missing_docs)] // documentation missing in model
  231    163   
#[derive(
  232    164   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  233    165   
)]
  234         -
pub struct PrimitiveIntHeaderInput {}
  235         -
impl PrimitiveIntHeaderInput {
  236         -
    /// Creates a new builder-style object to manufacture [`PrimitiveIntHeaderInput`](crate::input::PrimitiveIntHeaderInput).
  237         -
    pub fn builder() -> crate::input::primitive_int_header_input::Builder {
  238         -
        crate::input::primitive_int_header_input::Builder::default()
         166  +
pub struct NullInNonSparseInput {}
         167  +
impl NullInNonSparseInput {
         168  +
    /// Creates a new builder-style object to manufacture [`NullInNonSparseInput`](crate::input::NullInNonSparseInput).
         169  +
    pub fn builder() -> crate::input::null_in_non_sparse_input::Builder {
         170  +
        crate::input::null_in_non_sparse_input::Builder::default()
  239    171   
    }
  240    172   
}
  241         -
impl crate::constrained::Constrained for crate::input::PrimitiveIntHeaderInput {
  242         -
    type Unconstrained = crate::input::primitive_int_header_input::Builder;
         173  +
impl crate::constrained::Constrained for crate::input::NullInNonSparseInput {
         174  +
    type Unconstrained = crate::input::null_in_non_sparse_input::Builder;
  243    175   
}
  244    176   
  245    177   
#[allow(missing_docs)] // documentation missing in model
  246    178   
#[derive(
  247    179   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  248    180   
)]
  249         -
pub struct StringPayloadInput {
  250         -
    #[allow(missing_docs)] // documentation missing in model
  251         -
    pub payload: ::std::option::Option<::std::string::String>,
  252         -
}
  253         -
impl StringPayloadInput {
  254         -
    #[allow(missing_docs)] // documentation missing in model
  255         -
    pub fn payload(&self) -> ::std::option::Option<&str> {
  256         -
        self.payload.as_deref()
         181  +
pub struct CaseInsensitiveErrorOperationInput {}
         182  +
impl CaseInsensitiveErrorOperationInput {
         183  +
    /// Creates a new builder-style object to manufacture [`CaseInsensitiveErrorOperationInput`](crate::input::CaseInsensitiveErrorOperationInput).
         184  +
    pub fn builder() -> crate::input::case_insensitive_error_operation_input::Builder {
         185  +
        crate::input::case_insensitive_error_operation_input::Builder::default()
  257    186   
    }
  258    187   
}
  259         -
impl StringPayloadInput {
  260         -
    /// Creates a new builder-style object to manufacture [`StringPayloadInput`](crate::input::StringPayloadInput).
  261         -
    pub fn builder() -> crate::input::string_payload_input::Builder {
  262         -
        crate::input::string_payload_input::Builder::default()
         188  +
impl crate::constrained::Constrained for crate::input::CaseInsensitiveErrorOperationInput {
         189  +
    type Unconstrained = crate::input::case_insensitive_error_operation_input::Builder;
         190  +
}
         191  +
         192  +
#[allow(missing_docs)] // documentation missing in model
         193  +
#[derive(
         194  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         195  +
)]
         196  +
pub struct EmptyStructWithContentOnWireOpInput {}
         197  +
impl EmptyStructWithContentOnWireOpInput {
         198  +
    /// Creates a new builder-style object to manufacture [`EmptyStructWithContentOnWireOpInput`](crate::input::EmptyStructWithContentOnWireOpInput).
         199  +
    pub fn builder() -> crate::input::empty_struct_with_content_on_wire_op_input::Builder {
         200  +
        crate::input::empty_struct_with_content_on_wire_op_input::Builder::default()
  263    201   
    }
  264    202   
}
  265         -
impl crate::constrained::Constrained for crate::input::StringPayloadInput {
  266         -
    type Unconstrained = crate::input::string_payload_input::Builder;
         203  +
impl crate::constrained::Constrained for crate::input::EmptyStructWithContentOnWireOpInput {
         204  +
    type Unconstrained = crate::input::empty_struct_with_content_on_wire_op_input::Builder;
  267    205   
}
  268         -
/// See [`HttpQueryParamsOnlyOperationInput`](crate::input::HttpQueryParamsOnlyOperationInput).
  269         -
pub mod http_query_params_only_operation_input {
  270    206   
  271         -
    impl ::std::convert::From<Builder> for crate::input::HttpQueryParamsOnlyOperationInput {
  272         -
        fn from(builder: Builder) -> Self {
  273         -
            builder.build()
  274         -
        }
  275         -
    }
  276         -
    /// A builder for [`HttpQueryParamsOnlyOperationInput`](crate::input::HttpQueryParamsOnlyOperationInput).
  277         -
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  278         -
    pub struct Builder {
  279         -
        pub(crate) query_map: ::std::option::Option<
  280         -
            ::std::collections::HashMap<::std::string::String, ::std::string::String>,
  281         -
        >,
  282         -
    }
  283         -
    impl Builder {
         207  +
#[allow(missing_docs)] // documentation missing in model
         208  +
#[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
         209  +
pub struct QueryPrecedenceInput {
  284    210   
    #[allow(missing_docs)] // documentation missing in model
  285         -
        pub fn query_map(
  286         -
            mut self,
  287         -
            input: ::std::option::Option<
  288         -
                ::std::collections::HashMap<::std::string::String, ::std::string::String>,
  289         -
            >,
  290         -
        ) -> Self {
  291         -
            self.query_map = input;
  292         -
            self
  293         -
        }
         211  +
    pub foo: ::std::option::Option<::std::string::String>,
  294    212   
    #[allow(missing_docs)] // documentation missing in model
  295         -
        pub(crate) fn set_query_map(
  296         -
            mut self,
  297         -
            input: Option<
  298         -
                impl ::std::convert::Into<
         213  +
    pub baz: ::std::option::Option<
  299    214   
        ::std::collections::HashMap<::std::string::String, ::std::string::String>,
  300    215   
    >,
  301         -
            >,
  302         -
        ) -> Self {
  303         -
            self.query_map = input.map(|v| v.into());
  304         -
            self
  305         -
        }
  306         -
        /// Consumes the builder and constructs a [`HttpQueryParamsOnlyOperationInput`](crate::input::HttpQueryParamsOnlyOperationInput).
  307         -
        pub fn build(self) -> crate::input::HttpQueryParamsOnlyOperationInput {
  308         -
            self.build_enforcing_all_constraints()
  309         -
        }
  310         -
        fn build_enforcing_all_constraints(
  311         -
            self,
  312         -
        ) -> crate::input::HttpQueryParamsOnlyOperationInput {
  313         -
            crate::input::HttpQueryParamsOnlyOperationInput {
  314         -
                query_map: self.query_map,
         216  +
}
         217  +
impl QueryPrecedenceInput {
         218  +
    #[allow(missing_docs)] // documentation missing in model
         219  +
    pub fn foo(&self) -> ::std::option::Option<&str> {
         220  +
        self.foo.as_deref()
  315    221   
    }
         222  +
    #[allow(missing_docs)] // documentation missing in model
         223  +
    pub fn baz(
         224  +
        &self,
         225  +
    ) -> ::std::option::Option<
         226  +
        &::std::collections::HashMap<::std::string::String, ::std::string::String>,
         227  +
    > {
         228  +
        self.baz.as_ref()
  316    229   
    }
         230  +
}
         231  +
impl QueryPrecedenceInput {
         232  +
    /// Creates a new builder-style object to manufacture [`QueryPrecedenceInput`](crate::input::QueryPrecedenceInput).
         233  +
    pub fn builder() -> crate::input::query_precedence_input::Builder {
         234  +
        crate::input::query_precedence_input::Builder::default()
  317    235   
    }
  318    236   
}
  319         -
/// See [`QueryPrecedenceInput`](crate::input::QueryPrecedenceInput).
  320         -
pub mod query_precedence_input {
         237  +
impl crate::constrained::Constrained for crate::input::QueryPrecedenceInput {
         238  +
    type Unconstrained = crate::input::query_precedence_input::Builder;
         239  +
}
         240  +
/// See [`StringPayloadInput`](crate::input::StringPayloadInput).
         241  +
pub mod string_payload_input {
  321    242   
  322         -
    impl ::std::convert::From<Builder> for crate::input::QueryPrecedenceInput {
         243  +
    impl ::std::convert::From<Builder> for crate::input::StringPayloadInput {
  323    244   
        fn from(builder: Builder) -> Self {
  324    245   
            builder.build()
  325    246   
        }
  326    247   
    }
  327         -
    /// A builder for [`QueryPrecedenceInput`](crate::input::QueryPrecedenceInput).
         248  +
    /// A builder for [`StringPayloadInput`](crate::input::StringPayloadInput).
  328    249   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  329    250   
    pub struct Builder {
  330         -
        pub(crate) foo: ::std::option::Option<::std::string::String>,
  331         -
        pub(crate) baz: ::std::option::Option<
  332         -
            ::std::collections::HashMap<::std::string::String, ::std::string::String>,
  333         -
        >,
         251  +
        pub(crate) payload: ::std::option::Option<::std::string::String>,
  334    252   
    }
  335    253   
    impl Builder {
  336    254   
        #[allow(missing_docs)] // documentation missing in model
  337         -
        pub fn foo(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  338         -
            self.foo = input;
         255  +
        pub fn payload(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         256  +
            self.payload = input;
  339    257   
            self
  340    258   
        }
  341    259   
        #[allow(missing_docs)] // documentation missing in model
  342         -
        pub(crate) fn set_foo(
         260  +
        pub(crate) fn set_payload(
  343    261   
            mut self,
  344    262   
            input: Option<impl ::std::convert::Into<::std::string::String>>,
  345    263   
        ) -> Self {
  346         -
            self.foo = input.map(|v| v.into());
  347         -
            self
  348         -
        }
  349         -
        #[allow(missing_docs)] // documentation missing in model
  350         -
        pub fn baz(
  351         -
            mut self,
  352         -
            input: ::std::option::Option<
  353         -
                ::std::collections::HashMap<::std::string::String, ::std::string::String>,
  354         -
            >,
  355         -
        ) -> Self {
  356         -
            self.baz = input;
  357         -
            self
  358         -
        }
  359         -
        #[allow(missing_docs)] // documentation missing in model
  360         -
        pub(crate) fn set_baz(
  361         -
            mut self,
  362         -
            input: Option<
  363         -
                impl ::std::convert::Into<
  364         -
                    ::std::collections::HashMap<::std::string::String, ::std::string::String>,
  365         -
                >,
  366         -
            >,
  367         -
        ) -> Self {
  368         -
            self.baz = input.map(|v| v.into());
         264  +
            self.payload = input.map(|v| v.into());
  369    265   
            self
  370    266   
        }
  371         -
        /// Consumes the builder and constructs a [`QueryPrecedenceInput`](crate::input::QueryPrecedenceInput).
  372         -
        pub fn build(self) -> crate::input::QueryPrecedenceInput {
  373         -
            self.build_enforcing_all_constraints()
  374         -
        }
  375         -
        fn build_enforcing_all_constraints(self) -> crate::input::QueryPrecedenceInput {
  376         -
            crate::input::QueryPrecedenceInput {
  377         -
                foo: self.foo,
  378         -
                baz: self.baz,
  379         -
            }
  380         -
        }
  381         -
    }
  382         -
}
  383         -
/// See [`EmptyStructWithContentOnWireOpInput`](crate::input::EmptyStructWithContentOnWireOpInput).
  384         -
pub mod empty_struct_with_content_on_wire_op_input {
  385         -
  386         -
    impl ::std::convert::From<Builder> for crate::input::EmptyStructWithContentOnWireOpInput {
  387         -
        fn from(builder: Builder) -> Self {
  388         -
            builder.build()
  389         -
        }
  390         -
    }
  391         -
    /// A builder for [`EmptyStructWithContentOnWireOpInput`](crate::input::EmptyStructWithContentOnWireOpInput).
  392         -
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  393         -
    pub struct Builder {}
  394         -
    impl Builder {
  395         -
        /// Consumes the builder and constructs a [`EmptyStructWithContentOnWireOpInput`](crate::input::EmptyStructWithContentOnWireOpInput).
  396         -
        pub fn build(self) -> crate::input::EmptyStructWithContentOnWireOpInput {
         267  +
        /// Consumes the builder and constructs a [`StringPayloadInput`](crate::input::StringPayloadInput).
         268  +
        pub fn build(self) -> crate::input::StringPayloadInput {
  397    269   
            self.build_enforcing_all_constraints()
  398    270   
        }
  399         -
        fn build_enforcing_all_constraints(
  400         -
            self,
  401         -
        ) -> crate::input::EmptyStructWithContentOnWireOpInput {
  402         -
            crate::input::EmptyStructWithContentOnWireOpInput {}
  403         -
        }
  404         -
    }
  405         -
}
  406         -
/// See [`CaseInsensitiveErrorOperationInput`](crate::input::CaseInsensitiveErrorOperationInput).
  407         -
pub mod case_insensitive_error_operation_input {
  408         -
  409         -
    impl ::std::convert::From<Builder> for crate::input::CaseInsensitiveErrorOperationInput {
  410         -
        fn from(builder: Builder) -> Self {
  411         -
            builder.build()
  412         -
        }
  413         -
    }
  414         -
    /// A builder for [`CaseInsensitiveErrorOperationInput`](crate::input::CaseInsensitiveErrorOperationInput).
  415         -
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  416         -
    pub struct Builder {}
  417         -
    impl Builder {
  418         -
        /// Consumes the builder and constructs a [`CaseInsensitiveErrorOperationInput`](crate::input::CaseInsensitiveErrorOperationInput).
  419         -
        pub fn build(self) -> crate::input::CaseInsensitiveErrorOperationInput {
  420         -
            self.build_enforcing_all_constraints()
         271  +
        fn build_enforcing_all_constraints(self) -> crate::input::StringPayloadInput {
         272  +
            crate::input::StringPayloadInput {
         273  +
                payload: self.payload,
  421    274   
            }
  422         -
        fn build_enforcing_all_constraints(
  423         -
            self,
  424         -
        ) -> crate::input::CaseInsensitiveErrorOperationInput {
  425         -
            crate::input::CaseInsensitiveErrorOperationInput {}
  426    275   
        }
  427    276   
    }
  428    277   
}
  429         -
/// See [`NullInNonSparseInput`](crate::input::NullInNonSparseInput).
  430         -
pub mod null_in_non_sparse_input {
         278  +
/// See [`PrimitiveIntHeaderInput`](crate::input::PrimitiveIntHeaderInput).
         279  +
pub mod primitive_int_header_input {
  431    280   
  432         -
    impl ::std::convert::From<Builder> for crate::input::NullInNonSparseInput {
         281  +
    impl ::std::convert::From<Builder> for crate::input::PrimitiveIntHeaderInput {
  433    282   
        fn from(builder: Builder) -> Self {
  434    283   
            builder.build()
  435    284   
        }
  436    285   
    }
  437         -
    /// A builder for [`NullInNonSparseInput`](crate::input::NullInNonSparseInput).
         286  +
    /// A builder for [`PrimitiveIntHeaderInput`](crate::input::PrimitiveIntHeaderInput).
  438    287   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  439    288   
    pub struct Builder {}
  440    289   
    impl Builder {
  441         -
        /// Consumes the builder and constructs a [`NullInNonSparseInput`](crate::input::NullInNonSparseInput).
  442         -
        pub fn build(self) -> crate::input::NullInNonSparseInput {
         290  +
        /// Consumes the builder and constructs a [`PrimitiveIntHeaderInput`](crate::input::PrimitiveIntHeaderInput).
         291  +
        pub fn build(self) -> crate::input::PrimitiveIntHeaderInput {
  443    292   
            self.build_enforcing_all_constraints()
  444    293   
        }
  445         -
        fn build_enforcing_all_constraints(self) -> crate::input::NullInNonSparseInput {
  446         -
            crate::input::NullInNonSparseInput {}
         294  +
        fn build_enforcing_all_constraints(self) -> crate::input::PrimitiveIntHeaderInput {
         295  +
            crate::input::PrimitiveIntHeaderInput {}
  447    296   
        }
  448    297   
    }
  449    298   
}
  450         -
/// See [`EscapedStringValuesInput`](crate::input::EscapedStringValuesInput).
  451         -
pub mod escaped_string_values_input {
         299  +
/// See [`EnumQueryInput`](crate::input::EnumQueryInput).
         300  +
pub mod enum_query_input {
  452    301   
  453    302   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  454    303   
    /// Holds one variant for each of the ways the builder can fail.
  455    304   
    #[non_exhaustive]
  456    305   
    #[allow(clippy::enum_variant_names)]
  457    306   
    pub enum ConstraintViolation {
  458         -
        /// Constraint violation occurred building member `r#enum` when building `EscapedStringValuesInput`.
         307  +
        /// `r#enum` was not provided but it is required when building `EnumQueryInput`.
         308  +
        MissingEnum,
         309  +
        /// Constraint violation occurred building member `r#enum` when building `EnumQueryInput`.
  459    310   
        #[doc(hidden)]
  460         -
        Enum(crate::model::enum_with_escaped_chars::ConstraintViolation),
         311  +
        Enum(crate::model::string_enum::ConstraintViolation),
  461    312   
    }
  462    313   
    impl ::std::fmt::Display for ConstraintViolation {
  463    314   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  464    315   
            match self {
  465         -
                ConstraintViolation::Enum(_) => write!(f, "constraint violation occurred building member `r#enum` when building `EscapedStringValuesInput`"),
         316  +
                ConstraintViolation::MissingEnum => write!(f, "`r#enum` was not provided but it is required when building `EnumQueryInput`"),
         317  +
                ConstraintViolation::Enum(_) => write!(f, "constraint violation occurred building member `r#enum` when building `EnumQueryInput`"),
  466    318   
            }
  467    319   
        }
  468    320   
    }
  469    321   
    impl ::std::error::Error for ConstraintViolation {}
  470    322   
    impl ConstraintViolation {
  471    323   
        pub(crate) fn as_validation_exception_field(
  472    324   
            self,
  473    325   
            path: ::std::string::String,
  474    326   
        ) -> crate::model::ValidationExceptionField {
  475    327   
            match self {
         328  +
                ConstraintViolation::MissingEnum => crate::model::ValidationExceptionField {
         329  +
                    message: format!(
         330  +
                        "Value at '{}/enum' failed to satisfy constraint: Member must not be null",
         331  +
                        path
         332  +
                    ),
         333  +
                    path: path + "/enum",
         334  +
                },
  476    335   
                ConstraintViolation::Enum(inner) => {
  477    336   
                    inner.as_validation_exception_field(path + "/enum")
  478    337   
                }
  479    338   
            }
  480    339   
        }
  481    340   
    }
  482    341   
    impl ::std::convert::From<ConstraintViolation>
  483    342   
        for ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection
  484    343   
    {
  485    344   
        fn from(constraint_violation: ConstraintViolation) -> Self {
  486    345   
            let first_validation_exception_field =
  487    346   
                constraint_violation.as_validation_exception_field("".to_owned());
  488    347   
            let validation_exception = crate::error::ValidationException {
  489    348   
                message: format!(
  490    349   
                    "1 validation error detected. {}",
  491    350   
                    &first_validation_exception_field.message
  492    351   
                ),
  493    352   
                field_list: Some(vec![first_validation_exception_field]),
  494    353   
            };
  495    354   
            Self::ConstraintViolation(
  496    355   
                                crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
  497    356   
                                    .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
  498    357   
                            )
  499    358   
        }
  500    359   
    }
  501    360   
    impl ::std::convert::From<Builder>
  502         -
        for crate::constrained::MaybeConstrained<crate::input::EscapedStringValuesInput>
         361  +
        for crate::constrained::MaybeConstrained<crate::input::EnumQueryInput>
  503    362   
    {
  504    363   
        fn from(builder: Builder) -> Self {
  505    364   
            Self::Unconstrained(builder)
  506    365   
        }
  507    366   
    }
  508         -
    impl ::std::convert::TryFrom<Builder> for crate::input::EscapedStringValuesInput {
         367  +
    impl ::std::convert::TryFrom<Builder> for crate::input::EnumQueryInput {
  509    368   
        type Error = ConstraintViolation;
  510    369   
  511    370   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  512    371   
            builder.build()
  513    372   
        }
  514    373   
    }
  515         -
    /// A builder for [`EscapedStringValuesInput`](crate::input::EscapedStringValuesInput).
         374  +
    /// A builder for [`EnumQueryInput`](crate::input::EnumQueryInput).
  516    375   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  517    376   
    pub struct Builder {
  518         -
        pub(crate) r#enum: ::std::option::Option<
  519         -
            crate::constrained::MaybeConstrained<crate::model::EnumWithEscapedChars>,
  520         -
        >,
  521         -
        pub(crate) some_string: ::std::option::Option<::std::string::String>,
         377  +
        pub(crate) r#enum:
         378  +
            ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::StringEnum>>,
  522    379   
    }
  523    380   
    impl Builder {
  524    381   
        #[allow(missing_docs)] // documentation missing in model
  525         -
        pub fn r#enum(
  526         -
            mut self,
  527         -
            input: ::std::option::Option<crate::model::EnumWithEscapedChars>,
  528         -
        ) -> Self {
  529         -
            self.r#enum = input.map(crate::constrained::MaybeConstrained::Constrained);
         382  +
        pub fn r#enum(mut self, input: crate::model::StringEnum) -> Self {
         383  +
            self.r#enum = Some(crate::constrained::MaybeConstrained::Constrained(input));
  530    384   
            self
  531    385   
        }
  532    386   
        #[allow(missing_docs)] // documentation missing in model
  533    387   
        pub(crate) fn set_enum(
  534    388   
            mut self,
  535         -
            input: Option<
  536         -
                impl ::std::convert::Into<
  537         -
                    crate::constrained::MaybeConstrained<crate::model::EnumWithEscapedChars>,
  538         -
                >,
         389  +
            input: impl ::std::convert::Into<
         390  +
                crate::constrained::MaybeConstrained<crate::model::StringEnum>,
  539    391   
            >,
  540    392   
        ) -> Self {
  541         -
            self.r#enum = input.map(|v| v.into());
  542         -
            self
  543         -
        }
  544         -
        #[allow(missing_docs)] // documentation missing in model
  545         -
        pub fn some_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  546         -
            self.some_string = input;
  547         -
            self
  548         -
        }
  549         -
        #[allow(missing_docs)] // documentation missing in model
  550         -
        pub(crate) fn set_some_string(
  551         -
            mut self,
  552         -
            input: Option<impl ::std::convert::Into<::std::string::String>>,
  553         -
        ) -> Self {
  554         -
            self.some_string = input.map(|v| v.into());
         393  +
            self.r#enum = Some(input.into());
  555    394   
            self
  556    395   
        }
  557         -
        /// Consumes the builder and constructs a [`EscapedStringValuesInput`](crate::input::EscapedStringValuesInput).
         396  +
        /// Consumes the builder and constructs a [`EnumQueryInput`](crate::input::EnumQueryInput).
  558    397   
        ///
  559         -
        /// The builder fails to construct a [`EscapedStringValuesInput`](crate::input::EscapedStringValuesInput) if a [`ConstraintViolation`] occurs.
         398  +
        /// The builder fails to construct a [`EnumQueryInput`](crate::input::EnumQueryInput) if a [`ConstraintViolation`] occurs.
  560    399   
        ///
  561         -
        pub fn build(self) -> Result<crate::input::EscapedStringValuesInput, ConstraintViolation> {
         400  +
        /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
         401  +
        pub fn build(self) -> Result<crate::input::EnumQueryInput, ConstraintViolation> {
  562    402   
            self.build_enforcing_all_constraints()
  563    403   
        }
  564    404   
        fn build_enforcing_all_constraints(
  565    405   
            self,
  566         -
        ) -> Result<crate::input::EscapedStringValuesInput, ConstraintViolation> {
  567         -
            Ok(crate::input::EscapedStringValuesInput {
         406  +
        ) -> Result<crate::input::EnumQueryInput, ConstraintViolation> {
         407  +
            Ok(crate::input::EnumQueryInput {
  568    408   
                r#enum: self
  569    409   
                    .r#enum
  570    410   
                    .map(|v| match v {
  571    411   
                        crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
  572    412   
                        crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
  573    413   
                    })
  574    414   
                    .map(|res| res.map_err(ConstraintViolation::Enum))
  575         -
                    .transpose()?,
  576         -
                some_string: self.some_string,
         415  +
                    .transpose()?
         416  +
                    .ok_or(ConstraintViolation::MissingEnum)?,
  577    417   
            })
  578    418   
        }
  579    419   
    }
  580    420   
}
  581         -
/// See [`PrimitiveIntOpInput`](crate::input::PrimitiveIntOpInput).
  582         -
pub mod primitive_int_op_input {
         421  +
/// See [`StatusResponseInput`](crate::input::StatusResponseInput).
         422  +
pub mod status_response_input {
  583    423   
  584         -
    impl ::std::convert::From<Builder> for crate::input::PrimitiveIntOpInput {
         424  +
    impl ::std::convert::From<Builder> for crate::input::StatusResponseInput {
  585    425   
        fn from(builder: Builder) -> Self {
  586    426   
            builder.build()
  587    427   
        }
  588    428   
    }
  589         -
    /// A builder for [`PrimitiveIntOpInput`](crate::input::PrimitiveIntOpInput).
         429  +
    /// A builder for [`StatusResponseInput`](crate::input::StatusResponseInput).
  590    430   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  591         -
    pub struct Builder {
  592         -
        pub(crate) value: ::std::option::Option<i32>,
  593         -
    }
         431  +
    pub struct Builder {}
  594    432   
    impl Builder {
  595         -
        #[allow(missing_docs)] // documentation missing in model
  596         -
        pub fn value(mut self, input: i32) -> Self {
  597         -
            self.value = Some(input);
  598         -
            self
  599         -
        }
  600         -
        #[allow(missing_docs)] // documentation missing in model
  601         -
        pub(crate) fn set_value(mut self, input: impl ::std::convert::Into<i32>) -> Self {
  602         -
            self.value = Some(input.into());
  603         -
            self
  604         -
        }
  605         -
        /// Consumes the builder and constructs a [`PrimitiveIntOpInput`](crate::input::PrimitiveIntOpInput).
  606         -
        pub fn build(self) -> crate::input::PrimitiveIntOpInput {
         433  +
        /// Consumes the builder and constructs a [`StatusResponseInput`](crate::input::StatusResponseInput).
         434  +
        pub fn build(self) -> crate::input::StatusResponseInput {
  607    435   
            self.build_enforcing_all_constraints()
  608    436   
        }
  609         -
        fn build_enforcing_all_constraints(self) -> crate::input::PrimitiveIntOpInput {
  610         -
            crate::input::PrimitiveIntOpInput {
  611         -
                value: self.value.unwrap_or(0i32),
  612         -
            }
         437  +
        fn build_enforcing_all_constraints(self) -> crate::input::StatusResponseInput {
         438  +
            crate::input::StatusResponseInput {}
  613    439   
        }
  614    440   
    }
  615    441   
}
  616    442   
/// See [`MapWithEnumKeyOpInput`](crate::input::MapWithEnumKeyOpInput).
  617    443   
pub mod map_with_enum_key_op_input {
  618    444   
  619    445   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  620    446   
    /// Holds one variant for each of the ways the builder can fail.
  621    447   
    #[non_exhaustive]
  622    448   
    #[allow(clippy::enum_variant_names)]
@@ -702,528 +933,854 @@
  722    548   
                    .map(|v| match v {
  723    549   
                        crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
  724    550   
                        crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
  725    551   
                    })
  726    552   
                    .map(|res| res.map(|v| v.into()).map_err(ConstraintViolation::Map))
  727    553   
                    .transpose()?,
  728    554   
            })
  729    555   
        }
  730    556   
    }
  731    557   
}
  732         -
/// See [`StatusResponseInput`](crate::input::StatusResponseInput).
  733         -
pub mod status_response_input {
         558  +
/// See [`PrimitiveIntOpInput`](crate::input::PrimitiveIntOpInput).
         559  +
pub mod primitive_int_op_input {
  734    560   
  735         -
    impl ::std::convert::From<Builder> for crate::input::StatusResponseInput {
         561  +
    impl ::std::convert::From<Builder> for crate::input::PrimitiveIntOpInput {
  736    562   
        fn from(builder: Builder) -> Self {
  737    563   
            builder.build()
  738    564   
        }
  739    565   
    }
  740         -
    /// A builder for [`StatusResponseInput`](crate::input::StatusResponseInput).
         566  +
    /// A builder for [`PrimitiveIntOpInput`](crate::input::PrimitiveIntOpInput).
  741    567   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  742         -
    pub struct Builder {}
         568  +
    pub struct Builder {
         569  +
        pub(crate) value: ::std::option::Option<i32>,
         570  +
    }
  743    571   
    impl Builder {
  744         -
        /// Consumes the builder and constructs a [`StatusResponseInput`](crate::input::StatusResponseInput).
  745         -
        pub fn build(self) -> crate::input::StatusResponseInput {
         572  +
        #[allow(missing_docs)] // documentation missing in model
         573  +
        pub fn value(mut self, input: i32) -> Self {
         574  +
            self.value = Some(input);
         575  +
            self
         576  +
        }
         577  +
        #[allow(missing_docs)] // documentation missing in model
         578  +
        pub(crate) fn set_value(mut self, input: impl ::std::convert::Into<i32>) -> Self {
         579  +
            self.value = Some(input.into());
         580  +
            self
         581  +
        }
         582  +
        /// Consumes the builder and constructs a [`PrimitiveIntOpInput`](crate::input::PrimitiveIntOpInput).
         583  +
        pub fn build(self) -> crate::input::PrimitiveIntOpInput {
  746    584   
            self.build_enforcing_all_constraints()
  747    585   
        }
  748         -
        fn build_enforcing_all_constraints(self) -> crate::input::StatusResponseInput {
  749         -
            crate::input::StatusResponseInput {}
         586  +
        fn build_enforcing_all_constraints(self) -> crate::input::PrimitiveIntOpInput {
         587  +
            crate::input::PrimitiveIntOpInput {
         588  +
                value: self.value.unwrap_or(0i32),
         589  +
            }
  750    590   
        }
  751    591   
    }
  752    592   
}
  753         -
/// See [`EnumQueryInput`](crate::input::EnumQueryInput).
  754         -
pub mod enum_query_input {
         593  +
/// See [`EscapedStringValuesInput`](crate::input::EscapedStringValuesInput).
         594  +
pub mod escaped_string_values_input {
  755    595   
  756    596   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  757    597   
    /// Holds one variant for each of the ways the builder can fail.
  758    598   
    #[non_exhaustive]
  759    599   
    #[allow(clippy::enum_variant_names)]
  760    600   
    pub enum ConstraintViolation {
  761         -
        /// `r#enum` was not provided but it is required when building `EnumQueryInput`.
  762         -
        MissingEnum,
  763         -
        /// Constraint violation occurred building member `r#enum` when building `EnumQueryInput`.
         601  +
        /// Constraint violation occurred building member `r#enum` when building `EscapedStringValuesInput`.
  764    602   
        #[doc(hidden)]
  765         -
        Enum(crate::model::string_enum::ConstraintViolation),
         603  +
        Enum(crate::model::enum_with_escaped_chars::ConstraintViolation),
  766    604   
    }
  767    605   
    impl ::std::fmt::Display for ConstraintViolation {
  768    606   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  769    607   
            match self {
  770         -
                ConstraintViolation::MissingEnum => write!(f, "`r#enum` was not provided but it is required when building `EnumQueryInput`"),
  771         -
                ConstraintViolation::Enum(_) => write!(f, "constraint violation occurred building member `r#enum` when building `EnumQueryInput`"),
         608  +
                ConstraintViolation::Enum(_) => write!(f, "constraint violation occurred building member `r#enum` when building `EscapedStringValuesInput`"),
  772    609   
            }
  773    610   
        }
  774    611   
    }
  775    612   
    impl ::std::error::Error for ConstraintViolation {}
  776    613   
    impl ConstraintViolation {
  777    614   
        pub(crate) fn as_validation_exception_field(
  778    615   
            self,
  779    616   
            path: ::std::string::String,
  780    617   
        ) -> crate::model::ValidationExceptionField {
  781    618   
            match self {
  782         -
                ConstraintViolation::MissingEnum => crate::model::ValidationExceptionField {
  783         -
                    message: format!(
  784         -
                        "Value at '{}/enum' failed to satisfy constraint: Member must not be null",
  785         -
                        path
  786         -
                    ),
  787         -
                    path: path + "/enum",
  788         -
                },
  789    619   
                ConstraintViolation::Enum(inner) => {
  790    620   
                    inner.as_validation_exception_field(path + "/enum")
  791    621   
                }
  792    622   
            }
  793    623   
        }
  794    624   
    }
  795    625   
    impl ::std::convert::From<ConstraintViolation>
  796    626   
        for ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection
  797    627   
    {
  798    628   
        fn from(constraint_violation: ConstraintViolation) -> Self {
  799    629   
            let first_validation_exception_field =
  800    630   
                constraint_violation.as_validation_exception_field("".to_owned());
  801    631   
            let validation_exception = crate::error::ValidationException {
  802    632   
                message: format!(
  803    633   
                    "1 validation error detected. {}",
  804    634   
                    &first_validation_exception_field.message
  805    635   
                ),
  806    636   
                field_list: Some(vec![first_validation_exception_field]),
  807    637   
            };
  808    638   
            Self::ConstraintViolation(
  809    639   
                                crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
  810    640   
                                    .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
  811    641   
                            )
  812    642   
        }
  813    643   
    }
  814    644   
    impl ::std::convert::From<Builder>
  815         -
        for crate::constrained::MaybeConstrained<crate::input::EnumQueryInput>
         645  +
        for crate::constrained::MaybeConstrained<crate::input::EscapedStringValuesInput>
  816    646   
    {
  817    647   
        fn from(builder: Builder) -> Self {
  818    648   
            Self::Unconstrained(builder)
  819    649   
        }
  820    650   
    }
  821         -
    impl ::std::convert::TryFrom<Builder> for crate::input::EnumQueryInput {
         651  +
    impl ::std::convert::TryFrom<Builder> for crate::input::EscapedStringValuesInput {
  822    652   
        type Error = ConstraintViolation;
  823    653   
  824    654   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  825    655   
            builder.build()
  826    656   
        }
  827    657   
    }
  828         -
    /// A builder for [`EnumQueryInput`](crate::input::EnumQueryInput).
         658  +
    /// A builder for [`EscapedStringValuesInput`](crate::input::EscapedStringValuesInput).
  829    659   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  830    660   
    pub struct Builder {
  831         -
        pub(crate) r#enum:
  832         -
            ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::StringEnum>>,
         661  +
        pub(crate) r#enum: ::std::option::Option<
         662  +
            crate::constrained::MaybeConstrained<crate::model::EnumWithEscapedChars>,
         663  +
        >,
         664  +
        pub(crate) some_string: ::std::option::Option<::std::string::String>,
  833    665   
    }
  834    666   
    impl Builder {
  835    667   
        #[allow(missing_docs)] // documentation missing in model
  836         -
        pub fn r#enum(mut self, input: crate::model::StringEnum) -> Self {
  837         -
            self.r#enum = Some(crate::constrained::MaybeConstrained::Constrained(input));
         668  +
        pub fn r#enum(
         669  +
            mut self,
         670  +
            input: ::std::option::Option<crate::model::EnumWithEscapedChars>,
         671  +
        ) -> Self {
         672  +
            self.r#enum = input.map(crate::constrained::MaybeConstrained::Constrained);
  838    673   
            self
  839    674   
        }
  840    675   
        #[allow(missing_docs)] // documentation missing in model
  841    676   
        pub(crate) fn set_enum(
  842    677   
            mut self,
  843         -
            input: impl ::std::convert::Into<
  844         -
                crate::constrained::MaybeConstrained<crate::model::StringEnum>,
         678  +
            input: Option<
         679  +
                impl ::std::convert::Into<
         680  +
                    crate::constrained::MaybeConstrained<crate::model::EnumWithEscapedChars>,
         681  +
                >,
  845    682   
            >,
  846    683   
        ) -> Self {
  847         -
            self.r#enum = Some(input.into());
         684  +
            self.r#enum = input.map(|v| v.into());
  848    685   
            self
  849    686   
        }
  850         -
        /// Consumes the builder and constructs a [`EnumQueryInput`](crate::input::EnumQueryInput).
         687  +
        #[allow(missing_docs)] // documentation missing in model
         688  +
        pub fn some_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         689  +
            self.some_string = input;
         690  +
            self
         691  +
        }
         692  +
        #[allow(missing_docs)] // documentation missing in model
         693  +
        pub(crate) fn set_some_string(
         694  +
            mut self,
         695  +
            input: Option<impl ::std::convert::Into<::std::string::String>>,
         696  +
        ) -> Self {
         697  +
            self.some_string = input.map(|v| v.into());
         698  +
            self
         699  +
        }
         700  +
        /// Consumes the builder and constructs a [`EscapedStringValuesInput`](crate::input::EscapedStringValuesInput).
  851    701   
        ///
  852         -
        /// The builder fails to construct a [`EnumQueryInput`](crate::input::EnumQueryInput) if a [`ConstraintViolation`] occurs.
         702  +
        /// The builder fails to construct a [`EscapedStringValuesInput`](crate::input::EscapedStringValuesInput) if a [`ConstraintViolation`] occurs.
  853    703   
        ///
  854         -
        /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
  855         -
        pub fn build(self) -> Result<crate::input::EnumQueryInput, ConstraintViolation> {
         704  +
        pub fn build(self) -> Result<crate::input::EscapedStringValuesInput, ConstraintViolation> {
  856    705   
            self.build_enforcing_all_constraints()
  857    706   
        }
  858    707   
        fn build_enforcing_all_constraints(
  859    708   
            self,
  860         -
        ) -> Result<crate::input::EnumQueryInput, ConstraintViolation> {
  861         -
            Ok(crate::input::EnumQueryInput {
         709  +
        ) -> Result<crate::input::EscapedStringValuesInput, ConstraintViolation> {
         710  +
            Ok(crate::input::EscapedStringValuesInput {
  862    711   
                r#enum: self
  863    712   
                    .r#enum
  864    713   
                    .map(|v| match v {
  865    714   
                        crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
  866    715   
                        crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
  867    716   
                    })
  868    717   
                    .map(|res| res.map_err(ConstraintViolation::Enum))
  869         -
                    .transpose()?
  870         -
                    .ok_or(ConstraintViolation::MissingEnum)?,
         718  +
                    .transpose()?,
         719  +
                some_string: self.some_string,
  871    720   
            })
  872    721   
        }
  873    722   
    }
  874    723   
}
  875         -
/// See [`PrimitiveIntHeaderInput`](crate::input::PrimitiveIntHeaderInput).
  876         -
pub mod primitive_int_header_input {
         724  +
/// See [`NullInNonSparseInput`](crate::input::NullInNonSparseInput).
         725  +
pub mod null_in_non_sparse_input {
  877    726   
  878         -
    impl ::std::convert::From<Builder> for crate::input::PrimitiveIntHeaderInput {
         727  +
    impl ::std::convert::From<Builder> for crate::input::NullInNonSparseInput {
  879    728   
        fn from(builder: Builder) -> Self {
  880    729   
            builder.build()
  881    730   
        }
  882    731   
    }
  883         -
    /// A builder for [`PrimitiveIntHeaderInput`](crate::input::PrimitiveIntHeaderInput).
         732  +
    /// A builder for [`NullInNonSparseInput`](crate::input::NullInNonSparseInput).
  884    733   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  885    734   
    pub struct Builder {}
  886    735   
    impl Builder {
  887         -
        /// Consumes the builder and constructs a [`PrimitiveIntHeaderInput`](crate::input::PrimitiveIntHeaderInput).
  888         -
        pub fn build(self) -> crate::input::PrimitiveIntHeaderInput {
         736  +
        /// Consumes the builder and constructs a [`NullInNonSparseInput`](crate::input::NullInNonSparseInput).
         737  +
        pub fn build(self) -> crate::input::NullInNonSparseInput {
  889    738   
            self.build_enforcing_all_constraints()
  890    739   
        }
  891         -
        fn build_enforcing_all_constraints(self) -> crate::input::PrimitiveIntHeaderInput {
  892         -
            crate::input::PrimitiveIntHeaderInput {}
         740  +
        fn build_enforcing_all_constraints(self) -> crate::input::NullInNonSparseInput {
         741  +
            crate::input::NullInNonSparseInput {}
  893    742   
        }
  894    743   
    }
  895    744   
}
  896         -
/// See [`StringPayloadInput`](crate::input::StringPayloadInput).
  897         -
pub mod string_payload_input {
         745  +
/// See [`CaseInsensitiveErrorOperationInput`](crate::input::CaseInsensitiveErrorOperationInput).
         746  +
pub mod case_insensitive_error_operation_input {
  898    747   
  899         -
    impl ::std::convert::From<Builder> for crate::input::StringPayloadInput {
         748  +
    impl ::std::convert::From<Builder> for crate::input::CaseInsensitiveErrorOperationInput {
  900    749   
        fn from(builder: Builder) -> Self {
  901    750   
            builder.build()
  902    751   
        }
  903    752   
    }
  904         -
    /// A builder for [`StringPayloadInput`](crate::input::StringPayloadInput).
         753  +
    /// A builder for [`CaseInsensitiveErrorOperationInput`](crate::input::CaseInsensitiveErrorOperationInput).
         754  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         755  +
    pub struct Builder {}
         756  +
    impl Builder {
         757  +
        /// Consumes the builder and constructs a [`CaseInsensitiveErrorOperationInput`](crate::input::CaseInsensitiveErrorOperationInput).
         758  +
        pub fn build(self) -> crate::input::CaseInsensitiveErrorOperationInput {
         759  +
            self.build_enforcing_all_constraints()
         760  +
        }
         761  +
        fn build_enforcing_all_constraints(
         762  +
            self,
         763  +
        ) -> crate::input::CaseInsensitiveErrorOperationInput {
         764  +
            crate::input::CaseInsensitiveErrorOperationInput {}
         765  +
        }
         766  +
    }
         767  +
}
         768  +
/// See [`EmptyStructWithContentOnWireOpInput`](crate::input::EmptyStructWithContentOnWireOpInput).
         769  +
pub mod empty_struct_with_content_on_wire_op_input {
         770  +
         771  +
    impl ::std::convert::From<Builder> for crate::input::EmptyStructWithContentOnWireOpInput {
         772  +
        fn from(builder: Builder) -> Self {
         773  +
            builder.build()
         774  +
        }
         775  +
    }
         776  +
    /// A builder for [`EmptyStructWithContentOnWireOpInput`](crate::input::EmptyStructWithContentOnWireOpInput).
         777  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         778  +
    pub struct Builder {}
         779  +
    impl Builder {
         780  +
        /// Consumes the builder and constructs a [`EmptyStructWithContentOnWireOpInput`](crate::input::EmptyStructWithContentOnWireOpInput).
         781  +
        pub fn build(self) -> crate::input::EmptyStructWithContentOnWireOpInput {
         782  +
            self.build_enforcing_all_constraints()
         783  +
        }
         784  +
        fn build_enforcing_all_constraints(
         785  +
            self,
         786  +
        ) -> crate::input::EmptyStructWithContentOnWireOpInput {
         787  +
            crate::input::EmptyStructWithContentOnWireOpInput {}
         788  +
        }
         789  +
    }
         790  +
}
         791  +
/// See [`QueryPrecedenceInput`](crate::input::QueryPrecedenceInput).
         792  +
pub mod query_precedence_input {
         793  +
         794  +
    impl ::std::convert::From<Builder> for crate::input::QueryPrecedenceInput {
         795  +
        fn from(builder: Builder) -> Self {
         796  +
            builder.build()
         797  +
        }
         798  +
    }
         799  +
    /// A builder for [`QueryPrecedenceInput`](crate::input::QueryPrecedenceInput).
  905    800   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  906    801   
    pub struct Builder {
  907         -
        pub(crate) payload: ::std::option::Option<::std::string::String>,
         802  +
        pub(crate) foo: ::std::option::Option<::std::string::String>,
         803  +
        pub(crate) baz: ::std::option::Option<
         804  +
            ::std::collections::HashMap<::std::string::String, ::std::string::String>,
         805  +
        >,
  908    806   
    }
  909    807   
    impl Builder {
  910    808   
        #[allow(missing_docs)] // documentation missing in model
  911         -
        pub fn payload(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  912         -
            self.payload = input;
         809  +
        pub fn foo(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         810  +
            self.foo = input;
  913    811   
            self
  914    812   
        }
  915    813   
        #[allow(missing_docs)] // documentation missing in model
  916         -
        pub(crate) fn set_payload(
         814  +
        pub(crate) fn set_foo(
  917    815   
            mut self,
  918    816   
            input: Option<impl ::std::convert::Into<::std::string::String>>,
  919    817   
        ) -> Self {
  920         -
            self.payload = input.map(|v| v.into());
         818  +
            self.foo = input.map(|v| v.into());
  921    819   
            self
  922    820   
        }
  923         -
        /// Consumes the builder and constructs a [`StringPayloadInput`](crate::input::StringPayloadInput).
  924         -
        pub fn build(self) -> crate::input::StringPayloadInput {
         821  +
        #[allow(missing_docs)] // documentation missing in model
         822  +
        pub fn baz(
         823  +
            mut self,
         824  +
            input: ::std::option::Option<
         825  +
                ::std::collections::HashMap<::std::string::String, ::std::string::String>,
         826  +
            >,
         827  +
        ) -> Self {
         828  +
            self.baz = input;
         829  +
            self
         830  +
        }
         831  +
        #[allow(missing_docs)] // documentation missing in model
         832  +
        pub(crate) fn set_baz(
         833  +
            mut self,
         834  +
            input: Option<
         835  +
                impl ::std::convert::Into<
         836  +
                    ::std::collections::HashMap<::std::string::String, ::std::string::String>,
         837  +
                >,
         838  +
            >,
         839  +
        ) -> Self {
         840  +
            self.baz = input.map(|v| v.into());
         841  +
            self
         842  +
        }
         843  +
        /// Consumes the builder and constructs a [`QueryPrecedenceInput`](crate::input::QueryPrecedenceInput).
         844  +
        pub fn build(self) -> crate::input::QueryPrecedenceInput {
  925    845   
            self.build_enforcing_all_constraints()
  926    846   
        }
  927         -
        fn build_enforcing_all_constraints(self) -> crate::input::StringPayloadInput {
  928         -
            crate::input::StringPayloadInput {
  929         -
                payload: self.payload,
         847  +
        fn build_enforcing_all_constraints(self) -> crate::input::QueryPrecedenceInput {
         848  +
            crate::input::QueryPrecedenceInput {
         849  +
                foo: self.foo,
         850  +
                baz: self.baz,
  930    851   
            }
  931    852   
        }
  932    853   
    }
  933    854   
}

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

@@ -150,150 +254,249 @@
  170    170   
//! use ::tokio::net::TcpListener;
  171    171   
//!
  172    172   
//! #[::tokio::main]
  173    173   
//! pub async fn main() {
  174    174   
//!    let config = RestJsonExtrasConfig::builder().build();
  175    175   
//!    let app = RestJsonExtras::builder(config)
  176    176   
//!        .case_insensitive_error_operation(case_insensitive_error_operation)
  177    177   
//!        .empty_struct_with_content_on_wire_op(empty_struct_with_content_on_wire_op)
  178    178   
//!        .enum_query(enum_query)
  179    179   
//!        .escaped_string_values(escaped_string_values)
  180         -
//!        .http_query_params_only_operation(http_query_params_only_operation)
  181    180   
//!        .map_with_enum_key_op(map_with_enum_key_op)
  182    181   
//!        .null_in_non_sparse(null_in_non_sparse)
  183    182   
//!        .primitive_int_header(primitive_int_header)
  184    183   
//!        .primitive_int_op(primitive_int_op)
  185    184   
//!        .query_precedence(query_precedence)
  186    185   
//!        .status_response(status_response)
  187    186   
//!        .string_payload(string_payload)
  188    187   
//!        .build()
  189    188   
//!        .expect("failed to build an instance of RestJsonExtras");
  190    189   
//!
  191    190   
//!    let bind: SocketAddr = "127.0.0.1:6969".parse()
  192    191   
//!        .expect("unable to parse the server bind address and port");
  193    192   
//!    let listener = TcpListener::bind(bind).await
  194    193   
//!        .expect("failed to bind TCP listener");
  195    194   
//!    # let server = async { Ok::<_, ()>(()) };
  196    195   
//!
  197    196   
//!    // Run your service!
  198    197   
//!    if let Err(err) = serve(listener, app.into_make_service()).await {
  199    198   
//!        eprintln!("server error: {:?}", err);
  200    199   
//!    }
  201    200   
//! }
  202    201   
//!
  203    202   
//! use rest_json_extras::{input, output, error};
  204    203   
//!
  205    204   
//! async fn case_insensitive_error_operation(input: input::CaseInsensitiveErrorOperationInput) -> Result<output::CaseInsensitiveErrorOperationOutput, error::CaseInsensitiveErrorOperationError> {
  206    205   
//!     todo!()
  207    206   
//! }
  208    207   
//!
  209    208   
//! async fn empty_struct_with_content_on_wire_op(input: input::EmptyStructWithContentOnWireOpInput) -> Result<output::EmptyStructWithContentOnWireOpOutput, error::EmptyStructWithContentOnWireOpError> {
  210    209   
//!     todo!()
  211    210   
//! }
  212    211   
//!
  213    212   
//! async fn enum_query(input: input::EnumQueryInput) -> Result<output::EnumQueryOutput, error::EnumQueryError> {
  214    213   
//!     todo!()
  215    214   
//! }
  216    215   
//!
  217    216   
//! async fn escaped_string_values(input: input::EscapedStringValuesInput) -> Result<output::EscapedStringValuesOutput, error::EscapedStringValuesError> {
  218    217   
//!     todo!()
  219    218   
//! }
  220    219   
//!
  221         -
//! async fn http_query_params_only_operation(input: input::HttpQueryParamsOnlyOperationInput) -> Result<output::HttpQueryParamsOnlyOperationOutput, error::HttpQueryParamsOnlyOperationError> {
  222         -
//!     todo!()
  223         -
//! }
  224         -
//!
  225    220   
//! async fn map_with_enum_key_op(input: input::MapWithEnumKeyOpInput) -> Result<output::MapWithEnumKeyOpOutput, error::MapWithEnumKeyOpError> {
  226    221   
//!     todo!()
  227    222   
//! }
  228    223   
//!
  229    224   
//! async fn null_in_non_sparse(input: input::NullInNonSparseInput) -> Result<output::NullInNonSparseOutput, error::NullInNonSparseError> {
  230    225   
//!     todo!()
  231    226   
//! }
  232    227   
//!
  233    228   
//! async fn primitive_int_header(input: input::PrimitiveIntHeaderInput) -> Result<output::PrimitiveIntHeaderOutput, error::PrimitiveIntHeaderError> {
  234    229   
//!     todo!()

tmp-codegen-diff/codegen-server-test/rest_json_extras/rust-server-codegen/src/mimes.rs

@@ -1,1 +14,14 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) static CONTENT_TYPE_APPLICATION_JSON: std::sync::LazyLock<::mime::Mime> =
           2  +
pub(crate) static CONTENT_TYPE_TEXT_PLAIN: std::sync::LazyLock<::mime::Mime> =
    3      3   
    std::sync::LazyLock::new(|| {
    4         -
        "application/json"
           4  +
        "text/plain"
    5      5   
            .parse::<::mime::Mime>()
    6      6   
            .expect("BUG: MIME parsing failed, content_type is not valid")
    7      7   
    });
    8      8   
    9         -
pub(crate) static CONTENT_TYPE_TEXT_PLAIN: std::sync::LazyLock<::mime::Mime> =
           9  +
pub(crate) static CONTENT_TYPE_APPLICATION_JSON: std::sync::LazyLock<::mime::Mime> =
   10     10   
    std::sync::LazyLock::new(|| {
   11         -
        "text/plain"
          11  +
        "application/json"
   12     12   
            .parse::<::mime::Mime>()
   13     13   
            .expect("BUG: MIME parsing failed, content_type is not valid")
   14     14   
    });

tmp-codegen-diff/codegen-server-test/rest_json_extras/rust-server-codegen/src/model.rs

@@ -1,1 +300,331 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(missing_docs)] // documentation missing in model
    3         -
#[derive(
    4         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
    5         -
)]
    6         -
pub struct EmptyStruct {}
    7         -
impl EmptyStruct {
    8         -
    /// Creates a new builder-style object to manufacture [`EmptyStruct`](crate::model::EmptyStruct).
    9         -
    pub fn builder() -> crate::model::empty_struct::Builder {
   10         -
        crate::model::empty_struct::Builder::default()
   11         -
    }
   12         -
}
   13         -
   14         -
#[allow(missing_docs)] // documentation missing in model
   15         -
#[derive(
   16         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   17         -
)]
   18         -
pub enum SingleElementUnion {
   19         -
    #[allow(missing_docs)] // documentation missing in model
   20         -
    A(::std::string::String),
   21         -
}
   22         -
impl SingleElementUnion {
   23         -
    #[allow(irrefutable_let_patterns)]
   24         -
    /// Tries to convert the enum instance into [`A`](crate::model::SingleElementUnion::A), extracting the inner [`String`](::std::string::String).
   25         -
    /// Returns `Err(&Self)` if it can't be converted.
   26         -
    pub fn as_a(&self) -> ::std::result::Result<&::std::string::String, &Self> {
   27         -
        if let SingleElementUnion::A(val) = &self {
   28         -
            ::std::result::Result::Ok(val)
   29         -
        } else {
   30         -
            ::std::result::Result::Err(self)
   31         -
        }
   32         -
    }
   33         -
    /// Returns true if this is a [`A`](crate::model::SingleElementUnion::A).
   34         -
    pub fn is_a(&self) -> bool {
   35         -
        self.as_a().is_ok()
   36         -
    }
   37         -
}
   38         -
   39         -
/// Describes one specific validation failure for an input member.
   40         -
#[derive(
   41         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   42         -
)]
   43         -
pub struct ValidationExceptionField {
   44         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
   45         -
    pub path: ::std::string::String,
   46         -
    /// A detailed description of the validation failure.
   47         -
    pub message: ::std::string::String,
   48         -
}
   49         -
impl ValidationExceptionField {
   50         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
   51         -
    pub fn path(&self) -> &str {
   52         -
        use std::ops::Deref;
   53         -
        self.path.deref()
   54         -
    }
   55         -
    /// A detailed description of the validation failure.
   56         -
    pub fn message(&self) -> &str {
   57         -
        use std::ops::Deref;
   58         -
        self.message.deref()
   59         -
    }
   60         -
}
   61         -
impl ValidationExceptionField {
   62         -
    /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
   63         -
    pub fn builder() -> crate::model::validation_exception_field::Builder {
   64         -
        crate::model::validation_exception_field::Builder::default()
   65         -
    }
   66         -
}
   67         -
   68      2   
#[allow(missing_docs)] // documentation missing in model
   69      3   
#[derive(
   70      4   
    ::std::clone::Clone,
   71      5   
    ::std::cmp::Eq,
   72      6   
    ::std::cmp::Ord,
   73      7   
    ::std::cmp::PartialEq,
   74      8   
    ::std::cmp::PartialOrd,
   75      9   
    ::std::fmt::Debug,
   76     10   
    ::std::hash::Hash,
   77     11   
)]
   78         -
pub enum EnumWithEscapedChars {
   79         -
    /// this needs#tobe escaped
   80         -
    HasQuotes,
          12  +
pub enum StringEnum {
   81     13   
    #[allow(missing_docs)] // documentation missing in model
   82         -
    Normal,
          14  +
    V,
   83     15   
}
   84         -
/// See [`EnumWithEscapedChars`](crate::model::EnumWithEscapedChars).
   85         -
pub mod enum_with_escaped_chars {
          16  +
/// See [`StringEnum`](crate::model::StringEnum).
          17  +
pub mod string_enum {
   86     18   
    #[derive(Debug, PartialEq)]
   87     19   
    pub struct ConstraintViolation(pub(crate) ::std::string::String);
   88     20   
   89     21   
    impl ::std::fmt::Display for ConstraintViolation {
   90     22   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
   91     23   
            write!(
   92     24   
                f,
   93         -
                r#"Value provided for 'aws.protocoltests.restjson#EnumWithEscapedChars' failed to satisfy constraint: Member must satisfy enum value set: [has"quotes, normal]"#
          25  +
                r#"Value provided for 'aws.protocoltests.restjson#StringEnum' failed to satisfy constraint: Member must satisfy enum value set: [enumvalue]"#
   94     26   
            )
   95     27   
        }
   96     28   
    }
   97     29   
   98     30   
    impl ::std::error::Error for ConstraintViolation {}
   99     31   
    impl ConstraintViolation {
  100     32   
        pub(crate) fn as_validation_exception_field(
  101     33   
            self,
  102     34   
            path: ::std::string::String,
  103     35   
        ) -> crate::model::ValidationExceptionField {
  104     36   
            crate::model::ValidationExceptionField {
  105     37   
                message: format!(
  106         -
                    r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [has"quotes, normal]"#,
          38  +
                    r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [enumvalue]"#,
  107     39   
                    &path
  108     40   
                ),
  109     41   
                path,
  110     42   
            }
  111     43   
        }
  112     44   
    }
  113     45   
}
  114         -
impl ::std::convert::TryFrom<&str> for EnumWithEscapedChars {
  115         -
    type Error = crate::model::enum_with_escaped_chars::ConstraintViolation;
          46  +
impl ::std::convert::TryFrom<&str> for StringEnum {
          47  +
    type Error = crate::model::string_enum::ConstraintViolation;
  116     48   
    fn try_from(
  117     49   
        s: &str,
  118     50   
    ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
  119     51   
        match s {
  120         -
            "has\"quotes" => Ok(EnumWithEscapedChars::HasQuotes),
  121         -
            "normal" => Ok(EnumWithEscapedChars::Normal),
  122         -
            _ => Err(crate::model::enum_with_escaped_chars::ConstraintViolation(
  123         -
                s.to_owned(),
  124         -
            )),
          52  +
            "enumvalue" => Ok(StringEnum::V),
          53  +
            _ => Err(crate::model::string_enum::ConstraintViolation(s.to_owned())),
  125     54   
        }
  126     55   
    }
  127     56   
}
  128         -
impl ::std::convert::TryFrom<::std::string::String> for EnumWithEscapedChars {
  129         -
    type Error = crate::model::enum_with_escaped_chars::ConstraintViolation;
          57  +
impl ::std::convert::TryFrom<::std::string::String> for StringEnum {
          58  +
    type Error = crate::model::string_enum::ConstraintViolation;
  130     59   
    fn try_from(
  131     60   
        s: ::std::string::String,
  132     61   
    ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
  133     62   
    {
  134     63   
        s.as_str().try_into()
  135     64   
    }
  136     65   
}
  137         -
impl std::str::FromStr for EnumWithEscapedChars {
  138         -
    type Err = crate::model::enum_with_escaped_chars::ConstraintViolation;
          66  +
impl std::str::FromStr for StringEnum {
          67  +
    type Err = crate::model::string_enum::ConstraintViolation;
  139     68   
    fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
  140     69   
        Self::try_from(s)
  141     70   
    }
  142     71   
}
  143         -
impl EnumWithEscapedChars {
          72  +
impl StringEnum {
  144     73   
    /// Returns the `&str` value of the enum member.
  145     74   
    pub fn as_str(&self) -> &str {
  146     75   
        match self {
  147         -
            EnumWithEscapedChars::HasQuotes => "has\"quotes",
  148         -
            EnumWithEscapedChars::Normal => "normal",
          76  +
            StringEnum::V => "enumvalue",
  149     77   
        }
  150     78   
    }
  151     79   
    /// Returns all the `&str` representations of the enum members.
  152     80   
    pub const fn values() -> &'static [&'static str] {
  153         -
        &["has\"quotes", "normal"]
          81  +
        &["enumvalue"]
  154     82   
    }
  155     83   
}
  156         -
impl ::std::convert::AsRef<str> for EnumWithEscapedChars {
          84  +
impl ::std::convert::AsRef<str> for StringEnum {
  157     85   
    fn as_ref(&self) -> &str {
  158     86   
        self.as_str()
  159     87   
    }
  160     88   
}
  161         -
impl crate::constrained::Constrained for EnumWithEscapedChars {
          89  +
impl crate::constrained::Constrained for StringEnum {
  162     90   
    type Unconstrained = ::std::string::String;
  163     91   
}
  164     92   
  165     93   
impl ::std::convert::From<::std::string::String>
  166         -
    for crate::constrained::MaybeConstrained<crate::model::EnumWithEscapedChars>
          94  +
    for crate::constrained::MaybeConstrained<crate::model::StringEnum>
  167     95   
{
  168     96   
    fn from(value: ::std::string::String) -> Self {
  169     97   
        Self::Unconstrained(value)
  170     98   
    }
  171     99   
}
  172    100   
  173    101   
#[allow(missing_docs)] // documentation missing in model
  174    102   
#[derive(
  175    103   
    ::std::clone::Clone,
  176    104   
    ::std::cmp::Eq,
  177    105   
    ::std::cmp::Ord,
  178    106   
    ::std::cmp::PartialEq,
  179    107   
    ::std::cmp::PartialOrd,
  180    108   
    ::std::fmt::Debug,
  181    109   
    ::std::hash::Hash,
  182    110   
)]
  183         -
pub enum StringEnum {
         111  +
pub enum EnumWithEscapedChars {
         112  +
    /// this needs#tobe escaped
         113  +
    HasQuotes,
  184    114   
    #[allow(missing_docs)] // documentation missing in model
  185         -
    V,
         115  +
    Normal,
  186    116   
}
  187         -
/// See [`StringEnum`](crate::model::StringEnum).
  188         -
pub mod string_enum {
         117  +
/// See [`EnumWithEscapedChars`](crate::model::EnumWithEscapedChars).
         118  +
pub mod enum_with_escaped_chars {
  189    119   
    #[derive(Debug, PartialEq)]
  190    120   
    pub struct ConstraintViolation(pub(crate) ::std::string::String);
  191    121   
  192    122   
    impl ::std::fmt::Display for ConstraintViolation {
  193    123   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  194    124   
            write!(
  195    125   
                f,
  196         -
                r#"Value provided for 'aws.protocoltests.restjson#StringEnum' failed to satisfy constraint: Member must satisfy enum value set: [enumvalue]"#
         126  +
                r#"Value provided for 'aws.protocoltests.restjson#EnumWithEscapedChars' failed to satisfy constraint: Member must satisfy enum value set: [has"quotes, normal]"#
  197    127   
            )
  198    128   
        }
  199    129   
    }
  200    130   
  201    131   
    impl ::std::error::Error for ConstraintViolation {}
  202    132   
    impl ConstraintViolation {
  203    133   
        pub(crate) fn as_validation_exception_field(
  204    134   
            self,
  205    135   
            path: ::std::string::String,
  206    136   
        ) -> crate::model::ValidationExceptionField {
  207    137   
            crate::model::ValidationExceptionField {
  208    138   
                message: format!(
  209         -
                    r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [enumvalue]"#,
         139  +
                    r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [has"quotes, normal]"#,
  210    140   
                    &path
  211    141   
                ),
  212    142   
                path,
  213    143   
            }
  214    144   
        }
  215    145   
    }
  216    146   
}
  217         -
impl ::std::convert::TryFrom<&str> for StringEnum {
  218         -
    type Error = crate::model::string_enum::ConstraintViolation;
         147  +
impl ::std::convert::TryFrom<&str> for EnumWithEscapedChars {
         148  +
    type Error = crate::model::enum_with_escaped_chars::ConstraintViolation;
  219    149   
    fn try_from(
  220    150   
        s: &str,
  221    151   
    ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
  222    152   
        match s {
  223         -
            "enumvalue" => Ok(StringEnum::V),
  224         -
            _ => Err(crate::model::string_enum::ConstraintViolation(s.to_owned())),
         153  +
            "has\"quotes" => Ok(EnumWithEscapedChars::HasQuotes),
         154  +
            "normal" => Ok(EnumWithEscapedChars::Normal),
         155  +
            _ => Err(crate::model::enum_with_escaped_chars::ConstraintViolation(
         156  +
                s.to_owned(),
         157  +
            )),
  225    158   
        }
  226    159   
    }
  227    160   
}
  228         -
impl ::std::convert::TryFrom<::std::string::String> for StringEnum {
  229         -
    type Error = crate::model::string_enum::ConstraintViolation;
         161  +
impl ::std::convert::TryFrom<::std::string::String> for EnumWithEscapedChars {
         162  +
    type Error = crate::model::enum_with_escaped_chars::ConstraintViolation;
  230    163   
    fn try_from(
  231    164   
        s: ::std::string::String,
  232    165   
    ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
  233    166   
    {
  234    167   
        s.as_str().try_into()
  235    168   
    }
  236    169   
}
  237         -
impl std::str::FromStr for StringEnum {
  238         -
    type Err = crate::model::string_enum::ConstraintViolation;
         170  +
impl std::str::FromStr for EnumWithEscapedChars {
         171  +
    type Err = crate::model::enum_with_escaped_chars::ConstraintViolation;
  239    172   
    fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
  240    173   
        Self::try_from(s)
  241    174   
    }
  242    175   
}
  243         -
impl StringEnum {
         176  +
impl EnumWithEscapedChars {
  244    177   
    /// Returns the `&str` value of the enum member.
  245    178   
    pub fn as_str(&self) -> &str {
  246    179   
        match self {
  247         -
            StringEnum::V => "enumvalue",
         180  +
            EnumWithEscapedChars::HasQuotes => "has\"quotes",
         181  +
            EnumWithEscapedChars::Normal => "normal",
  248    182   
        }
  249    183   
    }
  250    184   
    /// Returns all the `&str` representations of the enum members.
  251    185   
    pub const fn values() -> &'static [&'static str] {
  252         -
        &["enumvalue"]
         186  +
        &["has\"quotes", "normal"]
  253    187   
    }
  254    188   
}
  255         -
impl ::std::convert::AsRef<str> for StringEnum {
         189  +
impl ::std::convert::AsRef<str> for EnumWithEscapedChars {
  256    190   
    fn as_ref(&self) -> &str {
  257    191   
        self.as_str()
  258    192   
    }
  259    193   
}
  260         -
impl crate::constrained::Constrained for StringEnum {
         194  +
impl crate::constrained::Constrained for EnumWithEscapedChars {
  261    195   
    type Unconstrained = ::std::string::String;
  262    196   
}
  263    197   
  264    198   
impl ::std::convert::From<::std::string::String>
  265         -
    for crate::constrained::MaybeConstrained<crate::model::StringEnum>
         199  +
    for crate::constrained::MaybeConstrained<crate::model::EnumWithEscapedChars>
  266    200   
{
  267    201   
    fn from(value: ::std::string::String) -> Self {
  268    202   
        Self::Unconstrained(value)
  269    203   
    }
  270    204   
}
         205  +
         206  +
#[allow(missing_docs)] // documentation missing in model
         207  +
#[derive(
         208  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         209  +
)]
         210  +
pub enum SingleElementUnion {
         211  +
    #[allow(missing_docs)] // documentation missing in model
         212  +
    A(::std::string::String),
         213  +
}
         214  +
impl SingleElementUnion {
         215  +
    #[allow(irrefutable_let_patterns)]
         216  +
    /// Tries to convert the enum instance into [`A`](crate::model::SingleElementUnion::A), extracting the inner [`String`](::std::string::String).
         217  +
    /// Returns `Err(&Self)` if it can't be converted.
         218  +
    pub fn as_a(&self) -> ::std::result::Result<&::std::string::String, &Self> {
         219  +
        if let SingleElementUnion::A(val) = &self {
         220  +
            ::std::result::Result::Ok(val)
         221  +
        } else {
         222  +
            ::std::result::Result::Err(self)
         223  +
        }
         224  +
    }
         225  +
    /// Returns true if this is a [`A`](crate::model::SingleElementUnion::A).
         226  +
    pub fn is_a(&self) -> bool {
         227  +
        self.as_a().is_ok()
         228  +
    }
         229  +
}
         230  +
         231  +
#[allow(missing_docs)] // documentation missing in model
         232  +
#[derive(
         233  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         234  +
)]
         235  +
pub struct EmptyStruct {}
         236  +
impl EmptyStruct {
         237  +
    /// Creates a new builder-style object to manufacture [`EmptyStruct`](crate::model::EmptyStruct).
         238  +
    pub fn builder() -> crate::model::empty_struct::Builder {
         239  +
        crate::model::empty_struct::Builder::default()
         240  +
    }
         241  +
}
         242  +
         243  +
/// Describes one specific validation failure for an input member.
         244  +
#[derive(
         245  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         246  +
)]
         247  +
pub struct ValidationExceptionField {
         248  +
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
         249  +
    pub path: ::std::string::String,
         250  +
    /// A detailed description of the validation failure.
         251  +
    pub message: ::std::string::String,
         252  +
}
         253  +
impl ValidationExceptionField {
         254  +
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
         255  +
    pub fn path(&self) -> &str {
         256  +
        use std::ops::Deref;
         257  +
        self.path.deref()
         258  +
    }
         259  +
    /// A detailed description of the validation failure.
         260  +
    pub fn message(&self) -> &str {
         261  +
        use std::ops::Deref;
         262  +
        self.message.deref()
         263  +
    }
         264  +
}
         265  +
impl ValidationExceptionField {
         266  +
    /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         267  +
    pub fn builder() -> crate::model::validation_exception_field::Builder {
         268  +
        crate::model::validation_exception_field::Builder::default()
         269  +
    }
         270  +
}
         271  +
pub mod map_with_enum_key {
         272  +
         273  +
    #[allow(clippy::enum_variant_names)]
         274  +
    #[derive(Debug, PartialEq)]
         275  +
    pub enum ConstraintViolation {
         276  +
        #[doc(hidden)]
         277  +
        Key(crate::model::string_enum::ConstraintViolation),
         278  +
    }
         279  +
         280  +
    impl ::std::fmt::Display for ConstraintViolation {
         281  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         282  +
            match self {
         283  +
                Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
         284  +
            }
         285  +
        }
         286  +
    }
         287  +
         288  +
    impl ::std::error::Error for ConstraintViolation {}
         289  +
    impl ConstraintViolation {
         290  +
        pub(crate) fn as_validation_exception_field(
         291  +
            self,
         292  +
            path: ::std::string::String,
         293  +
        ) -> crate::model::ValidationExceptionField {
         294  +
            match self {
         295  +
                Self::Key(key_constraint_violation) => {
         296  +
                    key_constraint_violation.as_validation_exception_field(path)
         297  +
                }
         298  +
            }
         299  +
        }
         300  +
    }
         301  +
}
  271    302   
/// See [`EmptyStruct`](crate::model::EmptyStruct).
  272    303   
pub mod empty_struct {
  273    304   
  274    305   
    impl ::std::convert::From<Builder> for crate::model::EmptyStruct {
  275    306   
        fn from(builder: Builder) -> Self {
  276    307   
            builder.build()
  277    308   
        }
  278    309   
    }
  279    310   
    /// A builder for [`EmptyStruct`](crate::model::EmptyStruct).
  280    311   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
@@ -326,357 +386,0 @@
  346    377   
        fn build_enforcing_all_constraints(
  347    378   
            self,
  348    379   
        ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
  349    380   
            Ok(crate::model::ValidationExceptionField {
  350    381   
                path: self.path.ok_or(ConstraintViolation::MissingPath)?,
  351    382   
                message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
  352    383   
            })
  353    384   
        }
  354    385   
    }
  355    386   
}
  356         -
pub mod map_with_enum_key {
  357         -
  358         -
    #[allow(clippy::enum_variant_names)]
  359         -
    #[derive(Debug, PartialEq)]
  360         -
    pub enum ConstraintViolation {
  361         -
        #[doc(hidden)]
  362         -
        Key(crate::model::string_enum::ConstraintViolation),
  363         -
    }
  364         -
  365         -
    impl ::std::fmt::Display for ConstraintViolation {
  366         -
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  367         -
            match self {
  368         -
                Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
  369         -
            }
  370         -
        }
  371         -
    }
  372         -
  373         -
    impl ::std::error::Error for ConstraintViolation {}
  374         -
    impl ConstraintViolation {
  375         -
        pub(crate) fn as_validation_exception_field(
  376         -
            self,
  377         -
            path: ::std::string::String,
  378         -
        ) -> crate::model::ValidationExceptionField {
  379         -
            match self {
  380         -
                Self::Key(key_constraint_violation) => {
  381         -
                    key_constraint_violation.as_validation_exception_field(path)
  382         -
                }
  383         -
            }
  384         -
        }
  385         -
    }
  386         -
}