Skip to content

Conversation

@arithmetic1728
Copy link
Contributor

This PR adds a new credential type for API key, and the get_api_key_credentials method needed by GAPIC clients (see here) to enable API key support. Once this PR is released in auth lib, GAPIC clients will be able to use API key with the latest auth lib. This feature has been tested with the following sample.

import google.cloud.language_v1
import google.api_core.client_options

# provide api key value via client options
client = google.cloud.language_v1.LanguageServiceClient(client_options={"api_key":"FILL IN"})

request = {'document': { 'type_': 'PLAIN_TEXT', 'content': "hello" }, 'encoding_type': 'UTF8'}
response = client.analyze_sentiment(request)

print(response)

@arithmetic1728 arithmetic1728 requested review from a team and sai-sunder-s as code owners November 11, 2022 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants