code: public static String toUnionMemberName(ClassTemplateSpec spec) {
  
      if (spec.getSchema() == null) { // custom type
        return spec.getClassName() + "Member";
      }
  
      Type schemaType = spec.getSchema().getType();
      if (schemaType == Type.INT) {
        return "IntMember";
      } else if (schemaType == Type.LONG) {
        return "LongMember";
      } else if (schemaType == Type.FLOAT) {
        return "FloatMember";
      } else if (schemaType == Type.DOUBLE) {
        return "DoubleMember";
      } else if (schemaType == Type.STRING) {
        return "StringMember";
      } else if (schemaType == Type.BOOLEAN) {
        return "BooleanMember";
      } else if (schemaType == Type.BYTES) {
        return "BytesMember";
      } else if (schemaType == Type.FIXED) {
        return "FixedMember";
      } else if (schemaType == Type.ENUM) {
        return spec.getClassName() + "Member";
      } else if (schemaType == Type.RECORD) {
        return spec.getClassName() + "Member";
      } else if (schemaType == Type.MAP) {
        return "MapMember";
      } else if (schemaType == Type.ARRAY) {
        return "ArrayMember";
      } else {
        throw new IllegalArgumentException("unrecognized type: " + schemaType);
      }
    }
docs: Returns the union member class name for the given {@link ClassTemplateSpec} as a Swift
  source code string.
  
  @param spec provides the union member type to get the name for.
  @return a Swift source code string identifying the union member.