File tree 2 files changed +6
-0
lines changed
gax-java/gax/src/main/java/com/google/api/gax/rpc
2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -238,6 +238,10 @@ public static ClientContext create(StubSettings settings) throws IOException {
238
238
if (credentials != null ) {
239
239
defaultCallContext = defaultCallContext .withCredentials (credentials );
240
240
}
241
+ //TODO: if we decided to add setApiKey method need to check and throw exception if apikey and credentials are provided
242
+ if (settings .getApiKey () != null ) {
243
+ defaultCallContext = defaultCallContext .withCredentials (ApiKeyCredentials .create (settings .getApiKey ()));
244
+ }
241
245
defaultCallContext = defaultCallContext .withEndpointContext (endpointContext );
242
246
243
247
WatchdogProvider watchdogProvider = settings .getStreamWatchdogProvider ();
Original file line number Diff line number Diff line change @@ -109,6 +109,8 @@ public final String getQuotaProjectId() {
109
109
return stubSettings .getQuotaProjectId ();
110
110
}
111
111
112
+ public final String getApiKey () {return stubSettings .getApiKey ();}
113
+
112
114
@ Nullable
113
115
public final WatchdogProvider getWatchdogProvider () {
114
116
return stubSettings .getStreamWatchdogProvider ();
You can’t perform that action at this time.
0 commit comments