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