Server Test

Server Test

rev. 3c756f73b1f83a0eed4275d9d1e22df0b10b66fb (ignoring whitespace)

Files changed:

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

@@ -0,1 +0,933 @@
           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  +
#[allow(missing_docs)] // documentation missing in model
          65  +
#[derive(
          66  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
          67  +
)]
          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  +
    }
          74  +
}
          75  +
impl crate::constrained::Constrained for crate::input::EmptyStructWithContentOnWireOpInput {
          76  +
    type Unconstrained = crate::input::empty_struct_with_content_on_wire_op_input::Builder;
          77  +
}
          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()
          88  +
    }
          89  +
}
          90  +
impl crate::constrained::Constrained for crate::input::CaseInsensitiveErrorOperationInput {
          91  +
    type Unconstrained = crate::input::case_insensitive_error_operation_input::Builder;
          92  +
}
          93  +
          94  +
#[allow(missing_docs)] // documentation missing in model
          95  +
#[derive(
          96  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
          97  +
)]
          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()
         103  +
    }
         104  +
}
         105  +
impl crate::constrained::Constrained for crate::input::NullInNonSparseInput {
         106  +
    type Unconstrained = crate::input::null_in_non_sparse_input::Builder;
         107  +
}
         108  +
         109  +
#[allow(missing_docs)] // documentation missing in model
         110  +
#[derive(
         111  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         112  +
)]
         113  +
pub struct EscapedStringValuesInput {
         114  +
    #[allow(missing_docs)] // documentation missing in model
         115  +
    pub r#enum: ::std::option::Option<crate::model::EnumWithEscapedChars>,
         116  +
    #[allow(missing_docs)] // documentation missing in model
         117  +
    pub some_string: ::std::option::Option<::std::string::String>,
         118  +
}
         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  +
    }
         124  +
    #[allow(missing_docs)] // documentation missing in model
         125  +
    pub fn some_string(&self) -> ::std::option::Option<&str> {
         126  +
        self.some_string.as_deref()
         127  +
    }
         128  +
}
         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()
         133  +
    }
         134  +
}
         135  +
impl crate::constrained::Constrained for crate::input::EscapedStringValuesInput {
         136  +
    type Unconstrained = crate::input::escaped_string_values_input::Builder;
         137  +
}
         138  +
         139  +
#[allow(missing_docs)] // documentation missing in model
         140  +
#[derive(
         141  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         142  +
)]
         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()
         157  +
    }
         158  +
}
         159  +
impl crate::constrained::Constrained for crate::input::PrimitiveIntOpInput {
         160  +
    type Unconstrained = crate::input::primitive_int_op_input::Builder;
         161  +
}
         162  +
         163  +
#[allow(missing_docs)] // documentation missing in model
         164  +
#[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
         165  +
pub struct MapWithEnumKeyOpInput {
         166  +
    #[allow(missing_docs)] // documentation missing in model
         167  +
    pub map: ::std::option::Option<
         168  +
        ::std::collections::HashMap<crate::model::StringEnum, ::std::string::String>,
         169  +
    >,
         170  +
}
         171  +
impl MapWithEnumKeyOpInput {
         172  +
    #[allow(missing_docs)] // documentation missing in model
         173  +
    pub fn map(
         174  +
        &self,
         175  +
    ) -> ::std::option::Option<
         176  +
        &::std::collections::HashMap<crate::model::StringEnum, ::std::string::String>,
         177  +
    > {
         178  +
        self.map.as_ref()
         179  +
    }
         180  +
}
         181  +
impl MapWithEnumKeyOpInput {
         182  +
    /// Creates a new builder-style object to manufacture [`MapWithEnumKeyOpInput`](crate::input::MapWithEnumKeyOpInput).
         183  +
    pub fn builder() -> crate::input::map_with_enum_key_op_input::Builder {
         184  +
        crate::input::map_with_enum_key_op_input::Builder::default()
         185  +
    }
         186  +
}
         187  +
impl crate::constrained::Constrained for crate::input::MapWithEnumKeyOpInput {
         188  +
    type Unconstrained = crate::input::map_with_enum_key_op_input::Builder;
         189  +
}
         190  +
         191  +
#[allow(missing_docs)] // documentation missing in model
         192  +
#[derive(
         193  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         194  +
)]
         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()
         200  +
    }
         201  +
}
         202  +
impl crate::constrained::Constrained for crate::input::StatusResponseInput {
         203  +
    type Unconstrained = crate::input::status_response_input::Builder;
         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 struct EnumQueryInput {
         211  +
    #[allow(missing_docs)] // documentation missing in model
         212  +
    pub r#enum: crate::model::StringEnum,
         213  +
}
         214  +
impl EnumQueryInput {
         215  +
    #[allow(missing_docs)] // documentation missing in model
         216  +
    pub fn r#enum(&self) -> &crate::model::StringEnum {
         217  +
        &self.r#enum
         218  +
    }
         219  +
}
         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()
         224  +
    }
         225  +
}
         226  +
impl crate::constrained::Constrained for crate::input::EnumQueryInput {
         227  +
    type Unconstrained = crate::input::enum_query_input::Builder;
         228  +
}
         229  +
         230  +
#[allow(missing_docs)] // documentation missing in model
         231  +
#[derive(
         232  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         233  +
)]
         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()
         239  +
    }
         240  +
}
         241  +
impl crate::constrained::Constrained for crate::input::PrimitiveIntHeaderInput {
         242  +
    type Unconstrained = crate::input::primitive_int_header_input::Builder;
         243  +
}
         244  +
         245  +
#[allow(missing_docs)] // documentation missing in model
         246  +
#[derive(
         247  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         248  +
)]
         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()
         257  +
    }
         258  +
}
         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()
         263  +
    }
         264  +
}
         265  +
