1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 2 | /// The service builder for [`PokemonService`].
|
3 3 | ///
|
4 4 | /// Constructed via [`PokemonService::builder`].
|
5 5 | pub struct PokemonServiceBuilder<Body, L, HttpPl, ModelPl> {
|
6 - | check_health: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
7 - | do_nothing: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
8 - | get_pokemon_species: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
9 - | get_server_statistics: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
6 + | check_health: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
7 + | do_nothing: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
8 + | get_pokemon_species: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
9 + | get_server_statistics: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
10 10 | layer: L,
|
11 11 | http_plugin: HttpPl,
|
12 12 | model_plugin: ModelPl,
|
13 13 | }
|
14 14 |
|
15 15 | impl<Body, L, HttpPl, ModelPl> PokemonServiceBuilder<Body, L, HttpPl, ModelPl> {
|
16 16 | /// Sets the [`CheckHealth`](crate::operation_shape::CheckHealth) operation.
|
17 17 | ///
|
18 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
19 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
18 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
19 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
20 20 | ///
|
21 21 | /// # Example
|
22 22 | ///
|
23 23 | /// ```no_run
|
24 24 | /// use pokemon_service_server_sdk::{PokemonService, PokemonServiceConfig};
|
25 25 | ///
|
26 26 | /// use pokemon_service_server_sdk::{input, output, error};
|
27 27 | ///
|
28 28 | /// async fn handler(input: input::CheckHealthInput) -> Result<output::CheckHealthOutput, error::CheckHealthError> {
|
29 29 | /// todo!()
|
30 30 | /// }
|
31 31 | ///
|
32 32 | /// let config = PokemonServiceConfig::builder().build();
|
33 33 | /// let app = PokemonService::builder(config)
|
34 34 | /// .check_health(handler)
|
35 35 | /// /* Set other handlers */
|
36 36 | /// .build()
|
37 37 | /// .unwrap();
|
38 - | /// # let app: PokemonService<::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;
|
38 + | /// # let app: PokemonService<::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;
|
39 39 | /// ```
|
40 40 | ///
|
41 41 | pub fn check_health<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
42 42 | where
|
43 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::CheckHealth, HandlerExtractors>,
|
43 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::CheckHealth, HandlerExtractors>,
|
44 44 |
|
45 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
45 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
46 46 | PokemonService<L>,
|
47 47 | crate::operation_shape::CheckHealth,
|
48 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::CheckHealth, HandlerType>
|
48 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::CheckHealth, HandlerType>
|
49 49 | >,
|
50 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
50 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
51 51 | PokemonService<L>,
|
52 52 | crate::operation_shape::CheckHealth,
|
53 53 | ModelPl::Output
|
54 54 | >,
|
55 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
55 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
56 56 | PokemonService<L>,
|
57 57 | crate::operation_shape::CheckHealth,
|
58 58 | <
|
59 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
60 - | as ::aws_smithy_http_server::plugin::Plugin<
|
59 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
60 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
61 61 | PokemonService<L>,
|
62 62 | crate::operation_shape::CheckHealth,
|
63 63 | ModelPl::Output
|
64 64 | >
|
65 65 | >::Output
|
66 66 | >,
|
67 67 |
|
68 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
68 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
69 69 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
70 70 |
|
71 71 | {
|
72 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
73 - | use ::aws_smithy_http_server::plugin::Plugin;
|
72 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
73 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
74 74 | let svc = crate::operation_shape::CheckHealth::from_handler(handler);
|
75 75 | let svc = self.model_plugin.apply(svc);
|
76 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
76 + | let svc =
|
77 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
77 78 | .apply(svc);
|
78 79 | let svc = self.http_plugin.apply(svc);
|
79 80 | self.check_health_custom(svc)
|
80 81 | }
|
81 82 |
|
82 83 | /// Sets the [`CheckHealth`](crate::operation_shape::CheckHealth) operation.
|
83 84 | ///
|
84 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
85 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
85 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
86 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
86 87 | ///
|
87 88 | /// # Example
|
88 89 | ///
|
89 90 | /// ```no_run
|
90 91 | /// use pokemon_service_server_sdk::{PokemonService, PokemonServiceConfig};
|
91 92 | ///
|
92 93 | /// use pokemon_service_server_sdk::{input, output, error};
|
93 94 | ///
|
94 95 | /// async fn handler(input: input::CheckHealthInput) -> Result<output::CheckHealthOutput, error::CheckHealthError> {
|
95 96 | /// todo!()
|
96 97 | /// }
|
97 98 | ///
|
98 99 | /// let config = PokemonServiceConfig::builder().build();
|
99 100 | /// let svc = ::tower::util::service_fn(handler);
|
100 101 | /// let app = PokemonService::builder(config)
|
101 102 | /// .check_health_service(svc)
|
102 103 | /// /* Set other handlers */
|
103 104 | /// .build()
|
104 105 | /// .unwrap();
|
105 - | /// # let app: PokemonService<::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;
|
106 + | /// # let app: PokemonService<::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;
|
106 107 | /// ```
|
107 108 | ///
|
108 109 | pub fn check_health_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
109 110 | where
|
110 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::CheckHealth, ServiceExtractors>,
|
111 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::CheckHealth, ServiceExtractors>,
|
111 112 |
|
112 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
113 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
113 114 | PokemonService<L>,
|
114 115 | crate::operation_shape::CheckHealth,
|
115 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::CheckHealth, S>
|
116 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::CheckHealth, S>
|
116 117 | >,
|
117 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
118 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
118 119 | PokemonService<L>,
|
119 120 | crate::operation_shape::CheckHealth,
|
120 121 | ModelPl::Output
|
121 122 | >,
|
122 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
123 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
123 124 | PokemonService<L>,
|
124 125 | crate::operation_shape::CheckHealth,
|
125 126 | <
|
126 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
127 - | as ::aws_smithy_http_server::plugin::Plugin<
|
127 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
128 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
128 129 | PokemonService<L>,
|
129 130 | crate::operation_shape::CheckHealth,
|
130 131 | ModelPl::Output
|
131 132 | >
|
132 133 | >::Output
|
133 134 | >,
|
134 135 |
|
135 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
136 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
136 137 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
137 138 |
|
138 139 | {
|
139 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
140 - | use ::aws_smithy_http_server::plugin::Plugin;
|
140 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
141 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
141 142 | let svc = crate::operation_shape::CheckHealth::from_service(service);
|
142 143 | let svc = self.model_plugin.apply(svc);
|
143 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
144 + | let svc =
|
145 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
144 146 | .apply(svc);
|
145 147 | let svc = self.http_plugin.apply(svc);
|
146 148 | self.check_health_custom(svc)
|
147 149 | }
|
148 150 |
|
149 151 | /// Sets the [`CheckHealth`](crate::operation_shape::CheckHealth) to a custom [`Service`](tower::Service).
|
150 152 | /// not constrained by the Smithy contract.
|
151 153 | fn check_health_custom<S>(mut self, svc: S) -> Self
|
152 154 | where
|
153 155 | S: ::tower::Service<
|
154 156 | ::http::Request<Body>,
|
155 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
157 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
156 158 | Error = ::std::convert::Infallible,
|
157 159 | > + Clone
|
158 160 | + Send
|
159 161 | + 'static,
|
160 162 | S::Future: Send + 'static,
|
161 163 | {
|
162 - | self.check_health = Some(::aws_smithy_http_server::routing::Route::new(svc));
|
164 + | self.check_health = Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
163 165 | self
|
164 166 | }
|
165 167 |
|
166 168 | /// Sets the [`DoNothing`](crate::operation_shape::DoNothing) operation.
|
167 169 | ///
|
168 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
169 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
170 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
171 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
170 172 | ///
|
171 173 | /// # Example
|
172 174 | ///
|
173 175 | /// ```no_run
|
174 176 | /// use pokemon_service_server_sdk::{PokemonService, PokemonServiceConfig};
|
175 177 | ///
|
176 178 | /// use pokemon_service_server_sdk::{input, output, error};
|
177 179 | ///
|
178 180 | /// async fn handler(input: input::DoNothingInput) -> Result<output::DoNothingOutput, error::DoNothingError> {
|
179 181 | /// todo!()
|
180 182 | /// }
|
181 183 | ///
|
182 184 | /// let config = PokemonServiceConfig::builder().build();
|
183 185 | /// let app = PokemonService::builder(config)
|
184 186 | /// .do_nothing(handler)
|
185 187 | /// /* Set other handlers */
|
186 188 | /// .build()
|
187 189 | /// .unwrap();
|
188 - | /// # let app: PokemonService<::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;
|
190 + | /// # let app: PokemonService<::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;
|
189 191 | /// ```
|
190 192 | ///
|
191 193 | pub fn do_nothing<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
192 194 | where
|
193 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::DoNothing, HandlerExtractors>,
|
195 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::DoNothing, HandlerExtractors>,
|
194 196 |
|
195 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
197 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
196 198 | PokemonService<L>,
|
197 199 | crate::operation_shape::DoNothing,
|
198 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::DoNothing, HandlerType>
|
200 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::DoNothing, HandlerType>
|
199 201 | >,
|
200 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
202 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
201 203 | PokemonService<L>,
|
202 204 | crate::operation_shape::DoNothing,
|
203 205 | ModelPl::Output
|
204 206 | >,
|
205 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
207 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
206 208 | PokemonService<L>,
|
207 209 | crate::operation_shape::DoNothing,
|
208 210 | <
|
209 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
210 - | as ::aws_smithy_http_server::plugin::Plugin<
|
211 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
212 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
211 213 | PokemonService<L>,
|
212 214 | crate::operation_shape::DoNothing,
|
213 215 | ModelPl::Output
|
214 216 | >
|
215 217 | >::Output
|
216 218 | >,
|
217 219 |
|
218 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
220 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
219 221 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
220 222 |
|
221 223 | {
|
222 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
223 - | use ::aws_smithy_http_server::plugin::Plugin;
|
224 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
225 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
224 226 | let svc = crate::operation_shape::DoNothing::from_handler(handler);
|
225 227 | let svc = self.model_plugin.apply(svc);
|
226 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
228 + | let svc =
|
229 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
227 230 | .apply(svc);
|
228 231 | let svc = self.http_plugin.apply(svc);
|
229 232 | self.do_nothing_custom(svc)
|
230 233 | }
|
231 234 |
|
232 235 | /// Sets the [`DoNothing`](crate::operation_shape::DoNothing) operation.
|
233 236 | ///
|
234 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
235 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
237 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
238 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
236 239 | ///
|
237 240 | /// # Example
|
238 241 | ///
|
239 242 | /// ```no_run
|
240 243 | /// use pokemon_service_server_sdk::{PokemonService, PokemonServiceConfig};
|
241 244 | ///
|
242 245 | /// use pokemon_service_server_sdk::{input, output, error};
|
243 246 | ///
|
244 247 | /// async fn handler(input: input::DoNothingInput) -> Result<output::DoNothingOutput, error::DoNothingError> {
|
245 248 | /// todo!()
|
246 249 | /// }
|
247 250 | ///
|
248 251 | /// let config = PokemonServiceConfig::builder().build();
|
249 252 | /// let svc = ::tower::util::service_fn(handler);
|
250 253 | /// let app = PokemonService::builder(config)
|
251 254 | /// .do_nothing_service(svc)
|
252 255 | /// /* Set other handlers */
|
253 256 | /// .build()
|
254 257 | /// .unwrap();
|
255 - | /// # let app: PokemonService<::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;
|
258 + | /// # let app: PokemonService<::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;
|
256 259 | /// ```
|
257 260 | ///
|
258 261 | pub fn do_nothing_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
259 262 | where
|
260 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::DoNothing, ServiceExtractors>,
|
263 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::DoNothing, ServiceExtractors>,
|
261 264 |
|
262 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
265 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
263 266 | PokemonService<L>,
|
264 267 | crate::operation_shape::DoNothing,
|
265 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::DoNothing, S>
|
268 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::DoNothing, S>
|
266 269 | >,
|
267 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
270 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
268 271 | PokemonService<L>,
|
269 272 | crate::operation_shape::DoNothing,
|
270 273 | ModelPl::Output
|
271 274 | >,
|
272 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
275 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
273 276 | PokemonService<L>,
|
274 277 | crate::operation_shape::DoNothing,
|
275 278 | <
|
276 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
277 - | as ::aws_smithy_http_server::plugin::Plugin<
|
279 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
280 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
278 281 | PokemonService<L>,
|
279 282 | crate::operation_shape::DoNothing,
|
280 283 | ModelPl::Output
|
281 284 | >
|
282 285 | >::Output
|
283 286 | >,
|
284 287 |
|
285 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
288 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
286 289 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
287 290 |
|
288 291 | {
|
289 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
290 - | use ::aws_smithy_http_server::plugin::Plugin;
|
292 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
293 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
291 294 | let svc = crate::operation_shape::DoNothing::from_service(service);
|
292 295 | let svc = self.model_plugin.apply(svc);
|
293 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
296 + | let svc =
|
297 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
294 298 | .apply(svc);
|
295 299 | let svc = self.http_plugin.apply(svc);
|
296 300 | self.do_nothing_custom(svc)
|
297 301 | }
|
298 302 |
|
299 303 | /// Sets the [`DoNothing`](crate::operation_shape::DoNothing) to a custom [`Service`](tower::Service).
|
300 304 | /// not constrained by the Smithy contract.
|
301 305 | fn do_nothing_custom<S>(mut self, svc: S) -> Self
|
302 306 | where
|
303 307 | S: ::tower::Service<
|
304 308 | ::http::Request<Body>,
|
305 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
309 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
306 310 | Error = ::std::convert::Infallible,
|
307 311 | > + Clone
|
308 312 | + Send
|
309 313 | + 'static,
|
310 314 | S::Future: Send + 'static,
|
311 315 | {
|
312 - | self.do_nothing = Some(::aws_smithy_http_server::routing::Route::new(svc));
|
316 + | self.do_nothing = Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
313 317 | self
|
314 318 | }
|
315 319 |
|
316 320 | /// Sets the [`GetPokemonSpecies`](crate::operation_shape::GetPokemonSpecies) operation.
|
317 321 | ///
|
318 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
319 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
322 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
323 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
320 324 | ///
|
321 325 | /// # Example
|
322 326 | ///
|
323 327 | /// ```no_run
|
324 328 | /// use pokemon_service_server_sdk::{PokemonService, PokemonServiceConfig};
|
325 329 | ///
|
326 330 | /// use pokemon_service_server_sdk::{input, output, error};
|
327 331 | ///
|
328 332 | /// async fn handler(input: input::GetPokemonSpeciesInput) -> Result<output::GetPokemonSpeciesOutput, error::GetPokemonSpeciesError> {
|
329 333 | /// todo!()
|
330 334 | /// }
|
331 335 | ///
|
332 336 | /// let config = PokemonServiceConfig::builder().build();
|
333 337 | /// let app = PokemonService::builder(config)
|
334 338 | /// .get_pokemon_species(handler)
|
335 339 | /// /* Set other handlers */
|
336 340 | /// .build()
|
337 341 | /// .unwrap();
|
338 - | /// # let app: PokemonService<::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;
|
342 + | /// # let app: PokemonService<::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;
|
339 343 | /// ```
|
340 344 | ///
|
341 345 | pub fn get_pokemon_species<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
342 346 | where
|
343 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::GetPokemonSpecies, HandlerExtractors>,
|
347 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::GetPokemonSpecies, HandlerExtractors>,
|
344 348 |
|
345 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
349 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
346 350 | PokemonService<L>,
|
347 351 | crate::operation_shape::GetPokemonSpecies,
|
348 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::GetPokemonSpecies, HandlerType>
|
352 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::GetPokemonSpecies, HandlerType>
|
349 353 | >,
|
350 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
354 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
351 355 | PokemonService<L>,
|
352 356 | crate::operation_shape::GetPokemonSpecies,
|
353 357 | ModelPl::Output
|
354 358 | >,
|
355 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
359 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
356 360 | PokemonService<L>,
|
357 361 | crate::operation_shape::GetPokemonSpecies,
|
358 362 | <
|
359 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
360 - | as ::aws_smithy_http_server::plugin::Plugin<
|
363 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
364 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
361 365 | PokemonService<L>,
|
362 366 | crate::operation_shape::GetPokemonSpecies,
|
363 367 | ModelPl::Output
|
364 368 | >
|
365 369 | >::Output
|
366 370 | >,
|
367 371 |
|
368 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
372 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
369 373 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
370 374 |
|
371 375 | {
|
372 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
373 - | use ::aws_smithy_http_server::plugin::Plugin;
|
376 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
377 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
374 378 | let svc = crate::operation_shape::GetPokemonSpecies::from_handler(handler);
|
375 379 | let svc = self.model_plugin.apply(svc);
|
376 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
380 + | let svc =
|
381 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
377 382 | .apply(svc);
|
378 383 | let svc = self.http_plugin.apply(svc);
|
379 384 | self.get_pokemon_species_custom(svc)
|
380 385 | }
|
381 386 |
|
382 387 | /// Sets the [`GetPokemonSpecies`](crate::operation_shape::GetPokemonSpecies) operation.
|
383 388 | ///
|
384 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
385 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
389 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
390 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
386 391 | ///
|
387 392 | /// # Example
|
388 393 | ///
|
389 394 | /// ```no_run
|
390 395 | /// use pokemon_service_server_sdk::{PokemonService, PokemonServiceConfig};
|
391 396 | ///
|
392 397 | /// use pokemon_service_server_sdk::{input, output, error};
|
393 398 | ///
|
394 399 | /// async fn handler(input: input::GetPokemonSpeciesInput) -> Result<output::GetPokemonSpeciesOutput, error::GetPokemonSpeciesError> {
|
395 400 | /// todo!()
|
396 401 | /// }
|
397 402 | ///
|
398 403 | /// let config = PokemonServiceConfig::builder().build();
|
399 404 | /// let svc = ::tower::util::service_fn(handler);
|
400 405 | /// let app = PokemonService::builder(config)
|
401 406 | /// .get_pokemon_species_service(svc)
|
402 407 | /// /* Set other handlers */
|
403 408 | /// .build()
|
404 409 | /// .unwrap();
|
405 - | /// # let app: PokemonService<::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;
|
410 + | /// # let app: PokemonService<::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;
|
406 411 | /// ```
|
407 412 | ///
|
408 413 | pub fn get_pokemon_species_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
409 414 | where
|
410 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::GetPokemonSpecies, ServiceExtractors>,
|
415 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::GetPokemonSpecies, ServiceExtractors>,
|
411 416 |
|
412 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
417 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
413 418 | PokemonService<L>,
|
414 419 | crate::operation_shape::GetPokemonSpecies,
|
415 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::GetPokemonSpecies, S>
|
420 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::GetPokemonSpecies, S>
|
416 421 | >,
|
417 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
422 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
418 423 | PokemonService<L>,
|
419 424 | crate::operation_shape::GetPokemonSpecies,
|
420 425 | ModelPl::Output
|
421 426 | >,
|
422 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
427 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
423 428 | PokemonService<L>,
|
424 429 | crate::operation_shape::GetPokemonSpecies,
|
425 430 | <
|
426 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
427 - | as ::aws_smithy_http_server::plugin::Plugin<
|
431 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
432 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
428 433 | PokemonService<L>,
|
429 434 | crate::operation_shape::GetPokemonSpecies,
|
430 435 | ModelPl::Output
|
431 436 | >
|
432 437 | >::Output
|
433 438 | >,
|
434 439 |
|
435 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
440 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
436 441 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
437 442 |
|
438 443 | {
|
439 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
440 - | use ::aws_smithy_http_server::plugin::Plugin;
|
444 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
445 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
441 446 | let svc = crate::operation_shape::GetPokemonSpecies::from_service(service);
|
442 447 | let svc = self.model_plugin.apply(svc);
|
443 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
448 + | let svc =
|
449 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
444 450 | .apply(svc);
|
445 451 | let svc = self.http_plugin.apply(svc);
|
446 452 | self.get_pokemon_species_custom(svc)
|
447 453 | }
|
448 454 |
|
449 455 | /// Sets the [`GetPokemonSpecies`](crate::operation_shape::GetPokemonSpecies) to a custom [`Service`](tower::Service).
|
450 456 | /// not constrained by the Smithy contract.
|
451 457 | fn get_pokemon_species_custom<S>(mut self, svc: S) -> Self
|
452 458 | where
|
453 459 | S: ::tower::Service<
|
454 460 | ::http::Request<Body>,
|
455 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
461 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
456 462 | Error = ::std::convert::Infallible,
|
457 463 | > + Clone
|
458 464 | + Send
|
459 465 | + 'static,
|
460 466 | S::Future: Send + 'static,
|
461 467 | {
|
462 - | self.get_pokemon_species = Some(::aws_smithy_http_server::routing::Route::new(svc));
|
468 + | self.get_pokemon_species = Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
463 469 | self
|
464 470 | }
|
465 471 |
|
466 472 | /// Sets the [`GetServerStatistics`](crate::operation_shape::GetServerStatistics) operation.
|
467 473 | ///
|
468 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
469 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
474 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
475 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
470 476 | ///
|
471 477 | /// # Example
|
472 478 | ///
|
473 479 | /// ```no_run
|
474 480 | /// use pokemon_service_server_sdk::{PokemonService, PokemonServiceConfig};
|
475 481 | ///
|
476 482 | /// use pokemon_service_server_sdk::{input, output, error};
|
477 483 | ///
|
478 484 | /// async fn handler(input: input::GetServerStatisticsInput) -> Result<output::GetServerStatisticsOutput, error::GetServerStatisticsError> {
|
479 485 | /// todo!()
|
480 486 | /// }
|
481 487 | ///
|
482 488 | /// let config = PokemonServiceConfig::builder().build();
|
483 489 | /// let app = PokemonService::builder(config)
|
484 490 | /// .get_server_statistics(handler)
|
485 491 | /// /* Set other handlers */
|
486 492 | /// .build()
|
487 493 | /// .unwrap();
|
488 - | /// # let app: PokemonService<::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;
|
494 + | /// # let app: PokemonService<::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;
|
489 495 | /// ```
|
490 496 | ///
|
491 497 | pub fn get_server_statistics<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
492 498 | where
|
493 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::GetServerStatistics, HandlerExtractors>,
|
499 + | HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::GetServerStatistics, HandlerExtractors>,
|
494 500 |
|
495 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
501 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
496 502 | PokemonService<L>,
|
497 503 | crate::operation_shape::GetServerStatistics,
|
498 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::GetServerStatistics, HandlerType>
|
504 + | ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::GetServerStatistics, HandlerType>
|
499 505 | >,
|
500 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
506 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
501 507 | PokemonService<L>,
|
502 508 | crate::operation_shape::GetServerStatistics,
|
503 509 | ModelPl::Output
|
504 510 | >,
|
505 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
511 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
506 512 | PokemonService<L>,
|
507 513 | crate::operation_shape::GetServerStatistics,
|
508 514 | <
|
509 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
510 - | as ::aws_smithy_http_server::plugin::Plugin<
|
515 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
516 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
511 517 | PokemonService<L>,
|
512 518 | crate::operation_shape::GetServerStatistics,
|
513 519 | ModelPl::Output
|
514 520 | >
|
515 521 | >::Output
|
516 522 | >,
|
517 523 |
|
518 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
524 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
519 525 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
520 526 |
|
521 527 | {
|
522 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
523 - | use ::aws_smithy_http_server::plugin::Plugin;
|
528 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
529 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
524 530 | let svc = crate::operation_shape::GetServerStatistics::from_handler(handler);
|
525 531 | let svc = self.model_plugin.apply(svc);
|
526 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
532 + | let svc =
|
533 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
527 534 | .apply(svc);
|
528 535 | let svc = self.http_plugin.apply(svc);
|
529 536 | self.get_server_statistics_custom(svc)
|
530 537 | }
|
531 538 |
|
532 539 | /// Sets the [`GetServerStatistics`](crate::operation_shape::GetServerStatistics) operation.
|
533 540 | ///
|
534 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
535 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
541 + | /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
|
542 + | /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
|
536 543 | ///
|
537 544 | /// # Example
|
538 545 | ///
|
539 546 | /// ```no_run
|
540 547 | /// use pokemon_service_server_sdk::{PokemonService, PokemonServiceConfig};
|
541 548 | ///
|
542 549 | /// use pokemon_service_server_sdk::{input, output, error};
|
543 550 | ///
|
544 551 | /// async fn handler(input: input::GetServerStatisticsInput) -> Result<output::GetServerStatisticsOutput, error::GetServerStatisticsError> {
|
545 552 | /// todo!()
|
546 553 | /// }
|
547 554 | ///
|
548 555 | /// let config = PokemonServiceConfig::builder().build();
|
549 556 | /// let svc = ::tower::util::service_fn(handler);
|
550 557 | /// let app = PokemonService::builder(config)
|
551 558 | /// .get_server_statistics_service(svc)
|
552 559 | /// /* Set other handlers */
|
553 560 | /// .build()
|
554 561 | /// .unwrap();
|
555 - | /// # let app: PokemonService<::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;
|
562 + | /// # let app: PokemonService<::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;
|
556 563 | /// ```
|
557 564 | ///
|
558 565 | pub fn get_server_statistics_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
559 566 | where
|
560 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::GetServerStatistics, ServiceExtractors>,
|
567 + | S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::GetServerStatistics, ServiceExtractors>,
|
561 568 |
|
562 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
569 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
563 570 | PokemonService<L>,
|
564 571 | crate::operation_shape::GetServerStatistics,
|
565 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::GetServerStatistics, S>
|
572 + | ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::GetServerStatistics, S>
|
566 573 | >,
|
567 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
574 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
568 575 | PokemonService<L>,
|
569 576 | crate::operation_shape::GetServerStatistics,
|
570 577 | ModelPl::Output
|
571 578 | >,
|
572 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
579 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
|
573 580 | PokemonService<L>,
|
574 581 | crate::operation_shape::GetServerStatistics,
|
575 582 | <
|
576 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
577 - | as ::aws_smithy_http_server::plugin::Plugin<
|
583 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
584 + | as ::aws_smithy_legacy_http_server::plugin::Plugin<
|
578 585 | PokemonService<L>,
|
579 586 | crate::operation_shape::GetServerStatistics,
|
580 587 | ModelPl::Output
|
581 588 | >
|
582 589 | >::Output
|
583 590 | >,
|
584 591 |
|
585 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
592 + | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
586 593 | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
587 594 |
|
588 595 | {
|
589 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
590 - | use ::aws_smithy_http_server::plugin::Plugin;
|
596 + | use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
|
597 + | use ::aws_smithy_legacy_http_server::plugin::Plugin;
|
591 598 | let svc = crate::operation_shape::GetServerStatistics::from_service(service);
|
592 599 | let svc = self.model_plugin.apply(svc);
|
593 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
600 + | let svc =
|
601 + | ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
594 602 | .apply(svc);
|
595 603 | let svc = self.http_plugin.apply(svc);
|
596 604 | self.get_server_statistics_custom(svc)
|
597 605 | }
|
598 606 |
|
599 607 | /// Sets the [`GetServerStatistics`](crate::operation_shape::GetServerStatistics) to a custom [`Service`](tower::Service).
|
600 608 | /// not constrained by the Smithy contract.
|
601 609 | fn get_server_statistics_custom<S>(mut self, svc: S) -> Self
|
602 610 | where
|
603 611 | S: ::tower::Service<
|
604 612 | ::http::Request<Body>,
|
605 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
613 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
606 614 | Error = ::std::convert::Infallible,
|
607 615 | > + Clone
|
608 616 | + Send
|
609 617 | + 'static,
|
610 618 | S::Future: Send + 'static,
|
611 619 | {
|
612 - | self.get_server_statistics = Some(::aws_smithy_http_server::routing::Route::new(svc));
|
620 + | self.get_server_statistics =
|
621 + | Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
|
613 622 | self
|
614 623 | }
|
615 624 | }
|
616 625 |
|
617 626 | impl<Body, L, HttpPl, ModelPl> PokemonServiceBuilder<Body, L, HttpPl, ModelPl> {
|
618 627 | /// Constructs a [`PokemonService`] from the arguments provided to the builder.
|
619 628 | ///
|
620 629 | /// Forgetting to register a handler for one or more operations will result in an error.
|
621 630 | ///
|
622 631 | /// Check out [`PokemonServiceBuilder::build_unchecked`] if you'd prefer the service to return status code 500 when an
|
623 632 | /// unspecified route is requested.
|
624 633 | pub fn build(
|
625 634 | self,
|
626 635 | ) -> ::std::result::Result<
|
627 636 | PokemonService<
|
628 - | ::aws_smithy_http_server::routing::RoutingService<
|
629 - | ::aws_smithy_http_server::protocol::rest::router::RestRouter<L::Service>,
|
630 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
637 + | ::aws_smithy_legacy_http_server::routing::RoutingService<
|
638 + | ::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<L::Service>,
|
639 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
631 640 | >,
|
632 641 | >,
|
633 642 | MissingOperationsError,
|
634 643 | >
|
635 644 | where
|
636 - | L: ::tower::Layer<::aws_smithy_http_server::routing::Route<Body>>,
|
645 + | L: ::tower::Layer<::aws_smithy_legacy_http_server::routing::Route<Body>>,
|
637 646 | {
|
638 647 | let router = {
|
639 - | use ::aws_smithy_http_server::operation::OperationShape;
|
648 + | use ::aws_smithy_legacy_http_server::operation::OperationShape;
|
640 649 | let mut missing_operation_names = std::collections::HashMap::new();
|
641 650 | if self.check_health.is_none() {
|
642 651 | missing_operation_names
|
643 652 | .insert(crate::operation_shape::CheckHealth::ID, ".check_health()");
|
644 653 | }
|
645 654 | if self.do_nothing.is_none() {
|
646 655 | missing_operation_names
|
647 656 | .insert(crate::operation_shape::DoNothing::ID, ".do_nothing()");
|
648 657 | }
|
649 658 | if self.get_pokemon_species.is_none() {
|
650 659 | missing_operation_names.insert(
|
651 660 | crate::operation_shape::GetPokemonSpecies::ID,
|
652 661 | ".get_pokemon_species()",
|
653 662 | );
|
654 663 | }
|
655 664 | if self.get_server_statistics.is_none() {
|
656 665 | missing_operation_names.insert(
|
657 666 | crate::operation_shape::GetServerStatistics::ID,
|
658 667 | ".get_server_statistics()",
|
659 668 | );
|
660 669 | }
|
661 670 | if !missing_operation_names.is_empty() {
|
662 671 | return Err(MissingOperationsError {
|
663 672 | operation_names2setter_methods: missing_operation_names,
|
664 673 | });
|
665 674 | }
|
666 675 | 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";
|
667 676 |
|
668 - | ::aws_smithy_http_server::protocol::rest::router::RestRouter::from_iter([
|
677 + | ::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter::from_iter([
|
669 678 | (
|
670 679 | request_specs::check_health(),
|
671 680 | self.check_health.expect(unexpected_error_msg),
|
672 681 | ),
|
673 682 | (
|
674 683 | request_specs::do_nothing(),
|
675 684 | self.do_nothing.expect(unexpected_error_msg),
|
676 685 | ),
|
677 686 | (
|
678 687 | request_specs::get_pokemon_species(),
|
679 688 | self.get_pokemon_species.expect(unexpected_error_msg),
|
680 689 | ),
|
681 690 | (
|
682 691 | request_specs::get_server_statistics(),
|
683 692 | self.get_server_statistics.expect(unexpected_error_msg),
|
684 693 | ),
|
685 694 | ])
|
686 695 | };
|
687 - | let svc = ::aws_smithy_http_server::routing::RoutingService::new(router);
|
696 + | let svc = ::aws_smithy_legacy_http_server::routing::RoutingService::new(router);
|
688 697 | let svc = svc.map(|s| s.layer(self.layer));
|
689 698 | Ok(PokemonService { svc })
|
690 699 | }
|
691 700 |
|
692 701 | /// Constructs a [`PokemonService`] from the arguments provided to the builder.
|
693 702 | /// Operations without a handler default to returning 500 Internal Server Error to the caller.
|
694 703 | ///
|
695 704 | /// Check out [`PokemonServiceBuilder::build`] if you'd prefer the builder to fail if one or more operations do
|
696 705 | /// not have a registered handler.
|
697 706 | pub fn build_unchecked(self) -> PokemonService<L::Service>
|
698 707 | where
|
699 708 | Body: Send + 'static,
|
700 709 | L: ::tower::Layer<
|
701 - | ::aws_smithy_http_server::routing::RoutingService<
|
702 - | ::aws_smithy_http_server::protocol::rest::router::RestRouter<
|
703 - | ::aws_smithy_http_server::routing::Route<Body>,
|
710 + | ::aws_smithy_legacy_http_server::routing::RoutingService<
|
711 + | ::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<
|
712 + | ::aws_smithy_legacy_http_server::routing::Route<Body>,
|
704 713 | >,
|
705 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
714 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
706 715 | >,
|
707 716 | >,
|
708 717 | {
|
709 - | let router = ::aws_smithy_http_server::protocol::rest::router::RestRouter::from_iter([
|
718 + | let router =
|
719 + | ::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter::from_iter([
|
710 720 | (
|
711 721 | request_specs::check_health(),
|
712 722 | self.check_health.unwrap_or_else(|| {
|
713 - | let svc = ::aws_smithy_http_server::operation::MissingFailure::<
|
714 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
723 + | let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<
|
724 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
715 725 | >::default();
|
716 - | ::aws_smithy_http_server::routing::Route::new(svc)
|
726 + | ::aws_smithy_legacy_http_server::routing::Route::new(svc)
|
717 727 | }),
|
718 728 | ),
|
719 729 | (
|
720 730 | request_specs::do_nothing(),
|
721 731 | self.do_nothing.unwrap_or_else(|| {
|
722 - | let svc = ::aws_smithy_http_server::operation::MissingFailure::<
|
723 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
732 + | let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<
|
733 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
724 734 | >::default();
|
725 - | ::aws_smithy_http_server::routing::Route::new(svc)
|
735 + | ::aws_smithy_legacy_http_server::routing::Route::new(svc)
|
726 736 | }),
|
727 737 | ),
|
728 738 | (
|
729 739 | request_specs::get_pokemon_species(),
|
730 740 | self.get_pokemon_species.unwrap_or_else(|| {
|
731 - | let svc = ::aws_smithy_http_server::operation::MissingFailure::<
|
732 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
741 + | let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<
|
742 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
733 743 | >::default();
|
734 - | ::aws_smithy_http_server::routing::Route::new(svc)
|
744 + | ::aws_smithy_legacy_http_server::routing::Route::new(svc)
|
735 745 | }),
|
736 746 | ),
|
737 747 | (
|
738 748 | request_specs::get_server_statistics(),
|
739 749 | self.get_server_statistics.unwrap_or_else(|| {
|
740 - | let svc = ::aws_smithy_http_server::operation::MissingFailure::<
|
741 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
750 + | let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<
|
751 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
742 752 | >::default();
|
743 - | ::aws_smithy_http_server::routing::Route::new(svc)
|
753 + | ::aws_smithy_legacy_http_server::routing::Route::new(svc)
|
744 754 | }),
|
745 755 | ),
|
746 756 | ]);
|
747 757 | let svc = self
|
748 758 | .layer
|
749 - | .layer(::aws_smithy_http_server::routing::RoutingService::new(
|
750 - | router,
|
751 - | ));
|
759 + | .layer(::aws_smithy_legacy_http_server::routing::RoutingService::new(router));
|
752 760 | PokemonService { svc }
|
753 761 | }
|
754 762 | }
|
755 763 |
|
756 764 | /// The error encountered when calling the [`PokemonServiceBuilder::build`] method if one or more operation handlers are not
|
757 765 | /// specified.
|
758 766 | #[derive(Debug)]
|
759 767 | pub struct MissingOperationsError {
|
760 768 | operation_names2setter_methods:
|
761 - | std::collections::HashMap<::aws_smithy_http_server::shape_id::ShapeId, &'static str>,
|
769 + | std::collections::HashMap<::aws_smithy_legacy_http_server::shape_id::ShapeId, &'static str>,
|
762 770 | }
|
763 771 |
|
764 772 | impl std::fmt::Display for MissingOperationsError {
|
765 773 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
766 774 | write!(
|
767 775 | f,
|
768 776 | "You must specify a handler for all operations attached to `PokemonService`.\n\
|
769 777 | We are missing handlers for the following operations:\n",
|
770 778 | )?;
|
771 779 | for operation_name in self.operation_names2setter_methods.keys() {
|
772 780 | writeln!(f, "- {}", operation_name.absolute())?;
|
773 781 | }
|
774 782 |
|
775 783 | writeln!(f, "\nUse the dedicated methods on `PokemonServiceBuilder` to register the missing handlers:")?;
|
776 784 | for setter_name in self.operation_names2setter_methods.values() {
|
777 785 | writeln!(f, "- {}", setter_name)?;
|
778 786 | }
|
779 787 | Ok(())
|
780 788 | }
|
781 789 | }
|
782 790 |
|
783 791 | impl std::error::Error for MissingOperationsError {}
|
784 792 |
|
785 793 | mod request_specs {
|
786 - | pub(super) fn check_health() -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
|
787 - | ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
|
794 + | pub(super) fn check_health(
|
795 + | ) -> ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec {
|
796 + | ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec::new(
|
788 797 | ::http::Method::GET,
|
789 - | ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
|
790 - | ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
|
791 - | ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
|
792 - | ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("ping")),
|
798 + | ::aws_smithy_legacy_http_server::routing::request_spec::UriSpec::new(
|
799 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathAndQuerySpec::new(
|
800 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
|
801 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathSegment::Literal(String::from("ping")),
|
793 802 | ]),
|
794 - | ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
|
803 + | ::aws_smithy_legacy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
|
795 804 | ])
|
796 805 | )
|
797 806 | ),
|
798 807 | )
|
799 808 | }
|
800 - | pub(super) fn do_nothing() -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
|
801 - | ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
|
809 + | pub(super) fn do_nothing() -> ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec
|
810 + | {
|
811 + | ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec::new(
|
802 812 | ::http::Method::GET,
|
803 - | ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
|
804 - | ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
|
805 - | ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
|
806 - | ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("do-nothing")),
|
813 + | ::aws_smithy_legacy_http_server::routing::request_spec::UriSpec::new(
|
814 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathAndQuerySpec::new(
|
815 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
|
816 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathSegment::Literal(String::from("do-nothing")),
|
807 817 | ]),
|
808 - | ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
|
818 + | ::aws_smithy_legacy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
|
809 819 | ])
|
810 820 | )
|
811 821 | ),
|
812 822 | )
|
813 823 | }
|
814 824 | pub(super) fn get_pokemon_species(
|
815 - | ) -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
|
816 - | ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
|
825 + | ) -> ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec {
|
826 + | ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec::new(
|
817 827 | ::http::Method::GET,
|
818 - | ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
|
819 - | ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
|
820 - | ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
|
821 - | ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("pokemon-species")),
|
822 - | ::aws_smithy_http_server::routing::request_spec::PathSegment::Label,
|
828 + | ::aws_smithy_legacy_http_server::routing::request_spec::UriSpec::new(
|
829 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathAndQuerySpec::new(
|
830 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
|
831 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathSegment::Literal(String::from("pokemon-species")),
|
832 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathSegment::Label,
|
823 833 | ]),
|
824 - | ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
|
834 + | ::aws_smithy_legacy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
|
825 835 | ])
|
826 836 | )
|
827 837 | ),
|
828 838 | )
|
829 839 | }
|
830 840 | pub(super) fn get_server_statistics(
|
831 - | ) -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
|
832 - | ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
|
841 + | ) -> ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec {
|
842 + | ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec::new(
|
833 843 | ::http::Method::GET,
|
834 - | ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
|
835 - | ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
|
836 - | ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
|
837 - | ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("stats")),
|
844 + | ::aws_smithy_legacy_http_server::routing::request_spec::UriSpec::new(
|
845 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathAndQuerySpec::new(
|
846 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
|
847 + | ::aws_smithy_legacy_http_server::routing::request_spec::PathSegment::Literal(String::from("stats")),
|
838 848 | ]),
|
839 - | ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
|
849 + | ::aws_smithy_legacy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
|
840 850 | ])
|
841 851 | )
|
842 852 | ),
|
843 853 | )
|
844 854 | }
|
845 855 | }
|
846 856 |
|
847 857 | /// The Pokémon Service allows you to retrieve information about Pokémon species.
|
848 858 | ///
|
849 859 | /// See the [root](crate) documentation for more information.
|
850 860 | #[derive(Clone)]
|
851 861 | pub struct PokemonService<
|
852 - | S = ::aws_smithy_http_server::routing::RoutingService<
|
853 - | ::aws_smithy_http_server::protocol::rest::router::RestRouter<
|
854 - | ::aws_smithy_http_server::routing::Route<::aws_smithy_http_server::body::BoxBody>,
|
862 + | S = ::aws_smithy_legacy_http_server::routing::RoutingService<
|
863 + | ::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<
|
864 + | ::aws_smithy_legacy_http_server::routing::Route<
|
865 + | ::aws_smithy_legacy_http_server::body::BoxBody,
|
866 + | >,
|
855 867 | >,
|
856 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
868 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
857 869 | >,
|
858 870 | > {
|
859 871 | // This is the router wrapped by layers.
|
860 872 | svc: S,
|
861 873 | }
|
862 874 |
|
863 875 | impl PokemonService<()> {
|
864 876 | /// Constructs a builder for [`PokemonService`].
|
865 877 | /// You must specify a configuration object holding any plugins and layers that should be applied
|
866 878 | /// to the operations in this service.
|
867 879 | pub fn builder<
|
868 880 | Body,
|
869 881 | L,
|
870 - | HttpPl: ::aws_smithy_http_server::plugin::HttpMarker,
|
871 - | ModelPl: ::aws_smithy_http_server::plugin::ModelMarker,
|
882 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::HttpMarker,
|
883 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::ModelMarker,
|
872 884 | >(
|
873 885 | config: PokemonServiceConfig<L, HttpPl, ModelPl>,
|
874 886 | ) -> PokemonServiceBuilder<Body, L, HttpPl, ModelPl> {
|
875 887 | PokemonServiceBuilder {
|
876 888 | check_health: None,
|
877 889 | do_nothing: None,
|
878 890 | get_pokemon_species: None,
|
879 891 | get_server_statistics: None,
|
880 892 | layer: config.layers,
|
881 893 | http_plugin: config.http_plugins,
|
882 894 | model_plugin: config.model_plugins,
|
883 895 | }
|
884 896 | }
|
885 897 |
|
886 898 | /// Constructs a builder for [`PokemonService`].
|
887 899 | /// You must specify what plugins should be applied to the operations in this service.
|
888 900 | ///
|
889 901 | /// Use [`PokemonService::builder_without_plugins`] if you don't need to apply plugins.
|
890 902 | ///
|
891 - | /// Check out [`HttpPlugins`](::aws_smithy_http_server::plugin::HttpPlugins) and
|
892 - | /// [`ModelPlugins`](::aws_smithy_http_server::plugin::ModelPlugins) if you need to apply
|
903 + | /// Check out [`HttpPlugins`](::aws_smithy_legacy_http_server::plugin::HttpPlugins) and
|
904 + | /// [`ModelPlugins`](::aws_smithy_legacy_http_server::plugin::ModelPlugins) if you need to apply
|
893 905 | /// multiple plugins.
|
894 906 | #[deprecated(
|
895 907 | since = "0.57.0",
|
896 908 | note = "please use the `builder` constructor and register plugins on the `PokemonServiceConfig` object instead; see https://github.com/smithy-lang/smithy-rs/discussions/3096"
|
897 909 | )]
|
898 910 | pub fn builder_with_plugins<
|
899 911 | Body,
|
900 - | HttpPl: ::aws_smithy_http_server::plugin::HttpMarker,
|
901 - | ModelPl: ::aws_smithy_http_server::plugin::ModelMarker,
|
912 + | HttpPl: ::aws_smithy_legacy_http_server::plugin::HttpMarker,
|
913 + | ModelPl: ::aws_smithy_legacy_http_server::plugin::ModelMarker,
|
902 914 | >(
|
903 915 | http_plugin: HttpPl,
|
904 916 | model_plugin: ModelPl,
|
905 917 | ) -> PokemonServiceBuilder<Body, ::tower::layer::util::Identity, HttpPl, ModelPl> {
|
906 918 | PokemonServiceBuilder {
|
907 919 | check_health: None,
|
908 920 | do_nothing: None,
|
909 921 | get_pokemon_species: None,
|
910 922 | get_server_statistics: None,
|
911 923 | layer: ::tower::layer::util::Identity::new(),
|
912 924 | http_plugin,
|
913 925 | model_plugin,
|
914 926 | }
|
915 927 | }
|
916 928 |
|
917 929 | /// Constructs a builder for [`PokemonService`].
|
918 930 | ///
|
919 931 | /// Use [`PokemonService::builder_with_plugins`] if you need to specify plugins.
|
920 932 | #[deprecated(
|
921 933 | since = "0.57.0",
|
922 934 | note = "please use the `builder` constructor instead; see https://github.com/smithy-lang/smithy-rs/discussions/3096"
|
923 935 | )]
|
924 936 | pub fn builder_without_plugins<Body>() -> PokemonServiceBuilder<
|
925 937 | Body,
|
926 938 | ::tower::layer::util::Identity,
|
927 - | ::aws_smithy_http_server::plugin::IdentityPlugin,
|
928 - | ::aws_smithy_http_server::plugin::IdentityPlugin,
|
939 + | ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
|
940 + | ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
|
929 941 | > {
|
930 942 | Self::builder_with_plugins(
|
931 - | ::aws_smithy_http_server::plugin::IdentityPlugin,
|
932 - | ::aws_smithy_http_server::plugin::IdentityPlugin,
|
943 + | ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
|
944 + | ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
|
933 945 | )
|
934 946 | }
|
935 947 | }
|
936 948 |
|
937 949 | impl<S> PokemonService<S> {
|
938 950 | /// Converts [`PokemonService`] into a [`MakeService`](tower::make::MakeService).
|
939 - | pub fn into_make_service(self) -> ::aws_smithy_http_server::routing::IntoMakeService<Self> {
|
940 - | ::aws_smithy_http_server::routing::IntoMakeService::new(self)
|
951 + | pub fn into_make_service(
|
952 + | self,
|
953 + | ) -> ::aws_smithy_legacy_http_server::routing::IntoMakeService<Self> {
|
954 + | ::aws_smithy_legacy_http_server::routing::IntoMakeService::new(self)
|
941 955 | }
|
942 956 |
|
943 - | /// Converts [`PokemonService`] into a [`MakeService`](tower::make::MakeService) with [`ConnectInfo`](::aws_smithy_http_server::request::connect_info::ConnectInfo).
|
957 + | /// Converts [`PokemonService`] into a [`MakeService`](tower::make::MakeService) with [`ConnectInfo`](::aws_smithy_legacy_http_server::request::connect_info::ConnectInfo).
|
944 958 | pub fn into_make_service_with_connect_info<C>(
|
945 959 | self,
|
946 - | ) -> ::aws_smithy_http_server::routing::IntoMakeServiceWithConnectInfo<Self, C> {
|
947 - | ::aws_smithy_http_server::routing::IntoMakeServiceWithConnectInfo::new(self)
|
960 + | ) -> ::aws_smithy_legacy_http_server::routing::IntoMakeServiceWithConnectInfo<Self, C> {
|
961 + | ::aws_smithy_legacy_http_server::routing::IntoMakeServiceWithConnectInfo::new(self)
|
948 962 | }
|
949 963 | }
|
950 964 |
|
951 965 | impl<S>
|
952 966 | PokemonService<
|
953 - | ::aws_smithy_http_server::routing::RoutingService<
|
954 - | ::aws_smithy_http_server::protocol::rest::router::RestRouter<S>,
|
955 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
967 + | ::aws_smithy_legacy_http_server::routing::RoutingService<
|
968 + | ::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<S>,
|
969 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
956 970 | >,
|
957 971 | >
|
958 972 | {
|
959 973 | /// Applies a [`Layer`](::tower::Layer) uniformly to all routes.
|
960 974 | #[deprecated(
|
961 975 | since = "0.57.0",
|
962 976 | note = "please add layers to the `PokemonServiceConfig` object instead; see https://github.com/smithy-lang/smithy-rs/discussions/3096"
|
963 977 | )]
|
964 978 | pub fn layer<L>(
|
965 979 | self,
|
966 980 | layer: &L,
|
967 981 | ) -> PokemonService<
|
968 - | ::aws_smithy_http_server::routing::RoutingService<
|
969 - | ::aws_smithy_http_server::protocol::rest::router::RestRouter<L::Service>,
|
970 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
982 + | ::aws_smithy_legacy_http_server::routing::RoutingService<
|
983 + | ::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<L::Service>,
|
984 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
971 985 | >,
|
972 986 | >
|
973 987 | where
|
974 988 | L: ::tower::Layer<S>,
|
975 989 | {
|
976 990 | PokemonService {
|
977 991 | svc: self.svc.map(|s| s.layer(layer)),
|
978 992 | }
|
979 993 | }
|
980 994 |
|
981 - | /// Applies [`Route::new`](::aws_smithy_http_server::routing::Route::new) to all routes.
|
995 + | /// Applies [`Route::new`](::aws_smithy_legacy_http_server::routing::Route::new) to all routes.
|
982 996 | ///
|
983 997 | /// This has the effect of erasing all types accumulated via layers.
|
984 998 | pub fn boxed<B>(
|
985 999 | self,
|
986 1000 | ) -> PokemonService<
|
987 - | ::aws_smithy_http_server::routing::RoutingService<
|
988 - | ::aws_smithy_http_server::protocol::rest::router::RestRouter<
|
989 - | ::aws_smithy_http_server::routing::Route<B>,
|
1001 + | ::aws_smithy_legacy_http_server::routing::RoutingService<
|
1002 + | ::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<
|
1003 + | ::aws_smithy_legacy_http_server::routing::Route<B>,
|
990 1004 | >,
|
991 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
1005 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
992 1006 | >,
|
993 1007 | >
|
994 1008 | where
|
995 1009 | S: ::tower::Service<
|
996 1010 | ::http::Request<B>,
|
997 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
1011 + | Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
|
998 1012 | Error = std::convert::Infallible,
|
999 1013 | >,
|
1000 1014 | S: Clone + Send + 'static,
|
1001 1015 | S::Future: Send + 'static,
|
1002 1016 | {
|
1003 1017 | self.layer(&::tower::layer::layer_fn(
|
1004 - | ::aws_smithy_http_server::routing::Route::new,
|
1018 + | ::aws_smithy_legacy_http_server::routing::Route::new,
|
1005 1019 | ))
|
1006 1020 | }
|
1007 1021 | }
|
1008 1022 |
|
1009 1023 | impl<S, R> ::tower::Service<R> for PokemonService<S>
|
1010 1024 | where
|
1011 1025 | S: ::tower::Service<R>,
|
1012 1026 | {
|
1013 1027 | type Response = S::Response;
|
1014 1028 | type Error = S::Error;
|
1015 1029 | type Future = S::Future;
|
1016 1030 |
|
1017 1031 | fn poll_ready(
|
1018 1032 | &mut self,
|
1019 1033 | cx: &mut std::task::Context,
|
1020 1034 | ) -> std::task::Poll<::std::result::Result<(), Self::Error>> {
|
1021 1035 | self.svc.poll_ready(cx)
|
1022 1036 | }
|
1023 1037 |
|
1024 1038 | fn call(&mut self, request: R) -> Self::Future {
|
1025 1039 | self.svc.call(request)
|
1026 1040 | }
|
1027 1041 | }
|
1028 1042 |
|
1029 1043 | /// An enumeration of all [operations](https://smithy.io/2.0/spec/service-types.html#operation) in PokemonService.
|
1030 1044 | #[allow(clippy::enum_variant_names)]
|
1031 1045 | #[derive(Debug, PartialEq, Eq, Clone, Copy)]
|
1032 1046 | pub enum Operation {
|
1033 1047 | CheckHealth,
|
1034 1048 | DoNothing,
|
1035 1049 | GetPokemonSpecies,
|
1036 1050 | GetServerStatistics,
|
1037 1051 | }
|
1038 1052 |
|
1039 1053 | impl Operation {
|
1040 - | /// Returns the [operations](https://smithy.io/2.0/spec/service-types.html#operation) [`ShapeId`](::aws_smithy_http_server::shape_id::ShapeId).
|
1041 - | pub fn shape_id(&self) -> ::aws_smithy_http_server::shape_id::ShapeId {
|
1054 + | /// Returns the [operations](https://smithy.io/2.0/spec/service-types.html#operation) [`ShapeId`](::aws_smithy_legacy_http_server::shape_id::ShapeId).
|
1055 + | pub fn shape_id(&self) -> ::aws_smithy_legacy_http_server::shape_id::ShapeId {
|
1042 1056 | match self {
|
1043 - | Operation::CheckHealth => ::aws_smithy_http_server::shape_id::ShapeId::new(
|
1057 + | Operation::CheckHealth => ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
1044 1058 | "com.aws.example#CheckHealth",
|
1045 1059 | "com.aws.example",
|
1046 1060 | "CheckHealth",
|
1047 1061 | ),
|
1048 - | Operation::DoNothing => ::aws_smithy_http_server::shape_id::ShapeId::new(
|
1062 + | Operation::DoNothing => ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
1049 1063 | "com.aws.example#DoNothing",
|
1050 1064 | "com.aws.example",
|
1051 1065 | "DoNothing",
|
1052 1066 | ),
|
1053 - | Operation::GetPokemonSpecies => ::aws_smithy_http_server::shape_id::ShapeId::new(
|
1067 + | Operation::GetPokemonSpecies => {
|
1068 + | ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
1054 1069 | "com.aws.example#GetPokemonSpecies",
|
1055 1070 | "com.aws.example",
|
1056 1071 | "GetPokemonSpecies",
|
1057 - | ),
|
1058 - | Operation::GetServerStatistics => ::aws_smithy_http_server::shape_id::ShapeId::new(
|
1072 + | )
|
1073 + | }
|
1074 + | Operation::GetServerStatistics => {
|
1075 + | ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
1059 1076 | "com.aws.example#GetServerStatistics",
|
1060 1077 | "com.aws.example",
|
1061 1078 | "GetServerStatistics",
|
1062 - | ),
|
1079 + | )
|
1080 + | }
|
1063 1081 | }
|
1064 1082 | }
|
1065 1083 | }
|
1066 - | impl<L> ::aws_smithy_http_server::service::ContainsOperation<crate::operation_shape::CheckHealth>
|
1084 + | impl<L>
|
1085 + | ::aws_smithy_legacy_http_server::service::ContainsOperation<crate::operation_shape::CheckHealth>
|
1067 1086 | for PokemonService<L>
|
1068 1087 | {
|
1069 1088 | const VALUE: Operation = Operation::CheckHealth;
|
1070 1089 | }
|
1071 - | impl<L> ::aws_smithy_http_server::service::ContainsOperation<crate::operation_shape::DoNothing>
|
1090 + | impl<L>
|
1091 + | ::aws_smithy_legacy_http_server::service::ContainsOperation<crate::operation_shape::DoNothing>
|
1072 1092 | for PokemonService<L>
|
1073 1093 | {
|
1074 1094 | const VALUE: Operation = Operation::DoNothing;
|
1075 1095 | }
|
1076 1096 | impl<L>
|
1077 - | ::aws_smithy_http_server::service::ContainsOperation<crate::operation_shape::GetPokemonSpecies>
|
1078 - | for PokemonService<L>
|
1097 + | ::aws_smithy_legacy_http_server::service::ContainsOperation<
|
1098 + | crate::operation_shape::GetPokemonSpecies,
|
1099 + | > for PokemonService<L>
|
1079 1100 | {
|
1080 1101 | const VALUE: Operation = Operation::GetPokemonSpecies;
|
1081 1102 | }
|
1082 1103 | impl<L>
|
1083 - | ::aws_smithy_http_server::service::ContainsOperation<
|
1104 + | ::aws_smithy_legacy_http_server::service::ContainsOperation<
|
1084 1105 | crate::operation_shape::GetServerStatistics,
|
1085 1106 | > for PokemonService<L>
|
1086 1107 | {
|
1087 1108 | const VALUE: Operation = Operation::GetServerStatistics;
|
1088 1109 | }
|
1089 1110 |
|
1090 - | impl<S> ::aws_smithy_http_server::service::ServiceShape for PokemonService<S> {
|
1091 - | const ID: ::aws_smithy_http_server::shape_id::ShapeId =
|
1092 - | ::aws_smithy_http_server::shape_id::ShapeId::new(
|
1111 + | impl<S> ::aws_smithy_legacy_http_server::service::ServiceShape for PokemonService<S> {
|
1112 + | const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
|
1113 + | ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
|
1093 1114 | "com.aws.example.ts#PokemonService",
|
1094 1115 | "com.aws.example.ts",
|
1095 1116 | "PokemonService",
|
1096 1117 | );
|
1097 1118 |
|
1098 1119 | const VERSION: Option<&'static str> = Some("2021-12-01");
|
1099 1120 |
|
1100 - | type Protocol = ::aws_smithy_http_server::protocol::rest_json_1::RestJson1;
|
1121 + | type Protocol = ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1;
|
1101 1122 |
|
1102 1123 | type Operations = Operation;
|
1103 1124 | }
|
1104 1125 | /// Configuration for the [`PokemonService`]. This is the central place where to register and
|
1105 1126 | /// configure [`::tower::Layer`]s, HTTP plugins, and model plugins.
|
1106 1127 | ///
|
1107 1128 | /// ```rust,no_run
|
1108 1129 | /// # use pokemon_service_server_sdk::PokemonServiceConfig;
|
1109 - | /// # use ::aws_smithy_http_server::plugin::IdentityPlugin;
|
1130 + | /// # use ::aws_smithy_legacy_http_server::plugin::IdentityPlugin;
|
1110 1131 | /// # use ::tower::layer::util::Identity;
|
1111 1132 | /// # let authentication_plugin = IdentityPlugin;
|
1112 1133 | /// # let authorization_plugin = IdentityPlugin;
|
1113 1134 | /// # let server_request_id_provider_layer = Identity::new();
|
1114 1135 | /// let config = PokemonServiceConfig::builder()
|
1115 1136 | /// // Layers get executed first...
|
1116 1137 | /// .layer(server_request_id_provider_layer)
|
1117 1138 | /// // ...then HTTP plugins...
|
1118 1139 | /// .http_plugin(authentication_plugin)
|
1119 1140 | /// // ...and right after deserialization, model plugins.
|
1120 1141 | /// .model_plugin(authorization_plugin)
|
1121 1142 | /// .build();
|
1122 1143 | /// ```
|
1123 1144 | ///
|
1124 1145 | /// See the [`plugin`] system for details.
|
1125 1146 | ///
|
1126 - | /// [`plugin`]: ::aws_smithy_http_server::plugin
|
1147 + | /// [`plugin`]: ::aws_smithy_legacy_http_server::plugin
|
1127 1148 | #[derive(::std::fmt::Debug)]
|
1128 1149 | pub struct PokemonServiceConfig<L, H, M> {
|
1129 1150 | layers: L,
|
1130 1151 | http_plugins: H,
|
1131 1152 | model_plugins: M,
|
1132 1153 | }
|
1133 1154 |
|
1134 1155 | impl PokemonServiceConfig<(), (), ()> {
|
1135 1156 | /// Returns a builder to construct the configuration.
|
1136 1157 | pub fn builder() -> PokemonServiceConfigBuilder<
|
1137 1158 | ::tower::layer::util::Identity,
|
1138 - | ::aws_smithy_http_server::plugin::IdentityPlugin,
|
1139 - | ::aws_smithy_http_server::plugin::IdentityPlugin,
|
1159 + | ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
|
1160 + | ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
|
1140 1161 | > {
|
1141 1162 | PokemonServiceConfigBuilder {
|
1142 1163 | layers: ::tower::layer::util::Identity::new(),
|
1143 - | http_plugins: ::aws_smithy_http_server::plugin::IdentityPlugin,
|
1144 - | model_plugins: ::aws_smithy_http_server::plugin::IdentityPlugin,
|
1164 + | http_plugins: ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
|
1165 + | model_plugins: ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
|
1145 1166 | }
|
1146 1167 | }
|
1147 1168 | }
|
1148 1169 |
|
1149 1170 | /// Builder returned by [`PokemonServiceConfig::builder()`].
|
1150 1171 | #[derive(::std::fmt::Debug)]
|
1151 1172 | pub struct PokemonServiceConfigBuilder<L, H, M> {
|
1152 1173 | pub(crate) layers: L,
|
1153 1174 | pub(crate) http_plugins: H,
|
1154 1175 | pub(crate) model_plugins: M,
|
1155 1176 | }
|
1156 1177 |
|
1157 1178 | impl<L, H, M> PokemonServiceConfigBuilder<L, H, M> {
|
1158 1179 | /// Add a [`::tower::Layer`] to the service.
|
1159 1180 | pub fn layer<NewLayer>(
|
1160 1181 | self,
|
1161 1182 | layer: NewLayer,
|
1162 1183 | ) -> PokemonServiceConfigBuilder<::tower::layer::util::Stack<NewLayer, L>, H, M> {
|
1163 1184 | PokemonServiceConfigBuilder {
|
1164 1185 | layers: ::tower::layer::util::Stack::new(layer, self.layers),
|
1165 1186 | http_plugins: self.http_plugins,
|
1166 1187 | model_plugins: self.model_plugins,
|
1167 1188 | }
|
1168 1189 | }
|
1169 1190 |
|
1170 1191 | /// Add a HTTP [plugin] to the service.
|
1171 1192 | ///
|
1172 - | /// [plugin]: ::aws_smithy_http_server::plugin
|
1193 + | /// [plugin]: ::aws_smithy_legacy_http_server::plugin
|
1173 1194 | // We eagerly require `NewPlugin: HttpMarker`, despite not really needing it, because compiler
|
1174 1195 | // errors get _substantially_ better if the user makes a mistake.
|
1175 - | pub fn http_plugin<NewPlugin: ::aws_smithy_http_server::plugin::HttpMarker>(
|
1196 + | pub fn http_plugin<NewPlugin: ::aws_smithy_legacy_http_server::plugin::HttpMarker>(
|
1176 1197 | self,
|
1177 1198 | http_plugin: NewPlugin,
|
1178 1199 | ) -> PokemonServiceConfigBuilder<
|
1179 1200 | L,
|
1180 - | ::aws_smithy_http_server::plugin::PluginStack<NewPlugin, H>,
|
1201 + | ::aws_smithy_legacy_http_server::plugin::PluginStack<NewPlugin, H>,
|
1181 1202 | M,
|
1182 1203 | > {
|
1183 1204 | PokemonServiceConfigBuilder {
|
1184 1205 | layers: self.layers,
|
1185 - | http_plugins: ::aws_smithy_http_server::plugin::PluginStack::new(
|
1206 + | http_plugins: ::aws_smithy_legacy_http_server::plugin::PluginStack::new(
|
1186 1207 | http_plugin,
|
1187 1208 | self.http_plugins,
|
1188 1209 | ),
|
1189 1210 | model_plugins: self.model_plugins,
|
1190 1211 | }
|
1191 1212 | }
|
1192 1213 |
|
1193 1214 | /// Add a model [plugin] to the service.
|
1194 1215 | ///
|
1195 - | /// [plugin]: ::aws_smithy_http_server::plugin
|
1216 + | /// [plugin]: ::aws_smithy_legacy_http_server::plugin
|
1196 1217 | // We eagerly require `NewPlugin: ModelMarker`, despite not really needing it, because compiler
|
1197 1218 | // errors get _substantially_ better if the user makes a mistake.
|
1198 - | pub fn model_plugin<NewPlugin: ::aws_smithy_http_server::plugin::ModelMarker>(
|
1219 + | pub fn model_plugin<NewPlugin: ::aws_smithy_legacy_http_server::plugin::ModelMarker>(
|
1199 1220 | self,
|
1200 1221 | model_plugin: NewPlugin,
|
1201 1222 | ) -> PokemonServiceConfigBuilder<
|
1202 1223 | L,
|
1203 1224 | H,
|
1204 - | ::aws_smithy_http_server::plugin::PluginStack<NewPlugin, M>,
|
1225 + | ::aws_smithy_legacy_http_server::plugin::PluginStack<NewPlugin, M>,
|
1205 1226 | > {
|
1206 1227 | PokemonServiceConfigBuilder {
|
1207 1228 | layers: self.layers,
|
1208 1229 | http_plugins: self.http_plugins,
|
1209 - | model_plugins: ::aws_smithy_http_server::plugin::PluginStack::new(
|
1230 + | model_plugins: ::aws_smithy_legacy_http_server::plugin::PluginStack::new(
|
1210 1231 | model_plugin,
|
1211 1232 | self.model_plugins,
|
1212 1233 | ),
|
1213 1234 | }
|
1214 1235 | }
|
1215 1236 |
|
1216 1237 | /// Build the configuration.
|
1217 1238 | pub fn build(self) -> super::PokemonServiceConfig<L, H, M> {
|
1218 1239 | super::PokemonServiceConfig {
|
1219 1240 | layers: self.layers,
|