1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | /// Python handler for operation `QueryIncompatibleOperation`.
|
3 - | pub(crate) async fn query_incompatible_operation(
|
4 - | input: crate::input::QueryIncompatibleOperationInput,
|
2 + | /// Python handler for operation `NoInputAndNoOutput`.
|
3 + | pub(crate) async fn no_input_and_no_output(
|
4 + | input: crate::input::NoInputAndNoOutputInput,
|
5 5 | state: ::aws_smithy_legacy_http_server::Extension<
|
6 6 | ::aws_smithy_http_server_python::context::PyContext,
|
7 7 | >,
|
8 8 | handler: ::aws_smithy_http_server_python::PyHandler,
|
9 9 | ) -> std::result::Result<
|
10 - | crate::output::QueryIncompatibleOperationOutput,
|
11 - | crate::error::QueryIncompatibleOperationError,
|
10 + | crate::output::NoInputAndNoOutputOutput,
|
11 + | crate::error::NoInputAndNoOutputError,
|
12 12 | > {
|
13 13 | // Async block used to run the handler and catch any Python error.
|
14 14 | let result = if handler.is_coroutine {
|
15 15 | ::tracing::trace!(
|
16 - | name = "query_incompatible_operation",
|
16 + | name = "no_input_and_no_output",
|
17 17 | "executing python handler coroutine"
|
18 18 | );
|
19 19 | let result = ::pyo3::Python::with_gil(|py| {
|
20 20 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
21 21 | let coroutine = if handler.args == 1 {
|
22 22 | pyhandler.call1((input,))?
|
23 23 | } else {
|
24 24 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
25 25 | };
|
26 26 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
27 27 | })?;
|
28 28 | result.await.and_then(|r| {
|
29 - | ::pyo3::Python::with_gil(|py| {
|
30 - | r.extract::<crate::output::QueryIncompatibleOperationOutput>(py)
|
31 - | })
|
29 + | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::NoInputAndNoOutputOutput>(py))
|
32 30 | })
|
33 31 | } else {
|
34 32 | ::tracing::trace!(
|
35 - | name = "query_incompatible_operation",
|
33 + | name = "no_input_and_no_output",
|
36 34 | "executing python handler function"
|
37 35 | );
|
38 36 | ::pyo3::Python::with_gil(|py| {
|
39 37 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
40 38 | let output = if handler.args == 1 {
|
41 39 | pyhandler.call1((input,))?
|
42 40 | } else {
|
43 41 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
44 42 | };
|
45 - | output.extract::<crate::output::QueryIncompatibleOperationOutput>()
|
43 + | output.extract::<crate::output::NoInputAndNoOutputOutput>()
|
46 44 | })
|
47 45 | };
|
48 46 | // Catch and record a Python traceback.
|
49 47 | result.map_err(|e| {
|
50 48 | let rich_py_err =
|
51 49 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
52 50 | e.clone_ref(py)
|
53 51 | }));
|
54 52 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
55 53 | e.into()
|
56 54 | })
|
57 55 | }
|
58 56 |
|
59 - | /// Python handler for operation `OperationWithRequiredMembersWithDefaults`.
|
60 - | pub(crate) async fn operation_with_required_members_with_defaults(
|
61 - | input: crate::input::OperationWithRequiredMembersWithDefaultsInput,
|
57 + | /// Python handler for operation `NoInputAndOutput`.
|
58 + | pub(crate) async fn no_input_and_output(
|
59 + | input: crate::input::NoInputAndOutputInput,
|
62 60 | state: ::aws_smithy_legacy_http_server::Extension<
|
63 61 | ::aws_smithy_http_server_python::context::PyContext,
|
64 62 | >,
|
65 63 | handler: ::aws_smithy_http_server_python::PyHandler,
|
66 - | ) -> std::result::Result<
|
67 - | crate::output::OperationWithRequiredMembersWithDefaultsOutput,
|
68 - | crate::error::OperationWithRequiredMembersWithDefaultsError,
|
69 - | > {
|
64 + | ) -> std::result::Result<crate::output::NoInputAndOutputOutput, crate::error::NoInputAndOutputError>
|
65 + | {
|
70 66 | // Async block used to run the handler and catch any Python error.
|
71 67 | let result = if handler.is_coroutine {
|
72 68 | ::tracing::trace!(
|
73 - | name = "operation_with_required_members_with_defaults",
|
69 + | name = "no_input_and_output",
|
74 70 | "executing python handler coroutine"
|
75 71 | );
|
76 72 | let result = ::pyo3::Python::with_gil(|py| {
|
77 73 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
78 74 | let coroutine = if handler.args == 1 {
|
79 75 | pyhandler.call1((input,))?
|
80 76 | } else {
|
81 77 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
82 78 | };
|
83 79 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
84 80 | })?;
|
85 81 | result.await.and_then(|r| {
|
86 - | ::pyo3::Python::with_gil(|py| {
|
87 - | r.extract::<crate::output::OperationWithRequiredMembersWithDefaultsOutput>(py)
|
88 - | })
|
82 + | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::NoInputAndOutputOutput>(py))
|
89 83 | })
|
90 84 | } else {
|
91 85 | ::tracing::trace!(
|
92 - | name = "operation_with_required_members_with_defaults",
|
86 + | name = "no_input_and_output",
|
93 87 | "executing python handler function"
|
94 88 | );
|
95 89 | ::pyo3::Python::with_gil(|py| {
|
96 90 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
97 91 | let output = if handler.args == 1 {
|
98 92 | pyhandler.call1((input,))?
|
99 93 | } else {
|
100 94 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
101 95 | };
|
102 - | output.extract::<crate::output::OperationWithRequiredMembersWithDefaultsOutput>()
|
96 + | output.extract::<crate::output::NoInputAndOutputOutput>()
|
103 97 | })
|
104 98 | };
|
105 99 | // Catch and record a Python traceback.
|
106 100 | result.map_err(|e| {
|
107 101 | let rich_py_err =
|
108 102 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
109 103 | e.clone_ref(py)
|
110 104 | }));
|
111 105 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
112 106 | e.into()
|
113 107 | })
|
114 108 | }
|
115 109 |
|
116 - | /// Python handler for operation `OperationWithNestedStructure`.
|
117 - | pub(crate) async fn operation_with_nested_structure(
|
118 - | input: crate::input::OperationWithNestedStructureInput,
|
110 + | /// Python handler for operation `EmptyInputAndEmptyOutput`.
|
111 + | pub(crate) async fn empty_input_and_empty_output(
|
112 + | input: crate::input::EmptyInputAndEmptyOutputInput,
|
119 113 | state: ::aws_smithy_legacy_http_server::Extension<
|
120 114 | ::aws_smithy_http_server_python::context::PyContext,
|
121 115 | >,
|
122 116 | handler: ::aws_smithy_http_server_python::PyHandler,
|
123 117 | ) -> std::result::Result<
|
124 - | crate::output::OperationWithNestedStructureOutput,
|
125 - | crate::error::OperationWithNestedStructureError,
|
118 + | crate::output::EmptyInputAndEmptyOutputOutput,
|
119 + | crate::error::EmptyInputAndEmptyOutputError,
|
126 120 | > {
|
127 121 | // Async block used to run the handler and catch any Python error.
|
128 122 | let result = if handler.is_coroutine {
|
129 123 | ::tracing::trace!(
|
130 - | name = "operation_with_nested_structure",
|
124 + | name = "empty_input_and_empty_output",
|
131 125 | "executing python handler coroutine"
|
132 126 | );
|
133 127 | let result = ::pyo3::Python::with_gil(|py| {
|
134 128 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
135 129 | let coroutine = if handler.args == 1 {
|
136 130 | pyhandler.call1((input,))?
|
137 131 | } else {
|
138 132 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
139 133 | };
|
140 134 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
141 135 | })?;
|
142 136 | result.await.and_then(|r| {
|
143 137 | ::pyo3::Python::with_gil(|py| {
|
144 - | r.extract::<crate::output::OperationWithNestedStructureOutput>(py)
|
138 + | r.extract::<crate::output::EmptyInputAndEmptyOutputOutput>(py)
|
145 139 | })
|
146 140 | })
|
147 141 | } else {
|
148 142 | ::tracing::trace!(
|
149 - | name = "operation_with_nested_structure",
|
143 + | name = "empty_input_and_empty_output",
|
150 144 | "executing python handler function"
|
151 145 | );
|
152 146 | ::pyo3::Python::with_gil(|py| {
|
153 147 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
154 148 | let output = if handler.args == 1 {
|
155 149 | pyhandler.call1((input,))?
|
156 150 | } else {
|
157 151 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
158 152 | };
|
159 - | output.extract::<crate::output::OperationWithNestedStructureOutput>()
|
153 + | output.extract::<crate::output::EmptyInputAndEmptyOutputOutput>()
|
160 154 | })
|
161 155 | };
|
162 156 | // Catch and record a Python traceback.
|
163 157 | result.map_err(|e| {
|
164 158 | let rich_py_err =
|
165 159 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
166 160 | e.clone_ref(py)
|
167 161 | }));
|
168 162 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
169 163 | e.into()
|
170 164 | })
|
171 165 | }
|
172 166 |
|
173 - | /// Python handler for operation `OperationWithRequiredMembers`.
|
174 - | pub(crate) async fn operation_with_required_members(
|
175 - | input: crate::input::OperationWithRequiredMembersInput,
|
167 + | /// Python handler for operation `SimpleScalarProperties`.
|
168 + | pub(crate) async fn simple_scalar_properties(
|
169 + | input: crate::input::SimpleScalarPropertiesInput,
|
176 170 | state: ::aws_smithy_legacy_http_server::Extension<
|
177 171 | ::aws_smithy_http_server_python::context::PyContext,
|
178 172 | >,
|
179 173 | handler: ::aws_smithy_http_server_python::PyHandler,
|
180 174 | ) -> std::result::Result<
|
181 - | crate::output::OperationWithRequiredMembersOutput,
|
182 - | crate::error::OperationWithRequiredMembersError,
|
175 + | crate::output::SimpleScalarPropertiesOutput,
|
176 + | crate::error::SimpleScalarPropertiesError,
|
183 177 | > {
|
184 178 | // Async block used to run the handler and catch any Python error.
|
185 179 | let result = if handler.is_coroutine {
|
186 180 | ::tracing::trace!(
|
187 - | name = "operation_with_required_members",
|
181 + | name = "simple_scalar_properties",
|
188 182 | "executing python handler coroutine"
|
189 183 | );
|
190 184 | let result = ::pyo3::Python::with_gil(|py| {
|
191 185 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
192 186 | let coroutine = if handler.args == 1 {
|
193 187 | pyhandler.call1((input,))?
|
194 188 | } else {
|
195 189 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
196 190 | };
|
197 191 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
198 192 | })?;
|
199 193 | result.await.and_then(|r| {
|
200 194 | ::pyo3::Python::with_gil(|py| {
|
201 - | r.extract::<crate::output::OperationWithRequiredMembersOutput>(py)
|
195 + | r.extract::<crate::output::SimpleScalarPropertiesOutput>(py)
|
202 196 | })
|
203 197 | })
|
204 198 | } else {
|
205 199 | ::tracing::trace!(
|
206 - | name = "operation_with_required_members",
|
200 + | name = "simple_scalar_properties",
|
207 201 | "executing python handler function"
|
208 202 | );
|
209 203 | ::pyo3::Python::with_gil(|py| {
|
210 204 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
211 205 | let output = if handler.args == 1 {
|
212 206 | pyhandler.call1((input,))?
|
213 207 | } else {
|
214 208 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
215 209 | };
|
216 - | output.extract::<crate::output::OperationWithRequiredMembersOutput>()
|
210 + | output.extract::<crate::output::SimpleScalarPropertiesOutput>()
|
217 211 | })
|
218 212 | };
|
219 213 | // Catch and record a Python traceback.
|
220 214 | result.map_err(|e| {
|
221 215 | let rich_py_err =
|
222 216 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
223 217 | e.clone_ref(py)
|
224 218 | }));
|
225 219 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
226 220 | e.into()
|
227 221 | })
|
228 222 | }
|
229 223 |
|
230 - | /// Python handler for operation `OperationWithDefaults`.
|
231 - | pub(crate) async fn operation_with_defaults(
|
232 - | input: crate::input::OperationWithDefaultsInput,
|
224 + | /// Python handler for operation `GreetingWithErrors`.
|
225 + | pub(crate) async fn greeting_with_errors(
|
226 + | input: crate::input::GreetingWithErrorsInput,
|
233 227 | state: ::aws_smithy_legacy_http_server::Extension<
|
234 228 | ::aws_smithy_http_server_python::context::PyContext,
|
235 229 | >,
|
236 230 | handler: ::aws_smithy_http_server_python::PyHandler,
|
237 231 | ) -> std::result::Result<
|
238 - | crate::output::OperationWithDefaultsOutput,
|
239 - | crate::error::OperationWithDefaultsError,
|
232 + | crate::output::GreetingWithErrorsOutput,
|
233 + | crate::error::GreetingWithErrorsError,
|
240 234 | > {
|
241 235 | // Async block used to run the handler and catch any Python error.
|
242 236 | let result = if handler.is_coroutine {
|
243 237 | ::tracing::trace!(
|
244 - | name = "operation_with_defaults",
|
238 + | name = "greeting_with_errors",
|
245 239 | "executing python handler coroutine"
|
246 240 | );
|
247 241 | let result = ::pyo3::Python::with_gil(|py| {
|
248 242 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
249 243 | let coroutine = if handler.args == 1 {
|
250 244 | pyhandler.call1((input,))?
|
251 245 | } else {
|
252 246 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
253 247 | };
|
254 248 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
255 249 | })?;
|
256 250 | result.await.and_then(|r| {
|
257 - | ::pyo3::Python::with_gil(|py| {
|
258 - | r.extract::<crate::output::OperationWithDefaultsOutput>(py)
|
259 - | })
|
251 + | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::GreetingWithErrorsOutput>(py))
|
260 252 | })
|
261 253 | } else {
|
262 254 | ::tracing::trace!(
|
263 - | name = "operation_with_defaults",
|
255 + | name = "greeting_with_errors",
|
264 256 | "executing python handler function"
|
265 257 | );
|
266 258 | ::pyo3::Python::with_gil(|py| {
|
267 259 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
268 260 | let output = if handler.args == 1 {
|
269 261 | pyhandler.call1((input,))?
|
270 262 | } else {
|
271 263 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
272 264 | };
|
273 - | output.extract::<crate::output::OperationWithDefaultsOutput>()
|
265 + | output.extract::<crate::output::GreetingWithErrorsOutput>()
|
274 266 | })
|
275 267 | };
|
276 268 | // Catch and record a Python traceback.
|
277 269 | result.map_err(|e| {
|
278 270 | let rich_py_err =
|
279 271 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
280 272 | e.clone_ref(py)
|
281 273 | }));
|
282 274 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
283 275 | e.into()
|
284 276 | })
|
285 277 | }
|
286 278 |
|
287 - | /// Python handler for operation `ContentTypeParameters`.
|
288 - | pub(crate) async fn content_type_parameters(
|
289 - | input: crate::input::ContentTypeParametersInput,
|
279 + | /// Python handler for operation `JsonUnions`.
|
280 + | pub(crate) async fn json_unions(
|
281 + | input: crate::input::JsonUnionsInput,
|
290 282 | state: ::aws_smithy_legacy_http_server::Extension<
|
291 283 | ::aws_smithy_http_server_python::context::PyContext,
|
292 284 | >,
|
293 285 | handler: ::aws_smithy_http_server_python::PyHandler,
|
294 - | ) -> std::result::Result<
|
295 - | crate::output::ContentTypeParametersOutput,
|
296 - | crate::error::ContentTypeParametersError,
|
297 - | > {
|
286 + | ) -> std::result::Result<crate::output::JsonUnionsOutput, crate::error::JsonUnionsError> {
|
298 287 | // Async block used to run the handler and catch any Python error.
|
299 288 | let result = if handler.is_coroutine {
|
300 - | ::tracing::trace!(
|
301 - | name = "content_type_parameters",
|
302 - | "executing python handler coroutine"
|
303 - | );
|
289 + | ::tracing::trace!(name = "json_unions", "executing python handler coroutine");
|
304 290 | let result = ::pyo3::Python::with_gil(|py| {
|
305 291 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
306 292 | let coroutine = if handler.args == 1 {
|
307 293 | pyhandler.call1((input,))?
|
308 294 | } else {
|
309 295 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
310 296 | };
|
311 297 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
312 298 | })?;
|
313 299 | result.await.and_then(|r| {
|
314 - | ::pyo3::Python::with_gil(|py| {
|
315 - | r.extract::<crate::output::ContentTypeParametersOutput>(py)
|
316 - | })
|
300 + | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::JsonUnionsOutput>(py))
|
317 301 | })
|
318 302 | } else {
|
319 - | ::tracing::trace!(
|
320 - | name = "content_type_parameters",
|
321 - | "executing python handler function"
|
322 - | );
|
303 + | ::tracing::trace!(name = "json_unions", "executing python handler function");
|
323 304 | ::pyo3::Python::with_gil(|py| {
|
324 305 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
325 306 | let output = if handler.args == 1 {
|
326 307 | pyhandler.call1((input,))?
|
327 308 | } else {
|
328 309 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
329 310 | };
|
330 - | output.extract::<crate::output::ContentTypeParametersOutput>()
|
311 + | output.extract::<crate::output::JsonUnionsOutput>()
|
331 312 | })
|
332 313 | };
|
333 314 | // Catch and record a Python traceback.
|
334 315 | result.map_err(|e| {
|
335 316 | let rich_py_err =
|
336 317 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
337 318 | e.clone_ref(py)
|
338 319 | }));
|
339 320 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
340 321 | e.into()
|
341 322 | })
|
342 323 | }
|
343 324 |
|
344 - | /// Python handler for operation `PutWithContentEncoding`.
|
345 - | pub(crate) async fn put_with_content_encoding(
|
346 - | input: crate::input::PutWithContentEncodingInput,
|
325 + | /// Python handler for operation `EndpointOperation`.
|
326 + | pub(crate) async fn endpoint_operation(
|
327 + | input: crate::input::EndpointOperationInput,
|
347 328 | state: ::aws_smithy_legacy_http_server::Extension<
|
348 329 | ::aws_smithy_http_server_python::context::PyContext,
|
349 330 | >,
|
350 331 | handler: ::aws_smithy_http_server_python::PyHandler,
|
351 - | ) -> std::result::Result<
|
352 - | crate::output::PutWithContentEncodingOutput,
|
353 - | crate::error::PutWithContentEncodingError,
|
354 - | > {
|
332 + | ) -> std::result::Result<crate::output::EndpointOperationOutput, crate::error::EndpointOperationError>
|
333 + | {
|
355 334 | // Async block used to run the handler and catch any Python error.
|
356 335 | let result = if handler.is_coroutine {
|
357 336 | ::tracing::trace!(
|
358 - | name = "put_with_content_encoding",
|
337 + | name = "endpoint_operation",
|
359 338 | "executing python handler coroutine"
|
360 339 | );
|
361 340 | let result = ::pyo3::Python::with_gil(|py| {
|
362 341 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
363 342 | let coroutine = if handler.args == 1 {
|
364 343 | pyhandler.call1((input,))?
|
365 344 | } else {
|
366 345 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
367 346 | };
|
368 347 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
369 348 | })?;
|
370 349 | result.await.and_then(|r| {
|
371 - | ::pyo3::Python::with_gil(|py| {
|
372 - | r.extract::<crate::output::PutWithContentEncodingOutput>(py)
|
373 - | })
|
350 + | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::EndpointOperationOutput>(py))
|
374 351 | })
|
375 352 | } else {
|
376 353 | ::tracing::trace!(
|
377 - | name = "put_with_content_encoding",
|
354 + | name = "endpoint_operation",
|
378 355 | "executing python handler function"
|
379 356 | );
|
380 357 | ::pyo3::Python::with_gil(|py| {
|
381 358 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
382 359 | let output = if handler.args == 1 {
|
383 360 | pyhandler.call1((input,))?
|
384 361 | } else {
|
385 362 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
386 363 | };
|
387 - | output.extract::<crate::output::PutWithContentEncodingOutput>()
|
364 + | output.extract::<crate::output::EndpointOperationOutput>()
|
388 365 | })
|
389 366 | };
|
390 367 | // Catch and record a Python traceback.
|
391 368 | result.map_err(|e| {
|
392 369 | let rich_py_err =
|
393 370 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
394 371 | e.clone_ref(py)
|
395 372 | }));
|
396 373 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
397 374 | e.into()
|
398 375 | })
|
399 376 | }
|
400 377 |
|
401 - | /// Python handler for operation `HostWithPathOperation`.
|
402 - | pub(crate) async fn host_with_path_operation(
|
403 - | input: crate::input::HostWithPathOperationInput,
|
378 + | /// Python handler for operation `EndpointWithHostLabelOperation`.
|
379 + | pub(crate) async fn endpoint_with_host_label_operation(
|
380 + | input: crate::input::EndpointWithHostLabelOperationInput,
|
404 381 | state: ::aws_smithy_legacy_http_server::Extension<
|
405 382 | ::aws_smithy_http_server_python::context::PyContext,
|
406 383 | >,
|
407 384 | handler: ::aws_smithy_http_server_python::PyHandler,
|
408 385 | ) -> std::result::Result<
|
409 - | crate::output::HostWithPathOperationOutput,
|
410 - | crate::error::HostWithPathOperationError,
|
386 + | crate::output::EndpointWithHostLabelOperationOutput,
|
387 + | crate::error::EndpointWithHostLabelOperationError,
|
411 388 | > {
|
412 389 | // Async block used to run the handler and catch any Python error.
|
413 390 | let result = if handler.is_coroutine {
|
414 391 | ::tracing::trace!(
|
415 - | name = "host_with_path_operation",
|
392 + | name = "endpoint_with_host_label_operation",
|
416 393 | "executing python handler coroutine"
|
417 394 | );
|
418 395 | let result = ::pyo3::Python::with_gil(|py| {
|
419 396 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
420 397 | let coroutine = if handler.args == 1 {
|
421 398 | pyhandler.call1((input,))?
|
422 399 | } else {
|
423 400 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
424 401 | };
|
425 402 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
426 403 | })?;
|
427 404 | result.await.and_then(|r| {
|
428 405 | ::pyo3::Python::with_gil(|py| {
|
429 - | r.extract::<crate::output::HostWithPathOperationOutput>(py)
|
406 + | r.extract::<crate::output::EndpointWithHostLabelOperationOutput>(py)
|
430 407 | })
|
431 408 | })
|
432 409 | } else {
|
433 410 | ::tracing::trace!(
|
434 - | name = "host_with_path_operation",
|
411 + | name = "endpoint_with_host_label_operation",
|
435 412 | "executing python handler function"
|
436 413 | );
|
437 414 | ::pyo3::Python::with_gil(|py| {
|
438 415 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
439 416 | let output = if handler.args == 1 {
|
440 417 | pyhandler.call1((input,))?
|
441 418 | } else {
|
442 419 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
443 420 | };
|
444 - | output.extract::<crate::output::HostWithPathOperationOutput>()
|
421 + | output.extract::<crate::output::EndpointWithHostLabelOperationOutput>()
|
445 422 | })
|
446 423 | };
|
447 424 | // Catch and record a Python traceback.
|
448 425 | result.map_err(|e| {
|
449 426 | let rich_py_err =
|
450 427 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
451 428 | e.clone_ref(py)
|
452 429 | }));
|
453 430 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
454 431 | e.into()
|
455 432 | })
|
456 433 | }
|
457 434 |
|
458 - | /// Python handler for operation `EndpointWithHostLabelOperation`.
|
459 - | pub(crate) async fn endpoint_with_host_label_operation(
|
460 - | input: crate::input::EndpointWithHostLabelOperationInput,
|
435 + | /// Python handler for operation `HostWithPathOperation`.
|
436 + | pub(crate) async fn host_with_path_operation(
|
437 + | input: crate::input::HostWithPathOperationInput,
|
461 438 | state: ::aws_smithy_legacy_http_server::Extension<
|
462 439 | ::aws_smithy_http_server_python::context::PyContext,
|
463 440 | >,
|
464 441 | handler: ::aws_smithy_http_server_python::PyHandler,
|
465 442 | ) -> std::result::Result<
|
466 - | crate::output::EndpointWithHostLabelOperationOutput,
|
467 - | crate::error::EndpointWithHostLabelOperationError,
|
443 + | crate::output::HostWithPathOperationOutput,
|
444 + | crate::error::HostWithPathOperationError,
|
468 445 | > {
|
469 446 | // Async block used to run the handler and catch any Python error.
|
470 447 | let result = if handler.is_coroutine {
|
471 448 | ::tracing::trace!(
|
472 - | name = "endpoint_with_host_label_operation",
|
449 + | name = "host_with_path_operation",
|
473 450 | "executing python handler coroutine"
|
474 451 | );
|
475 452 | let result = ::pyo3::Python::with_gil(|py| {
|
476 453 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
477 454 | let coroutine = if handler.args == 1 {
|
478 455 | pyhandler.call1((input,))?
|
479 456 | } else {
|
480 457 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
481 458 | };
|
482 459 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
483 460 | })?;
|
484 461 | result.await.and_then(|r| {
|
485 462 | ::pyo3::Python::with_gil(|py| {
|
486 - | r.extract::<crate::output::EndpointWithHostLabelOperationOutput>(py)
|
463 + | r.extract::<crate::output::HostWithPathOperationOutput>(py)
|
487 464 | })
|
488 465 | })
|
489 466 | } else {
|
490 467 | ::tracing::trace!(
|
491 - | name = "endpoint_with_host_label_operation",
|
468 + | name = "host_with_path_operation",
|
492 469 | "executing python handler function"
|
493 470 | );
|
494 471 | ::pyo3::Python::with_gil(|py| {
|
495 472 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
496 473 | let output = if handler.args == 1 {
|
497 474 | pyhandler.call1((input,))?
|
498 475 | } else {
|
499 476 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
500 477 | };
|
501 - | output.extract::<crate::output::EndpointWithHostLabelOperationOutput>()
|
478 + | output.extract::<crate::output::HostWithPathOperationOutput>()
|
502 479 | })
|
503 480 | };
|
504 481 | // Catch and record a Python traceback.
|
505 482 | result.map_err(|e| {
|
506 483 | let rich_py_err =
|
507 484 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
508 485 | e.clone_ref(py)
|
509 486 | }));
|
510 487 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
511 488 | e.into()
|
512 489 | })
|
513 490 | }
|
514 491 |
|
515 - | /// Python handler for operation `EndpointOperation`.
|
516 - | pub(crate) async fn endpoint_operation(
|
517 - | input: crate::input::EndpointOperationInput,
|
492 + | /// Python handler for operation `PutWithContentEncoding`.
|
493 + | pub(crate) async fn put_with_content_encoding(
|
494 + | input: crate::input::PutWithContentEncodingInput,
|
518 495 | state: ::aws_smithy_legacy_http_server::Extension<
|
519 496 | ::aws_smithy_http_server_python::context::PyContext,
|
520 497 | >,
|
521 498 | handler: ::aws_smithy_http_server_python::PyHandler,
|
522 - | ) -> std::result::Result<crate::output::EndpointOperationOutput, crate::error::EndpointOperationError>
|
523 - | {
|
499 + | ) -> std::result::Result<
|
500 + | crate::output::PutWithContentEncodingOutput,
|
501 + | crate::error::PutWithContentEncodingError,
|
502 + | > {
|
524 503 | // Async block used to run the handler and catch any Python error.
|
525 504 | let result = if handler.is_coroutine {
|
526 505 | ::tracing::trace!(
|
527 - | name = "endpoint_operation",
|
506 + | name = "put_with_content_encoding",
|
528 507 | "executing python handler coroutine"
|
529 508 | );
|
530 509 | let result = ::pyo3::Python::with_gil(|py| {
|
531 510 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
532 511 | let coroutine = if handler.args == 1 {
|
533 512 | pyhandler.call1((input,))?
|
534 513 | } else {
|
535 514 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
536 515 | };
|
537 516 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
538 517 | })?;
|
539 518 | result.await.and_then(|r| {
|
540 - | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::EndpointOperationOutput>(py))
|
519 + | ::pyo3::Python::with_gil(|py| {
|
520 + | r.extract::<crate::output::PutWithContentEncodingOutput>(py)
|
521 + | })
|
541 522 | })
|
542 523 | } else {
|
543 524 | ::tracing::trace!(
|
544 - | name = "endpoint_operation",
|
525 + | name = "put_with_content_encoding",
|
545 526 | "executing python handler function"
|
546 527 | );
|
547 528 | ::pyo3::Python::with_gil(|py| {
|
548 529 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
549 530 | let output = if handler.args == 1 {
|
550 531 | pyhandler.call1((input,))?
|
551 532 | } else {
|
552 533 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
553 534 | };
|
554 - | output.extract::<crate::output::EndpointOperationOutput>()
|
535 + | output.extract::<crate::output::PutWithContentEncodingOutput>()
|
555 536 | })
|
556 537 | };
|
557 538 | // Catch and record a Python traceback.
|
558 539 | result.map_err(|e| {
|
559 540 | let rich_py_err =
|
560 541 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
561 542 | e.clone_ref(py)
|
562 543 | }));
|
563 544 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
564 545 | e.into()
|
565 546 | })
|
566 547 | }
|
567 548 |
|
568 - | /// Python handler for operation `JsonUnions`.
|
569 - | pub(crate) async fn json_unions(
|
570 - | input: crate::input::JsonUnionsInput,
|
549 + | /// Python handler for operation `ContentTypeParameters`.
|
550 + | pub(crate) async fn content_type_parameters(
|
551 + | input: crate::input::ContentTypeParametersInput,
|
571 552 | state: ::aws_smithy_legacy_http_server::Extension<
|
572 553 | ::aws_smithy_http_server_python::context::PyContext,
|
573 554 | >,
|
574 555 | handler: ::aws_smithy_http_server_python::PyHandler,
|
575 - | ) -> std::result::Result<crate::output::JsonUnionsOutput, crate::error::JsonUnionsError> {
|
556 + | ) -> std::result::Result<
|
557 + | crate::output::ContentTypeParametersOutput,
|
558 + | crate::error::ContentTypeParametersError,
|
559 + | > {
|
576 560 | // Async block used to run the handler and catch any Python error.
|
577 561 | let result = if handler.is_coroutine {
|
578 - | ::tracing::trace!(name = "json_unions", "executing python handler coroutine");
|
562 + | ::tracing::trace!(
|
563 + | name = "content_type_parameters",
|
564 + | "executing python handler coroutine"
|
565 + | );
|
579 566 | let result = ::pyo3::Python::with_gil(|py| {
|
580 567 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
581 568 | let coroutine = if handler.args == 1 {
|
582 569 | pyhandler.call1((input,))?
|
583 570 | } else {
|
584 571 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
585 572 | };
|
586 573 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
587 574 | })?;
|
588 575 | result.await.and_then(|r| {
|
589 - | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::JsonUnionsOutput>(py))
|
576 + | ::pyo3::Python::with_gil(|py| {
|
577 + | r.extract::<crate::output::ContentTypeParametersOutput>(py)
|
578 + | })
|
590 579 | })
|
591 580 | } else {
|
592 - | ::tracing::trace!(name = "json_unions", "executing python handler function");
|
581 + | ::tracing::trace!(
|
582 + | name = "content_type_parameters",
|
583 + | "executing python handler function"
|
584 + | );
|
593 585 | ::pyo3::Python::with_gil(|py| {
|
594 586 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
595 587 | let output = if handler.args == 1 {
|
596 588 | pyhandler.call1((input,))?
|
597 589 | } else {
|
598 590 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
599 591 | };
|
600 - | output.extract::<crate::output::JsonUnionsOutput>()
|
592 + | output.extract::<crate::output::ContentTypeParametersOutput>()
|
601 593 | })
|
602 594 | };
|
603 595 | // Catch and record a Python traceback.
|
604 596 | result.map_err(|e| {
|
605 597 | let rich_py_err =
|
606 598 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
607 599 | e.clone_ref(py)
|
608 600 | }));
|
609 601 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
610 602 | e.into()
|
611 603 | })
|
612 604 | }
|
613 605 |
|
614 - | /// Python handler for operation `GreetingWithErrors`.
|
615 - | pub(crate) async fn greeting_with_errors(
|
616 - | input: crate::input::GreetingWithErrorsInput,
|
606 + | /// Python handler for operation `OperationWithDefaults`.
|
607 + | pub(crate) async fn operation_with_defaults(
|
608 + | input: crate::input::OperationWithDefaultsInput,
|
617 609 | state: ::aws_smithy_legacy_http_server::Extension<
|
618 610 | ::aws_smithy_http_server_python::context::PyContext,
|
619 611 | >,
|
620 612 | handler: ::aws_smithy_http_server_python::PyHandler,
|
621 613 | ) -> std::result::Result<
|
622 - | crate::output::GreetingWithErrorsOutput,
|
623 - | crate::error::GreetingWithErrorsError,
|
614 + | crate::output::OperationWithDefaultsOutput,
|
615 + | crate::error::OperationWithDefaultsError,
|
624 616 | > {
|
625 617 | // Async block used to run the handler and catch any Python error.
|
626 618 | let result = if handler.is_coroutine {
|
627 619 | ::tracing::trace!(
|
628 - | name = "greeting_with_errors",
|
620 + | name = "operation_with_defaults",
|
629 621 | "executing python handler coroutine"
|
630 622 | );
|
631 623 | let result = ::pyo3::Python::with_gil(|py| {
|
632 624 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
633 625 | let coroutine = if handler.args == 1 {
|
634 626 | pyhandler.call1((input,))?
|
635 627 | } else {
|
636 628 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
637 629 | };
|
638 630 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
639 631 | })?;
|
640 632 | result.await.and_then(|r| {
|
641 - | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::GreetingWithErrorsOutput>(py))
|
633 + | ::pyo3::Python::with_gil(|py| {
|
634 + | r.extract::<crate::output::OperationWithDefaultsOutput>(py)
|
635 + | })
|
642 636 | })
|
643 637 | } else {
|
644 638 | ::tracing::trace!(
|
645 - | name = "greeting_with_errors",
|
639 + | name = "operation_with_defaults",
|
646 640 | "executing python handler function"
|
647 641 | );
|
648 642 | ::pyo3::Python::with_gil(|py| {
|
649 643 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
650 644 | let output = if handler.args == 1 {
|
651 645 | pyhandler.call1((input,))?
|
652 646 | } else {
|
653 647 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
654 648 | };
|
655 - | output.extract::<crate::output::GreetingWithErrorsOutput>()
|
649 + | output.extract::<crate::output::OperationWithDefaultsOutput>()
|
656 650 | })
|
657 651 | };
|
658 652 | // Catch and record a Python traceback.
|
659 653 | result.map_err(|e| {
|
660 654 | let rich_py_err =
|
661 655 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
662 656 | e.clone_ref(py)
|
663 657 | }));
|
664 658 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
665 659 | e.into()
|
666 660 | })
|
667 661 | }
|
668 662 |
|
669 - | /// Python handler for operation `SimpleScalarProperties`.
|
670 - | pub(crate) async fn simple_scalar_properties(
|
671 - | input: crate::input::SimpleScalarPropertiesInput,
|
663 + | /// Python handler for operation `OperationWithRequiredMembers`.
|
664 + | pub(crate) async fn operation_with_required_members(
|
665 + | input: crate::input::OperationWithRequiredMembersInput,
|
672 666 | state: ::aws_smithy_legacy_http_server::Extension<
|
673 667 | ::aws_smithy_http_server_python::context::PyContext,
|
674 668 | >,
|
675 669 | handler: ::aws_smithy_http_server_python::PyHandler,
|
676 670 | ) -> std::result::Result<
|
677 - | crate::output::SimpleScalarPropertiesOutput,
|
678 - | crate::error::SimpleScalarPropertiesError,
|
671 + | crate::output::OperationWithRequiredMembersOutput,
|
672 + | crate::error::OperationWithRequiredMembersError,
|
679 673 | > {
|
680 674 | // Async block used to run the handler and catch any Python error.
|
681 675 | let result = if handler.is_coroutine {
|
682 676 | ::tracing::trace!(
|
683 - | name = "simple_scalar_properties",
|
677 + | name = "operation_with_required_members",
|
684 678 | "executing python handler coroutine"
|
685 679 | );
|
686 680 | let result = ::pyo3::Python::with_gil(|py| {
|
687 681 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
688 682 | let coroutine = if handler.args == 1 {
|
689 683 | pyhandler.call1((input,))?
|
690 684 | } else {
|
691 685 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
692 686 | };
|
693 687 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
694 688 | })?;
|
695 689 | result.await.and_then(|r| {
|
696 690 | ::pyo3::Python::with_gil(|py| {
|
697 - | r.extract::<crate::output::SimpleScalarPropertiesOutput>(py)
|
691 + | r.extract::<crate::output::OperationWithRequiredMembersOutput>(py)
|
698 692 | })
|
699 693 | })
|
700 694 | } else {
|
701 695 | ::tracing::trace!(
|
702 - | name = "simple_scalar_properties",
|
696 + | name = "operation_with_required_members",
|
703 697 | "executing python handler function"
|
704 698 | );
|
705 699 | ::pyo3::Python::with_gil(|py| {
|
706 700 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
707 701 | let output = if handler.args == 1 {
|
708 702 | pyhandler.call1((input,))?
|
709 703 | } else {
|
710 704 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
711 705 | };
|
712 - | output.extract::<crate::output::SimpleScalarPropertiesOutput>()
|
706 + | output.extract::<crate::output::OperationWithRequiredMembersOutput>()
|
713 707 | })
|
714 708 | };
|
715 709 | // Catch and record a Python traceback.
|
716 710 | result.map_err(|e| {
|
717 711 | let rich_py_err =
|
718 712 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
719 713 | e.clone_ref(py)
|
720 714 | }));
|
721 715 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
722 716 | e.into()
|
723 717 | })
|
724 718 | }
|
725 719 |
|
726 - | /// Python handler for operation `EmptyInputAndEmptyOutput`.
|
727 - | pub(crate) async fn empty_input_and_empty_output(
|
728 - | input: crate::input::EmptyInputAndEmptyOutputInput,
|
720 + | /// Python handler for operation `OperationWithNestedStructure`.
|
721 + | pub(crate) async fn operation_with_nested_structure(
|
722 + | input: crate::input::OperationWithNestedStructureInput,
|
729 723 | state: ::aws_smithy_legacy_http_server::Extension<
|
730 724 | ::aws_smithy_http_server_python::context::PyContext,
|
731 725 | >,
|
732 726 | handler: ::aws_smithy_http_server_python::PyHandler,
|
733 727 | ) -> std::result::Result<
|
734 - | crate::output::EmptyInputAndEmptyOutputOutput,
|
735 - | crate::error::EmptyInputAndEmptyOutputError,
|
728 + | crate::output::OperationWithNestedStructureOutput,
|
729 + | crate::error::OperationWithNestedStructureError,
|
736 730 | > {
|
737 731 | // Async block used to run the handler and catch any Python error.
|
738 732 | let result = if handler.is_coroutine {
|
739 733 | ::tracing::trace!(
|
740 - | name = "empty_input_and_empty_output",
|
734 + | name = "operation_with_nested_structure",
|
741 735 | "executing python handler coroutine"
|
742 736 | );
|
743 737 | let result = ::pyo3::Python::with_gil(|py| {
|
744 738 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
745 739 | let coroutine = if handler.args == 1 {
|
746 740 | pyhandler.call1((input,))?
|
747 741 | } else {
|
748 742 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
749 743 | };
|
750 744 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
751 745 | })?;
|
752 746 | result.await.and_then(|r| {
|
753 747 | ::pyo3::Python::with_gil(|py| {
|
754 - | r.extract::<crate::output::EmptyInputAndEmptyOutputOutput>(py)
|
748 + | r.extract::<crate::output::OperationWithNestedStructureOutput>(py)
|
755 749 | })
|
756 750 | })
|
757 751 | } else {
|
758 752 | ::tracing::trace!(
|
759 - | name = "empty_input_and_empty_output",
|
753 + | name = "operation_with_nested_structure",
|
760 754 | "executing python handler function"
|
761 755 | );
|
762 756 | ::pyo3::Python::with_gil(|py| {
|
763 757 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
764 758 | let output = if handler.args == 1 {
|
765 759 | pyhandler.call1((input,))?
|
766 760 | } else {
|
767 761 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
768 762 | };
|
769 - | output.extract::<crate::output::EmptyInputAndEmptyOutputOutput>()
|
763 + | output.extract::<crate::output::OperationWithNestedStructureOutput>()
|
770 764 | })
|
771 765 | };
|
772 766 | // Catch and record a Python traceback.
|
773 767 | result.map_err(|e| {
|
774 768 | let rich_py_err =
|
775 769 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
776 770 | e.clone_ref(py)
|
777 771 | }));
|
778 772 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
779 773 | e.into()
|
780 774 | })
|
781 775 | }
|
782 776 |
|
783 - | /// Python handler for operation `NoInputAndOutput`.
|
784 - | pub(crate) async fn no_input_and_output(
|
785 - | input: crate::input::NoInputAndOutputInput,
|
777 + | /// Python handler for operation `OperationWithRequiredMembersWithDefaults`.
|
778 + | pub(crate) async fn operation_with_required_members_with_defaults(
|
779 + | input: crate::input::OperationWithRequiredMembersWithDefaultsInput,
|
786 780 | state: ::aws_smithy_legacy_http_server::Extension<
|
787 781 | ::aws_smithy_http_server_python::context::PyContext,
|
788 782 | >,
|
789 783 | handler: ::aws_smithy_http_server_python::PyHandler,
|
790 - | ) -> std::result::Result<crate::output::NoInputAndOutputOutput, crate::error::NoInputAndOutputError>
|
791 - | {
|
784 + | ) -> std::result::Result<
|
785 + | crate::output::OperationWithRequiredMembersWithDefaultsOutput,
|
786 + | crate::error::OperationWithRequiredMembersWithDefaultsError,
|
787 + | > {
|
792 788 | // Async block used to run the handler and catch any Python error.
|
793 789 | let result = if handler.is_coroutine {
|
794 790 | ::tracing::trace!(
|
795 - | name = "no_input_and_output",
|
791 + | name = "operation_with_required_members_with_defaults",
|
796 792 | "executing python handler coroutine"
|
797 793 | );
|
798 794 | let result = ::pyo3::Python::with_gil(|py| {
|
799 795 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
800 796 | let coroutine = if handler.args == 1 {
|
801 797 | pyhandler.call1((input,))?
|
802 798 | } else {
|
803 799 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
804 800 | };
|
805 801 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
806 802 | })?;
|
807 803 | result.await.and_then(|r| {
|
808 - | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::NoInputAndOutputOutput>(py))
|
804 + | ::pyo3::Python::with_gil(|py| {
|
805 + | r.extract::<crate::output::OperationWithRequiredMembersWithDefaultsOutput>(py)
|
806 + | })
|
809 807 | })
|
810 808 | } else {
|
811 809 | ::tracing::trace!(
|
812 - | name = "no_input_and_output",
|
810 + | name = "operation_with_required_members_with_defaults",
|
813 811 | "executing python handler function"
|
814 812 | );
|
815 813 | ::pyo3::Python::with_gil(|py| {
|
816 814 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
817 815 | let output = if handler.args == 1 {
|
818 816 | pyhandler.call1((input,))?
|
819 817 | } else {
|
820 818 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
821 819 | };
|
822 - | output.extract::<crate::output::NoInputAndOutputOutput>()
|
820 + | output.extract::<crate::output::OperationWithRequiredMembersWithDefaultsOutput>()
|
823 821 | })
|
824 822 | };
|
825 823 | // Catch and record a Python traceback.
|
826 824 | result.map_err(|e| {
|
827 825 | let rich_py_err =
|
828 826 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
829 827 | e.clone_ref(py)
|
830 828 | }));
|
831 829 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
832 830 | e.into()
|
833 831 | })
|
834 832 | }
|
835 833 |
|
836 - | /// Python handler for operation `NoInputAndNoOutput`.
|
837 - | pub(crate) async fn no_input_and_no_output(
|
838 - | input: crate::input::NoInputAndNoOutputInput,
|
834 + | /// Python handler for operation `QueryIncompatibleOperation`.
|
835 + | pub(crate) async fn query_incompatible_operation(
|
836 + | input: crate::input::QueryIncompatibleOperationInput,
|
839 837 | state: ::aws_smithy_legacy_http_server::Extension<
|
840 838 | ::aws_smithy_http_server_python::context::PyContext,
|
841 839 | >,
|
842 840 | handler: ::aws_smithy_http_server_python::PyHandler,
|
843 841 | ) -> std::result::Result<
|
844 - | crate::output::NoInputAndNoOutputOutput,
|
845 - | crate::error::NoInputAndNoOutputError,
|
842 + | crate::output::QueryIncompatibleOperationOutput,
|
843 + | crate::error::QueryIncompatibleOperationError,
|
846 844 | > {
|
847 845 | // Async block used to run the handler and catch any Python error.
|
848 846 | let result = if handler.is_coroutine {
|
849 847 | ::tracing::trace!(
|
850 - | name = "no_input_and_no_output",
|
848 + | name = "query_incompatible_operation",
|
851 849 | "executing python handler coroutine"
|
852 850 | );
|
853 851 | let result = ::pyo3::Python::with_gil(|py| {
|
854 852 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
855 853 | let coroutine = if handler.args == 1 {
|
856 854 | pyhandler.call1((input,))?
|
857 855 | } else {
|
858 856 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
859 857 | };
|
860 858 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
861 859 | })?;
|
862 860 | result.await.and_then(|r| {
|
863 - | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::NoInputAndNoOutputOutput>(py))
|
861 + | ::pyo3::Python::with_gil(|py| {
|
862 + | r.extract::<crate::output::QueryIncompatibleOperationOutput>(py)
|
863 + | })
|
864 864 | })
|
865 865 | } else {
|
866 866 | ::tracing::trace!(
|
867 - | name = "no_input_and_no_output",
|
867 + | name = "query_incompatible_operation",
|
868 868 | "executing python handler function"
|
869 869 | );
|
870 870 | ::pyo3::Python::with_gil(|py| {
|
871 871 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
872 872 | let output = if handler.args == 1 {
|
873 873 | pyhandler.call1((input,))?
|
874 874 | } else {
|
875 875 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
876 876 | };
|
877 - | output.extract::<crate::output::NoInputAndNoOutputOutput>()
|
877 + | output.extract::<crate::output::QueryIncompatibleOperationOutput>()
|
878 878 | })
|
879 879 | };
|
880 880 | // Catch and record a Python traceback.
|
881 881 | result.map_err(|e| {
|
882 882 | let rich_py_err =
|
883 883 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
884 884 | e.clone_ref(py)
|
885 885 | }));
|
886 886 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
887 887 | e.into()
|