impl crate::constrained::Constrained for crate::input::StringPayloadInput {
         266  +
    type Unconstrained = crate::input::string_payload_input::Builder;
         267  +
}
         268  +
/// See [`HttpQueryParamsOnlyOperationInput`](crate::input::HttpQueryParamsOnlyOperationInput).
         269  +
pub mod http_query_params_only_operation_input {
         270  +
         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 {
         284  +
        #[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  +
        }
         294  +
        #[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<
         299  +
                    ::std::collections::HashMap<::std::string::String, ::std::string::String>,
         300  +
                >,
         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,
         315  +
            }
         316  +
        }
         317  +
    }
         318  +
}
         319  +
/// See [`QueryPrecedenceInput`](crate::input::QueryPrecedenceInput).
         320  +
pub mod query_precedence_input {
         321  +
         322  +
    impl ::std::convert::From<Builder> for crate::input::QueryPrecedenceInput {
         323  +
        fn from(builder: Builder) -> Self {
         324  +
            builder.build()
         325  +
        }
         326  +
    }
         327  +
    /// A builder for [`QueryPrecedenceInput`](crate::input::QueryPrecedenceInput).
         328  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         329  +
    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  +
        >,
         334  +
    }
         335  +
    impl Builder {
         336  +
        #[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;
         339  +
            self
         340  +
        }
         341  +
        #[allow(missing_docs)] // documentation missing in model
         342  +
        pub(crate) fn set_foo(
         343  +
            mut self,
         344  +
            input: Option<impl ::std::convert::Into<::std::string::String>>,
         345  +
        ) -> 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());
         369  +
            self
         370  +
        }
         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 {
         397  +
            self.build_enforcing_all_constraints()
         398  +
        }
         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()
         421  +
        }
         422  +
        fn build_enforcing_all_constraints(
         423  +
            self,
         424  +
        ) -> crate::input::CaseInsensitiveErrorOperationInput {
         425  +
            crate::input::CaseInsensitiveErrorOperationInput {}
         426  +
        }
         427  +
    }
         428  +
}
         429  +
/// See [`NullInNonSparseInput`](crate::input::NullInNonSparseInput).
         430  +
pub mod null_in_non_sparse_input {
         431  +
         432  +
    impl ::std::convert::From<Builder> for crate::input::NullInNonSparseInput {
         433  +
        fn from(builder: Builder) -> Self {
         434  +
            builder.build()
         435  +
        }
         436  +
    }
         437  +
    /// A builder for [`NullInNonSparseInput`](crate::input::NullInNonSparseInput).
         438  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         439  +
    pub struct Builder {}
         440  +
    impl Builder {
         441  +
        /// Consumes the builder and constructs a [`NullInNonSparseInput`](crate::input::NullInNonSparseInput).
         442  +
        pub fn build(self) -> crate::input::NullInNonSparseInput {
         443  +
            self.build_enforcing_all_constraints()
         444  +
        }
         445  +
        fn build_enforcing_all_constraints(self) -> crate::input::NullInNonSparseInput {
         446  +
            crate::input::NullInNonSparseInput {}
         447  +
        }
         448  +
    }
         449  +
}
         450  +
/// See [`EscapedStringValuesInput`](crate::input::EscapedStringValuesInput).
         451  +
pub mod escaped_string_values_input {
         452  +
         453  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
         454  +
    /// Holds one variant for each of the ways the builder can fail.
         455  +
    #[non_exhaustive]
         456  +
    #[allow(clippy::enum_variant_names)]
         457  +
    pub enum ConstraintViolation {
         458  +
        /// Constraint violation occurred building member `r#enum` when building `EscapedStringValuesInput`.
         459  +
        #[doc(hidden)]
         460  +
        Enum(crate::model::enum_with_escaped_chars::ConstraintViolation),
         461  +
    }
         462  +
    impl ::std::fmt::Display for ConstraintViolation {
         463  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         464  +
            match self {
         465  +
                ConstraintViolation::Enum(_) => write!(f, "constraint violation occurred building member `r#enum` when building `EscapedStringValuesInput`"),
         466  +
            }
         467  +
        }
         468  +
    }
         469  +
    impl ::std::error::Error for ConstraintViolation {}
         470  +
    impl ConstraintViolation {
         471  +
        pub(crate) fn as_validation_exception_field(
         472  +
            self,
         473  +
            path: ::std::string::String,
         474  +
        ) -> crate::model::ValidationExceptionField {
         475  +
            match self {
         476  +
                ConstraintViolation::Enum(inner) => {
         477  +
                    inner.as_validation_exception_field(path + "/enum")
         478  +
                }
         479  +
            }
         480  +
        }
         481  +
    }
         482  +
    impl ::std::convert::From<ConstraintViolation>
         483  +
        for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
         484  +
    {
         485  +
        fn from(constraint_violation: ConstraintViolation) -> Self {
         486  +
            let first_validation_exception_field =
         487  +
                constraint_violation.as_validation_exception_field("".to_owned());
         488  +
            let validation_exception = crate::error::ValidationException {
         489  +
                message: format!(
         490  +
                    "1 validation error detected. {}",
         491  +
                    &first_validation_exception_field.message
         492  +
                ),
         493  +
                field_list: Some(vec![first_validation_exception_field]),
         494  +
            };
         495  +
            Self::ConstraintViolation(
         496  +
                                crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
         497  +
                                    .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
         498  +
                            )
         499  +
        }
         500  +
    }
         501  +
    impl ::std::convert::From<Builder>
         502  +
        for crate::constrained::MaybeConstrained<crate::input::EscapedStringValuesInput>
         503  +
    {
         504  +
        fn from(builder: Builder) -> Self {
         505  +
            Self::Unconstrained(builder)
         506  +
        }
         507  +
    }
         508  +
    impl ::std::convert::TryFrom<Builder> for crate::input::EscapedStringValuesInput {
         509  +
        type Error = ConstraintViolation;
         510  +
         511  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
         512  +
            builder.build()
         513  +
        }
         514  +
    }
         515  +
    /// A builder for [`EscapedStringValuesInput`](crate::input::EscapedStringValuesInput).
         516  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         517  +
    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>,
         522  +
    }
         523  +
    impl Builder {
         524  +
        #[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);
         530  +
            self
         531  +
        }
         532  +
        #[allow(missing_docs)] // documentation missing in model
         533  +
        pub(crate) fn set_enum(
         534  +
            mut self,
         535  +
            input: Option<
         536  +
                impl ::std::convert::Into<
         537  +
                    crate::constrained::MaybeConstrained<crate::model::EnumWithEscapedChars>,
         538  +
                >,
         539  +
            >,
         540  +
        ) -> 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());
         555  +
            self
         556  +
        }
         557  +
        /// Consumes the builder and constructs a [`EscapedStringValuesInput`](crate::input::EscapedStringValuesInput).
         558  +
        ///
         559  +
        /// The builder fails to construct a [`EscapedStringValuesInput`](crate::input::EscapedStringValuesInput) if a [`ConstraintViolation`] occurs.
         560  +
        ///
         561  +
        pub fn build(self) -> Result<crate::input::EscapedStringValuesInput, ConstraintViolation> {
         562  +
            self.build_enforcing_all_constraints()
         563  +
        }
         564  +
        fn build_enforcing_all_constraints(
         565  +
            self,
         566  +
        ) -> Result<crate::input::EscapedStringValuesInput, ConstraintViolation> {
         567  +
            Ok(crate::input::EscapedStringValuesInput {
         568  +
                r#enum: self
         569  +
                    .r#enum
         570  +
                    .map(|v| match v {
         571  +
                        crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
         572  +
                        crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
         573  +
                    })
         574  +
                    .map(|res| res.map_err(ConstraintViolation::Enum))
         575  +
                    .transpose()?,
         576  +
                some_string: self.some_string,
         577  +
            })
         578  +
        }
         579  +
    }
         580  +
}
         581  +
