code: private JsonObject newSubrequest(RestEntry<JsonObject> record) {
      Preconditions.checkArgument(record.getResourcePath().isPresent(), "Resource path is not defined");
      JsonObject subReq = new JsonObject();
      subReq.addProperty("url", record.getResourcePath().get());
      subReq.add("richInput", record.getRestEntryVal());
  
      switch (operation) {
        case INSERT_ONLY_NOT_EXIST:
          subReq.addProperty("method", "POST");
          break;
        case UPSERT:
          subReq.addProperty("method", "PATCH");
          break;
        default:
          throw new IllegalArgumentException(operation + " is not supported.");
      }
      return subReq;
    }
docs: Create batch subrequest. For more detail @link https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/requests_composite_batch.htm
  
  @param record
  @return