private static String getResourceName(String modelName, VertexAI vertexAi) {
    if (modelName.startsWith(Constants.MODEL_NAME_PREFIX_PROJECTS)) {
      return modelName;
    } else if (modelName.startsWith(Constants.MODEL_NAME_PREFIX_PUBLISHERS)) {
      return String.format(
          "projects/%s/locations/%s/%s",
          vertexAi.getProjectId(), vertexAi.getLocation(), modelName);
    } else {
      return String.format(
          "projects/%s/locations/%s/publishers/google/models/%s",
          vertexAi.getProjectId(), vertexAi.getLocation(), reconcileModelName(modelName));
    }
  }
Computes resourceName based on original modelName. Note: this should happen before the
modelName is reconciled.
java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/GenerativeModel.java