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

Method to_dict

beanhub_cli/internal_api/models/sync_data.py:37–62  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected