-
Notifications
You must be signed in to change notification settings - Fork 156
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
Feat: Add api_key argument to Client constructor #1441
Conversation
:param api_key: | ||
(Optional) An API key. Mutually exclusive with any other credentials. | ||
This parameter is an alias for setting `client_options.api_key` and | ||
will supercede any api key set in the `client_options` parameter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this. While I understand that allowing api key-based access is the main goal, is there a specific reason why we need to add a parameter as an alias?
client_options
is an existing parameter, and both a dictionary or ClientOption instance is supported, making it quite easy for users to pass it in.
client_options = {"api_key": api_key}
client = Client(client_options=client_options)
Could you share more context on the user journey and requirements for this, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the result of a discussion with the PM. Basically, the overarching design philosophy was to make it as easy to use as possible, and this alias is inexpensive for us to maintain and improves usability and legibility.
🤖 I have created a release *beep* *boop* --- ## [3.1.0](https://togithub.com/googleapis/python-storage/compare/v3.0.0...v3.1.0) (2025-02-27) ### Features * Add api_key argument to Client constructor ([#1441](https://togithub.com/googleapis/python-storage/issues/1441)) ([c869e15](https://togithub.com/googleapis/python-storage/commit/c869e15ec535a0aa50029d30b6a3ce64ff119b5f)) * Add Bucket.move_blob() for HNS-enabled buckets ([#1431](https://togithub.com/googleapis/python-storage/issues/1431)) ([24c000f](https://togithub.com/googleapis/python-storage/commit/24c000fb7b9f576e6d6c6ec5733f3971fe133655)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
No description provided.