1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | /// The service builder for [`JsonRpc10`].
|
3 + | ///
|
4 + | /// Constructed via [`JsonRpc10::builder`].
|
5 + | pub struct JsonRpc10Builder<Body, L, HttpPl, ModelPl> {
|
6 + | content_type_parameters: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
7 + | empty_input_and_empty_output: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
8 + | endpoint_operation: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
9 + | endpoint_with_host_label_operation:
|
10 + | Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
11 + | greeting_with_errors: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
12 + | host_with_path_operation: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
13 + | json_unions: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
14 + | no_input_and_no_output: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
15 + | no_input_and_output: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
16 + | operation_with_defaults: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
17 + | operation_with_nested_structure: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
18 + | operation_with_required_members: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
19 + | operation_with_required_members_with_defaults:
|
20 + | Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
21 + | put_with_content_encoding: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
22 + | query_incompatible_operation: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
23 + | simple_scalar_properties: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
24 + | layer: L,
|
25 + | http_plugin: HttpPl,
|
26 + | model_plugin: ModelPl,
|
27 + | }
|
28 + |
|
29 + | impl<Body, L, HttpPl, ModelPl> JsonRpc10Builder<Body, L, HttpPl, ModelPl> {
|
30 + | /// Sets the [`ContentTypeParameters`](crate::operation_shape::ContentTypeParameters) operation.
|
31 + | ///
|
32 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
33 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
34 + | ///
|
35 + | /// # Example
|
36 + | ///
|
37 + | /// ```no_run
|
38 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
39 + | ///
|
40 + | /// use json_rpc10_http0x::{input, output, error};
|
41 + | ///
|
42 + | /// async fn handler(input: input::ContentTypeParametersInput) -> output::ContentTypeParametersOutput {
|
43 + | /// todo!()
|
44 + | /// }
|
45 + | ///
|
46 + | /// let config = JsonRpc10Config::builder().build();
|
47 + | /// let app = JsonRpc10::builder(config)
|
48 + | /// .content_type_parameters(handler)
|
49 + | /// /* Set other handlers */
|
50 + | /// .build()
|
51 + | /// .unwrap();
|
52 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
53 + | /// ```
|
54 + | ///
|
55 + | pub fn content_type_parameters<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
56 + | where
|
57 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::ContentTypeParameters, HandlerExtractors>,
|
58 + |
|
59 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
60 + | JsonRpc10<L>,
|
61 + | crate::operation_shape::ContentTypeParameters,
|
62 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::ContentTypeParameters, HandlerType>
|
63 + | >,
|
64 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
65 + | JsonRpc10<L>,
|
66 + | crate::operation_shape::ContentTypeParameters,
|
67 + | ModelPl::Output
|
68 + | >,
|
69 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
70 + | JsonRpc10<L>,
|
71 + | crate::operation_shape::ContentTypeParameters,
|
72 + | <
|
73 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
74 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
75 + | JsonRpc10<L>,
|
76 + | crate::operation_shape::ContentTypeParameters,
|
77 + | ModelPl::Output
|
78 + | >
|
79 + | >::Output
|
80 + | >,
|
81 + |
|
82 + | 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 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
84 + |
|
85 + | {
|
86 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
87 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
88 + | let svc = crate::operation_shape::ContentTypeParameters::from_handler(handler);
|
89 + | let svc = self.model_plugin.apply(svc);
|
90 + | let svc =
|
91 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
92 + | .apply(svc);
|
93 + | let svc = self.http_plugin.apply(svc);
|
94 + | self.content_type_parameters_custom(svc)
|
95 + | }
|
96 + |
|
97 + | /// Sets the [`ContentTypeParameters`](crate::operation_shape::ContentTypeParameters) operation.
|
98 + | ///
|
99 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
100 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
101 + | ///
|
102 + | /// # Example
|
103 + | ///
|
104 + | /// ```no_run
|
105 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
106 + | ///
|
107 + | /// use json_rpc10_http0x::{input, output, error};
|
108 + | ///
|
109 + | /// async fn handler(input: input::ContentTypeParametersInput) -> Result<output::ContentTypeParametersOutput, std::convert::Infallible> {
|
110 + | /// todo!()
|
111 + | /// }
|
112 + | ///
|
113 + | /// let config = JsonRpc10Config::builder().build();
|
114 + | /// let svc = ::tower::util::service_fn(handler);
|
115 + | /// let app = JsonRpc10::builder(config)
|
116 + | /// .content_type_parameters_service(svc)
|
117 + | /// /* Set other handlers */
|
118 + | /// .build()
|
119 + | /// .unwrap();
|
120 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
121 + | /// ```
|
122 + | ///
|
123 + | pub fn content_type_parameters_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
124 + | where
|
125 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::ContentTypeParameters, ServiceExtractors>,
|
126 + |
|
127 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
128 + | JsonRpc10<L>,
|
129 + | crate::operation_shape::ContentTypeParameters,
|
130 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::ContentTypeParameters, S>
|
131 + | >,
|
132 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
133 + | JsonRpc10<L>,
|
134 + | crate::operation_shape::ContentTypeParameters,
|
135 + | ModelPl::Output
|
136 + | >,
|
137 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
138 + | JsonRpc10<L>,
|
139 + | crate::operation_shape::ContentTypeParameters,
|
140 + | <
|
141 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
142 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
143 + | JsonRpc10<L>,
|
144 + | crate::operation_shape::ContentTypeParameters,
|
145 + | ModelPl::Output
|
146 + | >
|
147 + | >::Output
|
148 + | >,
|
149 + |
|
150 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
151 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
152 + |
|
153 + | {
|
154 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
155 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
156 + | let svc = crate::operation_shape::ContentTypeParameters::from_service(service);
|
157 + | let svc = self.model_plugin.apply(svc);
|
158 + | let svc =
|
159 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
160 + | .apply(svc);
|
161 + | let svc = self.http_plugin.apply(svc);
|
162 + | self.content_type_parameters_custom(svc)
|
163 + | }
|
164 + |
|
165 + | /// Sets the [`ContentTypeParameters`](crate::operation_shape::ContentTypeParameters) to a custom [`Service`](tower::Service).
|
166 + | /// not constrained by the Smithy contract.
|
167 + | fn content_type_parameters_custom<S>(mut self, svc: S) -> Self
|
168 + | where
|
169 + | S: ::tower::Service<
|
170 + | ::http::Request<Body>,
|
171 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
172 + | Error = ::std::convert::Infallible,
|
173 + | > + Clone
|
174 + | + Send
|
175 + | + 'static,
|
176 + | S::Future: Send + 'static,
|
177 + | {
|
178 + | self.content_type_parameters =
|
179 + | Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
180 + | self
|
181 + | }
|
182 + |
|
183 + | /// Sets the [`EmptyInputAndEmptyOutput`](crate::operation_shape::EmptyInputAndEmptyOutput) operation.
|
184 + | ///
|
185 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
186 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
187 + | ///
|
188 + | /// # Example
|
189 + | ///
|
190 + | /// ```no_run
|
191 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
192 + | ///
|
193 + | /// use json_rpc10_http0x::{input, output, error};
|
194 + | ///
|
195 + | /// async fn handler(input: input::EmptyInputAndEmptyOutputInput) -> output::EmptyInputAndEmptyOutputOutput {
|
196 + | /// todo!()
|
197 + | /// }
|
198 + | ///
|
199 + | /// let config = JsonRpc10Config::builder().build();
|
200 + | /// let app = JsonRpc10::builder(config)
|
201 + | /// .empty_input_and_empty_output(handler)
|
202 + | /// /* Set other handlers */
|
203 + | /// .build()
|
204 + | /// .unwrap();
|
205 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
206 + | /// ```
|
207 + | ///
|
208 + | pub fn empty_input_and_empty_output<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
209 + | where
|
210 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::EmptyInputAndEmptyOutput, HandlerExtractors>,
|
211 + |
|
212 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
213 + | JsonRpc10<L>,
|
214 + | crate::operation_shape::EmptyInputAndEmptyOutput,
|
215 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::EmptyInputAndEmptyOutput, HandlerType>
|
216 + | >,
|
217 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
218 + | JsonRpc10<L>,
|
219 + | crate::operation_shape::EmptyInputAndEmptyOutput,
|
220 + | ModelPl::Output
|
221 + | >,
|
222 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
223 + | JsonRpc10<L>,
|
224 + | crate::operation_shape::EmptyInputAndEmptyOutput,
|
225 + | <
|
226 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
227 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
228 + | JsonRpc10<L>,
|
229 + | crate::operation_shape::EmptyInputAndEmptyOutput,
|
230 + | ModelPl::Output
|
231 + | >
|
232 + | >::Output
|
233 + | >,
|
234 + |
|
235 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
236 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
237 + |
|
238 + | {
|
239 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
240 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
241 + | let svc = crate::operation_shape::EmptyInputAndEmptyOutput::from_handler(handler);
|
242 + | let svc = self.model_plugin.apply(svc);
|
243 + | let svc =
|
244 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
245 + | .apply(svc);
|
246 + | let svc = self.http_plugin.apply(svc);
|
247 + | self.empty_input_and_empty_output_custom(svc)
|
248 + | }
|
249 + |
|
250 + | /// Sets the [`EmptyInputAndEmptyOutput`](crate::operation_shape::EmptyInputAndEmptyOutput) operation.
|
251 + | ///
|
252 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
253 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
254 + | ///
|
255 + | /// # Example
|
256 + | ///
|
257 + | /// ```no_run
|
258 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
259 + | ///
|
260 + | /// use json_rpc10_http0x::{input, output, error};
|
261 + | ///
|
262 + | /// async fn handler(input: input::EmptyInputAndEmptyOutputInput) -> Result<output::EmptyInputAndEmptyOutputOutput, std::convert::Infallible> {
|
263 + | /// todo!()
|
264 + | /// }
|
265 + | ///
|
266 + | /// let config = JsonRpc10Config::builder().build();
|
267 + | /// let svc = ::tower::util::service_fn(handler);
|
268 + | /// let app = JsonRpc10::builder(config)
|
269 + | /// .empty_input_and_empty_output_service(svc)
|
270 + | /// /* Set other handlers */
|
271 + | /// .build()
|
272 + | /// .unwrap();
|
273 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
274 + | /// ```
|
275 + | ///
|
276 + | pub fn empty_input_and_empty_output_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
277 + | where
|
278 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::EmptyInputAndEmptyOutput, ServiceExtractors>,
|
279 + |
|
280 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
281 + | JsonRpc10<L>,
|
282 + | crate::operation_shape::EmptyInputAndEmptyOutput,
|
283 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::EmptyInputAndEmptyOutput, S>
|
284 + | >,
|
285 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
286 + | JsonRpc10<L>,
|
287 + | crate::operation_shape::EmptyInputAndEmptyOutput,
|
288 + | ModelPl::Output
|
289 + | >,
|
290 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
291 + | JsonRpc10<L>,
|
292 + | crate::operation_shape::EmptyInputAndEmptyOutput,
|
293 + | <
|
294 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
295 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
296 + | JsonRpc10<L>,
|
297 + | crate::operation_shape::EmptyInputAndEmptyOutput,
|
298 + | ModelPl::Output
|
299 + | >
|
300 + | >::Output
|
301 + | >,
|
302 + |
|
303 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
304 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
305 + |
|
306 + | {
|
307 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
308 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
309 + | let svc = crate::operation_shape::EmptyInputAndEmptyOutput::from_service(service);
|
310 + | let svc = self.model_plugin.apply(svc);
|
311 + | let svc =
|
312 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
313 + | .apply(svc);
|
314 + | let svc = self.http_plugin.apply(svc);
|
315 + | self.empty_input_and_empty_output_custom(svc)
|
316 + | }
|
317 + |
|
318 + | /// Sets the [`EmptyInputAndEmptyOutput`](crate::operation_shape::EmptyInputAndEmptyOutput) to a custom [`Service`](tower::Service).
|
319 + | /// not constrained by the Smithy contract.
|
320 + | fn empty_input_and_empty_output_custom<S>(mut self, svc: S) -> Self
|
321 + | where
|
322 + | S: ::tower::Service<
|
323 + | ::http::Request<Body>,
|
324 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
325 + | Error = ::std::convert::Infallible,
|
326 + | > + Clone
|
327 + | + Send
|
328 + | + 'static,
|
329 + | S::Future: Send + 'static,
|
330 + | {
|
331 + | self.empty_input_and_empty_output =
|
332 + | Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
333 + | self
|
334 + | }
|
335 + |
|
336 + | /// Sets the [`EndpointOperation`](crate::operation_shape::EndpointOperation) operation.
|
337 + | ///
|
338 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
339 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
340 + | ///
|
341 + | /// # Example
|
342 + | ///
|
343 + | /// ```no_run
|
344 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
345 + | ///
|
346 + | /// use json_rpc10_http0x::{input, output, error};
|
347 + | ///
|
348 + | /// async fn handler(input: input::EndpointOperationInput) -> output::EndpointOperationOutput {
|
349 + | /// todo!()
|
350 + | /// }
|
351 + | ///
|
352 + | /// let config = JsonRpc10Config::builder().build();
|
353 + | /// let app = JsonRpc10::builder(config)
|
354 + | /// .endpoint_operation(handler)
|
355 + | /// /* Set other handlers */
|
356 + | /// .build()
|
357 + | /// .unwrap();
|
358 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
359 + | /// ```
|
360 + | ///
|
361 + | pub fn endpoint_operation<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
362 + | where
|
363 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::EndpointOperation, HandlerExtractors>,
|
364 + |
|
365 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
366 + | JsonRpc10<L>,
|
367 + | crate::operation_shape::EndpointOperation,
|
368 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::EndpointOperation, HandlerType>
|
369 + | >,
|
370 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
371 + | JsonRpc10<L>,
|
372 + | crate::operation_shape::EndpointOperation,
|
373 + | ModelPl::Output
|
374 + | >,
|
375 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
376 + | JsonRpc10<L>,
|
377 + | crate::operation_shape::EndpointOperation,
|
378 + | <
|
379 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
380 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
381 + | JsonRpc10<L>,
|
382 + | crate::operation_shape::EndpointOperation,
|
383 + | ModelPl::Output
|
384 + | >
|
385 + | >::Output
|
386 + | >,
|
387 + |
|
388 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
389 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
390 + |
|
391 + | {
|
392 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
393 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
394 + | let svc = crate::operation_shape::EndpointOperation::from_handler(handler);
|
395 + | let svc = self.model_plugin.apply(svc);
|
396 + | let svc =
|
397 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
398 + | .apply(svc);
|
399 + | let svc = self.http_plugin.apply(svc);
|
400 + | self.endpoint_operation_custom(svc)
|
401 + | }
|
402 + |
|
403 + | /// Sets the [`EndpointOperation`](crate::operation_shape::EndpointOperation) operation.
|
404 + | ///
|
405 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
406 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
407 + | ///
|
408 + | /// # Example
|
409 + | ///
|
410 + | /// ```no_run
|
411 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
412 + | ///
|
413 + | /// use json_rpc10_http0x::{input, output, error};
|
414 + | ///
|
415 + | /// async fn handler(input: input::EndpointOperationInput) -> Result<output::EndpointOperationOutput, std::convert::Infallible> {
|
416 + | /// todo!()
|
417 + | /// }
|
418 + | ///
|
419 + | /// let config = JsonRpc10Config::builder().build();
|
420 + | /// let svc = ::tower::util::service_fn(handler);
|
421 + | /// let app = JsonRpc10::builder(config)
|
422 + | /// .endpoint_operation_service(svc)
|
423 + | /// /* Set other handlers */
|
424 + | /// .build()
|
425 + | /// .unwrap();
|
426 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
427 + | /// ```
|
428 + | ///
|
429 + | pub fn endpoint_operation_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
430 + | where
|
431 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::EndpointOperation, ServiceExtractors>,
|
432 + |
|
433 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
434 + | JsonRpc10<L>,
|
435 + | crate::operation_shape::EndpointOperation,
|
436 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::EndpointOperation, S>
|
437 + | >,
|
438 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
439 + | JsonRpc10<L>,
|
440 + | crate::operation_shape::EndpointOperation,
|
441 + | ModelPl::Output
|
442 + | >,
|
443 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
444 + | JsonRpc10<L>,
|
445 + | crate::operation_shape::EndpointOperation,
|
446 + | <
|
447 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
448 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
449 + | JsonRpc10<L>,
|
450 + | crate::operation_shape::EndpointOperation,
|
451 + | ModelPl::Output
|
452 + | >
|
453 + | >::Output
|
454 + | >,
|
455 + |
|
456 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
457 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
458 + |
|
459 + | {
|
460 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
461 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
462 + | let svc = crate::operation_shape::EndpointOperation::from_service(service);
|
463 + | let svc = self.model_plugin.apply(svc);
|
464 + | let svc =
|
465 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
466 + | .apply(svc);
|
467 + | let svc = self.http_plugin.apply(svc);
|
468 + | self.endpoint_operation_custom(svc)
|
469 + | }
|
470 + |
|
471 + | /// Sets the [`EndpointOperation`](crate::operation_shape::EndpointOperation) to a custom [`Service`](tower::Service).
|
472 + | /// not constrained by the Smithy contract.
|
473 + | fn endpoint_operation_custom<S>(mut self, svc: S) -> Self
|
474 + | where
|
475 + | S: ::tower::Service<
|
476 + | ::http::Request<Body>,
|
477 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
478 + | Error = ::std::convert::Infallible,
|
479 + | > + Clone
|
480 + | + Send
|
481 + | + 'static,
|
482 + | S::Future: Send + 'static,
|
483 + | {
|
484 + | self.endpoint_operation = Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
485 + | self
|
486 + | }
|
487 + |
|
488 + | /// Sets the [`EndpointWithHostLabelOperation`](crate::operation_shape::EndpointWithHostLabelOperation) operation.
|
489 + | ///
|
490 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
491 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
492 + | ///
|
493 + | /// # Example
|
494 + | ///
|
495 + | /// ```no_run
|
496 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
497 + | ///
|
498 + | /// use json_rpc10_http0x::{input, output, error};
|
499 + | ///
|
500 + | /// async fn handler(input: input::EndpointWithHostLabelOperationInput) -> Result<output::EndpointWithHostLabelOperationOutput, error::EndpointWithHostLabelOperationError> {
|
501 + | /// todo!()
|
502 + | /// }
|
503 + | ///
|
504 + | /// let config = JsonRpc10Config::builder().build();
|
505 + | /// let app = JsonRpc10::builder(config)
|
506 + | /// .endpoint_with_host_label_operation(handler)
|
507 + | /// /* Set other handlers */
|
508 + | /// .build()
|
509 + | /// .unwrap();
|
510 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
511 + | /// ```
|
512 + | ///
|
513 + | pub fn endpoint_with_host_label_operation<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
514 + | where
|
515 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::EndpointWithHostLabelOperation, HandlerExtractors>,
|
516 + |
|
517 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
518 + | JsonRpc10<L>,
|
519 + | crate::operation_shape::EndpointWithHostLabelOperation,
|
520 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::EndpointWithHostLabelOperation, HandlerType>
|
521 + | >,
|
522 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
523 + | JsonRpc10<L>,
|
524 + | crate::operation_shape::EndpointWithHostLabelOperation,
|
525 + | ModelPl::Output
|
526 + | >,
|
527 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
528 + | JsonRpc10<L>,
|
529 + | crate::operation_shape::EndpointWithHostLabelOperation,
|
530 + | <
|
531 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
532 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
533 + | JsonRpc10<L>,
|
534 + | crate::operation_shape::EndpointWithHostLabelOperation,
|
535 + | ModelPl::Output
|
536 + | >
|
537 + | >::Output
|
538 + | >,
|
539 + |
|
540 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
541 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
542 + |
|
543 + | {
|
544 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
545 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
546 + | let svc = crate::operation_shape::EndpointWithHostLabelOperation::from_handler(handler);
|
547 + | let svc = self.model_plugin.apply(svc);
|
548 + | let svc =
|
549 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
550 + | .apply(svc);
|
551 + | let svc = self.http_plugin.apply(svc);
|
552 + | self.endpoint_with_host_label_operation_custom(svc)
|
553 + | }
|
554 + |
|
555 + | /// Sets the [`EndpointWithHostLabelOperation`](crate::operation_shape::EndpointWithHostLabelOperation) operation.
|
556 + | ///
|
557 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
558 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
559 + | ///
|
560 + | /// # Example
|
561 + | ///
|
562 + | /// ```no_run
|
563 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
564 + | ///
|
565 + | /// use json_rpc10_http0x::{input, output, error};
|
566 + | ///
|
567 + | /// async fn handler(input: input::EndpointWithHostLabelOperationInput) -> Result<output::EndpointWithHostLabelOperationOutput, error::EndpointWithHostLabelOperationError> {
|
568 + | /// todo!()
|
569 + | /// }
|
570 + | ///
|
571 + | /// let config = JsonRpc10Config::builder().build();
|
572 + | /// let svc = ::tower::util::service_fn(handler);
|
573 + | /// let app = JsonRpc10::builder(config)
|
574 + | /// .endpoint_with_host_label_operation_service(svc)
|
575 + | /// /* Set other handlers */
|
576 + | /// .build()
|
577 + | /// .unwrap();
|
578 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
579 + | /// ```
|
580 + | ///
|
581 + | pub fn endpoint_with_host_label_operation_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
582 + | where
|
583 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::EndpointWithHostLabelOperation, ServiceExtractors>,
|
584 + |
|
585 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
586 + | JsonRpc10<L>,
|
587 + | crate::operation_shape::EndpointWithHostLabelOperation,
|
588 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::EndpointWithHostLabelOperation, S>
|
589 + | >,
|
590 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
591 + | JsonRpc10<L>,
|
592 + | crate::operation_shape::EndpointWithHostLabelOperation,
|
593 + | ModelPl::Output
|
594 + | >,
|
595 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
596 + | JsonRpc10<L>,
|
597 + | crate::operation_shape::EndpointWithHostLabelOperation,
|
598 + | <
|
599 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
600 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
601 + | JsonRpc10<L>,
|
602 + | crate::operation_shape::EndpointWithHostLabelOperation,
|
603 + | ModelPl::Output
|
604 + | >
|
605 + | >::Output
|
606 + | >,
|
607 + |
|
608 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
609 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
610 + |
|
611 + | {
|
612 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
613 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
614 + | let svc = crate::operation_shape::EndpointWithHostLabelOperation::from_service(service);
|
615 + | let svc = self.model_plugin.apply(svc);
|
616 + | let svc =
|
617 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
618 + | .apply(svc);
|
619 + | let svc = self.http_plugin.apply(svc);
|
620 + | self.endpoint_with_host_label_operation_custom(svc)
|
621 + | }
|
622 + |
|
623 + | /// Sets the [`EndpointWithHostLabelOperation`](crate::operation_shape::EndpointWithHostLabelOperation) to a custom [`Service`](tower::Service).
|
624 + | /// not constrained by the Smithy contract.
|
625 + | fn endpoint_with_host_label_operation_custom<S>(mut self, svc: S) -> Self
|
626 + | where
|
627 + | S: ::tower::Service<
|
628 + | ::http::Request<Body>,
|
629 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
630 + | Error = ::std::convert::Infallible,
|
631 + | > + Clone
|
632 + | + Send
|
633 + | + 'static,
|
634 + | S::Future: Send + 'static,
|
635 + | {
|
636 + | self.endpoint_with_host_label_operation =
|
637 + | Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
638 + | self
|
639 + | }
|
640 + |
|
641 + | /// Sets the [`GreetingWithErrors`](crate::operation_shape::GreetingWithErrors) operation.
|
642 + | ///
|
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.
|
645 + | ///
|
646 + | /// # Example
|
647 + | ///
|
648 + | /// ```no_run
|
649 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
650 + | ///
|
651 + | /// use json_rpc10_http0x::{input, output, error};
|
652 + | ///
|
653 + | /// async fn handler(input: input::GreetingWithErrorsInput) -> Result<output::GreetingWithErrorsOutput, error::GreetingWithErrorsError> {
|
654 + | /// todo!()
|
655 + | /// }
|
656 + | ///
|
657 + | /// let config = JsonRpc10Config::builder().build();
|
658 + | /// let app = JsonRpc10::builder(config)
|
659 + | /// .greeting_with_errors(handler)
|
660 + | /// /* Set other handlers */
|
661 + | /// .build()
|
662 + | /// .unwrap();
|
663 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
664 + | /// ```
|
665 + | ///
|
666 + | pub fn greeting_with_errors<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
667 + | where
|
668 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::GreetingWithErrors, HandlerExtractors>,
|
669 + |
|
670 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
671 + | JsonRpc10<L>,
|
672 + | crate::operation_shape::GreetingWithErrors,
|
673 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::GreetingWithErrors, HandlerType>
|
674 + | >,
|
675 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
676 + | JsonRpc10<L>,
|
677 + | crate::operation_shape::GreetingWithErrors,
|
678 + | ModelPl::Output
|
679 + | >,
|
680 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
681 + | JsonRpc10<L>,
|
682 + | crate::operation_shape::GreetingWithErrors,
|
683 + | <
|
684 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
685 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
686 + | JsonRpc10<L>,
|
687 + | crate::operation_shape::GreetingWithErrors,
|
688 + | ModelPl::Output
|
689 + | >
|
690 + | >::Output
|
691 + | >,
|
692 + |
|
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,
|
694 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
695 + |
|
696 + | {
|
697 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
698 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
699 + | let svc = crate::operation_shape::GreetingWithErrors::from_handler(handler);
|
700 + | let svc = self.model_plugin.apply(svc);
|
701 + | let svc =
|
702 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
703 + | .apply(svc);
|
704 + | let svc = self.http_plugin.apply(svc);
|
705 + | self.greeting_with_errors_custom(svc)
|
706 + | }
|
707 + |
|
708 + | /// Sets the [`GreetingWithErrors`](crate::operation_shape::GreetingWithErrors) operation.
|
709 + | ///
|
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.
|
712 + | ///
|
713 + | /// # Example
|
714 + | ///
|
715 + | /// ```no_run
|
716 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
717 + | ///
|
718 + | /// use json_rpc10_http0x::{input, output, error};
|
719 + | ///
|
720 + | /// async fn handler(input: input::GreetingWithErrorsInput) -> Result<output::GreetingWithErrorsOutput, error::GreetingWithErrorsError> {
|
721 + | /// todo!()
|
722 + | /// }
|
723 + | ///
|
724 + | /// let config = JsonRpc10Config::builder().build();
|
725 + | /// let svc = ::tower::util::service_fn(handler);
|
726 + | /// let app = JsonRpc10::builder(config)
|
727 + | /// .greeting_with_errors_service(svc)
|
728 + | /// /* Set other handlers */
|
729 + | /// .build()
|
730 + | /// .unwrap();
|
731 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
732 + | /// ```
|
733 + | ///
|
734 + | pub fn greeting_with_errors_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
735 + | where
|
736 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::GreetingWithErrors, ServiceExtractors>,
|
737 + |
|
738 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
739 + | JsonRpc10<L>,
|
740 + | crate::operation_shape::GreetingWithErrors,
|
741 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::GreetingWithErrors, S>
|
742 + | >,
|
743 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
744 + | JsonRpc10<L>,
|
745 + | crate::operation_shape::GreetingWithErrors,
|
746 + | ModelPl::Output
|
747 + | >,
|
748 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
749 + | JsonRpc10<L>,
|
750 + | crate::operation_shape::GreetingWithErrors,
|
751 + | <
|
752 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
753 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
754 + | JsonRpc10<L>,
|
755 + | crate::operation_shape::GreetingWithErrors,
|
756 + | ModelPl::Output
|
757 + | >
|
758 + | >::Output
|
759 + | >,
|
760 + |
|
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,
|
762 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
763 + |
|
764 + | {
|
765 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
766 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
767 + | let svc = crate::operation_shape::GreetingWithErrors::from_service(service);
|
768 + | let svc = self.model_plugin.apply(svc);
|
769 + | let svc =
|
770 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
771 + | .apply(svc);
|
772 + | let svc = self.http_plugin.apply(svc);
|
773 + | self.greeting_with_errors_custom(svc)
|
774 + | }
|
775 + |
|
776 + | /// Sets the [`GreetingWithErrors`](crate::operation_shape::GreetingWithErrors) to a custom [`Service`](tower::Service).
|
777 + | /// not constrained by the Smithy contract.
|
778 + | fn greeting_with_errors_custom<S>(mut self, svc: S) -> Self
|
779 + | where
|
780 + | S: ::tower::Service<
|
781 + | ::http::Request<Body>,
|
782 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
783 + | Error = ::std::convert::Infallible,
|
784 + | > + Clone
|
785 + | + Send
|
786 + | + 'static,
|
787 + | S::Future: Send + 'static,
|
788 + | {
|
789 + | self.greeting_with_errors = Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
790 + | self
|
791 + | }
|
792 + |
|
793 + | /// Sets the [`HostWithPathOperation`](crate::operation_shape::HostWithPathOperation) operation.
|
794 + | ///
|
795 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
796 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
797 + | ///
|
798 + | /// # Example
|
799 + | ///
|
800 + | /// ```no_run
|
801 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
802 + | ///
|
803 + | /// use json_rpc10_http0x::{input, output, error};
|
804 + | ///
|
805 + | /// async fn handler(input: input::HostWithPathOperationInput) -> output::HostWithPathOperationOutput {
|
806 + | /// todo!()
|
807 + | /// }
|
808 + | ///
|
809 + | /// let config = JsonRpc10Config::builder().build();
|
810 + | /// let app = JsonRpc10::builder(config)
|
811 + | /// .host_with_path_operation(handler)
|
812 + | /// /* Set other handlers */
|
813 + | /// .build()
|
814 + | /// .unwrap();
|
815 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
816 + | /// ```
|
817 + | ///
|
818 + | pub fn host_with_path_operation<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
819 + | where
|
820 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::HostWithPathOperation, HandlerExtractors>,
|
821 + |
|
822 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
823 + | JsonRpc10<L>,
|
824 + | crate::operation_shape::HostWithPathOperation,
|
825 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::HostWithPathOperation, HandlerType>
|
826 + | >,
|
827 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
828 + | JsonRpc10<L>,
|
829 + | crate::operation_shape::HostWithPathOperation,
|
830 + | ModelPl::Output
|
831 + | >,
|
832 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
833 + | JsonRpc10<L>,
|
834 + | crate::operation_shape::HostWithPathOperation,
|
835 + | <
|
836 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
837 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
838 + | JsonRpc10<L>,
|
839 + | crate::operation_shape::HostWithPathOperation,
|
840 + | ModelPl::Output
|
841 + | >
|
842 + | >::Output
|
843 + | >,
|
844 + |
|
845 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
846 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
847 + |
|
848 + | {
|
849 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
850 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
851 + | let svc = crate::operation_shape::HostWithPathOperation::from_handler(handler);
|
852 + | let svc = self.model_plugin.apply(svc);
|
853 + | let svc =
|
854 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
855 + | .apply(svc);
|
856 + | let svc = self.http_plugin.apply(svc);
|
857 + | self.host_with_path_operation_custom(svc)
|
858 + | }
|
859 + |
|
860 + | /// Sets the [`HostWithPathOperation`](crate::operation_shape::HostWithPathOperation) operation.
|
861 + | ///
|
862 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
863 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
864 + | ///
|
865 + | /// # Example
|
866 + | ///
|
867 + | /// ```no_run
|
868 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
869 + | ///
|
870 + | /// use json_rpc10_http0x::{input, output, error};
|
871 + | ///
|
872 + | /// async fn handler(input: input::HostWithPathOperationInput) -> Result<output::HostWithPathOperationOutput, std::convert::Infallible> {
|
873 + | /// todo!()
|
874 + | /// }
|
875 + | ///
|
876 + | /// let config = JsonRpc10Config::builder().build();
|
877 + | /// let svc = ::tower::util::service_fn(handler);
|
878 + | /// let app = JsonRpc10::builder(config)
|
879 + | /// .host_with_path_operation_service(svc)
|
880 + | /// /* Set other handlers */
|
881 + | /// .build()
|
882 + | /// .unwrap();
|
883 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
884 + | /// ```
|
885 + | ///
|
886 + | pub fn host_with_path_operation_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
887 + | where
|
888 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::HostWithPathOperation, ServiceExtractors>,
|
889 + |
|
890 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
891 + | JsonRpc10<L>,
|
892 + | crate::operation_shape::HostWithPathOperation,
|
893 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::HostWithPathOperation, S>
|
894 + | >,
|
895 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
896 + | JsonRpc10<L>,
|
897 + | crate::operation_shape::HostWithPathOperation,
|
898 + | ModelPl::Output
|
899 + | >,
|
900 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
901 + | JsonRpc10<L>,
|
902 + | crate::operation_shape::HostWithPathOperation,
|
903 + | <
|
904 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
905 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
906 + | JsonRpc10<L>,
|
907 + | crate::operation_shape::HostWithPathOperation,
|
908 + | ModelPl::Output
|
909 + | >
|
910 + | >::Output
|
911 + | >,
|
912 + |
|
913 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
914 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
915 + |
|
916 + | {
|
917 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
918 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
919 + | let svc = crate::operation_shape::HostWithPathOperation::from_service(service);
|
920 + | let svc = self.model_plugin.apply(svc);
|
921 + | let svc =
|
922 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
923 + | .apply(svc);
|
924 + | let svc = self.http_plugin.apply(svc);
|
925 + | self.host_with_path_operation_custom(svc)
|
926 + | }
|
927 + |
|
928 + | /// Sets the [`HostWithPathOperation`](crate::operation_shape::HostWithPathOperation) to a custom [`Service`](tower::Service).
|
929 + | /// not constrained by the Smithy contract.
|
930 + | fn host_with_path_operation_custom<S>(mut self, svc: S) -> Self
|
931 + | where
|
932 + | S: ::tower::Service<
|
933 + | ::http::Request<Body>,
|
934 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
935 + | Error = ::std::convert::Infallible,
|
936 + | > + Clone
|
937 + | + Send
|
938 + | + 'static,
|
939 + | S::Future: Send + 'static,
|
940 + | {
|
941 + | self.host_with_path_operation =
|
942 + | Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
943 + | self
|
944 + | }
|
945 + |
|
946 + | /// Sets the [`JsonUnions`](crate::operation_shape::JsonUnions) operation.
|
947 + | ///
|
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.
|
950 + | ///
|
951 + | /// # Example
|
952 + | ///
|
953 + | /// ```no_run
|
954 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
955 + | ///
|
956 + | /// use json_rpc10_http0x::{input, output, error};
|
957 + | ///
|
958 + | /// async fn handler(input: input::JsonUnionsInput) -> Result<output::JsonUnionsOutput, error::JsonUnionsError> {
|
959 + | /// todo!()
|
960 + | /// }
|
961 + | ///
|
962 + | /// let config = JsonRpc10Config::builder().build();
|
963 + | /// let app = JsonRpc10::builder(config)
|
964 + | /// .json_unions(handler)
|
965 + | /// /* Set other handlers */
|
966 + | /// .build()
|
967 + | /// .unwrap();
|
968 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
969 + | /// ```
|
970 + | ///
|
971 + | pub fn json_unions<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
972 + | where
|
973 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::JsonUnions, HandlerExtractors>,
|
974 + |
|
975 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
976 + | JsonRpc10<L>,
|
977 + | crate::operation_shape::JsonUnions,
|
978 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::JsonUnions, HandlerType>
|
979 + | >,
|
980 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
981 + | JsonRpc10<L>,
|
982 + | crate::operation_shape::JsonUnions,
|
983 + | ModelPl::Output
|
984 + | >,
|
985 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
986 + | JsonRpc10<L>,
|
987 + | crate::operation_shape::JsonUnions,
|
988 + | <
|
989 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
990 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
991 + | JsonRpc10<L>,
|
992 + | crate::operation_shape::JsonUnions,
|
993 + | ModelPl::Output
|
994 + | >
|
995 + | >::Output
|
996 + | >,
|
997 + |
|
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,
|
999 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1000 + |
|
1001 + | {
|
1002 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
1003 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
1004 + | let svc = crate::operation_shape::JsonUnions::from_handler(handler);
|
1005 + | let svc = self.model_plugin.apply(svc);
|
1006 + | let svc =
|
1007 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1008 + | .apply(svc);
|
1009 + | let svc = self.http_plugin.apply(svc);
|
1010 + | self.json_unions_custom(svc)
|
1011 + | }
|
1012 + |
|
1013 + | /// Sets the [`JsonUnions`](crate::operation_shape::JsonUnions) operation.
|
1014 + | ///
|
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.
|
1017 + | ///
|
1018 + | /// # Example
|
1019 + | ///
|
1020 + | /// ```no_run
|
1021 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
1022 + | ///
|
1023 + | /// use json_rpc10_http0x::{input, output, error};
|
1024 + | ///
|
1025 + | /// async fn handler(input: input::JsonUnionsInput) -> Result<output::JsonUnionsOutput, error::JsonUnionsError> {
|
1026 + | /// todo!()
|
1027 + | /// }
|
1028 + | ///
|
1029 + | /// let config = JsonRpc10Config::builder().build();
|
1030 + | /// let svc = ::tower::util::service_fn(handler);
|
1031 + | /// let app = JsonRpc10::builder(config)
|
1032 + | /// .json_unions_service(svc)
|
1033 + | /// /* Set other handlers */
|
1034 + | /// .build()
|
1035 + | /// .unwrap();
|
1036 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
1037 + | /// ```
|
1038 + | ///
|
1039 + | pub fn json_unions_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
1040 + | where
|
1041 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::JsonUnions, ServiceExtractors>,
|
1042 + |
|
1043 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1044 + | JsonRpc10<L>,
|
1045 + | crate::operation_shape::JsonUnions,
|
1046 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::JsonUnions, S>
|
1047 + | >,
|
1048 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1049 + | JsonRpc10<L>,
|
1050 + | crate::operation_shape::JsonUnions,
|
1051 + | ModelPl::Output
|
1052 + | >,
|
1053 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1054 + | JsonRpc10<L>,
|
1055 + | crate::operation_shape::JsonUnions,
|
1056 + | <
|
1057 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1058 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1059 + | JsonRpc10<L>,
|
1060 + | crate::operation_shape::JsonUnions,
|
1061 + | ModelPl::Output
|
1062 + | >
|
1063 + | >::Output
|
1064 + | >,
|
1065 + |
|
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,
|
1067 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1068 + |
|
1069 + | {
|
1070 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
1071 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
1072 + | let svc = crate::operation_shape::JsonUnions::from_service(service);
|
1073 + | let svc = self.model_plugin.apply(svc);
|
1074 + | let svc =
|
1075 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1076 + | .apply(svc);
|
1077 + | let svc = self.http_plugin.apply(svc);
|
1078 + | self.json_unions_custom(svc)
|
1079 + | }
|
1080 + |
|
1081 + | /// Sets the [`JsonUnions`](crate::operation_shape::JsonUnions) to a custom [`Service`](tower::Service).
|
1082 + | /// not constrained by the Smithy contract.
|
1083 + | fn json_unions_custom<S>(mut self, svc: S) -> Self
|
1084 + | where
|
1085 + | S: ::tower::Service<
|
1086 + | ::http::Request<Body>,
|
1087 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
1088 + | Error = ::std::convert::Infallible,
|
1089 + | > + Clone
|
1090 + | + Send
|
1091 + | + 'static,
|
1092 + | S::Future: Send + 'static,
|
1093 + | {
|
1094 + | self.json_unions = Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
1095 + | self
|
1096 + | }
|
1097 + |
|
1098 + | /// Sets the [`NoInputAndNoOutput`](crate::operation_shape::NoInputAndNoOutput) operation.
|
1099 + | ///
|
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.
|
1102 + | ///
|
1103 + | /// # Example
|
1104 + | ///
|
1105 + | /// ```no_run
|
1106 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
1107 + | ///
|
1108 + | /// use json_rpc10_http0x::{input, output, error};
|
1109 + | ///
|
1110 + | /// async fn handler(input: input::NoInputAndNoOutputInput) -> output::NoInputAndNoOutputOutput {
|
1111 + | /// todo!()
|
1112 + | /// }
|
1113 + | ///
|
1114 + | /// let config = JsonRpc10Config::builder().build();
|
1115 + | /// let app = JsonRpc10::builder(config)
|
1116 + | /// .no_input_and_no_output(handler)
|
1117 + | /// /* Set other handlers */
|
1118 + | /// .build()
|
1119 + | /// .unwrap();
|
1120 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
1121 + | /// ```
|
1122 + | ///
|
1123 + | pub fn no_input_and_no_output<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
1124 + | where
|
1125 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::NoInputAndNoOutput, HandlerExtractors>,
|
1126 + |
|
1127 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1128 + | JsonRpc10<L>,
|
1129 + | crate::operation_shape::NoInputAndNoOutput,
|
1130 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::NoInputAndNoOutput, HandlerType>
|
1131 + | >,
|
1132 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1133 + | JsonRpc10<L>,
|
1134 + | crate::operation_shape::NoInputAndNoOutput,
|
1135 + | ModelPl::Output
|
1136 + | >,
|
1137 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1138 + | JsonRpc10<L>,
|
1139 + | crate::operation_shape::NoInputAndNoOutput,
|
1140 + | <
|
1141 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1142 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1143 + | JsonRpc10<L>,
|
1144 + | crate::operation_shape::NoInputAndNoOutput,
|
1145 + | ModelPl::Output
|
1146 + | >
|
1147 + | >::Output
|
1148 + | >,
|
1149 + |
|
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,
|
1151 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1152 + |
|
1153 + | {
|
1154 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
1155 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
1156 + | let svc = crate::operation_shape::NoInputAndNoOutput::from_handler(handler);
|
1157 + | let svc = self.model_plugin.apply(svc);
|
1158 + | let svc =
|
1159 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1160 + | .apply(svc);
|
1161 + | let svc = self.http_plugin.apply(svc);
|
1162 + | self.no_input_and_no_output_custom(svc)
|
1163 + | }
|
1164 + |
|
1165 + | /// Sets the [`NoInputAndNoOutput`](crate::operation_shape::NoInputAndNoOutput) operation.
|
1166 + | ///
|
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.
|
1169 + | ///
|
1170 + | /// # Example
|
1171 + | ///
|
1172 + | /// ```no_run
|
1173 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
1174 + | ///
|
1175 + | /// use json_rpc10_http0x::{input, output, error};
|
1176 + | ///
|
1177 + | /// async fn handler(input: input::NoInputAndNoOutputInput) -> Result<output::NoInputAndNoOutputOutput, std::convert::Infallible> {
|
1178 + | /// todo!()
|
1179 + | /// }
|
1180 + | ///
|
1181 + | /// let config = JsonRpc10Config::builder().build();
|
1182 + | /// let svc = ::tower::util::service_fn(handler);
|
1183 + | /// let app = JsonRpc10::builder(config)
|
1184 + | /// .no_input_and_no_output_service(svc)
|
1185 + | /// /* Set other handlers */
|
1186 + | /// .build()
|
1187 + | /// .unwrap();
|
1188 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
1189 + | /// ```
|
1190 + | ///
|
1191 + | pub fn no_input_and_no_output_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
1192 + | where
|
1193 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::NoInputAndNoOutput, ServiceExtractors>,
|
1194 + |
|
1195 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1196 + | JsonRpc10<L>,
|
1197 + | crate::operation_shape::NoInputAndNoOutput,
|
1198 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::NoInputAndNoOutput, S>
|
1199 + | >,
|
1200 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1201 + | JsonRpc10<L>,
|
1202 + | crate::operation_shape::NoInputAndNoOutput,
|
1203 + | ModelPl::Output
|
1204 + | >,
|
1205 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1206 + | JsonRpc10<L>,
|
1207 + | crate::operation_shape::NoInputAndNoOutput,
|
1208 + | <
|
1209 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1210 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1211 + | JsonRpc10<L>,
|
1212 + | crate::operation_shape::NoInputAndNoOutput,
|
1213 + | ModelPl::Output
|
1214 + | >
|
1215 + | >::Output
|
1216 + | >,
|
1217 + |
|
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,
|
1219 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1220 + |
|
1221 + | {
|
1222 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
1223 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
1224 + | let svc = crate::operation_shape::NoInputAndNoOutput::from_service(service);
|
1225 + | let svc = self.model_plugin.apply(svc);
|
1226 + | let svc =
|
1227 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1228 + | .apply(svc);
|
1229 + | let svc = self.http_plugin.apply(svc);
|
1230 + | self.no_input_and_no_output_custom(svc)
|
1231 + | }
|
1232 + |
|
1233 + | /// Sets the [`NoInputAndNoOutput`](crate::operation_shape::NoInputAndNoOutput) to a custom [`Service`](tower::Service).
|
1234 + | /// not constrained by the Smithy contract.
|
1235 + | fn no_input_and_no_output_custom<S>(mut self, svc: S) -> Self
|
1236 + | where
|
1237 + | S: ::tower::Service<
|
1238 + | ::http::Request<Body>,
|
1239 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
1240 + | Error = ::std::convert::Infallible,
|
1241 + | > + Clone
|
1242 + | + Send
|
1243 + | + 'static,
|
1244 + | S::Future: Send + 'static,
|
1245 + | {
|
1246 + | self.no_input_and_no_output =
|
1247 + | Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
1248 + | self
|
1249 + | }
|
1250 + |
|
1251 + | /// Sets the [`NoInputAndOutput`](crate::operation_shape::NoInputAndOutput) operation.
|
1252 + | ///
|
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.
|
1255 + | ///
|
1256 + | /// # Example
|
1257 + | ///
|
1258 + | /// ```no_run
|
1259 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
1260 + | ///
|
1261 + | /// use json_rpc10_http0x::{input, output, error};
|
1262 + | ///
|
1263 + | /// async fn handler(input: input::NoInputAndOutputInput) -> output::NoInputAndOutputOutput {
|
1264 + | /// todo!()
|
1265 + | /// }
|
1266 + | ///
|
1267 + | /// let config = JsonRpc10Config::builder().build();
|
1268 + | /// let app = JsonRpc10::builder(config)
|
1269 + | /// .no_input_and_output(handler)
|
1270 + | /// /* Set other handlers */
|
1271 + | /// .build()
|
1272 + | /// .unwrap();
|
1273 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
1274 + | /// ```
|
1275 + | ///
|
1276 + | pub fn no_input_and_output<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
1277 + | where
|
1278 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::NoInputAndOutput, HandlerExtractors>,
|
1279 + |
|
1280 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1281 + | JsonRpc10<L>,
|
1282 + | crate::operation_shape::NoInputAndOutput,
|
1283 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::NoInputAndOutput, HandlerType>
|
1284 + | >,
|
1285 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1286 + | JsonRpc10<L>,
|
1287 + | crate::operation_shape::NoInputAndOutput,
|
1288 + | ModelPl::Output
|
1289 + | >,
|
1290 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1291 + | JsonRpc10<L>,
|
1292 + | crate::operation_shape::NoInputAndOutput,
|
1293 + | <
|
1294 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1295 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1296 + | JsonRpc10<L>,
|
1297 + | crate::operation_shape::NoInputAndOutput,
|
1298 + | ModelPl::Output
|
1299 + | >
|
1300 + | >::Output
|
1301 + | >,
|
1302 + |
|
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,
|
1304 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1305 + |
|
1306 + | {
|
1307 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
1308 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
1309 + | let svc = crate::operation_shape::NoInputAndOutput::from_handler(handler);
|
1310 + | let svc = self.model_plugin.apply(svc);
|
1311 + | let svc =
|
1312 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1313 + | .apply(svc);
|
1314 + | let svc = self.http_plugin.apply(svc);
|
1315 + | self.no_input_and_output_custom(svc)
|
1316 + | }
|
1317 + |
|
1318 + | /// Sets the [`NoInputAndOutput`](crate::operation_shape::NoInputAndOutput) operation.
|
1319 + | ///
|
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.
|
1322 + | ///
|
1323 + | /// # Example
|
1324 + | ///
|
1325 + | /// ```no_run
|
1326 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
1327 + | ///
|
1328 + | /// use json_rpc10_http0x::{input, output, error};
|
1329 + | ///
|
1330 + | /// async fn handler(input: input::NoInputAndOutputInput) -> Result<output::NoInputAndOutputOutput, std::convert::Infallible> {
|
1331 + | /// todo!()
|
1332 + | /// }
|
1333 + | ///
|
1334 + | /// let config = JsonRpc10Config::builder().build();
|
1335 + | /// let svc = ::tower::util::service_fn(handler);
|
1336 + | /// let app = JsonRpc10::builder(config)
|
1337 + | /// .no_input_and_output_service(svc)
|
1338 + | /// /* Set other handlers */
|
1339 + | /// .build()
|
1340 + | /// .unwrap();
|
1341 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
1342 + | /// ```
|
1343 + | ///
|
1344 + | pub fn no_input_and_output_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
1345 + | where
|
1346 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::NoInputAndOutput, ServiceExtractors>,
|
1347 + |
|
1348 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1349 + | JsonRpc10<L>,
|
1350 + | crate::operation_shape::NoInputAndOutput,
|
1351 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::NoInputAndOutput, S>
|
1352 + | >,
|
1353 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1354 + | JsonRpc10<L>,
|
1355 + | crate::operation_shape::NoInputAndOutput,
|
1356 + | ModelPl::Output
|
1357 + | >,
|
1358 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1359 + | JsonRpc10<L>,
|
1360 + | crate::operation_shape::NoInputAndOutput,
|
1361 + | <
|
1362 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1363 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1364 + | JsonRpc10<L>,
|
1365 + | crate::operation_shape::NoInputAndOutput,
|
1366 + | ModelPl::Output
|
1367 + | >
|
1368 + | >::Output
|
1369 + | >,
|
1370 + |
|
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,
|
1372 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1373 + |
|
1374 + | {
|
1375 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
1376 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
1377 + | let svc = crate::operation_shape::NoInputAndOutput::from_service(service);
|
1378 + | let svc = self.model_plugin.apply(svc);
|
1379 + | let svc =
|
1380 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1381 + | .apply(svc);
|
1382 + | let svc = self.http_plugin.apply(svc);
|
1383 + | self.no_input_and_output_custom(svc)
|
1384 + | }
|
1385 + |
|
1386 + | /// Sets the [`NoInputAndOutput`](crate::operation_shape::NoInputAndOutput) to a custom [`Service`](tower::Service).
|
1387 + | /// not constrained by the Smithy contract.
|
1388 + | fn no_input_and_output_custom<S>(mut self, svc: S) -> Self
|
1389 + | where
|
1390 + | S: ::tower::Service<
|
1391 + | ::http::Request<Body>,
|
1392 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
1393 + | Error = ::std::convert::Infallible,
|
1394 + | > + Clone
|
1395 + | + Send
|
1396 + | + 'static,
|
1397 + | S::Future: Send + 'static,
|
1398 + | {
|
1399 + | self.no_input_and_output = Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
1400 + | self
|
1401 + | }
|
1402 + |
|
1403 + | /// Sets the [`OperationWithDefaults`](crate::operation_shape::OperationWithDefaults) operation.
|
1404 + | ///
|
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.
|
1407 + | ///
|
1408 + | /// # Example
|
1409 + | ///
|
1410 + | /// ```no_run
|
1411 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
1412 + | ///
|
1413 + | /// use json_rpc10_http0x::{input, output, error};
|
1414 + | ///
|
1415 + | /// async fn handler(input: input::OperationWithDefaultsInput) -> Result<output::OperationWithDefaultsOutput, error::OperationWithDefaultsError> {
|
1416 + | /// todo!()
|
1417 + | /// }
|
1418 + | ///
|
1419 + | /// let config = JsonRpc10Config::builder().build();
|
1420 + | /// let app = JsonRpc10::builder(config)
|
1421 + | /// .operation_with_defaults(handler)
|
1422 + | /// /* Set other handlers */
|
1423 + | /// .build()
|
1424 + | /// .unwrap();
|
1425 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
1426 + | /// ```
|
1427 + | ///
|
1428 + | pub fn operation_with_defaults<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
1429 + | where
|
1430 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::OperationWithDefaults, HandlerExtractors>,
|
1431 + |
|
1432 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1433 + | JsonRpc10<L>,
|
1434 + | crate::operation_shape::OperationWithDefaults,
|
1435 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::OperationWithDefaults, HandlerType>
|
1436 + | >,
|
1437 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1438 + | JsonRpc10<L>,
|
1439 + | crate::operation_shape::OperationWithDefaults,
|
1440 + | ModelPl::Output
|
1441 + | >,
|
1442 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1443 + | JsonRpc10<L>,
|
1444 + | crate::operation_shape::OperationWithDefaults,
|
1445 + | <
|
1446 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1447 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1448 + | JsonRpc10<L>,
|
1449 + | crate::operation_shape::OperationWithDefaults,
|
1450 + | ModelPl::Output
|
1451 + | >
|
1452 + | >::Output
|
1453 + | >,
|
1454 + |
|
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,
|
1456 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1457 + |
|
1458 + | {
|
1459 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
1460 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
1461 + | let svc = crate::operation_shape::OperationWithDefaults::from_handler(handler);
|
1462 + | let svc = self.model_plugin.apply(svc);
|
1463 + | let svc =
|
1464 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1465 + | .apply(svc);
|
1466 + | let svc = self.http_plugin.apply(svc);
|
1467 + | self.operation_with_defaults_custom(svc)
|
1468 + | }
|
1469 + |
|
1470 + | /// Sets the [`OperationWithDefaults`](crate::operation_shape::OperationWithDefaults) operation.
|
1471 + | ///
|
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.
|
1474 + | ///
|
1475 + | /// # Example
|
1476 + | ///
|
1477 + | /// ```no_run
|
1478 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
1479 + | ///
|
1480 + | /// use json_rpc10_http0x::{input, output, error};
|
1481 + | ///
|
1482 + | /// async fn handler(input: input::OperationWithDefaultsInput) -> Result<output::OperationWithDefaultsOutput, error::OperationWithDefaultsError> {
|
1483 + | /// todo!()
|
1484 + | /// }
|
1485 + | ///
|
1486 + | /// let config = JsonRpc10Config::builder().build();
|
1487 + | /// let svc = ::tower::util::service_fn(handler);
|
1488 + | /// let app = JsonRpc10::builder(config)
|
1489 + | /// .operation_with_defaults_service(svc)
|
1490 + | /// /* Set other handlers */
|
1491 + | /// .build()
|
1492 + | /// .unwrap();
|
1493 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
1494 + | /// ```
|
1495 + | ///
|
1496 + | pub fn operation_with_defaults_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
1497 + | where
|
1498 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::OperationWithDefaults, ServiceExtractors>,
|
1499 + |
|
1500 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1501 + | JsonRpc10<L>,
|
1502 + | crate::operation_shape::OperationWithDefaults,
|
1503 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::OperationWithDefaults, S>
|
1504 + | >,
|
1505 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1506 + | JsonRpc10<L>,
|
1507 + | crate::operation_shape::OperationWithDefaults,
|
1508 + | ModelPl::Output
|
1509 + | >,
|
1510 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1511 + | JsonRpc10<L>,
|
1512 + | crate::operation_shape::OperationWithDefaults,
|
1513 + | <
|
1514 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1515 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1516 + | JsonRpc10<L>,
|
1517 + | crate::operation_shape::OperationWithDefaults,
|
1518 + | ModelPl::Output
|
1519 + | >
|
1520 + | >::Output
|
1521 + | >,
|
1522 + |
|
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,
|
1524 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1525 + |
|
1526 + | {
|
1527 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
1528 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
1529 + | let svc = crate::operation_shape::OperationWithDefaults::from_service(service);
|
1530 + | let svc = self.model_plugin.apply(svc);
|
1531 + | let svc =
|
1532 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1533 + | .apply(svc);
|
1534 + | let svc = self.http_plugin.apply(svc);
|
1535 + | self.operation_with_defaults_custom(svc)
|
1536 + | }
|
1537 + |
|
1538 + | /// Sets the [`OperationWithDefaults`](crate::operation_shape::OperationWithDefaults) to a custom [`Service`](tower::Service).
|
1539 + | /// not constrained by the Smithy contract.
|
1540 + | fn operation_with_defaults_custom<S>(mut self, svc: S) -> Self
|
1541 + | where
|
1542 + | S: ::tower::Service<
|
1543 + | ::http::Request<Body>,
|
1544 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
1545 + | Error = ::std::convert::Infallible,
|
1546 + | > + Clone
|
1547 + | + Send
|
1548 + | + 'static,
|
1549 + | S::Future: Send + 'static,
|
1550 + | {
|
1551 + | self.operation_with_defaults =
|
1552 + | Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
1553 + | self
|
1554 + | }
|
1555 + |
|
1556 + | /// Sets the [`OperationWithNestedStructure`](crate::operation_shape::OperationWithNestedStructure) operation.
|
1557 + | ///
|
1558 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
1559 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
1560 + | ///
|
1561 + | /// # Example
|
1562 + | ///
|
1563 + | /// ```no_run
|
1564 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
1565 + | ///
|
1566 + | /// use json_rpc10_http0x::{input, output, error};
|
1567 + | ///
|
1568 + | /// async fn handler(input: input::OperationWithNestedStructureInput) -> Result<output::OperationWithNestedStructureOutput, error::OperationWithNestedStructureError> {
|
1569 + | /// todo!()
|
1570 + | /// }
|
1571 + | ///
|
1572 + | /// let config = JsonRpc10Config::builder().build();
|
1573 + | /// let app = JsonRpc10::builder(config)
|
1574 + | /// .operation_with_nested_structure(handler)
|
1575 + | /// /* Set other handlers */
|
1576 + | /// .build()
|
1577 + | /// .unwrap();
|
1578 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
1579 + | /// ```
|
1580 + | ///
|
1581 + | pub fn operation_with_nested_structure<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
1582 + | where
|
1583 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::OperationWithNestedStructure, HandlerExtractors>,
|
1584 + |
|
1585 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1586 + | JsonRpc10<L>,
|
1587 + | crate::operation_shape::OperationWithNestedStructure,
|
1588 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::OperationWithNestedStructure, HandlerType>
|
1589 + | >,
|
1590 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1591 + | JsonRpc10<L>,
|
1592 + | crate::operation_shape::OperationWithNestedStructure,
|
1593 + | ModelPl::Output
|
1594 + | >,
|
1595 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1596 + | JsonRpc10<L>,
|
1597 + | crate::operation_shape::OperationWithNestedStructure,
|
1598 + | <
|
1599 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1600 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1601 + | JsonRpc10<L>,
|
1602 + | crate::operation_shape::OperationWithNestedStructure,
|
1603 + | ModelPl::Output
|
1604 + | >
|
1605 + | >::Output
|
1606 + | >,
|
1607 + |
|
1608 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1609 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1610 + |
|
1611 + | {
|
1612 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
1613 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
1614 + | let svc = crate::operation_shape::OperationWithNestedStructure::from_handler(handler);
|
1615 + | let svc = self.model_plugin.apply(svc);
|
1616 + | let svc =
|
1617 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1618 + | .apply(svc);
|
1619 + | let svc = self.http_plugin.apply(svc);
|
1620 + | self.operation_with_nested_structure_custom(svc)
|
1621 + | }
|
1622 + |
|
1623 + | /// Sets the [`OperationWithNestedStructure`](crate::operation_shape::OperationWithNestedStructure) operation.
|
1624 + | ///
|
1625 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
1626 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
1627 + | ///
|
1628 + | /// # Example
|
1629 + | ///
|
1630 + | /// ```no_run
|
1631 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
1632 + | ///
|
1633 + | /// use json_rpc10_http0x::{input, output, error};
|
1634 + | ///
|
1635 + | /// async fn handler(input: input::OperationWithNestedStructureInput) -> Result<output::OperationWithNestedStructureOutput, error::OperationWithNestedStructureError> {
|
1636 + | /// todo!()
|
1637 + | /// }
|
1638 + | ///
|
1639 + | /// let config = JsonRpc10Config::builder().build();
|
1640 + | /// let svc = ::tower::util::service_fn(handler);
|
1641 + | /// let app = JsonRpc10::builder(config)
|
1642 + | /// .operation_with_nested_structure_service(svc)
|
1643 + | /// /* Set other handlers */
|
1644 + | /// .build()
|
1645 + | /// .unwrap();
|
1646 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
1647 + | /// ```
|
1648 + | ///
|
1649 + | pub fn operation_with_nested_structure_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
1650 + | where
|
1651 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::OperationWithNestedStructure, ServiceExtractors>,
|
1652 + |
|
1653 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1654 + | JsonRpc10<L>,
|
1655 + | crate::operation_shape::OperationWithNestedStructure,
|
1656 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::OperationWithNestedStructure, S>
|
1657 + | >,
|
1658 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1659 + | JsonRpc10<L>,
|
1660 + | crate::operation_shape::OperationWithNestedStructure,
|
1661 + | ModelPl::Output
|
1662 + | >,
|
1663 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1664 + | JsonRpc10<L>,
|
1665 + | crate::operation_shape::OperationWithNestedStructure,
|
1666 + | <
|
1667 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1668 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1669 + | JsonRpc10<L>,
|
1670 + | crate::operation_shape::OperationWithNestedStructure,
|
1671 + | ModelPl::Output
|
1672 + | >
|
1673 + | >::Output
|
1674 + | >,
|
1675 + |
|
1676 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1677 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1678 + |
|
1679 + | {
|
1680 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
1681 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
1682 + | let svc = crate::operation_shape::OperationWithNestedStructure::from_service(service);
|
1683 + | let svc = self.model_plugin.apply(svc);
|
1684 + | let svc =
|
1685 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1686 + | .apply(svc);
|
1687 + | let svc = self.http_plugin.apply(svc);
|
1688 + | self.operation_with_nested_structure_custom(svc)
|
1689 + | }
|
1690 + |
|
1691 + | /// Sets the [`OperationWithNestedStructure`](crate::operation_shape::OperationWithNestedStructure) to a custom [`Service`](tower::Service).
|
1692 + | /// not constrained by the Smithy contract.
|
1693 + | fn operation_with_nested_structure_custom<S>(mut self, svc: S) -> Self
|
1694 + | where
|
1695 + | S: ::tower::Service<
|
1696 + | ::http::Request<Body>,
|
1697 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
1698 + | Error = ::std::convert::Infallible,
|
1699 + | > + Clone
|
1700 + | + Send
|
1701 + | + 'static,
|
1702 + | S::Future: Send + 'static,
|
1703 + | {
|
1704 + | self.operation_with_nested_structure =
|
1705 + | Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
1706 + | self
|
1707 + | }
|
1708 + |
|
1709 + | /// Sets the [`OperationWithRequiredMembers`](crate::operation_shape::OperationWithRequiredMembers) operation.
|
1710 + | ///
|
1711 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
1712 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
1713 + | ///
|
1714 + | /// # Example
|
1715 + | ///
|
1716 + | /// ```no_run
|
1717 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
1718 + | ///
|
1719 + | /// use json_rpc10_http0x::{input, output, error};
|
1720 + | ///
|
1721 + | /// async fn handler(input: input::OperationWithRequiredMembersInput) -> output::OperationWithRequiredMembersOutput {
|
1722 + | /// todo!()
|
1723 + | /// }
|
1724 + | ///
|
1725 + | /// let config = JsonRpc10Config::builder().build();
|
1726 + | /// let app = JsonRpc10::builder(config)
|
1727 + | /// .operation_with_required_members(handler)
|
1728 + | /// /* Set other handlers */
|
1729 + | /// .build()
|
1730 + | /// .unwrap();
|
1731 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
1732 + | /// ```
|
1733 + | ///
|
1734 + | pub fn operation_with_required_members<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
1735 + | where
|
1736 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::OperationWithRequiredMembers, HandlerExtractors>,
|
1737 + |
|
1738 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1739 + | JsonRpc10<L>,
|
1740 + | crate::operation_shape::OperationWithRequiredMembers,
|
1741 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::OperationWithRequiredMembers, HandlerType>
|
1742 + | >,
|
1743 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1744 + | JsonRpc10<L>,
|
1745 + | crate::operation_shape::OperationWithRequiredMembers,
|
1746 + | ModelPl::Output
|
1747 + | >,
|
1748 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1749 + | JsonRpc10<L>,
|
1750 + | crate::operation_shape::OperationWithRequiredMembers,
|
1751 + | <
|
1752 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1753 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1754 + | JsonRpc10<L>,
|
1755 + | crate::operation_shape::OperationWithRequiredMembers,
|
1756 + | ModelPl::Output
|
1757 + | >
|
1758 + | >::Output
|
1759 + | >,
|
1760 + |
|
1761 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1762 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1763 + |
|
1764 + | {
|
1765 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
1766 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
1767 + | let svc = crate::operation_shape::OperationWithRequiredMembers::from_handler(handler);
|
1768 + | let svc = self.model_plugin.apply(svc);
|
1769 + | let svc =
|
1770 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1771 + | .apply(svc);
|
1772 + | let svc = self.http_plugin.apply(svc);
|
1773 + | self.operation_with_required_members_custom(svc)
|
1774 + | }
|
1775 + |
|
1776 + | /// Sets the [`OperationWithRequiredMembers`](crate::operation_shape::OperationWithRequiredMembers) operation.
|
1777 + | ///
|
1778 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
1779 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
1780 + | ///
|
1781 + | /// # Example
|
1782 + | ///
|
1783 + | /// ```no_run
|
1784 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
1785 + | ///
|
1786 + | /// use json_rpc10_http0x::{input, output, error};
|
1787 + | ///
|
1788 + | /// async fn handler(input: input::OperationWithRequiredMembersInput) -> Result<output::OperationWithRequiredMembersOutput, std::convert::Infallible> {
|
1789 + | /// todo!()
|
1790 + | /// }
|
1791 + | ///
|
1792 + | /// let config = JsonRpc10Config::builder().build();
|
1793 + | /// let svc = ::tower::util::service_fn(handler);
|
1794 + | /// let app = JsonRpc10::builder(config)
|
1795 + | /// .operation_with_required_members_service(svc)
|
1796 + | /// /* Set other handlers */
|
1797 + | /// .build()
|
1798 + | /// .unwrap();
|
1799 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
1800 + | /// ```
|
1801 + | ///
|
1802 + | pub fn operation_with_required_members_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
1803 + | where
|
1804 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::OperationWithRequiredMembers, ServiceExtractors>,
|
1805 + |
|
1806 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1807 + | JsonRpc10<L>,
|
1808 + | crate::operation_shape::OperationWithRequiredMembers,
|
1809 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::OperationWithRequiredMembers, S>
|
1810 + | >,
|
1811 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1812 + | JsonRpc10<L>,
|
1813 + | crate::operation_shape::OperationWithRequiredMembers,
|
1814 + | ModelPl::Output
|
1815 + | >,
|
1816 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1817 + | JsonRpc10<L>,
|
1818 + | crate::operation_shape::OperationWithRequiredMembers,
|
1819 + | <
|
1820 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1821 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1822 + | JsonRpc10<L>,
|
1823 + | crate::operation_shape::OperationWithRequiredMembers,
|
1824 + | ModelPl::Output
|
1825 + | >
|
1826 + | >::Output
|
1827 + | >,
|
1828 + |
|
1829 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1830 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1831 + |
|
1832 + | {
|
1833 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
1834 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
1835 + | let svc = crate::operation_shape::OperationWithRequiredMembers::from_service(service);
|
1836 + | let svc = self.model_plugin.apply(svc);
|
1837 + | let svc =
|
1838 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1839 + | .apply(svc);
|
1840 + | let svc = self.http_plugin.apply(svc);
|
1841 + | self.operation_with_required_members_custom(svc)
|
1842 + | }
|
1843 + |
|
1844 + | /// Sets the [`OperationWithRequiredMembers`](crate::operation_shape::OperationWithRequiredMembers) to a custom [`Service`](tower::Service).
|
1845 + | /// not constrained by the Smithy contract.
|
1846 + | fn operation_with_required_members_custom<S>(mut self, svc: S) -> Self
|
1847 + | where
|
1848 + | S: ::tower::Service<
|
1849 + | ::http::Request<Body>,
|
1850 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
1851 + | Error = ::std::convert::Infallible,
|
1852 + | > + Clone
|
1853 + | + Send
|
1854 + | + 'static,
|
1855 + | S::Future: Send + 'static,
|
1856 + | {
|
1857 + | self.operation_with_required_members =
|
1858 + | Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
1859 + | self
|
1860 + | }
|
1861 + |
|
1862 + | /// Sets the [`OperationWithRequiredMembersWithDefaults`](crate::operation_shape::OperationWithRequiredMembersWithDefaults) operation.
|
1863 + | ///
|
1864 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
1865 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
1866 + | ///
|
1867 + | /// # Example
|
1868 + | ///
|
1869 + | /// ```no_run
|
1870 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
1871 + | ///
|
1872 + | /// use json_rpc10_http0x::{input, output, error};
|
1873 + | ///
|
1874 + | /// async fn handler(input: input::OperationWithRequiredMembersWithDefaultsInput) -> output::OperationWithRequiredMembersWithDefaultsOutput {
|
1875 + | /// todo!()
|
1876 + | /// }
|
1877 + | ///
|
1878 + | /// let config = JsonRpc10Config::builder().build();
|
1879 + | /// let app = JsonRpc10::builder(config)
|
1880 + | /// .operation_with_required_members_with_defaults(handler)
|
1881 + | /// /* Set other handlers */
|
1882 + | /// .build()
|
1883 + | /// .unwrap();
|
1884 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
1885 + | /// ```
|
1886 + | ///
|
1887 + | pub fn operation_with_required_members_with_defaults<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
1888 + | where
|
1889 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::OperationWithRequiredMembersWithDefaults, HandlerExtractors>,
|
1890 + |
|
1891 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1892 + | JsonRpc10<L>,
|
1893 + | crate::operation_shape::OperationWithRequiredMembersWithDefaults,
|
1894 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::OperationWithRequiredMembersWithDefaults, HandlerType>
|
1895 + | >,
|
1896 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1897 + | JsonRpc10<L>,
|
1898 + | crate::operation_shape::OperationWithRequiredMembersWithDefaults,
|
1899 + | ModelPl::Output
|
1900 + | >,
|
1901 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1902 + | JsonRpc10<L>,
|
1903 + | crate::operation_shape::OperationWithRequiredMembersWithDefaults,
|
1904 + | <
|
1905 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1906 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1907 + | JsonRpc10<L>,
|
1908 + | crate::operation_shape::OperationWithRequiredMembersWithDefaults,
|
1909 + | ModelPl::Output
|
1910 + | >
|
1911 + | >::Output
|
1912 + | >,
|
1913 + |
|
1914 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1915 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1916 + |
|
1917 + | {
|
1918 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
1919 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
1920 + | let svc =
|
1921 + | crate::operation_shape::OperationWithRequiredMembersWithDefaults::from_handler(handler);
|
1922 + | let svc = self.model_plugin.apply(svc);
|
1923 + | let svc =
|
1924 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1925 + | .apply(svc);
|
1926 + | let svc = self.http_plugin.apply(svc);
|
1927 + | self.operation_with_required_members_with_defaults_custom(svc)
|
1928 + | }
|
1929 + |
|
1930 + | /// Sets the [`OperationWithRequiredMembersWithDefaults`](crate::operation_shape::OperationWithRequiredMembersWithDefaults) operation.
|
1931 + | ///
|
1932 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
1933 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
1934 + | ///
|
1935 + | /// # Example
|
1936 + | ///
|
1937 + | /// ```no_run
|
1938 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
1939 + | ///
|
1940 + | /// use json_rpc10_http0x::{input, output, error};
|
1941 + | ///
|
1942 + | /// async fn handler(input: input::OperationWithRequiredMembersWithDefaultsInput) -> Result<output::OperationWithRequiredMembersWithDefaultsOutput, std::convert::Infallible> {
|
1943 + | /// todo!()
|
1944 + | /// }
|
1945 + | ///
|
1946 + | /// let config = JsonRpc10Config::builder().build();
|
1947 + | /// let svc = ::tower::util::service_fn(handler);
|
1948 + | /// let app = JsonRpc10::builder(config)
|
1949 + | /// .operation_with_required_members_with_defaults_service(svc)
|
1950 + | /// /* Set other handlers */
|
1951 + | /// .build()
|
1952 + | /// .unwrap();
|
1953 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
1954 + | /// ```
|
1955 + | ///
|
1956 + | pub fn operation_with_required_members_with_defaults_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
1957 + | where
|
1958 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::OperationWithRequiredMembersWithDefaults, ServiceExtractors>,
|
1959 + |
|
1960 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1961 + | JsonRpc10<L>,
|
1962 + | crate::operation_shape::OperationWithRequiredMembersWithDefaults,
|
1963 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::OperationWithRequiredMembersWithDefaults, S>
|
1964 + | >,
|
1965 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1966 + | JsonRpc10<L>,
|
1967 + | crate::operation_shape::OperationWithRequiredMembersWithDefaults,
|
1968 + | ModelPl::Output
|
1969 + | >,
|
1970 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1971 + | JsonRpc10<L>,
|
1972 + | crate::operation_shape::OperationWithRequiredMembersWithDefaults,
|
1973 + | <
|
1974 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1975 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
1976 + | JsonRpc10<L>,
|
1977 + | crate::operation_shape::OperationWithRequiredMembersWithDefaults,
|
1978 + | ModelPl::Output
|
1979 + | >
|
1980 + | >::Output
|
1981 + | >,
|
1982 + |
|
1983 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1984 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1985 + |
|
1986 + | {
|
1987 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
1988 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
1989 + | let svc =
|
1990 + | crate::operation_shape::OperationWithRequiredMembersWithDefaults::from_service(service);
|
1991 + | let svc = self.model_plugin.apply(svc);
|
1992 + | let svc =
|
1993 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1994 + | .apply(svc);
|
1995 + | let svc = self.http_plugin.apply(svc);
|
1996 + | self.operation_with_required_members_with_defaults_custom(svc)
|
1997 + | }
|
1998 + |
|
1999 + | /// Sets the [`OperationWithRequiredMembersWithDefaults`](crate::operation_shape::OperationWithRequiredMembersWithDefaults) to a custom [`Service`](tower::Service).
|
2000 + | /// not constrained by the Smithy contract.
|
2001 + | fn operation_with_required_members_with_defaults_custom<S>(mut self, svc: S) -> Self
|
2002 + | where
|
2003 + | S: ::tower::Service<
|
2004 + | ::http::Request<Body>,
|
2005 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
2006 + | Error = ::std::convert::Infallible,
|
2007 + | > + Clone
|
2008 + | + Send
|
2009 + | + 'static,
|
2010 + | S::Future: Send + 'static,
|
2011 + | {
|
2012 + | self.operation_with_required_members_with_defaults =
|
2013 + | Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
2014 + | self
|
2015 + | }
|
2016 + |
|
2017 + | /// Sets the [`PutWithContentEncoding`](crate::operation_shape::PutWithContentEncoding) operation.
|
2018 + | ///
|
2019 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
2020 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
2021 + | ///
|
2022 + | /// # Example
|
2023 + | ///
|
2024 + | /// ```no_run
|
2025 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
2026 + | ///
|
2027 + | /// use json_rpc10_http0x::{input, output, error};
|
2028 + | ///
|
2029 + | /// async fn handler(input: input::PutWithContentEncodingInput) -> output::PutWithContentEncodingOutput {
|
2030 + | /// todo!()
|
2031 + | /// }
|
2032 + | ///
|
2033 + | /// let config = JsonRpc10Config::builder().build();
|
2034 + | /// let app = JsonRpc10::builder(config)
|
2035 + | /// .put_with_content_encoding(handler)
|
2036 + | /// /* Set other handlers */
|
2037 + | /// .build()
|
2038 + | /// .unwrap();
|
2039 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
2040 + | /// ```
|
2041 + | ///
|
2042 + | pub fn put_with_content_encoding<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
2043 + | where
|
2044 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::PutWithContentEncoding, HandlerExtractors>,
|
2045 + |
|
2046 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2047 + | JsonRpc10<L>,
|
2048 + | crate::operation_shape::PutWithContentEncoding,
|
2049 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::PutWithContentEncoding, HandlerType>
|
2050 + | >,
|
2051 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2052 + | JsonRpc10<L>,
|
2053 + | crate::operation_shape::PutWithContentEncoding,
|
2054 + | ModelPl::Output
|
2055 + | >,
|
2056 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2057 + | JsonRpc10<L>,
|
2058 + | crate::operation_shape::PutWithContentEncoding,
|
2059 + | <
|
2060 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
2061 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2062 + | JsonRpc10<L>,
|
2063 + | crate::operation_shape::PutWithContentEncoding,
|
2064 + | ModelPl::Output
|
2065 + | >
|
2066 + | >::Output
|
2067 + | >,
|
2068 + |
|
2069 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
2070 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
2071 + |
|
2072 + | {
|
2073 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
2074 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
2075 + | let svc = crate::operation_shape::PutWithContentEncoding::from_handler(handler);
|
2076 + | let svc = self.model_plugin.apply(svc);
|
2077 + | let svc =
|
2078 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
2079 + | .apply(svc);
|
2080 + | let svc = self.http_plugin.apply(svc);
|
2081 + | self.put_with_content_encoding_custom(svc)
|
2082 + | }
|
2083 + |
|
2084 + | /// Sets the [`PutWithContentEncoding`](crate::operation_shape::PutWithContentEncoding) operation.
|
2085 + | ///
|
2086 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
2087 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
2088 + | ///
|
2089 + | /// # Example
|
2090 + | ///
|
2091 + | /// ```no_run
|
2092 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
2093 + | ///
|
2094 + | /// use json_rpc10_http0x::{input, output, error};
|
2095 + | ///
|
2096 + | /// async fn handler(input: input::PutWithContentEncodingInput) -> Result<output::PutWithContentEncodingOutput, std::convert::Infallible> {
|
2097 + | /// todo!()
|
2098 + | /// }
|
2099 + | ///
|
2100 + | /// let config = JsonRpc10Config::builder().build();
|
2101 + | /// let svc = ::tower::util::service_fn(handler);
|
2102 + | /// let app = JsonRpc10::builder(config)
|
2103 + | /// .put_with_content_encoding_service(svc)
|
2104 + | /// /* Set other handlers */
|
2105 + | /// .build()
|
2106 + | /// .unwrap();
|
2107 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
2108 + | /// ```
|
2109 + | ///
|
2110 + | pub fn put_with_content_encoding_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
2111 + | where
|
2112 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::PutWithContentEncoding, ServiceExtractors>,
|
2113 + |
|
2114 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2115 + | JsonRpc10<L>,
|
2116 + | crate::operation_shape::PutWithContentEncoding,
|
2117 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::PutWithContentEncoding, S>
|
2118 + | >,
|
2119 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2120 + | JsonRpc10<L>,
|
2121 + | crate::operation_shape::PutWithContentEncoding,
|
2122 + | ModelPl::Output
|
2123 + | >,
|
2124 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2125 + | JsonRpc10<L>,
|
2126 + | crate::operation_shape::PutWithContentEncoding,
|
2127 + | <
|
2128 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
2129 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2130 + | JsonRpc10<L>,
|
2131 + | crate::operation_shape::PutWithContentEncoding,
|
2132 + | ModelPl::Output
|
2133 + | >
|
2134 + | >::Output
|
2135 + | >,
|
2136 + |
|
2137 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
2138 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
2139 + |
|
2140 + | {
|
2141 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
2142 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
2143 + | let svc = crate::operation_shape::PutWithContentEncoding::from_service(service);
|
2144 + | let svc = self.model_plugin.apply(svc);
|
2145 + | let svc =
|
2146 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
2147 + | .apply(svc);
|
2148 + | let svc = self.http_plugin.apply(svc);
|
2149 + | self.put_with_content_encoding_custom(svc)
|
2150 + | }
|
2151 + |
|
2152 + | /// Sets the [`PutWithContentEncoding`](crate::operation_shape::PutWithContentEncoding) to a custom [`Service`](tower::Service).
|
2153 + | /// not constrained by the Smithy contract.
|
2154 + | fn put_with_content_encoding_custom<S>(mut self, svc: S) -> Self
|
2155 + | where
|
2156 + | S: ::tower::Service<
|
2157 + | ::http::Request<Body>,
|
2158 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
2159 + | Error = ::std::convert::Infallible,
|
2160 + | > + Clone
|
2161 + | + Send
|
2162 + | + 'static,
|
2163 + | S::Future: Send + 'static,
|
2164 + | {
|
2165 + | self.put_with_content_encoding =
|
2166 + | Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
2167 + | self
|
2168 + | }
|
2169 + |
|
2170 + | /// Sets the [`QueryIncompatibleOperation`](crate::operation_shape::QueryIncompatibleOperation) operation.
|
2171 + | ///
|
2172 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
2173 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
2174 + | ///
|
2175 + | /// # Example
|
2176 + | ///
|
2177 + | /// ```no_run
|
2178 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
2179 + | ///
|
2180 + | /// use json_rpc10_http0x::{input, output, error};
|
2181 + | ///
|
2182 + | /// async fn handler(input: input::QueryIncompatibleOperationInput) -> output::QueryIncompatibleOperationOutput {
|
2183 + | /// todo!()
|
2184 + | /// }
|
2185 + | ///
|
2186 + | /// let config = JsonRpc10Config::builder().build();
|
2187 + | /// let app = JsonRpc10::builder(config)
|
2188 + | /// .query_incompatible_operation(handler)
|
2189 + | /// /* Set other handlers */
|
2190 + | /// .build()
|
2191 + | /// .unwrap();
|
2192 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
2193 + | /// ```
|
2194 + | ///
|
2195 + | pub fn query_incompatible_operation<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
2196 + | where
|
2197 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::QueryIncompatibleOperation, HandlerExtractors>,
|
2198 + |
|
2199 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2200 + | JsonRpc10<L>,
|
2201 + | crate::operation_shape::QueryIncompatibleOperation,
|
2202 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::QueryIncompatibleOperation, HandlerType>
|
2203 + | >,
|
2204 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2205 + | JsonRpc10<L>,
|
2206 + | crate::operation_shape::QueryIncompatibleOperation,
|
2207 + | ModelPl::Output
|
2208 + | >,
|
2209 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2210 + | JsonRpc10<L>,
|
2211 + | crate::operation_shape::QueryIncompatibleOperation,
|
2212 + | <
|
2213 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
2214 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2215 + | JsonRpc10<L>,
|
2216 + | crate::operation_shape::QueryIncompatibleOperation,
|
2217 + | ModelPl::Output
|
2218 + | >
|
2219 + | >::Output
|
2220 + | >,
|
2221 + |
|
2222 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
2223 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
2224 + |
|
2225 + | {
|
2226 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
2227 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
2228 + | let svc = crate::operation_shape::QueryIncompatibleOperation::from_handler(handler);
|
2229 + | let svc = self.model_plugin.apply(svc);
|
2230 + | let svc =
|
2231 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
2232 + | .apply(svc);
|
2233 + | let svc = self.http_plugin.apply(svc);
|
2234 + | self.query_incompatible_operation_custom(svc)
|
2235 + | }
|
2236 + |
|
2237 + | /// Sets the [`QueryIncompatibleOperation`](crate::operation_shape::QueryIncompatibleOperation) operation.
|
2238 + | ///
|
2239 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
2240 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
2241 + | ///
|
2242 + | /// # Example
|
2243 + | ///
|
2244 + | /// ```no_run
|
2245 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
2246 + | ///
|
2247 + | /// use json_rpc10_http0x::{input, output, error};
|
2248 + | ///
|
2249 + | /// async fn handler(input: input::QueryIncompatibleOperationInput) -> Result<output::QueryIncompatibleOperationOutput, std::convert::Infallible> {
|
2250 + | /// todo!()
|
2251 + | /// }
|
2252 + | ///
|
2253 + | /// let config = JsonRpc10Config::builder().build();
|
2254 + | /// let svc = ::tower::util::service_fn(handler);
|
2255 + | /// let app = JsonRpc10::builder(config)
|
2256 + | /// .query_incompatible_operation_service(svc)
|
2257 + | /// /* Set other handlers */
|
2258 + | /// .build()
|
2259 + | /// .unwrap();
|
2260 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
2261 + | /// ```
|
2262 + | ///
|
2263 + | pub fn query_incompatible_operation_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
2264 + | where
|
2265 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::QueryIncompatibleOperation, ServiceExtractors>,
|
2266 + |
|
2267 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2268 + | JsonRpc10<L>,
|
2269 + | crate::operation_shape::QueryIncompatibleOperation,
|
2270 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::QueryIncompatibleOperation, S>
|
2271 + | >,
|
2272 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2273 + | JsonRpc10<L>,
|
2274 + | crate::operation_shape::QueryIncompatibleOperation,
|
2275 + | ModelPl::Output
|
2276 + | >,
|
2277 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2278 + | JsonRpc10<L>,
|
2279 + | crate::operation_shape::QueryIncompatibleOperation,
|
2280 + | <
|
2281 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
2282 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2283 + | JsonRpc10<L>,
|
2284 + | crate::operation_shape::QueryIncompatibleOperation,
|
2285 + | ModelPl::Output
|
2286 + | >
|
2287 + | >::Output
|
2288 + | >,
|
2289 + |
|
2290 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
2291 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
2292 + |
|
2293 + | {
|
2294 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
2295 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
2296 + | let svc = crate::operation_shape::QueryIncompatibleOperation::from_service(service);
|
2297 + | let svc = self.model_plugin.apply(svc);
|
2298 + | let svc =
|
2299 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
2300 + | .apply(svc);
|
2301 + | let svc = self.http_plugin.apply(svc);
|
2302 + | self.query_incompatible_operation_custom(svc)
|
2303 + | }
|
2304 + |
|
2305 + | /// Sets the [`QueryIncompatibleOperation`](crate::operation_shape::QueryIncompatibleOperation) to a custom [`Service`](tower::Service).
|
2306 + | /// not constrained by the Smithy contract.
|
2307 + | fn query_incompatible_operation_custom<S>(mut self, svc: S) -> Self
|
2308 + | where
|
2309 + | S: ::tower::Service<
|
2310 + | ::http::Request<Body>,
|
2311 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
2312 + | Error = ::std::convert::Infallible,
|
2313 + | > + Clone
|
2314 + | + Send
|
2315 + | + 'static,
|
2316 + | S::Future: Send + 'static,
|
2317 + | {
|
2318 + | self.query_incompatible_operation =
|
2319 + | Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
2320 + | self
|
2321 + | }
|
2322 + |
|
2323 + | /// Sets the [`SimpleScalarProperties`](crate::operation_shape::SimpleScalarProperties) operation.
|
2324 + | ///
|
2325 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
2326 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
2327 + | ///
|
2328 + | /// # Example
|
2329 + | ///
|
2330 + | /// ```no_run
|
2331 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
2332 + | ///
|
2333 + | /// use json_rpc10_http0x::{input, output, error};
|
2334 + | ///
|
2335 + | /// async fn handler(input: input::SimpleScalarPropertiesInput) -> output::SimpleScalarPropertiesOutput {
|
2336 + | /// todo!()
|
2337 + | /// }
|
2338 + | ///
|
2339 + | /// let config = JsonRpc10Config::builder().build();
|
2340 + | /// let app = JsonRpc10::builder(config)
|
2341 + | /// .simple_scalar_properties(handler)
|
2342 + | /// /* Set other handlers */
|
2343 + | /// .build()
|
2344 + | /// .unwrap();
|
2345 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
2346 + | /// ```
|
2347 + | ///
|
2348 + | pub fn simple_scalar_properties<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
2349 + | where
|
2350 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::SimpleScalarProperties, HandlerExtractors>,
|
2351 + |
|
2352 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2353 + | JsonRpc10<L>,
|
2354 + | crate::operation_shape::SimpleScalarProperties,
|
2355 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::SimpleScalarProperties, HandlerType>
|
2356 + | >,
|
2357 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2358 + | JsonRpc10<L>,
|
2359 + | crate::operation_shape::SimpleScalarProperties,
|
2360 + | ModelPl::Output
|
2361 + | >,
|
2362 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2363 + | JsonRpc10<L>,
|
2364 + | crate::operation_shape::SimpleScalarProperties,
|
2365 + | <
|
2366 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
2367 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2368 + | JsonRpc10<L>,
|
2369 + | crate::operation_shape::SimpleScalarProperties,
|
2370 + | ModelPl::Output
|
2371 + | >
|
2372 + | >::Output
|
2373 + | >,
|
2374 + |
|
2375 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
2376 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
2377 + |
|
2378 + | {
|
2379 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
2380 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
2381 + | let svc = crate::operation_shape::SimpleScalarProperties::from_handler(handler);
|
2382 + | let svc = self.model_plugin.apply(svc);
|
2383 + | let svc =
|
2384 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
2385 + | .apply(svc);
|
2386 + | let svc = self.http_plugin.apply(svc);
|
2387 + | self.simple_scalar_properties_custom(svc)
|
2388 + | }
|
2389 + |
|
2390 + | /// Sets the [`SimpleScalarProperties`](crate::operation_shape::SimpleScalarProperties) operation.
|
2391 + | ///
|
2392 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
2393 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
2394 + | ///
|
2395 + | /// # Example
|
2396 + | ///
|
2397 + | /// ```no_run
|
2398 + | /// use json_rpc10_http0x::{JsonRpc10, JsonRpc10Config};
|
2399 + | ///
|
2400 + | /// use json_rpc10_http0x::{input, output, error};
|
2401 + | ///
|
2402 + | /// async fn handler(input: input::SimpleScalarPropertiesInput) -> Result<output::SimpleScalarPropertiesOutput, std::convert::Infallible> {
|
2403 + | /// todo!()
|
2404 + | /// }
|
2405 + | ///
|
2406 + | /// let config = JsonRpc10Config::builder().build();
|
2407 + | /// let svc = ::tower::util::service_fn(handler);
|
2408 + | /// let app = JsonRpc10::builder(config)
|
2409 + | /// .simple_scalar_properties_service(svc)
|
2410 + | /// /* Set other handlers */
|
2411 + | /// .build()
|
2412 + | /// .unwrap();
|
2413 + | /// # let app: JsonRpc10<::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_10::AwsJson1_0>> = app;
|
2414 + | /// ```
|
2415 + | ///
|
2416 + | pub fn simple_scalar_properties_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
2417 + | where
|
2418 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::SimpleScalarProperties, ServiceExtractors>,
|
2419 + |
|
2420 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2421 + | JsonRpc10<L>,
|
2422 + | crate::operation_shape::SimpleScalarProperties,
|
2423 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::SimpleScalarProperties, S>
|
2424 + | >,
|
2425 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2426 + | JsonRpc10<L>,
|
2427 + | crate::operation_shape::SimpleScalarProperties,
|
2428 + | ModelPl::Output
|
2429 + | >,
|
2430 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2431 + | JsonRpc10<L>,
|
2432 + | crate::operation_shape::SimpleScalarProperties,
|
2433 + | <
|
2434 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
2435 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
2436 + | JsonRpc10<L>,
|
2437 + | crate::operation_shape::SimpleScalarProperties,
|
2438 + | ModelPl::Output
|
2439 + | >
|
2440 + | >::Output
|
2441 + | >,
|
2442 + |
|
2443 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
2444 + | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
2445 + |
|
2446 + | {
|
2447 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
2448 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
2449 + | let svc = crate::operation_shape::SimpleScalarProperties::from_service(service);
|
2450 + | let svc = self.model_plugin.apply(svc);
|
2451 + | let svc =
|
2452 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
2453 + | .apply(svc);
|
2454 + | let svc = self.http_plugin.apply(svc);
|
2455 + | self.simple_scalar_properties_custom(svc)
|
2456 + | }
|
2457 + |
|
2458 + | /// Sets the [`SimpleScalarProperties`](crate::operation_shape::SimpleScalarProperties) to a custom [`Service`](tower::Service).
|
2459 + | /// not constrained by the Smithy contract.
|
2460 + | fn simple_scalar_properties_custom<S>(mut self, svc: S) -> Self
|
2461 + | where
|
2462 + | S: ::tower::Service<
|
2463 + | ::http::Request<Body>,
|
2464 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
2465 + | Error = ::std::convert::Infallible,
|
2466 + | > + Clone
|
2467 + | + Send
|
2468 + | + 'static,
|
2469 + | S::Future: Send + 'static,
|
2470 + | {
|
2471 + | self.simple_scalar_properties =
|
2472 + | Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
2473 + | self
|
2474 + | }
|
2475 + | }
|
2476 + |
|
2477 + | impl<Body, L, HttpPl, ModelPl> JsonRpc10Builder<Body, L, HttpPl, ModelPl> {
|
2478 + | /// Constructs a [`JsonRpc10`] from the arguments provided to the builder.
|
2479 + | ///
|
2480 + | /// Forgetting to register a handler for one or more operations will result in an error.
|
2481 + | ///
|
2482 + | /// Check out [`JsonRpc10Builder::build_unchecked`] if you'd prefer the service to return status code 500 when an
|
2483 + | /// unspecified route is requested.
|
2484 + | pub fn build(
|
2485 + | self,
|
2486 + | ) -> ::std::result::Result<
|
2487 + | JsonRpc10<
|
2488 + | ::aws_smithy_legacy_http_server::routing::RoutingService<
|
2489 + | ::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<
|
2490 + | L::Service,
|
2491 + | >,
|
2492 + | ::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0,
|
2493 + | >,
|
2494 + | >,
|
2495 + | MissingOperationsError,
|
2496 + | >
|
2497 + | where
|
2498 + | L: ::tower::Layer<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
2499 + | {
|
2500 + | let router = {
|
2501 + | use ::aws_smithy_legacy_http_server::operation::OperationShape;
|
2502 + | let mut missing_operation_names = std::collections::HashMap::new();
|
2503 + | if self.content_type_parameters.is_none() {
|
2504 + | missing_operation_names.insert(
|
2505 + | crate::operation_shape::ContentTypeParameters::ID,
|
2506 + | ".content_type_parameters()",
|
2507 + | );
|
2508 + | }
|
2509 + | if self.empty_input_and_empty_output.is_none() {
|
2510 + | missing_operation_names.insert(
|
2511 + | crate::operation_shape::EmptyInputAndEmptyOutput::ID,
|
2512 + | ".empty_input_and_empty_output()",
|
2513 + | );
|
2514 + | }
|
2515 + | if self.endpoint_operation.is_none() {
|
2516 + | missing_operation_names.insert(
|
2517 + | crate::operation_shape::EndpointOperation::ID,
|
2518 + | ".endpoint_operation()",
|
2519 + | );
|
2520 + | }
|
2521 + | if self.endpoint_with_host_label_operation.is_none() {
|
2522 + | missing_operation_names.insert(
|
2523 + | crate::operation_shape::EndpointWithHostLabelOperation::ID,
|
2524 + | ".endpoint_with_host_label_operation()",
|
2525 + | );
|
2526 + | }
|
2527 + | if self.greeting_with_errors.is_none() {
|
2528 + | missing_operation_names.insert(
|
2529 + | crate::operation_shape::GreetingWithErrors::ID,
|
2530 + | ".greeting_with_errors()",
|
2531 + | );
|
2532 + | }
|
2533 + | if self.host_with_path_operation.is_none() {
|
2534 + | missing_operation_names.insert(
|
2535 + | crate::operation_shape::HostWithPathOperation::ID,
|
2536 + | ".host_with_path_operation()",
|
2537 + | );
|
2538 + | }
|
2539 + | if self.json_unions.is_none() {
|
2540 + | missing_operation_names
|
2541 + | .insert(crate::operation_shape::JsonUnions::ID, ".json_unions()");
|
2542 + | }
|
2543 + | if self.no_input_and_no_output.is_none() {
|
2544 + | missing_operation_names.insert(
|
2545 + | crate::operation_shape::NoInputAndNoOutput::ID,
|
2546 + | ".no_input_and_no_output()",
|
2547 + | );
|
2548 + | }
|
2549 + | if self.no_input_and_output.is_none() {
|
2550 + | missing_operation_names.insert(
|
2551 + | crate::operation_shape::NoInputAndOutput::ID,
|
2552 + | ".no_input_and_output()",
|
2553 + | );
|
2554 + | }
|
2555 + | if self.operation_with_defaults.is_none() {
|
2556 + | missing_operation_names.insert(
|
2557 + | crate::operation_shape::OperationWithDefaults::ID,
|
2558 + | ".operation_with_defaults()",
|
2559 + | );
|
2560 + | }
|
2561 + | if self.operation_with_nested_structure.is_none() {
|
2562 + | missing_operation_names.insert(
|
2563 + | crate::operation_shape::OperationWithNestedStructure::ID,
|
2564 + | ".operation_with_nested_structure()",
|
2565 + | );
|
2566 + | }
|
2567 + | if self.operation_with_required_members.is_none() {
|
2568 + | missing_operation_names.insert(
|
2569 + | crate::operation_shape::OperationWithRequiredMembers::ID,
|
2570 + | ".operation_with_required_members()",
|
2571 + | );
|
2572 + | }
|
2573 + | if self.operation_with_required_members_with_defaults.is_none() {
|
2574 + | missing_operation_names.insert(
|
2575 + | crate::operation_shape::OperationWithRequiredMembersWithDefaults::ID,
|
2576 + | ".operation_with_required_members_with_defaults()",
|
2577 + | );
|
2578 + | }
|
2579 + | if self.put_with_content_encoding.is_none() {
|
2580 + | missing_operation_names.insert(
|
2581 + | crate::operation_shape::PutWithContentEncoding::ID,
|
2582 + | ".put_with_content_encoding()",
|
2583 + | );
|
2584 + | }
|
2585 + | if self.query_incompatible_operation.is_none() {
|
2586 + | missing_operation_names.insert(
|
2587 + | crate::operation_shape::QueryIncompatibleOperation::ID,
|
2588 + | ".query_incompatible_operation()",
|
2589 + | );
|
2590 + | }
|
2591 + | if self.simple_scalar_properties.is_none() {
|
2592 + | missing_operation_names.insert(
|
2593 + | crate::operation_shape::SimpleScalarProperties::ID,
|
2594 + | ".simple_scalar_properties()",
|
2595 + | );
|
2596 + | }
|
2597 + | if !missing_operation_names.is_empty() {
|
2598 + | return Err(MissingOperationsError {
|
2599 + | operation_names2setter_methods: missing_operation_names,
|
2600 + | });
|
2601 + | }
|
2602 + | let unexpected_error_msg = "this should never panic since we are supposed to check beforehand that a handler has been registered for this operation; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues";
|
2603 + |
|
2604 + | ::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter::from_iter([
|
2605 + | (
|
2606 + | request_specs::content_type_parameters(),
|
2607 + | self.content_type_parameters.expect(unexpected_error_msg),
|
2608 + | ),
|
2609 + | (
|
2610 + | request_specs::empty_input_and_empty_output(),
|
2611 + | self.empty_input_and_empty_output
|
2612 + | .expect(unexpected_error_msg),
|
2613 + | ),
|
2614 + | (
|
2615 + | request_specs::endpoint_operation(),
|
2616 + | self.endpoint_operation.expect(unexpected_error_msg),
|
2617 + | ),
|
2618 + | (
|
2619 + | request_specs::endpoint_with_host_label_operation(),
|
2620 + | self.endpoint_with_host_label_operation
|
2621 + | .expect(unexpected_error_msg),
|
2622 + | ),
|
2623 + | (
|
2624 + | request_specs::greeting_with_errors(),
|
2625 + | self.greeting_with_errors.expect(unexpected_error_msg),
|
2626 + | ),
|
2627 + | (
|
2628 + | request_specs::host_with_path_operation(),
|
2629 + | self.host_with_path_operation.expect(unexpected_error_msg),
|
2630 + | ),
|
2631 + | (
|
2632 + | request_specs::json_unions(),
|
2633 + | self.json_unions.expect(unexpected_error_msg),
|
2634 + | ),
|
2635 + | (
|
2636 + | request_specs::no_input_and_no_output(),
|
2637 + | self.no_input_and_no_output.expect(unexpected_error_msg),
|
2638 + | ),
|
2639 + | (
|
2640 + | request_specs::no_input_and_output(),
|
2641 + | self.no_input_and_output.expect(unexpected_error_msg),
|
2642 + | ),
|
2643 + | (
|
2644 + | request_specs::operation_with_defaults(),
|
2645 + | self.operation_with_defaults.expect(unexpected_error_msg),
|
2646 + | ),
|
2647 + | (
|
2648 + | request_specs::operation_with_nested_structure(),
|
2649 + | self.operation_with_nested_structure
|
2650 + | .expect(unexpected_error_msg),
|
2651 + | ),
|
2652 + | (
|
2653 + | request_specs::operation_with_required_members(),
|
2654 + | self.operation_with_required_members
|
2655 + | .expect(unexpected_error_msg),
|
2656 + | ),
|
2657 + | (
|
2658 + | request_specs::operation_with_required_members_with_defaults(),
|
2659 + | self.operation_with_required_members_with_defaults
|
2660 + | .expect(unexpected_error_msg),
|
2661 + | ),
|
2662 + | (
|
2663 + | request_specs::put_with_content_encoding(),
|
2664 + | self.put_with_content_encoding.expect(unexpected_error_msg),
|
2665 + | ),
|
2666 + | (
|
2667 + | request_specs::query_incompatible_operation(),
|
2668 + | self.query_incompatible_operation
|
2669 + | .expect(unexpected_error_msg),
|
2670 + | ),
|
2671 + | (
|
2672 + | request_specs::simple_scalar_properties(),
|
2673 + | self.simple_scalar_properties.expect(unexpected_error_msg),
|
2674 + | ),
|
2675 + | ])
|
2676 + | };
|
2677 + | let svc = ::aws_smithy_legacy_http_server::routing::RoutingService::new(router);
|
2678 + | let svc = svc.map(|s| s.layer(self.layer));
|
2679 + | Ok(JsonRpc10 { svc })
|
2680 + | }
|
2681 + |
|
2682 + | /// Constructs a [`JsonRpc10`] from the arguments provided to the builder.
|
2683 + | /// Operations without a handler default to returning 500 Internal Server Error to the caller.
|
2684 + | ///
|
2685 + | /// Check out [`JsonRpc10Builder::build`] if you'd prefer the builder to fail if one or more operations do
|
2686 + | /// not have a registered handler.
|
2687 + | pub fn build_unchecked(self) -> JsonRpc10<L::Service>
|
2688 + | where
|
2689 + | Body: Send + 'static,
|
2690 + | L: ::tower::Layer<
|
2691 + | ::aws_smithy_legacy_http_server::routing::RoutingService<
|
2692 + | ::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<
|
2693 + | ::aws_smithy_legacy_http_server::routing::Route<Body>,
|
2694 + | >,
|
2695 + | ::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0,
|
2696 + | >,
|
2697 + | >,
|
2698 + | {
|
2699 + | let router = ::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter::from_iter([(
|
2700 + | request_specs::content_type_parameters(),
|
2701 + | self.content_type_parameters.unwrap_or_else(|| {
|
2702 + | let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0>::default();
|
2703 + | ::aws_smithy_legacy_http_server::routing::Route::new(svc)
|
2704 + | })
|
2705 + | ),
|
2706 + | (
|
2707 + | request_specs::empty_input_and_empty_output(),
|
2708 + | self.empty_input_and_empty_output.unwrap_or_else(|| {
|
2709 + | let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0>::default();
|
2710 + | ::aws_smithy_legacy_http_server::routing::Route::new(svc)
|
2711 + | })
|
2712 + | ),
|
2713 + | (
|
2714 + | request_specs::endpoint_operation(),
|
2715 + | self.endpoint_operation.unwrap_or_else(|| {
|
2716 + | let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0>::default();
|
2717 + | ::aws_smithy_legacy_http_server::routing::Route::new(svc)
|
2718 + | })
|
2719 + | ),
|
2720 + | (
|
2721 + | request_specs::endpoint_with_host_label_operation(),
|
2722 + | self.endpoint_with_host_label_operation.unwrap_or_else(|| {
|
2723 + | let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0>::default();
|
2724 + | ::aws_smithy_legacy_http_server::routing::Route::new(svc)
|
2725 + | })
|
2726 + | ),
|
2727 + | (
|
2728 + | request_specs::greeting_with_errors(),
|
2729 + | self.greeting_with_errors.unwrap_or_else(|| {
|
2730 + | let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0>::default();
|
2731 + | ::aws_smithy_legacy_http_server::routing::Route::new(svc)
|
2732 + | })
|
2733 + | ),
|
2734 + | (
|
2735 + | request_specs::host_with_path_operation(),
|
2736 + | self.host_with_path_operation.unwrap_or_else(|| {
|
2737 + | let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0>::default();
|
2738 + | ::aws_smithy_legacy_http_server::routing::Route::new(svc)
|
2739 + | })
|
2740 + | ),
|
2741 + | (
|
2742 + | request_specs::json_unions(),
|
2743 + | self.json_unions.unwrap_or_else(|| {
|
2744 + | let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0>::default();
|
2745 + | ::aws_smithy_legacy_http_server::routing::Route::new(svc)
|
2746 + | })
|
2747 + | ),
|
2748 + | (
|
2749 + | request_specs::no_input_and_no_output(),
|
2750 + | self.no_input_and_no_output.unwrap_or_else(|| {
|
2751 + | let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0>::default();
|
2752 + | ::aws_smithy_legacy_http_server::routing::Route::new(svc)
|
2753 + | })
|
2754 + | ),
|
2755 + | (
|
2756 + | request_specs::no_input_and_output(),
|
2757 + | self.no_input_and_output.unwrap_or_else(|| {
|
2758 + | let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0>::default();
|
2759 + | ::aws_smithy_legacy_http_server::routing::Route::new(svc)
|
2760 + | })
|
2761 + | ),
|
2762 + | (
|
2763 + | request_specs::operation_with_defaults(),
|
2764 + | self.operation_with_defaults.unwrap_or_else(|| {
|
2765 + | let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0>::default();
|
2766 + | ::aws_smithy_legacy_http_server::routing::Route::new(svc)
|
2767 + | })
|
2768 + | ),
|
2769 + | (
|
2770 + | request_specs::operation_with_nested_structure(),
|
2771 + | self.operation_with_nested_structure.unwrap_or_else(|| {
|
2772 + | let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0>::default();
|
2773 + | ::aws_smithy_legacy_http_server::routing::Route::new(svc)
|
2774 + | })
|
2775 + | ),
|
2776 + | (
|
2777 + | request_specs::operation_with_required_members(),
|
2778 + | self.operation_with_required_members.unwrap_or_else(|| {
|
2779 + | let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0>::default();
|
2780 + | ::aws_smithy_legacy_http_server::routing::Route::new(svc)
|
2781 + | })
|
2782 + | ),
|
2783 + | (
|
2784 + | request_specs::operation_with_required_members_with_defaults(),
|
2785 + | self.operation_with_required_members_with_defaults.unwrap_or_else(|| {
|
2786 + | let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0>::default();
|
2787 + | ::aws_smithy_legacy_http_server::routing::Route::new(svc)
|
2788 + | })
|
2789 + | ),
|
2790 + | (
|
2791 + | request_specs::put_with_content_encoding(),
|
2792 + | self.put_with_content_encoding.unwrap_or_else(|| {
|
2793 + | let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0>::default();
|
2794 + | ::aws_smithy_legacy_http_server::routing::Route::new(svc)
|
2795 + | })
|
2796 + | ),
|
2797 + | (
|
2798 + | request_specs::query_incompatible_operation(),
|
2799 + | self.query_incompatible_operation.unwrap_or_else(|| {
|
2800 + | let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0>::default();
|
2801 + | ::aws_smithy_legacy_http_server::routing::Route::new(svc)
|
2802 + | })
|
2803 + | ),
|
2804 + | (
|
2805 + | request_specs::simple_scalar_properties(),
|
2806 + | self.simple_scalar_properties.unwrap_or_else(|| {
|
2807 + | let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0>::default();
|
2808 + | ::aws_smithy_legacy_http_server::routing::Route::new(svc)
|
2809 + | })
|
2810 + | ),]);
|
2811 + | let svc = self
|
2812 + | .layer
|
2813 + | .layer(::aws_smithy_legacy_http_server::routing::RoutingService::new(router));
|
2814 + | JsonRpc10 { svc }
|
2815 + | }
|
2816 + | }
|
2817 + |
|
2818 + | /// The error encountered when calling the [`JsonRpc10Builder::build`] method if one or more operation handlers are not
|
2819 + | /// specified.
|
2820 + | #[derive(Debug)]
|
2821 + | pub struct MissingOperationsError {
|
2822 + | operation_names2setter_methods:
|
2823 + | std::collections::HashMap<::aws_smithy_legacy_http_server::shape_id::ShapeId, &'static str>,
|
2824 + | }
|
2825 + |
|
2826 + | impl std::fmt::Display for MissingOperationsError {
|
2827 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2828 + | write!(
|
2829 + | f,
|
2830 + | "You must specify a handler for all operations attached to `JsonRpc10`.\n\
|
2831 + | We are missing handlers for the following operations:\n",
|
2832 + | )?;
|
2833 + | for operation_name in self.operation_names2setter_methods.keys() {
|
2834 + | writeln!(f, "- {}", operation_name.absolute())?;
|
2835 + | }
|
2836 + |
|
2837 + | writeln!(
|
2838 + | f,
|
2839 + | "\nUse the dedicated methods on `JsonRpc10Builder` to register the missing handlers:"
|
2840 + | )?;
|
2841 + | for setter_name in self.operation_names2setter_methods.values() {
|
2842 + | writeln!(f, "- {}", setter_name)?;
|
2843 + | }
|
2844 + | Ok(())
|
2845 + | }
|
2846 + | }
|
2847 + |
|
2848 + | impl std::error::Error for MissingOperationsError {}
|
2849 + |
|
2850 + | mod request_specs {
|
2851 + | pub(super) fn content_type_parameters() -> &'static str {
|
2852 + | "JsonRpc10.ContentTypeParameters"
|
2853 + | }
|
2854 + | pub(super) fn empty_input_and_empty_output() -> &'static str {
|
2855 + | "JsonRpc10.EmptyInputAndEmptyOutput"
|
2856 + | }
|
2857 + | pub(super) fn endpoint_operation() -> &'static str {
|
2858 + | "JsonRpc10.EndpointOperation"
|
2859 + | }
|
2860 + | pub(super) fn endpoint_with_host_label_operation() -> &'static str {
|
2861 + | "JsonRpc10.EndpointWithHostLabelOperation"
|
2862 + | }
|
2863 + | pub(super) fn greeting_with_errors() -> &'static str {
|
2864 + | "JsonRpc10.GreetingWithErrors"
|
2865 + | }
|
2866 + | pub(super) fn host_with_path_operation() -> &'static str {
|
2867 + | "JsonRpc10.HostWithPathOperation"
|
2868 + | }
|
2869 + | pub(super) fn json_unions() -> &'static str {
|
2870 + | "JsonRpc10.JsonUnions"
|
2871 + | }
|
2872 + | pub(super) fn no_input_and_no_output() -> &'static str {
|
2873 + | "JsonRpc10.NoInputAndNoOutput"
|
2874 + | }
|
2875 + | pub(super) fn no_input_and_output() -> &'static str {
|
2876 + | "JsonRpc10.NoInputAndOutput"
|
2877 + | }
|
2878 + | pub(super) fn operation_with_defaults() -> &'static str {
|
2879 + | "JsonRpc10.OperationWithDefaults"
|
2880 + | }
|
2881 + | pub(super) fn operation_with_nested_structure() -> &'static str {
|
2882 + | "JsonRpc10.OperationWithNestedStructure"
|
2883 + | }
|
2884 + | pub(super) fn operation_with_required_members() -> &'static str {
|
2885 + | "JsonRpc10.OperationWithRequiredMembers"
|
2886 + | }
|
2887 + | pub(super) fn operation_with_required_members_with_defaults() -> &'static str {
|
2888 + | "JsonRpc10.OperationWithRequiredMembersWithDefaults"
|
2889 + | }
|
2890 + | pub(super) fn put_with_content_encoding() -> &'static str {
|
2891 + | "JsonRpc10.PutWithContentEncoding"
|
2892 + | }
|
2893 + | pub(super) fn query_incompatible_operation() -> &'static str {
|
2894 + | "JsonRpc10.QueryIncompatibleOperation"
|
2895 + | }
|
2896 + | pub(super) fn simple_scalar_properties() -> &'static str {
|
2897 + | "JsonRpc10.SimpleScalarProperties"
|
2898 + | }
|
2899 + | }
|
2900 + |
|
2901 + | #[allow(missing_docs)] // documentation missing in model
|
2902 + | ///
|
2903 + | /// See the [root](crate) documentation for more information.
|
2904 + | #[derive(Clone)]
|
2905 + | pub struct JsonRpc10<
|
2906 + | S = ::aws_smithy_legacy_http_server::routing::RoutingService<
|
2907 + | ::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<
|
2908 + | ::aws_smithy_legacy_http_server::routing::Route<
|
2909 + | ::aws_smithy_legacy_http_server::body::BoxBody,
|
2910 + | >,
|
2911 + | >,
|
2912 + | ::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0,
|
2913 + | >,
|
2914 + | > {
|
2915 + | // This is the router wrapped by layers.
|
2916 + | svc: S,
|
2917 + | }
|
2918 + |
|
2919 + | impl JsonRpc10<()> {
|
2920 + | /// Constructs a builder for [`JsonRpc10`].
|
2921 + | /// You must specify a configuration object holding any plugins and layers that should be applied
|
2922 + | /// to the operations in this service.
|
2923 + | pub fn builder<
|
2924 + | Body,
|
2925 + | L,
|
2926 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::HttpMarker,
|
2927 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::ModelMarker,
|
2928 + | >(
|
2929 + | config: JsonRpc10Config<L, HttpPl, ModelPl>,
|
2930 + | ) -> JsonRpc10Builder<Body, L, HttpPl, ModelPl> {
|
2931 + | JsonRpc10Builder {
|
2932 + | content_type_parameters: None,
|
2933 + | empty_input_and_empty_output: None,
|
2934 + | endpoint_operation: None,
|
2935 + | endpoint_with_host_label_operation: None,
|
2936 + | greeting_with_errors: None,
|
2937 + | host_with_path_operation: None,
|
2938 + | json_unions: None,
|
2939 + | no_input_and_no_output: None,
|
2940 + | no_input_and_output: None,
|
2941 + | operation_with_defaults: None,
|
2942 + | operation_with_nested_structure: None,
|
2943 + | operation_with_required_members: None,
|
2944 + | operation_with_required_members_with_defaults: None,
|
2945 + | put_with_content_encoding: None,
|
2946 + | query_incompatible_operation: None,
|
2947 + | simple_scalar_properties: None,
|
2948 + | layer: config.layers,
|
2949 + | http_plugin: config.http_plugins,
|
2950 + | model_plugin: config.model_plugins,
|
2951 + | }
|
2952 + | }
|
2953 + |
|
2954 + | /// Constructs a builder for [`JsonRpc10`].
|
2955 + | /// You must specify what plugins should be applied to the operations in this service.
|
2956 + | ///
|
2957 + | /// Use [`JsonRpc10::builder_without_plugins`] if you don't need to apply plugins.
|
2958 + | ///
|
2959 + | /// Check out [`HttpPlugins`](::aws_smithy_legacy_http_server::plugin::HttpPlugins) and
|
2960 + | /// [`ModelPlugins`](::aws_smithy_legacy_http_server::plugin::ModelPlugins) if you need to apply
|
2961 + | /// multiple plugins.
|
2962 + | #[deprecated(
|
2963 + | since = "0.57.0",
|
2964 + | note = "please use the `builder` constructor and register plugins on the `JsonRpc10Config` object instead; see https://github.com/smithy-lang/smithy-rs/discussions/3096"
|
2965 + | )]
|
2966 + | pub fn builder_with_plugins<
|
2967 + | Body,
|
2968 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::HttpMarker,
|
2969 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::ModelMarker,
|
2970 + | >(
|
2971 + | http_plugin: HttpPl,
|
2972 + | model_plugin: ModelPl,
|
2973 + | ) -> JsonRpc10Builder<Body, ::tower::layer::util::Identity, HttpPl, ModelPl> {
|
2974 + | JsonRpc10Builder {
|
2975 + | content_type_parameters: None,
|
2976 + | empty_input_and_empty_output: None,
|
2977 + | endpoint_operation: None,
|
2978 + | endpoint_with_host_label_operation: None,
|
2979 + | greeting_with_errors: None,
|
2980 + | host_with_path_operation: None,
|
2981 + | json_unions: None,
|
2982 + | no_input_and_no_output: None,
|
2983 + | no_input_and_output: None,
|
2984 + | operation_with_defaults: None,
|
2985 + | operation_with_nested_structure: None,
|
2986 + | operation_with_required_members: None,
|
2987 + | operation_with_required_members_with_defaults: None,
|
2988 + | put_with_content_encoding: None,
|
2989 + | query_incompatible_operation: None,
|
2990 + | simple_scalar_properties: None,
|
2991 + | layer: ::tower::layer::util::Identity::new(),
|
2992 + | http_plugin,
|
2993 + | model_plugin,
|
2994 + | }
|
2995 + | }
|
2996 + |
|
2997 + | /// Constructs a builder for [`JsonRpc10`].
|
2998 + | ///
|
2999 + | /// Use [`JsonRpc10::builder_with_plugins`] if you need to specify plugins.
|
3000 + | #[deprecated(
|
3001 + | since = "0.57.0",
|
3002 + | note = "please use the `builder` constructor instead; see https://github.com/smithy-lang/smithy-rs/discussions/3096"
|
3003 + | )]
|
3004 + | pub fn builder_without_plugins<Body>() -> JsonRpc10Builder<
|
3005 + | Body,
|
3006 + | ::tower::layer::util::Identity,
|
3007 + | ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
|
3008 + | ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
|
3009 + | > {
|
3010 + | Self::builder_with_plugins(
|
3011 + | ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
|
3012 + | ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
|
3013 + | )
|
3014 + | }
|
3015 + | }
|
3016 + |
|
3017 + | impl<S> JsonRpc10<S> {
|
3018 + | /// Converts [`JsonRpc10`] into a [`MakeService`](tower::make::MakeService).
|
3019 + | pub fn into_make_service(
|
3020 + | self,
|
3021 + | ) -> ::aws_smithy_legacy_http_server::routing::IntoMakeService<Self> {
|
3022 + | ::aws_smithy_legacy_http_server::routing::IntoMakeService::new(self)
|
3023 + | }
|
3024 + |
|
3025 + | /// Converts [`JsonRpc10`] into a [`MakeService`](tower::make::MakeService) with [`ConnectInfo`](::aws_smithy_legacy_http_server::request::connect_info::ConnectInfo).
|
3026 + | pub fn into_make_service_with_connect_info<C>(
|
3027 + | self,
|
3028 + | ) -> ::aws_smithy_legacy_http_server::routing::IntoMakeServiceWithConnectInfo<Self, C> {
|
3029 + | ::aws_smithy_legacy_http_server::routing::IntoMakeServiceWithConnectInfo::new(self)
|
3030 + | }
|
3031 + | }
|
3032 + |
|
3033 + | impl<S>
|
3034 + | JsonRpc10<
|
3035 + | ::aws_smithy_legacy_http_server::routing::RoutingService<
|
3036 + | ::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<S>,
|
3037 + | ::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0,
|
3038 + | >,
|
3039 + | >
|
3040 + | {
|
3041 + | /// Applies a [`Layer`](::tower::Layer) uniformly to all routes.
|
3042 + | #[deprecated(
|
3043 + | since = "0.57.0",
|
3044 + | note = "please add layers to the `JsonRpc10Config` object instead; see https://github.com/smithy-lang/smithy-rs/discussions/3096"
|
3045 + | )]
|
3046 + | pub fn layer<L>(
|
3047 + | self,
|
3048 + | layer: &L,
|
3049 + | ) -> JsonRpc10<
|
3050 + | ::aws_smithy_legacy_http_server::routing::RoutingService<
|
3051 + | ::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<L::Service>,
|
3052 + | ::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0,
|
3053 + | >,
|
3054 + | >
|
3055 + | where
|
3056 + | L: ::tower::Layer<S>,
|
3057 + | {
|
3058 + | JsonRpc10 {
|
3059 + | svc: self.svc.map(|s| s.layer(layer)),
|
3060 + | }
|
3061 + | }
|
3062 + |
|
3063 + | /// Applies [`Route::new`](::aws_smithy_legacy_http_server::routing::Route::new) to all routes.
|
3064 + | ///
|
3065 + | /// This has the effect of erasing all types accumulated via layers.
|
3066 + | pub fn boxed<B>(
|
3067 + | self,
|
3068 + | ) -> JsonRpc10<
|
3069 + | ::aws_smithy_legacy_http_server::routing::RoutingService<
|
3070 + | ::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<
|
3071 + | ::aws_smithy_legacy_http_server::routing::Route<B>,
|
3072 + | >,
|
3073 + | ::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0,
|
3074 + | >,
|
3075 + | >
|
3076 + | where
|
3077 + | S: ::tower::Service<
|
3078 + | ::http::Request<B>,
|
3079 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
3080 + | Error = std::convert::Infallible,
|
3081 + | >,
|
3082 + | S: Clone + Send + 'static,
|
3083 + | S::Future: Send + 'static,
|
3084 + | {
|
3085 + | self.layer(&::tower::layer::layer_fn(
|
3086 + | ::aws_smithy_legacy_http_server::routing::Route::new,
|
3087 + | ))
|
3088 + | }
|
3089 + | }
|
3090 + |
|
3091 + | impl<S, R> ::tower::Service<R> for JsonRpc10<S>
|
3092 + | where
|
3093 + | S: ::tower::Service<R>,
|
3094 + | {
|
3095 + | type Response = S::Response;
|
3096 + | type Error = S::Error;
|
3097 + | type Future = S::Future;
|
3098 + |
|
3099 + | fn poll_ready(
|
3100 + | &mut self,
|
3101 + | cx: &mut std::task::Context,
|
3102 + | ) -> std::task::Poll<::std::result::Result<(), Self::Error>> {
|
3103 + | self.svc.poll_ready(cx)
|
3104 + | }
|
3105 + |
|
3106 + | fn call(&mut self, request: R) -> Self::Future {
|
3107 + | self.svc.call(request)
|
3108 + | }
|
3109 + | }
|
3110 + |
|
3111 + | /// An enumeration of all [operations](https://smithy.io/2.0/spec/service-types.html#operation) in JsonRpc10.
|
3112 + | #[allow(clippy::enum_variant_names)]
|
3113 + | #[derive(Debug, PartialEq, Eq, Clone, Copy)]
|
3114 + | pub enum Operation {
|
3115 + | ContentTypeParameters,
|
3116 + | EmptyInputAndEmptyOutput,
|
3117 + | EndpointOperation,
|
3118 + | EndpointWithHostLabelOperation,
|
3119 + | GreetingWithErrors,
|
3120 + | HostWithPathOperation,
|
3121 + | JsonUnions,
|
3122 + | NoInputAndNoOutput,
|
3123 + | NoInputAndOutput,
|
3124 + | OperationWithDefaults,
|
3125 + | OperationWithNestedStructure,
|
3126 + | OperationWithRequiredMembers,
|
3127 + | OperationWithRequiredMembersWithDefaults,
|
3128 + | PutWithContentEncoding,
|
3129 + | QueryIncompatibleOperation,
|
3130 + | SimpleScalarProperties,
|
3131 + | }
|
3132 + |
|
3133 + | impl Operation {
|
3134 + | /// Returns the [operations](https://smithy.io/2.0/spec/service-types.html#operation) [`ShapeId`](::aws_smithy_legacy_http_server::shape_id::ShapeId).
|
3135 + | pub fn shape_id(&self) -> ::aws_smithy_legacy_http_server::shape_id::ShapeId {
|
3136 + | match self {
|
3137 + | Operation::ContentTypeParameters => {
|
3138 + | ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
3139 + | "aws.protocoltests.json10#ContentTypeParameters",
|
3140 + | "aws.protocoltests.json10",
|
3141 + | "ContentTypeParameters",
|
3142 + | )
|
3143 + | }
|
3144 + | Operation::EmptyInputAndEmptyOutput => {
|
3145 + | ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
3146 + | "aws.protocoltests.json10#EmptyInputAndEmptyOutput",
|
3147 + | "aws.protocoltests.json10",
|
3148 + | "EmptyInputAndEmptyOutput",
|
3149 + | )
|
3150 + | }
|
3151 + | Operation::EndpointOperation => {
|
3152 + | ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
3153 + | "aws.protocoltests.json10#EndpointOperation",
|
3154 + | "aws.protocoltests.json10",
|
3155 + | "EndpointOperation",
|
3156 + | )
|
3157 + | }
|
3158 + | Operation::EndpointWithHostLabelOperation => {
|
3159 + | ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
3160 + | "aws.protocoltests.json10#EndpointWithHostLabelOperation",
|
3161 + | "aws.protocoltests.json10",
|
3162 + | "EndpointWithHostLabelOperation",
|
3163 + | )
|
3164 + | }
|
3165 + | Operation::GreetingWithErrors => {
|
3166 + | ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
3167 + | "aws.protocoltests.json10#GreetingWithErrors",
|
3168 + | "aws.protocoltests.json10",
|
3169 + | "GreetingWithErrors",
|
3170 + | )
|
3171 + | }
|
3172 + | Operation::HostWithPathOperation => {
|
3173 + | ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
3174 + | "aws.protocoltests.json10#HostWithPathOperation",
|
3175 + | "aws.protocoltests.json10",
|
3176 + | "HostWithPathOperation",
|
3177 + | )
|
3178 + | }
|
3179 + | Operation::JsonUnions => ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
3180 + | "aws.protocoltests.json10#JsonUnions",
|
3181 + | "aws.protocoltests.json10",
|
3182 + | "JsonUnions",
|
3183 + | ),
|
3184 + | Operation::NoInputAndNoOutput => {
|
3185 + | ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
3186 + | "aws.protocoltests.json10#NoInputAndNoOutput",
|
3187 + | "aws.protocoltests.json10",
|
3188 + | "NoInputAndNoOutput",
|
3189 + | )
|
3190 + | }
|
3191 + | Operation::NoInputAndOutput => ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
3192 + | "aws.protocoltests.json10#NoInputAndOutput",
|
3193 + | "aws.protocoltests.json10",
|
3194 + | "NoInputAndOutput",
|
3195 + | ),
|
3196 + | Operation::OperationWithDefaults => {
|
3197 + | ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
3198 + | "aws.protocoltests.json10#OperationWithDefaults",
|
3199 + | "aws.protocoltests.json10",
|
3200 + | "OperationWithDefaults",
|
3201 + | )
|
3202 + | }
|
3203 + | Operation::OperationWithNestedStructure => {
|
3204 + | ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
3205 + | "aws.protocoltests.json10#OperationWithNestedStructure",
|
3206 + | "aws.protocoltests.json10",
|
3207 + | "OperationWithNestedStructure",
|
3208 + | )
|
3209 + | }
|
3210 + | Operation::OperationWithRequiredMembers => {
|
3211 + | ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
3212 + | "aws.protocoltests.json10#OperationWithRequiredMembers",
|
3213 + | "aws.protocoltests.json10",
|
3214 + | "OperationWithRequiredMembers",
|
3215 + | )
|
3216 + | }
|
3217 + | Operation::OperationWithRequiredMembersWithDefaults => {
|
3218 + | ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
3219 + | "aws.protocoltests.json10#OperationWithRequiredMembersWithDefaults",
|
3220 + | "aws.protocoltests.json10",
|
3221 + | "OperationWithRequiredMembersWithDefaults",
|
3222 + | )
|
3223 + | }
|
3224 + | Operation::PutWithContentEncoding => {
|
3225 + | ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
3226 + | "aws.protocoltests.json10#PutWithContentEncoding",
|
3227 + | "aws.protocoltests.json10",
|
3228 + | "PutWithContentEncoding",
|
3229 + | )
|
3230 + | }
|
3231 + | Operation::QueryIncompatibleOperation => {
|
3232 + | ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
3233 + | "aws.protocoltests.json10#QueryIncompatibleOperation",
|
3234 + | "aws.protocoltests.json10",
|
3235 + | "QueryIncompatibleOperation",
|
3236 + | )
|
3237 + | }
|
3238 + | Operation::SimpleScalarProperties => {
|
3239 + | ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
3240 + | "aws.protocoltests.json10#SimpleScalarProperties",
|
3241 + | "aws.protocoltests.json10",
|
3242 + | "SimpleScalarProperties",
|
3243 + | )
|
3244 + | }
|
3245 + | }
|
3246 + | }
|
3247 + | }
|
3248 + | impl<L>
|
3249 + | ::aws_smithy_legacy_http_server::service::ContainsOperation<
|
3250 + | crate::operation_shape::ContentTypeParameters,
|
3251 + | > for JsonRpc10<L>
|
3252 + | {
|
3253 + | const VALUE: Operation = Operation::ContentTypeParameters;
|
3254 + | }
|
3255 + | impl<L>
|
3256 + | ::aws_smithy_legacy_http_server::service::ContainsOperation<
|
3257 + | crate::operation_shape::EmptyInputAndEmptyOutput,
|
3258 + | > for JsonRpc10<L>
|
3259 + | {
|
3260 + | const VALUE: Operation = Operation::EmptyInputAndEmptyOutput;
|
3261 + | }
|
3262 + | impl<L>
|
3263 + | ::aws_smithy_legacy_http_server::service::ContainsOperation<
|
3264 + | crate::operation_shape::EndpointOperation,
|
3265 + | > for JsonRpc10<L>
|
3266 + | {
|
3267 + | const VALUE: Operation = Operation::EndpointOperation;
|
3268 + | }
|
3269 + | impl<L>
|
3270 + | ::aws_smithy_legacy_http_server::service::ContainsOperation<
|
3271 + | crate::operation_shape::EndpointWithHostLabelOperation,
|
3272 + | > for JsonRpc10<L>
|
3273 + | {
|
3274 + | const VALUE: Operation = Operation::EndpointWithHostLabelOperation;
|
3275 + | }
|
3276 + | impl<L>
|
3277 + | ::aws_smithy_legacy_http_server::service::ContainsOperation<
|
3278 + | crate::operation_shape::GreetingWithErrors,
|
3279 + | > for JsonRpc10<L>
|
3280 + | {
|
3281 + | const VALUE: Operation = Operation::GreetingWithErrors;
|
3282 + | }
|
3283 + | impl<L>
|
3284 + | ::aws_smithy_legacy_http_server::service::ContainsOperation<
|
3285 + | crate::operation_shape::HostWithPathOperation,
|
3286 + | > for JsonRpc10<L>
|
3287 + | {
|
3288 + | const VALUE: Operation = Operation::HostWithPathOperation;
|
3289 + | }
|
3290 + | impl<L>
|
3291 + | ::aws_smithy_legacy_http_server::service::ContainsOperation<crate::operation_shape::JsonUnions>
|
3292 + | for JsonRpc10<L>
|
3293 + | {
|
3294 + | const VALUE: Operation = Operation::JsonUnions;
|
3295 + | }
|
3296 + | impl<L>
|
3297 + | ::aws_smithy_legacy_http_server::service::ContainsOperation<
|
3298 + | crate::operation_shape::NoInputAndNoOutput,
|
3299 + | > for JsonRpc10<L>
|
3300 + | {
|
3301 + | const VALUE: Operation = Operation::NoInputAndNoOutput;
|
3302 + | }
|
3303 + | impl<L>
|
3304 + | ::aws_smithy_legacy_http_server::service::ContainsOperation<
|
3305 + | crate::operation_shape::NoInputAndOutput,
|
3306 + | > for JsonRpc10<L>
|
3307 + | {
|
3308 + | const VALUE: Operation = Operation::NoInputAndOutput;
|
3309 + | }
|
3310 + | impl<L>
|
3311 + | ::aws_smithy_legacy_http_server::service::ContainsOperation<
|
3312 + | crate::operation_shape::OperationWithDefaults,
|
3313 + | > for JsonRpc10<L>
|
3314 + | {
|
3315 + | const VALUE: Operation = Operation::OperationWithDefaults;
|
3316 + | }
|
3317 + | impl<L>
|
3318 + | ::aws_smithy_legacy_http_server::service::ContainsOperation<
|
3319 + | crate::operation_shape::OperationWithNestedStructure,
|
3320 + | > for JsonRpc10<L>
|
3321 + | {
|
3322 + | const VALUE: Operation = Operation::OperationWithNestedStructure;
|
3323 + | }
|
3324 + | impl<L>
|
3325 + | ::aws_smithy_legacy_http_server::service::ContainsOperation<
|
3326 + | crate::operation_shape::OperationWithRequiredMembers,
|
3327 + | > for JsonRpc10<L>
|
3328 + | {
|
3329 + | const VALUE: Operation = Operation::OperationWithRequiredMembers;
|
3330 + | }
|
3331 + | impl<L>
|
3332 + | ::aws_smithy_legacy_http_server::service::ContainsOperation<
|
3333 + | crate::operation_shape::OperationWithRequiredMembersWithDefaults,
|
3334 + | > for JsonRpc10<L>
|
3335 + | {
|
3336 + | const VALUE: Operation = Operation::OperationWithRequiredMembersWithDefaults;
|
3337 + | }
|
3338 + | impl<L>
|
3339 + | ::aws_smithy_legacy_http_server::service::ContainsOperation<
|
3340 + | crate::operation_shape::PutWithContentEncoding,
|
3341 + | > for JsonRpc10<L>
|
3342 + | {
|
3343 + | const VALUE: Operation = Operation::PutWithContentEncoding;
|
3344 + | }
|
3345 + | impl<L>
|
3346 + | ::aws_smithy_legacy_http_server::service::ContainsOperation<
|
3347 + | crate::operation_shape::QueryIncompatibleOperation,
|
3348 + | > for JsonRpc10<L>
|
3349 + | {
|
3350 + | const VALUE: Operation = Operation::QueryIncompatibleOperation;
|
3351 + | }
|
3352 + | impl<L>
|
3353 + | ::aws_smithy_legacy_http_server::service::ContainsOperation<
|
3354 + | crate::operation_shape::SimpleScalarProperties,
|
3355 + | > for JsonRpc10<L>
|
3356 + | {
|
3357 + | const VALUE: Operation = Operation::SimpleScalarProperties;
|
3358 + | }
|
3359 + |
|
3360 + | impl<S> ::aws_smithy_legacy_http_server::service::ServiceShape for JsonRpc10<S> {
|
3361 + | const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
|
3362 + | ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
3363 + | "aws.protocoltests.json10#JsonRpc10",
|
3364 + | "aws.protocoltests.json10",
|
3365 + | "JsonRpc10",
|
3366 + | );
|
3367 + |
|
3368 + | const VERSION: Option<&'static str> = Some("2020-07-14");
|
3369 + |
|
3370 + | type Protocol = ::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0;
|
3371 + |
|
3372 + | type Operations = Operation;
|
3373 + | }
|
3374 + | /// Configuration for the [`JsonRpc10`]. This is the central place where to register and
|
3375 + | /// configure [`::tower::Layer`]s, HTTP plugins, and model plugins.
|
3376 + | ///
|
3377 + | /// ```rust,no_run
|
3378 + | /// # use json_rpc10_http0x::JsonRpc10Config;
|
3379 + | /// # use ::aws_smithy_legacy_http_server::plugin::IdentityPlugin;
|
3380 + | /// # use ::tower::layer::util::Identity;
|
3381 + | /// # let authentication_plugin = IdentityPlugin;
|
3382 + | /// # let authorization_plugin = IdentityPlugin;
|
3383 + | /// # let server_request_id_provider_layer = Identity::new();
|
3384 + | /// let config = JsonRpc10Config::builder()
|
3385 + | /// // Layers get executed first...
|
3386 + | /// .layer(server_request_id_provider_layer)
|
3387 + | /// // ...then HTTP plugins...
|
3388 + | /// .http_plugin(authentication_plugin)
|
3389 + | /// // ...and right after deserialization, model plugins.
|
3390 + | /// .model_plugin(authorization_plugin)
|
3391 + | /// .build();
|
3392 + | /// ```
|
3393 + | ///
|
3394 + | /// See the [`plugin`] system for details.
|
3395 + | ///
|
3396 + | /// [`plugin`]: ::aws_smithy_legacy_http_server::plugin
|
3397 + | #[derive(::std::fmt::Debug)]
|
3398 + | pub struct JsonRpc10Config<L, H, M> {
|
3399 + | layers: L,
|
3400 + | http_plugins: H,
|
3401 + | model_plugins: M,
|
3402 + | }
|
3403 + |
|
3404 + | impl JsonRpc10Config<(), (), ()> {
|
3405 + | /// Returns a builder to construct the configuration.
|
3406 + | pub fn builder() -> JsonRpc10ConfigBuilder<
|
3407 + | ::tower::layer::util::Identity,
|
3408 + | ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
|
3409 + | ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
|
3410 + | > {
|
3411 + | JsonRpc10ConfigBuilder {
|
3412 + | layers: ::tower::layer::util::Identity::new(),
|
3413 + | http_plugins: ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
|
3414 + | model_plugins: ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
|
3415 + | }
|
3416 + | }
|
3417 + | }
|
3418 + |
|
3419 + | /// Builder returned by [`JsonRpc10Config::builder()`].
|
3420 + | #[derive(::std::fmt::Debug)]
|
3421 + | pub struct JsonRpc10ConfigBuilder<L, H, M> {
|
3422 + | pub(crate) layers: L,
|
3423 + | pub(crate) http_plugins: H,
|
3424 + | pub(crate) model_plugins: M,
|
3425 + | }
|
3426 + |
|
3427 + | impl<L, H, M> JsonRpc10ConfigBuilder<L, H, M> {
|
3428 + | /// Add a [`::tower::Layer`] to the service.
|
3429 + | pub fn layer<NewLayer>(
|
3430 + | self,
|
3431 + | layer: NewLayer,
|
3432 + | ) -> JsonRpc10ConfigBuilder<::tower::layer::util::Stack<NewLayer, L>, H, M> {
|
3433 + | JsonRpc10ConfigBuilder {
|
3434 + | layers: ::tower::layer::util::Stack::new(layer, self.layers),
|
3435 + | http_plugins: self.http_plugins,
|
3436 + | model_plugins: self.model_plugins,
|
3437 + | }
|
3438 + | }
|
3439 + |
|
3440 + | /// Add a HTTP [plugin] to the service.
|
3441 + | ///
|
3442 + | /// [plugin]: ::aws_smithy_legacy_http_server::plugin
|
3443 + | // We eagerly require `NewPlugin: HttpMarker`, despite not really needing it, because compiler
|
3444 + | // errors get _substantially_ better if the user makes a mistake.
|
3445 + | pub fn http_plugin<NewPlugin: ::aws_smithy_legacy_http_server::plugin::HttpMarker>(
|
3446 + | self,
|
3447 + | http_plugin: NewPlugin,
|
3448 + | ) -> JsonRpc10ConfigBuilder<
|
3449 + | L,
|
3450 + | ::aws_smithy_legacy_http_server::plugin::PluginStack<NewPlugin, H>,
|
3451 + | M,
|
3452 + | > {
|
3453 + | JsonRpc10ConfigBuilder {
|
3454 + | layers: self.layers,
|
3455 + | http_plugins: ::aws_smithy_legacy_http_server::plugin::PluginStack::new(
|
3456 + | http_plugin,
|
3457 + | self.http_plugins,
|
3458 + | ),
|
3459 + | model_plugins: self.model_plugins,
|
3460 + | }
|
3461 + | }
|
3462 + |
|
3463 + | /// Add a model [plugin] to the service.
|
3464 + | ///
|
3465 + | /// [plugin]: ::aws_smithy_legacy_http_server::plugin
|
3466 + | // We eagerly require `NewPlugin: ModelMarker`, despite not really needing it, because compiler
|
3467 + | // errors get _substantially_ better if the user makes a mistake.
|
3468 + | pub fn model_plugin<NewPlugin: ::aws_smithy_legacy_http_server::plugin::ModelMarker>(
|
3469 + | self,
|
3470 + | model_plugin: NewPlugin,
|
3471 + | ) -> JsonRpc10ConfigBuilder<
|
3472 + | L,
|
3473 + | H,
|
3474 + | ::aws_smithy_legacy_http_server::plugin::PluginStack<NewPlugin, M>,
|
3475 + | > {
|
3476 + | JsonRpc10ConfigBuilder {
|
3477 + | layers: self.layers,
|
3478 + | http_plugins: self.http_plugins,
|
3479 + | model_plugins: ::aws_smithy_legacy_http_server::plugin::PluginStack::new(
|
3480 + | model_plugin,
|
3481 + | self.model_plugins,
|
3482 + | ),
|
3483 + | }
|
3484 + | }
|
3485 + |
|
3486 + | /// Build the configuration.
|
3487 + | pub fn build(self) -> super::JsonRpc10Config<L, H, M> {
|
3488 + | super::JsonRpc10Config {
|
3489 + | layers: self.layers,
|
3490 + | http_plugins: self.http_plugins,
|
3491 + | model_plugins: self.model_plugins,
|
3492 + | }
|
3493 + | }
|
3494 + | }
|
3495 + | /// A macro to help with scoping [plugins](crate::server::plugin) to a subset of all operations.
|
3496 + | ///
|
3497 + | /// In contrast to [`crate::server::scope`](crate::server::scope), this macro has knowledge
|
3498 + | /// of the service and any operations _not_ specified will be placed in the opposing group.
|
3499 + | ///
|
3500 + | /// # Example
|
3501 + | ///
|
3502 + | /// ```rust
|
3503 + | /// scope! {
|
3504 + | /// /// Includes [`ContentTypeParameters`], excluding all other operations.
|
3505 + | /// struct ScopeA {
|
3506 + | /// includes: [ContentTypeParameters]
|
3507 + | /// }
|
3508 + | /// }
|
3509 + | ///
|
3510 + | /// scope! {
|
3511 + | /// /// Excludes [`ContentTypeParameters`], excluding all other operations.
|
3512 + | /// struct ScopeB {
|
3513 + | /// excludes: [ContentTypeParameters]
|
3514 + | /// }
|
3515 + | /// }
|
3516 + | ///
|
3517 + | /// # use json_rpc10_http0x::server::plugin::{Plugin, Scoped};
|
3518 + | /// # use json_rpc10_http0x::scope;
|
3519 + | /// # struct MockPlugin;
|
3520 + | /// # impl<S, Op, T> Plugin<S, Op, T> for MockPlugin { type Output = u32; fn apply(&self, input: T) -> u32 { 3 } }
|
3521 + | /// # let scoped_a = Scoped::new::<ScopeA>(MockPlugin);
|
3522 + | /// # let scoped_b = Scoped::new::<ScopeB>(MockPlugin);
|
3523 + | /// # let a = Plugin::<(), json_rpc10_http0x::operation_shape::ContentTypeParameters, u64>::apply(&scoped_a, 6);
|
3524 + | /// # let b = Plugin::<(), json_rpc10_http0x::operation_shape::ContentTypeParameters, u64>::apply(&scoped_b, 6);
|
3525 + | /// # assert_eq!(a, 3_u32);
|
3526 + | /// # assert_eq!(b, 6_u64);
|
3527 + | /// ```
|
3528 + | #[macro_export]
|
3529 + | macro_rules! scope {
|
3530 + | // Completed, render impls
|
3531 + | (@ $ name: ident, $ contains: ident () ($($ temp: ident)*) ($($ not_member: ident)*)) => {
|
3532 + | $(
|
3533 + | impl $ crate::server::plugin::scoped::Membership<$ temp> for $ name {
|
3534 + | type Contains = $ crate::server::plugin::scoped::$ contains;
|
3535 + | }
|
3536 + | )*
|
3537 + | $(
|
3538 + | impl $ crate::server::plugin::scoped::Membership<$ not_member> for $ name {
|
3539 + | type Contains = $ crate::server::plugin::scoped::$ contains;
|
3540 + | }
|
3541 + | )*
|
3542 + | };
|
3543 + | // All `not_member`s exhausted, move `temp` into `not_member`
|
3544 + | (@ $ name: ident, $ contains: ident ($($ member: ident)*) ($($ temp: ident)*) ()) => {
|
3545 + | scope! { @ $ name, $ contains ($($ member)*) () ($($ temp)*) }
|
3546 + | };
|
3547 + |
|
3548 + | // ContentTypeParameters match found, pop from both `member` and `not_member`
|
3549 + | (@ $ name: ident, $ contains: ident (ContentTypeParameters $($ member: ident)*) ($($ temp: ident)*) (ContentTypeParameters $($ not_member: ident)*)) => {
|
3550 + | scope! { @ $ name, $ contains ($($ member)*) ($($ temp)*) ($($ not_member)*) }
|
3551 + | };
|
3552 + | // ContentTypeParameters match not found, pop from `not_member` into `temp` stack
|
3553 + | (@ $ name: ident, $ contains: ident (ContentTypeParameters $($ member: ident)*) ($($ temp: ident)*) ($ other: ident $($ not_member: ident)*)) => {
|
3554 + | scope! { @ $ name, $ contains (ContentTypeParameters $($ member)*) ($ other $($ temp)*) ($($ not_member)*) }
|
3555 + | };
|
3556 + |
|
3557 + | // EmptyInputAndEmptyOutput match found, pop from both `member` and `not_member`
|
3558 + | (@ $ name: ident, $ contains: ident (EmptyInputAndEmptyOutput $($ member: ident)*) ($($ temp: ident)*) (EmptyInputAndEmptyOutput $($ not_member: ident)*)) => {
|
3559 + | scope! { @ $ name, $ contains ($($ member)*) ($($ temp)*) ($($ not_member)*) }
|
3560 + | };
|
3561 + | // EmptyInputAndEmptyOutput match not found, pop from `not_member` into `temp` stack
|
3562 + | (@ $ name: ident, $ contains: ident (EmptyInputAndEmptyOutput $($ member: ident)*) ($($ temp: ident)*) ($ other: ident $($ not_member: ident)*)) => {
|
3563 + | scope! { @ $ name, $ contains (EmptyInputAndEmptyOutput $($ member)*) ($ other $($ temp)*) ($($ not_member)*) }
|
3564 + | };
|
3565 + |
|
3566 + | // EndpointOperation match found, pop from both `member` and `not_member`
|
3567 + | (@ $ name: ident, $ contains: ident (EndpointOperation $($ member: ident)*) ($($ temp: ident)*) (EndpointOperation $($ not_member: ident)*)) => {
|
3568 + | scope! { @ $ name, $ contains ($($ member)*) ($($ temp)*) ($($ not_member)*) }
|
3569 + | };
|
3570 + | // EndpointOperation match not found, pop from `not_member` into `temp` stack
|
3571 + | (@ $ name: ident, $ contains: ident (EndpointOperation $($ member: ident)*) ($($ temp: ident)*) ($ other: ident $($ not_member: ident)*)) => {
|
3572 + | scope! { @ $ name, $ contains (EndpointOperation $($ member)*) ($ other $($ temp)*) ($($ not_member)*) }
|
3573 + | };
|
3574 + |
|
3575 + | // EndpointWithHostLabelOperation match found, pop from both `member` and `not_member`
|
3576 + | (@ $ name: ident, $ contains: ident (EndpointWithHostLabelOperation $($ member: ident)*) ($($ temp: ident)*) (EndpointWithHostLabelOperation $($ not_member: ident)*)) => {
|
3577 + | scope! { @ $ name, $ contains ($($ member)*) ($($ temp)*) ($($ not_member)*) }
|
3578 + | };
|
3579 + | // EndpointWithHostLabelOperation match not found, pop from `not_member` into `temp` stack
|
3580 + | (@ $ name: ident, $ contains: ident (EndpointWithHostLabelOperation $($ member: ident)*) ($($ temp: ident)*) ($ other: ident $($ not_member: ident)*)) => {
|
3581 + | scope! { @ $ name, $ contains (EndpointWithHostLabelOperation $($ member)*) ($ other $($ temp)*) ($($ not_member)*) }
|
3582 + | };
|
3583 + |
|
3584 + | // GreetingWithErrors match found, pop from both `member` and `not_member`
|
3585 + | (@ $ name: ident, $ contains: ident (GreetingWithErrors $($ member: ident)*) ($($ temp: ident)*) (GreetingWithErrors $($ not_member: ident)*)) => {
|
3586 + | scope! { @ $ name, $ contains ($($ member)*) ($($ temp)*) ($($ not_member)*) }
|
3587 + | };
|
3588 + | // GreetingWithErrors match not found, pop from `not_member` into `temp` stack
|
3589 + | (@ $ name: ident, $ contains: ident (GreetingWithErrors $($ member: ident)*) ($($ temp: ident)*) ($ other: ident $($ not_member: ident)*)) => {
|
3590 + | scope! { @ $ name, $ contains (GreetingWithErrors $($ member)*) ($ other $($ temp)*) ($($ not_member)*) }
|
3591 + | };
|
3592 + |
|
3593 + | // HostWithPathOperation match found, pop from both `member` and `not_member`
|
3594 + | (@ $ name: ident, $ contains: ident (HostWithPathOperation $($ member: ident)*) ($($ temp: ident)*) (HostWithPathOperation $($ not_member: ident)*)) => {
|
3595 + | scope! { @ $ name, $ contains ($($ member)*) ($($ temp)*) ($($ not_member)*) }
|
3596 + | };
|
3597 + | // HostWithPathOperation match not found, pop from `not_member` into `temp` stack
|
3598 + | (@ $ name: ident, $ contains: ident (HostWithPathOperation $($ member: ident)*) ($($ temp: ident)*) ($ other: ident $($ not_member: ident)*)) => {
|
3599 + | scope! { @ $ name, $ contains (HostWithPathOperation $($ member)*) ($ other $($ temp)*) ($($ not_member)*) }
|
3600 + | };
|
3601 + |
|
3602 + | // JsonUnions match found, pop from both `member` and `not_member`
|
3603 + | (@ $ name: ident, $ contains: ident (JsonUnions $($ member: ident)*) ($($ temp: ident)*) (JsonUnions $($ not_member: ident)*)) => {
|
3604 + | scope! { @ $ name, $ contains ($($ member)*) ($($ temp)*) ($($ not_member)*) }
|
3605 + | };
|
3606 + | // JsonUnions match not found, pop from `not_member` into `temp` stack
|
3607 + | (@ $ name: ident, $ contains: ident (JsonUnions $($ member: ident)*) ($($ temp: ident)*) ($ other: ident $($ not_member: ident)*)) => {
|
3608 + | scope! { @ $ name, $ contains (JsonUnions $($ member)*) ($ other $($ temp)*) ($($ not_member)*) }
|
3609 + | };
|
3610 + |
|
3611 + | // NoInputAndNoOutput match found, pop from both `member` and `not_member`
|
3612 + | (@ $ name: ident, $ contains: ident (NoInputAndNoOutput $($ member: ident)*) ($($ temp: ident)*) (NoInputAndNoOutput $($ not_member: ident)*)) => {
|
3613 + | scope! { @ $ name, $ contains ($($ member)*) ($($ temp)*) ($($ not_member)*) }
|
3614 + | };
|
3615 + | // NoInputAndNoOutput match not found, pop from `not_member` into `temp` stack
|
3616 + | (@ $ name: ident, $ contains: ident (NoInputAndNoOutput $($ member: ident)*) ($($ temp: ident)*) ($ other: ident $($ not_member: ident)*)) => {
|
3617 + | scope! { @ $ name, $ contains (NoInputAndNoOutput $($ member)*) ($ other $($ temp)*) ($($ not_member)*) }
|
3618 + | };
|
3619 + |
|
3620 + | // NoInputAndOutput match found, pop from both `member` and `not_member`
|
3621 + | (@ $ name: ident, $ contains: ident (NoInputAndOutput $($ member: ident)*) ($($ temp: ident)*) (NoInputAndOutput $($ not_member: ident)*)) => {
|
3622 + | scope! { @ $ name, $ contains ($($ member)*) ($($ temp)*) ($($ not_member)*) }
|
3623 + | };
|
3624 + | // NoInputAndOutput match not found, pop from `not_member` into `temp` stack
|
3625 + | (@ $ name: ident, $ contains: ident (NoInputAndOutput $($ member: ident)*) ($($ temp: ident)*) ($ other: ident $($ not_member: ident)*)) => {
|
3626 + | scope! { @ $ name, $ contains (NoInputAndOutput $($ member)*) ($ other $($ temp)*) ($($ not_member)*) }
|
3627 + | };
|
3628 + |
|
3629 + | // OperationWithDefaults match found, pop from both `member` and `not_member`
|
3630 + | (@ $ name: ident, $ contains: ident (OperationWithDefaults $($ member: ident)*) ($($ temp: ident)*) (OperationWithDefaults $($ not_member: ident)*)) => {
|
3631 + | scope! { @ $ name, $ contains ($($ member)*) ($($ temp)*) ($($ not_member)*) }
|
3632 + | };
|
3633 + | // OperationWithDefaults match not found, pop from `not_member` into `temp` stack
|
3634 + | (@ $ name: ident, $ contains: ident (OperationWithDefaults $($ member: ident)*) ($($ temp: ident)*) ($ other: ident $($ not_member: ident)*)) => {
|
3635 + | scope! { @ $ name, $ contains (OperationWithDefaults $($ member)*) ($ other $($ temp)*) ($($ not_member)*) }
|
3636 + | };
|
3637 + |
|
3638 + | // OperationWithNestedStructure match found, pop from both `member` and `not_member`
|
3639 + | (@ $ name: ident, $ contains: ident (OperationWithNestedStructure $($ member: ident)*) ($($ temp: ident)*) (OperationWithNestedStructure $($ not_member: ident)*)) => {
|
3640 + | scope! { @ $ name, $ contains ($($ member)*) ($($ temp)*) ($($ not_member)*) }
|
3641 + | };
|
3642 + | // OperationWithNestedStructure match not found, pop from `not_member` into `temp` stack
|
3643 + | (@ $ name: ident, $ contains: ident (OperationWithNestedStructure $($ member: ident)*) ($($ temp: ident)*) ($ other: ident $($ not_member: ident)*)) => {
|
3644 + | scope! { @ $ name, $ contains (OperationWithNestedStructure $($ member)*) ($ other $($ temp)*) ($($ not_member)*) }
|
3645 + | };
|
3646 + |
|
3647 + | // OperationWithRequiredMembers match found, pop from both `member` and `not_member`
|
3648 + | (@ $ name: ident, $ contains: ident (OperationWithRequiredMembers $($ member: ident)*) ($($ temp: ident)*) (OperationWithRequiredMembers $($ not_member: ident)*)) => {
|
3649 + | scope! { @ $ name, $ contains ($($ member)*) ($($ temp)*) ($($ not_member)*) }
|
3650 + | };
|
3651 + | // OperationWithRequiredMembers match not found, pop from `not_member` into `temp` stack
|
3652 + | (@ $ name: ident, $ contains: ident (OperationWithRequiredMembers $($ member: ident)*) ($($ temp: ident)*) ($ other: ident $($ not_member: ident)*)) => {
|
3653 + | scope! { @ $ name, $ contains (OperationWithRequiredMembers $($ member)*) ($ other $($ temp)*) ($($ not_member)*) }
|
3654 + | };
|
3655 + |
|
3656 + | // OperationWithRequiredMembersWithDefaults match found, pop from both `member` and `not_member`
|
3657 + | (@ $ name: ident, $ contains: ident (OperationWithRequiredMembersWithDefaults $($ member: ident)*) ($($ temp: ident)*) (OperationWithRequiredMembersWithDefaults $($ not_member: ident)*)) => {
|
3658 + | scope! { @ $ name, $ contains ($($ member)*) ($($ temp)*) ($($ not_member)*) }
|
3659 + | };
|
3660 + | // OperationWithRequiredMembersWithDefaults match not found, pop from `not_member` into `temp` stack
|
3661 + | (@ $ name: ident, $ contains: ident (OperationWithRequiredMembersWithDefaults $($ member: ident)*) ($($ temp: ident)*) ($ other: ident $($ not_member: ident)*)) => {
|
3662 + | scope! { @ $ name, $ contains (OperationWithRequiredMembersWithDefaults $($ member)*) ($ other $($ temp)*) ($($ not_member)*) }
|
3663 + | };
|
3664 + |
|
3665 + | // PutWithContentEncoding match found, pop from both `member` and `not_member`
|
3666 + | (@ $ name: ident, $ contains: ident (PutWithContentEncoding $($ member: ident)*) ($($ temp: ident)*) (PutWithContentEncoding $($ not_member: ident)*)) => {
|
3667 + | scope! { @ $ name, $ contains ($($ member)*) ($($ temp)*) ($($ not_member)*) }
|
3668 + | };
|
3669 + | // PutWithContentEncoding match not found, pop from `not_member` into `temp` stack
|
3670 + | (@ $ name: ident, $ contains: ident (PutWithContentEncoding $($ member: ident)*) ($($ temp: ident)*) ($ other: ident $($ not_member: ident)*)) => {
|
3671 + | scope! { @ $ name, $ contains (PutWithContentEncoding $($ member)*) ($ other $($ temp)*) ($($ not_member)*) }
|
3672 + | };
|
3673 + |
|
3674 + | // QueryIncompatibleOperation match found, pop from both `member` and `not_member`
|
3675 + | (@ $ name: ident, $ contains: ident (QueryIncompatibleOperation $($ member: ident)*) ($($ temp: ident)*) (QueryIncompatibleOperation $($ not_member: ident)*)) => {
|
3676 + | scope! { @ $ name, $ contains ($($ member)*) ($($ temp)*) ($($ not_member)*) }
|
3677 + | };
|
3678 + | // QueryIncompatibleOperation match not found, pop from `not_member` into `temp` stack
|
3679 + | (@ $ name: ident, $ contains: ident (QueryIncompatibleOperation $($ member: ident)*) ($($ temp: ident)*) ($ other: ident $($ not_member: ident)*)) => {
|
3680 + | scope! { @ $ name, $ contains (QueryIncompatibleOperation $($ member)*) ($ other $($ temp)*) ($($ not_member)*) }
|
3681 + | };
|
3682 + |
|
3683 + | // SimpleScalarProperties match found, pop from both `member` and `not_member`
|
3684 + | (@ $ name: ident, $ contains: ident (SimpleScalarProperties $($ member: ident)*) ($($ temp: ident)*) (SimpleScalarProperties $($ not_member: ident)*)) => {
|
3685 + | scope! { @ $ name, $ contains ($($ member)*) ($($ temp)*) ($($ not_member)*) }
|
3686 + | };
|
3687 + | // SimpleScalarProperties match not found, pop from `not_member` into `temp` stack
|
3688 + | (@ $ name: ident, $ contains: ident (SimpleScalarProperties $($ member: ident)*) ($($ temp: ident)*) ($ other: ident $($ not_member: ident)*)) => {
|
3689 + | scope! { @ $ name, $ contains (SimpleScalarProperties $($ member)*) ($ other $($ temp)*) ($($ not_member)*) }
|
3690 + | };
|
3691 + |
|
3692 + | (
|
3693 + | $(#[$ attrs:meta])*
|
3694 + | $ vis:vis struct $ name:ident {
|
3695 + | includes: [$($ include:ident),*]
|
3696 + | }
|
3697 + | ) => {
|
3698 + | use $ crate::operation_shape::*;
|
3699 + | $ crate::server::scope! {
|
3700 + | $(#[$ attrs])*
|
3701 + | $ vis struct $ name {
|
3702 + | includes: [$($ include),*],
|
3703 + | excludes: []
|
3704 + | }
|
3705 + | }
|
3706 + | scope! { @ $ name, False ($($ include)*) () (ContentTypeParameters EmptyInputAndEmptyOutput EndpointOperation EndpointWithHostLabelOperation GreetingWithErrors HostWithPathOperation JsonUnions NoInputAndNoOutput NoInputAndOutput OperationWithDefaults OperationWithNestedStructure OperationWithRequiredMembers OperationWithRequiredMembersWithDefaults PutWithContentEncoding QueryIncompatibleOperation SimpleScalarProperties) }
|
3707 + | };
|
3708 + | (
|
3709 + | $(#[$ attrs:meta])*
|
3710 + | $ vis:vis struct $ name:ident {
|
3711 + | excludes: [$($ exclude:ident),*]
|
3712 + | }
|
3713 + | ) => {
|
3714 + | use $ crate::operation_shape::*;
|
3715 + |
|
3716 + | $ crate::server::scope! {
|
3717 + | $(#[$ attrs])*
|
3718 + | $ vis struct $ name {
|
3719 + | includes: [],
|
3720 + | excludes: [$($ exclude),*]
|
3721 + | }
|
3722 + | }
|
3723 + | scope! { @ $ name, True ($($ exclude)*) () (ContentTypeParameters EmptyInputAndEmptyOutput EndpointOperation EndpointWithHostLabelOperation GreetingWithErrors HostWithPathOperation JsonUnions NoInputAndNoOutput NoInputAndOutput OperationWithDefaults OperationWithNestedStructure OperationWithRequiredMembers OperationWithRequiredMembersWithDefaults PutWithContentEncoding QueryIncompatibleOperation SimpleScalarProperties) }
|
3724 + | };
|
3725 + | }
|