Attributes: id (str): state (PlaidItemSyncState): item (ItemData): error_message (Union[None, Unset, str]):
| 20 | |
| 21 | @_attrs_define |
| 22 | class SyncData: |
| 23 | """ |
| 24 | Attributes: |
| 25 | id (str): |
| 26 | state (PlaidItemSyncState): |
| 27 | item (ItemData): |
| 28 | error_message (Union[None, Unset, str]): |
| 29 | """ |
| 30 | |
| 31 | id: str |
| 32 | state: PlaidItemSyncState |
| 33 | item: "ItemData" |
| 34 | error_message: Union[None, Unset, str] = UNSET |
| 35 | additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) |
| 36 | |
| 37 | def to_dict(self) -> dict[str, Any]: |
| 38 | id = self.id |
| 39 | |
| 40 | state = self.state.value |
| 41 | |
| 42 | item = self.item.to_dict() |
| 43 | |
| 44 | error_message: Union[None, Unset, str] |
| 45 | if isinstance(self.error_message, Unset): |
| 46 | error_message = UNSET |
| 47 | else: |
| 48 | error_message = self.error_message |
| 49 | |
| 50 | field_dict: dict[str, Any] = {} |
| 51 | field_dict.update(self.additional_properties) |
| 52 | field_dict.update( |
| 53 | { |
| 54 | "id": id, |
| 55 | "state": state, |
| 56 | "item": item, |
| 57 | } |
| 58 | ) |
| 59 | if error_message is not UNSET: |
| 60 | field_dict["error_message"] = error_message |
| 61 | |
| 62 | return field_dict |
| 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 |
nothing calls this directly
no outgoing calls
no test coverage detected