/// See [`PrimitiveIntOpInput`](crate::input::PrimitiveIntOpInput).
         582  +
pub mod primitive_int_op_input {
         583  +
         584  +
    impl ::std::convert::From<Builder> for crate::input::PrimitiveIntOpInput {
         585  +
        fn from(builder: Builder) -> Self {
         586  +
            builder.build()
         587  +
        }
         588  +
    }
         589  +
    /// A builder for [`PrimitiveIntOpInput`](crate::input::PrimitiveIntOpInput).
         590  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         591  +
    pub struct Builder {
         592  +
        pub(crate) value: ::std::option::Option<i32>,
         593  +
    }
         594  +
    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 {
         607  +
            self.build_enforcing_all_constraints()
         608  +
        }
         609  +
        fn build_enforcing_all_constraints(self) -> crate::input::PrimitiveIntOpInput {
         610  +
            crate::input::PrimitiveIntOpInput {
         611  +
                value: self.value.unwrap_or(0i32),
         612  +
            }
         613  +
        }
         614  +
    }
         615  +
}
         616  +
/// See [`MapWithEnumKeyOpInput`](crate::input::MapWithEnumKeyOpInput).
         617  +
pub mod map_with_enum_key_op_input {
         618  +
         619  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
         620  +
    /// Holds one variant for each of the ways the builder can fail.
         621  +
    #[non_exhaustive]
         622  +
    #[allow(clippy::enum_variant_names)]
         623  +
    pub enum ConstraintViolation {
         624  +
        /// Constraint violation occurred building member `map` when building `MapWithEnumKeyOpInput`.
         625  +
        #[doc(hidden)]
         626  +
        Map(crate::model::map_with_enum_key::ConstraintViolation),
         627  +
    }
         628  +
    impl ::std::fmt::Display for ConstraintViolation {
         629  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         630  +
            match self {
         631  +
                ConstraintViolation::Map(_) => write!(f, "constraint violation occurred building member `map` when building `MapWithEnumKeyOpInput`"),
         632  +
            }
         633  +
        }
         634  +
    }
         635  +
    impl ::std::error::Error for ConstraintViolation {}
         636  +
    impl ConstraintViolation {
         637  +
        pub(crate) fn as_validation_exception_field(
         638  +
            self,
         639  +
            path: ::std::string::String,
         640  +
        ) -> crate::model::ValidationExceptionField {
         641  +
            match self {
         642  +
                ConstraintViolation::Map(inner) => {
         643  +
                    inner.as_validation_exception_field(path + "/map")
         644  +
                }
         645  +
            }
         646  +
        }
         647  +
    }
         648  +
    impl ::std::convert::From<ConstraintViolation>
         649  +
        for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
         650  +
    {
         651  +
        fn from(constraint_violation: ConstraintViolation) -> Self {
         652  +
            let first_validation_exception_field =
         653  +
                constraint_violation.as_validation_exception_field("".to_owned());
         654  +
            let validation_exception = crate::error::ValidationException {
         655  +
                message: format!(
         656  +
                    "1 validation error detected. {}",
         657  +
                    &first_validation_exception_field.message
         658  +
                ),
         659  +
                field_list: Some(vec![first_validation_exception_field]),
         660  +
            };
         661  +
            Self::ConstraintViolation(
         662  +
                                crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
         663  +
                                    .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
         664  +
                            )
         665  +
        }
         666  +
    }
         667  +
    impl ::std::convert::From<Builder>
         668  +
        for crate::constrained::MaybeConstrained<crate::input::MapWithEnumKeyOpInput>
         669  +
    {
         670  +
        fn from(builder: Builder) -> Self {
         671  +
            Self::Unconstrained(builder)
         672  +
        }
         673  +
    }
         674  +
    impl ::std::convert::TryFrom<Builder> for crate::input::MapWithEnumKeyOpInput {
         675  +
        type Error = ConstraintViolation;
         676  +
         677  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
         678  +
            builder.build()
         679  +
        }
         680  +
    }
         681  +
    /// A builder for [`MapWithEnumKeyOpInput`](crate::input::MapWithEnumKeyOpInput).
         682  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         683  +
    pub struct Builder {
         684  +
        pub(crate) map: ::std::option::Option<
         685  +
            crate::constrained::MaybeConstrained<
         686  +
                crate::constrained::map_with_enum_key_constrained::MapWithEnumKeyConstrained,
         687  +
            >,
         688  +
        >,
         689  +
    }
         690  +
    impl Builder {
         691  +
        #[allow(missing_docs)] // documentation missing in model
         692  +
        pub fn map(
         693  +
            mut self,
         694  +
            input: ::std::option::Option<
         695  +
                ::std::collections::HashMap<crate::model::StringEnum, ::std::string::String>,
         696  +
            >,
         697  +
        ) -> Self {
         698  +
            self.map = input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
         699  +
            self
         700  +
        }
         701  +
        #[allow(missing_docs)] // documentation missing in model
         702  +
        pub(crate) fn set_map(
         703  +
            mut self,
         704  +
            input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_with_enum_key_constrained::MapWithEnumKeyConstrained>>>,
         705  +
        ) -> Self {
         706  +
            self.map = input.map(|v| v.into());
         707  +
            self
         708  +
        }
         709  +
        /// Consumes the builder and constructs a [`MapWithEnumKeyOpInput`](crate::input::MapWithEnumKeyOpInput).
         710  +
        ///
         711  +
        /// The builder fails to construct a [`MapWithEnumKeyOpInput`](crate::input::MapWithEnumKeyOpInput) if a [`ConstraintViolation`] occurs.
         712  +
        ///
         713  +
        pub fn build(self) -> Result<crate::input::MapWithEnumKeyOpInput, ConstraintViolation> {
         714  +
            self.build_enforcing_all_constraints()
         715  +
        }
         716  +
        fn build_enforcing_all_constraints(
         717  +
            self,
         718  +
        ) -> Result<crate::input::MapWithEnumKeyOpInput, ConstraintViolation> {
         719  +
            Ok(crate::input::MapWithEnumKeyOpInput {
         720  +
                map: self
         721  +
                    .map
         722  +
                    .map(|v| match v {
         723  +
                        crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
         724  +
                        crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
         725  +
                    })
         726  +
                    .map(|res| res.map(|v| v.into()).map_err(ConstraintViolation::Map))
         727  +
                    .transpose()?,
         728  +
            })
         729  +
        }
         730  +
    }
         731  +
}
         732  +
