Exemplo n.º 1
0
 def to_dict(self) -> dict:
     result: dict = {}
     result["uri"] = from_str(self.uri)
     result["timezone"] = from_str(self.timezone)
     result["typo"] = to_enum(Calendar, self.typo)
     result["with_estimate"] = from_union([from_bool, from_none],
                                          self.with_estimate)
     return result
Exemplo n.º 2
0
 def from_dict(obj: Any) -> 'ICalSection':
     assert isinstance(obj, dict)
     uri = from_str(obj.get("uri"))
     timezone = from_str(obj.get("timezone"))
     typo = Calendar(obj.get("typo"))
     with_estimate = from_union([from_bool, from_none],
                                obj.get("with_estimate"))
     return ICalSection(uri, timezone, typo, with_estimate)
Exemplo n.º 3
0
 def to_dict(self) -> dict:
     result: dict = {}
     result["calendar"] = self.calendar.to_dict()
     result["save"] = from_str(self.save)
     return result
Exemplo n.º 4
0
 def from_dict(obj: Any) -> 'FixSection':
     assert isinstance(obj, dict)
     calendar = ICalSection.from_dict(obj.get("calendar"))
     save = from_str(obj.get("save"))
     return FixSection(calendar, save)
Exemplo n.º 5
0
 def to_dict(self) -> dict:
     result: dict = {}
     result["calendars"] = from_list(lambda x: to_class(ICalSection, x),
                                     self.calendars)
     result["save"] = from_str(self.save)
     return result
Exemplo n.º 6
0
 def from_dict(obj: Any) -> 'MergeSection':
     assert isinstance(obj, dict)
     calendars = from_list(ICalSection.from_dict, obj.get("calendars"))
     save = from_str(obj.get("save"))
     return MergeSection(calendars, save)