Skip to content

feat: expose BucketInfo.getProject as a BigInteger #3119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2025

Conversation

BenWhitehead
Copy link
Collaborator

Expose publicly the project field which was previously internal only. This field represents the project number of the project the bucket belongs to.

This field is still OUTPUT_ONLY, and as such does hot have a setter exposed.

Fixes #3023

@BenWhitehead BenWhitehead requested a review from a team as a code owner May 27, 2025 17:26
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: storage Issues related to the googleapis/java-storage API. labels May 27, 2025
@BenWhitehead BenWhitehead force-pushed the feat/bucket-project branch from bec35cd to 2701269 Compare May 27, 2025 18:19
Expose publicly the project field which was previously internal only. This field represents the project number of the project the bucket belongs to.

This field is still OUTPUT_ONLY, and as such does hot have a setter exposed for it.

Fixes #3023
@BenWhitehead BenWhitehead force-pushed the feat/bucket-project branch from 2701269 to cc60695 Compare May 27, 2025 18:20
@@ -328,7 +328,7 @@ public void storage_BucketGetOption_fields_BucketField() {
"website",
"softDeletePolicy",
"hierarchicalNamespace",
"website");
"projectNumber");
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

website was defined twice, changing the second one to our new expected value.

@@ -821,7 +821,7 @@ public void storage_BucketListOption_fields_BucketField() {
"items/website",
"items/softDeletePolicy",
"items/hierarchicalNamespace",
"items/website");
"items/projectNumber");
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

website was defined twice, changing the second one to our new expected value.

@@ -2007,7 +2008,10 @@ public Builder setName(String name) {
}

@Override
Builder setProject(String project) {
Builder setProject(BigInteger project) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we name it set/getProjectNumber to make it more clear?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the v2/storage.proto it's named project in the discovery doc it's named projectNumber. Rather annoying.

We first added this field internally when doing the gRPC effort and before projectNUmber was public. In this case, I'm simply exposing the getter for the field we already have plumbed around.

@BenWhitehead BenWhitehead merged commit 64bbb60 into main May 28, 2025
23 checks passed
@BenWhitehead BenWhitehead deleted the feat/bucket-project branch May 28, 2025 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/java-storage API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add getProjectNumber method to Bucket.java
2 participants