public void startBundle()

in src/main/java/com/google/solutions/df/log/aggregations/common/fraud/detection/PredictTransform.java [250:267]


    public void startBundle() throws GeneralSecurityException, IOException {
      json = new Gson();
      httpTransport = GoogleNetHttpTransport.newTrustedTransport();
      JsonFactory jsonFactory = JacksonFactory.getDefaultInstance();
      Discovery discovery =
          new Discovery.Builder(httpTransport, jsonFactory, null)
              .setApplicationName("fin_serv_fraud_detection")
              .build();
      RestDescription api = discovery.apis().getRest("ml", "v1").execute();
      method = api.getResources().get("projects").getMethods().get("predict");
      JsonSchema param = new JsonSchema();
      param.set(
          "name",
          String.format("projects/%s/models/%s/versions/%s", projectId, modelId, versionId));
      url = new GenericUrl(UriTemplate.expand(api.getBaseUrl() + method.getPath(), param, true));
      credential = GoogleCredential.getApplicationDefault().createScoped(scope);
      LOG.debug("Url {}", url.toString());
    }