1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 2 | /// The service builder for [`JsonProtocol`].
|
3 3 | ///
|
4 4 | /// Constructed via [`JsonProtocol::builder`].
|
5 5 | pub struct JsonProtocolBuilder<Body, L, HttpPl, ModelPl> {
|
6 - | content_type_parameters: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
7 - | datetime_offsets: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
8 - | empty_operation: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
9 - | endpoint_operation: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
10 - | endpoint_with_host_label_operation: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
11 - | fractional_seconds: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
12 - | greeting_with_errors: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
13 - | host_with_path_operation: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
14 - | json_enums: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
15 - | json_int_enums: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
16 - | json_unions: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
17 - | kitchen_sink_operation: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
18 - | null_operation: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
19 - | operation_with_optional_input_output: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
20 - | put_and_get_inline_documents: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
21 - | put_with_content_encoding: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
22 - | simple_scalar_properties: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
23 - | sparse_nulls_operation: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
6 + | content_type_parameters: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
7 + | datetime_offsets: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
8 + | empty_operation: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
9 + | endpoint_operation: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
10 + | endpoint_with_host_label_operation:
|
11 + | Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
12 + | fractional_seconds: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
13 + | greeting_with_errors: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
14 + | host_with_path_operation: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
15 + | json_enums: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
16 + | json_int_enums: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
17 + | json_unions: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
18 + | kitchen_sink_operation: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
19 + | null_operation: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
20 + | operation_with_optional_input_output:
|
21 + | Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
22 + | put_and_get_inline_documents: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
23 + | put_with_content_encoding: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
24 + | simple_scalar_properties: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
25 + | sparse_nulls_operation: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
24 26 | layer: L,
|
25 27 | http_plugin: HttpPl,
|
26 28 | model_plugin: ModelPl,
|
27 29 | }
|
28 30 |
|
29 31 | impl<Body, L, HttpPl, ModelPl> JsonProtocolBuilder<Body, L, HttpPl, ModelPl> {
|
30 32 | /// Sets the [`ContentTypeParameters`](crate::operation_shape::ContentTypeParameters) operation.
|
31 33 | ///
|
32 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
33 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
34 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
35 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
34 36 | ///
|
35 37 | /// # Example
|
36 38 | ///
|
37 39 | /// ```no_run
|
38 40 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
39 41 | ///
|
40 42 | /// use json_rpc11::{input, output, error};
|
41 43 | ///
|
42 44 | /// async fn handler(input: input::ContentTypeParametersInput) -> Result<output::ContentTypeParametersOutput, error::ContentTypeParametersError> {
|
43 45 | /// todo!()
|
44 46 | /// }
|
45 47 | ///
|
46 48 | /// let config = JsonProtocolConfig::builder().build();
|
47 49 | /// let app = JsonProtocol::builder(config)
|
48 50 | /// .content_type_parameters(handler)
|
49 51 | /// /* Set other handlers */
|
50 52 | /// .build()
|
51 53 | /// .unwrap();
|
52 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
54 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
53 55 | /// ```
|
54 56 | ///
|
55 57 | pub fn content_type_parameters<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
56 58 | where
|
57 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::ContentTypeParameters, HandlerExtractors>,
|
59 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::ContentTypeParameters, HandlerExtractors>,
|
58 60 |
|
59 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
61 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
60 62 | JsonProtocol<L>,
|
61 63 | crate::operation_shape::ContentTypeParameters,
|
62 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::ContentTypeParameters, HandlerType>
|
64 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::ContentTypeParameters, HandlerType>
|
63 65 | >,
|
64 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
66 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
65 67 | JsonProtocol<L>,
|
66 68 | crate::operation_shape::ContentTypeParameters,
|
67 69 | ModelPl::Output
|
68 70 | >,
|
69 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
71 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
70 72 | JsonProtocol<L>,
|
71 73 | crate::operation_shape::ContentTypeParameters,
|
72 74 | <
|
73 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
74 - | as ::aws_smithy_http_server::plugin::Plugin<
|
75 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
76 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
75 77 | JsonProtocol<L>,
|
76 78 | crate::operation_shape::ContentTypeParameters,
|
77 79 | ModelPl::Output
|
78 80 | >
|
79 81 | >::Output
|
80 82 | >,
|
81 83 |
|
82 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
84 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
83 85 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
84 86 |
|
85 87 | {
|
86 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
87 - | use ::aws_smithy_http_server::plugin::Plugin;
|
88 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
89 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
88 90 | let svc = crate::operation_shape::ContentTypeParameters::from_handler(handler);
|
89 91 | let svc = self.model_plugin.apply(svc);
|
90 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
91 - | .apply(svc);
|
92 + | let svc =
|
93 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
94 + | .apply(svc);
|
92 95 | let svc = self.http_plugin.apply(svc);
|
93 96 | self.content_type_parameters_custom(svc)
|
94 97 | }
|
95 98 |
|
96 99 | /// Sets the [`ContentTypeParameters`](crate::operation_shape::ContentTypeParameters) operation.
|
97 100 | ///
|
98 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
99 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
101 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
102 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
100 103 | ///
|
101 104 | /// # Example
|
102 105 | ///
|
103 106 | /// ```no_run
|
104 107 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
105 108 | ///
|
106 109 | /// use json_rpc11::{input, output, error};
|
107 110 | ///
|
108 111 | /// async fn handler(input: input::ContentTypeParametersInput) -> Result<output::ContentTypeParametersOutput, error::ContentTypeParametersError> {
|
109 112 | /// todo!()
|
110 113 | /// }
|
111 114 | ///
|
112 115 | /// let config = JsonProtocolConfig::builder().build();
|
113 116 | /// let svc = ::tower::util::service_fn(handler);
|
114 117 | /// let app = JsonProtocol::builder(config)
|
115 118 | /// .content_type_parameters_service(svc)
|
116 119 | /// /* Set other handlers */
|
117 120 | /// .build()
|
118 121 | /// .unwrap();
|
119 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
122 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
120 123 | /// ```
|
121 124 | ///
|
122 125 | pub fn content_type_parameters_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
123 126 | where
|
124 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::ContentTypeParameters, ServiceExtractors>,
|
127 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::ContentTypeParameters, ServiceExtractors>,
|
125 128 |
|
126 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
129 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
127 130 | JsonProtocol<L>,
|
128 131 | crate::operation_shape::ContentTypeParameters,
|
129 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::ContentTypeParameters, S>
|
132 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::ContentTypeParameters, S>
|
130 133 | >,
|
131 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
134 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
132 135 | JsonProtocol<L>,
|
133 136 | crate::operation_shape::ContentTypeParameters,
|
134 137 | ModelPl::Output
|
135 138 | >,
|
136 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
139 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
137 140 | JsonProtocol<L>,
|
138 141 | crate::operation_shape::ContentTypeParameters,
|
139 142 | <
|
140 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
141 - | as ::aws_smithy_http_server::plugin::Plugin<
|
143 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
144 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
142 145 | JsonProtocol<L>,
|
143 146 | crate::operation_shape::ContentTypeParameters,
|
144 147 | ModelPl::Output
|
145 148 | >
|
146 149 | >::Output
|
147 150 | >,
|
148 151 |
|
149 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
152 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
150 153 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
151 154 |
|
152 155 | {
|
153 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
154 - | use ::aws_smithy_http_server::plugin::Plugin;
|
156 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
157 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
155 158 | let svc = crate::operation_shape::ContentTypeParameters::from_service(service);
|
156 159 | let svc = self.model_plugin.apply(svc);
|
157 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
158 - | .apply(svc);
|
160 + | let svc =
|
161 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
162 + | .apply(svc);
|
159 163 | let svc = self.http_plugin.apply(svc);
|
160 164 | self.content_type_parameters_custom(svc)
|
161 165 | }
|
162 166 |
|
163 167 | /// Sets the [`ContentTypeParameters`](crate::operation_shape::ContentTypeParameters) to a custom [`Service`](tower::Service).
|
164 168 | /// not constrained by the Smithy contract.
|
165 169 | fn content_type_parameters_custom<S>(mut self, svc: S) -> Self
|
166 170 | where
|
167 171 | S: ::tower::Service<
|
168 172 | ::http::Request<Body>,
|
169 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
173 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
170 174 | Error = ::std::convert::Infallible,
|
171 175 | > + Clone
|
172 176 | + Send
|
173 177 | + 'static,
|
174 178 | S::Future: Send + 'static,
|
175 179 | {
|
176 - | self.content_type_parameters = Some(::aws_smithy_http_server::routing::Route::new(svc));
|
180 + | self.content_type_parameters =
|
181 + | Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
177 182 | self
|
178 183 | }
|
179 184 |
|
180 185 | /// Sets the [`DatetimeOffsets`](crate::operation_shape::DatetimeOffsets) operation.
|
181 186 | ///
|
182 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
183 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
187 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
188 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
184 189 | ///
|
185 190 | /// # Example
|
186 191 | ///
|
187 192 | /// ```no_run
|
188 193 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
189 194 | ///
|
190 195 | /// use json_rpc11::{input, output, error};
|
191 196 | ///
|
192 197 | /// async fn handler(input: input::DatetimeOffsetsInput) -> Result<output::DatetimeOffsetsOutput, error::DatetimeOffsetsError> {
|
193 198 | /// todo!()
|
194 199 | /// }
|
195 200 | ///
|
196 201 | /// let config = JsonProtocolConfig::builder().build();
|
197 202 | /// let app = JsonProtocol::builder(config)
|
198 203 | /// .datetime_offsets(handler)
|
199 204 | /// /* Set other handlers */
|
200 205 | /// .build()
|
201 206 | /// .unwrap();
|
202 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
207 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
203 208 | /// ```
|
204 209 | ///
|
205 210 | pub fn datetime_offsets<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
206 211 | where
|
207 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::DatetimeOffsets, HandlerExtractors>,
|
212 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::DatetimeOffsets, HandlerExtractors>,
|
208 213 |
|
209 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
214 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
210 215 | JsonProtocol<L>,
|
211 216 | crate::operation_shape::DatetimeOffsets,
|
212 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::DatetimeOffsets, HandlerType>
|
217 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::DatetimeOffsets, HandlerType>
|
213 218 | >,
|
214 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
219 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
215 220 | JsonProtocol<L>,
|
216 221 | crate::operation_shape::DatetimeOffsets,
|
217 222 | ModelPl::Output
|
218 223 | >,
|
219 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
224 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
220 225 | JsonProtocol<L>,
|
221 226 | crate::operation_shape::DatetimeOffsets,
|
222 227 | <
|
223 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
224 - | as ::aws_smithy_http_server::plugin::Plugin<
|
228 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
229 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
225 230 | JsonProtocol<L>,
|
226 231 | crate::operation_shape::DatetimeOffsets,
|
227 232 | ModelPl::Output
|
228 233 | >
|
229 234 | >::Output
|
230 235 | >,
|
231 236 |
|
232 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
237 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
233 238 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
234 239 |
|
235 240 | {
|
236 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
237 - | use ::aws_smithy_http_server::plugin::Plugin;
|
241 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
242 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
238 243 | let svc = crate::operation_shape::DatetimeOffsets::from_handler(handler);
|
239 244 | let svc = self.model_plugin.apply(svc);
|
240 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
241 - | .apply(svc);
|
245 + | let svc =
|
246 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
247 + | .apply(svc);
|
242 248 | let svc = self.http_plugin.apply(svc);
|
243 249 | self.datetime_offsets_custom(svc)
|
244 250 | }
|
245 251 |
|
246 252 | /// Sets the [`DatetimeOffsets`](crate::operation_shape::DatetimeOffsets) operation.
|
247 253 | ///
|
248 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
249 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
254 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
255 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
250 256 | ///
|
251 257 | /// # Example
|
252 258 | ///
|
253 259 | /// ```no_run
|
254 260 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
255 261 | ///
|
256 262 | /// use json_rpc11::{input, output, error};
|
257 263 | ///
|
258 264 | /// async fn handler(input: input::DatetimeOffsetsInput) -> Result<output::DatetimeOffsetsOutput, error::DatetimeOffsetsError> {
|
259 265 | /// todo!()
|
260 266 | /// }
|
261 267 | ///
|
262 268 | /// let config = JsonProtocolConfig::builder().build();
|
263 269 | /// let svc = ::tower::util::service_fn(handler);
|
264 270 | /// let app = JsonProtocol::builder(config)
|
265 271 | /// .datetime_offsets_service(svc)
|
266 272 | /// /* Set other handlers */
|
267 273 | /// .build()
|
268 274 | /// .unwrap();
|
269 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
275 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
270 276 | /// ```
|
271 277 | ///
|
272 278 | pub fn datetime_offsets_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
273 279 | where
|
274 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::DatetimeOffsets, ServiceExtractors>,
|
280 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::DatetimeOffsets, ServiceExtractors>,
|
275 281 |
|
276 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
282 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
277 283 | JsonProtocol<L>,
|
278 284 | crate::operation_shape::DatetimeOffsets,
|
279 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::DatetimeOffsets, S>
|
285 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::DatetimeOffsets, S>
|
280 286 | >,
|
281 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
287 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
282 288 | JsonProtocol<L>,
|
283 289 | crate::operation_shape::DatetimeOffsets,
|
284 290 | ModelPl::Output
|
285 291 | >,
|
286 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
292 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
287 293 | JsonProtocol<L>,
|
288 294 | crate::operation_shape::DatetimeOffsets,
|
289 295 | <
|
290 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
291 - | as ::aws_smithy_http_server::plugin::Plugin<
|
296 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
297 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
292 298 | JsonProtocol<L>,
|
293 299 | crate::operation_shape::DatetimeOffsets,
|
294 300 | ModelPl::Output
|
295 301 | >
|
296 302 | >::Output
|
297 303 | >,
|
298 304 |
|
299 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
305 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
300 306 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
301 307 |
|
302 308 | {
|
303 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
304 - | use ::aws_smithy_http_server::plugin::Plugin;
|
309 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
310 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
305 311 | let svc = crate::operation_shape::DatetimeOffsets::from_service(service);
|
306 312 | let svc = self.model_plugin.apply(svc);
|
307 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
308 - | .apply(svc);
|
313 + | let svc =
|
314 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
315 + | .apply(svc);
|
309 316 | let svc = self.http_plugin.apply(svc);
|
310 317 | self.datetime_offsets_custom(svc)
|
311 318 | }
|
312 319 |
|
313 320 | /// Sets the [`DatetimeOffsets`](crate::operation_shape::DatetimeOffsets) to a custom [`Service`](tower::Service).
|
314 321 | /// not constrained by the Smithy contract.
|
315 322 | fn datetime_offsets_custom<S>(mut self, svc: S) -> Self
|
316 323 | where
|
317 324 | S: ::tower::Service<
|
318 325 | ::http::Request<Body>,
|
319 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
326 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
320 327 | Error = ::std::convert::Infallible,
|
321 328 | > + Clone
|
322 329 | + Send
|
323 330 | + 'static,
|
324 331 | S::Future: Send + 'static,
|
325 332 | {
|
326 - | self.datetime_offsets = Some(::aws_smithy_http_server::routing::Route::new(svc));
|
333 + | self.datetime_offsets = Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
327 334 | self
|
328 335 | }
|
329 336 |
|
330 337 | /// Sets the [`EmptyOperation`](crate::operation_shape::EmptyOperation) operation.
|
331 338 | ///
|
332 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
333 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
339 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
340 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
334 341 | ///
|
335 342 | /// # Example
|
336 343 | ///
|
337 344 | /// ```no_run
|
338 345 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
339 346 | ///
|
340 347 | /// use json_rpc11::{input, output, error};
|
341 348 | ///
|
342 349 | /// async fn handler(input: input::EmptyOperationInput) -> Result<output::EmptyOperationOutput, error::EmptyOperationError> {
|
343 350 | /// todo!()
|
344 351 | /// }
|
345 352 | ///
|
346 353 | /// let config = JsonProtocolConfig::builder().build();
|
347 354 | /// let app = JsonProtocol::builder(config)
|
348 355 | /// .empty_operation(handler)
|
349 356 | /// /* Set other handlers */
|
350 357 | /// .build()
|
351 358 | /// .unwrap();
|
352 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
359 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
353 360 | /// ```
|
354 361 | ///
|
355 362 | pub fn empty_operation<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
356 363 | where
|
357 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::EmptyOperation, HandlerExtractors>,
|
364 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::EmptyOperation, HandlerExtractors>,
|
358 365 |
|
359 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
366 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
360 367 | JsonProtocol<L>,
|
361 368 | crate::operation_shape::EmptyOperation,
|
362 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::EmptyOperation, HandlerType>
|
369 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::EmptyOperation, HandlerType>
|
363 370 | >,
|
364 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
371 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
365 372 | JsonProtocol<L>,
|
366 373 | crate::operation_shape::EmptyOperation,
|
367 374 | ModelPl::Output
|
368 375 | >,
|
369 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
376 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
370 377 | JsonProtocol<L>,
|
371 378 | crate::operation_shape::EmptyOperation,
|
372 379 | <
|
373 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
374 - | as ::aws_smithy_http_server::plugin::Plugin<
|
380 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
381 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
375 382 | JsonProtocol<L>,
|
376 383 | crate::operation_shape::EmptyOperation,
|
377 384 | ModelPl::Output
|
378 385 | >
|
379 386 | >::Output
|
380 387 | >,
|
381 388 |
|
382 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
389 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
383 390 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
384 391 |
|
385 392 | {
|
386 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
387 - | use ::aws_smithy_http_server::plugin::Plugin;
|
393 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
394 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
388 395 | let svc = crate::operation_shape::EmptyOperation::from_handler(handler);
|
389 396 | let svc = self.model_plugin.apply(svc);
|
390 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
391 - | .apply(svc);
|
397 + | let svc =
|
398 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
399 + | .apply(svc);
|
392 400 | let svc = self.http_plugin.apply(svc);
|
393 401 | self.empty_operation_custom(svc)
|
394 402 | }
|
395 403 |
|
396 404 | /// Sets the [`EmptyOperation`](crate::operation_shape::EmptyOperation) operation.
|
397 405 | ///
|
398 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
399 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
406 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
407 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
400 408 | ///
|
401 409 | /// # Example
|
402 410 | ///
|
403 411 | /// ```no_run
|
404 412 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
405 413 | ///
|
406 414 | /// use json_rpc11::{input, output, error};
|
407 415 | ///
|
408 416 | /// async fn handler(input: input::EmptyOperationInput) -> Result<output::EmptyOperationOutput, error::EmptyOperationError> {
|
409 417 | /// todo!()
|
410 418 | /// }
|
411 419 | ///
|
412 420 | /// let config = JsonProtocolConfig::builder().build();
|
413 421 | /// let svc = ::tower::util::service_fn(handler);
|
414 422 | /// let app = JsonProtocol::builder(config)
|
415 423 | /// .empty_operation_service(svc)
|
416 424 | /// /* Set other handlers */
|
417 425 | /// .build()
|
418 426 | /// .unwrap();
|
419 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
427 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
420 428 | /// ```
|
421 429 | ///
|
422 430 | pub fn empty_operation_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
423 431 | where
|
424 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::EmptyOperation, ServiceExtractors>,
|
432 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::EmptyOperation, ServiceExtractors>,
|
425 433 |
|
426 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
434 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
427 435 | JsonProtocol<L>,
|
428 436 | crate::operation_shape::EmptyOperation,
|
429 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::EmptyOperation, S>
|
437 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::EmptyOperation, S>
|
430 438 | >,
|
431 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
439 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
432 440 | JsonProtocol<L>,
|
433 441 | crate::operation_shape::EmptyOperation,
|
434 442 | ModelPl::Output
|
435 443 | >,
|
436 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
444 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
437 445 | JsonProtocol<L>,
|
438 446 | crate::operation_shape::EmptyOperation,
|
439 447 | <
|
440 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
441 - | as ::aws_smithy_http_server::plugin::Plugin<
|
448 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
449 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
442 450 | JsonProtocol<L>,
|
443 451 | crate::operation_shape::EmptyOperation,
|
444 452 | ModelPl::Output
|
445 453 | >
|
446 454 | >::Output
|
447 455 | >,
|
448 456 |
|
449 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
457 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
450 458 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
451 459 |
|
452 460 | {
|
453 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
454 - | use ::aws_smithy_http_server::plugin::Plugin;
|
461 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
462 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
455 463 | let svc = crate::operation_shape::EmptyOperation::from_service(service);
|
456 464 | let svc = self.model_plugin.apply(svc);
|
457 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
458 - | .apply(svc);
|
465 + | let svc =
|
466 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
467 + | .apply(svc);
|
459 468 | let svc = self.http_plugin.apply(svc);
|
460 469 | self.empty_operation_custom(svc)
|
461 470 | }
|
462 471 |
|
463 472 | /// Sets the [`EmptyOperation`](crate::operation_shape::EmptyOperation) to a custom [`Service`](tower::Service).
|
464 473 | /// not constrained by the Smithy contract.
|
465 474 | fn empty_operation_custom<S>(mut self, svc: S) -> Self
|
466 475 | where
|
467 476 | S: ::tower::Service<
|
468 477 | ::http::Request<Body>,
|
469 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
478 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
470 479 | Error = ::std::convert::Infallible,
|
471 480 | > + Clone
|
472 481 | + Send
|
473 482 | + 'static,
|
474 483 | S::Future: Send + 'static,
|
475 484 | {
|
476 - | self.empty_operation = Some(::aws_smithy_http_server::routing::Route::new(svc));
|
485 + | self.empty_operation = Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
477 486 | self
|
478 487 | }
|
479 488 |
|
480 489 | /// Sets the [`EndpointOperation`](crate::operation_shape::EndpointOperation) operation.
|
481 490 | ///
|
482 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
483 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
491 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
492 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
484 493 | ///
|
485 494 | /// # Example
|
486 495 | ///
|
487 496 | /// ```no_run
|
488 497 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
489 498 | ///
|
490 499 | /// use json_rpc11::{input, output, error};
|
491 500 | ///
|
492 501 | /// async fn handler(input: input::EndpointOperationInput) -> Result<output::EndpointOperationOutput, error::EndpointOperationError> {
|
493 502 | /// todo!()
|
494 503 | /// }
|
495 504 | ///
|
496 505 | /// let config = JsonProtocolConfig::builder().build();
|
497 506 | /// let app = JsonProtocol::builder(config)
|
498 507 | /// .endpoint_operation(handler)
|
499 508 | /// /* Set other handlers */
|
500 509 | /// .build()
|
501 510 | /// .unwrap();
|
502 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
511 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
503 512 | /// ```
|
504 513 | ///
|
505 514 | pub fn endpoint_operation<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
506 515 | where
|
507 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::EndpointOperation, HandlerExtractors>,
|
516 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::EndpointOperation, HandlerExtractors>,
|
508 517 |
|
509 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
518 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
510 519 | JsonProtocol<L>,
|
511 520 | crate::operation_shape::EndpointOperation,
|
512 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::EndpointOperation, HandlerType>
|
521 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::EndpointOperation, HandlerType>
|
513 522 | >,
|
514 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
523 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
515 524 | JsonProtocol<L>,
|
516 525 | crate::operation_shape::EndpointOperation,
|
517 526 | ModelPl::Output
|
518 527 | >,
|
519 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
528 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
520 529 | JsonProtocol<L>,
|
521 530 | crate::operation_shape::EndpointOperation,
|
522 531 | <
|
523 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
524 - | as ::aws_smithy_http_server::plugin::Plugin<
|
532 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
533 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
525 534 | JsonProtocol<L>,
|
526 535 | crate::operation_shape::EndpointOperation,
|
527 536 | ModelPl::Output
|
528 537 | >
|
529 538 | >::Output
|
530 539 | >,
|
531 540 |
|
532 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
541 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
533 542 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
534 543 |
|
535 544 | {
|
536 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
537 - | use ::aws_smithy_http_server::plugin::Plugin;
|
545 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
546 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
538 547 | let svc = crate::operation_shape::EndpointOperation::from_handler(handler);
|
539 548 | let svc = self.model_plugin.apply(svc);
|
540 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
541 - | .apply(svc);
|
549 + | let svc =
|
550 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
551 + | .apply(svc);
|
542 552 | let svc = self.http_plugin.apply(svc);
|
543 553 | self.endpoint_operation_custom(svc)
|
544 554 | }
|
545 555 |
|
546 556 | /// Sets the [`EndpointOperation`](crate::operation_shape::EndpointOperation) operation.
|
547 557 | ///
|
548 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
549 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
558 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
559 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
550 560 | ///
|
551 561 | /// # Example
|
552 562 | ///
|
553 563 | /// ```no_run
|
554 564 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
555 565 | ///
|
556 566 | /// use json_rpc11::{input, output, error};
|
557 567 | ///
|
558 568 | /// async fn handler(input: input::EndpointOperationInput) -> Result<output::EndpointOperationOutput, error::EndpointOperationError> {
|
559 569 | /// todo!()
|
560 570 | /// }
|
561 571 | ///
|
562 572 | /// let config = JsonProtocolConfig::builder().build();
|
563 573 | /// let svc = ::tower::util::service_fn(handler);
|
564 574 | /// let app = JsonProtocol::builder(config)
|
565 575 | /// .endpoint_operation_service(svc)
|
566 576 | /// /* Set other handlers */
|
567 577 | /// .build()
|
568 578 | /// .unwrap();
|
569 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
579 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
570 580 | /// ```
|
571 581 | ///
|
572 582 | pub fn endpoint_operation_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
573 583 | where
|
574 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::EndpointOperation, ServiceExtractors>,
|
584 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::EndpointOperation, ServiceExtractors>,
|
575 585 |
|
576 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
586 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
577 587 | JsonProtocol<L>,
|
578 588 | crate::operation_shape::EndpointOperation,
|
579 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::EndpointOperation, S>
|
589 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::EndpointOperation, S>
|
580 590 | >,
|
581 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
591 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
582 592 | JsonProtocol<L>,
|
583 593 | crate::operation_shape::EndpointOperation,
|
584 594 | ModelPl::Output
|
585 595 | >,
|
586 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
596 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
587 597 | JsonProtocol<L>,
|
588 598 | crate::operation_shape::EndpointOperation,
|
589 599 | <
|
590 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
591 - | as ::aws_smithy_http_server::plugin::Plugin<
|
600 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
601 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
592 602 | JsonProtocol<L>,
|
593 603 | crate::operation_shape::EndpointOperation,
|
594 604 | ModelPl::Output
|
595 605 | >
|
596 606 | >::Output
|
597 607 | >,
|
598 608 |
|
599 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
609 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
600 610 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
601 611 |
|
602 612 | {
|
603 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
604 - | use ::aws_smithy_http_server::plugin::Plugin;
|
613 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
614 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
605 615 | let svc = crate::operation_shape::EndpointOperation::from_service(service);
|
606 616 | let svc = self.model_plugin.apply(svc);
|
607 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
608 - | .apply(svc);
|
617 + | let svc =
|
618 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
619 + | .apply(svc);
|
609 620 | let svc = self.http_plugin.apply(svc);
|
610 621 | self.endpoint_operation_custom(svc)
|
611 622 | }
|
612 623 |
|
613 624 | /// Sets the [`EndpointOperation`](crate::operation_shape::EndpointOperation) to a custom [`Service`](tower::Service).
|
614 625 | /// not constrained by the Smithy contract.
|
615 626 | fn endpoint_operation_custom<S>(mut self, svc: S) -> Self
|
616 627 | where
|
617 628 | S: ::tower::Service<
|
618 629 | ::http::Request<Body>,
|
619 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
630 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
620 631 | Error = ::std::convert::Infallible,
|
621 632 | > + Clone
|
622 633 | + Send
|
623 634 | + 'static,
|
624 635 | S::Future: Send + 'static,
|
625 636 | {
|
626 - | self.endpoint_operation = Some(::aws_smithy_http_server::routing::Route::new(svc));
|
637 + | self.endpoint_operation = Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
627 638 | self
|
628 639 | }
|
629 640 |
|
630 641 | /// Sets the [`EndpointWithHostLabelOperation`](crate::operation_shape::EndpointWithHostLabelOperation) operation.
|
631 642 | ///
|
632 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
633 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
643 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
644 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
634 645 | ///
|
635 646 | /// # Example
|
636 647 | ///
|
637 648 | /// ```no_run
|
638 649 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
639 650 | ///
|
640 651 | /// use json_rpc11::{input, output, error};
|
641 652 | ///
|
642 653 | /// async fn handler(input: input::EndpointWithHostLabelOperationInput) -> Result<output::EndpointWithHostLabelOperationOutput, error::EndpointWithHostLabelOperationError> {
|
643 654 | /// todo!()
|
644 655 | /// }
|
645 656 | ///
|
646 657 | /// let config = JsonProtocolConfig::builder().build();
|
647 658 | /// let app = JsonProtocol::builder(config)
|
648 659 | /// .endpoint_with_host_label_operation(handler)
|
649 660 | /// /* Set other handlers */
|
650 661 | /// .build()
|
651 662 | /// .unwrap();
|
652 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
663 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
653 664 | /// ```
|
654 665 | ///
|
655 666 | pub fn endpoint_with_host_label_operation<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
656 667 | where
|
657 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::EndpointWithHostLabelOperation, HandlerExtractors>,
|
668 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::EndpointWithHostLabelOperation, HandlerExtractors>,
|
658 669 |
|
659 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
670 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
660 671 | JsonProtocol<L>,
|
661 672 | crate::operation_shape::EndpointWithHostLabelOperation,
|
662 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::EndpointWithHostLabelOperation, HandlerType>
|
673 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::EndpointWithHostLabelOperation, HandlerType>
|
663 674 | >,
|
664 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
675 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
665 676 | JsonProtocol<L>,
|
666 677 | crate::operation_shape::EndpointWithHostLabelOperation,
|
667 678 | ModelPl::Output
|
668 679 | >,
|
669 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
680 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
670 681 | JsonProtocol<L>,
|
671 682 | crate::operation_shape::EndpointWithHostLabelOperation,
|
672 683 | <
|
673 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
674 - | as ::aws_smithy_http_server::plugin::Plugin<
|
684 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
685 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
675 686 | JsonProtocol<L>,
|
676 687 | crate::operation_shape::EndpointWithHostLabelOperation,
|
677 688 | ModelPl::Output
|
678 689 | >
|
679 690 | >::Output
|
680 691 | >,
|
681 692 |
|
682 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
693 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
683 694 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
684 695 |
|
685 696 | {
|
686 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
687 - | use ::aws_smithy_http_server::plugin::Plugin;
|
697 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
698 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
688 699 | let svc = crate::operation_shape::EndpointWithHostLabelOperation::from_handler(handler);
|
689 700 | let svc = self.model_plugin.apply(svc);
|
690 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
691 - | .apply(svc);
|
701 + | let svc =
|
702 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
703 + | .apply(svc);
|
692 704 | let svc = self.http_plugin.apply(svc);
|
693 705 | self.endpoint_with_host_label_operation_custom(svc)
|
694 706 | }
|
695 707 |
|
696 708 | /// Sets the [`EndpointWithHostLabelOperation`](crate::operation_shape::EndpointWithHostLabelOperation) operation.
|
697 709 | ///
|
698 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
699 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
710 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
711 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
700 712 | ///
|
701 713 | /// # Example
|
702 714 | ///
|
703 715 | /// ```no_run
|
704 716 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
705 717 | ///
|
706 718 | /// use json_rpc11::{input, output, error};
|
707 719 | ///
|
708 720 | /// async fn handler(input: input::EndpointWithHostLabelOperationInput) -> Result<output::EndpointWithHostLabelOperationOutput, error::EndpointWithHostLabelOperationError> {
|
709 721 | /// todo!()
|
710 722 | /// }
|
711 723 | ///
|
712 724 | /// let config = JsonProtocolConfig::builder().build();
|
713 725 | /// let svc = ::tower::util::service_fn(handler);
|
714 726 | /// let app = JsonProtocol::builder(config)
|
715 727 | /// .endpoint_with_host_label_operation_service(svc)
|
716 728 | /// /* Set other handlers */
|
717 729 | /// .build()
|
718 730 | /// .unwrap();
|
719 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
731 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
720 732 | /// ```
|
721 733 | ///
|
722 734 | pub fn endpoint_with_host_label_operation_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
723 735 | where
|
724 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::EndpointWithHostLabelOperation, ServiceExtractors>,
|
736 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::EndpointWithHostLabelOperation, ServiceExtractors>,
|
725 737 |
|
726 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
738 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
727 739 | JsonProtocol<L>,
|
728 740 | crate::operation_shape::EndpointWithHostLabelOperation,
|
729 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::EndpointWithHostLabelOperation, S>
|
741 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::EndpointWithHostLabelOperation, S>
|
730 742 | >,
|
731 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
743 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
732 744 | JsonProtocol<L>,
|
733 745 | crate::operation_shape::EndpointWithHostLabelOperation,
|
734 746 | ModelPl::Output
|
735 747 | >,
|
736 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
748 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
737 749 | JsonProtocol<L>,
|
738 750 | crate::operation_shape::EndpointWithHostLabelOperation,
|
739 751 | <
|
740 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
741 - | as ::aws_smithy_http_server::plugin::Plugin<
|
752 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
753 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
742 754 | JsonProtocol<L>,
|
743 755 | crate::operation_shape::EndpointWithHostLabelOperation,
|
744 756 | ModelPl::Output
|
745 757 | >
|
746 758 | >::Output
|
747 759 | >,
|
748 760 |
|
749 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
761 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
750 762 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
751 763 |
|
752 764 | {
|
753 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
754 - | use ::aws_smithy_http_server::plugin::Plugin;
|
765 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
766 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
755 767 | let svc = crate::operation_shape::EndpointWithHostLabelOperation::from_service(service);
|
756 768 | let svc = self.model_plugin.apply(svc);
|
757 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
758 - | .apply(svc);
|
769 + | let svc =
|
770 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
771 + | .apply(svc);
|
759 772 | let svc = self.http_plugin.apply(svc);
|
760 773 | self.endpoint_with_host_label_operation_custom(svc)
|
761 774 | }
|
762 775 |
|
763 776 | /// Sets the [`EndpointWithHostLabelOperation`](crate::operation_shape::EndpointWithHostLabelOperation) to a custom [`Service`](tower::Service).
|
764 777 | /// not constrained by the Smithy contract.
|
765 778 | fn endpoint_with_host_label_operation_custom<S>(mut self, svc: S) -> Self
|
766 779 | where
|
767 780 | S: ::tower::Service<
|
768 781 | ::http::Request<Body>,
|
769 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
782 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
770 783 | Error = ::std::convert::Infallible,
|
771 784 | > + Clone
|
772 785 | + Send
|
773 786 | + 'static,
|
774 787 | S::Future: Send + 'static,
|
775 788 | {
|
776 789 | self.endpoint_with_host_label_operation =
|
777 - | Some(::aws_smithy_http_server::routing::Route::new(svc));
|
790 + | Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
778 791 | self
|
779 792 | }
|
780 793 |
|
781 794 | /// Sets the [`FractionalSeconds`](crate::operation_shape::FractionalSeconds) operation.
|
782 795 | ///
|
783 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
784 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
796 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
797 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
785 798 | ///
|
786 799 | /// # Example
|
787 800 | ///
|
788 801 | /// ```no_run
|
789 802 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
790 803 | ///
|
791 804 | /// use json_rpc11::{input, output, error};
|
792 805 | ///
|
793 806 | /// async fn handler(input: input::FractionalSecondsInput) -> Result<output::FractionalSecondsOutput, error::FractionalSecondsError> {
|
794 807 | /// todo!()
|
795 808 | /// }
|
796 809 | ///
|
797 810 | /// let config = JsonProtocolConfig::builder().build();
|
798 811 | /// let app = JsonProtocol::builder(config)
|
799 812 | /// .fractional_seconds(handler)
|
800 813 | /// /* Set other handlers */
|
801 814 | /// .build()
|
802 815 | /// .unwrap();
|
803 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
816 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
804 817 | /// ```
|
805 818 | ///
|
806 819 | pub fn fractional_seconds<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
807 820 | where
|
808 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::FractionalSeconds, HandlerExtractors>,
|
821 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::FractionalSeconds, HandlerExtractors>,
|
809 822 |
|
810 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
823 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
811 824 | JsonProtocol<L>,
|
812 825 | crate::operation_shape::FractionalSeconds,
|
813 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::FractionalSeconds, HandlerType>
|
826 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::FractionalSeconds, HandlerType>
|
814 827 | >,
|
815 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
828 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
816 829 | JsonProtocol<L>,
|
817 830 | crate::operation_shape::FractionalSeconds,
|
818 831 | ModelPl::Output
|
819 832 | >,
|
820 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
833 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
821 834 | JsonProtocol<L>,
|
822 835 | crate::operation_shape::FractionalSeconds,
|
823 836 | <
|
824 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
825 - | as ::aws_smithy_http_server::plugin::Plugin<
|
837 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
838 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
826 839 | JsonProtocol<L>,
|
827 840 | crate::operation_shape::FractionalSeconds,
|
828 841 | ModelPl::Output
|
829 842 | >
|
830 843 | >::Output
|
831 844 | >,
|
832 845 |
|
833 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
846 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
834 847 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
835 848 |
|
836 849 | {
|
837 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
838 - | use ::aws_smithy_http_server::plugin::Plugin;
|
850 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
851 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
839 852 | let svc = crate::operation_shape::FractionalSeconds::from_handler(handler);
|
840 853 | let svc = self.model_plugin.apply(svc);
|
841 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
842 - | .apply(svc);
|
854 + | let svc =
|
855 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
856 + | .apply(svc);
|
843 857 | let svc = self.http_plugin.apply(svc);
|
844 858 | self.fractional_seconds_custom(svc)
|
845 859 | }
|
846 860 |
|
847 861 | /// Sets the [`FractionalSeconds`](crate::operation_shape::FractionalSeconds) operation.
|
848 862 | ///
|
849 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
850 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
863 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
864 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
851 865 | ///
|
852 866 | /// # Example
|
853 867 | ///
|
854 868 | /// ```no_run
|
855 869 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
856 870 | ///
|
857 871 | /// use json_rpc11::{input, output, error};
|
858 872 | ///
|
859 873 | /// async fn handler(input: input::FractionalSecondsInput) -> Result<output::FractionalSecondsOutput, error::FractionalSecondsError> {
|
860 874 | /// todo!()
|
861 875 | /// }
|
862 876 | ///
|
863 877 | /// let config = JsonProtocolConfig::builder().build();
|
864 878 | /// let svc = ::tower::util::service_fn(handler);
|
865 879 | /// let app = JsonProtocol::builder(config)
|
866 880 | /// .fractional_seconds_service(svc)
|
867 881 | /// /* Set other handlers */
|
868 882 | /// .build()
|
869 883 | /// .unwrap();
|
870 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
884 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
871 885 | /// ```
|
872 886 | ///
|
873 887 | pub fn fractional_seconds_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
874 888 | where
|
875 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::FractionalSeconds, ServiceExtractors>,
|
889 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::FractionalSeconds, ServiceExtractors>,
|
876 890 |
|
877 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
891 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
878 892 | JsonProtocol<L>,
|
879 893 | crate::operation_shape::FractionalSeconds,
|
880 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::FractionalSeconds, S>
|
894 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::FractionalSeconds, S>
|
881 895 | >,
|
882 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
896 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
883 897 | JsonProtocol<L>,
|
884 898 | crate::operation_shape::FractionalSeconds,
|
885 899 | ModelPl::Output
|
886 900 | >,
|
887 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
901 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
888 902 | JsonProtocol<L>,
|
889 903 | crate::operation_shape::FractionalSeconds,
|
890 904 | <
|
891 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
892 - | as ::aws_smithy_http_server::plugin::Plugin<
|
905 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
906 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
893 907 | JsonProtocol<L>,
|
894 908 | crate::operation_shape::FractionalSeconds,
|
895 909 | ModelPl::Output
|
896 910 | >
|
897 911 | >::Output
|
898 912 | >,
|
899 913 |
|
900 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
914 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
901 915 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
902 916 |
|
903 917 | {
|
904 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
905 - | use ::aws_smithy_http_server::plugin::Plugin;
|
918 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
919 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
906 920 | let svc = crate::operation_shape::FractionalSeconds::from_service(service);
|
907 921 | let svc = self.model_plugin.apply(svc);
|
908 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
909 - | .apply(svc);
|
922 + | let svc =
|
923 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
924 + | .apply(svc);
|
910 925 | let svc = self.http_plugin.apply(svc);
|
911 926 | self.fractional_seconds_custom(svc)
|
912 927 | }
|
913 928 |
|
914 929 | /// Sets the [`FractionalSeconds`](crate::operation_shape::FractionalSeconds) to a custom [`Service`](tower::Service).
|
915 930 | /// not constrained by the Smithy contract.
|
916 931 | fn fractional_seconds_custom<S>(mut self, svc: S) -> Self
|
917 932 | where
|
918 933 | S: ::tower::Service<
|
919 934 | ::http::Request<Body>,
|
920 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
935 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
921 936 | Error = ::std::convert::Infallible,
|
922 937 | > + Clone
|
923 938 | + Send
|
924 939 | + 'static,
|
925 940 | S::Future: Send + 'static,
|
926 941 | {
|
927 - | self.fractional_seconds = Some(::aws_smithy_http_server::routing::Route::new(svc));
|
942 + | self.fractional_seconds = Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
928 943 | self
|
929 944 | }
|
930 945 |
|
931 946 | /// Sets the [`GreetingWithErrors`](crate::operation_shape::GreetingWithErrors) operation.
|
932 947 | ///
|
933 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
934 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
948 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
949 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
935 950 | ///
|
936 951 | /// # Example
|
937 952 | ///
|
938 953 | /// ```no_run
|
939 954 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
940 955 | ///
|
941 956 | /// use json_rpc11::{input, output, error};
|
942 957 | ///
|
943 958 | /// async fn handler(input: input::GreetingWithErrorsInput) -> Result<output::GreetingWithErrorsOutput, error::GreetingWithErrorsError> {
|
944 959 | /// todo!()
|
945 960 | /// }
|
946 961 | ///
|
947 962 | /// let config = JsonProtocolConfig::builder().build();
|
948 963 | /// let app = JsonProtocol::builder(config)
|
949 964 | /// .greeting_with_errors(handler)
|
950 965 | /// /* Set other handlers */
|
951 966 | /// .build()
|
952 967 | /// .unwrap();
|
953 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
968 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
954 969 | /// ```
|
955 970 | ///
|
956 971 | pub fn greeting_with_errors<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
957 972 | where
|
958 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::GreetingWithErrors, HandlerExtractors>,
|
973 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::GreetingWithErrors, HandlerExtractors>,
|
959 974 |
|
960 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
975 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
961 976 | JsonProtocol<L>,
|
962 977 | crate::operation_shape::GreetingWithErrors,
|
963 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::GreetingWithErrors, HandlerType>
|
978 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::GreetingWithErrors, HandlerType>
|
964 979 | >,
|
965 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
980 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
966 981 | JsonProtocol<L>,
|
967 982 | crate::operation_shape::GreetingWithErrors,
|
968 983 | ModelPl::Output
|
969 984 | >,
|
970 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
985 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
971 986 | JsonProtocol<L>,
|
972 987 | crate::operation_shape::GreetingWithErrors,
|
973 988 | <
|
974 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
975 - | as ::aws_smithy_http_server::plugin::Plugin<
|
989 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
990 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
976 991 | JsonProtocol<L>,
|
977 992 | crate::operation_shape::GreetingWithErrors,
|
978 993 | ModelPl::Output
|
979 994 | >
|
980 995 | >::Output
|
981 996 | >,
|
982 997 |
|
983 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
998 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
984 999 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
985 1000 |
|
986 1001 | {
|
987 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
988 - | use ::aws_smithy_http_server::plugin::Plugin;
|
1002 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
1003 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
989 1004 | let svc = crate::operation_shape::GreetingWithErrors::from_handler(handler);
|
990 1005 | let svc = self.model_plugin.apply(svc);
|
991 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
992 - | .apply(svc);
|
1006 + | let svc =
|
1007 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1008 + | .apply(svc);
|
993 1009 | let svc = self.http_plugin.apply(svc);
|
994 1010 | self.greeting_with_errors_custom(svc)
|
995 1011 | }
|
996 1012 |
|
997 1013 | /// Sets the [`GreetingWithErrors`](crate::operation_shape::GreetingWithErrors) operation.
|
998 1014 | ///
|
999 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
1000 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
1015 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
1016 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
1001 1017 | ///
|
1002 1018 | /// # Example
|
1003 1019 | ///
|
1004 1020 | /// ```no_run
|
1005 1021 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
1006 1022 | ///
|
1007 1023 | /// use json_rpc11::{input, output, error};
|
1008 1024 | ///
|
1009 1025 | /// async fn handler(input: input::GreetingWithErrorsInput) -> Result<output::GreetingWithErrorsOutput, error::GreetingWithErrorsError> {
|
1010 1026 | /// todo!()
|
1011 1027 | /// }
|
1012 1028 | ///
|
1013 1029 | /// let config = JsonProtocolConfig::builder().build();
|
1014 1030 | /// let svc = ::tower::util::service_fn(handler);
|
1015 1031 | /// let app = JsonProtocol::builder(config)
|
1016 1032 | /// .greeting_with_errors_service(svc)
|
1017 1033 | /// /* Set other handlers */
|
1018 1034 | /// .build()
|
1019 1035 | /// .unwrap();
|
1020 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
1036 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
1021 1037 | /// ```
|
1022 1038 | ///
|
1023 1039 | pub fn greeting_with_errors_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
1024 1040 | where
|
1025 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::GreetingWithErrors, ServiceExtractors>,
|
1041 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::GreetingWithErrors, ServiceExtractors>,
|
1026 1042 |
|
1027 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
1043 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1028 1044 | JsonProtocol<L>,
|
1029 1045 | crate::operation_shape::GreetingWithErrors,
|
1030 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::GreetingWithErrors, S>
|
1046 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::GreetingWithErrors, S>
|
1031 1047 | >,
|
1032 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
1048 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1033 1049 | JsonProtocol<L>,
|
1034 1050 | crate::operation_shape::GreetingWithErrors,
|
1035 1051 | ModelPl::Output
|
1036 1052 | >,
|
1037 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
1053 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1038 1054 | JsonProtocol<L>,
|
1039 1055 | crate::operation_shape::GreetingWithErrors,
|
1040 1056 | <
|
1041 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1042 - | as ::aws_smithy_http_server::plugin::Plugin<
|
1057 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1058 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1043 1059 | JsonProtocol<L>,
|
1044 1060 | crate::operation_shape::GreetingWithErrors,
|
1045 1061 | ModelPl::Output
|
1046 1062 | >
|
1047 1063 | >::Output
|
1048 1064 | >,
|
1049 1065 |
|
1050 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1066 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1051 1067 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1052 1068 |
|
1053 1069 | {
|
1054 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
1055 - | use ::aws_smithy_http_server::plugin::Plugin;
|
1070 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
1071 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
1056 1072 | let svc = crate::operation_shape::GreetingWithErrors::from_service(service);
|
1057 1073 | let svc = self.model_plugin.apply(svc);
|
1058 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1059 - | .apply(svc);
|
1074 + | let svc =
|
1075 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1076 + | .apply(svc);
|
1060 1077 | let svc = self.http_plugin.apply(svc);
|
1061 1078 | self.greeting_with_errors_custom(svc)
|
1062 1079 | }
|
1063 1080 |
|
1064 1081 | /// Sets the [`GreetingWithErrors`](crate::operation_shape::GreetingWithErrors) to a custom [`Service`](tower::Service).
|
1065 1082 | /// not constrained by the Smithy contract.
|
1066 1083 | fn greeting_with_errors_custom<S>(mut self, svc: S) -> Self
|
1067 1084 | where
|
1068 1085 | S: ::tower::Service<
|
1069 1086 | ::http::Request<Body>,
|
1070 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
1087 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
1071 1088 | Error = ::std::convert::Infallible,
|
1072 1089 | > + Clone
|
1073 1090 | + Send
|
1074 1091 | + 'static,
|
1075 1092 | S::Future: Send + 'static,
|
1076 1093 | {
|
1077 - | self.greeting_with_errors = Some(::aws_smithy_http_server::routing::Route::new(svc));
|
1094 + | self.greeting_with_errors = Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
1078 1095 | self
|
1079 1096 | }
|
1080 1097 |
|
1081 1098 | /// Sets the [`HostWithPathOperation`](crate::operation_shape::HostWithPathOperation) operation.
|
1082 1099 | ///
|
1083 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
1084 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
1100 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
1101 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
1085 1102 | ///
|
1086 1103 | /// # Example
|
1087 1104 | ///
|
1088 1105 | /// ```no_run
|
1089 1106 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
1090 1107 | ///
|
1091 1108 | /// use json_rpc11::{input, output, error};
|
1092 1109 | ///
|
1093 1110 | /// async fn handler(input: input::HostWithPathOperationInput) -> Result<output::HostWithPathOperationOutput, error::HostWithPathOperationError> {
|
1094 1111 | /// todo!()
|
1095 1112 | /// }
|
1096 1113 | ///
|
1097 1114 | /// let config = JsonProtocolConfig::builder().build();
|
1098 1115 | /// let app = JsonProtocol::builder(config)
|
1099 1116 | /// .host_with_path_operation(handler)
|
1100 1117 | /// /* Set other handlers */
|
1101 1118 | /// .build()
|
1102 1119 | /// .unwrap();
|
1103 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
1120 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
1104 1121 | /// ```
|
1105 1122 | ///
|
1106 1123 | pub fn host_with_path_operation<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
1107 1124 | where
|
1108 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::HostWithPathOperation, HandlerExtractors>,
|
1125 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::HostWithPathOperation, HandlerExtractors>,
|
1109 1126 |
|
1110 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
1127 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1111 1128 | JsonProtocol<L>,
|
1112 1129 | crate::operation_shape::HostWithPathOperation,
|
1113 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::HostWithPathOperation, HandlerType>
|
1130 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::HostWithPathOperation, HandlerType>
|
1114 1131 | >,
|
1115 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
1132 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1116 1133 | JsonProtocol<L>,
|
1117 1134 | crate::operation_shape::HostWithPathOperation,
|
1118 1135 | ModelPl::Output
|
1119 1136 | >,
|
1120 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
1137 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1121 1138 | JsonProtocol<L>,
|
1122 1139 | crate::operation_shape::HostWithPathOperation,
|
1123 1140 | <
|
1124 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1125 - | as ::aws_smithy_http_server::plugin::Plugin<
|
1141 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1142 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1126 1143 | JsonProtocol<L>,
|
1127 1144 | crate::operation_shape::HostWithPathOperation,
|
1128 1145 | ModelPl::Output
|
1129 1146 | >
|
1130 1147 | >::Output
|
1131 1148 | >,
|
1132 1149 |
|
1133 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1150 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1134 1151 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1135 1152 |
|
1136 1153 | {
|
1137 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
1138 - | use ::aws_smithy_http_server::plugin::Plugin;
|
1154 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
1155 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
1139 1156 | let svc = crate::operation_shape::HostWithPathOperation::from_handler(handler);
|
1140 1157 | let svc = self.model_plugin.apply(svc);
|
1141 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1142 - | .apply(svc);
|
1158 + | let svc =
|
1159 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1160 + | .apply(svc);
|
1143 1161 | let svc = self.http_plugin.apply(svc);
|
1144 1162 | self.host_with_path_operation_custom(svc)
|
1145 1163 | }
|
1146 1164 |
|
1147 1165 | /// Sets the [`HostWithPathOperation`](crate::operation_shape::HostWithPathOperation) operation.
|
1148 1166 | ///
|
1149 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
1150 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
1167 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
1168 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
1151 1169 | ///
|
1152 1170 | /// # Example
|
1153 1171 | ///
|
1154 1172 | /// ```no_run
|
1155 1173 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
1156 1174 | ///
|
1157 1175 | /// use json_rpc11::{input, output, error};
|
1158 1176 | ///
|
1159 1177 | /// async fn handler(input: input::HostWithPathOperationInput) -> Result<output::HostWithPathOperationOutput, error::HostWithPathOperationError> {
|
1160 1178 | /// todo!()
|
1161 1179 | /// }
|
1162 1180 | ///
|
1163 1181 | /// let config = JsonProtocolConfig::builder().build();
|
1164 1182 | /// let svc = ::tower::util::service_fn(handler);
|
1165 1183 | /// let app = JsonProtocol::builder(config)
|
1166 1184 | /// .host_with_path_operation_service(svc)
|
1167 1185 | /// /* Set other handlers */
|
1168 1186 | /// .build()
|
1169 1187 | /// .unwrap();
|
1170 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
1188 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
1171 1189 | /// ```
|
1172 1190 | ///
|
1173 1191 | pub fn host_with_path_operation_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
1174 1192 | where
|
1175 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::HostWithPathOperation, ServiceExtractors>,
|
1193 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::HostWithPathOperation, ServiceExtractors>,
|
1176 1194 |
|
1177 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
1195 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1178 1196 | JsonProtocol<L>,
|
1179 1197 | crate::operation_shape::HostWithPathOperation,
|
1180 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::HostWithPathOperation, S>
|
1198 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::HostWithPathOperation, S>
|
1181 1199 | >,
|
1182 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
1200 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1183 1201 | JsonProtocol<L>,
|
1184 1202 | crate::operation_shape::HostWithPathOperation,
|
1185 1203 | ModelPl::Output
|
1186 1204 | >,
|
1187 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
1205 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1188 1206 | JsonProtocol<L>,
|
1189 1207 | crate::operation_shape::HostWithPathOperation,
|
1190 1208 | <
|
1191 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1192 - | as ::aws_smithy_http_server::plugin::Plugin<
|
1209 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1210 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1193 1211 | JsonProtocol<L>,
|
1194 1212 | crate::operation_shape::HostWithPathOperation,
|
1195 1213 | ModelPl::Output
|
1196 1214 | >
|
1197 1215 | >::Output
|
1198 1216 | >,
|
1199 1217 |
|
1200 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1218 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1201 1219 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1202 1220 |
|
1203 1221 | {
|
1204 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
1205 - | use ::aws_smithy_http_server::plugin::Plugin;
|
1222 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
1223 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
1206 1224 | let svc = crate::operation_shape::HostWithPathOperation::from_service(service);
|
1207 1225 | let svc = self.model_plugin.apply(svc);
|
1208 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1209 - | .apply(svc);
|
1226 + | let svc =
|
1227 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1228 + | .apply(svc);
|
1210 1229 | let svc = self.http_plugin.apply(svc);
|
1211 1230 | self.host_with_path_operation_custom(svc)
|
1212 1231 | }
|
1213 1232 |
|
1214 1233 | /// Sets the [`HostWithPathOperation`](crate::operation_shape::HostWithPathOperation) to a custom [`Service`](tower::Service).
|
1215 1234 | /// not constrained by the Smithy contract.
|
1216 1235 | fn host_with_path_operation_custom<S>(mut self, svc: S) -> Self
|
1217 1236 | where
|
1218 1237 | S: ::tower::Service<
|
1219 1238 | ::http::Request<Body>,
|
1220 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
1239 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
1221 1240 | Error = ::std::convert::Infallible,
|
1222 1241 | > + Clone
|
1223 1242 | + Send
|
1224 1243 | + 'static,
|
1225 1244 | S::Future: Send + 'static,
|
1226 1245 | {
|
1227 - | self.host_with_path_operation = Some(::aws_smithy_http_server::routing::Route::new(svc));
|
1246 + | self.host_with_path_operation =
|
1247 + | Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
1228 1248 | self
|
1229 1249 | }
|
1230 1250 |
|
1231 1251 | /// Sets the [`JsonEnums`](crate::operation_shape::JsonEnums) operation.
|
1232 1252 | ///
|
1233 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
1234 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
1253 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
1254 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
1235 1255 | ///
|
1236 1256 | /// # Example
|
1237 1257 | ///
|
1238 1258 | /// ```no_run
|
1239 1259 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
1240 1260 | ///
|
1241 1261 | /// use json_rpc11::{input, output, error};
|
1242 1262 | ///
|
1243 1263 | /// async fn handler(input: input::JsonEnumsInput) -> Result<output::JsonEnumsOutput, error::JsonEnumsError> {
|
1244 1264 | /// todo!()
|
1245 1265 | /// }
|
1246 1266 | ///
|
1247 1267 | /// let config = JsonProtocolConfig::builder().build();
|
1248 1268 | /// let app = JsonProtocol::builder(config)
|
1249 1269 | /// .json_enums(handler)
|
1250 1270 | /// /* Set other handlers */
|
1251 1271 | /// .build()
|
1252 1272 | /// .unwrap();
|
1253 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
1273 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
1254 1274 | /// ```
|
1255 1275 | ///
|
1256 1276 | pub fn json_enums<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
1257 1277 | where
|
1258 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::JsonEnums, HandlerExtractors>,
|
1278 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::JsonEnums, HandlerExtractors>,
|
1259 1279 |
|
1260 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
1280 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1261 1281 | JsonProtocol<L>,
|
1262 1282 | crate::operation_shape::JsonEnums,
|
1263 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::JsonEnums, HandlerType>
|
1283 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::JsonEnums, HandlerType>
|
1264 1284 | >,
|
1265 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
1285 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1266 1286 | JsonProtocol<L>,
|
1267 1287 | crate::operation_shape::JsonEnums,
|
1268 1288 | ModelPl::Output
|
1269 1289 | >,
|
1270 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
1290 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1271 1291 | JsonProtocol<L>,
|
1272 1292 | crate::operation_shape::JsonEnums,
|
1273 1293 | <
|
1274 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1275 - | as ::aws_smithy_http_server::plugin::Plugin<
|
1294 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1295 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1276 1296 | JsonProtocol<L>,
|
1277 1297 | crate::operation_shape::JsonEnums,
|
1278 1298 | ModelPl::Output
|
1279 1299 | >
|
1280 1300 | >::Output
|
1281 1301 | >,
|
1282 1302 |
|
1283 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1303 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1284 1304 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1285 1305 |
|
1286 1306 | {
|
1287 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
1288 - | use ::aws_smithy_http_server::plugin::Plugin;
|
1307 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
1308 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
1289 1309 | let svc = crate::operation_shape::JsonEnums::from_handler(handler);
|
1290 1310 | let svc = self.model_plugin.apply(svc);
|
1291 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1292 - | .apply(svc);
|
1311 + | let svc =
|
1312 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1313 + | .apply(svc);
|
1293 1314 | let svc = self.http_plugin.apply(svc);
|
1294 1315 | self.json_enums_custom(svc)
|
1295 1316 | }
|
1296 1317 |
|
1297 1318 | /// Sets the [`JsonEnums`](crate::operation_shape::JsonEnums) operation.
|
1298 1319 | ///
|
1299 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
1300 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
1320 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
1321 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
1301 1322 | ///
|
1302 1323 | /// # Example
|
1303 1324 | ///
|
1304 1325 | /// ```no_run
|
1305 1326 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
1306 1327 | ///
|
1307 1328 | /// use json_rpc11::{input, output, error};
|
1308 1329 | ///
|
1309 1330 | /// async fn handler(input: input::JsonEnumsInput) -> Result<output::JsonEnumsOutput, error::JsonEnumsError> {
|
1310 1331 | /// todo!()
|
1311 1332 | /// }
|
1312 1333 | ///
|
1313 1334 | /// let config = JsonProtocolConfig::builder().build();
|
1314 1335 | /// let svc = ::tower::util::service_fn(handler);
|
1315 1336 | /// let app = JsonProtocol::builder(config)
|
1316 1337 | /// .json_enums_service(svc)
|
1317 1338 | /// /* Set other handlers */
|
1318 1339 | /// .build()
|
1319 1340 | /// .unwrap();
|
1320 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
1341 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
1321 1342 | /// ```
|
1322 1343 | ///
|
1323 1344 | pub fn json_enums_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
1324 1345 | where
|
1325 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::JsonEnums, ServiceExtractors>,
|
1346 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::JsonEnums, ServiceExtractors>,
|
1326 1347 |
|
1327 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
1348 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1328 1349 | JsonProtocol<L>,
|
1329 1350 | crate::operation_shape::JsonEnums,
|
1330 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::JsonEnums, S>
|
1351 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::JsonEnums, S>
|
1331 1352 | >,
|
1332 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
1353 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1333 1354 | JsonProtocol<L>,
|
1334 1355 | crate::operation_shape::JsonEnums,
|
1335 1356 | ModelPl::Output
|
1336 1357 | >,
|
1337 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
1358 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1338 1359 | JsonProtocol<L>,
|
1339 1360 | crate::operation_shape::JsonEnums,
|
1340 1361 | <
|
1341 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1342 - | as ::aws_smithy_http_server::plugin::Plugin<
|
1362 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1363 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1343 1364 | JsonProtocol<L>,
|
1344 1365 | crate::operation_shape::JsonEnums,
|
1345 1366 | ModelPl::Output
|
1346 1367 | >
|
1347 1368 | >::Output
|
1348 1369 | >,
|
1349 1370 |
|
1350 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1371 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1351 1372 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1352 1373 |
|
1353 1374 | {
|
1354 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
1355 - | use ::aws_smithy_http_server::plugin::Plugin;
|
1375 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
1376 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
1356 1377 | let svc = crate::operation_shape::JsonEnums::from_service(service);
|
1357 1378 | let svc = self.model_plugin.apply(svc);
|
1358 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1359 - | .apply(svc);
|
1379 + | let svc =
|
1380 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1381 + | .apply(svc);
|
1360 1382 | let svc = self.http_plugin.apply(svc);
|
1361 1383 | self.json_enums_custom(svc)
|
1362 1384 | }
|
1363 1385 |
|
1364 1386 | /// Sets the [`JsonEnums`](crate::operation_shape::JsonEnums) to a custom [`Service`](tower::Service).
|
1365 1387 | /// not constrained by the Smithy contract.
|
1366 1388 | fn json_enums_custom<S>(mut self, svc: S) -> Self
|
1367 1389 | where
|
1368 1390 | S: ::tower::Service<
|
1369 1391 | ::http::Request<Body>,
|
1370 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
1392 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
1371 1393 | Error = ::std::convert::Infallible,
|
1372 1394 | > + Clone
|
1373 1395 | + Send
|
1374 1396 | + 'static,
|
1375 1397 | S::Future: Send + 'static,
|
1376 1398 | {
|
1377 - | self.json_enums = Some(::aws_smithy_http_server::routing::Route::new(svc));
|
1399 + | self.json_enums = Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
1378 1400 | self
|
1379 1401 | }
|
1380 1402 |
|
1381 1403 | /// Sets the [`JsonIntEnums`](crate::operation_shape::JsonIntEnums) operation.
|
1382 1404 | ///
|
1383 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
1384 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
1405 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
1406 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
1385 1407 | ///
|
1386 1408 | /// # Example
|
1387 1409 | ///
|
1388 1410 | /// ```no_run
|
1389 1411 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
1390 1412 | ///
|
1391 1413 | /// use json_rpc11::{input, output, error};
|
1392 1414 | ///
|
1393 1415 | /// async fn handler(input: input::JsonIntEnumsInput) -> Result<output::JsonIntEnumsOutput, error::JsonIntEnumsError> {
|
1394 1416 | /// todo!()
|
1395 1417 | /// }
|
1396 1418 | ///
|
1397 1419 | /// let config = JsonProtocolConfig::builder().build();
|
1398 1420 | /// let app = JsonProtocol::builder(config)
|
1399 1421 | /// .json_int_enums(handler)
|
1400 1422 | /// /* Set other handlers */
|
1401 1423 | /// .build()
|
1402 1424 | /// .unwrap();
|
1403 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
1425 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
1404 1426 | /// ```
|
1405 1427 | ///
|
1406 1428 | pub fn json_int_enums<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
1407 1429 | where
|
1408 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::JsonIntEnums, HandlerExtractors>,
|
1430 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::JsonIntEnums, HandlerExtractors>,
|
1409 1431 |
|
1410 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
1432 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1411 1433 | JsonProtocol<L>,
|
1412 1434 | crate::operation_shape::JsonIntEnums,
|
1413 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::JsonIntEnums, HandlerType>
|
1435 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::JsonIntEnums, HandlerType>
|
1414 1436 | >,
|
1415 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
1437 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1416 1438 | JsonProtocol<L>,
|
1417 1439 | crate::operation_shape::JsonIntEnums,
|
1418 1440 | ModelPl::Output
|
1419 1441 | >,
|
1420 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
1442 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1421 1443 | JsonProtocol<L>,
|
1422 1444 | crate::operation_shape::JsonIntEnums,
|
1423 1445 | <
|
1424 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1425 - | as ::aws_smithy_http_server::plugin::Plugin<
|
1446 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1447 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1426 1448 | JsonProtocol<L>,
|
1427 1449 | crate::operation_shape::JsonIntEnums,
|
1428 1450 | ModelPl::Output
|
1429 1451 | >
|
1430 1452 | >::Output
|
1431 1453 | >,
|
1432 1454 |
|
1433 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1455 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1434 1456 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1435 1457 |
|
1436 1458 | {
|
1437 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
1438 - | use ::aws_smithy_http_server::plugin::Plugin;
|
1459 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
1460 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
1439 1461 | let svc = crate::operation_shape::JsonIntEnums::from_handler(handler);
|
1440 1462 | let svc = self.model_plugin.apply(svc);
|
1441 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1442 - | .apply(svc);
|
1463 + | let svc =
|
1464 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1465 + | .apply(svc);
|
1443 1466 | let svc = self.http_plugin.apply(svc);
|
1444 1467 | self.json_int_enums_custom(svc)
|
1445 1468 | }
|
1446 1469 |
|
1447 1470 | /// Sets the [`JsonIntEnums`](crate::operation_shape::JsonIntEnums) operation.
|
1448 1471 | ///
|
1449 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
1450 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
1472 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
1473 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
1451 1474 | ///
|
1452 1475 | /// # Example
|
1453 1476 | ///
|
1454 1477 | /// ```no_run
|
1455 1478 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
1456 1479 | ///
|
1457 1480 | /// use json_rpc11::{input, output, error};
|
1458 1481 | ///
|
1459 1482 | /// async fn handler(input: input::JsonIntEnumsInput) -> Result<output::JsonIntEnumsOutput, error::JsonIntEnumsError> {
|
1460 1483 | /// todo!()
|
1461 1484 | /// }
|
1462 1485 | ///
|
1463 1486 | /// let config = JsonProtocolConfig::builder().build();
|
1464 1487 | /// let svc = ::tower::util::service_fn(handler);
|
1465 1488 | /// let app = JsonProtocol::builder(config)
|
1466 1489 | /// .json_int_enums_service(svc)
|
1467 1490 | /// /* Set other handlers */
|
1468 1491 | /// .build()
|
1469 1492 | /// .unwrap();
|
1470 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
1493 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
1471 1494 | /// ```
|
1472 1495 | ///
|
1473 1496 | pub fn json_int_enums_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
1474 1497 | where
|
1475 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::JsonIntEnums, ServiceExtractors>,
|
1498 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::JsonIntEnums, ServiceExtractors>,
|
1476 1499 |
|
1477 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
1500 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1478 1501 | JsonProtocol<L>,
|
1479 1502 | crate::operation_shape::JsonIntEnums,
|
1480 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::JsonIntEnums, S>
|
1503 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::JsonIntEnums, S>
|
1481 1504 | >,
|
1482 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
1505 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1483 1506 | JsonProtocol<L>,
|
1484 1507 | crate::operation_shape::JsonIntEnums,
|
1485 1508 | ModelPl::Output
|
1486 1509 | >,
|
1487 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
1510 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1488 1511 | JsonProtocol<L>,
|
1489 1512 | crate::operation_shape::JsonIntEnums,
|
1490 1513 | <
|
1491 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1492 - | as ::aws_smithy_http_server::plugin::Plugin<
|
1514 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1515 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1493 1516 | JsonProtocol<L>,
|
1494 1517 | crate::operation_shape::JsonIntEnums,
|
1495 1518 | ModelPl::Output
|
1496 1519 | >
|
1497 1520 | >::Output
|
1498 1521 | >,
|
1499 1522 |
|
1500 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1523 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1501 1524 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1502 1525 |
|
1503 1526 | {
|
1504 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
1505 - | use ::aws_smithy_http_server::plugin::Plugin;
|
1527 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
1528 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
1506 1529 | let svc = crate::operation_shape::JsonIntEnums::from_service(service);
|
1507 1530 | let svc = self.model_plugin.apply(svc);
|
1508 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1509 - | .apply(svc);
|
1531 + | let svc =
|
1532 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1533 + | .apply(svc);
|
1510 1534 | let svc = self.http_plugin.apply(svc);
|
1511 1535 | self.json_int_enums_custom(svc)
|
1512 1536 | }
|
1513 1537 |
|
1514 1538 | /// Sets the [`JsonIntEnums`](crate::operation_shape::JsonIntEnums) to a custom [`Service`](tower::Service).
|
1515 1539 | /// not constrained by the Smithy contract.
|
1516 1540 | fn json_int_enums_custom<S>(mut self, svc: S) -> Self
|
1517 1541 | where
|
1518 1542 | S: ::tower::Service<
|
1519 1543 | ::http::Request<Body>,
|
1520 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
1544 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
1521 1545 | Error = ::std::convert::Infallible,
|
1522 1546 | > + Clone
|
1523 1547 | + Send
|
1524 1548 | + 'static,
|
1525 1549 | S::Future: Send + 'static,
|
1526 1550 | {
|
1527 - | self.json_int_enums = Some(::aws_smithy_http_server::routing::Route::new(svc));
|
1551 + | self.json_int_enums = Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
1528 1552 | self
|
1529 1553 | }
|
1530 1554 |
|
1531 1555 | /// Sets the [`JsonUnions`](crate::operation_shape::JsonUnions) operation.
|
1532 1556 | ///
|
1533 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
1534 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
1557 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
1558 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
1535 1559 | ///
|
1536 1560 | /// # Example
|
1537 1561 | ///
|
1538 1562 | /// ```no_run
|
1539 1563 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
1540 1564 | ///
|
1541 1565 | /// use json_rpc11::{input, output, error};
|
1542 1566 | ///
|
1543 1567 | /// async fn handler(input: input::JsonUnionsInput) -> Result<output::JsonUnionsOutput, error::JsonUnionsError> {
|
1544 1568 | /// todo!()
|
1545 1569 | /// }
|
1546 1570 | ///
|
1547 1571 | /// let config = JsonProtocolConfig::builder().build();
|
1548 1572 | /// let app = JsonProtocol::builder(config)
|
1549 1573 | /// .json_unions(handler)
|
1550 1574 | /// /* Set other handlers */
|
1551 1575 | /// .build()
|
1552 1576 | /// .unwrap();
|
1553 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
1577 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
1554 1578 | /// ```
|
1555 1579 | ///
|
1556 1580 | pub fn json_unions<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
1557 1581 | where
|
1558 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::JsonUnions, HandlerExtractors>,
|
1582 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::JsonUnions, HandlerExtractors>,
|
1559 1583 |
|
1560 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
1584 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1561 1585 | JsonProtocol<L>,
|
1562 1586 | crate::operation_shape::JsonUnions,
|
1563 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::JsonUnions, HandlerType>
|
1587 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::JsonUnions, HandlerType>
|
1564 1588 | >,
|
1565 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
1589 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1566 1590 | JsonProtocol<L>,
|
1567 1591 | crate::operation_shape::JsonUnions,
|
1568 1592 | ModelPl::Output
|
1569 1593 | >,
|
1570 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
1594 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1571 1595 | JsonProtocol<L>,
|
1572 1596 | crate::operation_shape::JsonUnions,
|
1573 1597 | <
|
1574 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1575 - | as ::aws_smithy_http_server::plugin::Plugin<
|
1598 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1599 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1576 1600 | JsonProtocol<L>,
|
1577 1601 | crate::operation_shape::JsonUnions,
|
1578 1602 | ModelPl::Output
|
1579 1603 | >
|
1580 1604 | >::Output
|
1581 1605 | >,
|
1582 1606 |
|
1583 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1607 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1584 1608 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1585 1609 |
|
1586 1610 | {
|
1587 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
1588 - | use ::aws_smithy_http_server::plugin::Plugin;
|
1611 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
1612 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
1589 1613 | let svc = crate::operation_shape::JsonUnions::from_handler(handler);
|
1590 1614 | let svc = self.model_plugin.apply(svc);
|
1591 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1592 - | .apply(svc);
|
1615 + | let svc =
|
1616 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1617 + | .apply(svc);
|
1593 1618 | let svc = self.http_plugin.apply(svc);
|
1594 1619 | self.json_unions_custom(svc)
|
1595 1620 | }
|
1596 1621 |
|
1597 1622 | /// Sets the [`JsonUnions`](crate::operation_shape::JsonUnions) operation.
|
1598 1623 | ///
|
1599 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
1600 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
1624 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
1625 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
1601 1626 | ///
|
1602 1627 | /// # Example
|
1603 1628 | ///
|
1604 1629 | /// ```no_run
|
1605 1630 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
1606 1631 | ///
|
1607 1632 | /// use json_rpc11::{input, output, error};
|
1608 1633 | ///
|
1609 1634 | /// async fn handler(input: input::JsonUnionsInput) -> Result<output::JsonUnionsOutput, error::JsonUnionsError> {
|
1610 1635 | /// todo!()
|
1611 1636 | /// }
|
1612 1637 | ///
|
1613 1638 | /// let config = JsonProtocolConfig::builder().build();
|
1614 1639 | /// let svc = ::tower::util::service_fn(handler);
|
1615 1640 | /// let app = JsonProtocol::builder(config)
|
1616 1641 | /// .json_unions_service(svc)
|
1617 1642 | /// /* Set other handlers */
|
1618 1643 | /// .build()
|
1619 1644 | /// .unwrap();
|
1620 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
1645 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
1621 1646 | /// ```
|
1622 1647 | ///
|
1623 1648 | pub fn json_unions_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
1624 1649 | where
|
1625 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::JsonUnions, ServiceExtractors>,
|
1650 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::JsonUnions, ServiceExtractors>,
|
1626 1651 |
|
1627 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
1652 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1628 1653 | JsonProtocol<L>,
|
1629 1654 | crate::operation_shape::JsonUnions,
|
1630 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::JsonUnions, S>
|
1655 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::JsonUnions, S>
|
1631 1656 | >,
|
1632 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
1657 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1633 1658 | JsonProtocol<L>,
|
1634 1659 | crate::operation_shape::JsonUnions,
|
1635 1660 | ModelPl::Output
|
1636 1661 | >,
|
1637 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
1662 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1638 1663 | JsonProtocol<L>,
|
1639 1664 | crate::operation_shape::JsonUnions,
|
1640 1665 | <
|
1641 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1642 - | as ::aws_smithy_http_server::plugin::Plugin<
|
1666 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1667 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1643 1668 | JsonProtocol<L>,
|
1644 1669 | crate::operation_shape::JsonUnions,
|
1645 1670 | ModelPl::Output
|
1646 1671 | >
|
1647 1672 | >::Output
|
1648 1673 | >,
|
1649 1674 |
|
1650 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1675 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1651 1676 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1652 1677 |
|
1653 1678 | {
|
1654 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
1655 - | use ::aws_smithy_http_server::plugin::Plugin;
|
1679 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
1680 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
1656 1681 | let svc = crate::operation_shape::JsonUnions::from_service(service);
|
1657 1682 | let svc = self.model_plugin.apply(svc);
|
1658 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1659 - | .apply(svc);
|
1683 + | let svc =
|
1684 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1685 + | .apply(svc);
|
1660 1686 | let svc = self.http_plugin.apply(svc);
|
1661 1687 | self.json_unions_custom(svc)
|
1662 1688 | }
|
1663 1689 |
|
1664 1690 | /// Sets the [`JsonUnions`](crate::operation_shape::JsonUnions) to a custom [`Service`](tower::Service).
|
1665 1691 | /// not constrained by the Smithy contract.
|
1666 1692 | fn json_unions_custom<S>(mut self, svc: S) -> Self
|
1667 1693 | where
|
1668 1694 | S: ::tower::Service<
|
1669 1695 | ::http::Request<Body>,
|
1670 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
1696 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
1671 1697 | Error = ::std::convert::Infallible,
|
1672 1698 | > + Clone
|
1673 1699 | + Send
|
1674 1700 | + 'static,
|
1675 1701 | S::Future: Send + 'static,
|
1676 1702 | {
|
1677 - | self.json_unions = Some(::aws_smithy_http_server::routing::Route::new(svc));
|
1703 + | self.json_unions = Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
1678 1704 | self
|
1679 1705 | }
|
1680 1706 |
|
1681 1707 | /// Sets the [`KitchenSinkOperation`](crate::operation_shape::KitchenSinkOperation) operation.
|
1682 1708 | ///
|
1683 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
1684 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
1709 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
1710 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
1685 1711 | ///
|
1686 1712 | /// # Example
|
1687 1713 | ///
|
1688 1714 | /// ```no_run
|
1689 1715 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
1690 1716 | ///
|
1691 1717 | /// use json_rpc11::{input, output, error};
|
1692 1718 | ///
|
1693 1719 | /// async fn handler(input: input::KitchenSinkOperationInput) -> Result<output::KitchenSinkOperationOutput, error::KitchenSinkOperationError> {
|
1694 1720 | /// todo!()
|
1695 1721 | /// }
|
1696 1722 | ///
|
1697 1723 | /// let config = JsonProtocolConfig::builder().build();
|
1698 1724 | /// let app = JsonProtocol::builder(config)
|
1699 1725 | /// .kitchen_sink_operation(handler)
|
1700 1726 | /// /* Set other handlers */
|
1701 1727 | /// .build()
|
1702 1728 | /// .unwrap();
|
1703 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
1729 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
1704 1730 | /// ```
|
1705 1731 | ///
|
1706 1732 | pub fn kitchen_sink_operation<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
1707 1733 | where
|
1708 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::KitchenSinkOperation, HandlerExtractors>,
|
1734 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::KitchenSinkOperation, HandlerExtractors>,
|
1709 1735 |
|
1710 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
1736 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1711 1737 | JsonProtocol<L>,
|
1712 1738 | crate::operation_shape::KitchenSinkOperation,
|
1713 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::KitchenSinkOperation, HandlerType>
|
1739 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::KitchenSinkOperation, HandlerType>
|
1714 1740 | >,
|
1715 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
1741 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1716 1742 | JsonProtocol<L>,
|
1717 1743 | crate::operation_shape::KitchenSinkOperation,
|
1718 1744 | ModelPl::Output
|
1719 1745 | >,
|
1720 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
1746 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1721 1747 | JsonProtocol<L>,
|
1722 1748 | crate::operation_shape::KitchenSinkOperation,
|
1723 1749 | <
|
1724 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1725 - | as ::aws_smithy_http_server::plugin::Plugin<
|
1750 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1751 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1726 1752 | JsonProtocol<L>,
|
1727 1753 | crate::operation_shape::KitchenSinkOperation,
|
1728 1754 | ModelPl::Output
|
1729 1755 | >
|
1730 1756 | >::Output
|
1731 1757 | >,
|
1732 1758 |
|
1733 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1759 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1734 1760 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1735 1761 |
|
1736 1762 | {
|
1737 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
1738 - | use ::aws_smithy_http_server::plugin::Plugin;
|
1763 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
1764 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
1739 1765 | let svc = crate::operation_shape::KitchenSinkOperation::from_handler(handler);
|
1740 1766 | let svc = self.model_plugin.apply(svc);
|
1741 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1742 - | .apply(svc);
|
1767 + | let svc =
|
1768 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1769 + | .apply(svc);
|
1743 1770 | let svc = self.http_plugin.apply(svc);
|
1744 1771 | self.kitchen_sink_operation_custom(svc)
|
1745 1772 | }
|
1746 1773 |
|
1747 1774 | /// Sets the [`KitchenSinkOperation`](crate::operation_shape::KitchenSinkOperation) operation.
|
1748 1775 | ///
|
1749 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
1750 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
1776 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
1777 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
1751 1778 | ///
|
1752 1779 | /// # Example
|
1753 1780 | ///
|
1754 1781 | /// ```no_run
|
1755 1782 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
1756 1783 | ///
|
1757 1784 | /// use json_rpc11::{input, output, error};
|
1758 1785 | ///
|
1759 1786 | /// async fn handler(input: input::KitchenSinkOperationInput) -> Result<output::KitchenSinkOperationOutput, error::KitchenSinkOperationError> {
|
1760 1787 | /// todo!()
|
1761 1788 | /// }
|
1762 1789 | ///
|
1763 1790 | /// let config = JsonProtocolConfig::builder().build();
|
1764 1791 | /// let svc = ::tower::util::service_fn(handler);
|
1765 1792 | /// let app = JsonProtocol::builder(config)
|
1766 1793 | /// .kitchen_sink_operation_service(svc)
|
1767 1794 | /// /* Set other handlers */
|
1768 1795 | /// .build()
|
1769 1796 | /// .unwrap();
|
1770 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
1797 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
1771 1798 | /// ```
|
1772 1799 | ///
|
1773 1800 | pub fn kitchen_sink_operation_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
1774 1801 | where
|
1775 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::KitchenSinkOperation, ServiceExtractors>,
|
1802 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::KitchenSinkOperation, ServiceExtractors>,
|
1776 1803 |
|
1777 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
1804 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1778 1805 | JsonProtocol<L>,
|
1779 1806 | crate::operation_shape::KitchenSinkOperation,
|
1780 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::KitchenSinkOperation, S>
|
1807 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::KitchenSinkOperation, S>
|
1781 1808 | >,
|
1782 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
1809 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1783 1810 | JsonProtocol<L>,
|
1784 1811 | crate::operation_shape::KitchenSinkOperation,
|
1785 1812 | ModelPl::Output
|
1786 1813 | >,
|
1787 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
1814 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1788 1815 | JsonProtocol<L>,
|
1789 1816 | crate::operation_shape::KitchenSinkOperation,
|
1790 1817 | <
|
1791 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1792 - | as ::aws_smithy_http_server::plugin::Plugin<
|
1818 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1819 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1793 1820 | JsonProtocol<L>,
|
1794 1821 | crate::operation_shape::KitchenSinkOperation,
|
1795 1822 | ModelPl::Output
|
1796 1823 | >
|
1797 1824 | >::Output
|
1798 1825 | >,
|
1799 1826 |
|
1800 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1827 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1801 1828 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1802 1829 |
|
1803 1830 | {
|
1804 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
1805 - | use ::aws_smithy_http_server::plugin::Plugin;
|
1831 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
1832 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
1806 1833 | let svc = crate::operation_shape::KitchenSinkOperation::from_service(service);
|
1807 1834 | let svc = self.model_plugin.apply(svc);
|
1808 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1809 - | .apply(svc);
|
1835 + | let svc =
|
1836 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1837 + | .apply(svc);
|
1810 1838 | let svc = self.http_plugin.apply(svc);
|
1811 1839 | self.kitchen_sink_operation_custom(svc)
|
1812 1840 | }
|
1813 1841 |
|
1814 1842 | /// Sets the [`KitchenSinkOperation`](crate::operation_shape::KitchenSinkOperation) to a custom [`Service`](tower::Service).
|
1815 1843 | /// not constrained by the Smithy contract.
|
1816 1844 | fn kitchen_sink_operation_custom<S>(mut self, svc: S) -> Self
|
1817 1845 | where
|
1818 1846 | S: ::tower::Service<
|
1819 1847 | ::http::Request<Body>,
|
1820 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
1848 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
1821 1849 | Error = ::std::convert::Infallible,
|
1822 1850 | > + Clone
|
1823 1851 | + Send
|
1824 1852 | + 'static,
|
1825 1853 | S::Future: Send + 'static,
|
1826 1854 | {
|
1827 - | self.kitchen_sink_operation = Some(::aws_smithy_http_server::routing::Route::new(svc));
|
1855 + | self.kitchen_sink_operation =
|
1856 + | Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
1828 1857 | self
|
1829 1858 | }
|
1830 1859 |
|
1831 1860 | /// Sets the [`NullOperation`](crate::operation_shape::NullOperation) operation.
|
1832 1861 | ///
|
1833 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
1834 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
1862 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
1863 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
1835 1864 | ///
|
1836 1865 | /// # Example
|
1837 1866 | ///
|
1838 1867 | /// ```no_run
|
1839 1868 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
1840 1869 | ///
|
1841 1870 | /// use json_rpc11::{input, output, error};
|
1842 1871 | ///
|
1843 1872 | /// async fn handler(input: input::NullOperationInput) -> Result<output::NullOperationOutput, error::NullOperationError> {
|
1844 1873 | /// todo!()
|
1845 1874 | /// }
|
1846 1875 | ///
|
1847 1876 | /// let config = JsonProtocolConfig::builder().build();
|
1848 1877 | /// let app = JsonProtocol::builder(config)
|
1849 1878 | /// .null_operation(handler)
|
1850 1879 | /// /* Set other handlers */
|
1851 1880 | /// .build()
|
1852 1881 | /// .unwrap();
|
1853 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
1882 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
1854 1883 | /// ```
|
1855 1884 | ///
|
1856 1885 | pub fn null_operation<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
1857 1886 | where
|
1858 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::NullOperation, HandlerExtractors>,
|
1887 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::NullOperation, HandlerExtractors>,
|
1859 1888 |
|
1860 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
1889 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1861 1890 | JsonProtocol<L>,
|
1862 1891 | crate::operation_shape::NullOperation,
|
1863 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::NullOperation, HandlerType>
|
1892 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::NullOperation, HandlerType>
|
1864 1893 | >,
|
1865 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
1894 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1866 1895 | JsonProtocol<L>,
|
1867 1896 | crate::operation_shape::NullOperation,
|
1868 1897 | ModelPl::Output
|
1869 1898 | >,
|
1870 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
1899 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1871 1900 | JsonProtocol<L>,
|
1872 1901 | crate::operation_shape::NullOperation,
|
1873 1902 | <
|
1874 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1875 - | as ::aws_smithy_http_server::plugin::Plugin<
|
1903 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1904 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1876 1905 | JsonProtocol<L>,
|
1877 1906 | crate::operation_shape::NullOperation,
|
1878 1907 | ModelPl::Output
|
1879 1908 | >
|
1880 1909 | >::Output
|
1881 1910 | >,
|
1882 1911 |
|
1883 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1912 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1884 1913 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1885 1914 |
|
1886 1915 | {
|
1887 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
1888 - | use ::aws_smithy_http_server::plugin::Plugin;
|
1916 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
1917 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
1889 1918 | let svc = crate::operation_shape::NullOperation::from_handler(handler);
|
1890 1919 | let svc = self.model_plugin.apply(svc);
|
1891 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1892 - | .apply(svc);
|
1920 + | let svc =
|
1921 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1922 + | .apply(svc);
|
1893 1923 | let svc = self.http_plugin.apply(svc);
|
1894 1924 | self.null_operation_custom(svc)
|
1895 1925 | }
|
1896 1926 |
|
1897 1927 | /// Sets the [`NullOperation`](crate::operation_shape::NullOperation) operation.
|
1898 1928 | ///
|
1899 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
1900 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
1929 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
1930 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
1901 1931 | ///
|
1902 1932 | /// # Example
|
1903 1933 | ///
|
1904 1934 | /// ```no_run
|
1905 1935 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
1906 1936 | ///
|
1907 1937 | /// use json_rpc11::{input, output, error};
|
1908 1938 | ///
|
1909 1939 | /// async fn handler(input: input::NullOperationInput) -> Result<output::NullOperationOutput, error::NullOperationError> {
|
1910 1940 | /// todo!()
|
1911 1941 | /// }
|
1912 1942 | ///
|
1913 1943 | /// let config = JsonProtocolConfig::builder().build();
|
1914 1944 | /// let svc = ::tower::util::service_fn(handler);
|
1915 1945 | /// let app = JsonProtocol::builder(config)
|
1916 1946 | /// .null_operation_service(svc)
|
1917 1947 | /// /* Set other handlers */
|
1918 1948 | /// .build()
|
1919 1949 | /// .unwrap();
|
1920 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
1950 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
1921 1951 | /// ```
|
1922 1952 | ///
|
1923 1953 | pub fn null_operation_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
1924 1954 | where
|
1925 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::NullOperation, ServiceExtractors>,
|
1955 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::NullOperation, ServiceExtractors>,
|
1926 1956 |
|
1927 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
1957 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1928 1958 | JsonProtocol<L>,
|
1929 1959 | crate::operation_shape::NullOperation,
|
1930 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::NullOperation, S>
|
1960 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::NullOperation, S>
|
1931 1961 | >,
|
1932 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
1962 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1933 1963 | JsonProtocol<L>,
|
1934 1964 | crate::operation_shape::NullOperation,
|
1935 1965 | ModelPl::Output
|
1936 1966 | >,
|
1937 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
1967 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1938 1968 | JsonProtocol<L>,
|
1939 1969 | crate::operation_shape::NullOperation,
|
1940 1970 | <
|
1941 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1942 - | as ::aws_smithy_http_server::plugin::Plugin<
|
1971 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1972 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1943 1973 | JsonProtocol<L>,
|
1944 1974 | crate::operation_shape::NullOperation,
|
1945 1975 | ModelPl::Output
|
1946 1976 | >
|
1947 1977 | >::Output
|
1948 1978 | >,
|
1949 1979 |
|
1950 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1980 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1951 1981 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1952 1982 |
|
1953 1983 | {
|
1954 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
1955 - | use ::aws_smithy_http_server::plugin::Plugin;
|
1984 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
1985 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
1956 1986 | let svc = crate::operation_shape::NullOperation::from_service(service);
|
1957 1987 | let svc = self.model_plugin.apply(svc);
|
1958 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1959 - | .apply(svc);
|
1988 + | let svc =
|
1989 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1990 + | .apply(svc);
|
1960 1991 | let svc = self.http_plugin.apply(svc);
|
1961 1992 | self.null_operation_custom(svc)
|
1962 1993 | }
|
1963 1994 |
|
1964 1995 | /// Sets the [`NullOperation`](crate::operation_shape::NullOperation) to a custom [`Service`](tower::Service).
|
1965 1996 | /// not constrained by the Smithy contract.
|
1966 1997 | fn null_operation_custom<S>(mut self, svc: S) -> Self
|
1967 1998 | where
|
1968 1999 | S: ::tower::Service<
|
1969 2000 | ::http::Request<Body>,
|
1970 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
2001 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
1971 2002 | Error = ::std::convert::Infallible,
|
1972 2003 | > + Clone
|
1973 2004 | + Send
|
1974 2005 | + 'static,
|
1975 2006 | S::Future: Send + 'static,
|
1976 2007 | {
|
1977 - | self.null_operation = Some(::aws_smithy_http_server::routing::Route::new(svc));
|
2008 + | self.null_operation = Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
1978 2009 | self
|
1979 2010 | }
|
1980 2011 |
|
1981 2012 | /// Sets the [`OperationWithOptionalInputOutput`](crate::operation_shape::OperationWithOptionalInputOutput) operation.
|
1982 2013 | ///
|
1983 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
1984 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
2014 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
2015 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
1985 2016 | ///
|
1986 2017 | /// # Example
|
1987 2018 | ///
|
1988 2019 | /// ```no_run
|
1989 2020 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
1990 2021 | ///
|
1991 2022 | /// use json_rpc11::{input, output, error};
|
1992 2023 | ///
|
1993 2024 | /// async fn handler(input: input::OperationWithOptionalInputOutputInput) -> Result<output::OperationWithOptionalInputOutputOutput, error::OperationWithOptionalInputOutputError> {
|
1994 2025 | /// todo!()
|
1995 2026 | /// }
|
1996 2027 | ///
|
1997 2028 | /// let config = JsonProtocolConfig::builder().build();
|
1998 2029 | /// let app = JsonProtocol::builder(config)
|
1999 2030 | /// .operation_with_optional_input_output(handler)
|
2000 2031 | /// /* Set other handlers */
|
2001 2032 | /// .build()
|
2002 2033 | /// .unwrap();
|
2003 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
2034 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
2004 2035 | /// ```
|
2005 2036 | ///
|
2006 2037 | pub fn operation_with_optional_input_output<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
2007 2038 | where
|
2008 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::OperationWithOptionalInputOutput, HandlerExtractors>,
|
2039 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::OperationWithOptionalInputOutput, HandlerExtractors>,
|
2009 2040 |
|
2010 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
2041 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2011 2042 | JsonProtocol<L>,
|
2012 2043 | crate::operation_shape::OperationWithOptionalInputOutput,
|
2013 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::OperationWithOptionalInputOutput, HandlerType>
|
2044 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::OperationWithOptionalInputOutput, HandlerType>
|
2014 2045 | >,
|
2015 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
2046 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2016 2047 | JsonProtocol<L>,
|
2017 2048 | crate::operation_shape::OperationWithOptionalInputOutput,
|
2018 2049 | ModelPl::Output
|
2019 2050 | >,
|
2020 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
2051 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2021 2052 | JsonProtocol<L>,
|
2022 2053 | crate::operation_shape::OperationWithOptionalInputOutput,
|
2023 2054 | <
|
2024 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
2025 - | as ::aws_smithy_http_server::plugin::Plugin<
|
2055 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
2056 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2026 2057 | JsonProtocol<L>,
|
2027 2058 | crate::operation_shape::OperationWithOptionalInputOutput,
|
2028 2059 | ModelPl::Output
|
2029 2060 | >
|
2030 2061 | >::Output
|
2031 2062 | >,
|
2032 2063 |
|
2033 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
2064 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
2034 2065 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
2035 2066 |
|
2036 2067 | {
|
2037 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
2038 - | use ::aws_smithy_http_server::plugin::Plugin;
|
2068 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
2069 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
2039 2070 | let svc = crate::operation_shape::OperationWithOptionalInputOutput::from_handler(handler);
|
2040 2071 | let svc = self.model_plugin.apply(svc);
|
2041 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
2042 - | .apply(svc);
|
2072 + | let svc =
|
2073 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
2074 + | .apply(svc);
|
2043 2075 | let svc = self.http_plugin.apply(svc);
|
2044 2076 | self.operation_with_optional_input_output_custom(svc)
|
2045 2077 | }
|
2046 2078 |
|
2047 2079 | /// Sets the [`OperationWithOptionalInputOutput`](crate::operation_shape::OperationWithOptionalInputOutput) operation.
|
2048 2080 | ///
|
2049 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
2050 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
2081 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
2082 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
2051 2083 | ///
|
2052 2084 | /// # Example
|
2053 2085 | ///
|
2054 2086 | /// ```no_run
|
2055 2087 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
2056 2088 | ///
|
2057 2089 | /// use json_rpc11::{input, output, error};
|
2058 2090 | ///
|
2059 2091 | /// async fn handler(input: input::OperationWithOptionalInputOutputInput) -> Result<output::OperationWithOptionalInputOutputOutput, error::OperationWithOptionalInputOutputError> {
|
2060 2092 | /// todo!()
|
2061 2093 | /// }
|
2062 2094 | ///
|
2063 2095 | /// let config = JsonProtocolConfig::builder().build();
|
2064 2096 | /// let svc = ::tower::util::service_fn(handler);
|
2065 2097 | /// let app = JsonProtocol::builder(config)
|
2066 2098 | /// .operation_with_optional_input_output_service(svc)
|
2067 2099 | /// /* Set other handlers */
|
2068 2100 | /// .build()
|
2069 2101 | /// .unwrap();
|
2070 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
2102 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
2071 2103 | /// ```
|
2072 2104 | ///
|
2073 2105 | pub fn operation_with_optional_input_output_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
2074 2106 | where
|
2075 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::OperationWithOptionalInputOutput, ServiceExtractors>,
|
2107 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::OperationWithOptionalInputOutput, ServiceExtractors>,
|
2076 2108 |
|
2077 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
2109 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2078 2110 | JsonProtocol<L>,
|
2079 2111 | crate::operation_shape::OperationWithOptionalInputOutput,
|
2080 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::OperationWithOptionalInputOutput, S>
|
2112 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::OperationWithOptionalInputOutput, S>
|
2081 2113 | >,
|
2082 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
2114 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2083 2115 | JsonProtocol<L>,
|
2084 2116 | crate::operation_shape::OperationWithOptionalInputOutput,
|
2085 2117 | ModelPl::Output
|
2086 2118 | >,
|
2087 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
2119 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2088 2120 | JsonProtocol<L>,
|
2089 2121 | crate::operation_shape::OperationWithOptionalInputOutput,
|
2090 2122 | <
|
2091 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
2092 - | as ::aws_smithy_http_server::plugin::Plugin<
|
2123 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
2124 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2093 2125 | JsonProtocol<L>,
|
2094 2126 | crate::operation_shape::OperationWithOptionalInputOutput,
|
2095 2127 | ModelPl::Output
|
2096 2128 | >
|
2097 2129 | >::Output
|
2098 2130 | >,
|
2099 2131 |
|
2100 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
2132 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
2101 2133 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
2102 2134 |
|
2103 2135 | {
|
2104 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
2105 - | use ::aws_smithy_http_server::plugin::Plugin;
|
2136 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
2137 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
2106 2138 | let svc = crate::operation_shape::OperationWithOptionalInputOutput::from_service(service);
|
2107 2139 | let svc = self.model_plugin.apply(svc);
|
2108 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
2109 - | .apply(svc);
|
2140 + | let svc =
|
2141 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
2142 + | .apply(svc);
|
2110 2143 | let svc = self.http_plugin.apply(svc);
|
2111 2144 | self.operation_with_optional_input_output_custom(svc)
|
2112 2145 | }
|
2113 2146 |
|
2114 2147 | /// Sets the [`OperationWithOptionalInputOutput`](crate::operation_shape::OperationWithOptionalInputOutput) to a custom [`Service`](tower::Service).
|
2115 2148 | /// not constrained by the Smithy contract.
|
2116 2149 | fn operation_with_optional_input_output_custom<S>(mut self, svc: S) -> Self
|
2117 2150 | where
|
2118 2151 | S: ::tower::Service<
|
2119 2152 | ::http::Request<Body>,
|
2120 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
2153 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
2121 2154 | Error = ::std::convert::Infallible,
|
2122 2155 | > + Clone
|
2123 2156 | + Send
|
2124 2157 | + 'static,
|
2125 2158 | S::Future: Send + 'static,
|
2126 2159 | {
|
2127 2160 | self.operation_with_optional_input_output =
|
2128 - | Some(::aws_smithy_http_server::routing::Route::new(svc));
|
2161 + | Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
2129 2162 | self
|
2130 2163 | }
|
2131 2164 |
|
2132 2165 | /// Sets the [`PutAndGetInlineDocuments`](crate::operation_shape::PutAndGetInlineDocuments) operation.
|
2133 2166 | ///
|
2134 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
2135 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
2167 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
2168 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
2136 2169 | ///
|
2137 2170 | /// # Example
|
2138 2171 | ///
|
2139 2172 | /// ```no_run
|
2140 2173 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
2141 2174 | ///
|
2142 2175 | /// use json_rpc11::{input, output, error};
|
2143 2176 | ///
|
2144 2177 | /// async fn handler(input: input::PutAndGetInlineDocumentsInput) -> Result<output::PutAndGetInlineDocumentsOutput, error::PutAndGetInlineDocumentsError> {
|
2145 2178 | /// todo!()
|
2146 2179 | /// }
|
2147 2180 | ///
|
2148 2181 | /// let config = JsonProtocolConfig::builder().build();
|
2149 2182 | /// let app = JsonProtocol::builder(config)
|
2150 2183 | /// .put_and_get_inline_documents(handler)
|
2151 2184 | /// /* Set other handlers */
|
2152 2185 | /// .build()
|
2153 2186 | /// .unwrap();
|
2154 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
2187 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
2155 2188 | /// ```
|
2156 2189 | ///
|
2157 2190 | pub fn put_and_get_inline_documents<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
2158 2191 | where
|
2159 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::PutAndGetInlineDocuments, HandlerExtractors>,
|
2192 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::PutAndGetInlineDocuments, HandlerExtractors>,
|
2160 2193 |
|
2161 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
2194 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2162 2195 | JsonProtocol<L>,
|
2163 2196 | crate::operation_shape::PutAndGetInlineDocuments,
|
2164 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::PutAndGetInlineDocuments, HandlerType>
|
2197 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::PutAndGetInlineDocuments, HandlerType>
|
2165 2198 | >,
|
2166 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
2199 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2167 2200 | JsonProtocol<L>,
|
2168 2201 | crate::operation_shape::PutAndGetInlineDocuments,
|
2169 2202 | ModelPl::Output
|
2170 2203 | >,
|
2171 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
2204 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2172 2205 | JsonProtocol<L>,
|
2173 2206 | crate::operation_shape::PutAndGetInlineDocuments,
|
2174 2207 | <
|
2175 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
2176 - | as ::aws_smithy_http_server::plugin::Plugin<
|
2208 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
2209 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2177 2210 | JsonProtocol<L>,
|
2178 2211 | crate::operation_shape::PutAndGetInlineDocuments,
|
2179 2212 | ModelPl::Output
|
2180 2213 | >
|
2181 2214 | >::Output
|
2182 2215 | >,
|
2183 2216 |
|
2184 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
2217 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
2185 2218 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
2186 2219 |
|
2187 2220 | {
|
2188 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
2189 - | use ::aws_smithy_http_server::plugin::Plugin;
|
2221 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
2222 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
2190 2223 | let svc = crate::operation_shape::PutAndGetInlineDocuments::from_handler(handler);
|
2191 2224 | let svc = self.model_plugin.apply(svc);
|
2192 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
2193 - | .apply(svc);
|
2225 + | let svc =
|
2226 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
2227 + | .apply(svc);
|
2194 2228 | let svc = self.http_plugin.apply(svc);
|
2195 2229 | self.put_and_get_inline_documents_custom(svc)
|
2196 2230 | }
|
2197 2231 |
|
2198 2232 | /// Sets the [`PutAndGetInlineDocuments`](crate::operation_shape::PutAndGetInlineDocuments) operation.
|
2199 2233 | ///
|
2200 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
2201 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
2234 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
2235 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
2202 2236 | ///
|
2203 2237 | /// # Example
|
2204 2238 | ///
|
2205 2239 | /// ```no_run
|
2206 2240 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
2207 2241 | ///
|
2208 2242 | /// use json_rpc11::{input, output, error};
|
2209 2243 | ///
|
2210 2244 | /// async fn handler(input: input::PutAndGetInlineDocumentsInput) -> Result<output::PutAndGetInlineDocumentsOutput, error::PutAndGetInlineDocumentsError> {
|
2211 2245 | /// todo!()
|
2212 2246 | /// }
|
2213 2247 | ///
|
2214 2248 | /// let config = JsonProtocolConfig::builder().build();
|
2215 2249 | /// let svc = ::tower::util::service_fn(handler);
|
2216 2250 | /// let app = JsonProtocol::builder(config)
|
2217 2251 | /// .put_and_get_inline_documents_service(svc)
|
2218 2252 | /// /* Set other handlers */
|
2219 2253 | /// .build()
|
2220 2254 | /// .unwrap();
|
2221 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
2255 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
2222 2256 | /// ```
|
2223 2257 | ///
|
2224 2258 | pub fn put_and_get_inline_documents_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
2225 2259 | where
|
2226 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::PutAndGetInlineDocuments, ServiceExtractors>,
|
2260 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::PutAndGetInlineDocuments, ServiceExtractors>,
|
2227 2261 |
|
2228 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
2262 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2229 2263 | JsonProtocol<L>,
|
2230 2264 | crate::operation_shape::PutAndGetInlineDocuments,
|
2231 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::PutAndGetInlineDocuments, S>
|
2265 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::PutAndGetInlineDocuments, S>
|
2232 2266 | >,
|
2233 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
2267 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2234 2268 | JsonProtocol<L>,
|
2235 2269 | crate::operation_shape::PutAndGetInlineDocuments,
|
2236 2270 | ModelPl::Output
|
2237 2271 | >,
|
2238 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
2272 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2239 2273 | JsonProtocol<L>,
|
2240 2274 | crate::operation_shape::PutAndGetInlineDocuments,
|
2241 2275 | <
|
2242 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
2243 - | as ::aws_smithy_http_server::plugin::Plugin<
|
2276 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
2277 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2244 2278 | JsonProtocol<L>,
|
2245 2279 | crate::operation_shape::PutAndGetInlineDocuments,
|
2246 2280 | ModelPl::Output
|
2247 2281 | >
|
2248 2282 | >::Output
|
2249 2283 | >,
|
2250 2284 |
|
2251 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
2285 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
2252 2286 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
2253 2287 |
|
2254 2288 | {
|
2255 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
2256 - | use ::aws_smithy_http_server::plugin::Plugin;
|
2289 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
2290 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
2257 2291 | let svc = crate::operation_shape::PutAndGetInlineDocuments::from_service(service);
|
2258 2292 | let svc = self.model_plugin.apply(svc);
|
2259 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
2260 - | .apply(svc);
|
2293 + | let svc =
|
2294 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
2295 + | .apply(svc);
|
2261 2296 | let svc = self.http_plugin.apply(svc);
|
2262 2297 | self.put_and_get_inline_documents_custom(svc)
|
2263 2298 | }
|
2264 2299 |
|
2265 2300 | /// Sets the [`PutAndGetInlineDocuments`](crate::operation_shape::PutAndGetInlineDocuments) to a custom [`Service`](tower::Service).
|
2266 2301 | /// not constrained by the Smithy contract.
|
2267 2302 | fn put_and_get_inline_documents_custom<S>(mut self, svc: S) -> Self
|
2268 2303 | where
|
2269 2304 | S: ::tower::Service<
|
2270 2305 | ::http::Request<Body>,
|
2271 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
2306 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
2272 2307 | Error = ::std::convert::Infallible,
|
2273 2308 | > + Clone
|
2274 2309 | + Send
|
2275 2310 | + 'static,
|
2276 2311 | S::Future: Send + 'static,
|
2277 2312 | {
|
2278 2313 | self.put_and_get_inline_documents =
|
2279 - | Some(::aws_smithy_http_server::routing::Route::new(svc));
|
2314 + | Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
2280 2315 | self
|
2281 2316 | }
|
2282 2317 |
|
2283 2318 | /// Sets the [`PutWithContentEncoding`](crate::operation_shape::PutWithContentEncoding) operation.
|
2284 2319 | ///
|
2285 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
2286 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
2320 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
2321 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
2287 2322 | ///
|
2288 2323 | /// # Example
|
2289 2324 | ///
|
2290 2325 | /// ```no_run
|
2291 2326 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
2292 2327 | ///
|
2293 2328 | /// use json_rpc11::{input, output, error};
|
2294 2329 | ///
|
2295 2330 | /// async fn handler(input: input::PutWithContentEncodingInput) -> Result<output::PutWithContentEncodingOutput, error::PutWithContentEncodingError> {
|
2296 2331 | /// todo!()
|
2297 2332 | /// }
|
2298 2333 | ///
|
2299 2334 | /// let config = JsonProtocolConfig::builder().build();
|
2300 2335 | /// let app = JsonProtocol::builder(config)
|
2301 2336 | /// .put_with_content_encoding(handler)
|
2302 2337 | /// /* Set other handlers */
|
2303 2338 | /// .build()
|
2304 2339 | /// .unwrap();
|
2305 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
2340 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
2306 2341 | /// ```
|
2307 2342 | ///
|
2308 2343 | pub fn put_with_content_encoding<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
2309 2344 | where
|
2310 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::PutWithContentEncoding, HandlerExtractors>,
|
2345 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::PutWithContentEncoding, HandlerExtractors>,
|
2311 2346 |
|
2312 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
2347 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2313 2348 | JsonProtocol<L>,
|
2314 2349 | crate::operation_shape::PutWithContentEncoding,
|
2315 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::PutWithContentEncoding, HandlerType>
|
2350 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::PutWithContentEncoding, HandlerType>
|
2316 2351 | >,
|
2317 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
2352 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2318 2353 | JsonProtocol<L>,
|
2319 2354 | crate::operation_shape::PutWithContentEncoding,
|
2320 2355 | ModelPl::Output
|
2321 2356 | >,
|
2322 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
2357 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2323 2358 | JsonProtocol<L>,
|
2324 2359 | crate::operation_shape::PutWithContentEncoding,
|
2325 2360 | <
|
2326 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
2327 - | as ::aws_smithy_http_server::plugin::Plugin<
|
2361 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
2362 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2328 2363 | JsonProtocol<L>,
|
2329 2364 | crate::operation_shape::PutWithContentEncoding,
|
2330 2365 | ModelPl::Output
|
2331 2366 | >
|
2332 2367 | >::Output
|
2333 2368 | >,
|
2334 2369 |
|
2335 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
2370 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
2336 2371 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
2337 2372 |
|
2338 2373 | {
|
2339 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
2340 - | use ::aws_smithy_http_server::plugin::Plugin;
|
2374 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
2375 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
2341 2376 | let svc = crate::operation_shape::PutWithContentEncoding::from_handler(handler);
|
2342 2377 | let svc = self.model_plugin.apply(svc);
|
2343 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
2344 - | .apply(svc);
|
2378 + | let svc =
|
2379 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
2380 + | .apply(svc);
|
2345 2381 | let svc = self.http_plugin.apply(svc);
|
2346 2382 | self.put_with_content_encoding_custom(svc)
|
2347 2383 | }
|
2348 2384 |
|
2349 2385 | /// Sets the [`PutWithContentEncoding`](crate::operation_shape::PutWithContentEncoding) operation.
|
2350 2386 | ///
|
2351 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
2352 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
2387 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
2388 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
2353 2389 | ///
|
2354 2390 | /// # Example
|
2355 2391 | ///
|
2356 2392 | /// ```no_run
|
2357 2393 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
2358 2394 | ///
|
2359 2395 | /// use json_rpc11::{input, output, error};
|
2360 2396 | ///
|
2361 2397 | /// async fn handler(input: input::PutWithContentEncodingInput) -> Result<output::PutWithContentEncodingOutput, error::PutWithContentEncodingError> {
|
2362 2398 | /// todo!()
|
2363 2399 | /// }
|
2364 2400 | ///
|
2365 2401 | /// let config = JsonProtocolConfig::builder().build();
|
2366 2402 | /// let svc = ::tower::util::service_fn(handler);
|
2367 2403 | /// let app = JsonProtocol::builder(config)
|
2368 2404 | /// .put_with_content_encoding_service(svc)
|
2369 2405 | /// /* Set other handlers */
|
2370 2406 | /// .build()
|
2371 2407 | /// .unwrap();
|
2372 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
2408 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
2373 2409 | /// ```
|
2374 2410 | ///
|
2375 2411 | pub fn put_with_content_encoding_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
2376 2412 | where
|
2377 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::PutWithContentEncoding, ServiceExtractors>,
|
2413 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::PutWithContentEncoding, ServiceExtractors>,
|
2378 2414 |
|
2379 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
2415 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2380 2416 | JsonProtocol<L>,
|
2381 2417 | crate::operation_shape::PutWithContentEncoding,
|
2382 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::PutWithContentEncoding, S>
|
2418 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::PutWithContentEncoding, S>
|
2383 2419 | >,
|
2384 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
2420 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2385 2421 | JsonProtocol<L>,
|
2386 2422 | crate::operation_shape::PutWithContentEncoding,
|
2387 2423 | ModelPl::Output
|
2388 2424 | >,
|
2389 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
2425 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2390 2426 | JsonProtocol<L>,
|
2391 2427 | crate::operation_shape::PutWithContentEncoding,
|
2392 2428 | <
|
2393 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
2394 - | as ::aws_smithy_http_server::plugin::Plugin<
|
2429 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
2430 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2395 2431 | JsonProtocol<L>,
|
2396 2432 | crate::operation_shape::PutWithContentEncoding,
|
2397 2433 | ModelPl::Output
|
2398 2434 | >
|
2399 2435 | >::Output
|
2400 2436 | >,
|
2401 2437 |
|
2402 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
2438 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
2403 2439 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
2404 2440 |
|
2405 2441 | {
|
2406 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
2407 - | use ::aws_smithy_http_server::plugin::Plugin;
|
2442 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
2443 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
2408 2444 | let svc = crate::operation_shape::PutWithContentEncoding::from_service(service);
|
2409 2445 | let svc = self.model_plugin.apply(svc);
|
2410 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
2411 - | .apply(svc);
|
2446 + | let svc =
|
2447 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
2448 + | .apply(svc);
|
2412 2449 | let svc = self.http_plugin.apply(svc);
|
2413 2450 | self.put_with_content_encoding_custom(svc)
|
2414 2451 | }
|
2415 2452 |
|
2416 2453 | /// Sets the [`PutWithContentEncoding`](crate::operation_shape::PutWithContentEncoding) to a custom [`Service`](tower::Service).
|
2417 2454 | /// not constrained by the Smithy contract.
|
2418 2455 | fn put_with_content_encoding_custom<S>(mut self, svc: S) -> Self
|
2419 2456 | where
|
2420 2457 | S: ::tower::Service<
|
2421 2458 | ::http::Request<Body>,
|
2422 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
2459 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
2423 2460 | Error = ::std::convert::Infallible,
|
2424 2461 | > + Clone
|
2425 2462 | + Send
|
2426 2463 | + 'static,
|
2427 2464 | S::Future: Send + 'static,
|
2428 2465 | {
|
2429 - | self.put_with_content_encoding = Some(::aws_smithy_http_server::routing::Route::new(svc));
|
2466 + | self.put_with_content_encoding =
|
2467 + | Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
2430 2468 | self
|
2431 2469 | }
|
2432 2470 |
|
2433 2471 | /// Sets the [`SimpleScalarProperties`](crate::operation_shape::SimpleScalarProperties) operation.
|
2434 2472 | ///
|
2435 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
2436 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
2473 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
2474 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
2437 2475 | ///
|
2438 2476 | /// # Example
|
2439 2477 | ///
|
2440 2478 | /// ```no_run
|
2441 2479 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
2442 2480 | ///
|
2443 2481 | /// use json_rpc11::{input, output, error};
|
2444 2482 | ///
|
2445 2483 | /// async fn handler(input: input::SimpleScalarPropertiesInput) -> Result<output::SimpleScalarPropertiesOutput, error::SimpleScalarPropertiesError> {
|
2446 2484 | /// todo!()
|
2447 2485 | /// }
|
2448 2486 | ///
|
2449 2487 | /// let config = JsonProtocolConfig::builder().build();
|
2450 2488 | /// let app = JsonProtocol::builder(config)
|
2451 2489 | /// .simple_scalar_properties(handler)
|
2452 2490 | /// /* Set other handlers */
|
2453 2491 | /// .build()
|
2454 2492 | /// .unwrap();
|
2455 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
2493 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
2456 2494 | /// ```
|
2457 2495 | ///
|
2458 2496 | pub fn simple_scalar_properties<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
2459 2497 | where
|
2460 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::SimpleScalarProperties, HandlerExtractors>,
|
2498 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::SimpleScalarProperties, HandlerExtractors>,
|
2461 2499 |
|
2462 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
2500 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2463 2501 | JsonProtocol<L>,
|
2464 2502 | crate::operation_shape::SimpleScalarProperties,
|
2465 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::SimpleScalarProperties, HandlerType>
|
2503 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::SimpleScalarProperties, HandlerType>
|
2466 2504 | >,
|
2467 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
2505 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2468 2506 | JsonProtocol<L>,
|
2469 2507 | crate::operation_shape::SimpleScalarProperties,
|
2470 2508 | ModelPl::Output
|
2471 2509 | >,
|
2472 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
2510 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2473 2511 | JsonProtocol<L>,
|
2474 2512 | crate::operation_shape::SimpleScalarProperties,
|
2475 2513 | <
|
2476 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
2477 - | as ::aws_smithy_http_server::plugin::Plugin<
|
2514 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
2515 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2478 2516 | JsonProtocol<L>,
|
2479 2517 | crate::operation_shape::SimpleScalarProperties,
|
2480 2518 | ModelPl::Output
|
2481 2519 | >
|
2482 2520 | >::Output
|
2483 2521 | >,
|
2484 2522 |
|
2485 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
2523 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
2486 2524 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
2487 2525 |
|
2488 2526 | {
|
2489 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
2490 - | use ::aws_smithy_http_server::plugin::Plugin;
|
2527 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
2528 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
2491 2529 | let svc = crate::operation_shape::SimpleScalarProperties::from_handler(handler);
|
2492 2530 | let svc = self.model_plugin.apply(svc);
|
2493 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
2494 - | .apply(svc);
|
2531 + | let svc =
|
2532 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
2533 + | .apply(svc);
|
2495 2534 | let svc = self.http_plugin.apply(svc);
|
2496 2535 | self.simple_scalar_properties_custom(svc)
|
2497 2536 | }
|
2498 2537 |
|
2499 2538 | /// Sets the [`SimpleScalarProperties`](crate::operation_shape::SimpleScalarProperties) operation.
|
2500 2539 | ///
|
2501 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
2502 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
2540 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
2541 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
2503 2542 | ///
|
2504 2543 | /// # Example
|
2505 2544 | ///
|
2506 2545 | /// ```no_run
|
2507 2546 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
2508 2547 | ///
|
2509 2548 | /// use json_rpc11::{input, output, error};
|
2510 2549 | ///
|
2511 2550 | /// async fn handler(input: input::SimpleScalarPropertiesInput) -> Result<output::SimpleScalarPropertiesOutput, error::SimpleScalarPropertiesError> {
|
2512 2551 | /// todo!()
|
2513 2552 | /// }
|
2514 2553 | ///
|
2515 2554 | /// let config = JsonProtocolConfig::builder().build();
|
2516 2555 | /// let svc = ::tower::util::service_fn(handler);
|
2517 2556 | /// let app = JsonProtocol::builder(config)
|
2518 2557 | /// .simple_scalar_properties_service(svc)
|
2519 2558 | /// /* Set other handlers */
|
2520 2559 | /// .build()
|
2521 2560 | /// .unwrap();
|
2522 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
2561 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
2523 2562 | /// ```
|
2524 2563 | ///
|
2525 2564 | pub fn simple_scalar_properties_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
2526 2565 | where
|
2527 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::SimpleScalarProperties, ServiceExtractors>,
|
2566 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::SimpleScalarProperties, ServiceExtractors>,
|
2528 2567 |
|
2529 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
2568 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2530 2569 | JsonProtocol<L>,
|
2531 2570 | crate::operation_shape::SimpleScalarProperties,
|
2532 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::SimpleScalarProperties, S>
|
2571 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::SimpleScalarProperties, S>
|
2533 2572 | >,
|
2534 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
2573 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2535 2574 | JsonProtocol<L>,
|
2536 2575 | crate::operation_shape::SimpleScalarProperties,
|
2537 2576 | ModelPl::Output
|
2538 2577 | >,
|
2539 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
2578 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2540 2579 | JsonProtocol<L>,
|
2541 2580 | crate::operation_shape::SimpleScalarProperties,
|
2542 2581 | <
|
2543 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
2544 - | as ::aws_smithy_http_server::plugin::Plugin<
|
2582 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
2583 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2545 2584 | JsonProtocol<L>,
|
2546 2585 | crate::operation_shape::SimpleScalarProperties,
|
2547 2586 | ModelPl::Output
|
2548 2587 | >
|
2549 2588 | >::Output
|
2550 2589 | >,
|
2551 2590 |
|
2552 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
2591 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
2553 2592 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
2554 2593 |
|
2555 2594 | {
|
2556 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
2557 - | use ::aws_smithy_http_server::plugin::Plugin;
|
2595 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
2596 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
2558 2597 | let svc = crate::operation_shape::SimpleScalarProperties::from_service(service);
|
2559 2598 | let svc = self.model_plugin.apply(svc);
|
2560 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
2561 - | .apply(svc);
|
2599 + | let svc =
|
2600 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
2601 + | .apply(svc);
|
2562 2602 | let svc = self.http_plugin.apply(svc);
|
2563 2603 | self.simple_scalar_properties_custom(svc)
|
2564 2604 | }
|
2565 2605 |
|
2566 2606 | /// Sets the [`SimpleScalarProperties`](crate::operation_shape::SimpleScalarProperties) to a custom [`Service`](tower::Service).
|
2567 2607 | /// not constrained by the Smithy contract.
|
2568 2608 | fn simple_scalar_properties_custom<S>(mut self, svc: S) -> Self
|
2569 2609 | where
|
2570 2610 | S: ::tower::Service<
|
2571 2611 | ::http::Request<Body>,
|
2572 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
2612 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
2573 2613 | Error = ::std::convert::Infallible,
|
2574 2614 | > + Clone
|
2575 2615 | + Send
|
2576 2616 | + 'static,
|
2577 2617 | S::Future: Send + 'static,
|
2578 2618 | {
|
2579 - | self.simple_scalar_properties = Some(::aws_smithy_http_server::routing::Route::new(svc));
|
2619 + | self.simple_scalar_properties =
|
2620 + | Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
2580 2621 | self
|
2581 2622 | }
|
2582 2623 |
|
2583 2624 | /// Sets the [`SparseNullsOperation`](crate::operation_shape::SparseNullsOperation) operation.
|
2584 2625 | ///
|
2585 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
2586 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
2626 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
2627 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
2587 2628 | ///
|
2588 2629 | /// # Example
|
2589 2630 | ///
|
2590 2631 | /// ```no_run
|
2591 2632 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
2592 2633 | ///
|
2593 2634 | /// use json_rpc11::{input, output, error};
|
2594 2635 | ///
|
2595 2636 | /// async fn handler(input: input::SparseNullsOperationInput) -> Result<output::SparseNullsOperationOutput, error::SparseNullsOperationError> {
|
2596 2637 | /// todo!()
|
2597 2638 | /// }
|
2598 2639 | ///
|
2599 2640 | /// let config = JsonProtocolConfig::builder().build();
|
2600 2641 | /// let app = JsonProtocol::builder(config)
|
2601 2642 | /// .sparse_nulls_operation(handler)
|
2602 2643 | /// /* Set other handlers */
|
2603 2644 | /// .build()
|
2604 2645 | /// .unwrap();
|
2605 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
2646 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
2606 2647 | /// ```
|
2607 2648 | ///
|
2608 2649 | pub fn sparse_nulls_operation<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
2609 2650 | where
|
2610 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::SparseNullsOperation, HandlerExtractors>,
|
2651 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::SparseNullsOperation, HandlerExtractors>,
|
2611 2652 |
|
2612 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
2653 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2613 2654 | JsonProtocol<L>,
|
2614 2655 | crate::operation_shape::SparseNullsOperation,
|
2615 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::SparseNullsOperation, HandlerType>
|
2656 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::SparseNullsOperation, HandlerType>
|
2616 2657 | >,
|
2617 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
2658 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2618 2659 | JsonProtocol<L>,
|
2619 2660 | crate::operation_shape::SparseNullsOperation,
|
2620 2661 | ModelPl::Output
|
2621 2662 | >,
|
2622 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
2663 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2623 2664 | JsonProtocol<L>,
|
2624 2665 | crate::operation_shape::SparseNullsOperation,
|
2625 2666 | <
|
2626 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
2627 - | as ::aws_smithy_http_server::plugin::Plugin<
|
2667 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
2668 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2628 2669 | JsonProtocol<L>,
|
2629 2670 | crate::operation_shape::SparseNullsOperation,
|
2630 2671 | ModelPl::Output
|
2631 2672 | >
|
2632 2673 | >::Output
|
2633 2674 | >,
|
2634 2675 |
|
2635 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
2676 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
2636 2677 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
2637 2678 |
|
2638 2679 | {
|
2639 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
2640 - | use ::aws_smithy_http_server::plugin::Plugin;
|
2680 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
2681 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
2641 2682 | let svc = crate::operation_shape::SparseNullsOperation::from_handler(handler);
|
2642 2683 | let svc = self.model_plugin.apply(svc);
|
2643 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
2644 - | .apply(svc);
|
2684 + | let svc =
|
2685 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
2686 + | .apply(svc);
|
2645 2687 | let svc = self.http_plugin.apply(svc);
|
2646 2688 | self.sparse_nulls_operation_custom(svc)
|
2647 2689 | }
|
2648 2690 |
|
2649 2691 | /// Sets the [`SparseNullsOperation`](crate::operation_shape::SparseNullsOperation) operation.
|
2650 2692 | ///
|
2651 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
2652 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
2693 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
2694 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
2653 2695 | ///
|
2654 2696 | /// # Example
|
2655 2697 | ///
|
2656 2698 | /// ```no_run
|
2657 2699 | /// use json_rpc11::{JsonProtocol, JsonProtocolConfig};
|
2658 2700 | ///
|
2659 2701 | /// use json_rpc11::{input, output, error};
|
2660 2702 | ///
|
2661 2703 | /// async fn handler(input: input::SparseNullsOperationInput) -> Result<output::SparseNullsOperationOutput, error::SparseNullsOperationError> {
|
2662 2704 | /// todo!()
|
2663 2705 | /// }
|
2664 2706 | ///
|
2665 2707 | /// let config = JsonProtocolConfig::builder().build();
|
2666 2708 | /// let svc = ::tower::util::service_fn(handler);
|
2667 2709 | /// let app = JsonProtocol::builder(config)
|
2668 2710 | /// .sparse_nulls_operation_service(svc)
|
2669 2711 | /// /* Set other handlers */
|
2670 2712 | /// .build()
|
2671 2713 | /// .unwrap();
|
2672 - | /// # let app: JsonProtocol<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
2714 + | /// # let app: JsonProtocol<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
|
2673 2715 | /// ```
|
2674 2716 | ///
|
2675 2717 | pub fn sparse_nulls_operation_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
2676 2718 | where
|
2677 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::SparseNullsOperation, ServiceExtractors>,
|
2719 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::SparseNullsOperation, ServiceExtractors>,
|
2678 2720 |
|
2679 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
2721 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2680 2722 | JsonProtocol<L>,
|
2681 2723 | crate::operation_shape::SparseNullsOperation,
|
2682 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::SparseNullsOperation, S>
|
2724 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::SparseNullsOperation, S>
|
2683 2725 | >,
|
2684 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
2726 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2685 2727 | JsonProtocol<L>,
|
2686 2728 | crate::operation_shape::SparseNullsOperation,
|
2687 2729 | ModelPl::Output
|
2688 2730 | >,
|
2689 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
2731 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2690 2732 | JsonProtocol<L>,
|
2691 2733 | crate::operation_shape::SparseNullsOperation,
|
2692 2734 | <
|
2693 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
2694 - | as ::aws_smithy_http_server::plugin::Plugin<
|
2735 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
2736 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2695 2737 | JsonProtocol<L>,
|
2696 2738 | crate::operation_shape::SparseNullsOperation,
|
2697 2739 | ModelPl::Output
|
2698 2740 | >
|
2699 2741 | >::Output
|
2700 2742 | >,
|
2701 2743 |
|
2702 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
2744 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
2703 2745 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
2704 2746 |
|
2705 2747 | {
|
2706 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
2707 - | use ::aws_smithy_http_server::plugin::Plugin;
|
2748 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
2749 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
2708 2750 | let svc = crate::operation_shape::SparseNullsOperation::from_service(service);
|
2709 2751 | let svc = self.model_plugin.apply(svc);
|
2710 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
2711 - | .apply(svc);
|
2752 + | let svc =
|
2753 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
2754 + | .apply(svc);
|
2712 2755 | let svc = self.http_plugin.apply(svc);
|
2713 2756 | self.sparse_nulls_operation_custom(svc)
|
2714 2757 | }
|
2715 2758 |
|
2716 2759 | /// Sets the [`SparseNullsOperation`](crate::operation_shape::SparseNullsOperation) to a custom [`Service`](tower::Service).
|
2717 2760 | /// not constrained by the Smithy contract.
|
2718 2761 | fn sparse_nulls_operation_custom<S>(mut self, svc: S) -> Self
|
2719 2762 | where
|
2720 2763 | S: ::tower::Service<
|
2721 2764 | ::http::Request<Body>,
|
2722 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
2765 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
2723 2766 | Error = ::std::convert::Infallible,
|
2724 2767 | > + Clone
|
2725 2768 | + Send
|
2726 2769 | + 'static,
|
2727 2770 | S::Future: Send + 'static,
|
2728 2771 | {
|
2729 - | self.sparse_nulls_operation = Some(::aws_smithy_http_server::routing::Route::new(svc));
|
2772 + | self.sparse_nulls_operation =
|
2773 + | Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
2730 2774 | self
|
2731 2775 | }
|
2732 2776 | }
|
2733 2777 |
|
2734 2778 | impl<Body, L, HttpPl, ModelPl> JsonProtocolBuilder<Body, L, HttpPl, ModelPl> {
|
2735 2779 | /// Constructs a [`JsonProtocol`] from the arguments provided to the builder.
|
2736 2780 | ///
|
2737 2781 | /// Forgetting to register a handler for one or more operations will result in an error.
|
2738 2782 | ///
|
2739 2783 | /// Check out [`JsonProtocolBuilder::build_unchecked`] if you'd prefer the service to return status code 500 when an
|
2740 2784 | /// unspecified route is requested.
|
2741 2785 | pub fn build(
|
2742 2786 | self,
|
2743 2787 | ) -> ::std::result::Result<
|
2744 2788 | JsonProtocol<
|
2745 - | ::aws_smithy_http_server::routing::RoutingService<
|
2746 - | ::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<L::Service>,
|
2747 - | ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
|
2789 + | ::aws_smithy_legacy_http_server::routing::RoutingService<
|
2790 + | ::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<
|
2791 + | L::Service,
|
2792 + | >,
|
2793 + | ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
|
2748 2794 | >,
|
2749 2795 | >,
|
2750 2796 | MissingOperationsError,
|
2751 2797 | >
|
2752 2798 | where
|
2753 - | L: ::tower::Layer<::aws_smithy_http_server::routing::Route<Body>>,
|
2799 + | L: ::tower::Layer<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
2754 2800 | {
|
2755 2801 | let router = {
|
2756 - | use ::aws_smithy_http_server::operation::OperationShape;
|
2802 + | use ::aws_smithy_legacy_http_server::operation::OperationShape;
|
2757 2803 | let mut missing_operation_names = std::collections::HashMap::new();
|
2758 2804 | if self.content_type_parameters.is_none() {
|
2759 2805 | missing_operation_names.insert(
|
2760 2806 | crate::operation_shape::ContentTypeParameters::ID,
|
2761 2807 | ".content_type_parameters()",
|
2762 2808 | );
|
2763 2809 | }
|
2764 2810 | if self.datetime_offsets.is_none() {
|
2765 2811 | missing_operation_names.insert(
|
2766 2812 | crate::operation_shape::DatetimeOffsets::ID,
|