From afc367ff21b2bdd60977709bbee4b4a7a22c2fbf Mon Sep 17 00:00:00 2001 From: "copybara-service[bot]" <56741989+copybara-service[bot]@users.noreply.github.com> Date: Thu, 14 Mar 2024 15:00:14 -0700 Subject: [PATCH] BREAKING_CHANGE: [vertexai] Remove vararg scopes in VertexAI (#10544) PiperOrigin-RevId: 615890471 Co-authored-by: Jaycee Li --- .../com/google/cloud/vertexai/VertexAI.java | 42 ------------------- 1 file changed, 42 deletions(-) diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/VertexAI.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/VertexAI.java index 3cdbed5ed7b0..8caad29c0171 100644 --- a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/VertexAI.java +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/VertexAI.java @@ -28,7 +28,6 @@ import com.google.cloud.vertexai.api.PredictionServiceClient; import com.google.cloud.vertexai.api.PredictionServiceSettings; import java.io.IOException; -import java.util.Arrays; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; @@ -145,47 +144,6 @@ public VertexAI(String projectId, String location, Transport transport, List)} instead. - * @param projectId the default project to use when making API calls - * @param location the default location to use when making API calls - * @param scopes collection of scopes in the default credentials. Make sure you have specified - * "https://www.googleapis.com/auth/cloud-platform" scope to access resources on Vertex AI. - */ - @Deprecated - public VertexAI(String projectId, String location, String... scopes) throws IOException { - CredentialsProvider credentialsProvider = - scopes.length == 0 - ? null - : GoogleCredentialsProvider.newBuilder() - .setScopesToApply(Arrays.asList(scopes)) - .setUseJwtAccessWithScope(true) - .build(); - - this.projectId = projectId; - this.location = location; - this.apiEndpoint = String.format("%s-aiplatform.googleapis.com", this.location); - this.credentialsProvider = credentialsProvider; - } - - /** - * Construct a VertexAI instance with default transport layer and application default credentials. - * - * @deprecated Use {@link #VertexAI(String, String, Transport, List)} instead. - * @param projectId the default project to use when making API calls - * @param location the default location to use when making API calls - * @param transport the default {@link Transport} layer to use to send API requests - * @param scopes collection of scopes in the default credentials - */ - @Deprecated - public VertexAI(String projectId, String location, Transport transport, String... scopes) - throws IOException { - this(projectId, location, scopes); - this.transport = transport; - } - /** * Returns the default {@link Transport} layer to use to send API requests. *