private PredictionServiceSettings getPredictionServiceSettings() throws IOException {
    PredictionServiceSettings.Builder builder;
    if (transport == Transport.REST) {
      builder = PredictionServiceSettings.newHttpJsonBuilder();
    } else {
      builder = PredictionServiceSettings.newBuilder();
    }
    builder.setEndpoint(String.format("%s:443", apiEndpoint));
    builder.setCredentialsProvider(credentialsProvider);

    builder.setHeaderProvider(headerProvider);
    return builder.build();
  }
Returns the {@link PredictionServiceClient} with GRPC or REST, based on the Transport type. The
client will be instantiated when the first prediction API call is made.

@return {@link PredictionServiceClient} that send requests to the backing service through
    method calls that map to the API methods.
java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/VertexAI.java