MCPcopy Create free account
hub / github.com/LaunchPlatform/beanhub-cli / from_dict

Method from_dict

beanhub_cli/internal_api/models/sync_data.py:65–92  ·  view source on GitHub ↗
(cls: type[T], src_dict: dict[str, Any])

Source from the content-addressed store, hash-verified

63
64 @classmethod
65 def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
66 from ..models.item_data import ItemData
67
68 d = src_dict.copy()
69 id = d.pop("id")
70
71 state = PlaidItemSyncState(d.pop("state"))
72
73 item = ItemData.from_dict(d.pop("item"))
74
75 def _parse_error_message(data: object) -> Union[None, Unset, str]:
76 if data is None:
77 return data
78 if isinstance(data, Unset):
79 return data
80 return cast(Union[None, Unset, str], data)
81
82 error_message = _parse_error_message(d.pop("error_message", UNSET))
83
84 sync_data = cls(
85 id=id,
86 state=state,
87 item=item,
88 error_message=error_message,
89 )
90
91 sync_data.additional_properties = d
92 return sync_data
93
94 @property
95 def additional_keys(self) -> list[str]:

Callers

nothing calls this directly

Calls 1

PlaidItemSyncStateClass · 0.85

Tested by

no test coverage detected