class Klass(Declared): a = var(int) b = var(int) c = var(int, init=False, required=False) def __post_init__(self, **omits): self.c = self.a + self.b
class Klass(Declared): a = var(int) b = var(int) c = var(int, init=False, required=False) def __post_init__(self, c): self.c = c + 1
class Court(Declared): num = var(int, required=False) name = var(str, required=False) date = var(date, default=date.today(), serializer=DateSerializer()) start_time = var(timedelta, serializer=_timedelta_serde) end_time = var(timedelta, serializer=_timedelta_serde) def __post_init__(self, **omits): if self.num is None and self.name is None: raise ValueError("num or name is required for court")
class Mapping(Declared): __xml_tag_name__ = "Mapping" element_code = pascalcase_var(str, as_xml_attr=True) element_type = pascalcase_var(str, as_xml_attr=True) element_id = var(str, as_xml_attr=True, field_name="ElementID") parent_type = pascalcase_var(str, as_xml_attr=True) parent_code = pascalcase_var(str, as_xml_attr=True) parent_id = var(str, as_xml_attr=True, field_name="ParentID") action = pascalcase_var(str, as_xml_attr=True) properties = vec(Property, field_name="Property")
class Object(Declared): __xml_tag_name__ = "Object" action = pascalcase_var(str, as_xml_attr=True) code = pascalcase_var(str, as_xml_attr=True) id_ = var(str, field_name="ID", as_xml_attr=True) element_type = pascalcase_var(str, as_xml_attr=True) properties = vec(Property, field_name="Property")
class JSONTestClass(Declared): a = var(int) b = var(float) c = var(bytes, serializer=BytesSerializer()) d = var(str) e = var(bool) f = var(list) g = var(dict)
class Person(Declared): name = var(str) age = var(int)
class Item(Declared): name = var(str, as_xml_attr=True) text = var(str, as_xml_text=True)
class Style(Declared): name = var(str, as_xml_attr=True) parent = var(str, as_xml_attr=True, required=False) items = vec(Item, field_name="item")
class Neighbor(Declared): name = var(str, as_xml_attr=True) direction = var(str, as_xml_attr=True)
class Country(Declared): rank = var(str) year = var(int) gdppc = var(int) name = var(str, as_xml_attr=True) neighbor = var(Neighbor)
class Klass1(Declared): testVarB = var(int, naming_style=NamingStyle.camelcase)
class Example(Declared): crcat = var(str) crsource = var(str) crkw = var(str) crint = var(int) crfloat = var(float)
class Home(Declared): location = var(str)
class Home(Declared): location = var(str) furniture = var(Furniture)
class Struct(Declared): __xml_tag_name__ = "root" p0 = var(str, as_xml_text=True)
class Body(Declared): field0 = var(Table, field_name="fieldA")
class Task(Declared): run_id = var(UUID, default_factory=uuid4, serializer=UUIDSerializer()) username = var(str) password = var(str) courts = vec(Court)
class Klass(Declared): test_var_a = var(int, naming_style=NamingStyle.camelcase)
class Item(Declared): a = var(str)
class Property(Declared): __xml_tag_name__ = "Property" name = pascalcase_var(str, as_xml_attr=True) value = var(str, as_xml_text=True)
class Table(Declared): hello_world = var(str, field_name="helloWorld")
class Struct(Declared): __xml_tag_name__ = "root" p0 = var(str, ignore_serialize=True)
class Klass3(Declared): TestVarD = var(int, naming_style=NamingStyle.camelcase)
class Person(Declared): valid = var(str, as_xml_attr=True) name = var(str) age = var(int)
class Struct(Declared): __xml_tag_name__ = "root" p0 = var(str, required=False)
class Furniture(Declared): name = var(str)
class Struct(Declared): __xml_tag_name__ = "root" p0 = var(str, as_xml_text=True, serializer=S())
class Person(Declared): name = var(str) age = var(int) home = vec(Home)
class Struct(Declared): __xml_tag_name__ = "root" p0 = var(int, as_xml_attr=True, required=False) p1 = var(str) p2 = var(float)