code: JSONObject toJson() {
          JSONObject ret = new JSONObject();
          ret.put("type",type.name());
          if (targetConfig != null) {
              ret.put("target",targetConfig.toJson());
          }
          return ret;
      }
docs: Get a JSON representation of this request