1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 0 | diff --git a/tmp-codegen-diff/codegen-server-test/rest_xml_extras/rust-server-codegen/src/input.rs b/tmp-codegen-diff/codegen-server-test/rest_xml_extras/rust-server-codegen/src/input.rs
|
3 1 | deleted file mode 100644
|
4 2 | index 1a2706b..0000000
|
5 - | -- a/tmp-codegen-diff/codegen-server-test/rest_xml_extras/rust-server-codegen/src/input.rs
|
3 + | ++ /dev/null
|
6 4 | @@ -1,58 +0,0 @@
|
7 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
8 - | #[allow(missing_docs)] // documentation missing in model
|
9 - | #[derive(
|
10 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
11 - | )]
|
12 - | pub struct ContentTypeParametersInput {
|
13 - | #[allow(missing_docs)] // documentation missing in model
|
14 - | pub value: ::std::option::Option<i32>,
|
15 - | }
|
16 - | impl ContentTypeParametersInput {
|
17 - | #[allow(missing_docs)] // documentation missing in model
|
18 - | pub fn value(&self) -> ::std::option::Option<i32> {
|
19 - | self.value
|
20 - | }
|
21 - | }
|
22 - | impl ContentTypeParametersInput {
|
23 - | /// Creates a new builder-style object to manufacture [`ContentTypeParametersInput`](crate::input::ContentTypeParametersInput).
|
24 - | pub fn builder() -> crate::input::content_type_parameters_input::Builder {
|
25 - | crate::input::content_type_parameters_input::Builder::default()
|
26 - | }
|
27 - | }
|
28 - | impl crate::constrained::Constrained for crate::input::ContentTypeParametersInput {
|
29 - | type Unconstrained = crate::input::content_type_parameters_input::Builder;
|
30 - | }
|
31 - | /// See [`ContentTypeParametersInput`](crate::input::ContentTypeParametersInput).
|
32 - | ///
|
33 - | pub mod content_type_parameters_input {
|
34 - |
|
35 - | impl ::std::convert::From<Builder> for crate::input::ContentTypeParametersInput {
|
36 - | fn from(builder: Builder) -> Self {
|
37 - | builder.build()
|
38 - | }
|
39 - | }
|
40 - | /// A builder for [`ContentTypeParametersInput`](crate::input::ContentTypeParametersInput).
|
41 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
42 - | pub struct Builder {
|
43 - | pub(crate) value: ::std::option::Option<i32>,
|
44 - | }
|
45 - | impl Builder {
|
46 - | #[allow(missing_docs)] // documentation missing in model
|
47 - | pub fn value(mut self, input: ::std::option::Option<i32>) -> Self {
|
48 - | self.value = input;
|
49 - | self
|
50 - | }
|
51 - | #[allow(missing_docs)] // documentation missing in model
|
52 - | pub(crate) fn set_value(mut self, input: Option<impl ::std::convert::Into<i32>>) -> Self {
|
53 - | self.value = input.map(|v| v.into());
|
54 - | self
|
55 - | }
|
56 - | /// Consumes the builder and constructs a [`ContentTypeParametersInput`](crate::input::ContentTypeParametersInput).
|
57 - | pub fn build(self) -> crate::input::ContentTypeParametersInput {
|
58 - | self.build_enforcing_all_constraints()
|
59 - | }
|
60 - | fn build_enforcing_all_constraints(self) -> crate::input::ContentTypeParametersInput {
|
61 - | crate::input::ContentTypeParametersInput { value: self.value }
|
62 - | }
|
63 - | }
|
64 - | }
|
65 5 | diff --git a/tmp-codegen-diff/codegen-server-test/rest_xml_extras/rust-server-codegen/src/lib.rs b/tmp-codegen-diff/codegen-server-test/rest_xml_extras/rust-server-codegen/src/lib.rs
|
66 6 | deleted file mode 100644
|
67 7 | index b7a8fd4..0000000
|
68 - | -- a/tmp-codegen-diff/codegen-server-test/rest_xml_extras/rust-server-codegen/src/lib.rs
|
8 + | ++ /dev/null
|
69 9 | @@ -1,229 +0,0 @@
|
70 - | #![allow(deprecated)]
|
71 - | #![allow(unknown_lints)]
|
72 - | #![allow(clippy::module_inception)]
|
73 - | #![allow(clippy::upper_case_acronyms)]
|
74 - | #![allow(clippy::large_enum_variant)]
|
75 - | #![allow(clippy::wrong_self_convention)]
|
76 - | #![allow(clippy::should_implement_trait)]
|
77 - | #![allow(clippy::disallowed_names)]
|
78 - | #![allow(clippy::vec_init_then_push)]
|
79 - | #![allow(clippy::type_complexity)]
|
80 - | #![allow(clippy::needless_return)]
|
81 - | #![allow(clippy::derive_partial_eq_without_eq)]
|
82 - | #![allow(clippy::result_large_err)]
|
83 - | #![allow(clippy::unnecessary_map_on_constructor)]
|
84 - | #![allow(rustdoc::bare_urls)]
|
85 - | #![allow(rustdoc::redundant_explicit_links)]
|
86 - | #![forbid(unsafe_code)]
|
87 - | #![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
88 - | //! A REST XML service that sends XML requests and responses.
|
89 - |
|
90 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
91 - | //! A fast and customizable Rust implementation of the RestXmlExtras Smithy service.
|
92 - | //!
|
93 - | //! # Using RestXmlExtras
|
94 - | //!
|
95 - | //! The primary entrypoint is [`RestXmlExtras`]: it satisfies the [`Service<http::Request, Response = http::Response>`](::tower::Service)
|
96 - | //! trait and therefore can be handed to a [`hyper` server](https://github.com/hyperium/hyper) via [`RestXmlExtras::into_make_service`] or used in Lambda via [`LambdaHandler`](::aws_smithy_http_server::routing::LambdaHandler).
|
97 - | //! The [`crate::input`], and [`crate::output`],
|
98 - | //! modules provide the types used in each operation.
|
99 - | //!
|
100 - | //! ### Running on Hyper
|
101 - | //!
|
102 - | //! ```rust,no_run
|
103 - | //! # use std::net::SocketAddr;
|
104 - | //! # async fn dummy() {
|
105 - | //! use rest_xml_extras::{RestXmlExtras, RestXmlExtrasConfig};
|
106 - | //!
|
107 - | //! # let app = RestXmlExtras::builder(
|
108 - | //! # RestXmlExtrasConfig::builder()
|
109 - | //! # .build()
|
110 - | //! # ).build_unchecked();
|
111 - | //! let server = app.into_make_service();
|
112 - | //! let bind: SocketAddr = "127.0.0.1:6969".parse()
|
113 - | //! .expect("unable to parse the server bind address and port");
|
114 - | //! ::hyper::Server::bind(&bind).serve(server).await.unwrap();
|
115 - | //! # }
|
116 - | //! ```
|
117 - | //!
|
118 - | //! ### Running on Lambda
|
119 - | //!
|
120 - | //! This requires the `aws-lambda` feature flag to be passed to the [`::aws_smithy_http_server`] crate.
|
121 - | //!
|
122 - | //! ```rust,ignore
|
123 - | //! use ::aws_smithy_http_server::routing::LambdaHandler;
|
124 - | //! use rest_xml_extras::RestXmlExtras;
|
125 - | //!
|
126 - | //! # async fn dummy() {
|
127 - | //! # let app = RestXmlExtras::builder(
|
128 - | //! # RestXmlExtrasConfig::builder()
|
129 - | //! # .build()
|
130 - | //! # ).build_unchecked();
|
131 - | //! let handler = LambdaHandler::new(app);
|
132 - | //! lambda_http::run(handler).await.unwrap();
|
133 - | //! # }
|
134 - | //! ```
|
135 - | //!
|
136 - | //! # Building the RestXmlExtras
|
137 - | //!
|
138 - | //! To construct [`RestXmlExtras`] we use [`RestXmlExtrasBuilder`] returned by [`RestXmlExtras::builder`].
|
139 - | //!
|
140 - | //! ## Plugins
|
141 - | //!
|
142 - | //! The [`RestXmlExtras::builder`] method, returning [`RestXmlExtrasBuilder`],
|
143 - | //! accepts a config object on which plugins can be registered.
|
144 - | //! Plugins allow you to build middleware which is aware of the operation it is being applied to.
|
145 - | //!
|
146 - | //! ```rust,no_run
|
147 - | //! # use ::aws_smithy_http_server::plugin::IdentityPlugin as LoggingPlugin;
|
148 - | //! # use ::aws_smithy_http_server::plugin::IdentityPlugin as MetricsPlugin;
|
149 - | //! # use ::hyper::Body;
|
150 - | //! use ::aws_smithy_http_server::plugin::HttpPlugins;
|
151 - | //! use rest_xml_extras::{RestXmlExtras, RestXmlExtrasConfig, RestXmlExtrasBuilder};
|
152 - | //!
|
153 - | //! let http_plugins = HttpPlugins::new()
|
154 - | //! .push(LoggingPlugin)
|
155 - | //! .push(MetricsPlugin);
|
156 - | //! let config = RestXmlExtrasConfig::builder().build();
|
157 - | //! let builder: RestXmlExtrasBuilder<Body, _, _, _> = RestXmlExtras::builder(config);
|
158 - | //! ```
|
159 - | //!
|
160 - | //! Check out [`::aws_smithy_http_server::plugin`] to learn more about plugins.
|
161 - | //!
|
162 - | //! ## Handlers
|
163 - | //!
|
164 - | //! [`RestXmlExtrasBuilder`] provides a setter method for each operation in your Smithy model. The setter methods expect an async function as input, matching the signature for the corresponding operation in your Smithy model.
|
165 - | //! We call these async functions **handlers**. This is where your application business logic lives.
|
166 - | //!
|
167 - | //! Every handler must take an `Input`, and optional [`extractor arguments`](::aws_smithy_http_server::request), while returning:
|
168 - | //!
|
169 - | //! * A `Result<Output, Error>` if your operation has modeled errors, or
|
170 - | //! * An `Output` otherwise.
|
171 - | //!
|
172 - | //! ```rust,no_run
|
173 - | //! # struct Input;
|
174 - | //! # struct Output;
|
175 - | //! # struct Error;
|
176 - | //! async fn infallible_handler(input: Input) -> Output { todo!() }
|
177 - | //!
|
178 - | //! async fn fallible_handler(input: Input) -> Result<Output, Error> { todo!() }
|
179 - | //! ```
|
180 - | //!
|
181 - | //! Handlers can accept up to 8 extractors:
|
182 - | //!
|
183 - | //! ```rust,no_run
|
184 - | //! # struct Input;
|
185 - | //! # struct Output;
|
186 - | //! # struct Error;
|
187 - | //! # struct State;
|
188 - | //! # use std::net::SocketAddr;
|
189 - | //! use ::aws_smithy_http_server::request::{extension::Extension, connect_info::ConnectInfo};
|
190 - | //!
|
191 - | //! async fn handler_with_no_extensions(input: Input) -> Output {
|
192 - | //! todo!()
|
193 - | //! }
|
194 - | //!
|
195 - | //! async fn handler_with_one_extractor(input: Input, ext: Extension<State>) -> Output {
|
196 - | //! todo!()
|
197 - | //! }
|
198 - | //!
|
199 - | //! async fn handler_with_two_extractors(
|
200 - | //! input: Input,
|
201 - | //! ext0: Extension<State>,
|
202 - | //! ext1: ConnectInfo<SocketAddr>,
|
203 - | //! ) -> Output {
|
204 - | //! todo!()
|
205 - | //! }
|
206 - | //! ```
|
207 - | //!
|
208 - | //! See the [`operation module`](::aws_smithy_http_server::operation) for information on precisely what constitutes a handler.
|
209 - | //!
|
210 - | //! ## Build
|
211 - | //!
|
212 - | //! You can convert [`RestXmlExtrasBuilder`] into [`RestXmlExtras`] using either [`RestXmlExtrasBuilder::build`] or [`RestXmlExtrasBuilder::build_unchecked`].
|
213 - | //!
|
214 - | //! [`RestXmlExtrasBuilder::build`] requires you to provide a handler for every single operation in your Smithy model. It will return an error if that is not the case.
|
215 - | //!
|
216 - | //! [`RestXmlExtrasBuilder::build_unchecked`], instead, does not require exhaustiveness. The server will automatically return 500 Internal Server Error to all requests for operations that do not have a registered handler.
|
217 - | //! [`RestXmlExtrasBuilder::build_unchecked`] is particularly useful if you are deploying your Smithy service as a collection of Lambda functions, where each Lambda is only responsible for a subset of the operations in the Smithy service (or even a single one!).
|
218 - | //!
|
219 - | //! # Example
|
220 - | //!
|
221 - | //! ```rust,no_run
|
222 - | //! # use std::net::SocketAddr;
|
223 - | //! use rest_xml_extras::{RestXmlExtras, RestXmlExtrasConfig};
|
224 - | //!
|
225 - | //! #[::tokio::main]
|
226 - | //! pub async fn main() {
|
227 - | //! let config = RestXmlExtrasConfig::builder().build();
|
228 - | //! let app = RestXmlExtras::builder(config)
|
229 - | //! .content_type_parameters(content_type_parameters)
|
230 - | //! .build()
|
231 - | //! .expect("failed to build an instance of RestXmlExtras");
|
232 - | //!
|
233 - | //! let bind: SocketAddr = "127.0.0.1:6969".parse()
|
234 - | //! .expect("unable to parse the server bind address and port");
|
235 - | //! let server = ::hyper::Server::bind(&bind).serve(app.into_make_service());
|
236 - | //! # let server = async { Ok::<_, ()>(()) };
|
237 - | //!
|
238 - | //! // Run your service!
|
239 - | //! if let Err(err) = server.await {
|
240 - | //! eprintln!("server error: {:?}", err);
|
241 - | //! }
|
242 - | //! }
|
243 - | //!
|
244 - | //! use rest_xml_extras::{input, output};
|
245 - | //!
|
246 - | //! async fn content_type_parameters(input: input::ContentTypeParametersInput) -> output::ContentTypeParametersOutput {
|
247 - | //! todo!()
|
248 - | //! }
|
249 - | //!
|
250 - | //! ```
|
251 - | //!
|
252 - | //! [`serve`]: https://docs.rs/hyper/0.14.16/hyper/server/struct.Builder.html#method.serve
|
253 - | //! [`tower::make::MakeService`]: https://docs.rs/tower/latest/tower/make/trait.MakeService.html
|
254 - | //! [HTTP binding traits]: https://smithy.io/2.0/spec/http-bindings.html
|
255 - | //! [operations]: https://smithy.io/2.0/spec/service-types.html#operation
|
256 - | //! [hyper server]: https://docs.rs/hyper/latest/hyper/server/index.html
|
257 - | //! [Service]: https://docs.rs/tower-service/latest/tower_service/trait.Service.html
|
258 - | pub use crate::service::{
|
259 - | MissingOperationsError, RestXmlExtras, RestXmlExtrasBuilder, RestXmlExtrasConfig,
|
260 - | RestXmlExtrasConfigBuilder,
|
261 - | };
|
262 - |
|
263 - | /// Crate version number.
|
264 - | pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION");
|
265 - |
|
266 - | /// All error types that operations can return. Documentation on these types is copied from the model.
|
267 - | pub mod error;
|
268 - |
|
269 - | /// Input structures for operations. Documentation on these types is copied from the model.
|
270 - | pub mod input;
|
271 - |
|
272 - | /// All operations that this crate can perform.
|
273 - | pub mod operation;
|
274 - |
|
275 - | /// A collection of types representing each operation defined in the service closure.
|
276 - | ///
|
277 - | /// The [plugin system](::aws_smithy_http_server::plugin) makes use of these
|
278 - | /// [zero-sized types](https://doc.rust-lang.org/nomicon/exotic-sizes.html#zero-sized-types-zsts) (ZSTs) to
|
279 - | /// parameterize [`Plugin`](::aws_smithy_http_server::plugin::Plugin) implementations. Their traits, such as
|
280 - | /// [`OperationShape`](::aws_smithy_http_server::operation::OperationShape), can be used to provide
|
281 - | /// operation specific information to the [`Layer`](::tower::Layer) being applied.
|
282 - | pub mod operation_shape;
|
283 - |
|
284 - | /// Output structures for operations. Documentation on these types is copied from the model.
|
285 - | pub mod output;
|
286 - |
|
287 - | /// Contains the types that are re-exported from the `aws-smithy-http-server` crate.
|
288 - | pub mod server;
|
289 - |
|
290 - | mod service;
|
291 - |
|
292 - | /// Data primitives referenced by other data types.
|
293 - | pub mod types;
|
294 - |
|
295 - | /// Constrained types for constrained shapes.
|
296 - | mod constrained;
|
297 - |
|
298 - | pub(crate) mod protocol_serde;
|
299 10 | diff --git a/tmp-codegen-diff/codegen-server-test/rest_xml_extras/rust-server-codegen/src/operation.rs b/tmp-codegen-diff/codegen-server-test/rest_xml_extras/rust-server-codegen/src/operation.rs
|
300 11 | deleted file mode 100644
|
301 12 | index ceff5d4..0000000
|
302 - | -- a/tmp-codegen-diff/codegen-server-test/rest_xml_extras/rust-server-codegen/src/operation.rs
|
13 + | ++ /dev/null
|
303 14 | @@ -1,126 +0,0 @@
|
304 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
305 - |
|
306 - | ::pin_project_lite::pin_project! {
|
307 - | /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
|
308 - | /// [`ContentTypeParametersInput`](crate::input::ContentTypeParametersInput) using modelled bindings.
|
309 - | pub struct ContentTypeParametersInputFuture {
|
310 - | inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ContentTypeParametersInput, ::aws_smithy_http_server::protocol::rest_xml::runtime_error::RuntimeError>> + Send>>
|
311 - | }
|
312 - | }
|
313 - |
|
314 - | impl std::future::Future for ContentTypeParametersInputFuture {
|
315 - | type Output = Result<
|
316 - | crate::input::ContentTypeParametersInput,
|
317 - | ::aws_smithy_http_server::protocol::rest_xml::runtime_error::RuntimeError,
|
318 - | >;
|
319 - |
|
320 - | fn poll(
|
321 - | self: std::pin::Pin<&mut Self>,
|
322 - | cx: &mut std::task::Context<'_>,
|
323 - | ) -> std::task::Poll<Self::Output> {
|
324 - | let this = self.project();
|
325 - | this.inner.as_mut().poll(cx)
|
326 - | }
|
327 - | }
|
328 - |
|
329 - | impl<B>
|
330 - | ::aws_smithy_http_server::request::FromRequest<
|
331 - | ::aws_smithy_http_server::protocol::rest_xml::RestXml,
|
332 - | B,
|
333 - | > for crate::input::ContentTypeParametersInput
|
334 - | where
|
335 - | B: ::aws_smithy_http_server::body::HttpBody + Send,
|
336 - | B: 'static,
|
337 - |
|
338 - | B::Data: Send,
|
339 - | ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection:
|
340 - | From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
|
341 - | {
|
342 - | type Rejection = ::aws_smithy_http_server::protocol::rest_xml::runtime_error::RuntimeError;
|
343 - | type Future = ContentTypeParametersInputFuture;
|
344 - |
|
345 - | fn from_request(request: ::http::Request<B>) -> Self::Future {
|
346 - | let fut = async move {
|
347 - | crate::protocol_serde::shape_content_type_parameters::de_content_type_parameters_http_request(request)
|
348 - | .await
|
349 - | .map_err(Into::into)
|
350 - | };
|
351 - | use ::futures_util::future::TryFutureExt;
|
352 - | let fut = fut.map_err(
|
353 - | |e: ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection| {
|
354 - | ::tracing::debug!(error = %e, "failed to deserialize request");
|
355 - | ::aws_smithy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e)
|
356 - | },
|
357 - | );
|
358 - | ContentTypeParametersInputFuture {
|
359 - | inner: Box::pin(fut),
|
360 - | }
|
361 - | }
|
362 - | }
|
363 - | impl
|
364 - | ::aws_smithy_http_server::response::IntoResponse<
|
365 - | ::aws_smithy_http_server::protocol::rest_xml::RestXml,
|
366 - | > for crate::output::ContentTypeParametersOutput
|
367 - | {
|
368 - | fn into_response(self) -> ::aws_smithy_http_server::response::Response {
|
369 - | match crate::protocol_serde::shape_content_type_parameters::ser_content_type_parameters_http_response(self) {
|
370 - | Ok(response) => response,
|
371 - | Err(e) => {
|
372 - | ::tracing::error!(error = %e, "failed to serialize response");
|
373 - | ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_xml::RestXml>::into_response(::aws_smithy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e))
|
374 - | }
|
375 - | }
|
376 - | }
|
377 - | }
|
378 - |
|
379 - | #[allow(unreachable_code, unused_variables)]
|
380 - | #[cfg(test)]
|
381 - | mod content_type_parameters_test {
|
382 - |
|
383 - | /// A server should ignore parameters added to the content type
|
384 - | /// Test ID: RestXmlMustSupportParametersInContentType
|
385 - | #[::tokio::test]
|
386 - | #[::tracing_test::traced_test]
|
387 - | async fn rest_xml_must_support_parameters_in_content_type_request() {
|
388 - | #[allow(unused_mut)]
|
389 - | let mut http_request = http::Request::builder()
|
390 - | .uri("/ContentTypeParameters")
|
391 - | .method("PUT")
|
392 - | .header("Content-Type", "application/xml; charset=utf-8")
|
393 - | .body(::aws_smithy_http_server::body::Body::from(
|
394 - | ::bytes::Bytes::from_static(
|
395 - | "<ContentTypeParametersInput><value>5</value></ContentTypeParametersInput>"
|
396 - | .as_bytes(),
|
397 - | ),
|
398 - | ))
|
399 - | .unwrap();
|
400 - | #[allow(unused_mut)]
|
401 - | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
402 - | let config = crate::service::RestXmlExtrasConfig::builder().build();
|
403 - | let service =
|
404 - | crate::service::RestXmlExtras::builder::<::hyper::body::Body, _, _, _>(config)
|
405 - | .content_type_parameters(move |input: crate::input::ContentTypeParametersInput| {
|
406 - | let sender = sender.clone();
|
407 - | async move {
|
408 - | let result = {
|
409 - | let expected = crate::input::ContentTypeParametersInput {
|
410 - | value: ::std::option::Option::Some(5),
|
411 - | };
|
412 - | ::pretty_assertions::assert_eq!(input, expected);
|
413 - | let response = crate::output::ContentTypeParametersOutput {};
|
414 - | response
|
415 - | };
|
416 - | sender.send(()).await.expect("receiver dropped early");
|
417 - | result
|
418 - | }
|
419 - | })
|
420 - | .build_unchecked();
|
421 - | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
422 - | .await
|
423 - | .expect("unable to make an HTTP request");
|
424 - | assert!(
|
425 - | receiver.recv().await.is_some(),
|
426 - | "we expected operation handler to be invoked but it was not entered"
|
427 - | );
|
428 - | }
|
429 - | }
|
430 15 | diff --git a/tmp-codegen-diff/codegen-server-test/rest_xml_extras/rust-server-codegen/src/operation_shape.rs b/tmp-codegen-diff/codegen-server-test/rest_xml_extras/rust-server-codegen/src/operation_shape.rs
|
431 16 | deleted file mode 100644
|
432 17 | index 0f79525..0000000
|
433 - | -- a/tmp-codegen-diff/codegen-server-test/rest_xml_extras/rust-server-codegen/src/operation_shape.rs
|
18 + | ++ /dev/null
|
434 19 | @@ -1,39 +0,0 @@
|
435 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
436 - |
|
437 - | /// The example tests how servers must support requests containing a `Content-Type` header with parameters.
|
438 - | pub struct ContentTypeParameters;
|
439 - |
|
440 - | impl ::aws_smithy_http_server::operation::OperationShape for ContentTypeParameters {
|
441 - | const ID: ::aws_smithy_http_server::shape_id::ShapeId =
|
442 - | ::aws_smithy_http_server::shape_id::ShapeId::new(
|
443 - | "aws.protocoltests.restxml#ContentTypeParameters",
|
444 - | "aws.protocoltests.restxml",
|
445 - | "ContentTypeParameters",
|
446 - | );
|
447 - |
|
448 - | type Input = crate::input::ContentTypeParametersInput;
|
449 - | type Output = crate::output::ContentTypeParametersOutput;
|
450 - | type Error = std::convert::Infallible;
|
451 - | }
|
452 - |
|
453 - | impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for ContentTypeParameters {
|
454 - | type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt<
|
455 - | ::aws_smithy_http_server::instrumentation::MakeIdentity,
|
456 - | ::aws_smithy_http_server::instrumentation::sensitivity::uri::MakeUri<
|
457 - | ::aws_smithy_http_server::instrumentation::MakeIdentity,
|
458 - | ::aws_smithy_http_server::instrumentation::MakeIdentity,
|
459 - | >,
|
460 - | >;
|
461 - | type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt<
|
462 - | ::aws_smithy_http_server::instrumentation::MakeIdentity,
|
463 - | ::aws_smithy_http_server::instrumentation::MakeIdentity,
|
464 - | >;
|
465 - |
|
466 - | fn request_fmt() -> Self::RequestFmt {
|
467 - | ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
|
468 - | }
|
469 - |
|
470 - | fn response_fmt() -> Self::ResponseFmt {
|
471 - | ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
|
472 - | }
|
473 - | }
|
474 20 | diff --git a/tmp-codegen-diff/codegen-server-test/rest_xml_extras/rust-server-codegen/src/output.rs b/tmp-codegen-diff/codegen-server-test/rest_xml_extras/rust-server-codegen/src/output.rs
|
475 21 | deleted file mode 100644
|
476 22 | index 8e86ae6..0000000
|
477 - | -- a/tmp-codegen-diff/codegen-server-test/rest_xml_extras/rust-server-codegen/src/output.rs
|
23 + | ++ /dev/null
|
478 24 | @@ -1,34 +0,0 @@
|
479 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
480 - | #[allow(missing_docs)] // documentation missing in model
|
481 - | #[derive(
|
482 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
483 - | )]
|
484 - | pub struct ContentTypeParametersOutput {}
|
485 - | impl ContentTypeParametersOutput {
|
486 - | /// Creates a new builder-style object to manufacture [`ContentTypeParametersOutput`](crate::output::ContentTypeParametersOutput).
|
487 - | pub fn builder() -> crate::output::content_type_parameters_output::Builder {
|
488 - | crate::output::content_type_parameters_output::Builder::default()
|
489 - | }
|
490 - | }
|
491 - | /// See [`ContentTypeParametersOutput`](crate::output::ContentTypeParametersOutput).
|
492 - | ///
|
493 - | pub mod content_type_parameters_output {
|
494 - |
|
495 - | impl ::std::convert::From<Builder> for crate::output::ContentTypeParametersOutput {
|
496 - | fn from(builder: Builder) -> Self {
|
497 - | builder.build()
|
498 - | }
|
499 - | }
|
500 - | /// A builder for [`ContentTypeParametersOutput`](crate::output::ContentTypeParametersOutput).
|
501 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
502 - | pub struct Builder {}
|
503 - | impl Builder {
|
504 - | /// Consumes the builder and constructs a [`ContentTypeParametersOutput`](crate::output::ContentTypeParametersOutput).
|
505 - | pub fn build(self) -> crate::output::ContentTypeParametersOutput {
|
506 - | self.build_enforcing_all_constraints()
|
507 - | }
|
508 - | fn build_enforcing_all_constraints(self) -> crate::output::ContentTypeParametersOutput {
|
509 - | crate::output::ContentTypeParametersOutput {}
|
510 - | }
|
511 - | }
|
512 - | }
|
513 25 | diff --git a/tmp-codegen-diff/codegen-server-test/rest_xml_extras/rust-server-codegen/src/protocol_serde.rs b/tmp-codegen-diff/codegen-server-test/rest_xml_extras/rust-server-codegen/src/protocol_serde.rs
|
514 26 | deleted file mode 100644
|
515 27 | index e3604d1..0000000
|
516 - | -- a/tmp-codegen-diff/codegen-server-test/rest_xml_extras/rust-server-codegen/src/protocol_serde.rs
|
28 + | ++ /dev/null
|
517 29 | @@ -1,2 +0,0 @@
|
518 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
519 - | pub(crate) mod shape_content_type_parameters;
|
520 30 | diff --git a/tmp-codegen-diff/codegen-server-test/rest_xml_extras/rust-server-codegen/src/server.rs b/tmp-codegen-diff/codegen-server-test/rest_xml_extras/rust-server-codegen/src/server.rs
|
521 31 | deleted file mode 100644
|
522 32 | index 2d532b0..0000000
|
523 - | -- a/tmp-codegen-diff/codegen-server-test/rest_xml_extras/rust-server-codegen/src/server.rs
|
33 + | ++ /dev/null
|
524 34 | @@ -1,39 +0,0 @@
|
525 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
526 - | pub mod body {
|
527 - | pub use ::aws_smithy_http_server::body::BoxBody;
|
528 - | }
|
529 - | pub mod operation {
|
530 - | pub use ::aws_smithy_http_server::operation::OperationShape;
|
531 - | }
|
532 - | pub mod plugin {
|
533 - | pub use ::aws_smithy_http_server::plugin::HttpMarker;
|
534 - | pub use ::aws_smithy_http_server::plugin::HttpPlugins;
|
535 - | pub use ::aws_smithy_http_server::plugin::ModelMarker;
|
536 - | pub use ::aws_smithy_http_server::plugin::ModelPlugins;
|
537 - | pub use ::aws_smithy_http_server::plugin::Plugin;
|
538 - | pub use ::aws_smithy_http_server::plugin::PluginStack;
|
539 - | }
|
540 - | pub mod request {
|
541 - | pub use ::aws_smithy_http_server::request::FromParts;
|
542 - |
|
543 - | #[cfg(feature = "aws-lambda")]
|
544 - | pub mod lambda {
|
545 - | pub use ::aws_smithy_http_server::request::lambda::Context;
|
546 - | }
|
547 - | }
|
548 - | pub mod response {
|
549 - | pub use ::aws_smithy_http_server::response::IntoResponse;
|
550 - | }
|
551 - | pub mod routing {
|
552 - | pub use ::aws_smithy_http_server::routing::IntoMakeService;
|
553 - | pub use ::aws_smithy_http_server::routing::IntoMakeServiceWithConnectInfo;
|
554 - | pub use ::aws_smithy_http_server::routing::Router;
|
555 - |
|
556 - | #[cfg(feature = "aws-lambda")]
|
557 - | pub use ::aws_smithy_http_server::routing::LambdaHandler;
|
558 - | }
|
559 - |
|
560 - | pub use ::aws_smithy_http_server::instrumentation;
|
561 - | pub use ::aws_smithy_http_server::protocol;
|
562 - |
|
563 - | pub use ::aws_smithy_http_server::Extension;
|
564 35 | diff --git a/tmp-codegen-diff/codegen-server-test/rest_xml_extras/rust-server-codegen/src/service.rs b/tmp-codegen-diff/codegen-server-test/rest_xml_extras/rust-server-codegen/src/service.rs
|
565 36 | deleted file mode 100644
|
566 37 | index d2eaa7d..0000000
|
567 - | -- a/tmp-codegen-diff/codegen-server-test/rest_xml_extras/rust-server-codegen/src/service.rs
|
38 + | ++ /dev/null
|
568 39 | @@ -1,720 +0,0 @@
|
569 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
570 - | /// The service builder for [`RestXmlExtras`].
|
571 - | ///
|
572 - | /// Constructed via [`RestXmlExtras::builder`].
|
573 - | pub struct RestXmlExtrasBuilder<Body, L, HttpPl, ModelPl> {
|
574 - | content_type_parameters: Option<::aws_smithy_http_server::routing::Route<Body>>,
|
575 - | layer: L,
|
576 - | http_plugin: HttpPl,
|
577 - | model_plugin: ModelPl,
|
578 - | }
|
579 - |
|
580 - | impl<Body, L, HttpPl, ModelPl> RestXmlExtrasBuilder<Body, L, HttpPl, ModelPl> {
|
581 - | /// Sets the [`ContentTypeParameters`](crate::operation_shape::ContentTypeParameters) operation.
|
582 - | ///
|
583 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
584 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
585 - | ///
|
586 - | /// # Example
|
587 - | ///
|
588 - | /// ```no_run
|
589 - | /// use rest_xml_extras::{RestXmlExtras, RestXmlExtrasConfig};
|
590 - | ///
|
591 - | /// use rest_xml_extras::{input, output};
|
592 - | ///
|
593 - | /// async fn handler(input: input::ContentTypeParametersInput) -> output::ContentTypeParametersOutput {
|
594 - | /// todo!()
|
595 - | /// }
|
596 - | ///
|
597 - | /// let config = RestXmlExtrasConfig::builder().build();
|
598 - | /// let app = RestXmlExtras::builder(config)
|
599 - | /// .content_type_parameters(handler)
|
600 - | /// /* Set other handlers */
|
601 - | /// .build()
|
602 - | /// .unwrap();
|
603 - | /// # let app: RestXmlExtras<::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_xml::RestXml>> = app;
|
604 - | /// ```
|
605 - | ///
|
606 - | pub fn content_type_parameters<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
607 - | where
|
608 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::ContentTypeParameters, HandlerExtractors>,
|
609 - |
|
610 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
611 - | RestXmlExtras<L>,
|
612 - | crate::operation_shape::ContentTypeParameters,
|
613 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::ContentTypeParameters, HandlerType>
|
614 - | >,
|
615 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
616 - | RestXmlExtras<L>,
|
617 - | crate::operation_shape::ContentTypeParameters,
|
618 - | ModelPl::Output
|
619 - | >,
|
620 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
621 - | RestXmlExtras<L>,
|
622 - | crate::operation_shape::ContentTypeParameters,
|
623 - | <
|
624 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
625 - | as ::aws_smithy_http_server::plugin::Plugin<
|
626 - | RestXmlExtras<L>,
|
627 - | crate::operation_shape::ContentTypeParameters,
|
628 - | ModelPl::Output
|
629 - | >
|
630 - | >::Output
|
631 - | >,
|
632 - |
|
633 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
634 - | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
635 - |
|
636 - | {
|
637 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
638 - | use ::aws_smithy_http_server::plugin::Plugin;
|
639 - | let svc = crate::operation_shape::ContentTypeParameters::from_handler(handler);
|
640 - | let svc = self.model_plugin.apply(svc);
|
641 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
642 - | .apply(svc);
|
643 - | let svc = self.http_plugin.apply(svc);
|
644 - | self.content_type_parameters_custom(svc)
|
645 - | }
|
646 - |
|
647 - | /// Sets the [`ContentTypeParameters`](crate::operation_shape::ContentTypeParameters) operation.
|
648 - | ///
|
649 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
650 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
651 - | ///
|
652 - | /// # Example
|
653 - | ///
|
654 - | /// ```no_run
|
655 - | /// use rest_xml_extras::{RestXmlExtras, RestXmlExtrasConfig};
|
656 - | ///
|
657 - | /// use rest_xml_extras::{input, output};
|
658 - | ///
|
659 - | /// async fn handler(input: input::ContentTypeParametersInput) -> Result<output::ContentTypeParametersOutput, std::convert::Infallible> {
|
660 - | /// todo!()
|
661 - | /// }
|
662 - | ///
|
663 - | /// let config = RestXmlExtrasConfig::builder().build();
|
664 - | /// let svc = ::tower::util::service_fn(handler);
|
665 - | /// let app = RestXmlExtras::builder(config)
|
666 - | /// .content_type_parameters_service(svc)
|
667 - | /// /* Set other handlers */
|
668 - | /// .build()
|
669 - | /// .unwrap();
|
670 - | /// # let app: RestXmlExtras<::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_xml::RestXml>> = app;
|
671 - | /// ```
|
672 - | ///
|
673 - | pub fn content_type_parameters_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
674 - | where
|
675 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::ContentTypeParameters, ServiceExtractors>,
|
676 - |
|
677 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
678 - | RestXmlExtras<L>,
|
679 - | crate::operation_shape::ContentTypeParameters,
|
680 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::ContentTypeParameters, S>
|
681 - | >,
|
682 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
683 - | RestXmlExtras<L>,
|
684 - | crate::operation_shape::ContentTypeParameters,
|
685 - | ModelPl::Output
|
686 - | >,
|
687 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
688 - | RestXmlExtras<L>,
|
689 - | crate::operation_shape::ContentTypeParameters,
|
690 - | <
|
691 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
692 - | as ::aws_smithy_http_server::plugin::Plugin<
|
693 - | RestXmlExtras<L>,
|
694 - | crate::operation_shape::ContentTypeParameters,
|
695 - | ModelPl::Output
|
696 - | >
|
697 - | >::Output
|
698 - | >,
|
699 - |
|
700 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
701 - | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
702 - |
|
703 - | {
|
704 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
705 - | use ::aws_smithy_http_server::plugin::Plugin;
|
706 - | let svc = crate::operation_shape::ContentTypeParameters::from_service(service);
|
707 - | let svc = self.model_plugin.apply(svc);
|
708 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
709 - | .apply(svc);
|
710 - | let svc = self.http_plugin.apply(svc);
|
711 - | self.content_type_parameters_custom(svc)
|
712 - | }
|
713 - |
|
714 - | /// Sets the [`ContentTypeParameters`](crate::operation_shape::ContentTypeParameters) to a custom [`Service`](tower::Service).
|
715 - | /// not constrained by the Smithy contract.
|
716 - | fn content_type_parameters_custom<S>(mut self, svc: S) -> Self
|
717 - | where
|
718 - | S: ::tower::Service<
|
719 - | ::http::Request<Body>,
|
720 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
721 - | Error = ::std::convert::Infallible,
|
722 - | > + Clone
|
723 - | + Send
|
724 - | + 'static,
|
725 - | S::Future: Send + 'static,
|
726 - | {
|
727 - | self.content_type_parameters = Some(::aws_smithy_http_server::routing::Route::new(svc));
|
728 - | self
|
729 - | }
|
730 - | }
|
731 - |
|
732 - | impl<Body, L, HttpPl, ModelPl> RestXmlExtrasBuilder<Body, L, HttpPl, ModelPl> {
|
733 - | /// Constructs a [`RestXmlExtras`] from the arguments provided to the builder.
|
734 - | ///
|
735 - | /// Forgetting to register a handler for one or more operations will result in an error.
|
736 - | ///
|
737 - | /// Check out [`RestXmlExtrasBuilder::build_unchecked`] if you'd prefer the service to return status code 500 when an
|
738 - | /// unspecified route is requested.
|
739 - | pub fn build(
|
740 - | self,
|
741 - | ) -> Result<
|
742 - | RestXmlExtras<
|
743 - | ::aws_smithy_http_server::routing::RoutingService<
|
744 - | ::aws_smithy_http_server::protocol::rest::router::RestRouter<L::Service>,
|
745 - | ::aws_smithy_http_server::protocol::rest_xml::RestXml,
|
746 - | >,
|
747 - | >,
|
748 - | MissingOperationsError,
|
749 - | >
|
750 - | where
|
751 - | L: ::tower::Layer<::aws_smithy_http_server::routing::Route<Body>>,
|
752 - | {
|
753 - | let router = {
|
754 - | use ::aws_smithy_http_server::operation::OperationShape;
|
755 - | let mut missing_operation_names = std::collections::HashMap::new();
|
756 - | if self.content_type_parameters.is_none() {
|
757 - | missing_operation_names.insert(
|
758 - | crate::operation_shape::ContentTypeParameters::ID,
|
759 - | ".content_type_parameters()",
|
760 - | );
|
761 - | }
|
762 - | if !missing_operation_names.is_empty() {
|
763 - | return Err(MissingOperationsError {
|
764 - | operation_names2setter_methods: missing_operation_names,
|
765 - | });
|
766 - | }
|
767 - | 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";
|
768 - |
|
769 - | ::aws_smithy_http_server::protocol::rest::router::RestRouter::from_iter([(
|
770 - | request_specs::content_type_parameters(),
|
771 - | self.content_type_parameters.expect(unexpected_error_msg),
|
772 - | )])
|
773 - | };
|
774 - | let svc = ::aws_smithy_http_server::routing::RoutingService::new(router);
|
775 - | let svc = svc.map(|s| s.layer(self.layer));
|
776 - | Ok(RestXmlExtras { svc })
|
777 - | }
|
778 - |
|
779 - | /// Constructs a [`RestXmlExtras`] from the arguments provided to the builder.
|
780 - | /// Operations without a handler default to returning 500 Internal Server Error to the caller.
|
781 - | ///
|
782 - | /// Check out [`RestXmlExtrasBuilder::build`] if you'd prefer the builder to fail if one or more operations do
|
783 - | /// not have a registered handler.
|
784 - | pub fn build_unchecked(self) -> RestXmlExtras<L::Service>
|
785 - | where
|
786 - | Body: Send + 'static,
|
787 - | L: ::tower::Layer<
|
788 - | ::aws_smithy_http_server::routing::RoutingService<
|
789 - | ::aws_smithy_http_server::protocol::rest::router::RestRouter<
|
790 - | ::aws_smithy_http_server::routing::Route<Body>,
|
791 - | >,
|
792 - | ::aws_smithy_http_server::protocol::rest_xml::RestXml,
|
793 - | >,
|
794 - | >,
|
795 - | {
|
796 - | let router = ::aws_smithy_http_server::protocol::rest::router::RestRouter::from_iter([(
|
797 - | request_specs::content_type_parameters(),
|
798 - | self.content_type_parameters.unwrap_or_else(|| {
|
799 - | let svc = ::aws_smithy_http_server::operation::MissingFailure::<
|
800 - | ::aws_smithy_http_server::protocol::rest_xml::RestXml,
|
801 - | >::default();
|
802 - | ::aws_smithy_http_server::routing::Route::new(svc)
|
803 - | }),
|
804 - | )]);
|
805 - | let svc = self
|
806 - | .layer
|
807 - | .layer(::aws_smithy_http_server::routing::RoutingService::new(
|
808 - | router,
|
809 - | ));
|
810 - | RestXmlExtras { svc }
|
811 - | }
|
812 - | }
|
813 - |
|
814 - | /// The error encountered when calling the [`RestXmlExtrasBuilder::build`] method if one or more operation handlers are not
|
815 - | /// specified.
|
816 - | #[derive(Debug)]
|
817 - | pub struct MissingOperationsError {
|
818 - | operation_names2setter_methods:
|
819 - | std::collections::HashMap<::aws_smithy_http_server::shape_id::ShapeId, &'static str>,
|
820 - | }
|
821 - |
|
822 - | impl std::fmt::Display for MissingOperationsError {
|
823 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
824 - | write!(
|
825 - | f,
|
826 - | "You must specify a handler for all operations attached to `RestXmlExtras`.\n\
|
827 - | We are missing handlers for the following operations:\n",
|
828 - | )?;
|
829 - | for operation_name in self.operation_names2setter_methods.keys() {
|
830 - | writeln!(f, "- {}", operation_name.absolute())?;
|
831 - | }
|
832 - |
|
833 - | writeln!(f, "\nUse the dedicated methods on `RestXmlExtrasBuilder` to register the missing handlers:")?;
|
834 - | for setter_name in self.operation_names2setter_methods.values() {
|
835 - | writeln!(f, "- {}", setter_name)?;
|
836 - | }
|
837 - | Ok(())
|
838 - | }
|
839 - | }
|
840 - |
|
841 - | impl std::error::Error for MissingOperationsError {}
|
842 - |
|
843 - | mod request_specs {
|
844 - | pub(super) fn content_type_parameters(
|
845 - | ) -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
|
846 - | ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
|
847 - | ::http::Method::PUT,
|
848 - | ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
|
849 - | ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
|
850 - | ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
|
851 - | ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("ContentTypeParameters")),
|
852 - | ]),
|
853 - | ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
|
854 - | ])
|
855 - | )
|
856 - | ),
|
857 - | )
|
858 - | }
|
859 - | }
|
860 - |
|
861 - | /// A REST XML service that sends XML requests and responses.
|
862 - | ///
|
863 - | /// See the [root](crate) documentation for more information.
|
864 - | #[derive(Clone)]
|
865 - | pub struct RestXmlExtras<
|
866 - | S = ::aws_smithy_http_server::routing::RoutingService<
|
867 - | ::aws_smithy_http_server::protocol::rest::router::RestRouter<
|
868 - | ::aws_smithy_http_server::routing::Route<::aws_smithy_http_server::body::BoxBody>,
|
869 - | >,
|
870 - | ::aws_smithy_http_server::protocol::rest_xml::RestXml,
|
871 - | >,
|
872 - | > {
|
873 - | // This is the router wrapped by layers.
|
874 - | svc: S,
|
875 - | }
|
876 - |
|
877 - | impl RestXmlExtras<()> {
|
878 - | /// Constructs a builder for [`RestXmlExtras`].
|
879 - | /// You must specify a configuration object holding any plugins and layers that should be applied
|
880 - | /// to the operations in this service.
|
881 - | pub fn builder<
|
882 - | Body,
|
883 - | L,
|
884 - | HttpPl: ::aws_smithy_http_server::plugin::HttpMarker,
|
885 - | ModelPl: ::aws_smithy_http_server::plugin::ModelMarker,
|
886 - | >(
|
887 - | config: RestXmlExtrasConfig<L, HttpPl, ModelPl>,
|
888 - | ) -> RestXmlExtrasBuilder<Body, L, HttpPl, ModelPl> {
|
889 - | RestXmlExtrasBuilder {
|
890 - | content_type_parameters: None,
|
891 - | layer: config.layers,
|
892 - | http_plugin: config.http_plugins,
|
893 - | model_plugin: config.model_plugins,
|
894 - | }
|
895 - | }
|
896 - |
|
897 - | /// Constructs a builder for [`RestXmlExtras`].
|
898 - | /// You must specify what plugins should be applied to the operations in this service.
|
899 - | ///
|
900 - | /// Use [`RestXmlExtras::builder_without_plugins`] if you don't need to apply plugins.
|
901 - | ///
|
902 - | /// Check out [`HttpPlugins`](::aws_smithy_http_server::plugin::HttpPlugins) and
|
903 - | /// [`ModelPlugins`](::aws_smithy_http_server::plugin::ModelPlugins) if you need to apply
|
904 - | /// multiple plugins.
|
905 - | #[deprecated(
|
906 - | since = "0.57.0",
|
907 - | note = "please use the `builder` constructor and register plugins on the `RestXmlExtrasConfig` object instead; see https://github.com/smithy-lang/smithy-rs/discussions/3096"
|
908 - | )]
|
909 - | pub fn builder_with_plugins<
|
910 - | Body,
|
911 - | HttpPl: ::aws_smithy_http_server::plugin::HttpMarker,
|
912 - | ModelPl: ::aws_smithy_http_server::plugin::ModelMarker,
|
913 - | >(
|
914 - | http_plugin: HttpPl,
|
915 - | model_plugin: ModelPl,
|
916 - | ) -> RestXmlExtrasBuilder<Body, ::tower::layer::util::Identity, HttpPl, ModelPl> {
|
917 - | RestXmlExtrasBuilder {
|
918 - | content_type_parameters: None,
|
919 - | layer: ::tower::layer::util::Identity::new(),
|
920 - | http_plugin,
|
921 - | model_plugin,
|
922 - | }
|
923 - | }
|
924 - |
|
925 - | /// Constructs a builder for [`RestXmlExtras`].
|
926 - | ///
|
927 - | /// Use [`RestXmlExtras::builder_with_plugins`] if you need to specify plugins.
|
928 - | #[deprecated(
|
929 - | since = "0.57.0",
|
930 - | note = "please use the `builder` constructor instead; see https://github.com/smithy-lang/smithy-rs/discussions/3096"
|
931 - | )]
|
932 - | pub fn builder_without_plugins<Body>() -> RestXmlExtrasBuilder<
|
933 - | Body,
|
934 - | ::tower::layer::util::Identity,
|
935 - | ::aws_smithy_http_server::plugin::IdentityPlugin,
|
936 - | ::aws_smithy_http_server::plugin::IdentityPlugin,
|
937 - | > {
|
938 - | Self::builder_with_plugins(
|
939 - | ::aws_smithy_http_server::plugin::IdentityPlugin,
|
940 - | ::aws_smithy_http_server::plugin::IdentityPlugin,
|
941 - | )
|
942 - | }
|
943 - | }
|
944 - |
|
945 - | impl<S> RestXmlExtras<S> {
|
946 - | /// Converts [`RestXmlExtras`] into a [`MakeService`](tower::make::MakeService).
|
947 - | pub fn into_make_service(self) -> ::aws_smithy_http_server::routing::IntoMakeService<Self> {
|
948 - | ::aws_smithy_http_server::routing::IntoMakeService::new(self)
|
949 - | }
|
950 - |
|
951 - | /// Converts [`RestXmlExtras`] into a [`MakeService`](tower::make::MakeService) with [`ConnectInfo`](::aws_smithy_http_server::request::connect_info::ConnectInfo).
|
952 - | pub fn into_make_service_with_connect_info<C>(
|
953 - | self,
|
954 - | ) -> ::aws_smithy_http_server::routing::IntoMakeServiceWithConnectInfo<Self, C> {
|
955 - | ::aws_smithy_http_server::routing::IntoMakeServiceWithConnectInfo::new(self)
|
956 - | }
|
957 - | }
|
958 - |
|
959 - | impl<S>
|
960 - | RestXmlExtras<
|
961 - | ::aws_smithy_http_server::routing::RoutingService<
|
962 - | ::aws_smithy_http_server::protocol::rest::router::RestRouter<S>,
|
963 - | ::aws_smithy_http_server::protocol::rest_xml::RestXml,
|
964 - | >,
|
965 - | >
|
966 - | {
|
967 - | /// Applies a [`Layer`](::tower::Layer) uniformly to all routes.
|
968 - | #[deprecated(
|
969 - | since = "0.57.0",
|
970 - | note = "please add layers to the `RestXmlExtrasConfig` object instead; see https://github.com/smithy-lang/smithy-rs/discussions/3096"
|
971 - | )]
|
972 - | pub fn layer<L>(
|
973 - | self,
|
974 - | layer: &L,
|
975 - | ) -> RestXmlExtras<
|
976 - | ::aws_smithy_http_server::routing::RoutingService<
|
977 - | ::aws_smithy_http_server::protocol::rest::router::RestRouter<L::Service>,
|
978 - | ::aws_smithy_http_server::protocol::rest_xml::RestXml,
|
979 - | >,
|
980 - | >
|
981 - | where
|
982 - | L: ::tower::Layer<S>,
|
983 - | {
|
984 - | RestXmlExtras {
|
985 - | svc: self.svc.map(|s| s.layer(layer)),
|
986 - | }
|
987 - | }
|
988 - |
|
989 - | /// Applies [`Route::new`](::aws_smithy_http_server::routing::Route::new) to all routes.
|
990 - | ///
|
991 - | /// This has the effect of erasing all types accumulated via layers.
|
992 - | pub fn boxed<B>(
|
993 - | self,
|
994 - | ) -> RestXmlExtras<
|
995 - | ::aws_smithy_http_server::routing::RoutingService<
|
996 - | ::aws_smithy_http_server::protocol::rest::router::RestRouter<
|
997 - | ::aws_smithy_http_server::routing::Route<B>,
|
998 - | >,
|
999 - | ::aws_smithy_http_server::protocol::rest_xml::RestXml,
|
1000 - | >,
|
1001 - | >
|
1002 - | where
|
1003 - | S: ::tower::Service<
|
1004 - | ::http::Request<B>,
|
1005 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
1006 - | Error = std::convert::Infallible,
|
1007 - | >,
|
1008 - | S: Clone + Send + 'static,
|
1009 - | S::Future: Send + 'static,
|
1010 - | {
|
1011 - | self.layer(&::tower::layer::layer_fn(
|
1012 - | ::aws_smithy_http_server::routing::Route::new,
|
1013 - | ))
|
1014 - | }
|
1015 - | }
|
1016 - |
|
1017 - | impl<S, R> ::tower::Service<R> for RestXmlExtras<S>
|
1018 - | where
|
1019 - | S: ::tower::Service<R>,
|
1020 - | {
|
1021 - | type Response = S::Response;
|
1022 - | type Error = S::Error;
|
1023 - | type Future = S::Future;
|
1024 - |
|
1025 - | fn poll_ready(
|
1026 - | &mut self,
|
1027 - | cx: &mut std::task::Context,
|
1028 - | ) -> std::task::Poll<Result<(), Self::Error>> {
|
1029 - | self.svc.poll_ready(cx)
|
1030 - | }
|
1031 - |
|
1032 - | fn call(&mut self, request: R) -> Self::Future {
|
1033 - | self.svc.call(request)
|
1034 - | }
|
1035 - | }
|
1036 - |
|
1037 - | /// An enumeration of all [operations](https://smithy.io/2.0/spec/service-types.html#operation) in RestXmlExtras.
|
1038 - | #[allow(clippy::enum_variant_names)]
|
1039 - | #[derive(Debug, PartialEq, Eq, Clone, Copy)]
|
1040 - | pub enum Operation {
|
1041 - | ContentTypeParameters,
|
1042 - | }
|
1043 - |
|
1044 - | impl Operation {
|
1045 - | /// Returns the [operations](https://smithy.io/2.0/spec/service-types.html#operation) [`ShapeId`](::aws_smithy_http_server::shape_id::ShapeId).
|
1046 - | pub fn shape_id(&self) -> ::aws_smithy_http_server::shape_id::ShapeId {
|
1047 - | match self {
|
1048 - | Operation::ContentTypeParameters => ::aws_smithy_http_server::shape_id::ShapeId::new(
|
1049 - | "aws.protocoltests.restxml#ContentTypeParameters",
|
1050 - | "aws.protocoltests.restxml",
|
1051 - | "ContentTypeParameters",
|
1052 - | ),
|
1053 - | }
|
1054 - | }
|
1055 - | }
|
1056 - | impl<L>
|
1057 - | ::aws_smithy_http_server::service::ContainsOperation<
|
1058 - | crate::operation_shape::ContentTypeParameters,
|
1059 - | > for RestXmlExtras<L>
|
1060 - | {
|
1061 - | const VALUE: Operation = Operation::ContentTypeParameters;
|
1062 - | }
|
1063 - |
|
1064 - | impl<S> ::aws_smithy_http_server::service::ServiceShape for RestXmlExtras<S> {
|
1065 - | const ID: ::aws_smithy_http_server::shape_id::ShapeId =
|
1066 - | ::aws_smithy_http_server::shape_id::ShapeId::new(
|
1067 - | "aws.protocoltests.restxml#RestXmlExtras",
|
1068 - | "aws.protocoltests.restxml",
|
1069 - | "RestXmlExtras",
|
1070 - | );
|
1071 - |
|
1072 - | const VERSION: Option<&'static str> = Some("2024-04-15");
|
1073 - |
|
1074 - | type Protocol = ::aws_smithy_http_server::protocol::rest_xml::RestXml;
|
1075 - |
|
1076 - | type Operations = Operation;
|
1077 - | }
|
1078 - | /// Configuration for the [`RestXmlExtras`]. This is the central place where to register and
|
1079 - | /// configure [`::tower::Layer`]s, HTTP plugins, and model plugins.
|
1080 - | ///
|
1081 - | /// ```rust,no_run
|
1082 - | /// # use rest_xml_extras::RestXmlExtrasConfig;
|
1083 - | /// # use ::aws_smithy_http_server::plugin::IdentityPlugin;
|
1084 - | /// # use ::tower::layer::util::Identity;
|
1085 - | /// # let authentication_plugin = IdentityPlugin;
|
1086 - | /// # let authorization_plugin = IdentityPlugin;
|
1087 - | /// # let server_request_id_provider_layer = Identity::new();
|
1088 - | /// let config = RestXmlExtrasConfig::builder()
|
1089 - | /// // Layers get executed first...
|
1090 - | /// .layer(server_request_id_provider_layer)
|
1091 - | /// // ...then HTTP plugins...
|
1092 - | /// .http_plugin(authentication_plugin)
|
1093 - | /// // ...and right after deserialization, model plugins.
|
1094 - | /// .model_plugin(authorization_plugin)
|
1095 - | /// .build();
|
1096 - | /// ```
|
1097 - | ///
|
1098 - | /// See the [`plugin`] system for details.
|
1099 - | ///
|
1100 - | /// [`plugin`]: ::aws_smithy_http_server::plugin
|
1101 - | #[derive(::std::fmt::Debug)]
|
1102 - | pub struct RestXmlExtrasConfig<L, H, M> {
|
1103 - | layers: L,
|
1104 - | http_plugins: H,
|
1105 - | model_plugins: M,
|
1106 - | }
|
1107 - |
|
1108 - | impl RestXmlExtrasConfig<(), (), ()> {
|
1109 - | /// Returns a builder to construct the configuration.
|
1110 - | pub fn builder() -> RestXmlExtrasConfigBuilder<
|
1111 - | ::tower::layer::util::Identity,
|
1112 - | ::aws_smithy_http_server::plugin::IdentityPlugin,
|
1113 - | ::aws_smithy_http_server::plugin::IdentityPlugin,
|
1114 - | > {
|
1115 - | RestXmlExtrasConfigBuilder {
|
1116 - | layers: ::tower::layer::util::Identity::new(),
|
1117 - | http_plugins: ::aws_smithy_http_server::plugin::IdentityPlugin,
|
1118 - | model_plugins: ::aws_smithy_http_server::plugin::IdentityPlugin,
|
1119 - | }
|
1120 - | }
|
1121 - | }
|
1122 - |
|
1123 - | /// Builder returned by [`RestXmlExtrasConfig::builder()`].
|
1124 - | #[derive(::std::fmt::Debug)]
|
1125 - | pub struct RestXmlExtrasConfigBuilder<L, H, M> {
|
1126 - | pub(crate) layers: L,
|
1127 - | pub(crate) http_plugins: H,
|
1128 - | pub(crate) model_plugins: M,
|
1129 - | }
|
1130 - |
|
1131 - | impl<L, H, M> RestXmlExtrasConfigBuilder<L, H, M> {
|
1132 - | /// Add a [`::tower::Layer`] to the service.
|
1133 - | pub fn layer<NewLayer>(
|
1134 - | self,
|
1135 - | layer: NewLayer,
|
1136 - | ) -> RestXmlExtrasConfigBuilder<::tower::layer::util::Stack<NewLayer, L>, H, M> {
|
1137 - | RestXmlExtrasConfigBuilder {
|
1138 - | layers: ::tower::layer::util::Stack::new(layer, self.layers),
|
1139 - | http_plugins: self.http_plugins,
|
1140 - | model_plugins: self.model_plugins,
|
1141 - | }
|
1142 - | }
|
1143 - |
|
1144 - | /// Add a HTTP [plugin] to the service.
|
1145 - | ///
|
1146 - | /// [plugin]: ::aws_smithy_http_server::plugin
|
1147 - | // We eagerly require `NewPlugin: HttpMarker`, despite not really needing it, because compiler
|
1148 - | // errors get _substantially_ better if the user makes a mistake.
|
1149 - | pub fn http_plugin<NewPlugin: ::aws_smithy_http_server::plugin::HttpMarker>(
|
1150 - | self,
|
1151 - | http_plugin: NewPlugin,
|
1152 - | ) -> RestXmlExtrasConfigBuilder<L, ::aws_smithy_http_server::plugin::PluginStack<NewPlugin, H>, M>
|
1153 - | {
|
1154 - | RestXmlExtrasConfigBuilder {
|
1155 - | layers: self.layers,
|
1156 - | http_plugins: ::aws_smithy_http_server::plugin::PluginStack::new(
|
1157 - | http_plugin,
|
1158 - | self.http_plugins,
|
1159 - | ),
|
1160 - | model_plugins: self.model_plugins,
|
1161 - | }
|
1162 - | }
|
1163 - |
|
1164 - | /// Add a model [plugin] to the service.
|
1165 - | ///
|
1166 - | /// [plugin]: ::aws_smithy_http_server::plugin
|
1167 - | // We eagerly require `NewPlugin: ModelMarker`, despite not really needing it, because compiler
|
1168 - | // errors get _substantially_ better if the user makes a mistake.
|
1169 - | pub fn model_plugin<NewPlugin: ::aws_smithy_http_server::plugin::ModelMarker>(
|
1170 - | self,
|
1171 - | model_plugin: NewPlugin,
|
1172 - | ) -> RestXmlExtrasConfigBuilder<L, H, ::aws_smithy_http_server::plugin::PluginStack<NewPlugin, M>>
|
1173 - | {
|
1174 - | RestXmlExtrasConfigBuilder {
|
1175 - | layers: self.layers,
|
1176 - | http_plugins: self.http_plugins,
|
1177 - | model_plugins: ::aws_smithy_http_server::plugin::PluginStack::new(
|
1178 - | model_plugin,
|
1179 - | self.model_plugins,
|
1180 - | ),
|
1181 - | }
|
1182 - | }
|
1183 - |
|
1184 - | /// Build the configuration.
|
1185 - | pub fn build(self) -> super::RestXmlExtrasConfig<L, H, M> {
|
1186 - | super::RestXmlExtrasConfig {
|
1187 - | layers: self.layers,
|
1188 - | http_plugins: self.http_plugins,
|
1189 - | model_plugins: self.model_plugins,
|
1190 - | }
|
1191 - | }
|
1192 - | }
|
1193 - | /// A macro to help with scoping [plugins](::aws_smithy_http_server::plugin) to a subset of all operations.
|
1194 - | ///
|
1195 - | /// In contrast to [`aws_smithy_http_server::scope`](::aws_smithy_http_server::scope), this macro has knowledge
|
1196 - | /// of the service and any operations _not_ specified will be placed in the opposing group.
|
1197 - | ///
|
1198 - | /// # Example
|
1199 - | ///
|
1200 - | /// ```rust
|
1201 - | /// scope! {
|
1202 - | /// /// Includes [`ContentTypeParameters`], excluding all other operations.
|
1203 - | /// struct ScopeA {
|
1204 - | /// includes: [ContentTypeParameters]
|
1205 - | /// }
|
1206 - | /// }
|
1207 - | ///
|
1208 - | /// scope! {
|
1209 - | /// /// Excludes [`ContentTypeParameters`], excluding all other operations.
|
1210 - | /// struct ScopeB {
|
1211 - | /// excludes: [ContentTypeParameters]
|
1212 - | /// }
|
1213 - | /// }
|
1214 - | ///
|
1215 - | /// # use ::aws_smithy_http_server::plugin::{Plugin, Scoped};
|
1216 - | /// # use rest_xml_extras::scope;
|
1217 - | /// # struct MockPlugin;
|
1218 - | /// # impl<S, Op, T> Plugin<S, Op, T> for MockPlugin { type Output = u32; fn apply(&self, input: T) -> u32 { 3 } }
|
1219 - | /// # let scoped_a = Scoped::new::<ScopeA>(MockPlugin);
|
1220 - | /// # let scoped_b = Scoped::new::<ScopeB>(MockPlugin);
|
1221 - | /// # let a = Plugin::<(), rest_xml_extras::operation_shape::ContentTypeParameters, u64>::apply(&scoped_a, 6);
|
1222 - | /// # let b = Plugin::<(), rest_xml_extras::operation_shape::ContentTypeParameters, u64>::apply(&scoped_b, 6);
|
1223 - | /// # assert_eq!(a, 3_u32);
|
1224 - | /// # assert_eq!(b, 6_u64);
|
1225 - | /// ```
|
1226 - | #[macro_export]
|
1227 - | macro_rules! scope {
|
1228 - | // Completed, render impls
|
1229 - | (@ $ name: ident, $ contains: ident () ($($ temp: ident)*) ($($ not_member: ident)*)) => {
|
1230 - | $(
|
1231 - | impl ::aws_smithy_http_server::plugin::scoped::Membership<$ temp> for $ name {
|
1232 - | type Contains = ::aws_smithy_http_server::plugin::scoped::$ contains;
|
1233 - | }
|
1234 - | )*
|
1235 - | $(
|
1236 - | impl ::aws_smithy_http_server::plugin::scoped::Membership<$ not_member> for $ name {
|
1237 - | type Contains = ::aws_smithy_http_server::plugin::scoped::$ contains;
|
1238 - | }
|
1239 - | )*
|
1240 - | };
|
1241 - | // All `not_member`s exhausted, move `temp` into `not_member`
|
1242 - | (@ $ name: ident, $ contains: ident ($($ member: ident)*) ($($ temp: ident)*) ()) => {
|
1243 - | scope! { @ $ name, $ contains ($($ member)*) () ($($ temp)*) }
|
1244 - | };
|
1245 - |
|
1246 - | // ContentTypeParameters match found, pop from both `member` and `not_member`
|
1247 - | (@ $ name: ident, $ contains: ident (ContentTypeParameters $($ member: ident)*) ($($ temp: ident)*) (ContentTypeParameters $($ not_member: ident)*)) => {
|
1248 - | scope! { @ $ name, $ contains ($($ member)*) ($($ temp)*) ($($ not_member)*) }
|
1249 - | };
|
1250 - | // ContentTypeParameters match not found, pop from `not_member` into `temp` stack
|
1251 - | (@ $ name: ident, $ contains: ident (ContentTypeParameters $($ member: ident)*) ($($ temp: ident)*) ($ other: ident $($ not_member: ident)*)) => {
|
1252 - | scope! { @ $ name, $ contains (ContentTypeParameters $($ member)*) ($ other $($ temp)*) ($($ not_member)*) }
|
1253 - | };
|
1254 - |
|
1255 - | (
|
1256 - | $(#[$ attrs:meta])*
|
1257 - | $ vis:vis struct $ name:ident {
|
1258 - | includes: [$($ include:ident),*]
|
1259 - | }
|
1260 - | ) => {
|
1261 - | use $ crate::operation_shape::*;
|
1262 - | ::aws_smithy_http_server::scope! {
|
1263 - | $(#[$ attrs])*
|
1264 - | $ vis struct $ name {
|
1265 - | includes: [$($ include),*],
|
1266 - | excludes: []
|
1267 - | }
|
1268 - | }
|
1269 - | scope! { @ $ name, False ($($ include)*) () (ContentTypeParameters) }
|
1270 - | };
|
1271 - | (
|
1272 - | $(#[$ attrs:meta])*
|
1273 - | $ vis:vis struct $ name:ident {
|
1274 - | excludes: [$($ exclude:ident),*]
|
1275 - | }
|
1276 - | ) => {
|
1277 - | use $ crate::operation_shape::*;
|
1278 - |
|
1279 - | ::aws_smithy_http_server::scope! {
|
1280 - | $(#[$ attrs])*
|
1281 - | $ vis struct $ name {
|
1282 - | includes: [],
|
1283 - | excludes: [$($ exclude),*]
|
1284 - | }
|
1285 - | }
|
1286 - | scope! { @ $ name, True ($($ exclude)*) () (ContentTypeParameters) }
|
1287 - | };
|
1288 - | }
|
1289 40 | diff --git a/tmp-codegen-diff/codegen-server-test/rest_xml_extras/rust-server-codegen/src/types.rs b/tmp-codegen-diff/codegen-server-test/rest_xml_extras/rust-server-codegen/src/types.rs
|
1290 41 | deleted file mode 100644
|
1291 42 | index b714cfb..0000000
|
1292 - | -- a/tmp-codegen-diff/codegen-server-test/rest_xml_extras/rust-server-codegen/src/types.rs
|
43 + | ++ /dev/null
|
1293 44 | @@ -1,9 +0,0 @@
|
1294 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
1295 - | pub use ::aws_smithy_types::body::SdkBody;
|
1296 - | pub use ::aws_smithy_types::byte_stream::error::Error as ByteStreamError;
|
1297 - | pub use ::aws_smithy_types::byte_stream::AggregatedBytes;
|
1298 - | pub use ::aws_smithy_types::byte_stream::ByteStream;
|
1299 - | pub use ::aws_smithy_types::date_time::Format as DateTimeFormat;
|
1300 - | pub use ::aws_smithy_types::error::display::DisplayErrorContext;
|
1301 - | pub use ::aws_smithy_types::Blob;
|
1302 - | pub use ::aws_smithy_types::DateTime;
|
1303 45 |
|