/// See [`StatusResponseInput`](crate::input::StatusResponseInput).
         733  +
pub mod status_response_input {
         734  +
         735  +
    impl ::std::convert::From<Builder> for crate::input::StatusResponseInput {
         736  +
        fn from(builder: Builder) -> Self {
         737  +
            builder.build()
         738  +
        }
         739  +
    }
         740  +
    /// A builder for [`StatusResponseInput`](crate::input::StatusResponseInput).
         741  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         742  +
    pub struct Builder {}
         743  +
    impl Builder {
         744  +
        /// Consumes the builder and constructs a [`StatusResponseInput`](crate::input::StatusResponseInput).
         745  +
        pub fn build(self) -> crate::input::StatusResponseInput {
         746  +
            self.build_enforcing_all_constraints()
         747  +
        }
         748  +
        fn build_enforcing_all_constraints(self) -> crate::input::StatusResponseInput {
         749  +
            crate::input::StatusResponseInput {}
         750  +
        }
         751  +
    }
         752  +
}
         753  +
/// See [`EnumQueryInput`](crate::input::EnumQueryInput).
         754  +
pub mod enum_query_input {
         755  +
         756  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
         757  +
    /// Holds one variant for each of the ways the builder can fail.
         758  +
    #[non_exhaustive]
         759  +
    #[allow(clippy::enum_variant_names)]
         760  +
    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`.
         764  +
        #[doc(hidden)]
         765  +
        Enum(crate::model::string_enum::ConstraintViolation),
         766  +
    }
         767  +
    impl ::std::fmt::Display for ConstraintViolation {
         768  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         769  +
            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`"),
         772  +
            }
         773  +
        }
         774  +
    }
         775  +
    impl ::std::error::Error for ConstraintViolation {}
         776  +
    impl ConstraintViolation {
         777  +
        pub(crate) fn as_validation_exception_field(
         778  +
            self,
         779  +
            path: ::std::string::String,
         780  +
        ) -> crate::model::ValidationExceptionField {
         781  +
            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  +
                ConstraintViolation::Enum(inner) => {
         790  +
                    inner.as_validation_exception_field(path + "/enum")
         791  +
                }
         792  +
            }
         793  +
        }
         794  +
    }
         795  +
    impl ::std::convert::From<ConstraintViolation>
         796  +
        for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
         797  +
    {
         798  +
        fn from(constraint_violation: ConstraintViolation) -> Self {
         799  +
            let first_validation_exception_field =
         800  +
                constraint_violation.as_validation_exception_field("".to_owned());
         801  +
            let validation_exception = crate::error::ValidationException {
         802  +
                message: format!(
         803  +
                    "1 validation error detected. {}",
         804  +
                    &first_validation_exception_field.message
         805  +
                ),
         806  +
                field_list: Some(vec![first_validation_exception_field]),
         807  +
            };
         808  +
            Self::ConstraintViolation(
         809  +
                                crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
         810  +
                                    .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
         811  +
                            )
         812  +
        }
         813  +
    }
         814  +
    impl ::std::convert::From<Builder>
         815  +
        for crate::constrained::MaybeConstrained<crate::input::EnumQueryInput>
         816  +
    {
         817  +
        fn from(builder: Builder) -> Self {
         818  +
            Self::Unconstrained(builder)
         819  +
        }
         820  +
    }
         821  +
    impl ::std::convert::TryFrom<Builder> for crate::input::EnumQueryInput {
         822  +
        type Error = ConstraintViolation;
         823  +
         824  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
         825  +
            builder.build()
         826  +
        }
         827  +
    }
         828  +
    /// A builder for [`EnumQueryInput`](crate::input::EnumQueryInput).
         829  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         830  +
    pub struct Builder {
         831  +
        pub(crate) r#enum:
         832  +
            ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::StringEnum>>,
         833  +
    }
         834  +
    impl Builder {
         835  +
        #[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));
         838  +
            self
         839  +
        }
         840  +
        #[allow(missing_docs)] // documentation missing in model
         841  +
        pub(crate) fn set_enum(
         842  +
            mut self,
         843  +
            input: impl ::std::convert::Into<
         844  +
                crate::constrained::MaybeConstrained<crate::model::StringEnum>,
         845  +
            >,
         846  +
        ) -> Self {
         847  +
            self.r#enum = Some(input.into());
         848  +
            self
         849  +
        }
         850  +
        /// Consumes the builder and constructs a [`EnumQueryInput`](crate::input::EnumQueryInput).
         851  +
        ///
         852  +
        /// The builder fails to construct a [`EnumQueryInput`](crate::input::EnumQueryInput) if a [`ConstraintViolation`] occurs.
         853  +
        ///
         854  +
        /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
         855  +
        pub fn build(self) -> Result<crate::input::EnumQueryInput, ConstraintViolation> {
         856  +
            self.build_enforcing_all_constraints()
         857  +
        }
         858  +
        fn build_enforcing_all_constraints(
         859  +
            self,
         860  +
        ) -> Result<crate::input::EnumQueryInput, ConstraintViolation> {
         861  +
            Ok(crate::input::EnumQueryInput {
         862  +
                r#enum: self
         863  +
                    .r#enum
         864  +
                    .map(|v| match v {
         865  +
                        crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
         866  +
                        crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
         867  +
                    })
         868  +
                    .map(|res| res.map_err(ConstraintViolation::Enum))
         869  +
                    .transpose()?
         870  +
                    .ok_or(ConstraintViolation::MissingEnum)?,
         871  +
            })
         872  +
        }
         873  +
    }
         874  +
}
         875  +
