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
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)
def to_dict(self) -> dict: result: dict = {} result["calendar"] = self.calendar.to_dict() result["save"] = from_str(self.save) return result
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)
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
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)