1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | /// Python handler for operation `RPCEcho`.
|
3 - | pub(crate) async fn rpc_echo(
|
4 - | input: crate::input::RpcEchoInput,
|
2 + | /// Python handler for operation `ReservedWordsAsMembers`.
|
3 + | pub(crate) async fn reserved_words_as_members(
|
4 + | input: crate::input::ReservedWordsAsMembersInput,
|
5 5 | state: ::aws_smithy_legacy_http_server::Extension<
|
6 6 | ::aws_smithy_http_server_python::context::PyContext,
|
7 7 | >,
|
8 8 | handler: ::aws_smithy_http_server_python::PyHandler,
|
9 - | ) -> std::result::Result<crate::output::RpcEchoOutput, crate::error::RPCEchoError> {
|
9 + | ) -> std::result::Result<
|
10 + | crate::output::ReservedWordsAsMembersOutput,
|
11 + | crate::error::ReservedWordsAsMembersError,
|
12 + | > {
|
10 13 | // Async block used to run the handler and catch any Python error.
|
11 14 | let result = if handler.is_coroutine {
|
12 - | ::tracing::trace!(name = "rpc_echo", "executing python handler coroutine");
|
15 + | ::tracing::trace!(
|
16 + | name = "reserved_words_as_members",
|
17 + | "executing python handler coroutine"
|
18 + | );
|
13 19 | let result = ::pyo3::Python::with_gil(|py| {
|
14 20 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
15 21 | let coroutine = if handler.args == 1 {
|
16 22 | pyhandler.call1((input,))?
|
17 23 | } else {
|
18 24 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
19 25 | };
|
20 26 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
21 27 | })?;
|
22 28 | result.await.and_then(|r| {
|
23 - | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::RpcEchoOutput>(py))
|
29 + | ::pyo3::Python::with_gil(|py| {
|
30 + | r.extract::<crate::output::ReservedWordsAsMembersOutput>(py)
|
31 + | })
|
24 32 | })
|
25 33 | } else {
|
26 - | ::tracing::trace!(name = "rpc_echo", "executing python handler function");
|
34 + | ::tracing::trace!(
|
35 + | name = "reserved_words_as_members",
|
36 + | "executing python handler function"
|
37 + | );
|
27 38 | ::pyo3::Python::with_gil(|py| {
|
28 39 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
29 40 | let output = if handler.args == 1 {
|
30 41 | pyhandler.call1((input,))?
|
31 42 | } else {
|
32 43 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
33 44 | };
|
34 - | output.extract::<crate::output::RpcEchoOutput>()
|
45 + | output.extract::<crate::output::ReservedWordsAsMembersOutput>()
|
35 46 | })
|
36 47 | };
|
37 48 | // Catch and record a Python traceback.
|
38 49 | result.map_err(|e| {
|
39 50 | let rich_py_err =
|
40 51 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
41 52 | e.clone_ref(py)
|
42 53 | }));
|
43 54 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
44 55 | e.into()
|
45 56 | })
|
46 57 | }
|
47 58 |
|
48 - | /// Python handler for operation `Match`.
|
49 - | pub(crate) async fn r#match(
|
50 - | input: crate::input::MatchInput,
|
59 + | /// Python handler for operation `StructureNamePunning`.
|
60 + | pub(crate) async fn structure_name_punning(
|
61 + | input: crate::input::StructureNamePunningInput,
|
51 62 | state: ::aws_smithy_legacy_http_server::Extension<
|
52 63 | ::aws_smithy_http_server_python::context::PyContext,
|
53 64 | >,
|
54 65 | handler: ::aws_smithy_http_server_python::PyHandler,
|
55 - | ) -> std::result::Result<crate::output::MatchOutput, crate::error::MatchError> {
|
66 + | ) -> std::result::Result<
|
67 + | crate::output::StructureNamePunningOutput,
|
68 + | crate::error::StructureNamePunningError,
|
69 + | > {
|
56 70 | // Async block used to run the handler and catch any Python error.
|
57 71 | let result = if handler.is_coroutine {
|
58 - | ::tracing::trace!(name = "r#match", "executing python handler coroutine");
|
72 + | ::tracing::trace!(
|
73 + | name = "structure_name_punning",
|
74 + | "executing python handler coroutine"
|
75 + | );
|
59 76 | let result = ::pyo3::Python::with_gil(|py| {
|
60 77 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
61 78 | let coroutine = if handler.args == 1 {
|
62 79 | pyhandler.call1((input,))?
|
63 80 | } else {
|
64 81 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
65 82 | };
|
66 83 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
67 84 | })?;
|
68 85 | result.await.and_then(|r| {
|
69 - | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::MatchOutput>(py))
|
86 + | ::pyo3::Python::with_gil(|py| {
|
87 + | r.extract::<crate::output::StructureNamePunningOutput>(py)
|
88 + | })
|
70 89 | })
|
71 90 | } else {
|
72 - | ::tracing::trace!(name = "r#match", "executing python handler function");
|
91 + | ::tracing::trace!(
|
92 + | name = "structure_name_punning",
|
93 + | "executing python handler function"
|
94 + | );
|
73 95 | ::pyo3::Python::with_gil(|py| {
|
74 96 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
75 97 | let output = if handler.args == 1 {
|
76 98 | pyhandler.call1((input,))?
|
77 99 | } else {
|
78 100 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
79 101 | };
|
80 - | output.extract::<crate::output::MatchOutput>()
|
102 + | output.extract::<crate::output::StructureNamePunningOutput>()
|
81 103 | })
|
82 104 | };
|
83 105 | // Catch and record a Python traceback.
|
84 106 | result.map_err(|e| {
|
85 107 | let rich_py_err =
|
86 108 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
87 109 | e.clone_ref(py)
|
88 110 | }));
|
89 111 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
90 112 | e.into()
|
91 113 | })
|
92 114 | }
|
93 115 |
|
94 - | /// Python handler for operation `Option`.
|
95 - | pub(crate) async fn option(
|
96 - | input: crate::input::OptionInput,
|
116 + | /// Python handler for operation `ErrCollisions`.
|
117 + | pub(crate) async fn err_collisions(
|
118 + | input: crate::input::ErrCollisionsInput,
|
97 119 | state: ::aws_smithy_legacy_http_server::Extension<
|
98 120 | ::aws_smithy_http_server_python::context::PyContext,
|
99 121 | >,
|
100 122 | handler: ::aws_smithy_http_server_python::PyHandler,
|
101 - | ) -> std::result::Result<crate::output::OptionOutput, crate::error::OptionError> {
|
123 + | ) -> std::result::Result<crate::output::ErrCollisionsOutput, crate::error::ErrCollisionsError> {
|
102 124 | // Async block used to run the handler and catch any Python error.
|
103 125 | let result = if handler.is_coroutine {
|
104 - | ::tracing::trace!(name = "option", "executing python handler coroutine");
|
126 + | ::tracing::trace!(
|
127 + | name = "err_collisions",
|
128 + | "executing python handler coroutine"
|
129 + | );
|
105 130 | let result = ::pyo3::Python::with_gil(|py| {
|
106 131 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
107 132 | let coroutine = if handler.args == 1 {
|
108 133 | pyhandler.call1((input,))?
|
109 134 | } else {
|
110 135 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
111 136 | };
|
112 137 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
113 138 | })?;
|
114 139 | result.await.and_then(|r| {
|
115 - | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::OptionOutput>(py))
|
140 + | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::ErrCollisionsOutput>(py))
|
116 141 | })
|
117 142 | } else {
|
118 - | ::tracing::trace!(name = "option", "executing python handler function");
|
143 + | ::tracing::trace!(name = "err_collisions", "executing python handler function");
|
119 144 | ::pyo3::Python::with_gil(|py| {
|
120 145 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
121 146 | let output = if handler.args == 1 {
|
122 147 | pyhandler.call1((input,))?
|
123 148 | } else {
|
124 149 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
125 150 | };
|
126 - | output.extract::<crate::output::OptionOutput>()
|
151 + | output.extract::<crate::output::ErrCollisionsOutput>()
|
127 152 | })
|
128 153 | };
|
129 154 | // Catch and record a Python traceback.
|
130 155 | result.map_err(|e| {
|
131 156 | let rich_py_err =
|
132 157 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
133 158 | e.clone_ref(py)
|
134 159 | }));
|
135 160 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
136 161 | e.into()
|
137 162 | })
|
138 163 | }
|
139 164 |
|
140 165 | /// Python handler for operation `Result`.
|
141 166 | pub(crate) async fn result(
|
142 167 | input: crate::input::ResultInput,
|
143 168 | state: ::aws_smithy_legacy_http_server::Extension<
|
144 169 | ::aws_smithy_http_server_python::context::PyContext,
|
145 170 | >,
|
146 171 | handler: ::aws_smithy_http_server_python::PyHandler,
|
147 172 | ) -> std::result::Result<crate::output::ResultOutput, crate::error::ResultError> {
|
148 173 | // Async block used to run the handler and catch any Python error.
|
149 174 | let result = if handler.is_coroutine {
|
150 175 | ::tracing::trace!(name = "result", "executing python handler coroutine");
|
151 176 | let result = ::pyo3::Python::with_gil(|py| {
|
152 177 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
153 178 | let coroutine = if handler.args == 1 {
|
154 179 | pyhandler.call1((input,))?
|
155 180 | } else {
|
156 181 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
157 182 | };
|
158 183 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
159 184 | })?;
|
160 185 | result.await.and_then(|r| {
|
161 186 | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::ResultOutput>(py))
|
162 187 | })
|
163 188 | } else {
|
164 189 | ::tracing::trace!(name = "result", "executing python handler function");
|
165 190 | ::pyo3::Python::with_gil(|py| {
|
166 191 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
167 192 | let output = if handler.args == 1 {
|
168 193 | pyhandler.call1((input,))?
|
169 194 | } else {
|
170 195 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
171 196 | };
|
172 197 | output.extract::<crate::output::ResultOutput>()
|
173 198 | })
|
174 199 | };
|
175 200 | // Catch and record a Python traceback.
|
176 201 | result.map_err(|e| {
|
177 202 | let rich_py_err =
|
178 203 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
179 204 | e.clone_ref(py)
|
180 205 | }));
|
181 206 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
182 207 | e.into()
|
183 208 | })
|
184 209 | }
|
185 210 |
|
186 - | /// Python handler for operation `ErrCollisions`.
|
187 - | pub(crate) async fn err_collisions(
|
188 - | input: crate::input::ErrCollisionsInput,
|
211 + | /// Python handler for operation `Option`.
|
212 + | pub(crate) async fn option(
|
213 + | input: crate::input::OptionInput,
|
189 214 | state: ::aws_smithy_legacy_http_server::Extension<
|
190 215 | ::aws_smithy_http_server_python::context::PyContext,
|
191 216 | >,
|
192 217 | handler: ::aws_smithy_http_server_python::PyHandler,
|
193 - | ) -> std::result::Result<crate::output::ErrCollisionsOutput, crate::error::ErrCollisionsError> {
|
218 + | ) -> std::result::Result<crate::output::OptionOutput, crate::error::OptionError> {
|
194 219 | // Async block used to run the handler and catch any Python error.
|
195 220 | let result = if handler.is_coroutine {
|
196 - | ::tracing::trace!(
|
197 - | name = "err_collisions",
|
198 - | "executing python handler coroutine"
|
199 - | );
|
221 + | ::tracing::trace!(name = "option", "executing python handler coroutine");
|
200 222 | let result = ::pyo3::Python::with_gil(|py| {
|
201 223 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
202 224 | let coroutine = if handler.args == 1 {
|
203 225 | pyhandler.call1((input,))?
|
204 226 | } else {
|
205 227 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
206 228 | };
|
207 229 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
208 230 | })?;
|
209 231 | result.await.and_then(|r| {
|
210 - | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::ErrCollisionsOutput>(py))
|
232 + | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::OptionOutput>(py))
|
211 233 | })
|
212 234 | } else {
|
213 - | ::tracing::trace!(name = "err_collisions", "executing python handler function");
|
235 + | ::tracing::trace!(name = "option", "executing python handler function");
|
214 236 | ::pyo3::Python::with_gil(|py| {
|
215 237 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
216 238 | let output = if handler.args == 1 {
|
217 239 | pyhandler.call1((input,))?
|
218 240 | } else {
|
219 241 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
220 242 | };
|
221 - | output.extract::<crate::output::ErrCollisionsOutput>()
|
243 + | output.extract::<crate::output::OptionOutput>()
|
222 244 | })
|
223 245 | };
|
224 246 | // Catch and record a Python traceback.
|
225 247 | result.map_err(|e| {
|
226 248 | let rich_py_err =
|
227 249 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
228 250 | e.clone_ref(py)
|
229 251 | }));
|
230 252 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
231 253 | e.into()
|
232 254 | })
|
233 255 | }
|
234 256 |
|
235 - | /// Python handler for operation `StructureNamePunning`.
|
236 - | pub(crate) async fn structure_name_punning(
|
237 - | input: crate::input::StructureNamePunningInput,
|
257 + | /// Python handler for operation `Match`.
|
258 + | pub(crate) async fn r#match(
|
259 + | input: crate::input::MatchInput,
|
238 260 | state: ::aws_smithy_legacy_http_server::Extension<
|
239 261 | ::aws_smithy_http_server_python::context::PyContext,
|
240 262 | >,
|
241 263 | handler: ::aws_smithy_http_server_python::PyHandler,
|
242 - | ) -> std::result::Result<
|
243 - | crate::output::StructureNamePunningOutput,
|
244 - | crate::error::StructureNamePunningError,
|
245 - | > {
|
264 + | ) -> std::result::Result<crate::output::MatchOutput, crate::error::MatchError> {
|
246 265 | // Async block used to run the handler and catch any Python error.
|
247 266 | let result = if handler.is_coroutine {
|
248 - | ::tracing::trace!(
|
249 - | name = "structure_name_punning",
|
250 - | "executing python handler coroutine"
|
251 - | );
|
267 + | ::tracing::trace!(name = "r#match", "executing python handler coroutine");
|
252 268 | let result = ::pyo3::Python::with_gil(|py| {
|
253 269 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
254 270 | let coroutine = if handler.args == 1 {
|
255 271 | pyhandler.call1((input,))?
|
256 272 | } else {
|
257 273 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
258 274 | };
|
259 275 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
260 276 | })?;
|
261 277 | result.await.and_then(|r| {
|
262 - | ::pyo3::Python::with_gil(|py| {
|
263 - | r.extract::<crate::output::StructureNamePunningOutput>(py)
|
264 - | })
|
278 + | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::MatchOutput>(py))
|
265 279 | })
|
266 280 | } else {
|
267 - | ::tracing::trace!(
|
268 - | name = "structure_name_punning",
|
269 - | "executing python handler function"
|
270 - | );
|
281 + | ::tracing::trace!(name = "r#match", "executing python handler function");
|
271 282 | ::pyo3::Python::with_gil(|py| {
|
272 283 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
273 284 | let output = if handler.args == 1 {
|
274 285 | pyhandler.call1((input,))?
|
275 286 | } else {
|
276 287 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
277 288 | };
|
278 - | output.extract::<crate::output::StructureNamePunningOutput>()
|
289 + | output.extract::<crate::output::MatchOutput>()
|
279 290 | })
|
280 291 | };
|
281 292 | // Catch and record a Python traceback.
|
282 293 | result.map_err(|e| {
|
283 294 | let rich_py_err =
|
284 295 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
285 296 | e.clone_ref(py)
|
286 297 | }));
|
287 298 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
288 299 | e.into()
|
289 300 | })
|
290 301 | }
|
291 302 |
|
292 - | /// Python handler for operation `ReservedWordsAsMembers`.
|
293 - | pub(crate) async fn reserved_words_as_members(
|
294 - | input: crate::input::ReservedWordsAsMembersInput,
|
303 + | /// Python handler for operation `RPCEcho`.
|
304 + | pub(crate) async fn rpc_echo(
|
305 + | input: crate::input::RpcEchoInput,
|
295 306 | state: ::aws_smithy_legacy_http_server::Extension<
|
296 307 | ::aws_smithy_http_server_python::context::PyContext,
|
297 308 | >,
|
298 309 | handler: ::aws_smithy_http_server_python::PyHandler,
|
299 - | ) -> std::result::Result<
|
300 - | crate::output::ReservedWordsAsMembersOutput,
|
301 - | crate::error::ReservedWordsAsMembersError,
|
302 - | > {
|
310 + | ) -> std::result::Result<crate::output::RpcEchoOutput, crate::error::RPCEchoError> {
|
303 311 | // Async block used to run the handler and catch any Python error.
|
304 312 | let result = if handler.is_coroutine {
|
305 - | ::tracing::trace!(
|
306 - | name = "reserved_words_as_members",
|
307 - | "executing python handler coroutine"
|
308 - | );
|
313 + | ::tracing::trace!(name = "rpc_echo", "executing python handler coroutine");
|
309 314 | let result = ::pyo3::Python::with_gil(|py| {
|
310 315 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
311 316 | let coroutine = if handler.args == 1 {
|
312 317 | pyhandler.call1((input,))?
|
313 318 | } else {
|
314 319 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
315 320 | };
|
316 321 | ::pyo3_asyncio::tokio::into_future(coroutine)
|
317 322 | })?;
|
318 323 | result.await.and_then(|r| {
|
319 - | ::pyo3::Python::with_gil(|py| {
|
320 - | r.extract::<crate::output::ReservedWordsAsMembersOutput>(py)
|
321 - | })
|
324 + | ::pyo3::Python::with_gil(|py| r.extract::<crate::output::RpcEchoOutput>(py))
|
322 325 | })
|
323 326 | } else {
|
324 - | ::tracing::trace!(
|
325 - | name = "reserved_words_as_members",
|
326 - | "executing python handler function"
|
327 - | );
|
327 + | ::tracing::trace!(name = "rpc_echo", "executing python handler function");
|
328 328 | ::pyo3::Python::with_gil(|py| {
|
329 329 | let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
|
330 330 | let output = if handler.args == 1 {
|
331 331 | pyhandler.call1((input,))?
|
332 332 | } else {
|
333 333 | pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
|
334 334 | };
|
335 - | output.extract::<crate::output::ReservedWordsAsMembersOutput>()
|
335 + | output.extract::<crate::output::RpcEchoOutput>()
|
336 336 | })
|
337 337 | };
|
338 338 | // Catch and record a Python traceback.
|
339 339 | result.map_err(|e| {
|
340 340 | let rich_py_err =
|
341 341 | ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
|
342 342 | e.clone_ref(py)
|
343 343 | }));
|
344 344 | ::tracing::error!(error = ?rich_py_err, "handler error");
|
345 345 | e.into()
|