Parse response from service, automatically deserializing tcb_info. Args: obj: Raw response object from service tcb_info_type: The specific TcbInfo subclass to use for parsing
(cls, obj: Any, tcb_info_type: type[T])
| 258 | |
| 259 | @classmethod |
| 260 | def parse_response(cls, obj: Any, tcb_info_type: type[T]) -> "InfoResponse[T]": |
| 261 | """Parse response from service, automatically deserializing tcb_info. |
| 262 | |
| 263 | Args: |
| 264 | obj: Raw response object from service |
| 265 | tcb_info_type: The specific TcbInfo subclass to use for parsing |
| 266 | |
| 267 | """ |
| 268 | if ( |
| 269 | isinstance(obj, dict) |
| 270 | and "tcb_info" in obj |
| 271 | and isinstance(obj["tcb_info"], str) |
| 272 | ): |
| 273 | obj = dict(obj) |
| 274 | obj["tcb_info"] = tcb_info_type(**json.loads(obj["tcb_info"])) |
| 275 | return cls(**obj) |
| 276 | |
| 277 | |
| 278 | class BaseClient: |