feat(bigquery): add internal listProjects API to core client#13429
feat(bigquery): add internal listProjects API to core client#13429keshavdandeva wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the ability to list Google Cloud Projects accessible to the caller. It adds a new Project model class, a ProjectListOption class for pagination options, and the listProjects method to the BigQuery interface and its implementation BigQueryImpl. It also updates the underlying RPC layer (BigQueryRpc and HttpBigQueryRpc) to support the new API call with OpenTelemetry tracing, and includes corresponding unit tests. There are no review comments to address.
| if (this == o) return true; | ||
| if (o == null || getClass() != o.getClass()) return false; | ||
| Project project = (Project) o; | ||
| return Objects.equals(id, project.id) |
There was a problem hiding this comment.
Shouldn't we use String.equals there?
| super(option, value); | ||
| } | ||
|
|
||
| public static ProjectListOption pageSize(long pageSize) { |
There was a problem hiding this comment.
Can we keep name consistent with API? maxResults?
|
|
||
| ProjectPageFetcher( | ||
| BigQueryOptions serviceOptions, String cursor, Map<BigQueryRpc.Option, ?> optionMap) { | ||
| this.requestOptions = |
There was a problem hiding this comment.
Will it automatically populate maxResults/pageSize?
b/521443900
This PR introduces support for fetching a list of GCP projects via the BigQuery API. This functionality is being exposed primarily to support cross-project dataset resolution in the native BigQuery JDBC driver.
Changes included:
Projectdomain model representing a BigQuery project (@BetaApi).listProjects(ProjectListOption... options)to theBigQueryclient interface, marked as@InternalApito preserve the public GA surface.listProjectsmapping toBigQueryRpcand implemented the underlying HTTP execution inHttpBigQueryRpc, including pagination and OpenTelemetry tracing support.ProjectPageFetcherinsideBigQueryImplto seamlessly handle paginated project results.BigQueryImplTestandHttpBigQueryRpcTest.