def _generate_struct_class_properties(self, ns, data_type):
for field in data_type.fields:<EOL><INDENT>field_name = fmt_func(field.name)<EOL>field_name_reserved_check = fmt_func(field.name, check_reserved=True)<EOL>if is_nullable_type(field.data_type):<EOL><INDENT>field_dt = field.data_type.data_type<EOL>dt_nullable = True<EOL><DEDENT>else:<EOL><INDENT>field_dt = field.data_type<EOL>dt_nullable = False<EOL><DEDENT>self.emit('<STR_LIT>')<EOL>self.emit('<STR_LIT>'.format(field_name_reserved_check))<EOL>with self.indent():<EOL><INDENT>self.emit('<STR_LIT>')<EOL>if field.doc:<EOL><INDENT>self.emit_wrapped_text(<EOL>self.process_doc(field.doc, self._docf))<EOL>self.emit()<EOL><DEDENT>self.emit('<STR_LIT>'.format(<EOL>self._python_type_mapping(ns, field_dt)))<EOL>self.emit('<STR_LIT>')<EOL>self.emit('<STR_LIT>'.format(field_name))<EOL>with self.indent():<EOL><INDENT>self.emit('<STR_LIT>'.format(field_name))<EOL><DEDENT>self.emit('<STR_LIT>')<EOL>with self.indent():<EOL><INDENT>if dt_nullable:<EOL><INDENT>self.emit('<STR_LIT>')<EOL><DEDENT>elif field.has_default:<EOL><INDENT>self.emit('<STR_LIT>'.format(<EOL>self._generate_python_value(ns, field.default)))<EOL><DEDENT>else:<EOL><INDENT>self.emit(<EOL>"<STR_LIT>"<EOL>% field_name<EOL>)<EOL><DEDENT><DEDENT><DEDENT>self.emit()<EOL>self.emit('<STR_LIT>'.format(field_name_reserved_check))<EOL>self.emit('<STR_LIT>'.format(field_name_reserved_check))<EOL>with self.indent():<EOL><INDENT>if dt_nullable:<EOL><INDENT>self.emit('<STR_LIT>')<EOL>with self.indent():<EOL><INDENT>self.emit('<STR_LIT>'.format(field_name_reserved_check))<EOL>self.emit('<STR_LIT>')<EOL><DEDENT><DEDENT>if is_user_defined_type(field_dt):<EOL><INDENT>self.emit('<STR_LIT>' %<EOL>field_name)<EOL><DEDENT>else:<EOL><INDENT>self.emit('<STR_LIT>'.format(field_name))<EOL><DEDENT>self.emit('<STR_LIT>'.format(field_name))<EOL>self.emit('<STR_LIT>'.format(field_name))<EOL><DEDENT>self.emit()<EOL>self.emit('<STR_LIT>'.format(field_name_reserved_check))<EOL>self.emit('<STR_LIT>'.format(field_name_reserved_check))<EOL>with self.indent():<EOL><INDENT>self.emit('<STR_LIT>'.format(field_name))<EOL>self.emit('<STR_LIT>'.format(field_name))<EOL><DEDENT>self.emit()<EOL><DEDENT>
Each field of the struct has a corresponding setter and getter.
The setter validates the value being set.