/// See [`PrimitiveIntHeaderInput`](crate::input::PrimitiveIntHeaderInput).
         876  +
pub mod primitive_int_header_input {
         877  +
         878  +
    impl ::std::convert::From<Builder> for crate::input::PrimitiveIntHeaderInput {
         879  +
        fn from(builder: Builder) -> Self {
         880  +
            builder.build()
         881  +
        }
         882  +
    }
         883  +
    /// A builder for [`PrimitiveIntHeaderInput`](crate::input::PrimitiveIntHeaderInput).
         884  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         885  +
    pub struct Builder {}
         886  +
    impl Builder {
         887  +
        /// Consumes the builder and constructs a [`PrimitiveIntHeaderInput`](crate::input::PrimitiveIntHeaderInput).
         888  +
        pub fn build(self) -> crate::input::PrimitiveIntHeaderInput {
         889  +
            self.build_enforcing_all_constraints()
         890  +
        }
         891  +
        fn build_enforcing_all_constraints(self) -> crate::input::PrimitiveIntHeaderInput {
         892  +
            crate::input::PrimitiveIntHeaderInput {}
         893  +
        }
         894  +
    }
         895  +
}
         896  +
/// See [`StringPayloadInput`](crate::input::StringPayloadInput).
         897  +
pub mod string_payload_input {
         898  +
         899  +
    impl ::std::convert::From<Builder> for crate::input::StringPayloadInput {
         900  +
        fn from(builder: Builder) -> Self {
         901  +
            builder.build()
         902  +
        }
         903  +
    }
         904  +
    /// A builder for [`StringPayloadInput`](crate::input::StringPayloadInput).
         905  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         906  +
    pub struct Builder {
         907  +
        pub(crate) payload: ::std::option::Option<::std::string::String>,
         908  +
    }
         909  +
    impl Builder {
         910  +
        #[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;
         913  +
            self
         914  +
        }
         915  +
        #[allow(missing_docs)] // documentation missing in model
         916  +
        pub(crate) fn set_payload(
         917  +
            mut self,
         918  +
            input: Option<impl ::std::convert::Into<::std::string::String>>,
         919  +
        ) -> Self {
         920  +
            self.payload = input.map(|v| v.into());
         921  +
            self
         922  +
        }
         923  +
        /// Consumes the builder and constructs a [`StringPayloadInput`](crate::input::StringPayloadInput).
         924  +
        pub fn build(self) -> crate::input::StringPayloadInput {
         925  +
            self.build_enforcing_all_constraints()
         926  +
        }
         927  +
        fn build_enforcing_all_constraints(self) -> crate::input::StringPayloadInput {
         928  +
            crate::input::StringPayloadInput {
         929  +
                payload: self.payload,
         930  +
            }
         931  +
        }
         932  +
    }
         933  +
}

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

@@ -0,1 +0,306 @@
           1  +
#![allow(deprecated)]
           2  +
