Skip to content

Add getProjectNumber method to Bucket.java #3023

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

Closed
alexmos-db opened this issue Apr 7, 2025 · 3 comments · Fixed by #3119 · May be fixed by #3112
Closed

Add getProjectNumber method to Bucket.java #3023

alexmos-db opened this issue Apr 7, 2025 · 3 comments · Fixed by #3119 · May be fixed by #3112
Labels
api: storage Issues related to the googleapis/java-storage API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@alexmos-db
Copy link

Is your feature request related to a problem? Please describe.

The Java SDK for GCS does not have a method for fetching the project number even though the value is returned from the describeBucket API. This helper exists on the C# SDK as per: https://cloud.google.com/storage/docs/getting-bucket-metadata#storage-get-bucket-metadata-csharp.

Please also see also JSON API reference: https://cloud.google.com/storage/docs/json_api/v1/buckets#resource

Describe the solution you'd like
Add the method for returning the projectNumber. I intend to open a PR shortly adding the required method.

Describe alternatives you've considered
n/a

@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/java-storage API. label Apr 7, 2025
@BenWhitehead
Copy link
Collaborator

Thanks for the interest (and the PR), I'm reaching out to some folks on the API ownership side of things to see if this field being public is intentional -- last I heard, it was an internal field.

@BenWhitehead BenWhitehead added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Apr 11, 2025
@alexmos-db
Copy link
Author

Thanks @BenWhitehead. FWIW, the projectNumber field is available and usable in other language SDKs, here's Python for example: https://cloud.google.com/python/docs/reference/storage/latest/google.cloud.storage.bucket.Bucket#google_cloud_storage_bucket_Bucket_project_number

@BenWhitehead
Copy link
Collaborator

I heard from the API team, the field being public is expected to be public, however they need to publish the exact format for how it is exposed for the grpc api. That will hopefully be published soon. Once published your PR will need to be updated to also perform the plumbing for the gRPC transport. I'll followup when it's published.

BenWhitehead added a commit that referenced this issue May 27, 2025
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 added a commit that referenced this issue May 27, 2025
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 added a commit that referenced this issue May 27, 2025
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 added a commit that referenced this issue May 27, 2025
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
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. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
2 participants