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 `QueryPrecedence`.
|
3 4 | pub(crate) async fn query_precedence(
|
4 5 | input: crate::input::QueryPrecedenceInput,
|
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<crate::output::QueryPrecedenceOutput, crate::error::QueryPrecedenceError> {
|
8 9 | // Async block used to run the handler and catch any Python error.
|
9 10 | let result = if handler.is_coroutine {
|
10 11 | ::tracing::trace!(
|
11 12 | name = "query_precedence",
|
12 13 | "executing python handler coroutine"
|
13 14 | );
|
14 15 | let result = ::pyo3::Python::with_gil(|py| {
|
15 16 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
16 17 | let coroutine = if handler.args == 1 {
|
17 18 | pyhandler.call1((input,))?
|
18 19 | } else {
|
19 20 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
20 21 | };
|
21 22 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
22 23 | })?;
|
23 24 | result.await.and_then(|r| {
|
24 25 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::QueryPrecedenceOutput>(py))
|
25 26 | })
|
26 27 | } else {
|
27 28 | ::tracing::trace!(
|
28 29 | name = "query_precedence",
|
29 30 | "executing python handler function"
|
30 31 | );
|
31 32 | ::pyo3::Python::with_gil(|py| {
|
32 33 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
33 34 | let output = if handler.args == 1 {
|
34 35 | pyhandler.call1((input,))?
|
35 36 | } else {
|
36 37 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
37 38 | };
|
38 39 | output.extract::<crate::output::QueryPrecedenceOutput>()
|
39 40 | })
|
40 41 | };
|
41 42 | // Catch and record a Python traceback.
|
42 43 | result.map_err(|e| {
|
43 44 | let rich_py_err =
|
44 45 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
45 46 | e.clone_ref(py)
|
46 47 | }));
|
47 48 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
48 49 | e.into()
|
49 50 | })
|
50 51 | }
|
51 52 |
|
53 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
52 54 | /// Python handler for operation `EmptyStructWithContentOnWireOp`.
|
53 55 | pub(crate) async fn empty_struct_with_content_on_wire_op(
|
54 56 | input: crate::input::EmptyStructWithContentOnWireOpInput,
|
55 57 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
56 58 | handler: ::aws_smithy_http_server_python::PyHandler,
|
57 59 | ) -> std::result::Result<
|
58 60 | crate::output::EmptyStructWithContentOnWireOpOutput,
|
59 61 | crate::error::EmptyStructWithContentOnWireOpError,
|
60 62 | > {
|
61 63 | // Async block used to run the handler and catch any Python error.
|
62 64 | let result = if handler.is_coroutine {
|
63 65 | ::tracing::trace!(
|
64 66 | name = "empty_struct_with_content_on_wire_op",
|
65 67 | "executing python handler coroutine"
|
66 68 | );
|
67 69 | let result = ::pyo3::Python::with_gil(|py| {
|
68 70 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
69 71 | let coroutine = if handler.args == 1 {
|
70 72 | pyhandler.call1((input,))?
|
71 73 | } else {
|
72 74 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
73 75 | };
|
74 76 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
75 77 | })?;
|
76 78 | result.await.and_then(|r| {
|
77 79 | ::pyo3::Python::with_gil(|py| {
|
78 80 | r.extract::<crate::output::EmptyStructWithContentOnWireOpOutput>(py)
|
79 81 | })
|
80 82 | })
|
81 83 | } else {
|
82 84 | ::tracing::trace!(
|
83 85 | name = "empty_struct_with_content_on_wire_op",
|
84 86 | "executing python handler function"
|
85 87 | );
|
86 88 | ::pyo3::Python::with_gil(|py| {
|
87 89 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
88 90 | let output = if handler.args == 1 {
|
89 91 | pyhandler.call1((input,))?
|
90 92 | } else {
|
91 93 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
92 94 | };
|
93 95 | output.extract::<crate::output::EmptyStructWithContentOnWireOpOutput>()
|
94 96 | })
|
95 97 | };
|
96 98 | // Catch and record a Python traceback.
|
97 99 | result.map_err(|e| {
|
98 100 | let rich_py_err =
|
99 101 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
100 102 | e.clone_ref(py)
|
101 103 | }));
|
102 104 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
103 105 | e.into()
|
104 106 | })
|
105 107 | }
|
106 108 |
|
109 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
107 110 | /// Python handler for operation `CaseInsensitiveErrorOperation`.
|
108 111 | pub(crate) async fn case_insensitive_error_operation(
|
109 112 | input: crate::input::CaseInsensitiveErrorOperationInput,
|
110 113 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
111 114 | handler: ::aws_smithy_http_server_python::PyHandler,
|
112 115 | ) -> std::result::Result<
|
113 116 | crate::output::CaseInsensitiveErrorOperationOutput,
|
114 117 | crate::error::CaseInsensitiveErrorOperationError,
|
115 118 | > {
|
116 119 | // Async block used to run the handler and catch any Python error.
|
117 120 | let result = if handler.is_coroutine {
|
118 121 | ::tracing::trace!(
|
119 122 | name = "case_insensitive_error_operation",
|
120 123 | "executing python handler coroutine"
|
121 124 | );
|
122 125 | let result = ::pyo3::Python::with_gil(|py| {
|
123 126 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
124 127 | let coroutine = if handler.args == 1 {
|
125 128 | pyhandler.call1((input,))?
|
126 129 | } else {
|
127 130 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
128 131 | };
|
129 132 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
130 133 | })?;
|
131 134 | result.await.and_then(|r| {
|
132 135 | ::pyo3::Python::with_gil(|py| {
|
133 136 | r.extract::<crate::output::CaseInsensitiveErrorOperationOutput>(py)
|
134 137 | })
|
135 138 | })
|
136 139 | } else {
|
137 140 | ::tracing::trace!(
|
138 141 | name = "case_insensitive_error_operation",
|
139 142 | "executing python handler function"
|
140 143 | );
|
141 144 | ::pyo3::Python::with_gil(|py| {
|
142 145 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
143 146 | let output = if handler.args == 1 {
|
144 147 | pyhandler.call1((input,))?
|
145 148 | } else {
|
146 149 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
147 150 | };
|
148 151 | output.extract::<crate::output::CaseInsensitiveErrorOperationOutput>()
|
149 152 | })
|
150 153 | };
|
151 154 | // Catch and record a Python traceback.
|
152 155 | result.map_err(|e| {
|
153 156 | let rich_py_err =
|
154 157 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
155 158 | e.clone_ref(py)
|
156 159 | }));
|
157 160 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
158 161 | e.into()
|
159 162 | })
|
160 163 | }
|
161 164 |
|
165 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
162 166 | /// Python handler for operation `NullInNonSparse`.
|
163 167 | pub(crate) async fn null_in_non_sparse(
|
164 168 | input: crate::input::NullInNonSparseInput,
|
165 169 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
166 170 | handler: ::aws_smithy_http_server_python::PyHandler,
|
167 171 | ) -> std::result::Result<crate::output::NullInNonSparseOutput, crate::error::NullInNonSparseError> {
|
168 172 | // Async block used to run the handler and catch any Python error.
|
169 173 | let result = if handler.is_coroutine {
|
170 174 | ::tracing::trace!(
|
171 175 | name = "null_in_non_sparse",
|
172 176 | "executing python handler coroutine"
|
173 177 | );
|
174 178 | let result = ::pyo3::Python::with_gil(|py| {
|
175 179 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
176 180 | let coroutine = if handler.args == 1 {
|
177 181 | pyhandler.call1((input,))?
|
178 182 | } else {
|
179 183 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
180 184 | };
|
181 185 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
182 186 | })?;
|
183 187 | result.await.and_then(|r| {
|
184 188 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::NullInNonSparseOutput>(py))
|
185 189 | })
|
186 190 | } else {
|
187 191 | ::tracing::trace!(
|
188 192 | name = "null_in_non_sparse",
|
189 193 | "executing python handler function"
|
190 194 | );
|
191 195 | ::pyo3::Python::with_gil(|py| {
|
192 196 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
193 197 | let output = if handler.args == 1 {
|
194 198 | pyhandler.call1((input,))?
|
195 199 | } else {
|
196 200 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
197 201 | };
|
198 202 | output.extract::<crate::output::NullInNonSparseOutput>()
|
199 203 | })
|
200 204 | };
|
201 205 | // Catch and record a Python traceback.
|
202 206 | result.map_err(|e| {
|
203 207 | let rich_py_err =
|
204 208 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
205 209 | e.clone_ref(py)
|
206 210 | }));
|
207 211 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
208 212 | e.into()
|
209 213 | })
|
210 214 | }
|
211 215 |
|
216 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
212 217 | /// Python handler for operation `EscapedStringValues`.
|
213 218 | pub(crate) async fn escaped_string_values(
|
214 219 | input: crate::input::EscapedStringValuesInput,
|
215 220 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
216 221 | handler: ::aws_smithy_http_server_python::PyHandler,
|
217 222 | ) -> std::result::Result<
|
218 223 | crate::output::EscapedStringValuesOutput,
|
219 224 | crate::error::EscapedStringValuesError,
|
220 225 | > {
|
221 226 | // Async block used to run the handler and catch any Python error.
|
222 227 | let result = if handler.is_coroutine {
|
223 228 | ::tracing::trace!(
|
224 229 | name = "escaped_string_values",
|
225 230 | "executing python handler coroutine"
|
226 231 | );
|
227 232 | let result = ::pyo3::Python::with_gil(|py| {
|
228 233 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
229 234 | let coroutine = if handler.args == 1 {
|
230 235 | pyhandler.call1((input,))?
|
231 236 | } else {
|
232 237 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
233 238 | };
|
234 239 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
235 240 | })?;
|
236 241 | result.await.and_then(|r| {
|
237 242 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::EscapedStringValuesOutput>(py))
|
238 243 | })
|
239 244 | } else {
|
240 245 | ::tracing::trace!(
|
241 246 | name = "escaped_string_values",
|
242 247 | "executing python handler function"
|
243 248 | );
|
244 249 | ::pyo3::Python::with_gil(|py| {
|
245 250 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
246 251 | let output = if handler.args == 1 {
|
247 252 | pyhandler.call1((input,))?
|
248 253 | } else {
|
249 254 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
250 255 | };
|
251 256 | output.extract::<crate::output::EscapedStringValuesOutput>()
|
252 257 | })
|
253 258 | };
|
254 259 | // Catch and record a Python traceback.
|
255 260 | result.map_err(|e| {
|
256 261 | let rich_py_err =
|
257 262 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
258 263 | e.clone_ref(py)
|
259 264 | }));
|
260 265 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
261 266 | e.into()
|
262 267 | })
|
263 268 | }
|
264 269 |
|
270 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
265 271 | /// Python handler for operation `PrimitiveIntOp`.
|
266 272 | pub(crate) async fn primitive_int_op(
|
267 273 | input: crate::input::PrimitiveIntOpInput,
|
268 274 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
269 275 | handler: ::aws_smithy_http_server_python::PyHandler,
|
270 276 | ) -> std::result::Result<crate::output::PrimitiveIntOpOutput, crate::error::PrimitiveIntOpError> {
|
271 277 | // Async block used to run the handler and catch any Python error.
|
272 278 | let result = if handler.is_coroutine {
|
273 279 | ::tracing::trace!(
|
274 280 | name = "primitive_int_op",
|
275 281 | "executing python handler coroutine"
|
276 282 | );
|
277 283 | let result = ::pyo3::Python::with_gil(|py| {
|
278 284 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
279 285 | let coroutine = if handler.args == 1 {
|
280 286 | pyhandler.call1((input,))?
|
281 287 | } else {
|
282 288 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
283 289 | };
|
284 290 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
285 291 | })?;
|
286 292 | result.await.and_then(|r| {
|
287 293 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::PrimitiveIntOpOutput>(py))
|
288 294 | })
|
289 295 | } else {
|
290 296 | ::tracing::trace!(
|
291 297 | name = "primitive_int_op",
|
292 298 | "executing python handler function"
|
293 299 | );
|
294 300 | ::pyo3::Python::with_gil(|py| {
|
295 301 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
296 302 | let output = if handler.args == 1 {
|
297 303 | pyhandler.call1((input,))?
|
298 304 | } else {
|
299 305 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
300 306 | };
|
301 307 | output.extract::<crate::output::PrimitiveIntOpOutput>()
|
302 308 | })
|
303 309 | };
|
304 310 | // Catch and record a Python traceback.
|
305 311 | result.map_err(|e| {
|
306 312 | let rich_py_err =
|
307 313 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
308 314 | e.clone_ref(py)
|
309 315 | }));
|
310 316 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
311 317 | e.into()
|
312 318 | })
|
313 319 | }
|
314 320 |
|
321 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
315 322 | /// Python handler for operation `MapWithEnumKeyOp`.
|
316 323 | pub(crate) async fn map_with_enum_key_op(
|
317 324 | input: crate::input::MapWithEnumKeyOpInput,
|
318 325 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
319 326 | handler: ::aws_smithy_http_server_python::PyHandler,
|
320 327 | ) -> std::result::Result<crate::output::MapWithEnumKeyOpOutput, crate::error::MapWithEnumKeyOpError>
|
321 328 | {
|
322 329 | // Async block used to run the handler and catch any Python error.
|
323 330 | let result = if handler.is_coroutine {
|
324 331 | ::tracing::trace!(
|
325 332 | name = "map_with_enum_key_op",
|
326 333 | "executing python handler coroutine"
|
327 334 | );
|
328 335 | let result = ::pyo3::Python::with_gil(|py| {
|
329 336 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
330 337 | let coroutine = if handler.args == 1 {
|
331 338 | pyhandler.call1((input,))?
|
332 339 | } else {
|
333 340 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
334 341 | };
|
335 342 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
336 343 | })?;
|
337 344 | result.await.and_then(|r| {
|
338 345 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::MapWithEnumKeyOpOutput>(py))
|
339 346 | })
|
340 347 | } else {
|
341 348 | ::tracing::trace!(
|
342 349 | name = "map_with_enum_key_op",
|
343 350 | "executing python handler function"
|
344 351 | );
|
345 352 | ::pyo3::Python::with_gil(|py| {
|
346 353 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
347 354 | let output = if handler.args == 1 {
|
348 355 | pyhandler.call1((input,))?
|
349 356 | } else {
|
350 357 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
351 358 | };
|
352 359 | output.extract::<crate::output::MapWithEnumKeyOpOutput>()
|
353 360 | })
|
354 361 | };
|
355 362 | // Catch and record a Python traceback.
|
356 363 | result.map_err(|e| {
|
357 364 | let rich_py_err =
|
358 365 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
359 366 | e.clone_ref(py)
|
360 367 | }));
|
361 368 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
362 369 | e.into()
|
363 370 | })
|
364 371 | }
|
365 372 |
|
373 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
366 374 | /// Python handler for operation `StatusResponse`.
|
367 375 | pub(crate) async fn status_response(
|
368 376 | input: crate::input::StatusResponseInput,
|
369 377 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
370 378 | handler: ::aws_smithy_http_server_python::PyHandler,
|
371 379 | ) -> std::result::Result<crate::output::StatusResponseOutput, crate::error::StatusResponseError> {
|
372 380 | // Async block used to run the handler and catch any Python error.
|
373 381 | let result = if handler.is_coroutine {
|
374 382 | ::tracing::trace!(
|
375 383 | name = "status_response",
|
376 384 | "executing python handler coroutine"
|
377 385 | );
|
378 386 | let result = ::pyo3::Python::with_gil(|py| {
|
379 387 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
380 388 | let coroutine = if handler.args == 1 {
|
381 389 | pyhandler.call1((input,))?
|
382 390 | } else {
|
383 391 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
384 392 | };
|
385 393 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
386 394 | })?;
|
387 395 | result.await.and_then(|r| {
|
388 396 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::StatusResponseOutput>(py))
|
389 397 | })
|
390 398 | } else {
|
391 399 | ::tracing::trace!(
|
392 400 | name = "status_response",
|
393 401 | "executing python handler function"
|
394 402 | );
|
395 403 | ::pyo3::Python::with_gil(|py| {
|
396 404 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
397 405 | let output = if handler.args == 1 {
|
398 406 | pyhandler.call1((input,))?
|
399 407 | } else {
|
400 408 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
401 409 | };
|
402 410 | output.extract::<crate::output::StatusResponseOutput>()
|
403 411 | })
|
404 412 | };
|
405 413 | // Catch and record a Python traceback.
|
406 414 | result.map_err(|e| {
|
407 415 | let rich_py_err =
|
408 416 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
409 417 | e.clone_ref(py)
|
410 418 | }));
|
411 419 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
412 420 | e.into()
|
413 421 | })
|
414 422 | }
|
415 423 |
|
424 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
416 425 | /// Python handler for operation `EnumQuery`.
|
417 426 | pub(crate) async fn enum_query(
|
418 427 | input: crate::input::EnumQueryInput,
|
419 428 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
420 429 | handler: ::aws_smithy_http_server_python::PyHandler,
|
421 430 | ) -> std::result::Result<crate::output::EnumQueryOutput, crate::error::EnumQueryError> {
|
422 431 | // Async block used to run the handler and catch any Python error.
|
423 432 | let result = if handler.is_coroutine {
|
424 433 | ::tracing::trace!(name = "enum_query", "executing python handler coroutine");
|
425 434 | let result = ::pyo3::Python::with_gil(|py| {
|
426 435 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
427 436 | let coroutine = if handler.args == 1 {
|
428 437 | pyhandler.call1((input,))?
|
429 438 | } else {
|
430 439 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
431 440 | };
|
432 441 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
433 442 | })?;
|
434 443 | result.await.and_then(|r| {
|
435 444 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::EnumQueryOutput>(py))
|
436 445 | })
|
437 446 | } else {
|
438 447 | ::tracing::trace!(name = "enum_query", "executing python handler function");
|
439 448 | ::pyo3::Python::with_gil(|py| {
|
440 449 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
441 450 | let output = if handler.args == 1 {
|
442 451 | pyhandler.call1((input,))?
|
443 452 | } else {
|
444 453 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
445 454 | };
|
446 455 | output.extract::<crate::output::EnumQueryOutput>()
|
447 456 | })
|
448 457 | };
|
449 458 | // Catch and record a Python traceback.
|
450 459 | result.map_err(|e| {
|
451 460 | let rich_py_err =
|
452 461 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
453 462 | e.clone_ref(py)
|
454 463 | }));
|
455 464 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
456 465 | e.into()
|
457 466 | })
|
458 467 | }
|
459 468 |
|
469 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
460 470 | /// Python handler for operation `PrimitiveIntHeader`.
|
461 471 | pub(crate) async fn primitive_int_header(
|
462 472 | input: crate::input::PrimitiveIntHeaderInput,
|
463 473 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
464 474 | handler: ::aws_smithy_http_server_python::PyHandler,
|
465 475 | ) -> std::result::Result<
|
466 476 | crate::output::PrimitiveIntHeaderOutput,
|
467 477 | crate::error::PrimitiveIntHeaderError,
|
468 478 | > {
|
469 479 | // Async block used to run the handler and catch any Python error.
|
470 480 | let result = if handler.is_coroutine {
|
471 481 | ::tracing::trace!(
|
472 482 | name = "primitive_int_header",
|
473 483 | "executing python handler coroutine"
|
474 484 | );
|
475 485 | let result = ::pyo3::Python::with_gil(|py| {
|
476 486 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
477 487 | let coroutine = if handler.args == 1 {
|
478 488 | pyhandler.call1((input,))?
|
479 489 | } else {
|
480 490 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
481 491 | };
|
482 492 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
483 493 | })?;
|
484 494 | result.await.and_then(|r| {
|
485 495 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::PrimitiveIntHeaderOutput>(py))
|
486 496 | })
|
487 497 | } else {
|
488 498 | ::tracing::trace!(
|
489 499 | name = "primitive_int_header",
|
490 500 | "executing python handler function"
|
491 501 | );
|
492 502 | ::pyo3::Python::with_gil(|py| {
|
493 503 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
494 504 | let output = if handler.args == 1 {
|
495 505 | pyhandler.call1((input,))?
|
496 506 | } else {
|
497 507 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
498 508 | };
|
499 509 | output.extract::<crate::output::PrimitiveIntHeaderOutput>()
|
500 510 | })
|
501 511 | };
|
502 512 | // Catch and record a Python traceback.
|
503 513 | result.map_err(|e| {
|
504 514 | let rich_py_err =
|
505 515 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
506 516 | e.clone_ref(py)
|
507 517 | }));
|
508 518 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
509 519 | e.into()
|
510 520 | })
|
511 521 | }
|
512 522 |
|
523 + | /* PythonServerOperationHandlerGenerator.kt:61 */
|
513 524 | /// Python handler for operation `StringPayload`.
|
514 525 | pub(crate) async fn string_payload(
|
515 526 | input: crate::input::StringPayloadInput,
|
516 527 | state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
|
517 528 | handler: ::aws_smithy_http_server_python::PyHandler,
|
518 529 | ) -> std::result::Result<crate::output::StringPayloadOutput, crate::error::StringPayloadError> {
|
519 530 | // Async block used to run the handler and catch any Python error.
|
520 531 | let result = if handler.is_coroutine {
|
521 532 | ::tracing::trace!(
|
522 533 | name = "string_payload",
|