#![allow(unknown_lints)]
           3  +
#![allow(clippy::module_inception)]
           4  +
#![allow(clippy::upper_case_acronyms)]
           5  +
#![allow(clippy::large_enum_variant)]
           6  +
#![allow(clippy::wrong_self_convention)]
           7  +
#![allow(clippy::should_implement_trait)]
           8  +
#![allow(clippy::disallowed_names)]
           9  +
#![allow(clippy::vec_init_then_push)]
          10  +
#![allow(clippy::type_complexity)]
          11  +
#![allow(clippy::needless_return)]
          12  +
#![allow(clippy::derive_partial_eq_without_eq)]
          13  +
#![allow(clippy::result_large_err)]
          14  +
#![allow(clippy::unnecessary_map_on_constructor)]
          15  +
#![allow(clippy::deprecated_semver)]
          16  +
#![allow(clippy::uninlined_format_args)]
          17  +
#![allow(rustdoc::bare_urls)]
          18  +
#![allow(rustdoc::redundant_explicit_links)]
          19  +
#![allow(rustdoc::invalid_html_tags)]
          20  +
#![forbid(unsafe_code)]
          21  +
#![cfg_attr(docsrs, feature(doc_cfg))]
          22  +
//! A REST JSON service that sends JSON requests and responses.
          23  +
          24  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
          25  +
//! A fast and customizable Rust implementation of the RestJsonExtras Smithy service.
          26  +
//!
          27  +
//! # Using RestJsonExtras
          28  +
//!
          29  +
//! The primary entrypoint is [`RestJsonExtras`]: it satisfies the [`Service<http::Request, Response = http::Response>`](::tower::Service)
          30  +
//! trait and therefore can be handed to a [`hyper` server](https://github.com/hyperium/hyper) via [`RestJsonExtras::into_make_service`]
          31  +
//! or used in AWS Lambda
          32  +
#![cfg_attr(
          33  +
    feature = "aws-lambda",
          34  +
    doc = " via [`LambdaHandler`](crate::server::routing::LambdaHandler)."
          35  +
)]
          36  +
#![cfg_attr(
          37  +
    not(feature = "aws-lambda"),
          38  +
    doc = " by enabling the `aws-lambda` feature flag and utilizing the `LambdaHandler`."
          39  +
)]
          40  +
//! The [`crate::input`], [`crate::output`], and [`crate::error`]
          41  +
//! modules provide the types used in each operation.
          42  +
//!
          43  +
//! ### Running on Hyper
          44  +
//!
          45  +
//! ```rust,no_run
          46  +
//! # use std::net::SocketAddr;
          47  +
//! # async fn dummy() {
          48  +
//! use rest_json_extras_http0x::{RestJsonExtras, RestJsonExtrasConfig};
          49  +
//!
          50  +
//! # let app = RestJsonExtras::builder(
          51  +
//! #     RestJsonExtrasConfig::builder()
          52  +
//! #         .build()
          53  +
//! # ).build_unchecked();
          54  +
//! let server = app.into_make_service();
          55  +
//! let bind: SocketAddr = "127.0.0.1:6969".parse()
          56  +
//!     .expect("unable to parse the server bind address and port");
          57  +
//! ::hyper::Server::bind(&bind).serve(server).await.unwrap();
          58  +
//! # }
          59  +
//!
          60  +
//! ```
          61  +
//!
          62  +
//! ### Running on Lambda
          63  +
//!
          64  +
//! ```rust,ignore
          65  +
//! use rest_json_extras_http0x::server::routing::LambdaHandler;
          66  +
//! use rest_json_extras_http0x::RestJsonExtras;
          67  +
//!
          68  +
//! # async fn dummy() {
          69  +
//! # let app = RestJsonExtras::builder(
          70  +
//! #     RestJsonExtrasConfig::builder()
          71  +
//! #         .build()
          72  +
//! # ).build_unchecked();
          73  +
//! let handler = LambdaHandler::new(app);
          74  +
//! lambda_http::run(handler).await.unwrap();
          75  +
//! # }
          76  +
//! ```
          77  +
//!
          78  +
//! # Building the RestJsonExtras
          79  +
//!
          80  +
//! To construct [`RestJsonExtras`] we use [`RestJsonExtrasBuilder`] returned by [`RestJsonExtras::builder`].
          81  +
//!
          82  +
//! ## Plugins
          83  +
//!
          84  +
//! The [`RestJsonExtras::builder`] method, returning [`RestJsonExtrasBuilder`],
          85  +
//! accepts a config object on which plugins can be registered.
          86  +
//! Plugins allow you to build middleware which is aware of the operation it is being applied to.
          87  +
//!
          88  +
//! ```rust,no_run
          89  +
//! # use rest_json_extras_http0x::server::plugin::IdentityPlugin as LoggingPlugin;
          90  +
//! # use rest_json_extras_http0x::server::plugin::IdentityPlugin as MetricsPlugin;
          91  +
//! # use ::hyper::Body;
          92  +
//! use rest_json_extras_http0x::server::plugin::HttpPlugins;
          93  +
//! use rest_json_extras_http0x::{RestJsonExtras, RestJsonExtrasConfig, RestJsonExtrasBuilder};
          94  +
//!
          95  +
//! let http_plugins = HttpPlugins::new()
          96  +
//!         .push(LoggingPlugin)
          97  +
//!         .push(MetricsPlugin);
          98  +
//! let config = RestJsonExtrasConfig::builder().build();
          99  +
//! let builder: RestJsonExtrasBuilder<::hyper::Body, _, _, _> = RestJsonExtras::builder(config);
         100  +
//! ```
         101  +
//!
         102  +
//! Check out [`crate::server::plugin`] to learn more about plugins.
         103  +
//!
         104  +
