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