Skip to content

Commit

Permalink
BREAKING_CHANGE: [vertexai] Remove vararg scopes in VertexAI (#10544)
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 615890471

Co-authored-by: Jaycee Li <jayceeli@google.com>
  • Loading branch information
copybara-service[bot] and jaycee-li committed Mar 14, 2024
1 parent 598d25d commit afc367f
Showing 1 changed file with 0 additions and 42 deletions.
Expand Up @@ -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;
Expand Down Expand Up @@ -145,47 +144,6 @@ public VertexAI(String projectId, String location, Transport transport, List<Str
this.transport = transport;
}

/**
* Construct a VertexAI instance with application default credentials.
*
* @deprecated Use {@link #VertexAI(String, String, List<String>)} 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<String>)} 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.
*
Expand Down

0 comments on commit afc367f

Please sign in to comment.