//! ## Handlers
         105  +
//!
         106  +
//! [`RestJsonExtrasBuilder`] provides a setter method for each operation in your Smithy model. The setter methods expect an async function as input, matching the signature for the corresponding operation in your Smithy model.
         107  +
//! We call these async functions **handlers**. This is where your application business logic lives.
         108  +
//!
         109  +
//! Every handler must take an `Input`, and optional [`extractor arguments`](crate::server::request), while returning:
         110  +
//!
         111  +
//! * A `Result<Output, Error>` if your operation has modeled errors, or
         112  +
//! * An `Output` otherwise.
         113  +
//!
         114  +
//! ```rust,no_run
         115  +
//! # struct Input;
         116  +
//! # struct Output;
         117  +
//! # struct Error;
         118  +
//! async fn infallible_handler(input: Input) -> Output { todo!() }
         119  +
//!
         120  +
//! async fn fallible_handler(input: Input) -> Result<Output, Error> { todo!() }
         121  +
//! ```
         122  +
//!
         123  +
//! Handlers can accept up to 8 extractors:
         124  +
//!
         125  +
//! ```rust,no_run
         126  +
//! # struct Input;
         127  +
//! # struct Output;
         128  +
//! # struct Error;
         129  +
//! # struct State;
         130  +
//! # use std::net::SocketAddr;
         131  +
//! use rest_json_extras_http0x::server::request::{extension::Extension, connect_info::ConnectInfo};
         132  +
//!
         133  +
//! async fn handler_with_no_extensions(input: Input) -> Output {
         134  +
//!     todo!()
         135  +
//! }
         136  +
//!
         137  +
//! async fn handler_with_one_extractor(input: Input, ext: Extension<State>) -> Output {
         138  +
//!     todo!()
         139  +
//! }
         140  +
//!
         141  +
//! async fn handler_with_two_extractors(
         142  +
//!     input: Input,
         143  +
//!     ext0: Extension<State>,
         144  +
//!     ext1: ConnectInfo<SocketAddr>,
         145  +
//! ) -> Output {
         146  +
//!     todo!()
         147  +
//! }
         148  +
//! ```
         149  +
//!
         150  +
//! See the [`operation module`](crate::operation) for information on precisely what constitutes a handler.
         151  +
//!
         152  +
//! ## Build
         153  +
//!
         154  +
//! You can convert [`RestJsonExtrasBuilder`] into [`RestJsonExtras`] using either [`RestJsonExtrasBuilder::build`] or [`RestJsonExtrasBuilder::build_unchecked`].
         155  +
//!
         156  +
//! [`RestJsonExtrasBuilder::build`] requires you to provide a handler for every single operation in your Smithy model. It will return an error if that is not the case.
         157  +
//!
         158  +
//! [`RestJsonExtrasBuilder::build_unchecked`], instead, does not require exhaustiveness. The server will automatically return 500 Internal Server Error to all requests for operations that do not have a registered handler.
         159  +
//! [`RestJsonExtrasBuilder::build_unchecked`] is particularly useful if you are deploying your Smithy service as a collection of Lambda functions, where each Lambda is only responsible for a subset of the operations in the Smithy service (or even a single one!).
         160  +
//!
         161  +
//! # Example
         162  +
//!
         163  +
//! ```rust,no_run
         164  +
//! # use std::net::SocketAddr;
         165  +
//! use rest_json_extras_http0x::{RestJsonExtras, RestJsonExtrasConfig};
         166  +
//!
         167  +
//! #[::tokio::main]
         168  +
//! pub async fn main() {
         169  +
//!    let config = RestJsonExtrasConfig::builder().build();
         170  +
//!    let app = RestJsonExtras::builder(config)
         171  +
//!        .case_insensitive_error_operation(case_insensitive_error_operation)
         172  +
//!        .empty_struct_with_content_on_wire_op(empty_struct_with_content_on_wire_op)
         173  +
//!        .enum_query(enum_query)
         174  +
//!        .escaped_string_values(escaped_string_values)
         175  +
//!        .http_query_params_only_operation(http_query_params_only_operation)
         176  +
//!        .map_with_enum_key_op(map_with_enum_key_op)
         177  +
//!        .null_in_non_sparse(null_in_non_sparse)
         178  +
//!        .primitive_int_header(primitive_int_header)
         179  +
//!        .primitive_int_op(primitive_int_op)
         180  +
//!        .query_precedence(query_precedence)
         181  +
//!        .status_response(status_response)
         182  +
//!        .string_payload(string_payload)
         183  +
//!        .build()
         184  +
//!        .expect("failed to build an instance of RestJsonExtras");
         185  +
//!
         186  +
//!    let bind: SocketAddr = "127.0.0.1:6969".parse()
         187  +
//!        .expect("unable to parse the server bind address and port");
         188  +
//!    let server = ::hyper::Server::bind(&bind).serve(app.into_make_service());
         189  +
//!    # let server = async { Ok::<_, ()>(()) };
         190  +
//!
         191  +
//!    // Run your service!
         192  +
//!    if let Err(err) = server.await {
         193  +
//!        eprintln!("server error: {:?}", err);
         194  +
//!    }
         195  +
//! }
         196  +
//!
         197  +
//! use rest_json_extras_http0x::{input, output, error};
         198  +
//!
         199  +
//! async fn case_insensitive_error_operation(input: input::CaseInsensitiveErrorOperationInput) -> Result<output::CaseInsensitiveErrorOperationOutput, error::CaseInsensitiveErrorOperationError> {
         200  +
//!     todo!()
         201  +
//! }
         202  +
//!
         203  +
//! async fn empty_struct_with_content_on_wire_op(input: input::EmptyStructWithContentOnWireOpInput) -> Result<output::EmptyStructWithContentOnWireOpOutput, error::EmptyStructWithContentOnWireOpError> {
         204  +
