1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
2 3 | /// Python handler for operation `OperationWithNestedStructure`.
|
3 4 | pub(crate) async fn operation_with_nested_structure(
|
4 5 | input: crate::input::OperationWithNestedStructureInput,
|
5 6 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
6 7 | handler: ::aws_smithy_http_server_python::PyHandler,
|
7 8 | ) -> std::result::Result<
|
8 9 | crate::output::OperationWithNestedStructureOutput,
|
9 10 | crate::error::OperationWithNestedStructureError,
|
10 11 | > {
|
11 12 | // Async block used to run the handler and catch any Python error.
|
12 13 | let result = if handler.is_coroutine {
|
13 14 | ::tracing::trace!(
|
14 15 | name = "operation_with_nested_structure",
|
15 16 | "executing python handler coroutine"
|
16 17 | );
|
17 18 | let result = ::pyo3::Python::with_gil(|py| {
|
18 19 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
19 20 | let coroutine = if handler.args == 1 {
|
20 21 | pyhandler.call1((input,))?
|
21 22 | } else {
|
22 23 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
23 24 | };
|
24 25 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
25 26 | })?;
|
26 27 | result.await.and_then(|r| {
|
27 28 | ::pyo3::Python::with_gil(|py| {
|
28 29 | r.extract::<crate::output::OperationWithNestedStructureOutput>(py)
|
29 30 | })
|
30 31 | })
|
31 32 | } else {
|
32 33 | ::tracing::trace!(
|
33 34 | name = "operation_with_nested_structure",
|
34 35 | "executing python handler function"
|
35 36 | );
|
36 37 | ::pyo3::Python::with_gil(|py| {
|
37 38 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
38 39 | let output = if handler.args == 1 {
|
39 40 | pyhandler.call1((input,))?
|
40 41 | } else {
|
41 42 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
42 43 | };
|
43 44 | output.extract::<crate::output::OperationWithNestedStructureOutput>()
|
44 45 | })
|
45 46 | };
|
46 47 | // Catch and record a Python traceback.
|
47 48 | result.map_err(|e| {
|
48 49 | let rich_py_err =
|
49 50 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
50 51 | e.clone_ref(py)
|
51 52 | }));
|
52 53 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
53 54 | e.into()
|
54 55 | })
|
55 56 | }
|
56 57 |
|
58 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
57 59 | /// Python handler for operation `OperationWithDefaults`.
|
58 60 | pub(crate) async fn operation_with_defaults(
|
59 61 | input: crate::input::OperationWithDefaultsInput,
|
60 62 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
61 63 | handler: ::aws_smithy_http_server_python::PyHandler,
|
62 64 | ) -> std::result::Result<
|
63 65 | crate::output::OperationWithDefaultsOutput,
|
64 66 | crate::error::OperationWithDefaultsError,
|
65 67 | > {
|
66 68 | // Async block used to run the handler and catch any Python error.
|
67 69 | let result = if handler.is_coroutine {
|
68 70 | ::tracing::trace!(
|
69 71 | name = "operation_with_defaults",
|
70 72 | "executing python handler coroutine"
|
71 73 | );
|
72 74 | let result = ::pyo3::Python::with_gil(|py| {
|
73 75 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
74 76 | let coroutine = if handler.args == 1 {
|
75 77 | pyhandler.call1((input,))?
|
76 78 | } else {
|
77 79 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
78 80 | };
|
79 81 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
80 82 | })?;
|
81 83 | result.await.and_then(|r| {
|
82 84 | ::pyo3::Python::with_gil(|py| {
|
83 85 | r.extract::<crate::output::OperationWithDefaultsOutput>(py)
|
84 86 | })
|
85 87 | })
|
86 88 | } else {
|
87 89 | ::tracing::trace!(
|
88 90 | name = "operation_with_defaults",
|
89 91 | "executing python handler function"
|
90 92 | );
|
91 93 | ::pyo3::Python::with_gil(|py| {
|
92 94 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
93 95 | let output = if handler.args == 1 {
|
94 96 | pyhandler.call1((input,))?
|
95 97 | } else {
|
96 98 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
97 99 | };
|
98 100 | output.extract::<crate::output::OperationWithDefaultsOutput>()
|
99 101 | })
|
100 102 | };
|
101 103 | // Catch and record a Python traceback.
|
102 104 | result.map_err(|e| {
|
103 105 | let rich_py_err =
|
104 106 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
105 107 | e.clone_ref(py)
|
106 108 | }));
|
107 109 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
108 110 | e.into()
|
109 111 | })
|
110 112 | }
|
111 113 |
|
114 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
112 115 | /// Python handler for operation `ContentTypeParameters`.
|
113 116 | pub(crate) async fn content_type_parameters(
|
114 117 | input: crate::input::ContentTypeParametersInput,
|
115 118 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
116 119 | handler: ::aws_smithy_http_server_python::PyHandler,
|
117 120 | ) -> std::result::Result<
|
118 121 | crate::output::ContentTypeParametersOutput,
|
119 122 | crate::error::ContentTypeParametersError,
|
120 123 | > {
|
121 124 | // Async block used to run the handler and catch any Python error.
|
122 125 | let result = if handler.is_coroutine {
|
123 126 | ::tracing::trace!(
|
124 127 | name = "content_type_parameters",
|
125 128 | "executing python handler coroutine"
|
126 129 | );
|
127 130 | let result = ::pyo3::Python::with_gil(|py| {
|
128 131 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
129 132 | let coroutine = if handler.args == 1 {
|
130 133 | pyhandler.call1((input,))?
|
131 134 | } else {
|
132 135 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
133 136 | };
|
134 137 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
135 138 | })?;
|
136 139 | result.await.and_then(|r| {
|
137 140 | ::pyo3::Python::with_gil(|py| {
|
138 141 | r.extract::<crate::output::ContentTypeParametersOutput>(py)
|
139 142 | })
|
140 143 | })
|
141 144 | } else {
|
142 145 | ::tracing::trace!(
|
143 146 | name = "content_type_parameters",
|
144 147 | "executing python handler function"
|
145 148 | );
|
146 149 | ::pyo3::Python::with_gil(|py| {
|
147 150 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
148 151 | let output = if handler.args == 1 {
|
149 152 | pyhandler.call1((input,))?
|
150 153 | } else {
|
151 154 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
152 155 | };
|
153 156 | output.extract::<crate::output::ContentTypeParametersOutput>()
|
154 157 | })
|
155 158 | };
|
156 159 | // Catch and record a Python traceback.
|
157 160 | result.map_err(|e| {
|
158 161 | let rich_py_err =
|
159 162 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
160 163 | e.clone_ref(py)
|
161 164 | }));
|
162 165 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
163 166 | e.into()
|
164 167 | })
|
165 168 | }
|
166 169 |
|
170 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
167 171 | /// Python handler for operation `PutWithContentEncoding`.
|
168 172 | pub(crate) async fn put_with_content_encoding(
|
169 173 | input: crate::input::PutWithContentEncodingInput,
|
170 174 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
171 175 | handler: ::aws_smithy_http_server_python::PyHandler,
|
172 176 | ) -> std::result::Result<
|
173 177 | crate::output::PutWithContentEncodingOutput,
|
174 178 | crate::error::PutWithContentEncodingError,
|
175 179 | > {
|
176 180 | // Async block used to run the handler and catch any Python error.
|
177 181 | let result = if handler.is_coroutine {
|
178 182 | ::tracing::trace!(
|
179 183 | name = "put_with_content_encoding",
|
180 184 | "executing python handler coroutine"
|
181 185 | );
|
182 186 | let result = ::pyo3::Python::with_gil(|py| {
|
183 187 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
184 188 | let coroutine = if handler.args == 1 {
|
185 189 | pyhandler.call1((input,))?
|
186 190 | } else {
|
187 191 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
188 192 | };
|
189 193 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
190 194 | })?;
|
191 195 | result.await.and_then(|r| {
|
192 196 | ::pyo3::Python::with_gil(|py| {
|
193 197 | r.extract::<crate::output::PutWithContentEncodingOutput>(py)
|
194 198 | })
|
195 199 | })
|
196 200 | } else {
|
197 201 | ::tracing::trace!(
|
198 202 | name = "put_with_content_encoding",
|
199 203 | "executing python handler function"
|
200 204 | );
|
201 205 | ::pyo3::Python::with_gil(|py| {
|
202 206 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
203 207 | let output = if handler.args == 1 {
|
204 208 | pyhandler.call1((input,))?
|
205 209 | } else {
|
206 210 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
207 211 | };
|
208 212 | output.extract::<crate::output::PutWithContentEncodingOutput>()
|
209 213 | })
|
210 214 | };
|
211 215 | // Catch and record a Python traceback.
|
212 216 | result.map_err(|e| {
|
213 217 | let rich_py_err =
|
214 218 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
215 219 | e.clone_ref(py)
|
216 220 | }));
|
217 221 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
218 222 | e.into()
|
219 223 | })
|
220 224 | }
|
221 225 |
|
226 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
222 227 | /// Python handler for operation `FractionalSeconds`.
|
223 228 | pub(crate) async fn fractional_seconds(
|
224 229 | input: crate::input::FractionalSecondsInput,
|
225 230 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
226 231 | handler: ::aws_smithy_http_server_python::PyHandler,
|
227 232 | ) -> std::result::Result<crate::output::FractionalSecondsOutput, crate::error::FractionalSecondsError>
|
228 233 | {
|
229 234 | // Async block used to run the handler and catch any Python error.
|
230 235 | let result = if handler.is_coroutine {
|
231 236 | ::tracing::trace!(
|
232 237 | name = "fractional_seconds",
|
233 238 | "executing python handler coroutine"
|
234 239 | );
|
235 240 | let result = ::pyo3::Python::with_gil(|py| {
|
236 241 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
237 242 | let coroutine = if handler.args == 1 {
|
238 243 | pyhandler.call1((input,))?
|
239 244 | } else {
|
240 245 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
241 246 | };
|
242 247 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
243 248 | })?;
|
244 249 | result.await.and_then(|r| {
|
245 250 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::FractionalSecondsOutput>(py))
|
246 251 | })
|
247 252 | } else {
|
248 253 | ::tracing::trace!(
|
249 254 | name = "fractional_seconds",
|
250 255 | "executing python handler function"
|
251 256 | );
|
252 257 | ::pyo3::Python::with_gil(|py| {
|
253 258 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
254 259 | let output = if handler.args == 1 {
|
255 260 | pyhandler.call1((input,))?
|
256 261 | } else {
|
257 262 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
258 263 | };
|
259 264 | output.extract::<crate::output::FractionalSecondsOutput>()
|
260 265 | })
|
261 266 | };
|
262 267 | // Catch and record a Python traceback.
|
263 268 | result.map_err(|e| {
|
264 269 | let rich_py_err =
|
265 270 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
266 271 | e.clone_ref(py)
|
267 272 | }));
|
268 273 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
269 274 | e.into()
|
270 275 | })
|
271 276 | }
|
272 277 |
|
278 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
273 279 | /// Python handler for operation `DatetimeOffsets`.
|
274 280 | pub(crate) async fn datetime_offsets(
|
275 281 | input: crate::input::DatetimeOffsetsInput,
|
276 282 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
277 283 | handler: ::aws_smithy_http_server_python::PyHandler,
|
278 284 | ) -> std::result::Result<crate::output::DatetimeOffsetsOutput, crate::error::DatetimeOffsetsError> {
|
279 285 | // Async block used to run the handler and catch any Python error.
|
280 286 | let result = if handler.is_coroutine {
|
281 287 | ::tracing::trace!(
|
282 288 | name = "datetime_offsets",
|
283 289 | "executing python handler coroutine"
|
284 290 | );
|
285 291 | let result = ::pyo3::Python::with_gil(|py| {
|
286 292 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
287 293 | let coroutine = if handler.args == 1 {
|
288 294 | pyhandler.call1((input,))?
|
289 295 | } else {
|
290 296 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
291 297 | };
|
292 298 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
293 299 | })?;
|
294 300 | result.await.and_then(|r| {
|
295 301 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::DatetimeOffsetsOutput>(py))
|
296 302 | })
|
297 303 | } else {
|
298 304 | ::tracing::trace!(
|
299 305 | name = "datetime_offsets",
|
300 306 | "executing python handler function"
|
301 307 | );
|
302 308 | ::pyo3::Python::with_gil(|py| {
|
303 309 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
304 310 | let output = if handler.args == 1 {
|
305 311 | pyhandler.call1((input,))?
|
306 312 | } else {
|
307 313 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
308 314 | };
|
309 315 | output.extract::<crate::output::DatetimeOffsetsOutput>()
|
310 316 | })
|
311 317 | };
|
312 318 | // Catch and record a Python traceback.
|
313 319 | result.map_err(|e| {
|
314 320 | let rich_py_err =
|
315 321 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
316 322 | e.clone_ref(py)
|
317 323 | }));
|
318 324 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
319 325 | e.into()
|
320 326 | })
|
321 327 | }
|
322 328 |
|
329 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
323 330 | /// Python handler for operation `TestPostNoInputNoPayload`.
|
324 331 | pub(crate) async fn test_post_no_input_no_payload(
|
325 332 | input: crate::input::TestPostNoInputNoPayloadInput,
|
326 333 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
327 334 | handler: ::aws_smithy_http_server_python::PyHandler,
|
328 335 | ) -> std::result::Result<
|
329 336 | crate::output::TestPostNoInputNoPayloadOutput,
|
330 337 | crate::error::TestPostNoInputNoPayloadError,
|
331 338 | > {
|
332 339 | // Async block used to run the handler and catch any Python error.
|
333 340 | let result = if handler.is_coroutine {
|
334 341 | ::tracing::trace!(
|
335 342 | name = "test_post_no_input_no_payload",
|
336 343 | "executing python handler coroutine"
|
337 344 | );
|
338 345 | let result = ::pyo3::Python::with_gil(|py| {
|
339 346 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
340 347 | let coroutine = if handler.args == 1 {
|
341 348 | pyhandler.call1((input,))?
|
342 349 | } else {
|
343 350 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
344 351 | };
|
345 352 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
346 353 | })?;
|
347 354 | result.await.and_then(|r| {
|
348 355 | ::pyo3::Python::with_gil(|py| {
|
349 356 | r.extract::<crate::output::TestPostNoInputNoPayloadOutput>(py)
|
350 357 | })
|
351 358 | })
|
352 359 | } else {
|
353 360 | ::tracing::trace!(
|
354 361 | name = "test_post_no_input_no_payload",
|
355 362 | "executing python handler function"
|
356 363 | );
|
357 364 | ::pyo3::Python::with_gil(|py| {
|
358 365 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
359 366 | let output = if handler.args == 1 {
|
360 367 | pyhandler.call1((input,))?
|
361 368 | } else {
|
362 369 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
363 370 | };
|
364 371 | output.extract::<crate::output::TestPostNoInputNoPayloadOutput>()
|
365 372 | })
|
366 373 | };
|
367 374 | // Catch and record a Python traceback.
|
368 375 | result.map_err(|e| {
|
369 376 | let rich_py_err =
|
370 377 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
371 378 | e.clone_ref(py)
|
372 379 | }));
|
373 380 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
374 381 | e.into()
|
375 382 | })
|
376 383 | }
|
377 384 |
|
385 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
378 386 | /// Python handler for operation `TestGetNoInputNoPayload`.
|
379 387 | pub(crate) async fn test_get_no_input_no_payload(
|
380 388 | input: crate::input::TestGetNoInputNoPayloadInput,
|
381 389 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
382 390 | handler: ::aws_smithy_http_server_python::PyHandler,
|
383 391 | ) -> std::result::Result<
|
384 392 | crate::output::TestGetNoInputNoPayloadOutput,
|
385 393 | crate::error::TestGetNoInputNoPayloadError,
|
386 394 | > {
|
387 395 | // Async block used to run the handler and catch any Python error.
|
388 396 | let result = if handler.is_coroutine {
|
389 397 | ::tracing::trace!(
|
390 398 | name = "test_get_no_input_no_payload",
|
391 399 | "executing python handler coroutine"
|
392 400 | );
|
393 401 | let result = ::pyo3::Python::with_gil(|py| {
|
394 402 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
395 403 | let coroutine = if handler.args == 1 {
|
396 404 | pyhandler.call1((input,))?
|
397 405 | } else {
|
398 406 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
399 407 | };
|
400 408 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
401 409 | })?;
|
402 410 | result.await.and_then(|r| {
|
403 411 | ::pyo3::Python::with_gil(|py| {
|
404 412 | r.extract::<crate::output::TestGetNoInputNoPayloadOutput>(py)
|
405 413 | })
|
406 414 | })
|
407 415 | } else {
|
408 416 | ::tracing::trace!(
|
409 417 | name = "test_get_no_input_no_payload",
|
410 418 | "executing python handler function"
|
411 419 | );
|
412 420 | ::pyo3::Python::with_gil(|py| {
|
413 421 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
414 422 | let output = if handler.args == 1 {
|
415 423 | pyhandler.call1((input,))?
|
416 424 | } else {
|
417 425 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
418 426 | };
|
419 427 | output.extract::<crate::output::TestGetNoInputNoPayloadOutput>()
|
420 428 | })
|
421 429 | };
|
422 430 | // Catch and record a Python traceback.
|
423 431 | result.map_err(|e| {
|
424 432 | let rich_py_err =
|
425 433 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
426 434 | e.clone_ref(py)
|
427 435 | }));
|
428 436 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
429 437 | e.into()
|
430 438 | })
|
431 439 | }
|
432 440 |
|
441 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
433 442 | /// Python handler for operation `TestPostNoPayload`.
|
434 443 | pub(crate) async fn test_post_no_payload(
|
435 444 | input: crate::input::TestPostNoPayloadInput,
|
436 445 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
437 446 | handler: ::aws_smithy_http_server_python::PyHandler,
|
438 447 | ) -> std::result::Result<crate::output::TestPostNoPayloadOutput, crate::error::TestPostNoPayloadError>
|
439 448 | {
|
440 449 | // Async block used to run the handler and catch any Python error.
|
441 450 | let result = if handler.is_coroutine {
|
442 451 | ::tracing::trace!(
|
443 452 | name = "test_post_no_payload",
|
444 453 | "executing python handler coroutine"
|
445 454 | );
|
446 455 | let result = ::pyo3::Python::with_gil(|py| {
|
447 456 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
448 457 | let coroutine = if handler.args == 1 {
|
449 458 | pyhandler.call1((input,))?
|
450 459 | } else {
|
451 460 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
452 461 | };
|
453 462 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
454 463 | })?;
|
455 464 | result.await.and_then(|r| {
|
456 465 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::TestPostNoPayloadOutput>(py))
|
457 466 | })
|
458 467 | } else {
|
459 468 | ::tracing::trace!(
|
460 469 | name = "test_post_no_payload",
|
461 470 | "executing python handler function"
|
462 471 | );
|
463 472 | ::pyo3::Python::with_gil(|py| {
|
464 473 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
465 474 | let output = if handler.args == 1 {
|
466 475 | pyhandler.call1((input,))?
|
467 476 | } else {
|
468 477 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
469 478 | };
|
470 479 | output.extract::<crate::output::TestPostNoPayloadOutput>()
|
471 480 | })
|
472 481 | };
|
473 482 | // Catch and record a Python traceback.
|
474 483 | result.map_err(|e| {
|
475 484 | let rich_py_err =
|
476 485 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
477 486 | e.clone_ref(py)
|
478 487 | }));
|
479 488 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
480 489 | e.into()
|
481 490 | })
|
482 491 | }
|
483 492 |
|
493 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
484 494 | /// Python handler for operation `TestGetNoPayload`.
|
485 495 | pub(crate) async fn test_get_no_payload(
|
486 496 | input: crate::input::TestGetNoPayloadInput,
|
487 497 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
488 498 | handler: ::aws_smithy_http_server_python::PyHandler,
|
489 499 | ) -> std::result::Result<crate::output::TestGetNoPayloadOutput, crate::error::TestGetNoPayloadError>
|
490 500 | {
|
491 501 | // Async block used to run the handler and catch any Python error.
|
492 502 | let result = if handler.is_coroutine {
|
493 503 | ::tracing::trace!(
|
494 504 | name = "test_get_no_payload",
|
495 505 | "executing python handler coroutine"
|
496 506 | );
|
497 507 | let result = ::pyo3::Python::with_gil(|py| {
|
498 508 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
499 509 | let coroutine = if handler.args == 1 {
|
500 510 | pyhandler.call1((input,))?
|
501 511 | } else {
|
502 512 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
503 513 | };
|
504 514 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
505 515 | })?;
|
506 516 | result.await.and_then(|r| {
|
507 517 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::TestGetNoPayloadOutput>(py))
|
508 518 | })
|
509 519 | } else {
|
510 520 | ::tracing::trace!(
|
511 521 | name = "test_get_no_payload",
|
512 522 | "executing python handler function"
|
513 523 | );
|
514 524 | ::pyo3::Python::with_gil(|py| {
|
515 525 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
516 526 | let output = if handler.args == 1 {
|
517 527 | pyhandler.call1((input,))?
|
518 528 | } else {
|
519 529 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
520 530 | };
|
521 531 | output.extract::<crate::output::TestGetNoPayloadOutput>()
|
522 532 | })
|
523 533 | };
|
524 534 | // Catch and record a Python traceback.
|
525 535 | result.map_err(|e| {
|
526 536 | let rich_py_err =
|
527 537 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
528 538 | e.clone_ref(py)
|
529 539 | }));
|
530 540 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
531 541 | e.into()
|
532 542 | })
|
533 543 | }
|
534 544 |
|
545 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
535 546 | /// Python handler for operation `TestPayloadBlob`.
|
536 547 | pub(crate) async fn test_payload_blob(
|
537 548 | input: crate::input::TestPayloadBlobInput,
|
538 549 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
539 550 | handler: ::aws_smithy_http_server_python::PyHandler,
|
540 551 | ) -> std::result::Result<crate::output::TestPayloadBlobOutput, crate::error::TestPayloadBlobError> {
|
541 552 | // Async block used to run the handler and catch any Python error.
|
542 553 | let result = if handler.is_coroutine {
|
543 554 | ::tracing::trace!(
|
544 555 | name = "test_payload_blob",
|
545 556 | "executing python handler coroutine"
|
546 557 | );
|
547 558 | let result = ::pyo3::Python::with_gil(|py| {
|
548 559 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
549 560 | let coroutine = if handler.args == 1 {
|
550 561 | pyhandler.call1((input,))?
|
551 562 | } else {
|
552 563 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
553 564 | };
|
554 565 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
555 566 | })?;
|
556 567 | result.await.and_then(|r| {
|
557 568 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::TestPayloadBlobOutput>(py))
|
558 569 | })
|
559 570 | } else {
|
560 571 | ::tracing::trace!(
|
561 572 | name = "test_payload_blob",
|
562 573 | "executing python handler function"
|
563 574 | );
|
564 575 | ::pyo3::Python::with_gil(|py| {
|
565 576 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
566 577 | let output = if handler.args == 1 {
|
567 578 | pyhandler.call1((input,))?
|
568 579 | } else {
|
569 580 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
570 581 | };
|
571 582 | output.extract::<crate::output::TestPayloadBlobOutput>()
|
572 583 | })
|
573 584 | };
|
574 585 | // Catch and record a Python traceback.
|
575 586 | result.map_err(|e| {
|
576 587 | let rich_py_err =
|
577 588 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
578 589 | e.clone_ref(py)
|
579 590 | }));
|
580 591 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
581 592 | e.into()
|
582 593 | })
|
583 594 | }
|
584 595 |
|
596 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
585 597 | /// Python handler for operation `TestPayloadStructure`.
|
586 598 | pub(crate) async fn test_payload_structure(
|
587 599 | input: crate::input::TestPayloadStructureInput,
|
588 600 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
589 601 | handler: ::aws_smithy_http_server_python::PyHandler,
|
590 602 | ) -> std::result::Result<
|
591 603 | crate::output::TestPayloadStructureOutput,
|
592 604 | crate::error::TestPayloadStructureError,
|
593 605 | > {
|
594 606 | // Async block used to run the handler and catch any Python error.
|
595 607 | let result = if handler.is_coroutine {
|
596 608 | ::tracing::trace!(
|
597 609 | name = "test_payload_structure",
|
598 610 | "executing python handler coroutine"
|
599 611 | );
|
600 612 | let result = ::pyo3::Python::with_gil(|py| {
|
601 613 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
602 614 | let coroutine = if handler.args == 1 {
|
603 615 | pyhandler.call1((input,))?
|
604 616 | } else {
|
605 617 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
606 618 | };
|
607 619 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
608 620 | })?;
|
609 621 | result.await.and_then(|r| {
|
610 622 | ::pyo3::Python::with_gil(|py| {
|
611 623 | r.extract::<crate::output::TestPayloadStructureOutput>(py)
|
612 624 | })
|
613 625 | })
|
614 626 | } else {
|
615 627 | ::tracing::trace!(
|
616 628 | name = "test_payload_structure",
|
617 629 | "executing python handler function"
|
618 630 | );
|
619 631 | ::pyo3::Python::with_gil(|py| {
|
620 632 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
621 633 | let output = if handler.args == 1 {
|
622 634 | pyhandler.call1((input,))?
|
623 635 | } else {
|
624 636 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
625 637 | };
|
626 638 | output.extract::<crate::output::TestPayloadStructureOutput>()
|
627 639 | })
|
628 640 | };
|
629 641 | // Catch and record a Python traceback.
|
630 642 | result.map_err(|e| {
|
631 643 | let rich_py_err =
|
632 644 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
633 645 | e.clone_ref(py)
|
634 646 | }));
|
635 647 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
636 648 | e.into()
|
637 649 | })
|
638 650 | }
|
639 651 |
|
652 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
640 653 | /// Python handler for operation `TestBodyStructure`.
|
641 654 | pub(crate) async fn test_body_structure(
|
642 655 | input: crate::input::TestBodyStructureInput,
|
643 656 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
644 657 | handler: ::aws_smithy_http_server_python::PyHandler,
|
645 658 | ) -> std::result::Result<crate::output::TestBodyStructureOutput, crate::error::TestBodyStructureError>
|
646 659 | {
|
647 660 | // Async block used to run the handler and catch any Python error.
|
648 661 | let result = if handler.is_coroutine {
|
649 662 | ::tracing::trace!(
|
650 663 | name = "test_body_structure",
|
651 664 | "executing python handler coroutine"
|
652 665 | );
|
653 666 | let result = ::pyo3::Python::with_gil(|py| {
|
654 667 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
655 668 | let coroutine = if handler.args == 1 {
|
656 669 | pyhandler.call1((input,))?
|
657 670 | } else {
|
658 671 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
659 672 | };
|
660 673 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
661 674 | })?;
|
662 675 | result.await.and_then(|r| {
|
663 676 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::TestBodyStructureOutput>(py))
|
664 677 | })
|
665 678 | } else {
|
666 679 | ::tracing::trace!(
|
667 680 | name = "test_body_structure",
|
668 681 | "executing python handler function"
|
669 682 | );
|
670 683 | ::pyo3::Python::with_gil(|py| {
|
671 684 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
672 685 | let output = if handler.args == 1 {
|
673 686 | pyhandler.call1((input,))?
|
674 687 | } else {
|
675 688 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
676 689 | };
|
677 690 | output.extract::<crate::output::TestBodyStructureOutput>()
|
678 691 | })
|
679 692 | };
|
680 693 | // Catch and record a Python traceback.
|
681 694 | result.map_err(|e| {
|
682 695 | let rich_py_err =
|
683 696 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
684 697 | e.clone_ref(py)
|
685 698 | }));
|
686 699 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
687 700 | e.into()
|
688 701 | })
|
689 702 | }
|
690 703 |
|
704 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
691 705 | /// Python handler for operation `MalformedAcceptWithGenericString`.
|
692 706 | pub(crate) async fn malformed_accept_with_generic_string(
|
693 707 | input: crate::input::MalformedAcceptWithGenericStringInput,
|
694 708 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
695 709 | handler: ::aws_smithy_http_server_python::PyHandler,
|
696 710 | ) -> std::result::Result<
|
697 711 | crate::output::MalformedAcceptWithGenericStringOutput,
|
698 712 | crate::error::MalformedAcceptWithGenericStringError,
|
699 713 | > {
|
700 714 | // Async block used to run the handler and catch any Python error.
|
701 715 | let result = if handler.is_coroutine {
|
702 716 | ::tracing::trace!(
|
703 717 | name = "malformed_accept_with_generic_string",
|
704 718 | "executing python handler coroutine"
|
705 719 | );
|
706 720 | let result = ::pyo3::Python::with_gil(|py| {
|
707 721 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
708 722 | let coroutine = if handler.args == 1 {
|
709 723 | pyhandler.call1((input,))?
|
710 724 | } else {
|
711 725 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
712 726 | };
|
713 727 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
714 728 | })?;
|
715 729 | result.await.and_then(|r| {
|
716 730 | ::pyo3::Python::with_gil(|py| {
|
717 731 | r.extract::<crate::output::MalformedAcceptWithGenericStringOutput>(py)
|
718 732 | })
|
719 733 | })
|
720 734 | } else {
|
721 735 | ::tracing::trace!(
|
722 736 | name = "malformed_accept_with_generic_string",
|
723 737 | "executing python handler function"
|
724 738 | );
|
725 739 | ::pyo3::Python::with_gil(|py| {
|
726 740 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
727 741 | let output = if handler.args == 1 {
|
728 742 | pyhandler.call1((input,))?
|
729 743 | } else {
|
730 744 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
731 745 | };
|
732 746 | output.extract::<crate::output::MalformedAcceptWithGenericStringOutput>()
|
733 747 | })
|
734 748 | };
|
735 749 | // Catch and record a Python traceback.
|
736 750 | result.map_err(|e| {
|
737 751 | let rich_py_err =
|
738 752 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
739 753 | e.clone_ref(py)
|
740 754 | }));
|
741 755 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
742 756 | e.into()
|
743 757 | })
|
744 758 | }
|
745 759 |
|
760 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
746 761 | /// Python handler for operation `MalformedAcceptWithPayload`.
|
747 762 | pub(crate) async fn malformed_accept_with_payload(
|
748 763 | input: crate::input::MalformedAcceptWithPayloadInput,
|
749 764 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
750 765 | handler: ::aws_smithy_http_server_python::PyHandler,
|
751 766 | ) -> std::result::Result<
|
752 767 | crate::output::MalformedAcceptWithPayloadOutput,
|
753 768 | crate::error::MalformedAcceptWithPayloadError,
|
754 769 | > {
|
755 770 | // Async block used to run the handler and catch any Python error.
|
756 771 | let result = if handler.is_coroutine {
|
757 772 | ::tracing::trace!(
|
758 773 | name = "malformed_accept_with_payload",
|
759 774 | "executing python handler coroutine"
|
760 775 | );
|
761 776 | let result = ::pyo3::Python::with_gil(|py| {
|
762 777 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
763 778 | let coroutine = if handler.args == 1 {
|
764 779 | pyhandler.call1((input,))?
|
765 780 | } else {
|
766 781 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
767 782 | };
|
768 783 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
769 784 | })?;
|
770 785 | result.await.and_then(|r| {
|
771 786 | ::pyo3::Python::with_gil(|py| {
|
772 787 | r.extract::<crate::output::MalformedAcceptWithPayloadOutput>(py)
|
773 788 | })
|
774 789 | })
|
775 790 | } else {
|
776 791 | ::tracing::trace!(
|
777 792 | name = "malformed_accept_with_payload",
|
778 793 | "executing python handler function"
|
779 794 | );
|
780 795 | ::pyo3::Python::with_gil(|py| {
|
781 796 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
782 797 | let output = if handler.args == 1 {
|
783 798 | pyhandler.call1((input,))?
|
784 799 | } else {
|
785 800 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
786 801 | };
|
787 802 | output.extract::<crate::output::MalformedAcceptWithPayloadOutput>()
|
788 803 | })
|
789 804 | };
|
790 805 | // Catch and record a Python traceback.
|
791 806 | result.map_err(|e| {
|
792 807 | let rich_py_err =
|
793 808 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
794 809 | e.clone_ref(py)
|
795 810 | }));
|
796 811 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
797 812 | e.into()
|
798 813 | })
|
799 814 | }
|
800 815 |
|
816 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
801 817 | /// Python handler for operation `MalformedAcceptWithBody`.
|
802 818 | pub(crate) async fn malformed_accept_with_body(
|
803 819 | input: crate::input::MalformedAcceptWithBodyInput,
|
804 820 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
805 821 | handler: ::aws_smithy_http_server_python::PyHandler,
|
806 822 | ) -> std::result::Result<
|
807 823 | crate::output::MalformedAcceptWithBodyOutput,
|
808 824 | crate::error::MalformedAcceptWithBodyError,
|
809 825 | > {
|
810 826 | // Async block used to run the handler and catch any Python error.
|
811 827 | let result = if handler.is_coroutine {
|
812 828 | ::tracing::trace!(
|
813 829 | name = "malformed_accept_with_body",
|
814 830 | "executing python handler coroutine"
|
815 831 | );
|
816 832 | let result = ::pyo3::Python::with_gil(|py| {
|
817 833 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
818 834 | let coroutine = if handler.args == 1 {
|
819 835 | pyhandler.call1((input,))?
|
820 836 | } else {
|
821 837 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
822 838 | };
|
823 839 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
824 840 | })?;
|
825 841 | result.await.and_then(|r| {
|
826 842 | ::pyo3::Python::with_gil(|py| {
|
827 843 | r.extract::<crate::output::MalformedAcceptWithBodyOutput>(py)
|
828 844 | })
|
829 845 | })
|
830 846 | } else {
|
831 847 | ::tracing::trace!(
|
832 848 | name = "malformed_accept_with_body",
|
833 849 | "executing python handler function"
|
834 850 | );
|
835 851 | ::pyo3::Python::with_gil(|py| {
|
836 852 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
837 853 | let output = if handler.args == 1 {
|
838 854 | pyhandler.call1((input,))?
|
839 855 | } else {
|
840 856 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
841 857 | };
|
842 858 | output.extract::<crate::output::MalformedAcceptWithBodyOutput>()
|
843 859 | })
|
844 860 | };
|
845 861 | // Catch and record a Python traceback.
|
846 862 | result.map_err(|e| {
|
847 863 | let rich_py_err =
|
848 864 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
849 865 | e.clone_ref(py)
|
850 866 | }));
|
851 867 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
852 868 | e.into()
|
853 869 | })
|
854 870 | }
|
855 871 |
|
872 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
856 873 | /// Python handler for operation `MalformedContentTypeWithGenericString`.
|
857 874 | pub(crate) async fn malformed_content_type_with_generic_string(
|
858 875 | input: crate::input::MalformedContentTypeWithGenericStringInput,
|
859 876 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
860 877 | handler: ::aws_smithy_http_server_python::PyHandler,
|
861 878 | ) -> std::result::Result<
|
862 879 | crate::output::MalformedContentTypeWithGenericStringOutput,
|
863 880 | crate::error::MalformedContentTypeWithGenericStringError,
|
864 881 | > {
|
865 882 | // Async block used to run the handler and catch any Python error.
|
866 883 | let result = if handler.is_coroutine {
|
867 884 | ::tracing::trace!(
|
868 885 | name = "malformed_content_type_with_generic_string",
|
869 886 | "executing python handler coroutine"
|
870 887 | );
|
871 888 | let result = ::pyo3::Python::with_gil(|py| {
|
872 889 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
873 890 | let coroutine = if handler.args == 1 {
|
874 891 | pyhandler.call1((input,))?
|
875 892 | } else {
|
876 893 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
877 894 | };
|
878 895 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
879 896 | })?;
|
880 897 | result.await.and_then(|r| {
|
881 898 | ::pyo3::Python::with_gil(|py| {
|
882 899 | r.extract::<crate::output::MalformedContentTypeWithGenericStringOutput>(py)
|
883 900 | })
|
884 901 | })
|
885 902 | } else {
|
886 903 | ::tracing::trace!(
|
887 904 | name = "malformed_content_type_with_generic_string",
|
888 905 | "executing python handler function"
|
889 906 | );
|
890 907 | ::pyo3::Python::with_gil(|py| {
|
891 908 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
892 909 | let output = if handler.args == 1 {
|
893 910 | pyhandler.call1((input,))?
|
894 911 | } else {
|
895 912 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
896 913 | };
|
897 914 | output.extract::<crate::output::MalformedContentTypeWithGenericStringOutput>()
|
898 915 | })
|
899 916 | };
|
900 917 | // Catch and record a Python traceback.
|
901 918 | result.map_err(|e| {
|
902 919 | let rich_py_err =
|
903 920 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
904 921 | e.clone_ref(py)
|
905 922 | }));
|
906 923 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
907 924 | e.into()
|
908 925 | })
|
909 926 | }
|
910 927 |
|
928 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
911 929 | /// Python handler for operation `MalformedContentTypeWithPayload`.
|
912 930 | pub(crate) async fn malformed_content_type_with_payload(
|
913 931 | input: crate::input::MalformedContentTypeWithPayloadInput,
|
914 932 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
915 933 | handler: ::aws_smithy_http_server_python::PyHandler,
|
916 934 | ) -> std::result::Result<
|
917 935 | crate::output::MalformedContentTypeWithPayloadOutput,
|
918 936 | crate::error::MalformedContentTypeWithPayloadError,
|
919 937 | > {
|
920 938 | // Async block used to run the handler and catch any Python error.
|
921 939 | let result = if handler.is_coroutine {
|
922 940 | ::tracing::trace!(
|
923 941 | name = "malformed_content_type_with_payload",
|
924 942 | "executing python handler coroutine"
|
925 943 | );
|
926 944 | let result = ::pyo3::Python::with_gil(|py| {
|
927 945 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
928 946 | let coroutine = if handler.args == 1 {
|
929 947 | pyhandler.call1((input,))?
|
930 948 | } else {
|
931 949 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
932 950 | };
|
933 951 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
934 952 | })?;
|
935 953 | result.await.and_then(|r| {
|
936 954 | ::pyo3::Python::with_gil(|py| {
|
937 955 | r.extract::<crate::output::MalformedContentTypeWithPayloadOutput>(py)
|
938 956 | })
|
939 957 | })
|
940 958 | } else {
|
941 959 | ::tracing::trace!(
|
942 960 | name = "malformed_content_type_with_payload",
|
943 961 | "executing python handler function"
|
944 962 | );
|
945 963 | ::pyo3::Python::with_gil(|py| {
|
946 964 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
947 965 | let output = if handler.args == 1 {
|
948 966 | pyhandler.call1((input,))?
|
949 967 | } else {
|
950 968 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
951 969 | };
|
952 970 | output.extract::<crate::output::MalformedContentTypeWithPayloadOutput>()
|
953 971 | })
|
954 972 | };
|
955 973 | // Catch and record a Python traceback.
|
956 974 | result.map_err(|e| {
|
957 975 | let rich_py_err =
|
958 976 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
959 977 | e.clone_ref(py)
|
960 978 | }));
|
961 979 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
962 980 | e.into()
|
963 981 | })
|
964 982 | }
|
965 983 |
|
984 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
966 985 | /// Python handler for operation `MalformedContentTypeWithBody`.
|
967 986 | pub(crate) async fn malformed_content_type_with_body(
|
968 987 | input: crate::input::MalformedContentTypeWithBodyInput,
|
969 988 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
970 989 | handler: ::aws_smithy_http_server_python::PyHandler,
|
971 990 | ) -> std::result::Result<
|
972 991 | crate::output::MalformedContentTypeWithBodyOutput,
|
973 992 | crate::error::MalformedContentTypeWithBodyError,
|
974 993 | > {
|
975 994 | // Async block used to run the handler and catch any Python error.
|
976 995 | let result = if handler.is_coroutine {
|
977 996 | ::tracing::trace!(
|
978 997 | name = "malformed_content_type_with_body",
|
979 998 | "executing python handler coroutine"
|
980 999 | );
|
981 1000 | let result = ::pyo3::Python::with_gil(|py| {
|
982 1001 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
983 1002 | let coroutine = if handler.args == 1 {
|
984 1003 | pyhandler.call1((input,))?
|
985 1004 | } else {
|
986 1005 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
987 1006 | };
|
988 1007 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
989 1008 | })?;
|
990 1009 | result.await.and_then(|r| {
|
991 1010 | ::pyo3::Python::with_gil(|py| {
|
992 1011 | r.extract::<crate::output::MalformedContentTypeWithBodyOutput>(py)
|
993 1012 | })
|
994 1013 | })
|
995 1014 | } else {
|
996 1015 | ::tracing::trace!(
|
997 1016 | name = "malformed_content_type_with_body",
|
998 1017 | "executing python handler function"
|
999 1018 | );
|
1000 1019 | ::pyo3::Python::with_gil(|py| {
|
1001 1020 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1002 1021 | let output = if handler.args == 1 {
|
1003 1022 | pyhandler.call1((input,))?
|
1004 1023 | } else {
|
1005 1024 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1006 1025 | };
|
1007 1026 | output.extract::<crate::output::MalformedContentTypeWithBodyOutput>()
|
1008 1027 | })
|
1009 1028 | };
|
1010 1029 | // Catch and record a Python traceback.
|
1011 1030 | result.map_err(|e| {
|
1012 1031 | let rich_py_err =
|
1013 1032 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
1014 1033 | e.clone_ref(py)
|
1015 1034 | }));
|
1016 1035 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
1017 1036 | e.into()
|
1018 1037 | })
|
1019 1038 | }
|
1020 1039 |
|
1040 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
1021 1041 | /// Python handler for operation `MalformedContentTypeWithoutBody`.
|
1022 1042 | pub(crate) async fn malformed_content_type_without_body(
|
1023 1043 | input: crate::input::MalformedContentTypeWithoutBodyInput,
|
1024 1044 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
1025 1045 | handler: ::aws_smithy_http_server_python::PyHandler,
|
1026 1046 | ) -> std::result::Result<
|
1027 1047 | crate::output::MalformedContentTypeWithoutBodyOutput,
|
1028 1048 | crate::error::MalformedContentTypeWithoutBodyError,
|
1029 1049 | > {
|
1030 1050 | // Async block used to run the handler and catch any Python error.
|
1031 1051 | let result = if handler.is_coroutine {
|
1032 1052 | ::tracing::trace!(
|
1033 1053 | name = "malformed_content_type_without_body",
|
1034 1054 | "executing python handler coroutine"
|
1035 1055 | );
|
1036 1056 | let result = ::pyo3::Python::with_gil(|py| {
|
1037 1057 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1038 1058 | let coroutine = if handler.args == 1 {
|
1039 1059 | pyhandler.call1((input,))?
|
1040 1060 | } else {
|
1041 1061 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1042 1062 | };
|
1043 1063 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
1044 1064 | })?;
|
1045 1065 | result.await.and_then(|r| {
|
1046 1066 | ::pyo3::Python::with_gil(|py| {
|
1047 1067 | r.extract::<crate::output::MalformedContentTypeWithoutBodyOutput>(py)
|
1048 1068 | })
|
1049 1069 | })
|
1050 1070 | } else {
|
1051 1071 | ::tracing::trace!(
|
1052 1072 | name = "malformed_content_type_without_body",
|
1053 1073 | "executing python handler function"
|
1054 1074 | );
|
1055 1075 | ::pyo3::Python::with_gil(|py| {
|
1056 1076 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1057 1077 | let output = if handler.args == 1 {
|
1058 1078 | pyhandler.call1((input,))?
|
1059 1079 | } else {
|
1060 1080 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1061 1081 | };
|
1062 1082 | output.extract::<crate::output::MalformedContentTypeWithoutBodyOutput>()
|
1063 1083 | })
|
1064 1084 | };
|
1065 1085 | // Catch and record a Python traceback.
|
1066 1086 | result.map_err(|e| {
|
1067 1087 | let rich_py_err =
|
1068 1088 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
1069 1089 | e.clone_ref(py)
|
1070 1090 | }));
|
1071 1091 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
1072 1092 | e.into()
|
1073 1093 | })
|
1074 1094 | }
|
1075 1095 |
|
1096 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
1076 1097 | /// Python handler for operation `MalformedTimestampBodyHttpDate`.
|
1077 1098 | pub(crate) async fn malformed_timestamp_body_http_date(
|
1078 1099 | input: crate::input::MalformedTimestampBodyHttpDateInput,
|
1079 1100 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
1080 1101 | handler: ::aws_smithy_http_server_python::PyHandler,
|
1081 1102 | ) -> std::result::Result<
|
1082 1103 | crate::output::MalformedTimestampBodyHttpDateOutput,
|
1083 1104 | crate::error::MalformedTimestampBodyHttpDateError,
|
1084 1105 | > {
|
1085 1106 | // Async block used to run the handler and catch any Python error.
|
1086 1107 | let result = if handler.is_coroutine {
|
1087 1108 | ::tracing::trace!(
|
1088 1109 | name = "malformed_timestamp_body_http_date",
|
1089 1110 | "executing python handler coroutine"
|
1090 1111 | );
|
1091 1112 | let result = ::pyo3::Python::with_gil(|py| {
|
1092 1113 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1093 1114 | let coroutine = if handler.args == 1 {
|
1094 1115 | pyhandler.call1((input,))?
|
1095 1116 | } else {
|
1096 1117 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1097 1118 | };
|
1098 1119 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
1099 1120 | })?;
|
1100 1121 | result.await.and_then(|r| {
|
1101 1122 | ::pyo3::Python::with_gil(|py| {
|
1102 1123 | r.extract::<crate::output::MalformedTimestampBodyHttpDateOutput>(py)
|
1103 1124 | })
|
1104 1125 | })
|
1105 1126 | } else {
|
1106 1127 | ::tracing::trace!(
|
1107 1128 | name = "malformed_timestamp_body_http_date",
|
1108 1129 | "executing python handler function"
|
1109 1130 | );
|
1110 1131 | ::pyo3::Python::with_gil(|py| {
|
1111 1132 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1112 1133 | let output = if handler.args == 1 {
|
1113 1134 | pyhandler.call1((input,))?
|
1114 1135 | } else {
|
1115 1136 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1116 1137 | };
|
1117 1138 | output.extract::<crate::output::MalformedTimestampBodyHttpDateOutput>()
|
1118 1139 | })
|
1119 1140 | };
|
1120 1141 | // Catch and record a Python traceback.
|
1121 1142 | result.map_err(|e| {
|
1122 1143 | let rich_py_err =
|
1123 1144 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
1124 1145 | e.clone_ref(py)
|
1125 1146 | }));
|
1126 1147 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
1127 1148 | e.into()
|
1128 1149 | })
|
1129 1150 | }
|
1130 1151 |
|
1152 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
1131 1153 | /// Python handler for operation `MalformedTimestampBodyDateTime`.
|
1132 1154 | pub(crate) async fn malformed_timestamp_body_date_time(
|
1133 1155 | input: crate::input::MalformedTimestampBodyDateTimeInput,
|
1134 1156 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
1135 1157 | handler: ::aws_smithy_http_server_python::PyHandler,
|
1136 1158 | ) -> std::result::Result<
|
1137 1159 | crate::output::MalformedTimestampBodyDateTimeOutput,
|
1138 1160 | crate::error::MalformedTimestampBodyDateTimeError,
|
1139 1161 | > {
|
1140 1162 | // Async block used to run the handler and catch any Python error.
|
1141 1163 | let result = if handler.is_coroutine {
|
1142 1164 | ::tracing::trace!(
|
1143 1165 | name = "malformed_timestamp_body_date_time",
|
1144 1166 | "executing python handler coroutine"
|
1145 1167 | );
|
1146 1168 | let result = ::pyo3::Python::with_gil(|py| {
|
1147 1169 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1148 1170 | let coroutine = if handler.args == 1 {
|
1149 1171 | pyhandler.call1((input,))?
|
1150 1172 | } else {
|
1151 1173 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1152 1174 | };
|
1153 1175 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
1154 1176 | })?;
|
1155 1177 | result.await.and_then(|r| {
|
1156 1178 | ::pyo3::Python::with_gil(|py| {
|
1157 1179 | r.extract::<crate::output::MalformedTimestampBodyDateTimeOutput>(py)
|
1158 1180 | })
|
1159 1181 | })
|
1160 1182 | } else {
|
1161 1183 | ::tracing::trace!(
|
1162 1184 | name = "malformed_timestamp_body_date_time",
|
1163 1185 | "executing python handler function"
|
1164 1186 | );
|
1165 1187 | ::pyo3::Python::with_gil(|py| {
|
1166 1188 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1167 1189 | let output = if handler.args == 1 {
|
1168 1190 | pyhandler.call1((input,))?
|
1169 1191 | } else {
|
1170 1192 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1171 1193 | };
|
1172 1194 | output.extract::<crate::output::MalformedTimestampBodyDateTimeOutput>()
|
1173 1195 | })
|
1174 1196 | };
|
1175 1197 | // Catch and record a Python traceback.
|
1176 1198 | result.map_err(|e| {
|
1177 1199 | let rich_py_err =
|
1178 1200 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
1179 1201 | e.clone_ref(py)
|
1180 1202 | }));
|
1181 1203 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
1182 1204 | e.into()
|
1183 1205 | })
|
1184 1206 | }
|
1185 1207 |
|
1208 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
1186 1209 | /// Python handler for operation `MalformedTimestampBodyDefault`.
|
1187 1210 | pub(crate) async fn malformed_timestamp_body_default(
|
1188 1211 | input: crate::input::MalformedTimestampBodyDefaultInput,
|
1189 1212 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
1190 1213 | handler: ::aws_smithy_http_server_python::PyHandler,
|
1191 1214 | ) -> std::result::Result<
|
1192 1215 | crate::output::MalformedTimestampBodyDefaultOutput,
|
1193 1216 | crate::error::MalformedTimestampBodyDefaultError,
|
1194 1217 | > {
|
1195 1218 | // Async block used to run the handler and catch any Python error.
|
1196 1219 | let result = if handler.is_coroutine {
|
1197 1220 | ::tracing::trace!(
|
1198 1221 | name = "malformed_timestamp_body_default",
|
1199 1222 | "executing python handler coroutine"
|
1200 1223 | );
|
1201 1224 | let result = ::pyo3::Python::with_gil(|py| {
|
1202 1225 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1203 1226 | let coroutine = if handler.args == 1 {
|
1204 1227 | pyhandler.call1((input,))?
|
1205 1228 | } else {
|
1206 1229 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1207 1230 | };
|
1208 1231 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
1209 1232 | })?;
|
1210 1233 | result.await.and_then(|r| {
|
1211 1234 | ::pyo3::Python::with_gil(|py| {
|
1212 1235 | r.extract::<crate::output::MalformedTimestampBodyDefaultOutput>(py)
|
1213 1236 | })
|
1214 1237 | })
|
1215 1238 | } else {
|
1216 1239 | ::tracing::trace!(
|
1217 1240 | name = "malformed_timestamp_body_default",
|
1218 1241 | "executing python handler function"
|
1219 1242 | );
|
1220 1243 | ::pyo3::Python::with_gil(|py| {
|
1221 1244 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1222 1245 | let output = if handler.args == 1 {
|
1223 1246 | pyhandler.call1((input,))?
|
1224 1247 | } else {
|
1225 1248 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1226 1249 | };
|
1227 1250 | output.extract::<crate::output::MalformedTimestampBodyDefaultOutput>()
|
1228 1251 | })
|
1229 1252 | };
|
1230 1253 | // Catch and record a Python traceback.
|
1231 1254 | result.map_err(|e| {
|
1232 1255 | let rich_py_err =
|
1233 1256 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
1234 1257 | e.clone_ref(py)
|
1235 1258 | }));
|
1236 1259 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
1237 1260 | e.into()
|
1238 1261 | })
|
1239 1262 | }
|
1240 1263 |
|
1264 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
1241 1265 | /// Python handler for operation `MalformedTimestampHeaderEpoch`.
|
1242 1266 | pub(crate) async fn malformed_timestamp_header_epoch(
|
1243 1267 | input: crate::input::MalformedTimestampHeaderEpochInput,
|
1244 1268 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
1245 1269 | handler: ::aws_smithy_http_server_python::PyHandler,
|
1246 1270 | ) -> std::result::Result<
|
1247 1271 | crate::output::MalformedTimestampHeaderEpochOutput,
|
1248 1272 | crate::error::MalformedTimestampHeaderEpochError,
|
1249 1273 | > {
|
1250 1274 | // Async block used to run the handler and catch any Python error.
|
1251 1275 | let result = if handler.is_coroutine {
|
1252 1276 | ::tracing::trace!(
|
1253 1277 | name = "malformed_timestamp_header_epoch",
|
1254 1278 | "executing python handler coroutine"
|
1255 1279 | );
|
1256 1280 | let result = ::pyo3::Python::with_gil(|py| {
|
1257 1281 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1258 1282 | let coroutine = if handler.args == 1 {
|
1259 1283 | pyhandler.call1((input,))?
|
1260 1284 | } else {
|
1261 1285 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1262 1286 | };
|
1263 1287 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
1264 1288 | })?;
|
1265 1289 | result.await.and_then(|r| {
|
1266 1290 | ::pyo3::Python::with_gil(|py| {
|
1267 1291 | r.extract::<crate::output::MalformedTimestampHeaderEpochOutput>(py)
|
1268 1292 | })
|
1269 1293 | })
|
1270 1294 | } else {
|
1271 1295 | ::tracing::trace!(
|
1272 1296 | name = "malformed_timestamp_header_epoch",
|
1273 1297 | "executing python handler function"
|
1274 1298 | );
|
1275 1299 | ::pyo3::Python::with_gil(|py| {
|
1276 1300 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1277 1301 | let output = if handler.args == 1 {
|
1278 1302 | pyhandler.call1((input,))?
|
1279 1303 | } else {
|
1280 1304 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1281 1305 | };
|
1282 1306 | output.extract::<crate::output::MalformedTimestampHeaderEpochOutput>()
|
1283 1307 | })
|
1284 1308 | };
|
1285 1309 | // Catch and record a Python traceback.
|
1286 1310 | result.map_err(|e| {
|
1287 1311 | let rich_py_err =
|
1288 1312 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
1289 1313 | e.clone_ref(py)
|
1290 1314 | }));
|
1291 1315 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
1292 1316 | e.into()
|
1293 1317 | })
|
1294 1318 | }
|
1295 1319 |
|
1320 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
1296 1321 | /// Python handler for operation `MalformedTimestampHeaderDateTime`.
|
1297 1322 | pub(crate) async fn malformed_timestamp_header_date_time(
|
1298 1323 | input: crate::input::MalformedTimestampHeaderDateTimeInput,
|
1299 1324 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
1300 1325 | handler: ::aws_smithy_http_server_python::PyHandler,
|
1301 1326 | ) -> std::result::Result<
|
1302 1327 | crate::output::MalformedTimestampHeaderDateTimeOutput,
|
1303 1328 | crate::error::MalformedTimestampHeaderDateTimeError,
|
1304 1329 | > {
|
1305 1330 | // Async block used to run the handler and catch any Python error.
|
1306 1331 | let result = if handler.is_coroutine {
|
1307 1332 | ::tracing::trace!(
|
1308 1333 | name = "malformed_timestamp_header_date_time",
|
1309 1334 | "executing python handler coroutine"
|
1310 1335 | );
|
1311 1336 | let result = ::pyo3::Python::with_gil(|py| {
|
1312 1337 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1313 1338 | let coroutine = if handler.args == 1 {
|
1314 1339 | pyhandler.call1((input,))?
|
1315 1340 | } else {
|
1316 1341 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1317 1342 | };
|
1318 1343 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
1319 1344 | })?;
|
1320 1345 | result.await.and_then(|r| {
|
1321 1346 | ::pyo3::Python::with_gil(|py| {
|
1322 1347 | r.extract::<crate::output::MalformedTimestampHeaderDateTimeOutput>(py)
|
1323 1348 | })
|
1324 1349 | })
|
1325 1350 | } else {
|
1326 1351 | ::tracing::trace!(
|
1327 1352 | name = "malformed_timestamp_header_date_time",
|
1328 1353 | "executing python handler function"
|
1329 1354 | );
|
1330 1355 | ::pyo3::Python::with_gil(|py| {
|
1331 1356 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1332 1357 | let output = if handler.args == 1 {
|
1333 1358 | pyhandler.call1((input,))?
|
1334 1359 | } else {
|
1335 1360 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1336 1361 | };
|
1337 1362 | output.extract::<crate::output::MalformedTimestampHeaderDateTimeOutput>()
|
1338 1363 | })
|
1339 1364 | };
|
1340 1365 | // Catch and record a Python traceback.
|
1341 1366 | result.map_err(|e| {
|
1342 1367 | let rich_py_err =
|
1343 1368 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
1344 1369 | e.clone_ref(py)
|
1345 1370 | }));
|
1346 1371 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
1347 1372 | e.into()
|
1348 1373 | })
|
1349 1374 | }
|
1350 1375 |
|
1376 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
1351 1377 | /// Python handler for operation `MalformedTimestampHeaderDefault`.
|
1352 1378 | pub(crate) async fn malformed_timestamp_header_default(
|
1353 1379 | input: crate::input::MalformedTimestampHeaderDefaultInput,
|
1354 1380 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
1355 1381 | handler: ::aws_smithy_http_server_python::PyHandler,
|
1356 1382 | ) -> std::result::Result<
|
1357 1383 | crate::output::MalformedTimestampHeaderDefaultOutput,
|
1358 1384 | crate::error::MalformedTimestampHeaderDefaultError,
|
1359 1385 | > {
|
1360 1386 | // Async block used to run the handler and catch any Python error.
|
1361 1387 | let result = if handler.is_coroutine {
|
1362 1388 | ::tracing::trace!(
|
1363 1389 | name = "malformed_timestamp_header_default",
|
1364 1390 | "executing python handler coroutine"
|
1365 1391 | );
|
1366 1392 | let result = ::pyo3::Python::with_gil(|py| {
|
1367 1393 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1368 1394 | let coroutine = if handler.args == 1 {
|
1369 1395 | pyhandler.call1((input,))?
|
1370 1396 | } else {
|
1371 1397 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1372 1398 | };
|
1373 1399 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
1374 1400 | })?;
|
1375 1401 | result.await.and_then(|r| {
|
1376 1402 | ::pyo3::Python::with_gil(|py| {
|
1377 1403 | r.extract::<crate::output::MalformedTimestampHeaderDefaultOutput>(py)
|
1378 1404 | })
|
1379 1405 | })
|
1380 1406 | } else {
|
1381 1407 | ::tracing::trace!(
|
1382 1408 | name = "malformed_timestamp_header_default",
|
1383 1409 | "executing python handler function"
|
1384 1410 | );
|
1385 1411 | ::pyo3::Python::with_gil(|py| {
|
1386 1412 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1387 1413 | let output = if handler.args == 1 {
|
1388 1414 | pyhandler.call1((input,))?
|
1389 1415 | } else {
|
1390 1416 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1391 1417 | };
|
1392 1418 | output.extract::<crate::output::MalformedTimestampHeaderDefaultOutput>()
|
1393 1419 | })
|
1394 1420 | };
|
1395 1421 | // Catch and record a Python traceback.
|
1396 1422 | result.map_err(|e| {
|
1397 1423 | let rich_py_err =
|
1398 1424 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
1399 1425 | e.clone_ref(py)
|
1400 1426 | }));
|
1401 1427 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
1402 1428 | e.into()
|
1403 1429 | })
|
1404 1430 | }
|
1405 1431 |
|
1432 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
1406 1433 | /// Python handler for operation `MalformedTimestampQueryEpoch`.
|
1407 1434 | pub(crate) async fn malformed_timestamp_query_epoch(
|
1408 1435 | input: crate::input::MalformedTimestampQueryEpochInput,
|
1409 1436 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
1410 1437 | handler: ::aws_smithy_http_server_python::PyHandler,
|
1411 1438 | ) -> std::result::Result<
|
1412 1439 | crate::output::MalformedTimestampQueryEpochOutput,
|
1413 1440 | crate::error::MalformedTimestampQueryEpochError,
|
1414 1441 | > {
|
1415 1442 | // Async block used to run the handler and catch any Python error.
|
1416 1443 | let result = if handler.is_coroutine {
|
1417 1444 | ::tracing::trace!(
|
1418 1445 | name = "malformed_timestamp_query_epoch",
|
1419 1446 | "executing python handler coroutine"
|
1420 1447 | );
|
1421 1448 | let result = ::pyo3::Python::with_gil(|py| {
|
1422 1449 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1423 1450 | let coroutine = if handler.args == 1 {
|
1424 1451 | pyhandler.call1((input,))?
|
1425 1452 | } else {
|
1426 1453 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1427 1454 | };
|
1428 1455 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
1429 1456 | })?;
|
1430 1457 | result.await.and_then(|r| {
|
1431 1458 | ::pyo3::Python::with_gil(|py| {
|
1432 1459 | r.extract::<crate::output::MalformedTimestampQueryEpochOutput>(py)
|
1433 1460 | })
|
1434 1461 | })
|
1435 1462 | } else {
|
1436 1463 | ::tracing::trace!(
|
1437 1464 | name = "malformed_timestamp_query_epoch",
|
1438 1465 | "executing python handler function"
|
1439 1466 | );
|
1440 1467 | ::pyo3::Python::with_gil(|py| {
|
1441 1468 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1442 1469 | let output = if handler.args == 1 {
|
1443 1470 | pyhandler.call1((input,))?
|
1444 1471 | } else {
|
1445 1472 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1446 1473 | };
|
1447 1474 | output.extract::<crate::output::MalformedTimestampQueryEpochOutput>()
|
1448 1475 | })
|
1449 1476 | };
|
1450 1477 | // Catch and record a Python traceback.
|
1451 1478 | result.map_err(|e| {
|
1452 1479 | let rich_py_err =
|
1453 1480 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
1454 1481 | e.clone_ref(py)
|
1455 1482 | }));
|
1456 1483 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
1457 1484 | e.into()
|
1458 1485 | })
|
1459 1486 | }
|
1460 1487 |
|
1488 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
1461 1489 | /// Python handler for operation `MalformedTimestampQueryHttpDate`.
|
1462 1490 | pub(crate) async fn malformed_timestamp_query_http_date(
|
1463 1491 | input: crate::input::MalformedTimestampQueryHttpDateInput,
|
1464 1492 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
1465 1493 | handler: ::aws_smithy_http_server_python::PyHandler,
|
1466 1494 | ) -> std::result::Result<
|
1467 1495 | crate::output::MalformedTimestampQueryHttpDateOutput,
|
1468 1496 | crate::error::MalformedTimestampQueryHttpDateError,
|
1469 1497 | > {
|
1470 1498 | // Async block used to run the handler and catch any Python error.
|
1471 1499 | let result = if handler.is_coroutine {
|
1472 1500 | ::tracing::trace!(
|
1473 1501 | name = "malformed_timestamp_query_http_date",
|
1474 1502 | "executing python handler coroutine"
|
1475 1503 | );
|
1476 1504 | let result = ::pyo3::Python::with_gil(|py| {
|
1477 1505 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1478 1506 | let coroutine = if handler.args == 1 {
|
1479 1507 | pyhandler.call1((input,))?
|
1480 1508 | } else {
|
1481 1509 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1482 1510 | };
|
1483 1511 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
1484 1512 | })?;
|
1485 1513 | result.await.and_then(|r| {
|
1486 1514 | ::pyo3::Python::with_gil(|py| {
|
1487 1515 | r.extract::<crate::output::MalformedTimestampQueryHttpDateOutput>(py)
|
1488 1516 | })
|
1489 1517 | })
|
1490 1518 | } else {
|
1491 1519 | ::tracing::trace!(
|
1492 1520 | name = "malformed_timestamp_query_http_date",
|
1493 1521 | "executing python handler function"
|
1494 1522 | );
|
1495 1523 | ::pyo3::Python::with_gil(|py| {
|
1496 1524 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1497 1525 | let output = if handler.args == 1 {
|
1498 1526 | pyhandler.call1((input,))?
|
1499 1527 | } else {
|
1500 1528 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1501 1529 | };
|
1502 1530 | output.extract::<crate::output::MalformedTimestampQueryHttpDateOutput>()
|
1503 1531 | })
|
1504 1532 | };
|
1505 1533 | // Catch and record a Python traceback.
|
1506 1534 | result.map_err(|e| {
|
1507 1535 | let rich_py_err =
|
1508 1536 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
1509 1537 | e.clone_ref(py)
|
1510 1538 | }));
|
1511 1539 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
1512 1540 | e.into()
|
1513 1541 | })
|
1514 1542 | }
|
1515 1543 |
|
1544 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
1516 1545 | /// Python handler for operation `MalformedTimestampQueryDefault`.
|
1517 1546 | pub(crate) async fn malformed_timestamp_query_default(
|
1518 1547 | input: crate::input::MalformedTimestampQueryDefaultInput,
|
1519 1548 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
1520 1549 | handler: ::aws_smithy_http_server_python::PyHandler,
|
1521 1550 | ) -> std::result::Result<
|
1522 1551 | crate::output::MalformedTimestampQueryDefaultOutput,
|
1523 1552 | crate::error::MalformedTimestampQueryDefaultError,
|
1524 1553 | > {
|
1525 1554 | // Async block used to run the handler and catch any Python error.
|
1526 1555 | let result = if handler.is_coroutine {
|
1527 1556 | ::tracing::trace!(
|
1528 1557 | name = "malformed_timestamp_query_default",
|
1529 1558 | "executing python handler coroutine"
|
1530 1559 | );
|
1531 1560 | let result = ::pyo3::Python::with_gil(|py| {
|
1532 1561 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1533 1562 | let coroutine = if handler.args == 1 {
|
1534 1563 | pyhandler.call1((input,))?
|
1535 1564 | } else {
|
1536 1565 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1537 1566 | };
|
1538 1567 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
1539 1568 | })?;
|
1540 1569 | result.await.and_then(|r| {
|
1541 1570 | ::pyo3::Python::with_gil(|py| {
|
1542 1571 | r.extract::<crate::output::MalformedTimestampQueryDefaultOutput>(py)
|
1543 1572 | })
|
1544 1573 | })
|
1545 1574 | } else {
|
1546 1575 | ::tracing::trace!(
|
1547 1576 | name = "malformed_timestamp_query_default",
|
1548 1577 | "executing python handler function"
|
1549 1578 | );
|
1550 1579 | ::pyo3::Python::with_gil(|py| {
|
1551 1580 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1552 1581 | let output = if handler.args == 1 {
|
1553 1582 | pyhandler.call1((input,))?
|
1554 1583 | } else {
|
1555 1584 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1556 1585 | };
|
1557 1586 | output.extract::<crate::output::MalformedTimestampQueryDefaultOutput>()
|
1558 1587 | })
|
1559 1588 | };
|
1560 1589 | // Catch and record a Python traceback.
|
1561 1590 | result.map_err(|e| {
|
1562 1591 | let rich_py_err =
|
1563 1592 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
1564 1593 | e.clone_ref(py)
|
1565 1594 | }));
|
1566 1595 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
1567 1596 | e.into()
|
1568 1597 | })
|
1569 1598 | }
|
1570 1599 |
|
1600 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
1571 1601 | /// Python handler for operation `MalformedTimestampPathEpoch`.
|
1572 1602 | pub(crate) async fn malformed_timestamp_path_epoch(
|
1573 1603 | input: crate::input::MalformedTimestampPathEpochInput,
|
1574 1604 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
1575 1605 | handler: ::aws_smithy_http_server_python::PyHandler,
|
1576 1606 | ) -> std::result::Result<
|
1577 1607 | crate::output::MalformedTimestampPathEpochOutput,
|
1578 1608 | crate::error::MalformedTimestampPathEpochError,
|
1579 1609 | > {
|
1580 1610 | // Async block used to run the handler and catch any Python error.
|
1581 1611 | let result = if handler.is_coroutine {
|
1582 1612 | ::tracing::trace!(
|
1583 1613 | name = "malformed_timestamp_path_epoch",
|
1584 1614 | "executing python handler coroutine"
|
1585 1615 | );
|
1586 1616 | let result = ::pyo3::Python::with_gil(|py| {
|
1587 1617 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1588 1618 | let coroutine = if handler.args == 1 {
|
1589 1619 | pyhandler.call1((input,))?
|
1590 1620 | } else {
|
1591 1621 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1592 1622 | };
|
1593 1623 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
1594 1624 | })?;
|
1595 1625 | result.await.and_then(|r| {
|
1596 1626 | ::pyo3::Python::with_gil(|py| {
|
1597 1627 | r.extract::<crate::output::MalformedTimestampPathEpochOutput>(py)
|
1598 1628 | })
|
1599 1629 | })
|
1600 1630 | } else {
|
1601 1631 | ::tracing::trace!(
|
1602 1632 | name = "malformed_timestamp_path_epoch",
|
1603 1633 | "executing python handler function"
|
1604 1634 | );
|
1605 1635 | ::pyo3::Python::with_gil(|py| {
|
1606 1636 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1607 1637 | let output = if handler.args == 1 {
|
1608 1638 | pyhandler.call1((input,))?
|
1609 1639 | } else {
|
1610 1640 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1611 1641 | };
|
1612 1642 | output.extract::<crate::output::MalformedTimestampPathEpochOutput>()
|
1613 1643 | })
|
1614 1644 | };
|
1615 1645 | // Catch and record a Python traceback.
|
1616 1646 | result.map_err(|e| {
|
1617 1647 | let rich_py_err =
|
1618 1648 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
1619 1649 | e.clone_ref(py)
|
1620 1650 | }));
|
1621 1651 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
1622 1652 | e.into()
|
1623 1653 | })
|
1624 1654 | }
|
1625 1655 |
|
1656 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
1626 1657 | /// Python handler for operation `MalformedTimestampPathHttpDate`.
|
1627 1658 | pub(crate) async fn malformed_timestamp_path_http_date(
|
1628 1659 | input: crate::input::MalformedTimestampPathHttpDateInput,
|
1629 1660 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
1630 1661 | handler: ::aws_smithy_http_server_python::PyHandler,
|
1631 1662 | ) -> std::result::Result<
|
1632 1663 | crate::output::MalformedTimestampPathHttpDateOutput,
|
1633 1664 | crate::error::MalformedTimestampPathHttpDateError,
|
1634 1665 | > {
|
1635 1666 | // Async block used to run the handler and catch any Python error.
|
1636 1667 | let result = if handler.is_coroutine {
|
1637 1668 | ::tracing::trace!(
|
1638 1669 | name = "malformed_timestamp_path_http_date",
|
1639 1670 | "executing python handler coroutine"
|
1640 1671 | );
|
1641 1672 | let result = ::pyo3::Python::with_gil(|py| {
|
1642 1673 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1643 1674 | let coroutine = if handler.args == 1 {
|
1644 1675 | pyhandler.call1((input,))?
|
1645 1676 | } else {
|
1646 1677 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1647 1678 | };
|
1648 1679 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
1649 1680 | })?;
|
1650 1681 | result.await.and_then(|r| {
|
1651 1682 | ::pyo3::Python::with_gil(|py| {
|
1652 1683 | r.extract::<crate::output::MalformedTimestampPathHttpDateOutput>(py)
|
1653 1684 | })
|
1654 1685 | })
|
1655 1686 | } else {
|
1656 1687 | ::tracing::trace!(
|
1657 1688 | name = "malformed_timestamp_path_http_date",
|
1658 1689 | "executing python handler function"
|
1659 1690 | );
|
1660 1691 | ::pyo3::Python::with_gil(|py| {
|
1661 1692 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1662 1693 | let output = if handler.args == 1 {
|
1663 1694 | pyhandler.call1((input,))?
|
1664 1695 | } else {
|
1665 1696 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1666 1697 | };
|
1667 1698 | output.extract::<crate::output::MalformedTimestampPathHttpDateOutput>()
|
1668 1699 | })
|
1669 1700 | };
|
1670 1701 | // Catch and record a Python traceback.
|
1671 1702 | result.map_err(|e| {
|
1672 1703 | let rich_py_err =
|
1673 1704 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
1674 1705 | e.clone_ref(py)
|
1675 1706 | }));
|
1676 1707 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
1677 1708 | e.into()
|
1678 1709 | })
|
1679 1710 | }
|
1680 1711 |
|
1712 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
1681 1713 | /// Python handler for operation `MalformedTimestampPathDefault`.
|
1682 1714 | pub(crate) async fn malformed_timestamp_path_default(
|
1683 1715 | input: crate::input::MalformedTimestampPathDefaultInput,
|
1684 1716 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
1685 1717 | handler: ::aws_smithy_http_server_python::PyHandler,
|
1686 1718 | ) -> std::result::Result<
|
1687 1719 | crate::output::MalformedTimestampPathDefaultOutput,
|
1688 1720 | crate::error::MalformedTimestampPathDefaultError,
|
1689 1721 | > {
|
1690 1722 | // Async block used to run the handler and catch any Python error.
|
1691 1723 | let result = if handler.is_coroutine {
|
1692 1724 | ::tracing::trace!(
|
1693 1725 | name = "malformed_timestamp_path_default",
|
1694 1726 | "executing python handler coroutine"
|
1695 1727 | );
|
1696 1728 | let result = ::pyo3::Python::with_gil(|py| {
|
1697 1729 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1698 1730 | let coroutine = if handler.args == 1 {
|
1699 1731 | pyhandler.call1((input,))?
|
1700 1732 | } else {
|
1701 1733 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1702 1734 | };
|
1703 1735 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
1704 1736 | })?;
|
1705 1737 | result.await.and_then(|r| {
|
1706 1738 | ::pyo3::Python::with_gil(|py| {
|
1707 1739 | r.extract::<crate::output::MalformedTimestampPathDefaultOutput>(py)
|
1708 1740 | })
|
1709 1741 | })
|
1710 1742 | } else {
|
1711 1743 | ::tracing::trace!(
|
1712 1744 | name = "malformed_timestamp_path_default",
|
1713 1745 | "executing python handler function"
|
1714 1746 | );
|
1715 1747 | ::pyo3::Python::with_gil(|py| {
|
1716 1748 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1717 1749 | let output = if handler.args == 1 {
|
1718 1750 | pyhandler.call1((input,))?
|
1719 1751 | } else {
|
1720 1752 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1721 1753 | };
|
1722 1754 | output.extract::<crate::output::MalformedTimestampPathDefaultOutput>()
|
1723 1755 | })
|
1724 1756 | };
|
1725 1757 | // Catch and record a Python traceback.
|
1726 1758 | result.map_err(|e| {
|
1727 1759 | let rich_py_err =
|
1728 1760 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
1729 1761 | e.clone_ref(py)
|
1730 1762 | }));
|
1731 1763 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
1732 1764 | e.into()
|
1733 1765 | })
|
1734 1766 | }
|
1735 1767 |
|
1768 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
1736 1769 | /// Python handler for operation `MalformedString`.
|
1737 1770 | pub(crate) async fn malformed_string(
|
1738 1771 | input: crate::input::MalformedStringInput,
|
1739 1772 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
1740 1773 | handler: ::aws_smithy_http_server_python::PyHandler,
|
1741 1774 | ) -> std::result::Result<crate::output::MalformedStringOutput, crate::error::MalformedStringError> {
|
1742 1775 | // Async block used to run the handler and catch any Python error.
|
1743 1776 | let result = if handler.is_coroutine {
|
1744 1777 | ::tracing::trace!(
|
1745 1778 | name = "malformed_string",
|
1746 1779 | "executing python handler coroutine"
|
1747 1780 | );
|
1748 1781 | let result = ::pyo3::Python::with_gil(|py| {
|
1749 1782 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1750 1783 | let coroutine = if handler.args == 1 {
|
1751 1784 | pyhandler.call1((input,))?
|
1752 1785 | } else {
|
1753 1786 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1754 1787 | };
|
1755 1788 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
1756 1789 | })?;
|
1757 1790 | result.await.and_then(|r| {
|
1758 1791 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::MalformedStringOutput>(py))
|
1759 1792 | })
|
1760 1793 | } else {
|
1761 1794 | ::tracing::trace!(
|
1762 1795 | name = "malformed_string",
|
1763 1796 | "executing python handler function"
|
1764 1797 | );
|
1765 1798 | ::pyo3::Python::with_gil(|py| {
|
1766 1799 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1767 1800 | let output = if handler.args == 1 {
|
1768 1801 | pyhandler.call1((input,))?
|
1769 1802 | } else {
|
1770 1803 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1771 1804 | };
|
1772 1805 | output.extract::<crate::output::MalformedStringOutput>()
|
1773 1806 | })
|
1774 1807 | };
|
1775 1808 | // Catch and record a Python traceback.
|
1776 1809 | result.map_err(|e| {
|
1777 1810 | let rich_py_err =
|
1778 1811 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
1779 1812 | e.clone_ref(py)
|
1780 1813 | }));
|
1781 1814 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
1782 1815 | e.into()
|
1783 1816 | })
|
1784 1817 | }
|
1785 1818 |
|
1819 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
1786 1820 | /// Python handler for operation `MalformedDouble`.
|
1787 1821 | pub(crate) async fn malformed_double(
|
1788 1822 | input: crate::input::MalformedDoubleInput,
|
1789 1823 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
1790 1824 | handler: ::aws_smithy_http_server_python::PyHandler,
|
1791 1825 | ) -> std::result::Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> {
|
1792 1826 | // Async block used to run the handler and catch any Python error.
|
1793 1827 | let result = if handler.is_coroutine {
|
1794 1828 | ::tracing::trace!(
|
1795 1829 | name = "malformed_double",
|
1796 1830 | "executing python handler coroutine"
|
1797 1831 | );
|
1798 1832 | let result = ::pyo3::Python::with_gil(|py| {
|
1799 1833 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1800 1834 | let coroutine = if handler.args == 1 {
|
1801 1835 | pyhandler.call1((input,))?
|
1802 1836 | } else {
|
1803 1837 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1804 1838 | };
|
1805 1839 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
1806 1840 | })?;
|
1807 1841 | result.await.and_then(|r| {
|
1808 1842 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::MalformedDoubleOutput>(py))
|
1809 1843 | })
|
1810 1844 | } else {
|
1811 1845 | ::tracing::trace!(
|
1812 1846 | name = "malformed_double",
|
1813 1847 | "executing python handler function"
|
1814 1848 | );
|
1815 1849 | ::pyo3::Python::with_gil(|py| {
|
1816 1850 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1817 1851 | let output = if handler.args == 1 {
|
1818 1852 | pyhandler.call1((input,))?
|
1819 1853 | } else {
|
1820 1854 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1821 1855 | };
|
1822 1856 | output.extract::<crate::output::MalformedDoubleOutput>()
|
1823 1857 | })
|
1824 1858 | };
|
1825 1859 | // Catch and record a Python traceback.
|
1826 1860 | result.map_err(|e| {
|
1827 1861 | let rich_py_err =
|
1828 1862 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
1829 1863 | e.clone_ref(py)
|
1830 1864 | }));
|
1831 1865 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
1832 1866 | e.into()
|
1833 1867 | })
|
1834 1868 | }
|
1835 1869 |
|
1870 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
1836 1871 | /// Python handler for operation `MalformedFloat`.
|
1837 1872 | pub(crate) async fn malformed_float(
|
1838 1873 | input: crate::input::MalformedFloatInput,
|
1839 1874 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
1840 1875 | handler: ::aws_smithy_http_server_python::PyHandler,
|
1841 1876 | ) -> std::result::Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> {
|
1842 1877 | // Async block used to run the handler and catch any Python error.
|
1843 1878 | let result = if handler.is_coroutine {
|
1844 1879 | ::tracing::trace!(
|
1845 1880 | name = "malformed_float",
|
1846 1881 | "executing python handler coroutine"
|
1847 1882 | );
|
1848 1883 | let result = ::pyo3::Python::with_gil(|py| {
|
1849 1884 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1850 1885 | let coroutine = if handler.args == 1 {
|
1851 1886 | pyhandler.call1((input,))?
|
1852 1887 | } else {
|
1853 1888 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1854 1889 | };
|
1855 1890 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
1856 1891 | })?;
|
1857 1892 | result.await.and_then(|r| {
|
1858 1893 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::MalformedFloatOutput>(py))
|
1859 1894 | })
|
1860 1895 | } else {
|
1861 1896 | ::tracing::trace!(
|
1862 1897 | name = "malformed_float",
|
1863 1898 | "executing python handler function"
|
1864 1899 | );
|
1865 1900 | ::pyo3::Python::with_gil(|py| {
|
1866 1901 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1867 1902 | let output = if handler.args == 1 {
|
1868 1903 | pyhandler.call1((input,))?
|
1869 1904 | } else {
|
1870 1905 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1871 1906 | };
|
1872 1907 | output.extract::<crate::output::MalformedFloatOutput>()
|
1873 1908 | })
|
1874 1909 | };
|
1875 1910 | // Catch and record a Python traceback.
|
1876 1911 | result.map_err(|e| {
|
1877 1912 | let rich_py_err =
|
1878 1913 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
1879 1914 | e.clone_ref(py)
|
1880 1915 | }));
|
1881 1916 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
1882 1917 | e.into()
|
1883 1918 | })
|
1884 1919 | }
|
1885 1920 |
|
1921 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
1886 1922 | /// Python handler for operation `MalformedLong`.
|
1887 1923 | pub(crate) async fn malformed_long(
|
1888 1924 | input: crate::input::MalformedLongInput,
|
1889 1925 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
1890 1926 | handler: ::aws_smithy_http_server_python::PyHandler,
|
1891 1927 | ) -> std::result::Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> {
|
1892 1928 | // Async block used to run the handler and catch any Python error.
|
1893 1929 | let result = if handler.is_coroutine {
|
1894 1930 | ::tracing::trace!(
|
1895 1931 | name = "malformed_long",
|
1896 1932 | "executing python handler coroutine"
|
1897 1933 | );
|
1898 1934 | let result = ::pyo3::Python::with_gil(|py| {
|
1899 1935 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1900 1936 | let coroutine = if handler.args == 1 {
|
1901 1937 | pyhandler.call1((input,))?
|
1902 1938 | } else {
|
1903 1939 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1904 1940 | };
|
1905 1941 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
1906 1942 | })?;
|
1907 1943 | result.await.and_then(|r| {
|
1908 1944 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::MalformedLongOutput>(py))
|
1909 1945 | })
|
1910 1946 | } else {
|
1911 1947 | ::tracing::trace!(name = "malformed_long", "executing python handler function");
|
1912 1948 | ::pyo3::Python::with_gil(|py| {
|
1913 1949 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1914 1950 | let output = if handler.args == 1 {
|
1915 1951 | pyhandler.call1((input,))?
|
1916 1952 | } else {
|
1917 1953 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1918 1954 | };
|
1919 1955 | output.extract::<crate::output::MalformedLongOutput>()
|
1920 1956 | })
|
1921 1957 | };
|
1922 1958 | // Catch and record a Python traceback.
|
1923 1959 | result.map_err(|e| {
|
1924 1960 | let rich_py_err =
|
1925 1961 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
1926 1962 | e.clone_ref(py)
|
1927 1963 | }));
|
1928 1964 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
1929 1965 | e.into()
|
1930 1966 | })
|
1931 1967 | }
|
1932 1968 |
|
1969 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
1933 1970 | /// Python handler for operation `MalformedShort`.
|
1934 1971 | pub(crate) async fn malformed_short(
|
1935 1972 | input: crate::input::MalformedShortInput,
|
1936 1973 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
1937 1974 | handler: ::aws_smithy_http_server_python::PyHandler,
|
1938 1975 | ) -> std::result::Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> {
|
1939 1976 | // Async block used to run the handler and catch any Python error.
|
1940 1977 | let result = if handler.is_coroutine {
|
1941 1978 | ::tracing::trace!(
|
1942 1979 | name = "malformed_short",
|
1943 1980 | "executing python handler coroutine"
|
1944 1981 | );
|
1945 1982 | let result = ::pyo3::Python::with_gil(|py| {
|
1946 1983 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1947 1984 | let coroutine = if handler.args == 1 {
|
1948 1985 | pyhandler.call1((input,))?
|
1949 1986 | } else {
|
1950 1987 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1951 1988 | };
|
1952 1989 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
1953 1990 | })?;
|
1954 1991 | result.await.and_then(|r| {
|
1955 1992 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::MalformedShortOutput>(py))
|
1956 1993 | })
|
1957 1994 | } else {
|
1958 1995 | ::tracing::trace!(
|
1959 1996 | name = "malformed_short",
|
1960 1997 | "executing python handler function"
|
1961 1998 | );
|
1962 1999 | ::pyo3::Python::with_gil(|py| {
|
1963 2000 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1964 2001 | let output = if handler.args == 1 {
|
1965 2002 | pyhandler.call1((input,))?
|
1966 2003 | } else {
|
1967 2004 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
1968 2005 | };
|
1969 2006 | output.extract::<crate::output::MalformedShortOutput>()
|
1970 2007 | })
|
1971 2008 | };
|
1972 2009 | // Catch and record a Python traceback.
|
1973 2010 | result.map_err(|e| {
|
1974 2011 | let rich_py_err =
|
1975 2012 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
1976 2013 | e.clone_ref(py)
|
1977 2014 | }));
|
1978 2015 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
1979 2016 | e.into()
|
1980 2017 | })
|
1981 2018 | }
|
1982 2019 |
|
2020 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
1983 2021 | /// Python handler for operation `MalformedByte`.
|
1984 2022 | pub(crate) async fn malformed_byte(
|
1985 2023 | input: crate::input::MalformedByteInput,
|
1986 2024 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
1987 2025 | handler: ::aws_smithy_http_server_python::PyHandler,
|
1988 2026 | ) -> std::result::Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> {
|
1989 2027 | // Async block used to run the handler and catch any Python error.
|
1990 2028 | let result = if handler.is_coroutine {
|
1991 2029 | ::tracing::trace!(
|
1992 2030 | name = "malformed_byte",
|
1993 2031 | "executing python handler coroutine"
|
1994 2032 | );
|
1995 2033 | let result = ::pyo3::Python::with_gil(|py| {
|
1996 2034 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
1997 2035 | let coroutine = if handler.args == 1 {
|
1998 2036 | pyhandler.call1((input,))?
|
1999 2037 | } else {
|
2000 2038 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2001 2039 | };
|
2002 2040 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
2003 2041 | })?;
|
2004 2042 | result.await.and_then(|r| {
|
2005 2043 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::MalformedByteOutput>(py))
|
2006 2044 | })
|
2007 2045 | } else {
|
2008 2046 | ::tracing::trace!(name = "malformed_byte", "executing python handler function");
|
2009 2047 | ::pyo3::Python::with_gil(|py| {
|
2010 2048 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2011 2049 | let output = if handler.args == 1 {
|
2012 2050 | pyhandler.call1((input,))?
|
2013 2051 | } else {
|
2014 2052 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2015 2053 | };
|
2016 2054 | output.extract::<crate::output::MalformedByteOutput>()
|
2017 2055 | })
|
2018 2056 | };
|
2019 2057 | // Catch and record a Python traceback.
|
2020 2058 | result.map_err(|e| {
|
2021 2059 | let rich_py_err =
|
2022 2060 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
2023 2061 | e.clone_ref(py)
|
2024 2062 | }));
|
2025 2063 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
2026 2064 | e.into()
|
2027 2065 | })
|
2028 2066 | }
|
2029 2067 |
|
2068 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
2030 2069 | /// Python handler for operation `MalformedBlob`.
|
2031 2070 | pub(crate) async fn malformed_blob(
|
2032 2071 | input: crate::input::MalformedBlobInput,
|
2033 2072 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
2034 2073 | handler: ::aws_smithy_http_server_python::PyHandler,
|
2035 2074 | ) -> std::result::Result<crate::output::MalformedBlobOutput, crate::error::MalformedBlobError> {
|
2036 2075 | // Async block used to run the handler and catch any Python error.
|
2037 2076 | let result = if handler.is_coroutine {
|
2038 2077 | ::tracing::trace!(
|
2039 2078 | name = "malformed_blob",
|
2040 2079 | "executing python handler coroutine"
|
2041 2080 | );
|
2042 2081 | let result = ::pyo3::Python::with_gil(|py| {
|
2043 2082 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2044 2083 | let coroutine = if handler.args == 1 {
|
2045 2084 | pyhandler.call1((input,))?
|
2046 2085 | } else {
|
2047 2086 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2048 2087 | };
|
2049 2088 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
2050 2089 | })?;
|
2051 2090 | result.await.and_then(|r| {
|
2052 2091 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::MalformedBlobOutput>(py))
|
2053 2092 | })
|
2054 2093 | } else {
|
2055 2094 | ::tracing::trace!(name = "malformed_blob", "executing python handler function");
|
2056 2095 | ::pyo3::Python::with_gil(|py| {
|
2057 2096 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2058 2097 | let output = if handler.args == 1 {
|
2059 2098 | pyhandler.call1((input,))?
|
2060 2099 | } else {
|
2061 2100 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2062 2101 | };
|
2063 2102 | output.extract::<crate::output::MalformedBlobOutput>()
|
2064 2103 | })
|
2065 2104 | };
|
2066 2105 | // Catch and record a Python traceback.
|
2067 2106 | result.map_err(|e| {
|
2068 2107 | let rich_py_err =
|
2069 2108 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
2070 2109 | e.clone_ref(py)
|
2071 2110 | }));
|
2072 2111 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
2073 2112 | e.into()
|
2074 2113 | })
|
2075 2114 | }
|
2076 2115 |
|
2116 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
2077 2117 | /// Python handler for operation `MalformedMap`.
|
2078 2118 | pub(crate) async fn malformed_map(
|
2079 2119 | input: crate::input::MalformedMapInput,
|
2080 2120 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
2081 2121 | handler: ::aws_smithy_http_server_python::PyHandler,
|
2082 2122 | ) -> std::result::Result<crate::output::MalformedMapOutput, crate::error::MalformedMapError> {
|
2083 2123 | // Async block used to run the handler and catch any Python error.
|
2084 2124 | let result = if handler.is_coroutine {
|
2085 2125 | ::tracing::trace!(name = "malformed_map", "executing python handler coroutine");
|
2086 2126 | let result = ::pyo3::Python::with_gil(|py| {
|
2087 2127 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2088 2128 | let coroutine = if handler.args == 1 {
|
2089 2129 | pyhandler.call1((input,))?
|
2090 2130 | } else {
|
2091 2131 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2092 2132 | };
|
2093 2133 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
2094 2134 | })?;
|
2095 2135 | result.await.and_then(|r| {
|
2096 2136 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::MalformedMapOutput>(py))
|
2097 2137 | })
|
2098 2138 | } else {
|
2099 2139 | ::tracing::trace!(name = "malformed_map", "executing python handler function");
|
2100 2140 | ::pyo3::Python::with_gil(|py| {
|
2101 2141 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2102 2142 | let output = if handler.args == 1 {
|
2103 2143 | pyhandler.call1((input,))?
|
2104 2144 | } else {
|
2105 2145 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2106 2146 | };
|
2107 2147 | output.extract::<crate::output::MalformedMapOutput>()
|
2108 2148 | })
|
2109 2149 | };
|
2110 2150 | // Catch and record a Python traceback.
|
2111 2151 | result.map_err(|e| {
|
2112 2152 | let rich_py_err =
|
2113 2153 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
2114 2154 | e.clone_ref(py)
|
2115 2155 | }));
|
2116 2156 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
2117 2157 | e.into()
|
2118 2158 | })
|
2119 2159 | }
|
2120 2160 |
|
2161 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
2121 2162 | /// Python handler for operation `MalformedList`.
|
2122 2163 | pub(crate) async fn malformed_list(
|
2123 2164 | input: crate::input::MalformedListInput,
|
2124 2165 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
2125 2166 | handler: ::aws_smithy_http_server_python::PyHandler,
|
2126 2167 | ) -> std::result::Result<crate::output::MalformedListOutput, crate::error::MalformedListError> {
|
2127 2168 | // Async block used to run the handler and catch any Python error.
|
2128 2169 | let result = if handler.is_coroutine {
|
2129 2170 | ::tracing::trace!(
|
2130 2171 | name = "malformed_list",
|
2131 2172 | "executing python handler coroutine"
|
2132 2173 | );
|
2133 2174 | let result = ::pyo3::Python::with_gil(|py| {
|
2134 2175 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2135 2176 | let coroutine = if handler.args == 1 {
|
2136 2177 | pyhandler.call1((input,))?
|
2137 2178 | } else {
|
2138 2179 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2139 2180 | };
|
2140 2181 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
2141 2182 | })?;
|
2142 2183 | result.await.and_then(|r| {
|
2143 2184 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::MalformedListOutput>(py))
|
2144 2185 | })
|
2145 2186 | } else {
|
2146 2187 | ::tracing::trace!(name = "malformed_list", "executing python handler function");
|
2147 2188 | ::pyo3::Python::with_gil(|py| {
|
2148 2189 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2149 2190 | let output = if handler.args == 1 {
|
2150 2191 | pyhandler.call1((input,))?
|
2151 2192 | } else {
|
2152 2193 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2153 2194 | };
|
2154 2195 | output.extract::<crate::output::MalformedListOutput>()
|
2155 2196 | })
|
2156 2197 | };
|
2157 2198 | // Catch and record a Python traceback.
|
2158 2199 | result.map_err(|e| {
|
2159 2200 | let rich_py_err =
|
2160 2201 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
2161 2202 | e.clone_ref(py)
|
2162 2203 | }));
|
2163 2204 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
2164 2205 | e.into()
|
2165 2206 | })
|
2166 2207 | }
|
2167 2208 |
|
2209 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
2168 2210 | /// Python handler for operation `MalformedBoolean`.
|
2169 2211 | pub(crate) async fn malformed_boolean(
|
2170 2212 | input: crate::input::MalformedBooleanInput,
|
2171 2213 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
2172 2214 | handler: ::aws_smithy_http_server_python::PyHandler,
|
2173 2215 | ) -> std::result::Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError>
|
2174 2216 | {
|
2175 2217 | // Async block used to run the handler and catch any Python error.
|
2176 2218 | let result = if handler.is_coroutine {
|
2177 2219 | ::tracing::trace!(
|
2178 2220 | name = "malformed_boolean",
|
2179 2221 | "executing python handler coroutine"
|
2180 2222 | );
|
2181 2223 | let result = ::pyo3::Python::with_gil(|py| {
|
2182 2224 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2183 2225 | let coroutine = if handler.args == 1 {
|
2184 2226 | pyhandler.call1((input,))?
|
2185 2227 | } else {
|
2186 2228 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2187 2229 | };
|
2188 2230 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
2189 2231 | })?;
|
2190 2232 | result.await.and_then(|r| {
|
2191 2233 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::MalformedBooleanOutput>(py))
|
2192 2234 | })
|
2193 2235 | } else {
|
2194 2236 | ::tracing::trace!(
|
2195 2237 | name = "malformed_boolean",
|
2196 2238 | "executing python handler function"
|
2197 2239 | );
|
2198 2240 | ::pyo3::Python::with_gil(|py| {
|
2199 2241 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2200 2242 | let output = if handler.args == 1 {
|
2201 2243 | pyhandler.call1((input,))?
|
2202 2244 | } else {
|
2203 2245 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2204 2246 | };
|
2205 2247 | output.extract::<crate::output::MalformedBooleanOutput>()
|
2206 2248 | })
|
2207 2249 | };
|
2208 2250 | // Catch and record a Python traceback.
|
2209 2251 | result.map_err(|e| {
|
2210 2252 | let rich_py_err =
|
2211 2253 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
2212 2254 | e.clone_ref(py)
|
2213 2255 | }));
|
2214 2256 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
2215 2257 | e.into()
|
2216 2258 | })
|
2217 2259 | }
|
2218 2260 |
|
2261 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
2219 2262 | /// Python handler for operation `MalformedUnion`.
|
2220 2263 | pub(crate) async fn malformed_union(
|
2221 2264 | input: crate::input::MalformedUnionInput,
|
2222 2265 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
2223 2266 | handler: ::aws_smithy_http_server_python::PyHandler,
|
2224 2267 | ) -> std::result::Result<crate::output::MalformedUnionOutput, crate::error::MalformedUnionError> {
|
2225 2268 | // Async block used to run the handler and catch any Python error.
|
2226 2269 | let result = if handler.is_coroutine {
|
2227 2270 | ::tracing::trace!(
|
2228 2271 | name = "malformed_union",
|
2229 2272 | "executing python handler coroutine"
|
2230 2273 | );
|
2231 2274 | let result = ::pyo3::Python::with_gil(|py| {
|
2232 2275 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2233 2276 | let coroutine = if handler.args == 1 {
|
2234 2277 | pyhandler.call1((input,))?
|
2235 2278 | } else {
|
2236 2279 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2237 2280 | };
|
2238 2281 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
2239 2282 | })?;
|
2240 2283 | result.await.and_then(|r| {
|
2241 2284 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::MalformedUnionOutput>(py))
|
2242 2285 | })
|
2243 2286 | } else {
|
2244 2287 | ::tracing::trace!(
|
2245 2288 | name = "malformed_union",
|
2246 2289 | "executing python handler function"
|
2247 2290 | );
|
2248 2291 | ::pyo3::Python::with_gil(|py| {
|
2249 2292 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2250 2293 | let output = if handler.args == 1 {
|
2251 2294 | pyhandler.call1((input,))?
|
2252 2295 | } else {
|
2253 2296 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2254 2297 | };
|
2255 2298 | output.extract::<crate::output::MalformedUnionOutput>()
|
2256 2299 | })
|
2257 2300 | };
|
2258 2301 | // Catch and record a Python traceback.
|
2259 2302 | result.map_err(|e| {
|
2260 2303 | let rich_py_err =
|
2261 2304 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
2262 2305 | e.clone_ref(py)
|
2263 2306 | }));
|
2264 2307 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
2265 2308 | e.into()
|
2266 2309 | })
|
2267 2310 | }
|
2268 2311 |
|
2312 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
2269 2313 | /// Python handler for operation `MalformedInteger`.
|
2270 2314 | pub(crate) async fn malformed_integer(
|
2271 2315 | input: crate::input::MalformedIntegerInput,
|
2272 2316 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
2273 2317 | handler: ::aws_smithy_http_server_python::PyHandler,
|
2274 2318 | ) -> std::result::Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError>
|
2275 2319 | {
|
2276 2320 | // Async block used to run the handler and catch any Python error.
|
2277 2321 | let result = if handler.is_coroutine {
|
2278 2322 | ::tracing::trace!(
|
2279 2323 | name = "malformed_integer",
|
2280 2324 | "executing python handler coroutine"
|
2281 2325 | );
|
2282 2326 | let result = ::pyo3::Python::with_gil(|py| {
|
2283 2327 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2284 2328 | let coroutine = if handler.args == 1 {
|
2285 2329 | pyhandler.call1((input,))?
|
2286 2330 | } else {
|
2287 2331 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2288 2332 | };
|
2289 2333 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
2290 2334 | })?;
|
2291 2335 | result.await.and_then(|r| {
|
2292 2336 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::MalformedIntegerOutput>(py))
|
2293 2337 | })
|
2294 2338 | } else {
|
2295 2339 | ::tracing::trace!(
|
2296 2340 | name = "malformed_integer",
|
2297 2341 | "executing python handler function"
|
2298 2342 | );
|
2299 2343 | ::pyo3::Python::with_gil(|py| {
|
2300 2344 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2301 2345 | let output = if handler.args == 1 {
|
2302 2346 | pyhandler.call1((input,))?
|
2303 2347 | } else {
|
2304 2348 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2305 2349 | };
|
2306 2350 | output.extract::<crate::output::MalformedIntegerOutput>()
|
2307 2351 | })
|
2308 2352 | };
|
2309 2353 | // Catch and record a Python traceback.
|
2310 2354 | result.map_err(|e| {
|
2311 2355 | let rich_py_err =
|
2312 2356 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
2313 2357 | e.clone_ref(py)
|
2314 2358 | }));
|
2315 2359 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
2316 2360 | e.into()
|
2317 2361 | })
|
2318 2362 | }
|
2319 2363 |
|
2364 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
2320 2365 | /// Python handler for operation `MalformedRequestBody`.
|
2321 2366 | pub(crate) async fn malformed_request_body(
|
2322 2367 | input: crate::input::MalformedRequestBodyInput,
|
2323 2368 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
2324 2369 | handler: ::aws_smithy_http_server_python::PyHandler,
|
2325 2370 | ) -> std::result::Result<
|
2326 2371 | crate::output::MalformedRequestBodyOutput,
|
2327 2372 | crate::error::MalformedRequestBodyError,
|
2328 2373 | > {
|
2329 2374 | // Async block used to run the handler and catch any Python error.
|
2330 2375 | let result = if handler.is_coroutine {
|
2331 2376 | ::tracing::trace!(
|
2332 2377 | name = "malformed_request_body",
|
2333 2378 | "executing python handler coroutine"
|
2334 2379 | );
|
2335 2380 | let result = ::pyo3::Python::with_gil(|py| {
|
2336 2381 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2337 2382 | let coroutine = if handler.args == 1 {
|
2338 2383 | pyhandler.call1((input,))?
|
2339 2384 | } else {
|
2340 2385 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2341 2386 | };
|
2342 2387 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
2343 2388 | })?;
|
2344 2389 | result.await.and_then(|r| {
|
2345 2390 | ::pyo3::Python::with_gil(|py| {
|
2346 2391 | r.extract::<crate::output::MalformedRequestBodyOutput>(py)
|
2347 2392 | })
|
2348 2393 | })
|
2349 2394 | } else {
|
2350 2395 | ::tracing::trace!(
|
2351 2396 | name = "malformed_request_body",
|
2352 2397 | "executing python handler function"
|
2353 2398 | );
|
2354 2399 | ::pyo3::Python::with_gil(|py| {
|
2355 2400 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2356 2401 | let output = if handler.args == 1 {
|
2357 2402 | pyhandler.call1((input,))?
|
2358 2403 | } else {
|
2359 2404 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2360 2405 | };
|
2361 2406 | output.extract::<crate::output::MalformedRequestBodyOutput>()
|
2362 2407 | })
|
2363 2408 | };
|
2364 2409 | // Catch and record a Python traceback.
|
2365 2410 | result.map_err(|e| {
|
2366 2411 | let rich_py_err =
|
2367 2412 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
2368 2413 | e.clone_ref(py)
|
2369 2414 | }));
|
2370 2415 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
2371 2416 | e.into()
|
2372 2417 | })
|
2373 2418 | }
|
2374 2419 |
|
2420 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
2375 2421 | /// Python handler for operation `HttpChecksumRequired`.
|
2376 2422 | pub(crate) async fn http_checksum_required(
|
2377 2423 | input: crate::input::HttpChecksumRequiredInput,
|
2378 2424 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
2379 2425 | handler: ::aws_smithy_http_server_python::PyHandler,
|
2380 2426 | ) -> std::result::Result<
|
2381 2427 | crate::output::HttpChecksumRequiredOutput,
|
2382 2428 | crate::error::HttpChecksumRequiredError,
|
2383 2429 | > {
|
2384 2430 | // Async block used to run the handler and catch any Python error.
|
2385 2431 | let result = if handler.is_coroutine {
|
2386 2432 | ::tracing::trace!(
|
2387 2433 | name = "http_checksum_required",
|
2388 2434 | "executing python handler coroutine"
|
2389 2435 | );
|
2390 2436 | let result = ::pyo3::Python::with_gil(|py| {
|
2391 2437 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2392 2438 | let coroutine = if handler.args == 1 {
|
2393 2439 | pyhandler.call1((input,))?
|
2394 2440 | } else {
|
2395 2441 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2396 2442 | };
|
2397 2443 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
2398 2444 | })?;
|
2399 2445 | result.await.and_then(|r| {
|
2400 2446 | ::pyo3::Python::with_gil(|py| {
|
2401 2447 | r.extract::<crate::output::HttpChecksumRequiredOutput>(py)
|
2402 2448 | })
|
2403 2449 | })
|
2404 2450 | } else {
|
2405 2451 | ::tracing::trace!(
|
2406 2452 | name = "http_checksum_required",
|
2407 2453 | "executing python handler function"
|
2408 2454 | );
|
2409 2455 | ::pyo3::Python::with_gil(|py| {
|
2410 2456 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2411 2457 | let output = if handler.args == 1 {
|
2412 2458 | pyhandler.call1((input,))?
|
2413 2459 | } else {
|
2414 2460 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2415 2461 | };
|
2416 2462 | output.extract::<crate::output::HttpChecksumRequiredOutput>()
|
2417 2463 | })
|
2418 2464 | };
|
2419 2465 | // Catch and record a Python traceback.
|
2420 2466 | result.map_err(|e| {
|
2421 2467 | let rich_py_err =
|
2422 2468 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
2423 2469 | e.clone_ref(py)
|
2424 2470 | }));
|
2425 2471 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
2426 2472 | e.into()
|
2427 2473 | })
|
2428 2474 | }
|
2429 2475 |
|
2476 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
2430 2477 | /// Python handler for operation `HostWithPathOperation`.
|
2431 2478 | pub(crate) async fn host_with_path_operation(
|
2432 2479 | input: crate::input::HostWithPathOperationInput,
|
2433 2480 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
2434 2481 | handler: ::aws_smithy_http_server_python::PyHandler,
|
2435 2482 | ) -> std::result::Result<
|
2436 2483 | crate::output::HostWithPathOperationOutput,
|
2437 2484 | crate::error::HostWithPathOperationError,
|
2438 2485 | > {
|
2439 2486 | // Async block used to run the handler and catch any Python error.
|
2440 2487 | let result = if handler.is_coroutine {
|
2441 2488 | ::tracing::trace!(
|
2442 2489 | name = "host_with_path_operation",
|
2443 2490 | "executing python handler coroutine"
|
2444 2491 | );
|
2445 2492 | let result = ::pyo3::Python::with_gil(|py| {
|
2446 2493 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2447 2494 | let coroutine = if handler.args == 1 {
|
2448 2495 | pyhandler.call1((input,))?
|
2449 2496 | } else {
|
2450 2497 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2451 2498 | };
|
2452 2499 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
2453 2500 | })?;
|
2454 2501 | result.await.and_then(|r| {
|
2455 2502 | ::pyo3::Python::with_gil(|py| {
|
2456 2503 | r.extract::<crate::output::HostWithPathOperationOutput>(py)
|
2457 2504 | })
|
2458 2505 | })
|
2459 2506 | } else {
|
2460 2507 | ::tracing::trace!(
|
2461 2508 | name = "host_with_path_operation",
|
2462 2509 | "executing python handler function"
|
2463 2510 | );
|
2464 2511 | ::pyo3::Python::with_gil(|py| {
|
2465 2512 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2466 2513 | let output = if handler.args == 1 {
|
2467 2514 | pyhandler.call1((input,))?
|
2468 2515 | } else {
|
2469 2516 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2470 2517 | };
|
2471 2518 | output.extract::<crate::output::HostWithPathOperationOutput>()
|
2472 2519 | })
|
2473 2520 | };
|
2474 2521 | // Catch and record a Python traceback.
|
2475 2522 | result.map_err(|e| {
|
2476 2523 | let rich_py_err =
|
2477 2524 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
2478 2525 | e.clone_ref(py)
|
2479 2526 | }));
|
2480 2527 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
2481 2528 | e.into()
|
2482 2529 | })
|
2483 2530 | }
|
2484 2531 |
|
2532 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
2485 2533 | /// Python handler for operation `EndpointWithHostLabelOperation`.
|
2486 2534 | pub(crate) async fn endpoint_with_host_label_operation(
|
2487 2535 | input: crate::input::EndpointWithHostLabelOperationInput,
|
2488 2536 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
2489 2537 | handler: ::aws_smithy_http_server_python::PyHandler,
|
2490 2538 | ) -> std::result::Result<
|
2491 2539 | crate::output::EndpointWithHostLabelOperationOutput,
|
2492 2540 | crate::error::EndpointWithHostLabelOperationError,
|
2493 2541 | > {
|
2494 2542 | // Async block used to run the handler and catch any Python error.
|
2495 2543 | let result = if handler.is_coroutine {
|
2496 2544 | ::tracing::trace!(
|
2497 2545 | name = "endpoint_with_host_label_operation",
|
2498 2546 | "executing python handler coroutine"
|
2499 2547 | );
|
2500 2548 | let result = ::pyo3::Python::with_gil(|py| {
|
2501 2549 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2502 2550 | let coroutine = if handler.args == 1 {
|
2503 2551 | pyhandler.call1((input,))?
|
2504 2552 | } else {
|
2505 2553 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2506 2554 | };
|
2507 2555 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
2508 2556 | })?;
|
2509 2557 | result.await.and_then(|r| {
|
2510 2558 | ::pyo3::Python::with_gil(|py| {
|
2511 2559 | r.extract::<crate::output::EndpointWithHostLabelOperationOutput>(py)
|
2512 2560 | })
|
2513 2561 | })
|
2514 2562 | } else {
|
2515 2563 | ::tracing::trace!(
|
2516 2564 | name = "endpoint_with_host_label_operation",
|
2517 2565 | "executing python handler function"
|
2518 2566 | );
|
2519 2567 | ::pyo3::Python::with_gil(|py| {
|
2520 2568 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2521 2569 | let output = if handler.args == 1 {
|
2522 2570 | pyhandler.call1((input,))?
|
2523 2571 | } else {
|
2524 2572 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2525 2573 | };
|
2526 2574 | output.extract::<crate::output::EndpointWithHostLabelOperationOutput>()
|
2527 2575 | })
|
2528 2576 | };
|
2529 2577 | // Catch and record a Python traceback.
|
2530 2578 | result.map_err(|e| {
|
2531 2579 | let rich_py_err =
|
2532 2580 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
2533 2581 | e.clone_ref(py)
|
2534 2582 | }));
|
2535 2583 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
2536 2584 | e.into()
|
2537 2585 | })
|
2538 2586 | }
|
2539 2587 |
|
2588 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
2540 2589 | /// Python handler for operation `EndpointOperation`.
|
2541 2590 | pub(crate) async fn endpoint_operation(
|
2542 2591 | input: crate::input::EndpointOperationInput,
|
2543 2592 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
2544 2593 | handler: ::aws_smithy_http_server_python::PyHandler,
|
2545 2594 | ) -> std::result::Result<crate::output::EndpointOperationOutput, crate::error::EndpointOperationError>
|
2546 2595 | {
|
2547 2596 | // Async block used to run the handler and catch any Python error.
|
2548 2597 | let result = if handler.is_coroutine {
|
2549 2598 | ::tracing::trace!(
|
2550 2599 | name = "endpoint_operation",
|
2551 2600 | "executing python handler coroutine"
|
2552 2601 | );
|
2553 2602 | let result = ::pyo3::Python::with_gil(|py| {
|
2554 2603 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2555 2604 | let coroutine = if handler.args == 1 {
|
2556 2605 | pyhandler.call1((input,))?
|
2557 2606 | } else {
|
2558 2607 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2559 2608 | };
|
2560 2609 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
2561 2610 | })?;
|
2562 2611 | result.await.and_then(|r| {
|
2563 2612 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::EndpointOperationOutput>(py))
|
2564 2613 | })
|
2565 2614 | } else {
|
2566 2615 | ::tracing::trace!(
|
2567 2616 | name = "endpoint_operation",
|
2568 2617 | "executing python handler function"
|
2569 2618 | );
|
2570 2619 | ::pyo3::Python::with_gil(|py| {
|
2571 2620 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2572 2621 | let output = if handler.args == 1 {
|
2573 2622 | pyhandler.call1((input,))?
|
2574 2623 | } else {
|
2575 2624 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2576 2625 | };
|
2577 2626 | output.extract::<crate::output::EndpointOperationOutput>()
|
2578 2627 | })
|
2579 2628 | };
|
2580 2629 | // Catch and record a Python traceback.
|
2581 2630 | result.map_err(|e| {
|
2582 2631 | let rich_py_err =
|
2583 2632 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
2584 2633 | e.clone_ref(py)
|
2585 2634 | }));
|
2586 2635 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
2587 2636 | e.into()
|
2588 2637 | })
|
2589 2638 | }
|
2590 2639 |
|
2640 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
2591 2641 | /// Python handler for operation `PostUnionWithJsonName`.
|
2592 2642 | pub(crate) async fn post_union_with_json_name(
|
2593 2643 | input: crate::input::PostUnionWithJsonNameInput,
|
2594 2644 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
2595 2645 | handler: ::aws_smithy_http_server_python::PyHandler,
|
2596 2646 | ) -> std::result::Result<
|
2597 2647 | crate::output::PostUnionWithJsonNameOutput,
|
2598 2648 | crate::error::PostUnionWithJsonNameError,
|
2599 2649 | > {
|
2600 2650 | // Async block used to run the handler and catch any Python error.
|
2601 2651 | let result = if handler.is_coroutine {
|
2602 2652 | ::tracing::trace!(
|
2603 2653 | name = "post_union_with_json_name",
|
2604 2654 | "executing python handler coroutine"
|
2605 2655 | );
|
2606 2656 | let result = ::pyo3::Python::with_gil(|py| {
|
2607 2657 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2608 2658 | let coroutine = if handler.args == 1 {
|
2609 2659 | pyhandler.call1((input,))?
|
2610 2660 | } else {
|
2611 2661 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2612 2662 | };
|
2613 2663 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
2614 2664 | })?;
|
2615 2665 | result.await.and_then(|r| {
|
2616 2666 | ::pyo3::Python::with_gil(|py| {
|
2617 2667 | r.extract::<crate::output::PostUnionWithJsonNameOutput>(py)
|
2618 2668 | })
|
2619 2669 | })
|
2620 2670 | } else {
|
2621 2671 | ::tracing::trace!(
|
2622 2672 | name = "post_union_with_json_name",
|
2623 2673 | "executing python handler function"
|
2624 2674 | );
|
2625 2675 | ::pyo3::Python::with_gil(|py| {
|
2626 2676 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2627 2677 | let output = if handler.args == 1 {
|
2628 2678 | pyhandler.call1((input,))?
|
2629 2679 | } else {
|
2630 2680 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2631 2681 | };
|
2632 2682 | output.extract::<crate::output::PostUnionWithJsonNameOutput>()
|
2633 2683 | })
|
2634 2684 | };
|
2635 2685 | // Catch and record a Python traceback.
|
2636 2686 | result.map_err(|e| {
|
2637 2687 | let rich_py_err =
|
2638 2688 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
2639 2689 | e.clone_ref(py)
|
2640 2690 | }));
|
2641 2691 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
2642 2692 | e.into()
|
2643 2693 | })
|
2644 2694 | }
|
2645 2695 |
|
2696 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
2646 2697 | /// Python handler for operation `PostPlayerAction`.
|
2647 2698 | pub(crate) async fn post_player_action(
|
2648 2699 | input: crate::input::PostPlayerActionInput,
|
2649 2700 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
2650 2701 | handler: ::aws_smithy_http_server_python::PyHandler,
|
2651 2702 | ) -> std::result::Result<crate::output::PostPlayerActionOutput, crate::error::PostPlayerActionError>
|
2652 2703 | {
|
2653 2704 | // Async block used to run the handler and catch any Python error.
|
2654 2705 | let result = if handler.is_coroutine {
|
2655 2706 | ::tracing::trace!(
|
2656 2707 | name = "post_player_action",
|
2657 2708 | "executing python handler coroutine"
|
2658 2709 | );
|
2659 2710 | let result = ::pyo3::Python::with_gil(|py| {
|
2660 2711 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2661 2712 | let coroutine = if handler.args == 1 {
|
2662 2713 | pyhandler.call1((input,))?
|
2663 2714 | } else {
|
2664 2715 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2665 2716 | };
|
2666 2717 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
2667 2718 | })?;
|
2668 2719 | result.await.and_then(|r| {
|
2669 2720 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::PostPlayerActionOutput>(py))
|
2670 2721 | })
|
2671 2722 | } else {
|
2672 2723 | ::tracing::trace!(
|
2673 2724 | name = "post_player_action",
|
2674 2725 | "executing python handler function"
|
2675 2726 | );
|
2676 2727 | ::pyo3::Python::with_gil(|py| {
|
2677 2728 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2678 2729 | let output = if handler.args == 1 {
|
2679 2730 | pyhandler.call1((input,))?
|
2680 2731 | } else {
|
2681 2732 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2682 2733 | };
|
2683 2734 | output.extract::<crate::output::PostPlayerActionOutput>()
|
2684 2735 | })
|
2685 2736 | };
|
2686 2737 | // Catch and record a Python traceback.
|
2687 2738 | result.map_err(|e| {
|
2688 2739 | let rich_py_err =
|
2689 2740 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
2690 2741 | e.clone_ref(py)
|
2691 2742 | }));
|
2692 2743 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
2693 2744 | e.into()
|
2694 2745 | })
|
2695 2746 | }
|
2696 2747 |
|
2748 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
2697 2749 | /// Python handler for operation `JsonUnions`.
|
2698 2750 | pub(crate) async fn json_unions(
|
2699 2751 | input: crate::input::JsonUnionsInput,
|
2700 2752 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
2701 2753 | handler: ::aws_smithy_http_server_python::PyHandler,
|
2702 2754 | ) -> std::result::Result<crate::output::JsonUnionsOutput, crate::error::JsonUnionsError> {
|
2703 2755 | // Async block used to run the handler and catch any Python error.
|
2704 2756 | let result = if handler.is_coroutine {
|
2705 2757 | ::tracing::trace!(name = "json_unions", "executing python handler coroutine");
|
2706 2758 | let result = ::pyo3::Python::with_gil(|py| {
|
2707 2759 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2708 2760 | let coroutine = if handler.args == 1 {
|
2709 2761 | pyhandler.call1((input,))?
|
2710 2762 | } else {
|
2711 2763 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2712 2764 | };
|
2713 2765 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
2714 2766 | })?;
|
2715 2767 | result.await.and_then(|r| {
|
2716 2768 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::JsonUnionsOutput>(py))
|
2717 2769 | })
|
2718 2770 | } else {
|
2719 2771 | ::tracing::trace!(name = "json_unions", "executing python handler function");
|
2720 2772 | ::pyo3::Python::with_gil(|py| {
|
2721 2773 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2722 2774 | let output = if handler.args == 1 {
|
2723 2775 | pyhandler.call1((input,))?
|
2724 2776 | } else {
|
2725 2777 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2726 2778 | };
|
2727 2779 | output.extract::<crate::output::JsonUnionsOutput>()
|
2728 2780 | })
|
2729 2781 | };
|
2730 2782 | // Catch and record a Python traceback.
|
2731 2783 | result.map_err(|e| {
|
2732 2784 | let rich_py_err =
|
2733 2785 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
2734 2786 | e.clone_ref(py)
|
2735 2787 | }));
|
2736 2788 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
2737 2789 | e.into()
|
2738 2790 | })
|
2739 2791 | }
|
2740 2792 |
|
2793 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
2741 2794 | /// Python handler for operation `DocumentTypeAsMapValue`.
|
2742 2795 | pub(crate) async fn document_type_as_map_value(
|
2743 2796 | input: crate::input::DocumentTypeAsMapValueInput,
|
2744 2797 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
2745 2798 | handler: ::aws_smithy_http_server_python::PyHandler,
|
2746 2799 | ) -> std::result::Result<
|
2747 2800 | crate::output::DocumentTypeAsMapValueOutput,
|
2748 2801 | crate::error::DocumentTypeAsMapValueError,
|
2749 2802 | > {
|
2750 2803 | // Async block used to run the handler and catch any Python error.
|
2751 2804 | let result = if handler.is_coroutine {
|
2752 2805 | ::tracing::trace!(
|
2753 2806 | name = "document_type_as_map_value",
|
2754 2807 | "executing python handler coroutine"
|
2755 2808 | );
|
2756 2809 | let result = ::pyo3::Python::with_gil(|py| {
|
2757 2810 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2758 2811 | let coroutine = if handler.args == 1 {
|
2759 2812 | pyhandler.call1((input,))?
|
2760 2813 | } else {
|
2761 2814 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2762 2815 | };
|
2763 2816 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
2764 2817 | })?;
|
2765 2818 | result.await.and_then(|r| {
|
2766 2819 | ::pyo3::Python::with_gil(|py| {
|
2767 2820 | r.extract::<crate::output::DocumentTypeAsMapValueOutput>(py)
|
2768 2821 | })
|
2769 2822 | })
|
2770 2823 | } else {
|
2771 2824 | ::tracing::trace!(
|
2772 2825 | name = "document_type_as_map_value",
|
2773 2826 | "executing python handler function"
|
2774 2827 | );
|
2775 2828 | ::pyo3::Python::with_gil(|py| {
|
2776 2829 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2777 2830 | let output = if handler.args == 1 {
|
2778 2831 | pyhandler.call1((input,))?
|
2779 2832 | } else {
|
2780 2833 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2781 2834 | };
|
2782 2835 | output.extract::<crate::output::DocumentTypeAsMapValueOutput>()
|
2783 2836 | })
|
2784 2837 | };
|
2785 2838 | // Catch and record a Python traceback.
|
2786 2839 | result.map_err(|e| {
|
2787 2840 | let rich_py_err =
|
2788 2841 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
2789 2842 | e.clone_ref(py)
|
2790 2843 | }));
|
2791 2844 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
2792 2845 | e.into()
|
2793 2846 | })
|
2794 2847 | }
|
2795 2848 |
|
2849 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
2796 2850 | /// Python handler for operation `DocumentTypeAsPayload`.
|
2797 2851 | pub(crate) async fn document_type_as_payload(
|
2798 2852 | input: crate::input::DocumentTypeAsPayloadInput,
|
2799 2853 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
2800 2854 | handler: ::aws_smithy_http_server_python::PyHandler,
|
2801 2855 | ) -> std::result::Result<
|
2802 2856 | crate::output::DocumentTypeAsPayloadOutput,
|
2803 2857 | crate::error::DocumentTypeAsPayloadError,
|
2804 2858 | > {
|
2805 2859 | // Async block used to run the handler and catch any Python error.
|
2806 2860 | let result = if handler.is_coroutine {
|
2807 2861 | ::tracing::trace!(
|
2808 2862 | name = "document_type_as_payload",
|
2809 2863 | "executing python handler coroutine"
|
2810 2864 | );
|
2811 2865 | let result = ::pyo3::Python::with_gil(|py| {
|
2812 2866 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2813 2867 | let coroutine = if handler.args == 1 {
|
2814 2868 | pyhandler.call1((input,))?
|
2815 2869 | } else {
|
2816 2870 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2817 2871 | };
|
2818 2872 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
2819 2873 | })?;
|
2820 2874 | result.await.and_then(|r| {
|
2821 2875 | ::pyo3::Python::with_gil(|py| {
|
2822 2876 | r.extract::<crate::output::DocumentTypeAsPayloadOutput>(py)
|
2823 2877 | })
|
2824 2878 | })
|
2825 2879 | } else {
|
2826 2880 | ::tracing::trace!(
|
2827 2881 | name = "document_type_as_payload",
|
2828 2882 | "executing python handler function"
|
2829 2883 | );
|
2830 2884 | ::pyo3::Python::with_gil(|py| {
|
2831 2885 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2832 2886 | let output = if handler.args == 1 {
|
2833 2887 | pyhandler.call1((input,))?
|
2834 2888 | } else {
|
2835 2889 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2836 2890 | };
|
2837 2891 | output.extract::<crate::output::DocumentTypeAsPayloadOutput>()
|
2838 2892 | })
|
2839 2893 | };
|
2840 2894 | // Catch and record a Python traceback.
|
2841 2895 | result.map_err(|e| {
|
2842 2896 | let rich_py_err =
|
2843 2897 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
2844 2898 | e.clone_ref(py)
|
2845 2899 | }));
|
2846 2900 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
2847 2901 | e.into()
|
2848 2902 | })
|
2849 2903 | }
|
2850 2904 |
|
2905 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
2851 2906 | /// Python handler for operation `DocumentType`.
|
2852 2907 | pub(crate) async fn document_type(
|
2853 2908 | input: crate::input::DocumentTypeInput,
|
2854 2909 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
2855 2910 | handler: ::aws_smithy_http_server_python::PyHandler,
|
2856 2911 | ) -> std::result::Result<crate::output::DocumentTypeOutput, crate::error::DocumentTypeError> {
|
2857 2912 | // Async block used to run the handler and catch any Python error.
|
2858 2913 | let result = if handler.is_coroutine {
|
2859 2914 | ::tracing::trace!(name = "document_type", "executing python handler coroutine");
|
2860 2915 | let result = ::pyo3::Python::with_gil(|py| {
|
2861 2916 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2862 2917 | let coroutine = if handler.args == 1 {
|
2863 2918 | pyhandler.call1((input,))?
|
2864 2919 | } else {
|
2865 2920 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2866 2921 | };
|
2867 2922 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
2868 2923 | })?;
|
2869 2924 | result.await.and_then(|r| {
|
2870 2925 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::DocumentTypeOutput>(py))
|
2871 2926 | })
|
2872 2927 | } else {
|
2873 2928 | ::tracing::trace!(name = "document_type", "executing python handler function");
|
2874 2929 | ::pyo3::Python::with_gil(|py| {
|
2875 2930 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2876 2931 | let output = if handler.args == 1 {
|
2877 2932 | pyhandler.call1((input,))?
|
2878 2933 | } else {
|
2879 2934 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2880 2935 | };
|
2881 2936 | output.extract::<crate::output::DocumentTypeOutput>()
|
2882 2937 | })
|
2883 2938 | };
|
2884 2939 | // Catch and record a Python traceback.
|
2885 2940 | result.map_err(|e| {
|
2886 2941 | let rich_py_err =
|
2887 2942 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
2888 2943 | e.clone_ref(py)
|
2889 2944 | }));
|
2890 2945 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
2891 2946 | e.into()
|
2892 2947 | })
|
2893 2948 | }
|
2894 2949 |
|
2950 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
2895 2951 | /// Python handler for operation `JsonBlobs`.
|
2896 2952 | pub(crate) async fn json_blobs(
|
2897 2953 | input: crate::input::JsonBlobsInput,
|
2898 2954 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
2899 2955 | handler: ::aws_smithy_http_server_python::PyHandler,
|
2900 2956 | ) -> std::result::Result<crate::output::JsonBlobsOutput, crate::error::JsonBlobsError> {
|
2901 2957 | // Async block used to run the handler and catch any Python error.
|
2902 2958 | let result = if handler.is_coroutine {
|
2903 2959 | ::tracing::trace!(name = "json_blobs", "executing python handler coroutine");
|
2904 2960 | let result = ::pyo3::Python::with_gil(|py| {
|
2905 2961 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2906 2962 | let coroutine = if handler.args == 1 {
|
2907 2963 | pyhandler.call1((input,))?
|
2908 2964 | } else {
|
2909 2965 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2910 2966 | };
|
2911 2967 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
2912 2968 | })?;
|
2913 2969 | result.await.and_then(|r| {
|
2914 2970 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::JsonBlobsOutput>(py))
|
2915 2971 | })
|
2916 2972 | } else {
|
2917 2973 | ::tracing::trace!(name = "json_blobs", "executing python handler function");
|
2918 2974 | ::pyo3::Python::with_gil(|py| {
|
2919 2975 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2920 2976 | let output = if handler.args == 1 {
|
2921 2977 | pyhandler.call1((input,))?
|
2922 2978 | } else {
|
2923 2979 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2924 2980 | };
|
2925 2981 | output.extract::<crate::output::JsonBlobsOutput>()
|
2926 2982 | })
|
2927 2983 | };
|
2928 2984 | // Catch and record a Python traceback.
|
2929 2985 | result.map_err(|e| {
|
2930 2986 | let rich_py_err =
|
2931 2987 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
2932 2988 | e.clone_ref(py)
|
2933 2989 | }));
|
2934 2990 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
2935 2991 | e.into()
|
2936 2992 | })
|
2937 2993 | }
|
2938 2994 |
|
2995 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
2939 2996 | /// Python handler for operation `SparseJsonMaps`.
|
2940 2997 | pub(crate) async fn sparse_json_maps(
|
2941 2998 | input: crate::input::SparseJsonMapsInput,
|
2942 2999 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
2943 3000 | handler: ::aws_smithy_http_server_python::PyHandler,
|
2944 3001 | ) -> std::result::Result<crate::output::SparseJsonMapsOutput, crate::error::SparseJsonMapsError> {
|
2945 3002 | // Async block used to run the handler and catch any Python error.
|
2946 3003 | let result = if handler.is_coroutine {
|
2947 3004 | ::tracing::trace!(
|
2948 3005 | name = "sparse_json_maps",
|
2949 3006 | "executing python handler coroutine"
|
2950 3007 | );
|
2951 3008 | let result = ::pyo3::Python::with_gil(|py| {
|
2952 3009 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2953 3010 | let coroutine = if handler.args == 1 {
|
2954 3011 | pyhandler.call1((input,))?
|
2955 3012 | } else {
|
2956 3013 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2957 3014 | };
|
2958 3015 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
2959 3016 | })?;
|
2960 3017 | result.await.and_then(|r| {
|
2961 3018 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::SparseJsonMapsOutput>(py))
|
2962 3019 | })
|
2963 3020 | } else {
|
2964 3021 | ::tracing::trace!(
|
2965 3022 | name = "sparse_json_maps",
|
2966 3023 | "executing python handler function"
|
2967 3024 | );
|
2968 3025 | ::pyo3::Python::with_gil(|py| {
|
2969 3026 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
2970 3027 | let output = if handler.args == 1 {
|
2971 3028 | pyhandler.call1((input,))?
|
2972 3029 | } else {
|
2973 3030 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
2974 3031 | };
|
2975 3032 | output.extract::<crate::output::SparseJsonMapsOutput>()
|
2976 3033 | })
|
2977 3034 | };
|
2978 3035 | // Catch and record a Python traceback.
|
2979 3036 | result.map_err(|e| {
|
2980 3037 | let rich_py_err =
|
2981 3038 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
2982 3039 | e.clone_ref(py)
|
2983 3040 | }));
|
2984 3041 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
2985 3042 | e.into()
|
2986 3043 | })
|
2987 3044 | }
|
2988 3045 |
|
3046 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
2989 3047 | /// Python handler for operation `JsonMaps`.
|
2990 3048 | pub(crate) async fn json_maps(
|
2991 3049 | input: crate::input::JsonMapsInput,
|
2992 3050 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
2993 3051 | handler: ::aws_smithy_http_server_python::PyHandler,
|
2994 3052 | ) -> std::result::Result<crate::output::JsonMapsOutput, crate::error::JsonMapsError> {
|
2995 3053 | // Async block used to run the handler and catch any Python error.
|
2996 3054 | let result = if handler.is_coroutine {
|
2997 3055 | ::tracing::trace!(name = "json_maps", "executing python handler coroutine");
|
2998 3056 | let result = ::pyo3::Python::with_gil(|py| {
|
2999 3057 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3000 3058 | let coroutine = if handler.args == 1 {
|
3001 3059 | pyhandler.call1((input,))?
|
3002 3060 | } else {
|
3003 3061 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3004 3062 | };
|
3005 3063 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
3006 3064 | })?;
|
3007 3065 | result.await.and_then(|r| {
|
3008 3066 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::JsonMapsOutput>(py))
|
3009 3067 | })
|
3010 3068 | } else {
|
3011 3069 | ::tracing::trace!(name = "json_maps", "executing python handler function");
|
3012 3070 | ::pyo3::Python::with_gil(|py| {
|
3013 3071 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3014 3072 | let output = if handler.args == 1 {
|
3015 3073 | pyhandler.call1((input,))?
|
3016 3074 | } else {
|
3017 3075 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3018 3076 | };
|
3019 3077 | output.extract::<crate::output::JsonMapsOutput>()
|
3020 3078 | })
|
3021 3079 | };
|
3022 3080 | // Catch and record a Python traceback.
|
3023 3081 | result.map_err(|e| {
|
3024 3082 | let rich_py_err =
|
3025 3083 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
3026 3084 | e.clone_ref(py)
|
3027 3085 | }));
|
3028 3086 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
3029 3087 | e.into()
|
3030 3088 | })
|
3031 3089 | }
|
3032 3090 |
|
3091 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
3033 3092 | /// Python handler for operation `SparseJsonLists`.
|
3034 3093 | pub(crate) async fn sparse_json_lists(
|
3035 3094 | input: crate::input::SparseJsonListsInput,
|
3036 3095 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
3037 3096 | handler: ::aws_smithy_http_server_python::PyHandler,
|
3038 3097 | ) -> std::result::Result<crate::output::SparseJsonListsOutput, crate::error::SparseJsonListsError> {
|
3039 3098 | // Async block used to run the handler and catch any Python error.
|
3040 3099 | let result = if handler.is_coroutine {
|
3041 3100 | ::tracing::trace!(
|
3042 3101 | name = "sparse_json_lists",
|
3043 3102 | "executing python handler coroutine"
|
3044 3103 | );
|
3045 3104 | let result = ::pyo3::Python::with_gil(|py| {
|
3046 3105 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3047 3106 | let coroutine = if handler.args == 1 {
|
3048 3107 | pyhandler.call1((input,))?
|
3049 3108 | } else {
|
3050 3109 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3051 3110 | };
|
3052 3111 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
3053 3112 | })?;
|
3054 3113 | result.await.and_then(|r| {
|
3055 3114 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::SparseJsonListsOutput>(py))
|
3056 3115 | })
|
3057 3116 | } else {
|
3058 3117 | ::tracing::trace!(
|
3059 3118 | name = "sparse_json_lists",
|
3060 3119 | "executing python handler function"
|
3061 3120 | );
|
3062 3121 | ::pyo3::Python::with_gil(|py| {
|
3063 3122 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3064 3123 | let output = if handler.args == 1 {
|
3065 3124 | pyhandler.call1((input,))?
|
3066 3125 | } else {
|
3067 3126 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3068 3127 | };
|
3069 3128 | output.extract::<crate::output::SparseJsonListsOutput>()
|
3070 3129 | })
|
3071 3130 | };
|
3072 3131 | // Catch and record a Python traceback.
|
3073 3132 | result.map_err(|e| {
|
3074 3133 | let rich_py_err =
|
3075 3134 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
3076 3135 | e.clone_ref(py)
|
3077 3136 | }));
|
3078 3137 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
3079 3138 | e.into()
|
3080 3139 | })
|
3081 3140 | }
|
3082 3141 |
|
3142 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
3083 3143 | /// Python handler for operation `JsonLists`.
|
3084 3144 | pub(crate) async fn json_lists(
|
3085 3145 | input: crate::input::JsonListsInput,
|
3086 3146 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
3087 3147 | handler: ::aws_smithy_http_server_python::PyHandler,
|
3088 3148 | ) -> std::result::Result<crate::output::JsonListsOutput, crate::error::JsonListsError> {
|
3089 3149 | // Async block used to run the handler and catch any Python error.
|
3090 3150 | let result = if handler.is_coroutine {
|
3091 3151 | ::tracing::trace!(name = "json_lists", "executing python handler coroutine");
|
3092 3152 | let result = ::pyo3::Python::with_gil(|py| {
|
3093 3153 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3094 3154 | let coroutine = if handler.args == 1 {
|
3095 3155 | pyhandler.call1((input,))?
|
3096 3156 | } else {
|
3097 3157 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3098 3158 | };
|
3099 3159 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
3100 3160 | })?;
|
3101 3161 | result.await.and_then(|r| {
|
3102 3162 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::JsonListsOutput>(py))
|
3103 3163 | })
|
3104 3164 | } else {
|
3105 3165 | ::tracing::trace!(name = "json_lists", "executing python handler function");
|
3106 3166 | ::pyo3::Python::with_gil(|py| {
|
3107 3167 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3108 3168 | let output = if handler.args == 1 {
|
3109 3169 | pyhandler.call1((input,))?
|
3110 3170 | } else {
|
3111 3171 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3112 3172 | };
|
3113 3173 | output.extract::<crate::output::JsonListsOutput>()
|
3114 3174 | })
|
3115 3175 | };
|
3116 3176 | // Catch and record a Python traceback.
|
3117 3177 | result.map_err(|e| {
|
3118 3178 | let rich_py_err =
|
3119 3179 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
3120 3180 | e.clone_ref(py)
|
3121 3181 | }));
|
3122 3182 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
3123 3183 | e.into()
|
3124 3184 | })
|
3125 3185 | }
|
3126 3186 |
|
3187 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
3127 3188 | /// Python handler for operation `RecursiveShapes`.
|
3128 3189 | pub(crate) async fn recursive_shapes(
|
3129 3190 | input: crate::input::RecursiveShapesInput,
|
3130 3191 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
3131 3192 | handler: ::aws_smithy_http_server_python::PyHandler,
|
3132 3193 | ) -> std::result::Result<crate::output::RecursiveShapesOutput, crate::error::RecursiveShapesError> {
|
3133 3194 | // Async block used to run the handler and catch any Python error.
|
3134 3195 | let result = if handler.is_coroutine {
|
3135 3196 | ::tracing::trace!(
|
3136 3197 | name = "recursive_shapes",
|
3137 3198 | "executing python handler coroutine"
|
3138 3199 | );
|
3139 3200 | let result = ::pyo3::Python::with_gil(|py| {
|
3140 3201 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3141 3202 | let coroutine = if handler.args == 1 {
|
3142 3203 | pyhandler.call1((input,))?
|
3143 3204 | } else {
|
3144 3205 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3145 3206 | };
|
3146 3207 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
3147 3208 | })?;
|
3148 3209 | result.await.and_then(|r| {
|
3149 3210 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::RecursiveShapesOutput>(py))
|
3150 3211 | })
|
3151 3212 | } else {
|
3152 3213 | ::tracing::trace!(
|
3153 3214 | name = "recursive_shapes",
|
3154 3215 | "executing python handler function"
|
3155 3216 | );
|
3156 3217 | ::pyo3::Python::with_gil(|py| {
|
3157 3218 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3158 3219 | let output = if handler.args == 1 {
|
3159 3220 | pyhandler.call1((input,))?
|
3160 3221 | } else {
|
3161 3222 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3162 3223 | };
|
3163 3224 | output.extract::<crate::output::RecursiveShapesOutput>()
|
3164 3225 | })
|
3165 3226 | };
|
3166 3227 | // Catch and record a Python traceback.
|
3167 3228 | result.map_err(|e| {
|
3168 3229 | let rich_py_err =
|
3169 3230 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
3170 3231 | e.clone_ref(py)
|
3171 3232 | }));
|
3172 3233 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
3173 3234 | e.into()
|
3174 3235 | })
|
3175 3236 | }
|
3176 3237 |
|
3238 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
3177 3239 | /// Python handler for operation `JsonIntEnums`.
|
3178 3240 | pub(crate) async fn json_int_enums(
|
3179 3241 | input: crate::input::JsonIntEnumsInput,
|
3180 3242 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
3181 3243 | handler: ::aws_smithy_http_server_python::PyHandler,
|
3182 3244 | ) -> std::result::Result<crate::output::JsonIntEnumsOutput, crate::error::JsonIntEnumsError> {
|
3183 3245 | // Async block used to run the handler and catch any Python error.
|
3184 3246 | let result = if handler.is_coroutine {
|
3185 3247 | ::tracing::trace!(
|
3186 3248 | name = "json_int_enums",
|
3187 3249 | "executing python handler coroutine"
|
3188 3250 | );
|
3189 3251 | let result = ::pyo3::Python::with_gil(|py| {
|
3190 3252 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3191 3253 | let coroutine = if handler.args == 1 {
|
3192 3254 | pyhandler.call1((input,))?
|
3193 3255 | } else {
|
3194 3256 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3195 3257 | };
|
3196 3258 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
3197 3259 | })?;
|
3198 3260 | result.await.and_then(|r| {
|
3199 3261 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::JsonIntEnumsOutput>(py))
|
3200 3262 | })
|
3201 3263 | } else {
|
3202 3264 | ::tracing::trace!(name = "json_int_enums", "executing python handler function");
|
3203 3265 | ::pyo3::Python::with_gil(|py| {
|
3204 3266 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3205 3267 | let output = if handler.args == 1 {
|
3206 3268 | pyhandler.call1((input,))?
|
3207 3269 | } else {
|
3208 3270 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3209 3271 | };
|
3210 3272 | output.extract::<crate::output::JsonIntEnumsOutput>()
|
3211 3273 | })
|
3212 3274 | };
|
3213 3275 | // Catch and record a Python traceback.
|
3214 3276 | result.map_err(|e| {
|
3215 3277 | let rich_py_err =
|
3216 3278 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
3217 3279 | e.clone_ref(py)
|
3218 3280 | }));
|
3219 3281 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
3220 3282 | e.into()
|
3221 3283 | })
|
3222 3284 | }
|
3223 3285 |
|
3286 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
3224 3287 | /// Python handler for operation `JsonEnums`.
|
3225 3288 | pub(crate) async fn json_enums(
|
3226 3289 | input: crate::input::JsonEnumsInput,
|
3227 3290 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
3228 3291 | handler: ::aws_smithy_http_server_python::PyHandler,
|
3229 3292 | ) -> std::result::Result<crate::output::JsonEnumsOutput, crate::error::JsonEnumsError> {
|
3230 3293 | // Async block used to run the handler and catch any Python error.
|
3231 3294 | let result = if handler.is_coroutine {
|
3232 3295 | ::tracing::trace!(name = "json_enums", "executing python handler coroutine");
|
3233 3296 | let result = ::pyo3::Python::with_gil(|py| {
|
3234 3297 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3235 3298 | let coroutine = if handler.args == 1 {
|
3236 3299 | pyhandler.call1((input,))?
|
3237 3300 | } else {
|
3238 3301 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3239 3302 | };
|
3240 3303 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
3241 3304 | })?;
|
3242 3305 | result.await.and_then(|r| {
|
3243 3306 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::JsonEnumsOutput>(py))
|
3244 3307 | })
|
3245 3308 | } else {
|
3246 3309 | ::tracing::trace!(name = "json_enums", "executing python handler function");
|
3247 3310 | ::pyo3::Python::with_gil(|py| {
|
3248 3311 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3249 3312 | let output = if handler.args == 1 {
|
3250 3313 | pyhandler.call1((input,))?
|
3251 3314 | } else {
|
3252 3315 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3253 3316 | };
|
3254 3317 | output.extract::<crate::output::JsonEnumsOutput>()
|
3255 3318 | })
|
3256 3319 | };
|
3257 3320 | // Catch and record a Python traceback.
|
3258 3321 | result.map_err(|e| {
|
3259 3322 | let rich_py_err =
|
3260 3323 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
3261 3324 | e.clone_ref(py)
|
3262 3325 | }));
|
3263 3326 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
3264 3327 | e.into()
|
3265 3328 | })
|
3266 3329 | }
|
3267 3330 |
|
3331 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
3268 3332 | /// Python handler for operation `JsonTimestamps`.
|
3269 3333 | pub(crate) async fn json_timestamps(
|
3270 3334 | input: crate::input::JsonTimestampsInput,
|
3271 3335 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
3272 3336 | handler: ::aws_smithy_http_server_python::PyHandler,
|
3273 3337 | ) -> std::result::Result<crate::output::JsonTimestampsOutput, crate::error::JsonTimestampsError> {
|
3274 3338 | // Async block used to run the handler and catch any Python error.
|
3275 3339 | let result = if handler.is_coroutine {
|
3276 3340 | ::tracing::trace!(
|
3277 3341 | name = "json_timestamps",
|
3278 3342 | "executing python handler coroutine"
|
3279 3343 | );
|
3280 3344 | let result = ::pyo3::Python::with_gil(|py| {
|
3281 3345 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3282 3346 | let coroutine = if handler.args == 1 {
|
3283 3347 | pyhandler.call1((input,))?
|
3284 3348 | } else {
|
3285 3349 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3286 3350 | };
|
3287 3351 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
3288 3352 | })?;
|
3289 3353 | result.await.and_then(|r| {
|
3290 3354 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::JsonTimestampsOutput>(py))
|
3291 3355 | })
|
3292 3356 | } else {
|
3293 3357 | ::tracing::trace!(
|
3294 3358 | name = "json_timestamps",
|
3295 3359 | "executing python handler function"
|
3296 3360 | );
|
3297 3361 | ::pyo3::Python::with_gil(|py| {
|
3298 3362 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3299 3363 | let output = if handler.args == 1 {
|
3300 3364 | pyhandler.call1((input,))?
|
3301 3365 | } else {
|
3302 3366 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3303 3367 | };
|
3304 3368 | output.extract::<crate::output::JsonTimestampsOutput>()
|
3305 3369 | })
|
3306 3370 | };
|
3307 3371 | // Catch and record a Python traceback.
|
3308 3372 | result.map_err(|e| {
|
3309 3373 | let rich_py_err =
|
3310 3374 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
3311 3375 | e.clone_ref(py)
|
3312 3376 | }));
|
3313 3377 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
3314 3378 | e.into()
|
3315 3379 | })
|
3316 3380 | }
|
3317 3381 |
|
3382 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
3318 3383 | /// Python handler for operation `SimpleScalarProperties`.
|
3319 3384 | pub(crate) async fn simple_scalar_properties(
|
3320 3385 | input: crate::input::SimpleScalarPropertiesInput,
|
3321 3386 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
3322 3387 | handler: ::aws_smithy_http_server_python::PyHandler,
|
3323 3388 | ) -> std::result::Result<
|
3324 3389 | crate::output::SimpleScalarPropertiesOutput,
|
3325 3390 | crate::error::SimpleScalarPropertiesError,
|
3326 3391 | > {
|
3327 3392 | // Async block used to run the handler and catch any Python error.
|
3328 3393 | let result = if handler.is_coroutine {
|
3329 3394 | ::tracing::trace!(
|
3330 3395 | name = "simple_scalar_properties",
|
3331 3396 | "executing python handler coroutine"
|
3332 3397 | );
|
3333 3398 | let result = ::pyo3::Python::with_gil(|py| {
|
3334 3399 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3335 3400 | let coroutine = if handler.args == 1 {
|
3336 3401 | pyhandler.call1((input,))?
|
3337 3402 | } else {
|
3338 3403 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3339 3404 | };
|
3340 3405 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
3341 3406 | })?;
|
3342 3407 | result.await.and_then(|r| {
|
3343 3408 | ::pyo3::Python::with_gil(|py| {
|
3344 3409 | r.extract::<crate::output::SimpleScalarPropertiesOutput>(py)
|
3345 3410 | })
|
3346 3411 | })
|
3347 3412 | } else {
|
3348 3413 | ::tracing::trace!(
|
3349 3414 | name = "simple_scalar_properties",
|
3350 3415 | "executing python handler function"
|
3351 3416 | );
|
3352 3417 | ::pyo3::Python::with_gil(|py| {
|
3353 3418 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3354 3419 | let output = if handler.args == 1 {
|
3355 3420 | pyhandler.call1((input,))?
|
3356 3421 | } else {
|
3357 3422 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3358 3423 | };
|
3359 3424 | output.extract::<crate::output::SimpleScalarPropertiesOutput>()
|
3360 3425 | })
|
3361 3426 | };
|
3362 3427 | // Catch and record a Python traceback.
|
3363 3428 | result.map_err(|e| {
|
3364 3429 | let rich_py_err =
|
3365 3430 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
3366 3431 | e.clone_ref(py)
|
3367 3432 | }));
|
3368 3433 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
3369 3434 | e.into()
|
3370 3435 | })
|
3371 3436 | }
|
3372 3437 |
|
3438 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
3373 3439 | /// Python handler for operation `GreetingWithErrors`.
|
3374 3440 | pub(crate) async fn greeting_with_errors(
|
3375 3441 | input: crate::input::GreetingWithErrorsInput,
|
3376 3442 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
3377 3443 | handler: ::aws_smithy_http_server_python::PyHandler,
|
3378 3444 | ) -> std::result::Result<
|
3379 3445 | crate::output::GreetingWithErrorsOutput,
|
3380 3446 | crate::error::GreetingWithErrorsError,
|
3381 3447 | > {
|
3382 3448 | // Async block used to run the handler and catch any Python error.
|
3383 3449 | let result = if handler.is_coroutine {
|
3384 3450 | ::tracing::trace!(
|
3385 3451 | name = "greeting_with_errors",
|
3386 3452 | "executing python handler coroutine"
|
3387 3453 | );
|
3388 3454 | let result = ::pyo3::Python::with_gil(|py| {
|
3389 3455 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3390 3456 | let coroutine = if handler.args == 1 {
|
3391 3457 | pyhandler.call1((input,))?
|
3392 3458 | } else {
|
3393 3459 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3394 3460 | };
|
3395 3461 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
3396 3462 | })?;
|
3397 3463 | result.await.and_then(|r| {
|
3398 3464 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::GreetingWithErrorsOutput>(py))
|
3399 3465 | })
|
3400 3466 | } else {
|
3401 3467 | ::tracing::trace!(
|
3402 3468 | name = "greeting_with_errors",
|
3403 3469 | "executing python handler function"
|
3404 3470 | );
|
3405 3471 | ::pyo3::Python::with_gil(|py| {
|
3406 3472 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3407 3473 | let output = if handler.args == 1 {
|
3408 3474 | pyhandler.call1((input,))?
|
3409 3475 | } else {
|
3410 3476 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3411 3477 | };
|
3412 3478 | output.extract::<crate::output::GreetingWithErrorsOutput>()
|
3413 3479 | })
|
3414 3480 | };
|
3415 3481 | // Catch and record a Python traceback.
|
3416 3482 | result.map_err(|e| {
|
3417 3483 | let rich_py_err =
|
3418 3484 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
3419 3485 | e.clone_ref(py)
|
3420 3486 | }));
|
3421 3487 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
3422 3488 | e.into()
|
3423 3489 | })
|
3424 3490 | }
|
3425 3491 |
|
3492 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
3426 3493 | /// Python handler for operation `StreamingTraitsWithMediaType`.
|
3427 3494 | pub(crate) async fn streaming_traits_with_media_type(
|
3428 3495 | input: crate::input::StreamingTraitsWithMediaTypeInput,
|
3429 3496 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
3430 3497 | handler: ::aws_smithy_http_server_python::PyHandler,
|
3431 3498 | ) -> std::result::Result<
|
3432 3499 | crate::output::StreamingTraitsWithMediaTypeOutput,
|
3433 3500 | crate::error::StreamingTraitsWithMediaTypeError,
|
3434 3501 | > {
|
3435 3502 | // Async block used to run the handler and catch any Python error.
|
3436 3503 | let result = if handler.is_coroutine {
|
3437 3504 | ::tracing::trace!(
|
3438 3505 | name = "streaming_traits_with_media_type",
|
3439 3506 | "executing python handler coroutine"
|
3440 3507 | );
|
3441 3508 | let result = ::pyo3::Python::with_gil(|py| {
|
3442 3509 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3443 3510 | let coroutine = if handler.args == 1 {
|
3444 3511 | pyhandler.call1((input,))?
|
3445 3512 | } else {
|
3446 3513 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3447 3514 | };
|
3448 3515 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
3449 3516 | })?;
|
3450 3517 | result.await.and_then(|r| {
|
3451 3518 | ::pyo3::Python::with_gil(|py| {
|
3452 3519 | r.extract::<crate::output::StreamingTraitsWithMediaTypeOutput>(py)
|
3453 3520 | })
|
3454 3521 | })
|
3455 3522 | } else {
|
3456 3523 | ::tracing::trace!(
|
3457 3524 | name = "streaming_traits_with_media_type",
|
3458 3525 | "executing python handler function"
|
3459 3526 | );
|
3460 3527 | ::pyo3::Python::with_gil(|py| {
|
3461 3528 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3462 3529 | let output = if handler.args == 1 {
|
3463 3530 | pyhandler.call1((input,))?
|
3464 3531 | } else {
|
3465 3532 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3466 3533 | };
|
3467 3534 | output.extract::<crate::output::StreamingTraitsWithMediaTypeOutput>()
|
3468 3535 | })
|
3469 3536 | };
|
3470 3537 | // Catch and record a Python traceback.
|
3471 3538 | result.map_err(|e| {
|
3472 3539 | let rich_py_err =
|
3473 3540 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
3474 3541 | e.clone_ref(py)
|
3475 3542 | }));
|
3476 3543 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
3477 3544 | e.into()
|
3478 3545 | })
|
3479 3546 | }
|
3480 3547 |
|
3548 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
3481 3549 | /// Python handler for operation `StreamingTraitsRequireLength`.
|
3482 3550 | pub(crate) async fn streaming_traits_require_length(
|
3483 3551 | input: crate::input::StreamingTraitsRequireLengthInput,
|
3484 3552 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
3485 3553 | handler: ::aws_smithy_http_server_python::PyHandler,
|
3486 3554 | ) -> std::result::Result<
|
3487 3555 | crate::output::StreamingTraitsRequireLengthOutput,
|
3488 3556 | crate::error::StreamingTraitsRequireLengthError,
|
3489 3557 | > {
|
3490 3558 | // Async block used to run the handler and catch any Python error.
|
3491 3559 | let result = if handler.is_coroutine {
|
3492 3560 | ::tracing::trace!(
|
3493 3561 | name = "streaming_traits_require_length",
|
3494 3562 | "executing python handler coroutine"
|
3495 3563 | );
|
3496 3564 | let result = ::pyo3::Python::with_gil(|py| {
|
3497 3565 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3498 3566 | let coroutine = if handler.args == 1 {
|
3499 3567 | pyhandler.call1((input,))?
|
3500 3568 | } else {
|
3501 3569 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3502 3570 | };
|
3503 3571 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
3504 3572 | })?;
|
3505 3573 | result.await.and_then(|r| {
|
3506 3574 | ::pyo3::Python::with_gil(|py| {
|
3507 3575 | r.extract::<crate::output::StreamingTraitsRequireLengthOutput>(py)
|
3508 3576 | })
|
3509 3577 | })
|
3510 3578 | } else {
|
3511 3579 | ::tracing::trace!(
|
3512 3580 | name = "streaming_traits_require_length",
|
3513 3581 | "executing python handler function"
|
3514 3582 | );
|
3515 3583 | ::pyo3::Python::with_gil(|py| {
|
3516 3584 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3517 3585 | let output = if handler.args == 1 {
|
3518 3586 | pyhandler.call1((input,))?
|
3519 3587 | } else {
|
3520 3588 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3521 3589 | };
|
3522 3590 | output.extract::<crate::output::StreamingTraitsRequireLengthOutput>()
|
3523 3591 | })
|
3524 3592 | };
|
3525 3593 | // Catch and record a Python traceback.
|
3526 3594 | result.map_err(|e| {
|
3527 3595 | let rich_py_err =
|
3528 3596 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
3529 3597 | e.clone_ref(py)
|
3530 3598 | }));
|
3531 3599 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
3532 3600 | e.into()
|
3533 3601 | })
|
3534 3602 | }
|
3535 3603 |
|
3604 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
3536 3605 | /// Python handler for operation `StreamingTraits`.
|
3537 3606 | pub(crate) async fn streaming_traits(
|
3538 3607 | input: crate::input::StreamingTraitsInput,
|
3539 3608 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
3540 3609 | handler: ::aws_smithy_http_server_python::PyHandler,
|
3541 3610 | ) -> std::result::Result<crate::output::StreamingTraitsOutput, crate::error::StreamingTraitsError> {
|
3542 3611 | // Async block used to run the handler and catch any Python error.
|
3543 3612 | let result = if handler.is_coroutine {
|
3544 3613 | ::tracing::trace!(
|
3545 3614 | name = "streaming_traits",
|
3546 3615 | "executing python handler coroutine"
|
3547 3616 | );
|
3548 3617 | let result = ::pyo3::Python::with_gil(|py| {
|
3549 3618 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3550 3619 | let coroutine = if handler.args == 1 {
|
3551 3620 | pyhandler.call1((input,))?
|
3552 3621 | } else {
|
3553 3622 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3554 3623 | };
|
3555 3624 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
3556 3625 | })?;
|
3557 3626 | result.await.and_then(|r| {
|
3558 3627 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::StreamingTraitsOutput>(py))
|
3559 3628 | })
|
3560 3629 | } else {
|
3561 3630 | ::tracing::trace!(
|
3562 3631 | name = "streaming_traits",
|
3563 3632 | "executing python handler function"
|
3564 3633 | );
|
3565 3634 | ::pyo3::Python::with_gil(|py| {
|
3566 3635 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3567 3636 | let output = if handler.args == 1 {
|
3568 3637 | pyhandler.call1((input,))?
|
3569 3638 | } else {
|
3570 3639 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3571 3640 | };
|
3572 3641 | output.extract::<crate::output::StreamingTraitsOutput>()
|
3573 3642 | })
|
3574 3643 | };
|
3575 3644 | // Catch and record a Python traceback.
|
3576 3645 | result.map_err(|e| {
|
3577 3646 | let rich_py_err =
|
3578 3647 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
3579 3648 | e.clone_ref(py)
|
3580 3649 | }));
|
3581 3650 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
3582 3651 | e.into()
|
3583 3652 | })
|
3584 3653 | }
|
3585 3654 |
|
3655 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
3586 3656 | /// Python handler for operation `HttpResponseCode`.
|
3587 3657 | pub(crate) async fn http_response_code(
|
3588 3658 | input: crate::input::HttpResponseCodeInput,
|
3589 3659 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
3590 3660 | handler: ::aws_smithy_http_server_python::PyHandler,
|
3591 3661 | ) -> std::result::Result<crate::output::HttpResponseCodeOutput, crate::error::HttpResponseCodeError>
|
3592 3662 | {
|
3593 3663 | // Async block used to run the handler and catch any Python error.
|
3594 3664 | let result = if handler.is_coroutine {
|
3595 3665 | ::tracing::trace!(
|
3596 3666 | name = "http_response_code",
|
3597 3667 | "executing python handler coroutine"
|
3598 3668 | );
|
3599 3669 | let result = ::pyo3::Python::with_gil(|py| {
|
3600 3670 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3601 3671 | let coroutine = if handler.args == 1 {
|
3602 3672 | pyhandler.call1((input,))?
|
3603 3673 | } else {
|
3604 3674 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3605 3675 | };
|
3606 3676 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
3607 3677 | })?;
|
3608 3678 | result.await.and_then(|r| {
|
3609 3679 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::HttpResponseCodeOutput>(py))
|
3610 3680 | })
|
3611 3681 | } else {
|
3612 3682 | ::tracing::trace!(
|
3613 3683 | name = "http_response_code",
|
3614 3684 | "executing python handler function"
|
3615 3685 | );
|
3616 3686 | ::pyo3::Python::with_gil(|py| {
|
3617 3687 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3618 3688 | let output = if handler.args == 1 {
|
3619 3689 | pyhandler.call1((input,))?
|
3620 3690 | } else {
|
3621 3691 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3622 3692 | };
|
3623 3693 | output.extract::<crate::output::HttpResponseCodeOutput>()
|
3624 3694 | })
|
3625 3695 | };
|
3626 3696 | // Catch and record a Python traceback.
|
3627 3697 | result.map_err(|e| {
|
3628 3698 | let rich_py_err =
|
3629 3699 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
3630 3700 | e.clone_ref(py)
|
3631 3701 | }));
|
3632 3702 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
3633 3703 | e.into()
|
3634 3704 | })
|
3635 3705 | }
|
3636 3706 |
|
3707 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
3637 3708 | /// Python handler for operation `HttpPayloadWithUnion`.
|
3638 3709 | pub(crate) async fn http_payload_with_union(
|
3639 3710 | input: crate::input::HttpPayloadWithUnionInput,
|
3640 3711 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
3641 3712 | handler: ::aws_smithy_http_server_python::PyHandler,
|
3642 3713 | ) -> std::result::Result<
|
3643 3714 | crate::output::HttpPayloadWithUnionOutput,
|
3644 3715 | crate::error::HttpPayloadWithUnionError,
|
3645 3716 | > {
|
3646 3717 | // Async block used to run the handler and catch any Python error.
|
3647 3718 | let result = if handler.is_coroutine {
|
3648 3719 | ::tracing::trace!(
|
3649 3720 | name = "http_payload_with_union",
|
3650 3721 | "executing python handler coroutine"
|
3651 3722 | );
|
3652 3723 | let result = ::pyo3::Python::with_gil(|py| {
|
3653 3724 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3654 3725 | let coroutine = if handler.args == 1 {
|
3655 3726 | pyhandler.call1((input,))?
|
3656 3727 | } else {
|
3657 3728 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3658 3729 | };
|
3659 3730 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
3660 3731 | })?;
|
3661 3732 | result.await.and_then(|r| {
|
3662 3733 | ::pyo3::Python::with_gil(|py| {
|
3663 3734 | r.extract::<crate::output::HttpPayloadWithUnionOutput>(py)
|
3664 3735 | })
|
3665 3736 | })
|
3666 3737 | } else {
|
3667 3738 | ::tracing::trace!(
|
3668 3739 | name = "http_payload_with_union",
|
3669 3740 | "executing python handler function"
|
3670 3741 | );
|
3671 3742 | ::pyo3::Python::with_gil(|py| {
|
3672 3743 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3673 3744 | let output = if handler.args == 1 {
|
3674 3745 | pyhandler.call1((input,))?
|
3675 3746 | } else {
|
3676 3747 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3677 3748 | };
|
3678 3749 | output.extract::<crate::output::HttpPayloadWithUnionOutput>()
|
3679 3750 | })
|
3680 3751 | };
|
3681 3752 | // Catch and record a Python traceback.
|
3682 3753 | result.map_err(|e| {
|
3683 3754 | let rich_py_err =
|
3684 3755 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
3685 3756 | e.clone_ref(py)
|
3686 3757 | }));
|
3687 3758 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
3688 3759 | e.into()
|
3689 3760 | })
|
3690 3761 | }
|
3691 3762 |
|
3763 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
3692 3764 | /// Python handler for operation `HttpStringPayload`.
|
3693 3765 | pub(crate) async fn http_string_payload(
|
3694 3766 | input: crate::input::HttpStringPayloadInput,
|
3695 3767 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
3696 3768 | handler: ::aws_smithy_http_server_python::PyHandler,
|
3697 3769 | ) -> std::result::Result<crate::output::HttpStringPayloadOutput, crate::error::HttpStringPayloadError>
|
3698 3770 | {
|
3699 3771 | // Async block used to run the handler and catch any Python error.
|
3700 3772 | let result = if handler.is_coroutine {
|
3701 3773 | ::tracing::trace!(
|
3702 3774 | name = "http_string_payload",
|
3703 3775 | "executing python handler coroutine"
|
3704 3776 | );
|
3705 3777 | let result = ::pyo3::Python::with_gil(|py| {
|
3706 3778 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3707 3779 | let coroutine = if handler.args == 1 {
|
3708 3780 | pyhandler.call1((input,))?
|
3709 3781 | } else {
|
3710 3782 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3711 3783 | };
|
3712 3784 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
3713 3785 | })?;
|
3714 3786 | result.await.and_then(|r| {
|
3715 3787 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::HttpStringPayloadOutput>(py))
|
3716 3788 | })
|
3717 3789 | } else {
|
3718 3790 | ::tracing::trace!(
|
3719 3791 | name = "http_string_payload",
|
3720 3792 | "executing python handler function"
|
3721 3793 | );
|
3722 3794 | ::pyo3::Python::with_gil(|py| {
|
3723 3795 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3724 3796 | let output = if handler.args == 1 {
|
3725 3797 | pyhandler.call1((input,))?
|
3726 3798 | } else {
|
3727 3799 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3728 3800 | };
|
3729 3801 | output.extract::<crate::output::HttpStringPayloadOutput>()
|
3730 3802 | })
|
3731 3803 | };
|
3732 3804 | // Catch and record a Python traceback.
|
3733 3805 | result.map_err(|e| {
|
3734 3806 | let rich_py_err =
|
3735 3807 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
3736 3808 | e.clone_ref(py)
|
3737 3809 | }));
|
3738 3810 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
3739 3811 | e.into()
|
3740 3812 | })
|
3741 3813 | }
|
3742 3814 |
|
3815 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
3743 3816 | /// Python handler for operation `HttpEnumPayload`.
|
3744 3817 | pub(crate) async fn http_enum_payload(
|
3745 3818 | input: crate::input::HttpEnumPayloadInput,
|
3746 3819 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
3747 3820 | handler: ::aws_smithy_http_server_python::PyHandler,
|
3748 3821 | ) -> std::result::Result<crate::output::HttpEnumPayloadOutput, crate::error::HttpEnumPayloadError> {
|
3749 3822 | // Async block used to run the handler and catch any Python error.
|
3750 3823 | let result = if handler.is_coroutine {
|
3751 3824 | ::tracing::trace!(
|
3752 3825 | name = "http_enum_payload",
|
3753 3826 | "executing python handler coroutine"
|
3754 3827 | );
|
3755 3828 | let result = ::pyo3::Python::with_gil(|py| {
|
3756 3829 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3757 3830 | let coroutine = if handler.args == 1 {
|
3758 3831 | pyhandler.call1((input,))?
|
3759 3832 | } else {
|
3760 3833 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3761 3834 | };
|
3762 3835 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
3763 3836 | })?;
|
3764 3837 | result.await.and_then(|r| {
|
3765 3838 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::HttpEnumPayloadOutput>(py))
|
3766 3839 | })
|
3767 3840 | } else {
|
3768 3841 | ::tracing::trace!(
|
3769 3842 | name = "http_enum_payload",
|
3770 3843 | "executing python handler function"
|
3771 3844 | );
|
3772 3845 | ::pyo3::Python::with_gil(|py| {
|
3773 3846 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3774 3847 | let output = if handler.args == 1 {
|
3775 3848 | pyhandler.call1((input,))?
|
3776 3849 | } else {
|
3777 3850 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3778 3851 | };
|
3779 3852 | output.extract::<crate::output::HttpEnumPayloadOutput>()
|
3780 3853 | })
|
3781 3854 | };
|
3782 3855 | // Catch and record a Python traceback.
|
3783 3856 | result.map_err(|e| {
|
3784 3857 | let rich_py_err =
|
3785 3858 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
3786 3859 | e.clone_ref(py)
|
3787 3860 | }));
|
3788 3861 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
3789 3862 | e.into()
|
3790 3863 | })
|
3791 3864 | }
|
3792 3865 |
|
3866 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
3793 3867 | /// Python handler for operation `HttpPayloadWithStructure`.
|
3794 3868 | pub(crate) async fn http_payload_with_structure(
|
3795 3869 | input: crate::input::HttpPayloadWithStructureInput,
|
3796 3870 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
3797 3871 | handler: ::aws_smithy_http_server_python::PyHandler,
|
3798 3872 | ) -> std::result::Result<
|
3799 3873 | crate::output::HttpPayloadWithStructureOutput,
|
3800 3874 | crate::error::HttpPayloadWithStructureError,
|
3801 3875 | > {
|
3802 3876 | // Async block used to run the handler and catch any Python error.
|
3803 3877 | let result = if handler.is_coroutine {
|
3804 3878 | ::tracing::trace!(
|
3805 3879 | name = "http_payload_with_structure",
|
3806 3880 | "executing python handler coroutine"
|
3807 3881 | );
|
3808 3882 | let result = ::pyo3::Python::with_gil(|py| {
|
3809 3883 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3810 3884 | let coroutine = if handler.args == 1 {
|
3811 3885 | pyhandler.call1((input,))?
|
3812 3886 | } else {
|
3813 3887 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3814 3888 | };
|
3815 3889 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
3816 3890 | })?;
|
3817 3891 | result.await.and_then(|r| {
|
3818 3892 | ::pyo3::Python::with_gil(|py| {
|
3819 3893 | r.extract::<crate::output::HttpPayloadWithStructureOutput>(py)
|
3820 3894 | })
|
3821 3895 | })
|
3822 3896 | } else {
|
3823 3897 | ::tracing::trace!(
|
3824 3898 | name = "http_payload_with_structure",
|
3825 3899 | "executing python handler function"
|
3826 3900 | );
|
3827 3901 | ::pyo3::Python::with_gil(|py| {
|
3828 3902 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3829 3903 | let output = if handler.args == 1 {
|
3830 3904 | pyhandler.call1((input,))?
|
3831 3905 | } else {
|
3832 3906 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3833 3907 | };
|
3834 3908 | output.extract::<crate::output::HttpPayloadWithStructureOutput>()
|
3835 3909 | })
|
3836 3910 | };
|
3837 3911 | // Catch and record a Python traceback.
|
3838 3912 | result.map_err(|e| {
|
3839 3913 | let rich_py_err =
|
3840 3914 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
3841 3915 | e.clone_ref(py)
|
3842 3916 | }));
|
3843 3917 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
3844 3918 | e.into()
|
3845 3919 | })
|
3846 3920 | }
|
3847 3921 |
|
3922 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
3848 3923 | /// Python handler for operation `HttpPayloadTraitsWithMediaType`.
|
3849 3924 | pub(crate) async fn http_payload_traits_with_media_type(
|
3850 3925 | input: crate::input::HttpPayloadTraitsWithMediaTypeInput,
|
3851 3926 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
3852 3927 | handler: ::aws_smithy_http_server_python::PyHandler,
|
3853 3928 | ) -> std::result::Result<
|
3854 3929 | crate::output::HttpPayloadTraitsWithMediaTypeOutput,
|
3855 3930 | crate::error::HttpPayloadTraitsWithMediaTypeError,
|
3856 3931 | > {
|
3857 3932 | // Async block used to run the handler and catch any Python error.
|
3858 3933 | let result = if handler.is_coroutine {
|
3859 3934 | ::tracing::trace!(
|
3860 3935 | name = "http_payload_traits_with_media_type",
|
3861 3936 | "executing python handler coroutine"
|
3862 3937 | );
|
3863 3938 | let result = ::pyo3::Python::with_gil(|py| {
|
3864 3939 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3865 3940 | let coroutine = if handler.args == 1 {
|
3866 3941 | pyhandler.call1((input,))?
|
3867 3942 | } else {
|
3868 3943 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3869 3944 | };
|
3870 3945 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
3871 3946 | })?;
|
3872 3947 | result.await.and_then(|r| {
|
3873 3948 | ::pyo3::Python::with_gil(|py| {
|
3874 3949 | r.extract::<crate::output::HttpPayloadTraitsWithMediaTypeOutput>(py)
|
3875 3950 | })
|
3876 3951 | })
|
3877 3952 | } else {
|
3878 3953 | ::tracing::trace!(
|
3879 3954 | name = "http_payload_traits_with_media_type",
|
3880 3955 | "executing python handler function"
|
3881 3956 | );
|
3882 3957 | ::pyo3::Python::with_gil(|py| {
|
3883 3958 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3884 3959 | let output = if handler.args == 1 {
|
3885 3960 | pyhandler.call1((input,))?
|
3886 3961 | } else {
|
3887 3962 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3888 3963 | };
|
3889 3964 | output.extract::<crate::output::HttpPayloadTraitsWithMediaTypeOutput>()
|
3890 3965 | })
|
3891 3966 | };
|
3892 3967 | // Catch and record a Python traceback.
|
3893 3968 | result.map_err(|e| {
|
3894 3969 | let rich_py_err =
|
3895 3970 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
3896 3971 | e.clone_ref(py)
|
3897 3972 | }));
|
3898 3973 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
3899 3974 | e.into()
|
3900 3975 | })
|
3901 3976 | }
|
3902 3977 |
|
3978 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
3903 3979 | /// Python handler for operation `HttpPayloadTraits`.
|
3904 3980 | pub(crate) async fn http_payload_traits(
|
3905 3981 | input: crate::input::HttpPayloadTraitsInput,
|
3906 3982 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
3907 3983 | handler: ::aws_smithy_http_server_python::PyHandler,
|
3908 3984 | ) -> std::result::Result<crate::output::HttpPayloadTraitsOutput, crate::error::HttpPayloadTraitsError>
|
3909 3985 | {
|
3910 3986 | // Async block used to run the handler and catch any Python error.
|
3911 3987 | let result = if handler.is_coroutine {
|
3912 3988 | ::tracing::trace!(
|
3913 3989 | name = "http_payload_traits",
|
3914 3990 | "executing python handler coroutine"
|
3915 3991 | );
|
3916 3992 | let result = ::pyo3::Python::with_gil(|py| {
|
3917 3993 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3918 3994 | let coroutine = if handler.args == 1 {
|
3919 3995 | pyhandler.call1((input,))?
|
3920 3996 | } else {
|
3921 3997 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3922 3998 | };
|
3923 3999 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
3924 4000 | })?;
|
3925 4001 | result.await.and_then(|r| {
|
3926 4002 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::HttpPayloadTraitsOutput>(py))
|
3927 4003 | })
|
3928 4004 | } else {
|
3929 4005 | ::tracing::trace!(
|
3930 4006 | name = "http_payload_traits",
|
3931 4007 | "executing python handler function"
|
3932 4008 | );
|
3933 4009 | ::pyo3::Python::with_gil(|py| {
|
3934 4010 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3935 4011 | let output = if handler.args == 1 {
|
3936 4012 | pyhandler.call1((input,))?
|
3937 4013 | } else {
|
3938 4014 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3939 4015 | };
|
3940 4016 | output.extract::<crate::output::HttpPayloadTraitsOutput>()
|
3941 4017 | })
|
3942 4018 | };
|
3943 4019 | // Catch and record a Python traceback.
|
3944 4020 | result.map_err(|e| {
|
3945 4021 | let rich_py_err =
|
3946 4022 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
3947 4023 | e.clone_ref(py)
|
3948 4024 | }));
|
3949 4025 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
3950 4026 | e.into()
|
3951 4027 | })
|
3952 4028 | }
|
3953 4029 |
|
4030 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
3954 4031 | /// Python handler for operation `HttpPrefixHeadersInResponse`.
|
3955 4032 | pub(crate) async fn http_prefix_headers_in_response(
|
3956 4033 | input: crate::input::HttpPrefixHeadersInResponseInput,
|
3957 4034 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
3958 4035 | handler: ::aws_smithy_http_server_python::PyHandler,
|
3959 4036 | ) -> std::result::Result<
|
3960 4037 | crate::output::HttpPrefixHeadersInResponseOutput,
|
3961 4038 | crate::error::HttpPrefixHeadersInResponseError,
|
3962 4039 | > {
|
3963 4040 | // Async block used to run the handler and catch any Python error.
|
3964 4041 | let result = if handler.is_coroutine {
|
3965 4042 | ::tracing::trace!(
|
3966 4043 | name = "http_prefix_headers_in_response",
|
3967 4044 | "executing python handler coroutine"
|
3968 4045 | );
|
3969 4046 | let result = ::pyo3::Python::with_gil(|py| {
|
3970 4047 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3971 4048 | let coroutine = if handler.args == 1 {
|
3972 4049 | pyhandler.call1((input,))?
|
3973 4050 | } else {
|
3974 4051 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3975 4052 | };
|
3976 4053 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
3977 4054 | })?;
|
3978 4055 | result.await.and_then(|r| {
|
3979 4056 | ::pyo3::Python::with_gil(|py| {
|
3980 4057 | r.extract::<crate::output::HttpPrefixHeadersInResponseOutput>(py)
|
3981 4058 | })
|
3982 4059 | })
|
3983 4060 | } else {
|
3984 4061 | ::tracing::trace!(
|
3985 4062 | name = "http_prefix_headers_in_response",
|
3986 4063 | "executing python handler function"
|
3987 4064 | );
|
3988 4065 | ::pyo3::Python::with_gil(|py| {
|
3989 4066 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
3990 4067 | let output = if handler.args == 1 {
|
3991 4068 | pyhandler.call1((input,))?
|
3992 4069 | } else {
|
3993 4070 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
3994 4071 | };
|
3995 4072 | output.extract::<crate::output::HttpPrefixHeadersInResponseOutput>()
|
3996 4073 | })
|
3997 4074 | };
|
3998 4075 | // Catch and record a Python traceback.
|
3999 4076 | result.map_err(|e| {
|
4000 4077 | let rich_py_err =
|
4001 4078 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
4002 4079 | e.clone_ref(py)
|
4003 4080 | }));
|
4004 4081 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
4005 4082 | e.into()
|
4006 4083 | })
|
4007 4084 | }
|
4008 4085 |
|
4086 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
4009 4087 | /// Python handler for operation `HttpPrefixHeaders`.
|
4010 4088 | pub(crate) async fn http_prefix_headers(
|
4011 4089 | input: crate::input::HttpPrefixHeadersInput,
|
4012 4090 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
4013 4091 | handler: ::aws_smithy_http_server_python::PyHandler,
|
4014 4092 | ) -> std::result::Result<crate::output::HttpPrefixHeadersOutput, crate::error::HttpPrefixHeadersError>
|
4015 4093 | {
|
4016 4094 | // Async block used to run the handler and catch any Python error.
|
4017 4095 | let result = if handler.is_coroutine {
|
4018 4096 | ::tracing::trace!(
|
4019 4097 | name = "http_prefix_headers",
|
4020 4098 | "executing python handler coroutine"
|
4021 4099 | );
|
4022 4100 | let result = ::pyo3::Python::with_gil(|py| {
|
4023 4101 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4024 4102 | let coroutine = if handler.args == 1 {
|
4025 4103 | pyhandler.call1((input,))?
|
4026 4104 | } else {
|
4027 4105 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4028 4106 | };
|
4029 4107 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
4030 4108 | })?;
|
4031 4109 | result.await.and_then(|r| {
|
4032 4110 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::HttpPrefixHeadersOutput>(py))
|
4033 4111 | })
|
4034 4112 | } else {
|
4035 4113 | ::tracing::trace!(
|
4036 4114 | name = "http_prefix_headers",
|
4037 4115 | "executing python handler function"
|
4038 4116 | );
|
4039 4117 | ::pyo3::Python::with_gil(|py| {
|
4040 4118 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4041 4119 | let output = if handler.args == 1 {
|
4042 4120 | pyhandler.call1((input,))?
|
4043 4121 | } else {
|
4044 4122 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4045 4123 | };
|
4046 4124 | output.extract::<crate::output::HttpPrefixHeadersOutput>()
|
4047 4125 | })
|
4048 4126 | };
|
4049 4127 | // Catch and record a Python traceback.
|
4050 4128 | result.map_err(|e| {
|
4051 4129 | let rich_py_err =
|
4052 4130 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
4053 4131 | e.clone_ref(py)
|
4054 4132 | }));
|
4055 4133 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
4056 4134 | e.into()
|
4057 4135 | })
|
4058 4136 | }
|
4059 4137 |
|
4138 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
4060 4139 | /// Python handler for operation `QueryParamsAsStringListMap`.
|
4061 4140 | pub(crate) async fn query_params_as_string_list_map(
|
4062 4141 | input: crate::input::QueryParamsAsStringListMapInput,
|
4063 4142 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
4064 4143 | handler: ::aws_smithy_http_server_python::PyHandler,
|
4065 4144 | ) -> std::result::Result<
|
4066 4145 | crate::output::QueryParamsAsStringListMapOutput,
|
4067 4146 | crate::error::QueryParamsAsStringListMapError,
|
4068 4147 | > {
|
4069 4148 | // Async block used to run the handler and catch any Python error.
|
4070 4149 | let result = if handler.is_coroutine {
|
4071 4150 | ::tracing::trace!(
|
4072 4151 | name = "query_params_as_string_list_map",
|
4073 4152 | "executing python handler coroutine"
|
4074 4153 | );
|
4075 4154 | let result = ::pyo3::Python::with_gil(|py| {
|
4076 4155 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4077 4156 | let coroutine = if handler.args == 1 {
|
4078 4157 | pyhandler.call1((input,))?
|
4079 4158 | } else {
|
4080 4159 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4081 4160 | };
|
4082 4161 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
4083 4162 | })?;
|
4084 4163 | result.await.and_then(|r| {
|
4085 4164 | ::pyo3::Python::with_gil(|py| {
|
4086 4165 | r.extract::<crate::output::QueryParamsAsStringListMapOutput>(py)
|
4087 4166 | })
|
4088 4167 | })
|
4089 4168 | } else {
|
4090 4169 | ::tracing::trace!(
|
4091 4170 | name = "query_params_as_string_list_map",
|
4092 4171 | "executing python handler function"
|
4093 4172 | );
|
4094 4173 | ::pyo3::Python::with_gil(|py| {
|
4095 4174 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4096 4175 | let output = if handler.args == 1 {
|
4097 4176 | pyhandler.call1((input,))?
|
4098 4177 | } else {
|
4099 4178 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4100 4179 | };
|
4101 4180 | output.extract::<crate::output::QueryParamsAsStringListMapOutput>()
|
4102 4181 | })
|
4103 4182 | };
|
4104 4183 | // Catch and record a Python traceback.
|
4105 4184 | result.map_err(|e| {
|
4106 4185 | let rich_py_err =
|
4107 4186 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
4108 4187 | e.clone_ref(py)
|
4109 4188 | }));
|
4110 4189 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
4111 4190 | e.into()
|
4112 4191 | })
|
4113 4192 | }
|
4114 4193 |
|
4194 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
4115 4195 | /// Python handler for operation `QueryPrecedence`.
|
4116 4196 | pub(crate) async fn query_precedence(
|
4117 4197 | input: crate::input::QueryPrecedenceInput,
|
4118 4198 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
4119 4199 | handler: ::aws_smithy_http_server_python::PyHandler,
|
4120 4200 | ) -> std::result::Result<crate::output::QueryPrecedenceOutput, crate::error::QueryPrecedenceError> {
|
4121 4201 | // Async block used to run the handler and catch any Python error.
|
4122 4202 | let result = if handler.is_coroutine {
|
4123 4203 | ::tracing::trace!(
|
4124 4204 | name = "query_precedence",
|
4125 4205 | "executing python handler coroutine"
|
4126 4206 | );
|
4127 4207 | let result = ::pyo3::Python::with_gil(|py| {
|
4128 4208 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4129 4209 | let coroutine = if handler.args == 1 {
|
4130 4210 | pyhandler.call1((input,))?
|
4131 4211 | } else {
|
4132 4212 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4133 4213 | };
|
4134 4214 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
4135 4215 | })?;
|
4136 4216 | result.await.and_then(|r| {
|
4137 4217 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::QueryPrecedenceOutput>(py))
|
4138 4218 | })
|
4139 4219 | } else {
|
4140 4220 | ::tracing::trace!(
|
4141 4221 | name = "query_precedence",
|
4142 4222 | "executing python handler function"
|
4143 4223 | );
|
4144 4224 | ::pyo3::Python::with_gil(|py| {
|
4145 4225 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4146 4226 | let output = if handler.args == 1 {
|
4147 4227 | pyhandler.call1((input,))?
|
4148 4228 | } else {
|
4149 4229 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4150 4230 | };
|
4151 4231 | output.extract::<crate::output::QueryPrecedenceOutput>()
|
4152 4232 | })
|
4153 4233 | };
|
4154 4234 | // Catch and record a Python traceback.
|
4155 4235 | result.map_err(|e| {
|
4156 4236 | let rich_py_err =
|
4157 4237 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
4158 4238 | e.clone_ref(py)
|
4159 4239 | }));
|
4160 4240 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
4161 4241 | e.into()
|
4162 4242 | })
|
4163 4243 | }
|
4164 4244 |
|
4245 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
4165 4246 | /// Python handler for operation `QueryIdempotencyTokenAutoFill`.
|
4166 4247 | pub(crate) async fn query_idempotency_token_auto_fill(
|
4167 4248 | input: crate::input::QueryIdempotencyTokenAutoFillInput,
|
4168 4249 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
4169 4250 | handler: ::aws_smithy_http_server_python::PyHandler,
|
4170 4251 | ) -> std::result::Result<
|
4171 4252 | crate::output::QueryIdempotencyTokenAutoFillOutput,
|
4172 4253 | crate::error::QueryIdempotencyTokenAutoFillError,
|
4173 4254 | > {
|
4174 4255 | // Async block used to run the handler and catch any Python error.
|
4175 4256 | let result = if handler.is_coroutine {
|
4176 4257 | ::tracing::trace!(
|
4177 4258 | name = "query_idempotency_token_auto_fill",
|
4178 4259 | "executing python handler coroutine"
|
4179 4260 | );
|
4180 4261 | let result = ::pyo3::Python::with_gil(|py| {
|
4181 4262 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4182 4263 | let coroutine = if handler.args == 1 {
|
4183 4264 | pyhandler.call1((input,))?
|
4184 4265 | } else {
|
4185 4266 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4186 4267 | };
|
4187 4268 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
4188 4269 | })?;
|
4189 4270 | result.await.and_then(|r| {
|
4190 4271 | ::pyo3::Python::with_gil(|py| {
|
4191 4272 | r.extract::<crate::output::QueryIdempotencyTokenAutoFillOutput>(py)
|
4192 4273 | })
|
4193 4274 | })
|
4194 4275 | } else {
|
4195 4276 | ::tracing::trace!(
|
4196 4277 | name = "query_idempotency_token_auto_fill",
|
4197 4278 | "executing python handler function"
|
4198 4279 | );
|
4199 4280 | ::pyo3::Python::with_gil(|py| {
|
4200 4281 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4201 4282 | let output = if handler.args == 1 {
|
4202 4283 | pyhandler.call1((input,))?
|
4203 4284 | } else {
|
4204 4285 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4205 4286 | };
|
4206 4287 | output.extract::<crate::output::QueryIdempotencyTokenAutoFillOutput>()
|
4207 4288 | })
|
4208 4289 | };
|
4209 4290 | // Catch and record a Python traceback.
|
4210 4291 | result.map_err(|e| {
|
4211 4292 | let rich_py_err =
|
4212 4293 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
4213 4294 | e.clone_ref(py)
|
4214 4295 | }));
|
4215 4296 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
4216 4297 | e.into()
|
4217 4298 | })
|
4218 4299 | }
|
4219 4300 |
|
4301 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
4220 4302 | /// Python handler for operation `OmitsSerializingEmptyLists`.
|
4221 4303 | pub(crate) async fn omits_serializing_empty_lists(
|
4222 4304 | input: crate::input::OmitsSerializingEmptyListsInput,
|
4223 4305 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
4224 4306 | handler: ::aws_smithy_http_server_python::PyHandler,
|
4225 4307 | ) -> std::result::Result<
|
4226 4308 | crate::output::OmitsSerializingEmptyListsOutput,
|
4227 4309 | crate::error::OmitsSerializingEmptyListsError,
|
4228 4310 | > {
|
4229 4311 | // Async block used to run the handler and catch any Python error.
|
4230 4312 | let result = if handler.is_coroutine {
|
4231 4313 | ::tracing::trace!(
|
4232 4314 | name = "omits_serializing_empty_lists",
|
4233 4315 | "executing python handler coroutine"
|
4234 4316 | );
|
4235 4317 | let result = ::pyo3::Python::with_gil(|py| {
|
4236 4318 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4237 4319 | let coroutine = if handler.args == 1 {
|
4238 4320 | pyhandler.call1((input,))?
|
4239 4321 | } else {
|
4240 4322 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4241 4323 | };
|
4242 4324 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
4243 4325 | })?;
|
4244 4326 | result.await.and_then(|r| {
|
4245 4327 | ::pyo3::Python::with_gil(|py| {
|
4246 4328 | r.extract::<crate::output::OmitsSerializingEmptyListsOutput>(py)
|
4247 4329 | })
|
4248 4330 | })
|
4249 4331 | } else {
|
4250 4332 | ::tracing::trace!(
|
4251 4333 | name = "omits_serializing_empty_lists",
|
4252 4334 | "executing python handler function"
|
4253 4335 | );
|
4254 4336 | ::pyo3::Python::with_gil(|py| {
|
4255 4337 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4256 4338 | let output = if handler.args == 1 {
|
4257 4339 | pyhandler.call1((input,))?
|
4258 4340 | } else {
|
4259 4341 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4260 4342 | };
|
4261 4343 | output.extract::<crate::output::OmitsSerializingEmptyListsOutput>()
|
4262 4344 | })
|
4263 4345 | };
|
4264 4346 | // Catch and record a Python traceback.
|
4265 4347 | result.map_err(|e| {
|
4266 4348 | let rich_py_err =
|
4267 4349 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
4268 4350 | e.clone_ref(py)
|
4269 4351 | }));
|
4270 4352 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
4271 4353 | e.into()
|
4272 4354 | })
|
4273 4355 | }
|
4274 4356 |
|
4357 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
4275 4358 | /// Python handler for operation `OmitsNullSerializesEmptyString`.
|
4276 4359 | pub(crate) async fn omits_null_serializes_empty_string(
|
4277 4360 | input: crate::input::OmitsNullSerializesEmptyStringInput,
|
4278 4361 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
4279 4362 | handler: ::aws_smithy_http_server_python::PyHandler,
|
4280 4363 | ) -> std::result::Result<
|
4281 4364 | crate::output::OmitsNullSerializesEmptyStringOutput,
|
4282 4365 | crate::error::OmitsNullSerializesEmptyStringError,
|
4283 4366 | > {
|
4284 4367 | // Async block used to run the handler and catch any Python error.
|
4285 4368 | let result = if handler.is_coroutine {
|
4286 4369 | ::tracing::trace!(
|
4287 4370 | name = "omits_null_serializes_empty_string",
|
4288 4371 | "executing python handler coroutine"
|
4289 4372 | );
|
4290 4373 | let result = ::pyo3::Python::with_gil(|py| {
|
4291 4374 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4292 4375 | let coroutine = if handler.args == 1 {
|
4293 4376 | pyhandler.call1((input,))?
|
4294 4377 | } else {
|
4295 4378 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4296 4379 | };
|
4297 4380 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
4298 4381 | })?;
|
4299 4382 | result.await.and_then(|r| {
|
4300 4383 | ::pyo3::Python::with_gil(|py| {
|
4301 4384 | r.extract::<crate::output::OmitsNullSerializesEmptyStringOutput>(py)
|
4302 4385 | })
|
4303 4386 | })
|
4304 4387 | } else {
|
4305 4388 | ::tracing::trace!(
|
4306 4389 | name = "omits_null_serializes_empty_string",
|
4307 4390 | "executing python handler function"
|
4308 4391 | );
|
4309 4392 | ::pyo3::Python::with_gil(|py| {
|
4310 4393 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4311 4394 | let output = if handler.args == 1 {
|
4312 4395 | pyhandler.call1((input,))?
|
4313 4396 | } else {
|
4314 4397 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4315 4398 | };
|
4316 4399 | output.extract::<crate::output::OmitsNullSerializesEmptyStringOutput>()
|
4317 4400 | })
|
4318 4401 | };
|
4319 4402 | // Catch and record a Python traceback.
|
4320 4403 | result.map_err(|e| {
|
4321 4404 | let rich_py_err =
|
4322 4405 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
4323 4406 | e.clone_ref(py)
|
4324 4407 | }));
|
4325 4408 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
4326 4409 | e.into()
|
4327 4410 | })
|
4328 4411 | }
|
4329 4412 |
|
4413 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
4330 4414 | /// Python handler for operation `IgnoreQueryParamsInResponse`.
|
4331 4415 | pub(crate) async fn ignore_query_params_in_response(
|
4332 4416 | input: crate::input::IgnoreQueryParamsInResponseInput,
|
4333 4417 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
4334 4418 | handler: ::aws_smithy_http_server_python::PyHandler,
|
4335 4419 | ) -> std::result::Result<
|
4336 4420 | crate::output::IgnoreQueryParamsInResponseOutput,
|
4337 4421 | crate::error::IgnoreQueryParamsInResponseError,
|
4338 4422 | > {
|
4339 4423 | // Async block used to run the handler and catch any Python error.
|
4340 4424 | let result = if handler.is_coroutine {
|
4341 4425 | ::tracing::trace!(
|
4342 4426 | name = "ignore_query_params_in_response",
|
4343 4427 | "executing python handler coroutine"
|
4344 4428 | );
|
4345 4429 | let result = ::pyo3::Python::with_gil(|py| {
|
4346 4430 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4347 4431 | let coroutine = if handler.args == 1 {
|
4348 4432 | pyhandler.call1((input,))?
|
4349 4433 | } else {
|
4350 4434 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4351 4435 | };
|
4352 4436 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
4353 4437 | })?;
|
4354 4438 | result.await.and_then(|r| {
|
4355 4439 | ::pyo3::Python::with_gil(|py| {
|
4356 4440 | r.extract::<crate::output::IgnoreQueryParamsInResponseOutput>(py)
|
4357 4441 | })
|
4358 4442 | })
|
4359 4443 | } else {
|
4360 4444 | ::tracing::trace!(
|
4361 4445 | name = "ignore_query_params_in_response",
|
4362 4446 | "executing python handler function"
|
4363 4447 | );
|
4364 4448 | ::pyo3::Python::with_gil(|py| {
|
4365 4449 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4366 4450 | let output = if handler.args == 1 {
|
4367 4451 | pyhandler.call1((input,))?
|
4368 4452 | } else {
|
4369 4453 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4370 4454 | };
|
4371 4455 | output.extract::<crate::output::IgnoreQueryParamsInResponseOutput>()
|
4372 4456 | })
|
4373 4457 | };
|
4374 4458 | // Catch and record a Python traceback.
|
4375 4459 | result.map_err(|e| {
|
4376 4460 | let rich_py_err =
|
4377 4461 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
4378 4462 | e.clone_ref(py)
|
4379 4463 | }));
|
4380 4464 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
4381 4465 | e.into()
|
4382 4466 | })
|
4383 4467 | }
|
4384 4468 |
|
4469 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
4385 4470 | /// Python handler for operation `ConstantAndVariableQueryString`.
|
4386 4471 | pub(crate) async fn constant_and_variable_query_string(
|
4387 4472 | input: crate::input::ConstantAndVariableQueryStringInput,
|
4388 4473 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
4389 4474 | handler: ::aws_smithy_http_server_python::PyHandler,
|
4390 4475 | ) -> std::result::Result<
|
4391 4476 | crate::output::ConstantAndVariableQueryStringOutput,
|
4392 4477 | crate::error::ConstantAndVariableQueryStringError,
|
4393 4478 | > {
|
4394 4479 | // Async block used to run the handler and catch any Python error.
|
4395 4480 | let result = if handler.is_coroutine {
|
4396 4481 | ::tracing::trace!(
|
4397 4482 | name = "constant_and_variable_query_string",
|
4398 4483 | "executing python handler coroutine"
|
4399 4484 | );
|
4400 4485 | let result = ::pyo3::Python::with_gil(|py| {
|
4401 4486 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4402 4487 | let coroutine = if handler.args == 1 {
|
4403 4488 | pyhandler.call1((input,))?
|
4404 4489 | } else {
|
4405 4490 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4406 4491 | };
|
4407 4492 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
4408 4493 | })?;
|
4409 4494 | result.await.and_then(|r| {
|
4410 4495 | ::pyo3::Python::with_gil(|py| {
|
4411 4496 | r.extract::<crate::output::ConstantAndVariableQueryStringOutput>(py)
|
4412 4497 | })
|
4413 4498 | })
|
4414 4499 | } else {
|
4415 4500 | ::tracing::trace!(
|
4416 4501 | name = "constant_and_variable_query_string",
|
4417 4502 | "executing python handler function"
|
4418 4503 | );
|
4419 4504 | ::pyo3::Python::with_gil(|py| {
|
4420 4505 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4421 4506 | let output = if handler.args == 1 {
|
4422 4507 | pyhandler.call1((input,))?
|
4423 4508 | } else {
|
4424 4509 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4425 4510 | };
|
4426 4511 | output.extract::<crate::output::ConstantAndVariableQueryStringOutput>()
|
4427 4512 | })
|
4428 4513 | };
|
4429 4514 | // Catch and record a Python traceback.
|
4430 4515 | result.map_err(|e| {
|
4431 4516 | let rich_py_err =
|
4432 4517 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
4433 4518 | e.clone_ref(py)
|
4434 4519 | }));
|
4435 4520 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
4436 4521 | e.into()
|
4437 4522 | })
|
4438 4523 | }
|
4439 4524 |
|
4525 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
4440 4526 | /// Python handler for operation `ConstantQueryString`.
|
4441 4527 | pub(crate) async fn constant_query_string(
|
4442 4528 | input: crate::input::ConstantQueryStringInput,
|
4443 4529 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
4444 4530 | handler: ::aws_smithy_http_server_python::PyHandler,
|
4445 4531 | ) -> std::result::Result<
|
4446 4532 | crate::output::ConstantQueryStringOutput,
|
4447 4533 | crate::error::ConstantQueryStringError,
|
4448 4534 | > {
|
4449 4535 | // Async block used to run the handler and catch any Python error.
|
4450 4536 | let result = if handler.is_coroutine {
|
4451 4537 | ::tracing::trace!(
|
4452 4538 | name = "constant_query_string",
|
4453 4539 | "executing python handler coroutine"
|
4454 4540 | );
|
4455 4541 | let result = ::pyo3::Python::with_gil(|py| {
|
4456 4542 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4457 4543 | let coroutine = if handler.args == 1 {
|
4458 4544 | pyhandler.call1((input,))?
|
4459 4545 | } else {
|
4460 4546 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4461 4547 | };
|
4462 4548 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
4463 4549 | })?;
|
4464 4550 | result.await.and_then(|r| {
|
4465 4551 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::ConstantQueryStringOutput>(py))
|
4466 4552 | })
|
4467 4553 | } else {
|
4468 4554 | ::tracing::trace!(
|
4469 4555 | name = "constant_query_string",
|
4470 4556 | "executing python handler function"
|
4471 4557 | );
|
4472 4558 | ::pyo3::Python::with_gil(|py| {
|
4473 4559 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4474 4560 | let output = if handler.args == 1 {
|
4475 4561 | pyhandler.call1((input,))?
|
4476 4562 | } else {
|
4477 4563 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4478 4564 | };
|
4479 4565 | output.extract::<crate::output::ConstantQueryStringOutput>()
|
4480 4566 | })
|
4481 4567 | };
|
4482 4568 | // Catch and record a Python traceback.
|
4483 4569 | result.map_err(|e| {
|
4484 4570 | let rich_py_err =
|
4485 4571 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
4486 4572 | e.clone_ref(py)
|
4487 4573 | }));
|
4488 4574 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
4489 4575 | e.into()
|
4490 4576 | })
|
4491 4577 | }
|
4492 4578 |
|
4579 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
4493 4580 | /// Python handler for operation `AllQueryStringTypes`.
|
4494 4581 | pub(crate) async fn all_query_string_types(
|
4495 4582 | input: crate::input::AllQueryStringTypesInput,
|
4496 4583 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
4497 4584 | handler: ::aws_smithy_http_server_python::PyHandler,
|
4498 4585 | ) -> std::result::Result<
|
4499 4586 | crate::output::AllQueryStringTypesOutput,
|
4500 4587 | crate::error::AllQueryStringTypesError,
|
4501 4588 | > {
|
4502 4589 | // Async block used to run the handler and catch any Python error.
|
4503 4590 | let result = if handler.is_coroutine {
|
4504 4591 | ::tracing::trace!(
|
4505 4592 | name = "all_query_string_types",
|
4506 4593 | "executing python handler coroutine"
|
4507 4594 | );
|
4508 4595 | let result = ::pyo3::Python::with_gil(|py| {
|
4509 4596 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4510 4597 | let coroutine = if handler.args == 1 {
|
4511 4598 | pyhandler.call1((input,))?
|
4512 4599 | } else {
|
4513 4600 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4514 4601 | };
|
4515 4602 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
4516 4603 | })?;
|
4517 4604 | result.await.and_then(|r| {
|
4518 4605 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::AllQueryStringTypesOutput>(py))
|
4519 4606 | })
|
4520 4607 | } else {
|
4521 4608 | ::tracing::trace!(
|
4522 4609 | name = "all_query_string_types",
|
4523 4610 | "executing python handler function"
|
4524 4611 | );
|
4525 4612 | ::pyo3::Python::with_gil(|py| {
|
4526 4613 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4527 4614 | let output = if handler.args == 1 {
|
4528 4615 | pyhandler.call1((input,))?
|
4529 4616 | } else {
|
4530 4617 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4531 4618 | };
|
4532 4619 | output.extract::<crate::output::AllQueryStringTypesOutput>()
|
4533 4620 | })
|
4534 4621 | };
|
4535 4622 | // Catch and record a Python traceback.
|
4536 4623 | result.map_err(|e| {
|
4537 4624 | let rich_py_err =
|
4538 4625 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
4539 4626 | e.clone_ref(py)
|
4540 4627 | }));
|
4541 4628 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
4542 4629 | e.into()
|
4543 4630 | })
|
4544 4631 | }
|
4545 4632 |
|
4633 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
4546 4634 | /// Python handler for operation `HttpRequestWithRegexLiteral`.
|
4547 4635 | pub(crate) async fn http_request_with_regex_literal(
|
4548 4636 | input: crate::input::HttpRequestWithRegexLiteralInput,
|
4549 4637 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
4550 4638 | handler: ::aws_smithy_http_server_python::PyHandler,
|
4551 4639 | ) -> std::result::Result<
|
4552 4640 | crate::output::HttpRequestWithRegexLiteralOutput,
|
4553 4641 | crate::error::HttpRequestWithRegexLiteralError,
|
4554 4642 | > {
|
4555 4643 | // Async block used to run the handler and catch any Python error.
|
4556 4644 | let result = if handler.is_coroutine {
|
4557 4645 | ::tracing::trace!(
|
4558 4646 | name = "http_request_with_regex_literal",
|
4559 4647 | "executing python handler coroutine"
|
4560 4648 | );
|
4561 4649 | let result = ::pyo3::Python::with_gil(|py| {
|
4562 4650 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4563 4651 | let coroutine = if handler.args == 1 {
|
4564 4652 | pyhandler.call1((input,))?
|
4565 4653 | } else {
|
4566 4654 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4567 4655 | };
|
4568 4656 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
4569 4657 | })?;
|
4570 4658 | result.await.and_then(|r| {
|
4571 4659 | ::pyo3::Python::with_gil(|py| {
|
4572 4660 | r.extract::<crate::output::HttpRequestWithRegexLiteralOutput>(py)
|
4573 4661 | })
|
4574 4662 | })
|
4575 4663 | } else {
|
4576 4664 | ::tracing::trace!(
|
4577 4665 | name = "http_request_with_regex_literal",
|
4578 4666 | "executing python handler function"
|
4579 4667 | );
|
4580 4668 | ::pyo3::Python::with_gil(|py| {
|
4581 4669 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4582 4670 | let output = if handler.args == 1 {
|
4583 4671 | pyhandler.call1((input,))?
|
4584 4672 | } else {
|
4585 4673 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4586 4674 | };
|
4587 4675 | output.extract::<crate::output::HttpRequestWithRegexLiteralOutput>()
|
4588 4676 | })
|
4589 4677 | };
|
4590 4678 | // Catch and record a Python traceback.
|
4591 4679 | result.map_err(|e| {
|
4592 4680 | let rich_py_err =
|
4593 4681 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
4594 4682 | e.clone_ref(py)
|
4595 4683 | }));
|
4596 4684 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
4597 4685 | e.into()
|
4598 4686 | })
|
4599 4687 | }
|
4600 4688 |
|
4689 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
4601 4690 | /// Python handler for operation `HttpRequestWithFloatLabels`.
|
4602 4691 | pub(crate) async fn http_request_with_float_labels(
|
4603 4692 | input: crate::input::HttpRequestWithFloatLabelsInput,
|
4604 4693 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
4605 4694 | handler: ::aws_smithy_http_server_python::PyHandler,
|
4606 4695 | ) -> std::result::Result<
|
4607 4696 | crate::output::HttpRequestWithFloatLabelsOutput,
|
4608 4697 | crate::error::HttpRequestWithFloatLabelsError,
|
4609 4698 | > {
|
4610 4699 | // Async block used to run the handler and catch any Python error.
|
4611 4700 | let result = if handler.is_coroutine {
|
4612 4701 | ::tracing::trace!(
|
4613 4702 | name = "http_request_with_float_labels",
|
4614 4703 | "executing python handler coroutine"
|
4615 4704 | );
|
4616 4705 | let result = ::pyo3::Python::with_gil(|py| {
|
4617 4706 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4618 4707 | let coroutine = if handler.args == 1 {
|
4619 4708 | pyhandler.call1((input,))?
|
4620 4709 | } else {
|
4621 4710 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4622 4711 | };
|
4623 4712 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
4624 4713 | })?;
|
4625 4714 | result.await.and_then(|r| {
|
4626 4715 | ::pyo3::Python::with_gil(|py| {
|
4627 4716 | r.extract::<crate::output::HttpRequestWithFloatLabelsOutput>(py)
|
4628 4717 | })
|
4629 4718 | })
|
4630 4719 | } else {
|
4631 4720 | ::tracing::trace!(
|
4632 4721 | name = "http_request_with_float_labels",
|
4633 4722 | "executing python handler function"
|
4634 4723 | );
|
4635 4724 | ::pyo3::Python::with_gil(|py| {
|
4636 4725 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4637 4726 | let output = if handler.args == 1 {
|
4638 4727 | pyhandler.call1((input,))?
|
4639 4728 | } else {
|
4640 4729 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4641 4730 | };
|
4642 4731 | output.extract::<crate::output::HttpRequestWithFloatLabelsOutput>()
|
4643 4732 | })
|
4644 4733 | };
|
4645 4734 | // Catch and record a Python traceback.
|
4646 4735 | result.map_err(|e| {
|
4647 4736 | let rich_py_err =
|
4648 4737 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
4649 4738 | e.clone_ref(py)
|
4650 4739 | }));
|
4651 4740 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
4652 4741 | e.into()
|
4653 4742 | })
|
4654 4743 | }
|
4655 4744 |
|
4745 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
4656 4746 | /// Python handler for operation `HttpRequestWithGreedyLabelInPath`.
|
4657 4747 | pub(crate) async fn http_request_with_greedy_label_in_path(
|
4658 4748 | input: crate::input::HttpRequestWithGreedyLabelInPathInput,
|
4659 4749 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
4660 4750 | handler: ::aws_smithy_http_server_python::PyHandler,
|
4661 4751 | ) -> std::result::Result<
|
4662 4752 | crate::output::HttpRequestWithGreedyLabelInPathOutput,
|
4663 4753 | crate::error::HttpRequestWithGreedyLabelInPathError,
|
4664 4754 | > {
|
4665 4755 | // Async block used to run the handler and catch any Python error.
|
4666 4756 | let result = if handler.is_coroutine {
|
4667 4757 | ::tracing::trace!(
|
4668 4758 | name = "http_request_with_greedy_label_in_path",
|
4669 4759 | "executing python handler coroutine"
|
4670 4760 | );
|
4671 4761 | let result = ::pyo3::Python::with_gil(|py| {
|
4672 4762 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4673 4763 | let coroutine = if handler.args == 1 {
|
4674 4764 | pyhandler.call1((input,))?
|
4675 4765 | } else {
|
4676 4766 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4677 4767 | };
|
4678 4768 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
4679 4769 | })?;
|
4680 4770 | result.await.and_then(|r| {
|
4681 4771 | ::pyo3::Python::with_gil(|py| {
|
4682 4772 | r.extract::<crate::output::HttpRequestWithGreedyLabelInPathOutput>(py)
|
4683 4773 | })
|
4684 4774 | })
|
4685 4775 | } else {
|
4686 4776 | ::tracing::trace!(
|
4687 4777 | name = "http_request_with_greedy_label_in_path",
|
4688 4778 | "executing python handler function"
|
4689 4779 | );
|
4690 4780 | ::pyo3::Python::with_gil(|py| {
|
4691 4781 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4692 4782 | let output = if handler.args == 1 {
|
4693 4783 | pyhandler.call1((input,))?
|
4694 4784 | } else {
|
4695 4785 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4696 4786 | };
|
4697 4787 | output.extract::<crate::output::HttpRequestWithGreedyLabelInPathOutput>()
|
4698 4788 | })
|
4699 4789 | };
|
4700 4790 | // Catch and record a Python traceback.
|
4701 4791 | result.map_err(|e| {
|
4702 4792 | let rich_py_err =
|
4703 4793 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
4704 4794 | e.clone_ref(py)
|
4705 4795 | }));
|
4706 4796 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
4707 4797 | e.into()
|
4708 4798 | })
|
4709 4799 | }
|
4710 4800 |
|
4801 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
4711 4802 | /// Python handler for operation `HttpRequestWithLabelsAndTimestampFormat`.
|
4712 4803 | pub(crate) async fn http_request_with_labels_and_timestamp_format(
|
4713 4804 | input: crate::input::HttpRequestWithLabelsAndTimestampFormatInput,
|
4714 4805 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
4715 4806 | handler: ::aws_smithy_http_server_python::PyHandler,
|
4716 4807 | ) -> std::result::Result<
|
4717 4808 | crate::output::HttpRequestWithLabelsAndTimestampFormatOutput,
|
4718 4809 | crate::error::HttpRequestWithLabelsAndTimestampFormatError,
|
4719 4810 | > {
|
4720 4811 | // Async block used to run the handler and catch any Python error.
|
4721 4812 | let result = if handler.is_coroutine {
|
4722 4813 | ::tracing::trace!(
|
4723 4814 | name = "http_request_with_labels_and_timestamp_format",
|
4724 4815 | "executing python handler coroutine"
|
4725 4816 | );
|
4726 4817 | let result = ::pyo3::Python::with_gil(|py| {
|
4727 4818 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4728 4819 | let coroutine = if handler.args == 1 {
|
4729 4820 | pyhandler.call1((input,))?
|
4730 4821 | } else {
|
4731 4822 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4732 4823 | };
|
4733 4824 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
4734 4825 | })?;
|
4735 4826 | result.await.and_then(|r| {
|
4736 4827 | ::pyo3::Python::with_gil(|py| {
|
4737 4828 | r.extract::<crate::output::HttpRequestWithLabelsAndTimestampFormatOutput>(py)
|
4738 4829 | })
|
4739 4830 | })
|
4740 4831 | } else {
|
4741 4832 | ::tracing::trace!(
|
4742 4833 | name = "http_request_with_labels_and_timestamp_format",
|
4743 4834 | "executing python handler function"
|
4744 4835 | );
|
4745 4836 | ::pyo3::Python::with_gil(|py| {
|
4746 4837 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4747 4838 | let output = if handler.args == 1 {
|
4748 4839 | pyhandler.call1((input,))?
|
4749 4840 | } else {
|
4750 4841 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4751 4842 | };
|
4752 4843 | output.extract::<crate::output::HttpRequestWithLabelsAndTimestampFormatOutput>()
|
4753 4844 | })
|
4754 4845 | };
|
4755 4846 | // Catch and record a Python traceback.
|
4756 4847 | result.map_err(|e| {
|
4757 4848 | let rich_py_err =
|
4758 4849 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
4759 4850 | e.clone_ref(py)
|
4760 4851 | }));
|
4761 4852 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
4762 4853 | e.into()
|
4763 4854 | })
|
4764 4855 | }
|
4765 4856 |
|
4857 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
4766 4858 | /// Python handler for operation `HttpRequestWithLabels`.
|
4767 4859 | pub(crate) async fn http_request_with_labels(
|
4768 4860 | input: crate::input::HttpRequestWithLabelsInput,
|
4769 4861 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
4770 4862 | handler: ::aws_smithy_http_server_python::PyHandler,
|
4771 4863 | ) -> std::result::Result<
|
4772 4864 | crate::output::HttpRequestWithLabelsOutput,
|
4773 4865 | crate::error::HttpRequestWithLabelsError,
|
4774 4866 | > {
|
4775 4867 | // Async block used to run the handler and catch any Python error.
|
4776 4868 | let result = if handler.is_coroutine {
|
4777 4869 | ::tracing::trace!(
|
4778 4870 | name = "http_request_with_labels",
|
4779 4871 | "executing python handler coroutine"
|
4780 4872 | );
|
4781 4873 | let result = ::pyo3::Python::with_gil(|py| {
|
4782 4874 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4783 4875 | let coroutine = if handler.args == 1 {
|
4784 4876 | pyhandler.call1((input,))?
|
4785 4877 | } else {
|
4786 4878 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4787 4879 | };
|
4788 4880 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
4789 4881 | })?;
|
4790 4882 | result.await.and_then(|r| {
|
4791 4883 | ::pyo3::Python::with_gil(|py| {
|
4792 4884 | r.extract::<crate::output::HttpRequestWithLabelsOutput>(py)
|
4793 4885 | })
|
4794 4886 | })
|
4795 4887 | } else {
|
4796 4888 | ::tracing::trace!(
|
4797 4889 | name = "http_request_with_labels",
|
4798 4890 | "executing python handler function"
|
4799 4891 | );
|
4800 4892 | ::pyo3::Python::with_gil(|py| {
|
4801 4893 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4802 4894 | let output = if handler.args == 1 {
|
4803 4895 | pyhandler.call1((input,))?
|
4804 4896 | } else {
|
4805 4897 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4806 4898 | };
|
4807 4899 | output.extract::<crate::output::HttpRequestWithLabelsOutput>()
|
4808 4900 | })
|
4809 4901 | };
|
4810 4902 | // Catch and record a Python traceback.
|
4811 4903 | result.map_err(|e| {
|
4812 4904 | let rich_py_err =
|
4813 4905 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
4814 4906 | e.clone_ref(py)
|
4815 4907 | }));
|
4816 4908 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
4817 4909 | e.into()
|
4818 4910 | })
|
4819 4911 | }
|
4820 4912 |
|
4913 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
4821 4914 | /// Python handler for operation `MediaTypeHeader`.
|
4822 4915 | pub(crate) async fn media_type_header(
|
4823 4916 | input: crate::input::MediaTypeHeaderInput,
|
4824 4917 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
4825 4918 | handler: ::aws_smithy_http_server_python::PyHandler,
|
4826 4919 | ) -> std::result::Result<crate::output::MediaTypeHeaderOutput, crate::error::MediaTypeHeaderError> {
|
4827 4920 | // Async block used to run the handler and catch any Python error.
|
4828 4921 | let result = if handler.is_coroutine {
|
4829 4922 | ::tracing::trace!(
|
4830 4923 | name = "media_type_header",
|
4831 4924 | "executing python handler coroutine"
|
4832 4925 | );
|
4833 4926 | let result = ::pyo3::Python::with_gil(|py| {
|
4834 4927 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4835 4928 | let coroutine = if handler.args == 1 {
|
4836 4929 | pyhandler.call1((input,))?
|
4837 4930 | } else {
|
4838 4931 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4839 4932 | };
|
4840 4933 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
4841 4934 | })?;
|
4842 4935 | result.await.and_then(|r| {
|
4843 4936 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::MediaTypeHeaderOutput>(py))
|
4844 4937 | })
|
4845 4938 | } else {
|
4846 4939 | ::tracing::trace!(
|
4847 4940 | name = "media_type_header",
|
4848 4941 | "executing python handler function"
|
4849 4942 | );
|
4850 4943 | ::pyo3::Python::with_gil(|py| {
|
4851 4944 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4852 4945 | let output = if handler.args == 1 {
|
4853 4946 | pyhandler.call1((input,))?
|
4854 4947 | } else {
|
4855 4948 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4856 4949 | };
|
4857 4950 | output.extract::<crate::output::MediaTypeHeaderOutput>()
|
4858 4951 | })
|
4859 4952 | };
|
4860 4953 | // Catch and record a Python traceback.
|
4861 4954 | result.map_err(|e| {
|
4862 4955 | let rich_py_err =
|
4863 4956 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
4864 4957 | e.clone_ref(py)
|
4865 4958 | }));
|
4866 4959 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
4867 4960 | e.into()
|
4868 4961 | })
|
4869 4962 | }
|
4870 4963 |
|
4964 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
4871 4965 | /// Python handler for operation `TimestampFormatHeaders`.
|
4872 4966 | pub(crate) async fn timestamp_format_headers(
|
4873 4967 | input: crate::input::TimestampFormatHeadersInput,
|
4874 4968 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
4875 4969 | handler: ::aws_smithy_http_server_python::PyHandler,
|
4876 4970 | ) -> std::result::Result<
|
4877 4971 | crate::output::TimestampFormatHeadersOutput,
|
4878 4972 | crate::error::TimestampFormatHeadersError,
|
4879 4973 | > {
|
4880 4974 | // Async block used to run the handler and catch any Python error.
|
4881 4975 | let result = if handler.is_coroutine {
|
4882 4976 | ::tracing::trace!(
|
4883 4977 | name = "timestamp_format_headers",
|
4884 4978 | "executing python handler coroutine"
|
4885 4979 | );
|
4886 4980 | let result = ::pyo3::Python::with_gil(|py| {
|
4887 4981 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4888 4982 | let coroutine = if handler.args == 1 {
|
4889 4983 | pyhandler.call1((input,))?
|
4890 4984 | } else {
|
4891 4985 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4892 4986 | };
|
4893 4987 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
4894 4988 | })?;
|
4895 4989 | result.await.and_then(|r| {
|
4896 4990 | ::pyo3::Python::with_gil(|py| {
|
4897 4991 | r.extract::<crate::output::TimestampFormatHeadersOutput>(py)
|
4898 4992 | })
|
4899 4993 | })
|
4900 4994 | } else {
|
4901 4995 | ::tracing::trace!(
|
4902 4996 | name = "timestamp_format_headers",
|
4903 4997 | "executing python handler function"
|
4904 4998 | );
|
4905 4999 | ::pyo3::Python::with_gil(|py| {
|
4906 5000 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4907 5001 | let output = if handler.args == 1 {
|
4908 5002 | pyhandler.call1((input,))?
|
4909 5003 | } else {
|
4910 5004 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4911 5005 | };
|
4912 5006 | output.extract::<crate::output::TimestampFormatHeadersOutput>()
|
4913 5007 | })
|
4914 5008 | };
|
4915 5009 | // Catch and record a Python traceback.
|
4916 5010 | result.map_err(|e| {
|
4917 5011 | let rich_py_err =
|
4918 5012 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
4919 5013 | e.clone_ref(py)
|
4920 5014 | }));
|
4921 5015 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
4922 5016 | e.into()
|
4923 5017 | })
|
4924 5018 | }
|
4925 5019 |
|
5020 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
4926 5021 | /// Python handler for operation `NullAndEmptyHeadersServer`.
|
4927 5022 | pub(crate) async fn null_and_empty_headers_server(
|
4928 5023 | input: crate::input::NullAndEmptyHeadersServerInput,
|
4929 5024 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
4930 5025 | handler: ::aws_smithy_http_server_python::PyHandler,
|
4931 5026 | ) -> std::result::Result<
|
4932 5027 | crate::output::NullAndEmptyHeadersServerOutput,
|
4933 5028 | crate::error::NullAndEmptyHeadersServerError,
|
4934 5029 | > {
|
4935 5030 | // Async block used to run the handler and catch any Python error.
|
4936 5031 | let result = if handler.is_coroutine {
|
4937 5032 | ::tracing::trace!(
|
4938 5033 | name = "null_and_empty_headers_server",
|
4939 5034 | "executing python handler coroutine"
|
4940 5035 | );
|
4941 5036 | let result = ::pyo3::Python::with_gil(|py| {
|
4942 5037 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4943 5038 | let coroutine = if handler.args == 1 {
|
4944 5039 | pyhandler.call1((input,))?
|
4945 5040 | } else {
|
4946 5041 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4947 5042 | };
|
4948 5043 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
4949 5044 | })?;
|
4950 5045 | result.await.and_then(|r| {
|
4951 5046 | ::pyo3::Python::with_gil(|py| {
|
4952 5047 | r.extract::<crate::output::NullAndEmptyHeadersServerOutput>(py)
|
4953 5048 | })
|
4954 5049 | })
|
4955 5050 | } else {
|
4956 5051 | ::tracing::trace!(
|
4957 5052 | name = "null_and_empty_headers_server",
|
4958 5053 | "executing python handler function"
|
4959 5054 | );
|
4960 5055 | ::pyo3::Python::with_gil(|py| {
|
4961 5056 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4962 5057 | let output = if handler.args == 1 {
|
4963 5058 | pyhandler.call1((input,))?
|
4964 5059 | } else {
|
4965 5060 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
4966 5061 | };
|
4967 5062 | output.extract::<crate::output::NullAndEmptyHeadersServerOutput>()
|
4968 5063 | })
|
4969 5064 | };
|
4970 5065 | // Catch and record a Python traceback.
|
4971 5066 | result.map_err(|e| {
|
4972 5067 | let rich_py_err =
|
4973 5068 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
4974 5069 | e.clone_ref(py)
|
4975 5070 | }));
|
4976 5071 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
4977 5072 | e.into()
|
4978 5073 | })
|
4979 5074 | }
|
4980 5075 |
|
5076 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
4981 5077 | /// Python handler for operation `NullAndEmptyHeadersClient`.
|
4982 5078 | pub(crate) async fn null_and_empty_headers_client(
|
4983 5079 | input: crate::input::NullAndEmptyHeadersClientInput,
|
4984 5080 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
4985 5081 | handler: ::aws_smithy_http_server_python::PyHandler,
|
4986 5082 | ) -> std::result::Result<
|
4987 5083 | crate::output::NullAndEmptyHeadersClientOutput,
|
4988 5084 | crate::error::NullAndEmptyHeadersClientError,
|
4989 5085 | > {
|
4990 5086 | // Async block used to run the handler and catch any Python error.
|
4991 5087 | let result = if handler.is_coroutine {
|
4992 5088 | ::tracing::trace!(
|
4993 5089 | name = "null_and_empty_headers_client",
|
4994 5090 | "executing python handler coroutine"
|
4995 5091 | );
|
4996 5092 | let result = ::pyo3::Python::with_gil(|py| {
|
4997 5093 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
4998 5094 | let coroutine = if handler.args == 1 {
|
4999 5095 | pyhandler.call1((input,))?
|
5000 5096 | } else {
|
5001 5097 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
5002 5098 | };
|
5003 5099 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
5004 5100 | })?;
|
5005 5101 | result.await.and_then(|r| {
|
5006 5102 | ::pyo3::Python::with_gil(|py| {
|
5007 5103 | r.extract::<crate::output::NullAndEmptyHeadersClientOutput>(py)
|
5008 5104 | })
|
5009 5105 | })
|
5010 5106 | } else {
|
5011 5107 | ::tracing::trace!(
|
5012 5108 | name = "null_and_empty_headers_client",
|
5013 5109 | "executing python handler function"
|
5014 5110 | );
|
5015 5111 | ::pyo3::Python::with_gil(|py| {
|
5016 5112 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
5017 5113 | let output = if handler.args == 1 {
|
5018 5114 | pyhandler.call1((input,))?
|
5019 5115 | } else {
|
5020 5116 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
5021 5117 | };
|
5022 5118 | output.extract::<crate::output::NullAndEmptyHeadersClientOutput>()
|
5023 5119 | })
|
5024 5120 | };
|
5025 5121 | // Catch and record a Python traceback.
|
5026 5122 | result.map_err(|e| {
|
5027 5123 | let rich_py_err =
|
5028 5124 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
5029 5125 | e.clone_ref(py)
|
5030 5126 | }));
|
5031 5127 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
5032 5128 | e.into()
|
5033 5129 | })
|
5034 5130 | }
|
5035 5131 |
|
5132 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
5036 5133 | /// Python handler for operation `InputAndOutputWithHeaders`.
|
5037 5134 | pub(crate) async fn input_and_output_with_headers(
|
5038 5135 | input: crate::input::InputAndOutputWithHeadersInput,
|
5039 5136 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
5040 5137 | handler: ::aws_smithy_http_server_python::PyHandler,
|
5041 5138 | ) -> std::result::Result<
|
5042 5139 | crate::output::InputAndOutputWithHeadersOutput,
|
5043 5140 | crate::error::InputAndOutputWithHeadersError,
|
5044 5141 | > {
|
5045 5142 | // Async block used to run the handler and catch any Python error.
|
5046 5143 | let result = if handler.is_coroutine {
|
5047 5144 | ::tracing::trace!(
|
5048 5145 | name = "input_and_output_with_headers",
|
5049 5146 | "executing python handler coroutine"
|
5050 5147 | );
|
5051 5148 | let result = ::pyo3::Python::with_gil(|py| {
|
5052 5149 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
5053 5150 | let coroutine = if handler.args == 1 {
|
5054 5151 | pyhandler.call1((input,))?
|
5055 5152 | } else {
|
5056 5153 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
5057 5154 | };
|
5058 5155 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
5059 5156 | })?;
|
5060 5157 | result.await.and_then(|r| {
|
5061 5158 | ::pyo3::Python::with_gil(|py| {
|
5062 5159 | r.extract::<crate::output::InputAndOutputWithHeadersOutput>(py)
|
5063 5160 | })
|
5064 5161 | })
|
5065 5162 | } else {
|
5066 5163 | ::tracing::trace!(
|
5067 5164 | name = "input_and_output_with_headers",
|
5068 5165 | "executing python handler function"
|
5069 5166 | );
|
5070 5167 | ::pyo3::Python::with_gil(|py| {
|
5071 5168 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
5072 5169 | let output = if handler.args == 1 {
|
5073 5170 | pyhandler.call1((input,))?
|
5074 5171 | } else {
|
5075 5172 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
5076 5173 | };
|
5077 5174 | output.extract::<crate::output::InputAndOutputWithHeadersOutput>()
|
5078 5175 | })
|
5079 5176 | };
|
5080 5177 | // Catch and record a Python traceback.
|
5081 5178 | result.map_err(|e| {
|
5082 5179 | let rich_py_err =
|
5083 5180 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
5084 5181 | e.clone_ref(py)
|
5085 5182 | }));
|
5086 5183 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
5087 5184 | e.into()
|
5088 5185 | })
|
5089 5186 | }
|
5090 5187 |
|
5188 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
5091 5189 | /// Python handler for operation `UnitInputAndOutput`.
|
5092 5190 | pub(crate) async fn unit_input_and_output(
|
5093 5191 | input: crate::input::UnitInputAndOutputInput,
|
5094 5192 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
5095 5193 | handler: ::aws_smithy_http_server_python::PyHandler,
|
5096 5194 | ) -> std::result::Result<
|
5097 5195 | crate::output::UnitInputAndOutputOutput,
|
5098 5196 | crate::error::UnitInputAndOutputError,
|
5099 5197 | > {
|
5100 5198 | // Async block used to run the handler and catch any Python error.
|
5101 5199 | let result = if handler.is_coroutine {
|
5102 5200 | ::tracing::trace!(
|
5103 5201 | name = "unit_input_and_output",
|
5104 5202 | "executing python handler coroutine"
|
5105 5203 | );
|
5106 5204 | let result = ::pyo3::Python::with_gil(|py| {
|
5107 5205 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
5108 5206 | let coroutine = if handler.args == 1 {
|
5109 5207 | pyhandler.call1((input,))?
|
5110 5208 | } else {
|
5111 5209 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
5112 5210 | };
|
5113 5211 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
5114 5212 | })?;
|
5115 5213 | result.await.and_then(|r| {
|
5116 5214 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::UnitInputAndOutputOutput>(py))
|
5117 5215 | })
|
5118 5216 | } else {
|
5119 5217 | ::tracing::trace!(
|
5120 5218 | name = "unit_input_and_output",
|
5121 5219 | "executing python handler function"
|
5122 5220 | );
|
5123 5221 | ::pyo3::Python::with_gil(|py| {
|
5124 5222 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
5125 5223 | let output = if handler.args == 1 {
|
5126 5224 | pyhandler.call1((input,))?
|
5127 5225 | } else {
|
5128 5226 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
5129 5227 | };
|
5130 5228 | output.extract::<crate::output::UnitInputAndOutputOutput>()
|
5131 5229 | })
|
5132 5230 | };
|
5133 5231 | // Catch and record a Python traceback.
|
5134 5232 | result.map_err(|e| {
|
5135 5233 | let rich_py_err =
|
5136 5234 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
5137 5235 | e.clone_ref(py)
|
5138 5236 | }));
|
5139 5237 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
5140 5238 | e.into()
|
5141 5239 | })
|
5142 5240 | }
|
5143 5241 |
|
5242 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
5144 5243 | /// Python handler for operation `EmptyInputAndEmptyOutput`.
|
5145 5244 | pub(crate) async fn empty_input_and_empty_output(
|
5146 5245 | input: crate::input::EmptyInputAndEmptyOutputInput,
|
5147 5246 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
5148 5247 | handler: ::aws_smithy_http_server_python::PyHandler,
|
5149 5248 | ) -> std::result::Result<
|
5150 5249 | crate::output::EmptyInputAndEmptyOutputOutput,
|
5151 5250 | crate::error::EmptyInputAndEmptyOutputError,
|
5152 5251 | > {
|
5153 5252 | // Async block used to run the handler and catch any Python error.
|
5154 5253 | let result = if handler.is_coroutine {
|
5155 5254 | ::tracing::trace!(
|
5156 5255 | name = "empty_input_and_empty_output",
|
5157 5256 | "executing python handler coroutine"
|
5158 5257 | );
|
5159 5258 | let result = ::pyo3::Python::with_gil(|py| {
|
5160 5259 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
5161 5260 | let coroutine = if handler.args == 1 {
|
5162 5261 | pyhandler.call1((input,))?
|
5163 5262 | } else {
|
5164 5263 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
5165 5264 | };
|
5166 5265 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
5167 5266 | })?;
|
5168 5267 | result.await.and_then(|r| {
|
5169 5268 | ::pyo3::Python::with_gil(|py| {
|
5170 5269 | r.extract::<crate::output::EmptyInputAndEmptyOutputOutput>(py)
|
5171 5270 | })
|
5172 5271 | })
|
5173 5272 | } else {
|
5174 5273 | ::tracing::trace!(
|
5175 5274 | name = "empty_input_and_empty_output",
|
5176 5275 | "executing python handler function"
|
5177 5276 | );
|
5178 5277 | ::pyo3::Python::with_gil(|py| {
|
5179 5278 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
5180 5279 | let output = if handler.args == 1 {
|
5181 5280 | pyhandler.call1((input,))?
|
5182 5281 | } else {
|
5183 5282 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
5184 5283 | };
|
5185 5284 | output.extract::<crate::output::EmptyInputAndEmptyOutputOutput>()
|
5186 5285 | })
|
5187 5286 | };
|
5188 5287 | // Catch and record a Python traceback.
|
5189 5288 | result.map_err(|e| {
|
5190 5289 | let rich_py_err =
|
5191 5290 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
5192 5291 | e.clone_ref(py)
|
5193 5292 | }));
|
5194 5293 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
5195 5294 | e.into()
|
5196 5295 | })
|
5197 5296 | }
|
5198 5297 |
|
5298 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
5199 5299 | /// Python handler for operation `NoInputAndOutput`.
|
5200 5300 | pub(crate) async fn no_input_and_output(
|
5201 5301 | input: crate::input::NoInputAndOutputInput,
|
5202 5302 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
5203 5303 | handler: ::aws_smithy_http_server_python::PyHandler,
|
5204 5304 | ) -> std::result::Result<crate::output::NoInputAndOutputOutput, crate::error::NoInputAndOutputError>
|
5205 5305 | {
|
5206 5306 | // Async block used to run the handler and catch any Python error.
|
5207 5307 | let result = if handler.is_coroutine {
|
5208 5308 | ::tracing::trace!(
|
5209 5309 | name = "no_input_and_output",
|
5210 5310 | "executing python handler coroutine"
|
5211 5311 | );
|
5212 5312 | let result = ::pyo3::Python::with_gil(|py| {
|
5213 5313 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
5214 5314 | let coroutine = if handler.args == 1 {
|
5215 5315 | pyhandler.call1((input,))?
|
5216 5316 | } else {
|
5217 5317 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
5218 5318 | };
|
5219 5319 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
5220 5320 | })?;
|
5221 5321 | result.await.and_then(|r| {
|
5222 5322 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::NoInputAndOutputOutput>(py))
|
5223 5323 | })
|
5224 5324 | } else {
|
5225 5325 | ::tracing::trace!(
|
5226 5326 | name = "no_input_and_output",
|
5227 5327 | "executing python handler function"
|
5228 5328 | );
|
5229 5329 | ::pyo3::Python::with_gil(|py| {
|
5230 5330 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
5231 5331 | let output = if handler.args == 1 {
|
5232 5332 | pyhandler.call1((input,))?
|
5233 5333 | } else {
|
5234 5334 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
5235 5335 | };
|
5236 5336 | output.extract::<crate::output::NoInputAndOutputOutput>()
|
5237 5337 | })
|
5238 5338 | };
|
5239 5339 | // Catch and record a Python traceback.
|
5240 5340 | result.map_err(|e| {
|
5241 5341 | let rich_py_err =
|
5242 5342 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
5243 5343 | e.clone_ref(py)
|
5244 5344 | }));
|
5245 5345 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
5246 5346 | e.into()
|
5247 5347 | })
|
5248 5348 | }
|
5249 5349 |
|
5350 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
5250 5351 | /// Python handler for operation `NoInputAndNoOutput`.
|
5251 5352 | pub(crate) async fn no_input_and_no_output(
|
5252 5353 | input: crate::input::NoInputAndNoOutputInput,
|
5253 5354 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
5254 5355 | handler: ::aws_smithy_http_server_python::PyHandler,
|
5255 5356 | ) -> std::result::Result<
|
5256 5357 | crate::output::NoInputAndNoOutputOutput,
|
5257 5358 | crate::error::NoInputAndNoOutputError,
|
5258 5359 | > {
|
5259 5360 | // Async block used to run the handler and catch any Python error.
|