Transform dictionaries based off of type information from the given type, for example: ```py class Params(TypedDict, total=False): card_id: Required[Annotated[str, PropertyInfo(alias="cardID")]] transformed = transform({"card_id": "<my card ID>"}, Params) # {'cardID': '<my
(
data: _T,
expected_type: object,
)
| 295 | |
| 296 | |
| 297 | async def async_transform( |
| 298 | data: _T, |
| 299 | expected_type: object, |
| 300 | ) -> _T: |
| 301 | """Transform dictionaries based off of type information from the given type, for example: |
| 302 | |
| 303 | ```py |
| 304 | class Params(TypedDict, total=False): |
| 305 | card_id: Required[Annotated[str, PropertyInfo(alias="cardID")]] |
| 306 | |
| 307 | |
| 308 | transformed = transform({"card_id": "<my card ID>"}, Params) |
| 309 | # {'cardID': '<my card ID>'} |
| 310 | ``` |
| 311 | |
| 312 | Any keys / data that does not have type information given will be included as is. |
| 313 | |
| 314 | It should be noted that the transformations that this function does are not represented in the type system. |
| 315 | """ |
| 316 | transformed = await _async_transform_recursive(data, annotation=cast(type, expected_type)) |
| 317 | return cast(_T, transformed) |
| 318 | |
| 319 | |
| 320 | async def _async_transform_recursive( |
no test coverage detected