code: def _generate_union_class_variant_creators(self, ns, data_type):
          
          for field in data_type.fields:
              if not is_void_type(field.data_type):
                  field_name = fmt_func(field.name)
                  field_name_reserved_check = fmt_func(field.name, check_reserved=True)
                  if is_nullable_type(field.data_type):
                      field_dt = field.data_type.data_type
                  else:
                      field_dt = field.data_type
                  self.emit('@classmethod')
                  self.emit('def {}(cls, val):'.format(field_name_reserved_check))
                  with self.indent():
                      self.emit('"""')
                      self.emit_wrapped_text(
                          'Create an instance of this class set to the ``%s`` '
                          'tag with value ``val``.' % field_name)
                      self.emit()
                      self.emit(':param {} val:'.format(
                          self._python_type_mapping(ns, field_dt)))
                      self.emit(':rtype: {}'.format(
                          self._python_type_mapping(ns, data_type)))
                      self.emit('"""')
                      self.emit("return cls('{}', val)".format(field_name))
                  self.emit()
docs: Each non-symbol, non-any variant has a corresponding class method that
          can be used to construct a union with that variant selected.