//!     todo!()
         205  +
//! }
         206  +
//!
         207  +
//! async fn enum_query(input: input::EnumQueryInput) -> Result<output::EnumQueryOutput, error::EnumQueryError> {
         208  +
//!     todo!()
         209  +
//! }
         210  +
//!
         211  +
//! async fn escaped_string_values(input: input::EscapedStringValuesInput) -> Result<output::EscapedStringValuesOutput, error::EscapedStringValuesError> {
         212  +
//!     todo!()
         213  +
//! }
         214  +
//!
         215  +
//! async fn http_query_params_only_operation(input: input::HttpQueryParamsOnlyOperationInput) -> Result<output::HttpQueryParamsOnlyOperationOutput, error::HttpQueryParamsOnlyOperationError> {
         216  +
//!     todo!()
         217  +
//! }
         218  +
//!
         219  +
//! async fn map_with_enum_key_op(input: input::MapWithEnumKeyOpInput) -> Result<output::MapWithEnumKeyOpOutput, error::MapWithEnumKeyOpError> {
         220  +
//!     todo!()
         221  +
//! }
         222  +
//!
         223  +
//! async fn null_in_non_sparse(input: input::NullInNonSparseInput) -> Result<output::NullInNonSparseOutput, error::NullInNonSparseError> {
         224  +
//!     todo!()
         225  +
//! }
         226  +
//!
         227  +
//! async fn primitive_int_header(input: input::PrimitiveIntHeaderInput) -> Result<output::PrimitiveIntHeaderOutput, error::PrimitiveIntHeaderError> {
         228  +
//!     todo!()
         229  +
//! }
         230  +
//!
         231  +
//! async fn primitive_int_op(input: input::PrimitiveIntOpInput) -> Result<output::PrimitiveIntOpOutput, error::PrimitiveIntOpError> {
         232  +
//!     todo!()
         233  +
//! }
         234  +
//!
         235  +
//! async fn query_precedence(input: input::QueryPrecedenceInput) -> Result<output::QueryPrecedenceOutput, error::QueryPrecedenceError> {
         236  +
//!     todo!()
         237  +
//! }
         238  +
//!
         239  +
//! async fn status_response(input: input::StatusResponseInput) -> Result<output::StatusResponseOutput, error::StatusResponseError> {
         240  +
//!     todo!()
         241  +
//! }
         242  +
//!
         243  +
//! async fn string_payload(input: input::StringPayloadInput) -> Result<output::StringPayloadOutput, error::StringPayloadError> {
         244  +
//!     todo!()
         245  +
//! }
         246  +
//!
         247  +
//! ```
         248  +
//!
         249  +
//! [`serve`]: https://docs.rs/hyper/0.14.16/hyper/server/struct.Builder.html#method.serve
         250  +
//! [hyper server]: https://docs.rs/hyper/0.14.26/hyper/server/index.html
         251  +
//! [`tower::make::MakeService`]: https://docs.rs/tower/latest/tower/make/trait.MakeService.html
         252  +
//! [HTTP binding traits]: https://smithy.io/2.0/spec/http-bindings.html
         253  +
//! [operations]: https://smithy.io/2.0/spec/service-types.html#operation
         254  +
//! [Service]: https://docs.rs/tower-service/latest/tower_service/trait.Service.html
         255  +
pub use crate::service::{
         256  +
    MissingOperationsError, RestJsonExtras, RestJsonExtrasBuilder, RestJsonExtrasConfig,
         257  +
    RestJsonExtrasConfigBuilder,
         258  +
};
         259  +
         260  +
/// Contains the types that are re-exported from the `aws-smithy-http-server` crate.
         261  +
pub mod server {
         262  +
    // Re-export all types from the `aws-smithy-http-server` crate.
         263  +
    pub use ::aws_smithy_legacy_http_server::*;
         264  +
}
         265  +
         266  +
/// Crate version number.
         267  +
pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION");
         268  +
         269  +
/// Constrained types for constrained shapes.
         270  +
mod constrained;
         271  +
         272  +
/// All error types that operations can return. Documentation on these types is copied from the model.
         273  +
pub mod error;
         274  +
         275  +
/// Input structures for operations. Documentation on these types is copied from the model.
         276  +
pub mod input;
         277  +
         278  +
/// Data structures used by operation inputs/outputs. Documentation on these types is copied from the model.
         279  +
pub mod model;
         280  +
         281  +
/// All operations that this crate can perform.
         282  +
pub mod operation;
         283  +
         284  +
/// A collection of types representing each operation defined in the service closure.
         285  +
///
         286  +
/// The [plugin system](::aws_smithy_legacy_http_server::plugin) makes use of these
         287  +
/// [zero-sized types](https://doc.rust-lang.org/nomicon/exotic-sizes.html#zero-sized-types-zsts) (ZSTs) to
         288  +
/// parameterize [`Plugin`](::aws_smithy_legacy_http_server::plugin::Plugin) implementations. Their traits, such as
         289  +
/// [`OperationShape`](::aws_smithy_legacy_http_server::operation::OperationShape), can be used to provide
         290  +
/// operation specific information to the [`Layer`](::tower::Layer) being applied.
         291  +
pub mod operation_shape;
         292  +
         293  +
/// Output structures for operations. Documentation on these types is copied from the model.
         294  +
pub mod output;
         295  +
         296  +
mod service;
         297  +
         298  +
/// Data primitives referenced by other data types.
         299  +
pub mod types;
         300  +
         301  +
/// Unconstrained types for constrained shapes.
         302  +
mod unconstrained;
         303  +
         304  +
mod mimes;
         305  +
         306  +
pub(crate) mod protocol_serde;