1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 2 | /// The service builder for [`MiscService`].
|
3 3 | ///
|
4 4 | /// Constructed via [`MiscService::builder`].
|
5 5 | pub struct MiscServiceBuilder<Body, L, HttpPl, ModelPl> {
|
6 - | required_header_collection_operation: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
7 - | required_inner_shape_operation: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
8 - | response_code_default_operation: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
9 - | response_code_http_fallback_operation: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
10 - | response_code_required_operation: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
11 - | type_complexity_operation: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
6 + | required_header_collection_operation:
|
7 + | Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
8 + | required_inner_shape_operation: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
9 + | response_code_default_operation: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
10 + | response_code_http_fallback_operation:
|
11 + | Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
12 + | response_code_required_operation: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
13 + | type_complexity_operation: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
12 14 | layer: L,
|
13 15 | http_plugin: HttpPl,
|
14 16 | model_plugin: ModelPl,
|
15 17 | }
|
16 18 |
|
17 19 | impl<Body, L, HttpPl, ModelPl> MiscServiceBuilder<Body, L, HttpPl, ModelPl> {
|
18 20 | /// Sets the [`RequiredHeaderCollectionOperation`](crate::operation_shape::RequiredHeaderCollectionOperation) operation.
|
19 21 | ///
|
20 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
21 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
22 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
23 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
22 24 | ///
|
23 25 | /// # Example
|
24 26 | ///
|
25 27 | /// ```no_run
|
26 28 | /// use misc::{MiscService, MiscServiceConfig};
|
27 29 | ///
|
28 30 | /// use misc::{input, output, error};
|
29 31 | ///
|
30 32 | /// async fn handler(input: input::RequiredHeaderCollectionOperationInput) -> Result<output::RequiredHeaderCollectionOperationOutput, error::RequiredHeaderCollectionOperationError> {
|
31 33 | /// todo!()
|
32 34 | /// }
|
33 35 | ///
|
34 36 | /// let config = MiscServiceConfig::builder().build();
|
35 37 | /// let app = MiscService::builder(config)
|
36 38 | /// .required_header_collection_operation(handler)
|
37 39 | /// /* Set other handlers */
|
38 40 | /// .build()
|
39 41 | /// .unwrap();
|
40 - | /// # let app: MiscService<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::rest::router::RestRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
42 + | /// # let app: MiscService<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
41 43 | /// ```
|
42 44 | ///
|
43 45 | pub fn required_header_collection_operation<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
44 46 | where
|
45 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::RequiredHeaderCollectionOperation, HandlerExtractors>,
|
47 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::RequiredHeaderCollectionOperation, HandlerExtractors>,
|
46 48 |
|
47 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
49 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
48 50 | MiscService<L>,
|
49 51 | crate::operation_shape::RequiredHeaderCollectionOperation,
|
50 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::RequiredHeaderCollectionOperation, HandlerType>
|
52 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::RequiredHeaderCollectionOperation, HandlerType>
|
51 53 | >,
|
52 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
54 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
53 55 | MiscService<L>,
|
54 56 | crate::operation_shape::RequiredHeaderCollectionOperation,
|
55 57 | ModelPl::Output
|
56 58 | >,
|
57 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
59 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
58 60 | MiscService<L>,
|
59 61 | crate::operation_shape::RequiredHeaderCollectionOperation,
|
60 62 | <
|
61 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
62 - | as ::aws_smithy_http_server::plugin::Plugin<
|
63 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
64 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
63 65 | MiscService<L>,
|
64 66 | crate::operation_shape::RequiredHeaderCollectionOperation,
|
65 67 | ModelPl::Output
|
66 68 | >
|
67 69 | >::Output
|
68 70 | >,
|
69 71 |
|
70 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
72 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
71 73 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
72 74 |
|
73 75 | {
|
74 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
75 - | use ::aws_smithy_http_server::plugin::Plugin;
|
76 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
77 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
76 78 | let svc = crate::operation_shape::RequiredHeaderCollectionOperation::from_handler(handler);
|
77 79 | let svc = self.model_plugin.apply(svc);
|
78 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
79 - | .apply(svc);
|
80 + | let svc =
|
81 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
82 + | .apply(svc);
|
80 83 | let svc = self.http_plugin.apply(svc);
|
81 84 | self.required_header_collection_operation_custom(svc)
|
82 85 | }
|
83 86 |
|
84 87 | /// Sets the [`RequiredHeaderCollectionOperation`](crate::operation_shape::RequiredHeaderCollectionOperation) operation.
|
85 88 | ///
|
86 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
87 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
89 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
90 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
88 91 | ///
|
89 92 | /// # Example
|
90 93 | ///
|
91 94 | /// ```no_run
|
92 95 | /// use misc::{MiscService, MiscServiceConfig};
|
93 96 | ///
|
94 97 | /// use misc::{input, output, error};
|
95 98 | ///
|
96 99 | /// async fn handler(input: input::RequiredHeaderCollectionOperationInput) -> Result<output::RequiredHeaderCollectionOperationOutput, error::RequiredHeaderCollectionOperationError> {
|
97 100 | /// todo!()
|
98 101 | /// }
|
99 102 | ///
|
100 103 | /// let config = MiscServiceConfig::builder().build();
|
101 104 | /// let svc = ::tower::util::service_fn(handler);
|
102 105 | /// let app = MiscService::builder(config)
|
103 106 | /// .required_header_collection_operation_service(svc)
|
104 107 | /// /* Set other handlers */
|
105 108 | /// .build()
|
106 109 | /// .unwrap();
|
107 - | /// # let app: MiscService<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::rest::router::RestRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
110 + | /// # let app: MiscService<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
108 111 | /// ```
|
109 112 | ///
|
110 113 | pub fn required_header_collection_operation_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
111 114 | where
|
112 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::RequiredHeaderCollectionOperation, ServiceExtractors>,
|
115 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::RequiredHeaderCollectionOperation, ServiceExtractors>,
|
113 116 |
|
114 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
117 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
115 118 | MiscService<L>,
|
116 119 | crate::operation_shape::RequiredHeaderCollectionOperation,
|
117 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::RequiredHeaderCollectionOperation, S>
|
120 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::RequiredHeaderCollectionOperation, S>
|
118 121 | >,
|
119 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
122 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
120 123 | MiscService<L>,
|
121 124 | crate::operation_shape::RequiredHeaderCollectionOperation,
|
122 125 | ModelPl::Output
|
123 126 | >,
|
124 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
127 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
125 128 | MiscService<L>,
|
126 129 | crate::operation_shape::RequiredHeaderCollectionOperation,
|
127 130 | <
|
128 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
129 - | as ::aws_smithy_http_server::plugin::Plugin<
|
131 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
132 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
130 133 | MiscService<L>,
|
131 134 | crate::operation_shape::RequiredHeaderCollectionOperation,
|
132 135 | ModelPl::Output
|
133 136 | >
|
134 137 | >::Output
|
135 138 | >,
|
136 139 |
|
137 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
140 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
138 141 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
139 142 |
|
140 143 | {
|
141 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
142 - | use ::aws_smithy_http_server::plugin::Plugin;
|
144 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
145 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
143 146 | let svc = crate::operation_shape::RequiredHeaderCollectionOperation::from_service(service);
|
144 147 | let svc = self.model_plugin.apply(svc);
|
145 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
146 - | .apply(svc);
|
148 + | let svc =
|
149 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
150 + | .apply(svc);
|
147 151 | let svc = self.http_plugin.apply(svc);
|
148 152 | self.required_header_collection_operation_custom(svc)
|
149 153 | }
|
150 154 |
|
151 155 | /// Sets the [`RequiredHeaderCollectionOperation`](crate::operation_shape::RequiredHeaderCollectionOperation) to a custom [`Service`](tower::Service).
|
152 156 | /// not constrained by the Smithy contract.
|
153 157 | fn required_header_collection_operation_custom<S>(mut self, svc: S) -> Self
|
154 158 | where
|
155 159 | S: ::tower::Service<
|
156 160 | ::http::Request<Body>,
|
157 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
161 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
158 162 | Error = ::std::convert::Infallible,
|
159 163 | > + Clone
|
160 164 | + Send
|
161 165 | + 'static,
|
162 166 | S::Future: Send + 'static,
|
163 167 | {
|
164 168 | self.required_header_collection_operation =
|
165 - | Some(::aws_smithy_http_server::routing::Route::new(svc));
|
169 + | Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
166 170 | self
|
167 171 | }
|
168 172 |
|
169 173 | /// Sets the [`RequiredInnerShapeOperation`](crate::operation_shape::RequiredInnerShapeOperation) operation.
|
170 174 | ///
|
171 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
172 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
175 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
176 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
173 177 | ///
|
174 178 | /// # Example
|
175 179 | ///
|
176 180 | /// ```no_run
|
177 181 | /// use misc::{MiscService, MiscServiceConfig};
|
178 182 | ///
|
179 183 | /// use misc::{input, output, error};
|
180 184 | ///
|
181 185 | /// async fn handler(input: input::RequiredInnerShapeOperationInput) -> Result<output::RequiredInnerShapeOperationOutput, error::RequiredInnerShapeOperationError> {
|
182 186 | /// todo!()
|
183 187 | /// }
|
184 188 | ///
|
185 189 | /// let config = MiscServiceConfig::builder().build();
|
186 190 | /// let app = MiscService::builder(config)
|
187 191 | /// .required_inner_shape_operation(handler)
|
188 192 | /// /* Set other handlers */
|
189 193 | /// .build()
|
190 194 | /// .unwrap();
|
191 - | /// # let app: MiscService<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::rest::router::RestRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
195 + | /// # let app: MiscService<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
192 196 | /// ```
|
193 197 | ///
|
194 198 | pub fn required_inner_shape_operation<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
195 199 | where
|
196 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::RequiredInnerShapeOperation, HandlerExtractors>,
|
200 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::RequiredInnerShapeOperation, HandlerExtractors>,
|
197 201 |
|
198 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
202 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
199 203 | MiscService<L>,
|
200 204 | crate::operation_shape::RequiredInnerShapeOperation,
|
201 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::RequiredInnerShapeOperation, HandlerType>
|
205 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::RequiredInnerShapeOperation, HandlerType>
|
202 206 | >,
|
203 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
207 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
204 208 | MiscService<L>,
|
205 209 | crate::operation_shape::RequiredInnerShapeOperation,
|
206 210 | ModelPl::Output
|
207 211 | >,
|
208 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
212 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
209 213 | MiscService<L>,
|
210 214 | crate::operation_shape::RequiredInnerShapeOperation,
|
211 215 | <
|
212 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
213 - | as ::aws_smithy_http_server::plugin::Plugin<
|
216 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
217 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
214 218 | MiscService<L>,
|
215 219 | crate::operation_shape::RequiredInnerShapeOperation,
|
216 220 | ModelPl::Output
|
217 221 | >
|
218 222 | >::Output
|
219 223 | >,
|
220 224 |
|
221 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
225 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
222 226 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
223 227 |
|
224 228 | {
|
225 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
226 - | use ::aws_smithy_http_server::plugin::Plugin;
|
229 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
230 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
227 231 | let svc = crate::operation_shape::RequiredInnerShapeOperation::from_handler(handler);
|
228 232 | let svc = self.model_plugin.apply(svc);
|
229 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
230 - | .apply(svc);
|
233 + | let svc =
|
234 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
235 + | .apply(svc);
|
231 236 | let svc = self.http_plugin.apply(svc);
|
232 237 | self.required_inner_shape_operation_custom(svc)
|
233 238 | }
|
234 239 |
|
235 240 | /// Sets the [`RequiredInnerShapeOperation`](crate::operation_shape::RequiredInnerShapeOperation) operation.
|
236 241 | ///
|
237 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
238 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
242 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
243 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
239 244 | ///
|
240 245 | /// # Example
|
241 246 | ///
|
242 247 | /// ```no_run
|
243 248 | /// use misc::{MiscService, MiscServiceConfig};
|
244 249 | ///
|
245 250 | /// use misc::{input, output, error};
|
246 251 | ///
|
247 252 | /// async fn handler(input: input::RequiredInnerShapeOperationInput) -> Result<output::RequiredInnerShapeOperationOutput, error::RequiredInnerShapeOperationError> {
|
248 253 | /// todo!()
|
249 254 | /// }
|
250 255 | ///
|
251 256 | /// let config = MiscServiceConfig::builder().build();
|
252 257 | /// let svc = ::tower::util::service_fn(handler);
|
253 258 | /// let app = MiscService::builder(config)
|
254 259 | /// .required_inner_shape_operation_service(svc)
|
255 260 | /// /* Set other handlers */
|
256 261 | /// .build()
|
257 262 | /// .unwrap();
|
258 - | /// # let app: MiscService<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::rest::router::RestRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
263 + | /// # let app: MiscService<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
259 264 | /// ```
|
260 265 | ///
|
261 266 | pub fn required_inner_shape_operation_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
262 267 | where
|
263 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::RequiredInnerShapeOperation, ServiceExtractors>,
|
268 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::RequiredInnerShapeOperation, ServiceExtractors>,
|
264 269 |
|
265 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
270 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
266 271 | MiscService<L>,
|
267 272 | crate::operation_shape::RequiredInnerShapeOperation,
|
268 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::RequiredInnerShapeOperation, S>
|
273 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::RequiredInnerShapeOperation, S>
|
269 274 | >,
|
270 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
275 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
271 276 | MiscService<L>,
|
272 277 | crate::operation_shape::RequiredInnerShapeOperation,
|
273 278 | ModelPl::Output
|
274 279 | >,
|
275 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
280 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
276 281 | MiscService<L>,
|
277 282 | crate::operation_shape::RequiredInnerShapeOperation,
|
278 283 | <
|
279 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
280 - | as ::aws_smithy_http_server::plugin::Plugin<
|
284 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
285 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
281 286 | MiscService<L>,
|
282 287 | crate::operation_shape::RequiredInnerShapeOperation,
|
283 288 | ModelPl::Output
|
284 289 | >
|
285 290 | >::Output
|
286 291 | >,
|
287 292 |
|
288 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
293 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
289 294 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
290 295 |
|
291 296 | {
|
292 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
293 - | use ::aws_smithy_http_server::plugin::Plugin;
|
297 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
298 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
294 299 | let svc = crate::operation_shape::RequiredInnerShapeOperation::from_service(service);
|
295 300 | let svc = self.model_plugin.apply(svc);
|
296 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
297 - | .apply(svc);
|
301 + | let svc =
|
302 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
303 + | .apply(svc);
|
298 304 | let svc = self.http_plugin.apply(svc);
|
299 305 | self.required_inner_shape_operation_custom(svc)
|
300 306 | }
|
301 307 |
|
302 308 | /// Sets the [`RequiredInnerShapeOperation`](crate::operation_shape::RequiredInnerShapeOperation) to a custom [`Service`](tower::Service).
|
303 309 | /// not constrained by the Smithy contract.
|
304 310 | fn required_inner_shape_operation_custom<S>(mut self, svc: S) -> Self
|
305 311 | where
|
306 312 | S: ::tower::Service<
|
307 313 | ::http::Request<Body>,
|
308 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
314 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
309 315 | Error = ::std::convert::Infallible,
|
310 316 | > + Clone
|
311 317 | + Send
|
312 318 | + 'static,
|
313 319 | S::Future: Send + 'static,
|
314 320 | {
|
315 321 | self.required_inner_shape_operation =
|
316 - | Some(::aws_smithy_http_server::routing::Route::new(svc));
|
322 + | Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
317 323 | self
|
318 324 | }
|
319 325 |
|
320 326 | /// Sets the [`ResponseCodeDefaultOperation`](crate::operation_shape::ResponseCodeDefaultOperation) operation.
|
321 327 | ///
|
322 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
323 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
328 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
329 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
324 330 | ///
|
325 331 | /// # Example
|
326 332 | ///
|
327 333 | /// ```no_run
|
328 334 | /// use misc::{MiscService, MiscServiceConfig};
|
329 335 | ///
|
330 336 | /// use misc::{input, output, error};
|
331 337 | ///
|
332 338 | /// async fn handler(input: input::ResponseCodeDefaultOperationInput) -> Result<output::ResponseCodeDefaultOperationOutput, error::ResponseCodeDefaultOperationError> {
|
333 339 | /// todo!()
|
334 340 | /// }
|
335 341 | ///
|
336 342 | /// let config = MiscServiceConfig::builder().build();
|
337 343 | /// let app = MiscService::builder(config)
|
338 344 | /// .response_code_default_operation(handler)
|
339 345 | /// /* Set other handlers */
|
340 346 | /// .build()
|
341 347 | /// .unwrap();
|
342 - | /// # let app: MiscService<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::rest::router::RestRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
348 + | /// # let app: MiscService<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
343 349 | /// ```
|
344 350 | ///
|
345 351 | pub fn response_code_default_operation<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
346 352 | where
|
347 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::ResponseCodeDefaultOperation, HandlerExtractors>,
|
353 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::ResponseCodeDefaultOperation, HandlerExtractors>,
|
348 354 |
|
349 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
355 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
350 356 | MiscService<L>,
|
351 357 | crate::operation_shape::ResponseCodeDefaultOperation,
|
352 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::ResponseCodeDefaultOperation, HandlerType>
|
358 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::ResponseCodeDefaultOperation, HandlerType>
|
353 359 | >,
|
354 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
360 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
355 361 | MiscService<L>,
|
356 362 | crate::operation_shape::ResponseCodeDefaultOperation,
|
357 363 | ModelPl::Output
|
358 364 | >,
|
359 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
365 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
360 366 | MiscService<L>,
|
361 367 | crate::operation_shape::ResponseCodeDefaultOperation,
|
362 368 | <
|
363 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
364 - | as ::aws_smithy_http_server::plugin::Plugin<
|
369 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
370 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
365 371 | MiscService<L>,
|
366 372 | crate::operation_shape::ResponseCodeDefaultOperation,
|
367 373 | ModelPl::Output
|
368 374 | >
|
369 375 | >::Output
|
370 376 | >,
|
371 377 |
|
372 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
378 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
373 379 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
374 380 |
|
375 381 | {
|
376 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
377 - | use ::aws_smithy_http_server::plugin::Plugin;
|
382 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
383 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
378 384 | let svc = crate::operation_shape::ResponseCodeDefaultOperation::from_handler(handler);
|
379 385 | let svc = self.model_plugin.apply(svc);
|
380 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
381 - | .apply(svc);
|
386 + | let svc =
|
387 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
388 + | .apply(svc);
|
382 389 | let svc = self.http_plugin.apply(svc);
|
383 390 | self.response_code_default_operation_custom(svc)
|
384 391 | }
|
385 392 |
|
386 393 | /// Sets the [`ResponseCodeDefaultOperation`](crate::operation_shape::ResponseCodeDefaultOperation) operation.
|
387 394 | ///
|
388 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
389 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
395 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
396 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
390 397 | ///
|
391 398 | /// # Example
|
392 399 | ///
|
393 400 | /// ```no_run
|
394 401 | /// use misc::{MiscService, MiscServiceConfig};
|
395 402 | ///
|
396 403 | /// use misc::{input, output, error};
|
397 404 | ///
|
398 405 | /// async fn handler(input: input::ResponseCodeDefaultOperationInput) -> Result<output::ResponseCodeDefaultOperationOutput, error::ResponseCodeDefaultOperationError> {
|
399 406 | /// todo!()
|
400 407 | /// }
|
401 408 | ///
|
402 409 | /// let config = MiscServiceConfig::builder().build();
|
403 410 | /// let svc = ::tower::util::service_fn(handler);
|
404 411 | /// let app = MiscService::builder(config)
|
405 412 | /// .response_code_default_operation_service(svc)
|
406 413 | /// /* Set other handlers */
|
407 414 | /// .build()
|
408 415 | /// .unwrap();
|
409 - | /// # let app: MiscService<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::rest::router::RestRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
416 + | /// # let app: MiscService<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
410 417 | /// ```
|
411 418 | ///
|
412 419 | pub fn response_code_default_operation_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
413 420 | where
|
414 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::ResponseCodeDefaultOperation, ServiceExtractors>,
|
421 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::ResponseCodeDefaultOperation, ServiceExtractors>,
|
415 422 |
|
416 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
423 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
417 424 | MiscService<L>,
|
418 425 | crate::operation_shape::ResponseCodeDefaultOperation,
|
419 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::ResponseCodeDefaultOperation, S>
|
426 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::ResponseCodeDefaultOperation, S>
|
420 427 | >,
|
421 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
428 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
422 429 | MiscService<L>,
|
423 430 | crate::operation_shape::ResponseCodeDefaultOperation,
|
424 431 | ModelPl::Output
|
425 432 | >,
|
426 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
433 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
427 434 | MiscService<L>,
|
428 435 | crate::operation_shape::ResponseCodeDefaultOperation,
|
429 436 | <
|
430 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
431 - | as ::aws_smithy_http_server::plugin::Plugin<
|
437 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
438 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
432 439 | MiscService<L>,
|
433 440 | crate::operation_shape::ResponseCodeDefaultOperation,
|
434 441 | ModelPl::Output
|
435 442 | >
|
436 443 | >::Output
|
437 444 | >,
|
438 445 |
|
439 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
446 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
440 447 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
441 448 |
|
442 449 | {
|
443 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
444 - | use ::aws_smithy_http_server::plugin::Plugin;
|
450 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
451 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
445 452 | let svc = crate::operation_shape::ResponseCodeDefaultOperation::from_service(service);
|
446 453 | let svc = self.model_plugin.apply(svc);
|
447 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
448 - | .apply(svc);
|
454 + | let svc =
|
455 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
456 + | .apply(svc);
|
449 457 | let svc = self.http_plugin.apply(svc);
|
450 458 | self.response_code_default_operation_custom(svc)
|
451 459 | }
|
452 460 |
|
453 461 | /// Sets the [`ResponseCodeDefaultOperation`](crate::operation_shape::ResponseCodeDefaultOperation) to a custom [`Service`](tower::Service).
|
454 462 | /// not constrained by the Smithy contract.
|
455 463 | fn response_code_default_operation_custom<S>(mut self, svc: S) -> Self
|
456 464 | where
|
457 465 | S: ::tower::Service<
|
458 466 | ::http::Request<Body>,
|
459 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
467 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
460 468 | Error = ::std::convert::Infallible,
|
461 469 | > + Clone
|
462 470 | + Send
|
463 471 | + 'static,
|
464 472 | S::Future: Send + 'static,
|
465 473 | {
|
466 474 | self.response_code_default_operation =
|
467 - | Some(::aws_smithy_http_server::routing::Route::new(svc));
|
475 + | Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
468 476 | self
|
469 477 | }
|
470 478 |
|
471 479 | /// Sets the [`ResponseCodeHttpFallbackOperation`](crate::operation_shape::ResponseCodeHttpFallbackOperation) operation.
|
472 480 | ///
|
473 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
474 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
481 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
482 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
475 483 | ///
|
476 484 | /// # Example
|
477 485 | ///
|
478 486 | /// ```no_run
|
479 487 | /// use misc::{MiscService, MiscServiceConfig};
|
480 488 | ///
|
481 489 | /// use misc::{input, output, error};
|
482 490 | ///
|
483 491 | /// async fn handler(input: input::ResponseCodeHttpFallbackOperationInput) -> Result<output::ResponseCodeHttpFallbackOperationOutput, error::ResponseCodeHttpFallbackOperationError> {
|
484 492 | /// todo!()
|
485 493 | /// }
|
486 494 | ///
|
487 495 | /// let config = MiscServiceConfig::builder().build();
|
488 496 | /// let app = MiscService::builder(config)
|
489 497 | /// .response_code_http_fallback_operation(handler)
|
490 498 | /// /* Set other handlers */
|
491 499 | /// .build()
|
492 500 | /// .unwrap();
|
493 - | /// # let app: MiscService<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::rest::router::RestRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
501 + | /// # let app: MiscService<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
494 502 | /// ```
|
495 503 | ///
|
496 504 | pub fn response_code_http_fallback_operation<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
497 505 | where
|
498 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::ResponseCodeHttpFallbackOperation, HandlerExtractors>,
|
506 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::ResponseCodeHttpFallbackOperation, HandlerExtractors>,
|
499 507 |
|
500 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
508 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
501 509 | MiscService<L>,
|
502 510 | crate::operation_shape::ResponseCodeHttpFallbackOperation,
|
503 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::ResponseCodeHttpFallbackOperation, HandlerType>
|
511 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::ResponseCodeHttpFallbackOperation, HandlerType>
|
504 512 | >,
|
505 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
513 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
506 514 | MiscService<L>,
|
507 515 | crate::operation_shape::ResponseCodeHttpFallbackOperation,
|
508 516 | ModelPl::Output
|
509 517 | >,
|
510 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
518 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
511 519 | MiscService<L>,
|
512 520 | crate::operation_shape::ResponseCodeHttpFallbackOperation,
|
513 521 | <
|
514 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
515 - | as ::aws_smithy_http_server::plugin::Plugin<
|
522 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
523 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
516 524 | MiscService<L>,
|
517 525 | crate::operation_shape::ResponseCodeHttpFallbackOperation,
|
518 526 | ModelPl::Output
|
519 527 | >
|
520 528 | >::Output
|
521 529 | >,
|
522 530 |
|
523 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
531 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
524 532 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
525 533 |
|
526 534 | {
|
527 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
528 - | use ::aws_smithy_http_server::plugin::Plugin;
|
535 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
536 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
529 537 | let svc = crate::operation_shape::ResponseCodeHttpFallbackOperation::from_handler(handler);
|
530 538 | let svc = self.model_plugin.apply(svc);
|
531 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
532 - | .apply(svc);
|
539 + | let svc =
|
540 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
541 + | .apply(svc);
|
533 542 | let svc = self.http_plugin.apply(svc);
|
534 543 | self.response_code_http_fallback_operation_custom(svc)
|
535 544 | }
|
536 545 |
|
537 546 | /// Sets the [`ResponseCodeHttpFallbackOperation`](crate::operation_shape::ResponseCodeHttpFallbackOperation) operation.
|
538 547 | ///
|
539 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
540 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
548 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
549 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
541 550 | ///
|
542 551 | /// # Example
|
543 552 | ///
|
544 553 | /// ```no_run
|
545 554 | /// use misc::{MiscService, MiscServiceConfig};
|
546 555 | ///
|
547 556 | /// use misc::{input, output, error};
|
548 557 | ///
|
549 558 | /// async fn handler(input: input::ResponseCodeHttpFallbackOperationInput) -> Result<output::ResponseCodeHttpFallbackOperationOutput, error::ResponseCodeHttpFallbackOperationError> {
|
550 559 | /// todo!()
|
551 560 | /// }
|
552 561 | ///
|
553 562 | /// let config = MiscServiceConfig::builder().build();
|
554 563 | /// let svc = ::tower::util::service_fn(handler);
|
555 564 | /// let app = MiscService::builder(config)
|
556 565 | /// .response_code_http_fallback_operation_service(svc)
|
557 566 | /// /* Set other handlers */
|
558 567 | /// .build()
|
559 568 | /// .unwrap();
|
560 - | /// # let app: MiscService<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::rest::router::RestRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
569 + | /// # let app: MiscService<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
561 570 | /// ```
|
562 571 | ///
|
563 572 | pub fn response_code_http_fallback_operation_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
564 573 | where
|
565 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::ResponseCodeHttpFallbackOperation, ServiceExtractors>,
|
574 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::ResponseCodeHttpFallbackOperation, ServiceExtractors>,
|
566 575 |
|
567 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
576 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
568 577 | MiscService<L>,
|
569 578 | crate::operation_shape::ResponseCodeHttpFallbackOperation,
|
570 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::ResponseCodeHttpFallbackOperation, S>
|
579 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::ResponseCodeHttpFallbackOperation, S>
|
571 580 | >,
|
572 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
581 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
573 582 | MiscService<L>,
|
574 583 | crate::operation_shape::ResponseCodeHttpFallbackOperation,
|
575 584 | ModelPl::Output
|
576 585 | >,
|
577 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
586 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
578 587 | MiscService<L>,
|
579 588 | crate::operation_shape::ResponseCodeHttpFallbackOperation,
|
580 589 | <
|
581 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
582 - | as ::aws_smithy_http_server::plugin::Plugin<
|
590 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
591 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
583 592 | MiscService<L>,
|
584 593 | crate::operation_shape::ResponseCodeHttpFallbackOperation,
|
585 594 | ModelPl::Output
|
586 595 | >
|
587 596 | >::Output
|
588 597 | >,
|
589 598 |
|
590 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
599 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
591 600 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
592 601 |
|
593 602 | {
|
594 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
595 - | use ::aws_smithy_http_server::plugin::Plugin;
|
603 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
604 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
596 605 | let svc = crate::operation_shape::ResponseCodeHttpFallbackOperation::from_service(service);
|
597 606 | let svc = self.model_plugin.apply(svc);
|
598 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
599 - | .apply(svc);
|
607 + | let svc =
|
608 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
609 + | .apply(svc);
|
600 610 | let svc = self.http_plugin.apply(svc);
|
601 611 | self.response_code_http_fallback_operation_custom(svc)
|
602 612 | }
|
603 613 |
|
604 614 | /// Sets the [`ResponseCodeHttpFallbackOperation`](crate::operation_shape::ResponseCodeHttpFallbackOperation) to a custom [`Service`](tower::Service).
|
605 615 | /// not constrained by the Smithy contract.
|
606 616 | fn response_code_http_fallback_operation_custom<S>(mut self, svc: S) -> Self
|
607 617 | where
|
608 618 | S: ::tower::Service<
|
609 619 | ::http::Request<Body>,
|
610 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
620 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
611 621 | Error = ::std::convert::Infallible,
|
612 622 | > + Clone
|
613 623 | + Send
|
614 624 | + 'static,
|
615 625 | S::Future: Send + 'static,
|
616 626 | {
|
617 627 | self.response_code_http_fallback_operation =
|
618 - | Some(::aws_smithy_http_server::routing::Route::new(svc));
|
628 + | Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
619 629 | self
|
620 630 | }
|
621 631 |
|
622 632 | /// Sets the [`ResponseCodeRequiredOperation`](crate::operation_shape::ResponseCodeRequiredOperation) operation.
|
623 633 | ///
|
624 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
625 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
634 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
635 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
626 636 | ///
|
627 637 | /// # Example
|
628 638 | ///
|
629 639 | /// ```no_run
|
630 640 | /// use misc::{MiscService, MiscServiceConfig};
|
631 641 | ///
|
632 642 | /// use misc::{input, output, error};
|
633 643 | ///
|
634 644 | /// async fn handler(input: input::ResponseCodeRequiredOperationInput) -> Result<output::ResponseCodeRequiredOperationOutput, error::ResponseCodeRequiredOperationError> {
|
635 645 | /// todo!()
|
636 646 | /// }
|
637 647 | ///
|
638 648 | /// let config = MiscServiceConfig::builder().build();
|
639 649 | /// let app = MiscService::builder(config)
|
640 650 | /// .response_code_required_operation(handler)
|
641 651 | /// /* Set other handlers */
|
642 652 | /// .build()
|
643 653 | /// .unwrap();
|
644 - | /// # let app: MiscService<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::rest::router::RestRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
654 + | /// # let app: MiscService<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
645 655 | /// ```
|
646 656 | ///
|
647 657 | pub fn response_code_required_operation<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
648 658 | where
|
649 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::ResponseCodeRequiredOperation, HandlerExtractors>,
|
659 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::ResponseCodeRequiredOperation, HandlerExtractors>,
|
650 660 |
|
651 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
661 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
652 662 | MiscService<L>,
|
653 663 | crate::operation_shape::ResponseCodeRequiredOperation,
|
654 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::ResponseCodeRequiredOperation, HandlerType>
|
664 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::ResponseCodeRequiredOperation, HandlerType>
|
655 665 | >,
|
656 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
666 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
657 667 | MiscService<L>,
|
658 668 | crate::operation_shape::ResponseCodeRequiredOperation,
|
659 669 | ModelPl::Output
|
660 670 | >,
|
661 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
671 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
662 672 | MiscService<L>,
|
663 673 | crate::operation_shape::ResponseCodeRequiredOperation,
|
664 674 | <
|
665 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
666 - | as ::aws_smithy_http_server::plugin::Plugin<
|
675 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
676 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
667 677 | MiscService<L>,
|
668 678 | crate::operation_shape::ResponseCodeRequiredOperation,
|
669 679 | ModelPl::Output
|
670 680 | >
|
671 681 | >::Output
|
672 682 | >,
|
673 683 |
|
674 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
684 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
675 685 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
676 686 |
|
677 687 | {
|
678 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
679 - | use ::aws_smithy_http_server::plugin::Plugin;
|
688 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
689 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
680 690 | let svc = crate::operation_shape::ResponseCodeRequiredOperation::from_handler(handler);
|
681 691 | let svc = self.model_plugin.apply(svc);
|
682 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
683 - | .apply(svc);
|
692 + | let svc =
|
693 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
694 + | .apply(svc);
|
684 695 | let svc = self.http_plugin.apply(svc);
|
685 696 | self.response_code_required_operation_custom(svc)
|
686 697 | }
|
687 698 |
|
688 699 | /// Sets the [`ResponseCodeRequiredOperation`](crate::operation_shape::ResponseCodeRequiredOperation) operation.
|
689 700 | ///
|
690 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
691 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
701 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
702 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
692 703 | ///
|
693 704 | /// # Example
|
694 705 | ///
|
695 706 | /// ```no_run
|
696 707 | /// use misc::{MiscService, MiscServiceConfig};
|
697 708 | ///
|
698 709 | /// use misc::{input, output, error};
|
699 710 | ///
|
700 711 | /// async fn handler(input: input::ResponseCodeRequiredOperationInput) -> Result<output::ResponseCodeRequiredOperationOutput, error::ResponseCodeRequiredOperationError> {
|
701 712 | /// todo!()
|
702 713 | /// }
|
703 714 | ///
|
704 715 | /// let config = MiscServiceConfig::builder().build();
|
705 716 | /// let svc = ::tower::util::service_fn(handler);
|
706 717 | /// let app = MiscService::builder(config)
|
707 718 | /// .response_code_required_operation_service(svc)
|
708 719 | /// /* Set other handlers */
|
709 720 | /// .build()
|
710 721 | /// .unwrap();
|
711 - | /// # let app: MiscService<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::rest::router::RestRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
722 + | /// # let app: MiscService<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
712 723 | /// ```
|
713 724 | ///
|
714 725 | pub fn response_code_required_operation_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
715 726 | where
|
716 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::ResponseCodeRequiredOperation, ServiceExtractors>,
|
727 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::ResponseCodeRequiredOperation, ServiceExtractors>,
|
717 728 |
|
718 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
729 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
719 730 | MiscService<L>,
|
720 731 | crate::operation_shape::ResponseCodeRequiredOperation,
|
721 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::ResponseCodeRequiredOperation, S>
|
732 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::ResponseCodeRequiredOperation, S>
|
722 733 | >,
|
723 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
734 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
724 735 | MiscService<L>,
|
725 736 | crate::operation_shape::ResponseCodeRequiredOperation,
|
726 737 | ModelPl::Output
|
727 738 | >,
|
728 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
739 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
729 740 | MiscService<L>,
|
730 741 | crate::operation_shape::ResponseCodeRequiredOperation,
|
731 742 | <
|
732 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
733 - | as ::aws_smithy_http_server::plugin::Plugin<
|
743 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
744 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
734 745 | MiscService<L>,
|
735 746 | crate::operation_shape::ResponseCodeRequiredOperation,
|
736 747 | ModelPl::Output
|
737 748 | >
|
738 749 | >::Output
|
739 750 | >,
|
740 751 |
|
741 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
752 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
742 753 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
743 754 |
|
744 755 | {
|
745 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
746 - | use ::aws_smithy_http_server::plugin::Plugin;
|
756 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
757 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
747 758 | let svc = crate::operation_shape::ResponseCodeRequiredOperation::from_service(service);
|
748 759 | let svc = self.model_plugin.apply(svc);
|
749 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
750 - | .apply(svc);
|
760 + | let svc =
|
761 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
762 + | .apply(svc);
|
751 763 | let svc = self.http_plugin.apply(svc);
|
752 764 | self.response_code_required_operation_custom(svc)
|
753 765 | }
|
754 766 |
|
755 767 | /// Sets the [`ResponseCodeRequiredOperation`](crate::operation_shape::ResponseCodeRequiredOperation) to a custom [`Service`](tower::Service).
|
756 768 | /// not constrained by the Smithy contract.
|
757 769 | fn response_code_required_operation_custom<S>(mut self, svc: S) -> Self
|
758 770 | where
|
759 771 | S: ::tower::Service<
|
760 772 | ::http::Request<Body>,
|
761 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
773 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
762 774 | Error = ::std::convert::Infallible,
|
763 775 | > + Clone
|
764 776 | + Send
|
765 777 | + 'static,
|
766 778 | S::Future: Send + 'static,
|
767 779 | {
|
768 780 | self.response_code_required_operation =
|
769 - | Some(::aws_smithy_http_server::routing::Route::new(svc));
|
781 + | Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
770 782 | self
|
771 783 | }
|
772 784 |
|
773 785 | /// Sets the [`TypeComplexityOperation`](crate::operation_shape::TypeComplexityOperation) operation.
|
774 786 | ///
|
775 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
776 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
787 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
788 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
777 789 | ///
|
778 790 | /// # Example
|
779 791 | ///
|
780 792 | /// ```no_run
|
781 793 | /// use misc::{MiscService, MiscServiceConfig};
|
782 794 | ///
|
783 795 | /// use misc::{input, output, error};
|
784 796 | ///
|
785 797 | /// async fn handler(input: input::TypeComplexityOperationInput) -> Result<output::TypeComplexityOperationOutput, error::TypeComplexityOperationError> {
|
786 798 | /// todo!()
|
787 799 | /// }
|
788 800 | ///
|
789 801 | /// let config = MiscServiceConfig::builder().build();
|
790 802 | /// let app = MiscService::builder(config)
|
791 803 | /// .type_complexity_operation(handler)
|
792 804 | /// /* Set other handlers */
|
793 805 | /// .build()
|
794 806 | /// .unwrap();
|
795 - | /// # let app: MiscService<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::rest::router::RestRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
807 + | /// # let app: MiscService<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
796 808 | /// ```
|
797 809 | ///
|
798 810 | pub fn type_complexity_operation<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
799 811 | where
|
800 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::TypeComplexityOperation, HandlerExtractors>,
|
812 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::TypeComplexityOperation, HandlerExtractors>,
|
801 813 |
|
802 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
814 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
803 815 | MiscService<L>,
|
804 816 | crate::operation_shape::TypeComplexityOperation,
|
805 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::TypeComplexityOperation, HandlerType>
|
817 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::TypeComplexityOperation, HandlerType>
|
806 818 | >,
|
807 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
819 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
808 820 | MiscService<L>,
|
809 821 | crate::operation_shape::TypeComplexityOperation,
|
810 822 | ModelPl::Output
|
811 823 | >,
|
812 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
824 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
813 825 | MiscService<L>,
|
814 826 | crate::operation_shape::TypeComplexityOperation,
|
815 827 | <
|
816 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
817 - | as ::aws_smithy_http_server::plugin::Plugin<
|
828 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
829 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
818 830 | MiscService<L>,
|
819 831 | crate::operation_shape::TypeComplexityOperation,
|
820 832 | ModelPl::Output
|
821 833 | >
|
822 834 | >::Output
|
823 835 | >,
|
824 836 |
|
825 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
837 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
826 838 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
827 839 |
|
828 840 | {
|
829 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
830 - | use ::aws_smithy_http_server::plugin::Plugin;
|
841 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
842 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
831 843 | let svc = crate::operation_shape::TypeComplexityOperation::from_handler(handler);
|
832 844 | let svc = self.model_plugin.apply(svc);
|
833 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
834 - | .apply(svc);
|
845 + | let svc =
|
846 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
847 + | .apply(svc);
|
835 848 | let svc = self.http_plugin.apply(svc);
|
836 849 | self.type_complexity_operation_custom(svc)
|
837 850 | }
|
838 851 |
|
839 852 | /// Sets the [`TypeComplexityOperation`](crate::operation_shape::TypeComplexityOperation) operation.
|
840 853 | ///
|
841 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
842 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
854 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
855 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
843 856 | ///
|
844 857 | /// # Example
|
845 858 | ///
|
846 859 | /// ```no_run
|
847 860 | /// use misc::{MiscService, MiscServiceConfig};
|
848 861 | ///
|
849 862 | /// use misc::{input, output, error};
|
850 863 | ///
|
851 864 | /// async fn handler(input: input::TypeComplexityOperationInput) -> Result<output::TypeComplexityOperationOutput, error::TypeComplexityOperationError> {
|
852 865 | /// todo!()
|
853 866 | /// }
|
854 867 | ///
|
855 868 | /// let config = MiscServiceConfig::builder().build();
|
856 869 | /// let svc = ::tower::util::service_fn(handler);
|
857 870 | /// let app = MiscService::builder(config)
|
858 871 | /// .type_complexity_operation_service(svc)
|
859 872 | /// /* Set other handlers */
|
860 873 | /// .build()
|
861 874 | /// .unwrap();
|
862 - | /// # let app: MiscService<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::rest::router::RestRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
875 + | /// # let app: MiscService<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
863 876 | /// ```
|
864 877 | ///
|
865 878 | pub fn type_complexity_operation_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
866 879 | where
|
867 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::TypeComplexityOperation, ServiceExtractors>,
|
880 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::TypeComplexityOperation, ServiceExtractors>,
|
868 881 |
|
869 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
882 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
870 883 | MiscService<L>,
|
871 884 | crate::operation_shape::TypeComplexityOperation,
|
872 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::TypeComplexityOperation, S>
|
885 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::TypeComplexityOperation, S>
|
873 886 | >,
|
874 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
887 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
875 888 | MiscService<L>,
|
876 889 | crate::operation_shape::TypeComplexityOperation,
|
877 890 | ModelPl::Output
|
878 891 | >,
|
879 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
892 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
880 893 | MiscService<L>,
|
881 894 | crate::operation_shape::TypeComplexityOperation,
|
882 895 | <
|
883 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
884 - | as ::aws_smithy_http_server::plugin::Plugin<
|
896 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
897 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
885 898 | MiscService<L>,
|
886 899 | crate::operation_shape::TypeComplexityOperation,
|
887 900 | ModelPl::Output
|
888 901 | >
|
889 902 | >::Output
|
890 903 | >,
|
891 904 |
|
892 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
905 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
893 906 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
894 907 |
|
895 908 | {
|
896 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
897 - | use ::aws_smithy_http_server::plugin::Plugin;
|
909 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
910 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
898 911 | let svc = crate::operation_shape::TypeComplexityOperation::from_service(service);
|
899 912 | let svc = self.model_plugin.apply(svc);
|
900 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
901 - | .apply(svc);
|
913 + | let svc =
|
914 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
915 + | .apply(svc);
|
902 916 | let svc = self.http_plugin.apply(svc);
|
903 917 | self.type_complexity_operation_custom(svc)
|
904 918 | }
|
905 919 |
|
906 920 | /// Sets the [`TypeComplexityOperation`](crate::operation_shape::TypeComplexityOperation) to a custom [`Service`](tower::Service).
|
907 921 | /// not constrained by the Smithy contract.
|
908 922 | fn type_complexity_operation_custom<S>(mut self, svc: S) -> Self
|
909 923 | where
|
910 924 | S: ::tower::Service<
|
911 925 | ::http::Request<Body>,
|
912 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
926 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
913 927 | Error = ::std::convert::Infallible,
|
914 928 | > + Clone
|
915 929 | + Send
|
916 930 | + 'static,
|
917 931 | S::Future: Send + 'static,
|
918 932 | {
|
919 - | self.type_complexity_operation = Some(::aws_smithy_http_server::routing::Route::new(svc));
|
933 + | self.type_complexity_operation =
|
934 + | Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
920 935 | self
|
921 936 | }
|
922 937 | }
|
923 938 |
|
924 939 | impl<Body, L, HttpPl, ModelPl> MiscServiceBuilder<Body, L, HttpPl, ModelPl> {
|
925 940 | /// Constructs a [`MiscService`] from the arguments provided to the builder.
|
926 941 | ///
|
927 942 | /// Forgetting to register a handler for one or more operations will result in an error.
|
928 943 | ///
|
929 944 | /// Check out [`MiscServiceBuilder::build_unchecked`] if you'd prefer the service to return status code 500 when an
|
930 945 | /// unspecified route is requested.
|
931 946 | pub fn build(
|
932 947 | self,
|
933 948 | ) -> ::std::result::Result<
|
934 949 | MiscService<
|
935 - | ::aws_smithy_http_server::routing::RoutingService<
|
936 - | ::aws_smithy_http_server::protocol::rest::router::RestRouter<L::Service>,
|
937 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
950 + | ::aws_smithy_legacy_http_server::routing::RoutingService<
|
951 + | ::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<L::Service>,
|
952 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
938 953 | >,
|
939 954 | >,
|
940 955 | MissingOperationsError,
|
941 956 | >
|
942 957 | where
|
943 - | L: ::tower::Layer<::aws_smithy_http_server::routing::Route<Body>>,
|
958 + | L: ::tower::Layer<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
944 959 | {
|
945 960 | let router = {
|
946 - | use ::aws_smithy_http_server::operation::OperationShape;
|
961 + | use ::aws_smithy_legacy_http_server::operation::OperationShape;
|
947 962 | let mut missing_operation_names = std::collections::HashMap::new();
|
948 963 | if self.required_header_collection_operation.is_none() {
|
949 964 | missing_operation_names.insert(
|
950 965 | crate::operation_shape::RequiredHeaderCollectionOperation::ID,
|
951 966 | ".required_header_collection_operation()",
|
952 967 | );
|
953 968 | }
|
954 969 | if self.required_inner_shape_operation.is_none() {
|
955 970 | missing_operation_names.insert(
|
956 971 | crate::operation_shape::RequiredInnerShapeOperation::ID,
|
957 972 | ".required_inner_shape_operation()",
|
958 973 | );
|
959 974 | }
|
960 975 | if self.response_code_default_operation.is_none() {
|
961 976 | missing_operation_names.insert(
|
962 977 | crate::operation_shape::ResponseCodeDefaultOperation::ID,
|
963 978 | ".response_code_default_operation()",
|
964 979 | );
|
965 980 | }
|
966 981 | if self.response_code_http_fallback_operation.is_none() {
|
967 982 | missing_operation_names.insert(
|
968 983 | crate::operation_shape::ResponseCodeHttpFallbackOperation::ID,
|
969 984 | ".response_code_http_fallback_operation()",
|
970 985 | );
|
971 986 | }
|
972 987 | if self.response_code_required_operation.is_none() {
|
973 988 | missing_operation_names.insert(
|
974 989 | crate::operation_shape::ResponseCodeRequiredOperation::ID,
|
975 990 | ".response_code_required_operation()",
|
976 991 | );
|
977 992 | }
|
978 993 | if self.type_complexity_operation.is_none() {
|
979 994 | missing_operation_names.insert(
|
980 995 | crate::operation_shape::TypeComplexityOperation::ID,
|
981 996 | ".type_complexity_operation()",
|
982 997 | );
|
983 998 | }
|
984 999 | if !missing_operation_names.is_empty() {
|
985 1000 | return Err(MissingOperationsError {
|
986 1001 | operation_names2setter_methods: missing_operation_names,
|
987 1002 | });
|
988 1003 | }
|
989 1004 | 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";
|
990 1005 |
|
991 - | ::aws_smithy_http_server::protocol::rest::router::RestRouter::from_iter([
|
1006 + | ::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter::from_iter([
|
992 1007 | (
|
993 1008 | request_specs::required_header_collection_operation(),
|
994 1009 | self.required_header_collection_operation
|
995 1010 | .expect(unexpected_error_msg),
|
996 1011 | ),
|
997 1012 | (
|
998 1013 | request_specs::required_inner_shape_operation(),
|
999 1014 | self.required_inner_shape_operation
|
1000 1015 | .expect(unexpected_error_msg),
|
1001 1016 | ),
|
1002 1017 | (
|
1003 1018 | request_specs::response_code_default_operation(),
|
1004 1019 | self.response_code_default_operation
|
1005 1020 | .expect(unexpected_error_msg),
|
1006 1021 | ),
|
1007 1022 | (
|
1008 1023 | request_specs::response_code_http_fallback_operation(),
|
1009 1024 | self.response_code_http_fallback_operation
|
1010 1025 | .expect(unexpected_error_msg),
|
1011 1026 | ),
|
1012 1027 | (
|
1013 1028 | request_specs::response_code_required_operation(),
|
1014 1029 | self.response_code_required_operation
|
1015 1030 | .expect(unexpected_error_msg),
|
1016 1031 | ),
|
1017 1032 | (
|
1018 1033 | request_specs::type_complexity_operation(),
|
1019 1034 | self.type_complexity_operation.expect(unexpected_error_msg),
|
1020 1035 | ),
|
1021 1036 | ])
|
1022 1037 | };
|
1023 - | let svc = ::aws_smithy_http_server::routing::RoutingService::new(router);
|
1038 + | let svc = ::aws_smithy_legacy_http_server::routing::RoutingService::new(router);
|
1024 1039 | let svc = svc.map(|s| s.layer(self.layer));
|
1025 1040 | Ok(MiscService { svc })
|
1026 1041 | }
|
1027 1042 |
|
1028 1043 | /// Constructs a [`MiscService`] from the arguments provided to the builder.
|
1029 1044 | /// Operations without a handler default to returning 500 Internal Server Error to the caller.
|
1030 1045 | ///
|
1031 1046 | /// Check out [`MiscServiceBuilder::build`] if you'd prefer the builder to fail if one or more operations do
|
1032 1047 | /// not have a registered handler.
|
1033 1048 | pub fn build_unchecked(self) -> MiscService<L::Service>
|
1034 1049 | where
|
1035 1050 | Body: Send + 'static,
|
1036 1051 | L: ::tower::Layer<
|
1037 - | ::aws_smithy_http_server::routing::RoutingService<
|
1038 - | ::aws_smithy_http_server::protocol::rest::router::RestRouter<
|
1039 - | ::aws_smithy_http_server::routing::Route<Body>,
|
1052 + | ::aws_smithy_legacy_http_server::routing::RoutingService<
|
1053 + | ::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<
|
1054 + | ::aws_smithy_legacy_http_server::routing::Route<Body>,
|
1040 1055 | >,
|
1041 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
1056 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
1042 1057 | >,
|
1043 1058 | >,
|
1044 1059 | {
|
1045 - | let router = ::aws_smithy_http_server::protocol::rest::router::RestRouter::from_iter([
|
1046 - | (
|
1047 - | request_specs::required_header_collection_operation(),
|
1048 - | self.required_header_collection_operation
|
1049 - | .unwrap_or_else(|| {
|
1050 - | let svc = ::aws_smithy_http_server::operation::MissingFailure::<
|
1051 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
1060 + | let router =
|
1061 + | ::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter::from_iter([
|
1062 + | (
|
1063 + | request_specs::required_header_collection_operation(),
|
1064 + | self.required_header_collection_operation
|
1065 + | .unwrap_or_else(|| {
|
1066 + | let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<
|
1067 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
1068 + | >::default();
|
1069 + | ::aws_smithy_legacy_http_server::routing::Route::new(svc)
|
1070 + | }),
|
1071 + | ),
|
1072 + | (
|
1073 + | request_specs::required_inner_shape_operation(),
|
1074 + | self.required_inner_shape_operation.unwrap_or_else(|| {
|
1075 + | let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<
|
1076 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
1052 1077 | >::default();
|
1053 - | ::aws_smithy_http_server::routing::Route::new(svc)
|
1078 + | ::aws_smithy_legacy_http_server::routing::Route::new(svc)
|
1054 1079 | }),
|
1055 - | ),
|
1056 - | (
|
1057 - | request_specs::required_inner_shape_operation(),
|
1058 - | self.required_inner_shape_operation.unwrap_or_else(|| {
|
1059 - | let svc = ::aws_smithy_http_server::operation::MissingFailure::<
|
1060 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
1061 - | >::default();
|
1062 - | ::aws_smithy_http_server::routing::Route::new(svc)
|
1063 - | }),
|
1064 - | ),
|
1065 - | (
|
1066 - | request_specs::response_code_default_operation(),
|
1067 - | self.response_code_default_operation.unwrap_or_else(|| {
|
1068 - | let svc = ::aws_smithy_http_server::operation::MissingFailure::<
|
1069 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
1070 - | >::default();
|
1071 - | ::aws_smithy_http_server::routing::Route::new(svc)
|
1072 - | }),
|
1073 - | ),
|
1074 - | (
|
1075 - | request_specs::response_code_http_fallback_operation(),
|
1076 - | self.response_code_http_fallback_operation
|
1077 - | .unwrap_or_else(|| {
|
1078 - | let svc = ::aws_smithy_http_server::operation::MissingFailure::<
|
1079 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
1080 + | ),
|
1081 + | (
|
1082 + | request_specs::response_code_default_operation(),
|
1083 + | self.response_code_default_operation.unwrap_or_else(|| {
|
1084 + | let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<
|
1085 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
1080 1086 | >::default();
|
1081 - | ::aws_smithy_http_server::routing::Route::new(svc)
|
1087 + | ::aws_smithy_legacy_http_server::routing::Route::new(svc)
|
1082 1088 | }),
|
1083 - | ),
|
1084 - | (
|
1085 - | request_specs::response_code_required_operation(),
|
1086 - | self.response_code_required_operation.unwrap_or_else(|| {
|
1087 - | let svc = ::aws_smithy_http_server::operation::MissingFailure::<
|
1088 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
1089 - | >::default();
|
1090 - | ::aws_smithy_http_server::routing::Route::new(svc)
|
1091 - | }),
|
1092 - | ),
|
1093 - | (
|
1094 - | request_specs::type_complexity_operation(),
|
1095 - | self.type_complexity_operation.unwrap_or_else(|| {
|
1096 - | let svc = ::aws_smithy_http_server::operation::MissingFailure::<
|
1097 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
1098 - | >::default();
|
1099 - | ::aws_smithy_http_server::routing::Route::new(svc)
|
1100 - | }),
|
1101 - | ),
|
1102 - | ]);
|
1089 + | ),
|
1090 + | (
|
1091 + | request_specs::response_code_http_fallback_operation(),
|
1092 + | self.response_code_http_fallback_operation
|
1093 + | .unwrap_or_else(|| {
|
1094 + | let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<
|
1095 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
1096 + | >::default();
|
1097 + | ::aws_smithy_legacy_http_server::routing::Route::new(svc)
|
1098 + | }),
|
1099 + | ),
|
1100 + | (
|
1101 + | request_specs::response_code_required_operation(),
|
1102 + | self.response_code_required_operation.unwrap_or_else(|| {
|
1103 + | let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<
|
1104 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
1105 + | >::default();
|
1106 + | ::aws_smithy_legacy_http_server::routing::Route::new(svc)
|
1107 + | }),
|
1108 + | ),
|
1109 + | (
|
1110 + | request_specs::type_complexity_operation(),
|
1111 + | self.type_complexity_operation.unwrap_or_else(|| {
|
1112 + | let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<
|
1113 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
1114 + | >::default();
|
1115 + | ::aws_smithy_legacy_http_server::routing::Route::new(svc)
|
1116 + | }),
|
1117 + | ),
|
1118 + | ]);
|
1103 1119 | let svc = self
|
1104 1120 | .layer
|
1105 - | .layer(::aws_smithy_http_server::routing::RoutingService::new(
|
1106 - | router,
|
1107 - | ));
|
1121 + | .layer(::aws_smithy_legacy_http_server::routing::RoutingService::new(router));
|
1108 1122 | MiscService { svc }
|
1109 1123 | }
|
1110 1124 | }
|
1111 1125 |
|
1112 1126 | /// The error encountered when calling the [`MiscServiceBuilder::build`] method if one or more operation handlers are not
|
1113 1127 | /// specified.
|
1114 1128 | #[derive(Debug)]
|
1115 1129 | pub struct MissingOperationsError {
|
1116 1130 | operation_names2setter_methods:
|
1117 - | std::collections::HashMap<::aws_smithy_http_server::shape_id::ShapeId, &'static str>,
|
1131 + | std::collections::HashMap<::aws_smithy_legacy_http_server::shape_id::ShapeId, &'static str>,
|
1118 1132 | }
|
1119 1133 |
|
1120 1134 | impl std::fmt::Display for MissingOperationsError {
|
1121 1135 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1122 1136 | write!(
|
1123 1137 | f,
|
1124 1138 | "You must specify a handler for all operations attached to `MiscService`.\n\
|
1125 1139 | We are missing handlers for the following operations:\n",
|
1126 1140 | )?;
|
1127 1141 | for operation_name in self.operation_names2setter_methods.keys() {
|
1128 1142 | writeln!(f, "- {}", operation_name.absolute())?;
|
1129 1143 | }
|
1130 1144 |
|
1131 1145 | writeln!(
|
1132 1146 | f,
|
1133 1147 | "\nUse the dedicated methods on `MiscServiceBuilder` to register the missing handlers:"
|
1134 1148 | )?;
|
1135 1149 | for setter_name in self.operation_names2setter_methods.values() {
|
1136 1150 | writeln!(f, "- {}", setter_name)?;
|
1137 1151 | }
|
1138 1152 | Ok(())
|
1139 1153 | }
|
1140 1154 | }
|
1141 1155 |
|
1142 1156 | impl std::error::Error for MissingOperationsError {}
|
1143 1157 |
|
1144 1158 | mod request_specs {
|
1145 1159 | pub(super) fn required_header_collection_operation(
|
1146 - | ) -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
|
1147 - | ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
|
1160 + | ) -> ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec {
|
1161 + | ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec::new(
|
1148 1162 | ::http::Method::GET,
|
1149 - | ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
|
1150 - | ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
|
1151 - | ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
|
1152 - | ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("required-header-collection-operation")),
|
1163 + | ::aws_smithy_legacy_http_server::routing::request_spec::UriSpec::new(
|
1164 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathAndQuerySpec::new(
|
1165 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
|
1166 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathSegment::Literal(String::from("required-header-collection-operation")),
|
1153 1167 | ]),
|
1154 - | ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
|
1168 + | ::aws_smithy_legacy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
|
1155 1169 | ])
|
1156 1170 | )
|
1157 1171 | ),
|
1158 1172 | )
|
1159 1173 | }
|
1160 1174 | pub(super) fn required_inner_shape_operation(
|
1161 - | ) -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
|
1162 - | ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
|
1175 + | ) -> ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec {
|
1176 + | ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec::new(
|
1163 1177 | ::http::Method::POST,
|
1164 - | ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
|
1165 - | ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
|
1166 - | ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
|
1167 - | ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("requiredInnerShapeOperation")),
|
1178 + | ::aws_smithy_legacy_http_server::routing::request_spec::UriSpec::new(
|
1179 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathAndQuerySpec::new(
|
1180 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
|
1181 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathSegment::Literal(String::from("requiredInnerShapeOperation")),
|
1168 1182 | ]),
|
1169 - | ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
|
1183 + | ::aws_smithy_legacy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
|
1170 1184 | ])
|
1171 1185 | )
|
1172 1186 | ),
|
1173 1187 | )
|
1174 1188 | }
|
1175 1189 | pub(super) fn response_code_default_operation(
|
1176 - | ) -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
|
1177 - | ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
|
1190 + | ) -> ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec {
|
1191 + | ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec::new(
|
1178 1192 | ::http::Method::GET,
|
1179 - | ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
|
1180 - | ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
|
1181 - | ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
|
1182 - | ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("responseCodeDefaultOperation")),
|
1193 + | ::aws_smithy_legacy_http_server::routing::request_spec::UriSpec::new(
|
1194 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathAndQuerySpec::new(
|
1195 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
|
1196 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathSegment::Literal(String::from("responseCodeDefaultOperation")),
|
1183 1197 | ]),
|
1184 - | ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
|
1198 + | ::aws_smithy_legacy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
|
1185 1199 | ])
|
1186 1200 | )
|
1187 1201 | ),
|
1188 1202 | )
|
1189 1203 | }
|
1190 1204 | pub(super) fn response_code_http_fallback_operation(
|
1191 - | ) -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
|
1192 - | ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
|
1205 + | ) -> ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec {
|
1206 + | ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec::new(
|
1193 1207 | ::http::Method::GET,
|
1194 - | ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
|
1195 - | ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
|
1196 - | ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
|
1197 - | ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("responseCodeHttpFallbackOperation")),
|
1208 + | ::aws_smithy_legacy_http_server::routing::request_spec::UriSpec::new(
|
1209 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathAndQuerySpec::new(
|
1210 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
|
1211 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathSegment::Literal(String::from("responseCodeHttpFallbackOperation")),
|
1198 1212 | ]),
|
1199 - | ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
|
1213 + | ::aws_smithy_legacy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
|
1200 1214 | ])
|
1201 1215 | )
|
1202 1216 | ),
|
1203 1217 | )
|
1204 1218 | }
|
1205 1219 | pub(super) fn response_code_required_operation(
|
1206 - | ) -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
|
1207 - | ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
|
1220 + | ) -> ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec {
|
1221 + | ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec::new(
|
1208 1222 | ::http::Method::GET,
|
1209 - | ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
|
1210 - | ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
|
1211 - | ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
|
1212 - | ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("responseCodeRequiredOperation")),
|
1223 + | ::aws_smithy_legacy_http_server::routing::request_spec::UriSpec::new(
|
1224 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathAndQuerySpec::new(
|
1225 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
|
1226 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathSegment::Literal(String::from("responseCodeRequiredOperation")),
|
1213 1227 | ]),
|
1214 - | ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
|
1228 + | ::aws_smithy_legacy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
|
1215 1229 | ])
|
1216 1230 | )
|
1217 1231 | ),
|
1218 1232 | )
|
1219 1233 | }
|
1220 1234 | pub(super) fn type_complexity_operation(
|
1221 - | ) -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
|
1222 - | ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
|
1235 + | ) -> ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec {
|
1236 + | ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec::new(
|
1223 1237 | ::http::Method::POST,
|
1224 - | ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
|
1225 - | ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
|
1226 - | ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
|
1227 - | ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("typeComplexityOperation")),
|
1238 + | ::aws_smithy_legacy_http_server::routing::request_spec::UriSpec::new(
|
1239 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathAndQuerySpec::new(
|
1240 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
|
1241 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathSegment::Literal(String::from("typeComplexityOperation")),
|
1228 1242 | ]),
|
1229 - | ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
|
1243 + | ::aws_smithy_legacy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
|
1230 1244 | ])
|
1231 1245 | )
|
1232 1246 | ),
|
1233 1247 | )
|
1234 1248 | }
|
1235 1249 | }
|
1236 1250 |
|
1237 1251 | /// A service to test miscellaneous aspects of code generation where protocol selection is not relevant. If you want to test something protocol-specific, add it to a separate `\[protocol\]-extras.smithy`.
|
1238 1252 | ///
|
1239 1253 | /// See the [root](crate) documentation for more information.
|
1240 1254 | #[derive(Clone)]
|
1241 1255 | pub struct MiscService<
|
1242 - | S = ::aws_smithy_http_server::routing::RoutingService<
|
1243 - | ::aws_smithy_http_server::protocol::rest::router::RestRouter<
|
1244 - | ::aws_smithy_http_server::routing::Route<::aws_smithy_http_server::body::BoxBody>,
|
1256 + | S = ::aws_smithy_legacy_http_server::routing::RoutingService<
|
1257 + | ::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<
|
1258 + | ::aws_smithy_legacy_http_server::routing::Route<
|
1259 + | ::aws_smithy_legacy_http_server::body::BoxBody,
|
1260 + | >,
|
1245 1261 | >,
|
1246 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
1262 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
1247 1263 | >,
|
1248 1264 | > {
|
1249 1265 | // This is the router wrapped by layers.
|
1250 1266 | svc: S,
|
1251 1267 | }
|
1252 1268 |
|
1253 1269 | impl MiscService<()> {
|
1254 1270 | /// Constructs a builder for [`MiscService`].
|
1255 1271 | /// You must specify a configuration object holding any plugins and layers that should be applied
|
1256 1272 | /// to the operations in this service.
|
1257 1273 | pub fn builder<
|
1258 1274 | Body,
|
1259 1275 | L,
|
1260 - | HttpPl: ::aws_smithy_http_server::plugin::HttpMarker,
|
1261 - | ModelPl: ::aws_smithy_http_server::plugin::ModelMarker,
|
1276 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::HttpMarker,
|
1277 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::ModelMarker,
|
1262 1278 | >(
|
1263 1279 | config: MiscServiceConfig<L, HttpPl, ModelPl>,
|
1264 1280 | ) -> MiscServiceBuilder<Body, L, HttpPl, ModelPl> {
|
1265 1281 | MiscServiceBuilder {
|
1266 1282 | required_header_collection_operation: None,
|
1267 1283 | required_inner_shape_operation: None,
|
1268 1284 | response_code_default_operation: None,
|
1269 1285 | response_code_http_fallback_operation: None,
|
1270 1286 | response_code_required_operation: None,
|
1271 1287 | type_complexity_operation: None,
|
1272 1288 | layer: config.layers,
|
1273 1289 | http_plugin: config.http_plugins,
|
1274 1290 | model_plugin: config.model_plugins,
|
1275 1291 | }
|
1276 1292 | }
|
1277 1293 |
|
1278 1294 | /// Constructs a builder for [`MiscService`].
|
1279 1295 | /// You must specify what plugins should be applied to the operations in this service.
|
1280 1296 | ///
|
1281 1297 | /// Use [`MiscService::builder_without_plugins`] if you don't need to apply plugins.
|
1282 1298 | ///
|
1283 - | /// Check out [`HttpPlugins`](::aws_smithy_http_server::plugin::HttpPlugins) and
|
1284 - | /// [`ModelPlugins`](::aws_smithy_http_server::plugin::ModelPlugins) if you need to apply
|
1299 + | /// Check out [`HttpPlugins`](::aws_smithy_legacy_http_server::plugin::HttpPlugins) and
|
1300 + | /// [`ModelPlugins`](::aws_smithy_legacy_http_server::plugin::ModelPlugins) if you need to apply
|
1285 1301 | /// multiple plugins.
|
1286 1302 | #[deprecated(
|
1287 1303 | since = "0.57.0",
|
1288 1304 | note = "please use the `builder` constructor and register plugins on the `MiscServiceConfig` object instead; see https://github.com/smithy-lang/smithy-rs/discussions/3096"
|
1289 1305 | )]
|
1290 1306 | pub fn builder_with_plugins<
|
1291 1307 | Body,
|
1292 - | HttpPl: ::aws_smithy_http_server::plugin::HttpMarker,
|
1293 - | ModelPl: ::aws_smithy_http_server::plugin::ModelMarker,
|
1308 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::HttpMarker,
|
1309 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::ModelMarker,
|
1294 1310 | >(
|
1295 1311 | http_plugin: HttpPl,
|
1296 1312 | model_plugin: ModelPl,
|
1297 1313 | ) -> MiscServiceBuilder<Body, ::tower::layer::util::Identity, HttpPl, ModelPl> {
|
1298 1314 | MiscServiceBuilder {
|
1299 1315 | required_header_collection_operation: None,
|
1300 1316 | required_inner_shape_operation: None,
|
1301 1317 | response_code_default_operation: None,
|
1302 1318 | response_code_http_fallback_operation: None,
|
1303 1319 | response_code_required_operation: None,
|
1304 1320 | type_complexity_operation: None,
|
1305 1321 | layer: ::tower::layer::util::Identity::new(),
|
1306 1322 | http_plugin,
|
1307 1323 | model_plugin,
|
1308 1324 | }
|
1309 1325 | }
|
1310 1326 |
|
1311 1327 | /// Constructs a builder for [`MiscService`].
|
1312 1328 | ///
|
1313 1329 | /// Use [`MiscService::builder_with_plugins`] if you need to specify plugins.
|
1314 1330 | #[deprecated(
|
1315 1331 | since = "0.57.0",
|
1316 1332 | note = "please use the `builder` constructor instead; see https://github.com/smithy-lang/smithy-rs/discussions/3096"
|
1317 1333 | )]
|
1318 1334 | pub fn builder_without_plugins<Body>() -> MiscServiceBuilder<
|
1319 1335 | Body,
|
1320 1336 | ::tower::layer::util::Identity,
|
1321 - | ::aws_smithy_http_server::plugin::IdentityPlugin,
|
1322 - | ::aws_smithy_http_server::plugin::IdentityPlugin,
|
1337 + | ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
|
1338 + | ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
|
1323 1339 | > {
|
1324 1340 | Self::builder_with_plugins(
|
1325 - | ::aws_smithy_http_server::plugin::IdentityPlugin,
|
1326 - | ::aws_smithy_http_server::plugin::IdentityPlugin,
|
1341 + | ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
|
1342 + | ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
|
1327 1343 | )
|
1328 1344 | }
|
1329 1345 | }
|
1330 1346 |
|
1331 1347 | impl<S> MiscService<S> {
|
1332 1348 | /// Converts [`MiscService`] into a [`MakeService`](tower::make::MakeService).
|
1333 - | pub fn into_make_service(self) -> ::aws_smithy_http_server::routing::IntoMakeService<Self> {
|
1334 - | ::aws_smithy_http_server::routing::IntoMakeService::new(self)
|
1349 + | pub fn into_make_service(
|
1350 + | self,
|
1351 + | ) -> ::aws_smithy_legacy_http_server::routing::IntoMakeService<Self> {
|
1352 + | ::aws_smithy_legacy_http_server::routing::IntoMakeService::new(self)
|
1335 1353 | }
|
1336 1354 |
|
1337 - | /// Converts [`MiscService`] into a [`MakeService`](tower::make::MakeService) with [`ConnectInfo`](::aws_smithy_http_server::request::connect_info::ConnectInfo).
|
1355 + | /// Converts [`MiscService`] into a [`MakeService`](tower::make::MakeService) with [`ConnectInfo`](::aws_smithy_legacy_http_server::request::connect_info::ConnectInfo).
|
1338 1356 | pub fn into_make_service_with_connect_info<C>(
|
1339 1357 | self,
|
1340 - | ) -> ::aws_smithy_http_server::routing::IntoMakeServiceWithConnectInfo<Self, C> {
|
1341 - | ::aws_smithy_http_server::routing::IntoMakeServiceWithConnectInfo::new(self)
|
1358 + | ) -> ::aws_smithy_legacy_http_server::routing::IntoMakeServiceWithConnectInfo<Self, C> {
|
1359 + | ::aws_smithy_legacy_http_server::routing::IntoMakeServiceWithConnectInfo::new(self)
|
1342 1360 | }
|
1343 1361 | }
|
1344 1362 |
|
1345 1363 | impl<S>
|
1346 1364 | MiscService<
|
1347 - | ::aws_smithy_http_server::routing::RoutingService<
|
1348 - | ::aws_smithy_http_server::protocol::rest::router::RestRouter<S>,
|
1349 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
1365 + | ::aws_smithy_legacy_http_server::routing::RoutingService<
|
1366 + | ::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<S>,
|
1367 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
1350 1368 | >,
|
1351 1369 | >
|
1352 1370 | {
|
1353 1371 | /// Applies a [`Layer`](::tower::Layer) uniformly to all routes.
|
1354 1372 | #[deprecated(
|
1355 1373 | since = "0.57.0",
|
1356 1374 | note = "please add layers to the `MiscServiceConfig` object instead; see https://github.com/smithy-lang/smithy-rs/discussions/3096"
|
1357 1375 | )]
|
1358 1376 | pub fn layer<L>(
|
1359 1377 | self,
|
1360 1378 | layer: &L,
|
1361 1379 | ) -> MiscService<
|
1362 - | ::aws_smithy_http_server::routing::RoutingService<
|
1363 - | ::aws_smithy_http_server::protocol::rest::router::RestRouter<L::Service>,
|
1364 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
1380 + | ::aws_smithy_legacy_http_server::routing::RoutingService<
|
1381 + | ::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<L::Service>,
|
1382 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
1365 1383 | >,
|
1366 1384 | >
|
1367 1385 | where
|
1368 1386 | L: ::tower::Layer<S>,
|
1369 1387 | {
|
1370 1388 | MiscService {
|
1371 1389 | svc: self.svc.map(|s| s.layer(layer)),
|
1372 1390 | }
|
1373 1391 | }
|
1374 1392 |
|
1375 - | /// Applies [`Route::new`](::aws_smithy_http_server::routing::Route::new) to all routes.
|
1393 + | /// Applies [`Route::new`](::aws_smithy_legacy_http_server::routing::Route::new) to all routes.
|
1376 1394 | ///
|
1377 1395 | /// This has the effect of erasing all types accumulated via layers.
|
1378 1396 | pub fn boxed<B>(
|
1379 1397 | self,
|
1380 1398 | ) -> MiscService<
|
1381 - | ::aws_smithy_http_server::routing::RoutingService<
|
1382 - | ::aws_smithy_http_server::protocol::rest::router::RestRouter<
|
1383 - | ::aws_smithy_http_server::routing::Route<B>,
|
1399 + | ::aws_smithy_legacy_http_server::routing::RoutingService<
|
1400 + | ::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<
|
1401 + | ::aws_smithy_legacy_http_server::routing::Route<B>,
|
1384 1402 | >,
|
1385 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
1403 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
1386 1404 | >,
|
1387 1405 | >
|
1388 1406 | where
|
1389 1407 | S: ::tower::Service<
|
1390 1408 | ::http::Request<B>,
|
1391 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
1409 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
1392 1410 | Error = std::convert::Infallible,
|
1393 1411 | >,
|
1394 1412 | S: Clone + Send + 'static,
|
1395 1413 | S::Future: Send + 'static,
|
1396 1414 | {
|
1397 1415 | self.layer(&::tower::layer::layer_fn(
|
1398 - | ::aws_smithy_http_server::routing::Route::new,
|
1416 + | ::aws_smithy_legacy_http_server::routing::Route::new,
|
1399 1417 | ))
|
1400 1418 | }
|
1401 1419 | }
|
1402 1420 |
|
1403 1421 | impl<S, R> ::tower::Service<R> for MiscService<S>
|
1404 1422 | where
|
1405 1423 | S: ::tower::Service<R>,
|
1406 1424 | {
|
1407 1425 | type Response = S::Response;
|
1408 1426 | type Error = S::Error;
|
1409 1427 | type Future = S::Future;
|
1410 1428 |
|
1411 1429 | fn poll_ready(
|
1412 1430 | &mut self,
|
1413 1431 | cx: &mut std::task::Context,
|
1414 1432 | ) -> std::task::Poll<::std::result::Result<(), Self::Error>> {
|
1415 1433 | self.svc.poll_ready(cx)
|
1416 1434 | }
|
1417 1435 |
|
1418 1436 | fn call(&mut self, request: R) -> Self::Future {
|
1419 1437 | self.svc.call(request)
|
1420 1438 | }
|
1421 1439 | }
|
1422 1440 |
|
1423 1441 | /// An enumeration of all [operations](https://smithy.io/2.0/spec/service-types.html#operation) in MiscService.
|
1424 1442 | #[allow(clippy::enum_variant_names)]
|
1425 1443 | #[derive(Debug, PartialEq, Eq, Clone, Copy)]
|
1426 1444 | pub enum Operation {
|
1427 1445 | RequiredHeaderCollectionOperation,
|
1428 1446 | RequiredInnerShapeOperation,
|
1429 1447 | ResponseCodeDefaultOperation,
|
1430 1448 | ResponseCodeHttpFallbackOperation,
|
1431 1449 | ResponseCodeRequiredOperation,
|
1432 1450 | TypeComplexityOperation,
|
1433 1451 | }
|
1434 1452 |
|
1435 1453 | impl Operation {
|
1436 - | /// Returns the [operations](https://smithy.io/2.0/spec/service-types.html#operation) [`ShapeId`](::aws_smithy_http_server::shape_id::ShapeId).
|
1437 - | pub fn shape_id(&self) -> ::aws_smithy_http_server::shape_id::ShapeId {
|
1454 + | /// Returns the [operations](https://smithy.io/2.0/spec/service-types.html#operation) [`ShapeId`](::aws_smithy_legacy_http_server::shape_id::ShapeId).
|
1455 + | pub fn shape_id(&self) -> ::aws_smithy_legacy_http_server::shape_id::ShapeId {
|
1438 1456 | match self {
|
1439 1457 | Operation::RequiredHeaderCollectionOperation => {
|
1440 - | ::aws_smithy_http_server::shape_id::ShapeId::new(
|
1458 + | ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
1441 1459 | "aws.protocoltests.misc#RequiredHeaderCollectionOperation",
|
1442 1460 | "aws.protocoltests.misc",
|
1443 1461 | "RequiredHeaderCollectionOperation",
|
1444 1462 | )
|
1445 1463 | }
|
1446 1464 | Operation::RequiredInnerShapeOperation => {
|
1447 - | ::aws_smithy_http_server::shape_id::ShapeId::new(
|
1465 + | ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
1448 1466 | "aws.protocoltests.misc#RequiredInnerShapeOperation",
|
1449 1467 | "aws.protocoltests.misc",
|
1450 1468 | "RequiredInnerShapeOperation",
|
1451 1469 | )
|
1452 1470 | }
|
1453 1471 | Operation::ResponseCodeDefaultOperation => {
|
1454 - | ::aws_smithy_http_server::shape_id::ShapeId::new(
|
1472 + | ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
1455 1473 | "aws.protocoltests.misc#ResponseCodeDefaultOperation",
|
1456 1474 | "aws.protocoltests.misc",
|
1457 1475 | "ResponseCodeDefaultOperation",
|
1458 1476 | )
|
1459 1477 | }
|
1460 1478 | Operation::ResponseCodeHttpFallbackOperation => {
|
1461 - | ::aws_smithy_http_server::shape_id::ShapeId::new(
|
1479 + | ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
1462 1480 | "aws.protocoltests.misc#ResponseCodeHttpFallbackOperation",
|
1463 1481 | "aws.protocoltests.misc",
|
1464 1482 | "ResponseCodeHttpFallbackOperation",
|
1465 1483 | )
|
1466 1484 | }
|
1467 1485 | Operation::ResponseCodeRequiredOperation => {
|
1468 - | ::aws_smithy_http_server::shape_id::ShapeId::new(
|
1486 + | ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
1469 1487 | "aws.protocoltests.misc#ResponseCodeRequiredOperation",
|
1470 1488 | "aws.protocoltests.misc",
|
1471 1489 | "ResponseCodeRequiredOperation",
|
1472 1490 | )
|
1473 1491 | }
|
1474 - | Operation::TypeComplexityOperation => ::aws_smithy_http_server::shape_id::ShapeId::new(
|
1475 - | "aws.protocoltests.misc#TypeComplexityOperation",
|
1476 - | "aws.protocoltests.misc",
|
1477 - | "TypeComplexityOperation",
|
1478 - | ),
|
1492 + | Operation::TypeComplexityOperation => {
|
1493 + | ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
1494 + | "aws.protocoltests.misc#TypeComplexityOperation",
|
1495 + | "aws.protocoltests.misc",
|
1496 + | "TypeComplexityOperation",
|
1497 + | )
|
1498 + | }
|
1479 1499 | }
|
1480 1500 | }
|
1481 1501 | }
|
1482 1502 | impl<L>
|
1483 - | ::aws_smithy_http_server::service::ContainsOperation<
|
1503 + | ::aws_smithy_legacy_http_server::service::ContainsOperation<
|
1484 1504 | crate::operation_shape::RequiredHeaderCollectionOperation,
|
1485 1505 | > for MiscService<L>
|
1486 1506 | {
|
1487 1507 | const VALUE: Operation = Operation::RequiredHeaderCollectionOperation;
|
1488 1508 | }
|
1489 1509 | impl<L>
|
1490 - | ::aws_smithy_http_server::service::ContainsOperation<
|
1510 + | ::aws_smithy_legacy_http_server::service::ContainsOperation<
|
1491 1511 | crate::operation_shape::RequiredInnerShapeOperation,
|
1492 1512 | > for MiscService<L>
|
1493 1513 | {
|
1494 1514 | const VALUE: Operation = Operation::RequiredInnerShapeOperation;
|
1495 1515 | }
|
1496 1516 | impl<L>
|
1497 - | ::aws_smithy_http_server::service::ContainsOperation<
|
1517 + | ::aws_smithy_legacy_http_server::service::ContainsOperation<
|
1498 1518 | crate::operation_shape::ResponseCodeDefaultOperation,
|
1499 1519 | > for MiscService<L>
|
1500 1520 | {
|
1501 1521 | const VALUE: Operation = Operation::ResponseCodeDefaultOperation;
|
1502 1522 | }
|
1503 1523 | impl<L>
|
1504 - | ::aws_smithy_http_server::service::ContainsOperation<
|
1524 + | ::aws_smithy_legacy_http_server::service::ContainsOperation<
|
1505 1525 | crate::operation_shape::ResponseCodeHttpFallbackOperation,
|
1506 1526 | > for MiscService<L>
|
1507 1527 | {
|
1508 1528 | const VALUE: Operation = Operation::ResponseCodeHttpFallbackOperation;
|
1509 1529 | }
|
1510 1530 | impl<L>
|
1511 - | ::aws_smithy_http_server::service::ContainsOperation<
|
1531 + | ::aws_smithy_legacy_http_server::service::ContainsOperation<
|
1512 1532 | crate::operation_shape::ResponseCodeRequiredOperation,
|
1513 1533 | > for MiscService<L>
|
1514 1534 | {
|
1515 1535 | const VALUE: Operation = Operation::ResponseCodeRequiredOperation;
|
1516 1536 | }
|
1517 1537 | impl<L>
|
1518 - | ::aws_smithy_http_server::service::ContainsOperation<
|
1538 + | ::aws_smithy_legacy_http_server::service::ContainsOperation<
|
1519 1539 | crate::operation_shape::TypeComplexityOperation,
|
1520 1540 | > for MiscService<L>
|
1521 1541 | {
|
1522 1542 | const VALUE: Operation = Operation::TypeComplexityOperation;
|
1523 1543 | }
|
1524 1544 |
|
1525 - | impl<S> ::aws_smithy_http_server::service::ServiceShape for MiscService<S> {
|
1526 - | const ID: ::aws_smithy_http_server::shape_id::ShapeId =
|
1527 - | ::aws_smithy_http_server::shape_id::ShapeId::new(
|
1545 + | impl<S> ::aws_smithy_legacy_http_server::service::ServiceShape for MiscService<S> {
|
1546 + | const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
|
1547 + | ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
1528 1548 | "aws.protocoltests.misc#MiscService",
|
1529 1549 | "aws.protocoltests.misc",
|
1530 1550 | "MiscService",
|
1531 1551 | );
|
1532 1552 |
|
1533 1553 | const VERSION: Option<&'static str> = Some("");
|
1534 1554 |
|
1535 - | type Protocol = ::aws_smithy_http_server::protocol::rest_json_1::RestJson1;
|
1555 + | type Protocol = ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1;
|
1536 1556 |
|
1537 1557 | type Operations = Operation;
|
1538 1558 | }
|
1539 1559 | /// Configuration for the [`MiscService`]. This is the central place where to register and
|
1540 1560 | /// configure [`::tower::Layer`]s, HTTP plugins, and model plugins.
|
1541 1561 | ///
|
1542 1562 | /// ```rust,no_run
|
1543 1563 | /// # use misc::MiscServiceConfig;
|
1544 - | /// # use ::aws_smithy_http_server::plugin::IdentityPlugin;
|
1564 + | /// # use ::aws_smithy_legacy_http_server::plugin::IdentityPlugin;
|
1545 1565 | /// # use ::tower::layer::util::Identity;
|
1546 1566 | /// # let authentication_plugin = IdentityPlugin;
|
1547 1567 | /// # let authorization_plugin = IdentityPlugin;
|
1548 1568 | /// # let server_request_id_provider_layer = Identity::new();
|
1549 1569 | /// let config = MiscServiceConfig::builder()
|
1550 1570 | /// // Layers get executed first...
|
1551 1571 | /// .layer(server_request_id_provider_layer)
|
1552 1572 | /// // ...then HTTP plugins...
|
1553 1573 | /// .http_plugin(authentication_plugin)
|
1554 1574 | /// // ...and right after deserialization, model plugins.
|
1555 1575 | /// .model_plugin(authorization_plugin)
|
1556 1576 | /// .build();
|
1557 1577 | /// ```
|
1558 1578 | ///
|
1559 1579 | /// See the [`plugin`] system for details.
|
1560 1580 | ///
|
1561 - | /// [`plugin`]: ::aws_smithy_http_server::plugin
|
1581 + | /// [`plugin`]: ::aws_smithy_legacy_http_server::plugin
|
1562 1582 | #[derive(::std::fmt::Debug)]
|
1563 1583 | pub struct MiscServiceConfig<L, H, M> {
|
1564 1584 | layers: L,
|
1565 1585 | http_plugins: H,
|
1566 1586 | model_plugins: M,
|
1567 1587 | }
|
1568 1588 |
|
1569 1589 | impl MiscServiceConfig<(), (), ()> {
|
1570 1590 | /// Returns a builder to construct the configuration.
|
1571 1591 | pub fn builder() -> MiscServiceConfigBuilder<
|
1572 1592 | ::tower::layer::util::Identity,
|
1573 - | ::aws_smithy_http_server::plugin::IdentityPlugin,
|
1574 - | ::aws_smithy_http_server::plugin::IdentityPlugin,
|
1593 + | ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
|
1594 + | ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
|
1575 1595 | > {
|
1576 1596 | MiscServiceConfigBuilder {
|
1577 1597 | layers: ::tower::layer::util::Identity::new(),
|
1578 - | http_plugins: ::aws_smithy_http_server::plugin::IdentityPlugin,
|
1579 - | model_plugins: ::aws_smithy_http_server::plugin::IdentityPlugin,
|
1598 + | http_plugins: ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
|
1599 + | model_plugins: ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
|
1580 1600 | }
|
1581 1601 | }
|
1582 1602 | }
|
1583 1603 |
|
1584 1604 | /// Builder returned by [`MiscServiceConfig::builder()`].
|
1585 1605 | #[derive(::std::fmt::Debug)]
|
1586 1606 | pub struct MiscServiceConfigBuilder<L, H, M> {
|
1587 1607 | pub(crate) layers: L,
|
1588 1608 | pub(crate) http_plugins: H,
|
1589 1609 | pub(crate) model_plugins: M,
|
1590 1610 | }
|
1591 1611 |
|
1592 1612 | impl<L, H, M> MiscServiceConfigBuilder<L, H, M> {
|
1593 1613 | /// Add a [`::tower::Layer`] to the service.
|
1594 1614 | pub fn layer<NewLayer>(
|
1595 1615 | self,
|
1596 1616 | layer: NewLayer,
|
1597 1617 | ) -> MiscServiceConfigBuilder<::tower::layer::util::Stack<NewLayer, L>, H, M> {
|
1598 1618 | MiscServiceConfigBuilder {
|
1599 1619 | layers: ::tower::layer::util::Stack::new(layer, self.layers),
|
1600 1620 | http_plugins: self.http_plugins,
|
1601 1621 | model_plugins: self.model_plugins,
|
1602 1622 | }
|
1603 1623 | }
|
1604 1624 |
|
1605 1625 | /// Add a HTTP [plugin] to the service.
|
1606 1626 | ///
|
1607 - | /// [plugin]: ::aws_smithy_http_server::plugin
|
1627 + | /// [plugin]: ::aws_smithy_legacy_http_server::plugin
|
1608 1628 | // We eagerly require `NewPlugin: HttpMarker`, despite not really needing it, because compiler
|
1609 1629 | // errors get _substantially_ better if the user makes a mistake.
|
1610 - | pub fn http_plugin<NewPlugin: ::aws_smithy_http_server::plugin::HttpMarker>(
|
1630 + | pub fn http_plugin<NewPlugin: ::aws_smithy_legacy_http_server::plugin::HttpMarker>(
|
1611 1631 | self,
|
1612 1632 | http_plugin: NewPlugin,
|
1613 - | ) -> MiscServiceConfigBuilder<L, ::aws_smithy_http_server::plugin::PluginStack<NewPlugin, H>, M>
|
1614 - | {
|
1633 + | ) -> MiscServiceConfigBuilder<
|
1634 + | L,
|
1635 + | ::aws_smithy_legacy_http_server::plugin::PluginStack<NewPlugin, H>,
|
1636 + | M,
|
1637 + | > {
|
1615 1638 | MiscServiceConfigBuilder {
|
1616 1639 | layers: self.layers,
|
1617 - | http_plugins: ::aws_smithy_http_server::plugin::PluginStack::new(
|
1640 + | http_plugins: ::aws_smithy_legacy_http_server::plugin::PluginStack::new(
|
1618 1641 | http_plugin,
|
1619 1642 | self.http_plugins,
|
1620 1643 | ),
|
1621 1644 | model_plugins: self.model_plugins,
|
1622 1645 | }
|
1623 1646 | }
|
1624 1647 |
|
1625 1648 | /// Add a model [plugin] to the service.
|
1626 1649 | ///
|
1627 - | /// [plugin]: ::aws_smithy_http_server::plugin
|
1650 + | /// [plugin]: ::aws_smithy_legacy_http_server::plugin
|
1628 1651 | // We eagerly require `NewPlugin: ModelMarker`, despite not really needing it, because compiler
|
1629 1652 | // errors get _substantially_ better if the user makes a mistake.
|
1630 - | pub fn model_plugin<NewPlugin: ::aws_smithy_http_server::plugin::ModelMarker>(
|
1653 + | pub fn model_plugin<NewPlugin: ::aws_smithy_legacy_http_server::plugin::ModelMarker>(
|
1631 1654 | self,
|
1632 1655 | model_plugin: NewPlugin,
|
1633 - | ) -> MiscServiceConfigBuilder<L, H, ::aws_smithy_http_server::plugin::PluginStack<NewPlugin, M>>
|
1634 - | {
|
1656 + | ) -> MiscServiceConfigBuilder<
|
1657 + | L,
|
1658 + | H,
|
1659 + | ::aws_smithy_legacy_http_server::plugin::PluginStack<NewPlugin, M>,
|
1660 + | > {
|
1635 1661 | MiscServiceConfigBuilder {
|
1636 1662 | layers: self.layers,
|
1637 1663 | http_plugins: self.http_plugins,
|
1638 - | model_plugins: ::aws_smithy_http_server::plugin::PluginStack::new(
|
1664 + | model_plugins: ::aws_smithy_legacy_http_server::plugin::PluginStack::new(
|
1639 1665 | model_plugin,
|
1640 1666 | self.model_plugins,
|
1641 1667 | ),
|
1642 1668 | }
|
1643 1669 | }
|
1644 1670 |
|
1645 1671 | /// Build the configuration.
|
1646 1672 | pub fn build(self) -> super::MiscServiceConfig<L, H, M> {
|
1647 1673 | super::MiscServiceConfig {
|
1648 1674 | layers: self.layers,
|