File tree Expand file tree Collapse file tree 5 files changed +1
-11
lines changed
internal/sidekick/internal/dart Expand file tree Collapse file tree 5 files changed +1
-11
lines changed Original file line number Diff line number Diff line change @@ -500,7 +500,6 @@ func calculateImports(imports map[string]bool) []string {
500500func (annotate * annotateModel ) annotateService (s * api.Service ) {
501501 // Add a package:http import if we're generating a service.
502502 annotate .imports [httpImport ] = true
503- annotate .imports [authImport ] = true
504503
505504 // Some methods are skipped.
506505 methods := language .FilterSlice (s .Methods , func (m * api.Method ) bool {
Original file line number Diff line number Diff line change 2727 requiredConfig = map [string ]string {
2828 "api-keys-environment-variables" : "GOOGLE_API_KEY,GEMINI_API_KEY" ,
2929 "issue-tracker-url" : "http://www.example.com/issues" ,
30- "package:googleapis_auth" : "^2.0.0" ,
3130 "package:google_cloud_gax" : "^1.2.3" ,
3231 "package:http" : "^4.5.6" ,
3332 "package:google_cloud_protobuf" : "^7.8.9" ,
@@ -153,7 +152,6 @@ func TestAnnotateModel_Options(t *testing.T) {
153152 if diff := cmp .Diff (map [string ]string {
154153 "google_cloud_gax" : "^1.2.3" ,
155154 "google_cloud_protobuf" : "^7.8.9" ,
156- "googleapis_auth" : "^2.0.0" ,
157155 "http" : "1.2.0" },
158156 am .dependencyConstraints ); diff != "" {
159157 t .Errorf ("mismatch in annotateModel.dependencyConstraints (-want, +got)\n :%s" , diff )
Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ import (
2626)
2727
2828var typedDataImport = "dart:typed_data"
29- var authImport = "package:googleapis_auth/auth_io.dart as auth"
3029var httpImport = "package:http/http.dart as http"
3130var gaxImport = "package:google_cloud_gax/gax.dart"
3231var encodingImport = "package:google_cloud_protobuf/src/encoding.dart"
Original file line number Diff line number Diff line change @@ -53,7 +53,6 @@ func TestFromProtobuf(t *testing.T) {
5353 "not-for-publication" : "true" ,
5454 "version" : "0.1.0" ,
5555 "skip-format" : "true" ,
56- "package:googleapis_auth" : "^2.0.0" ,
5756 "package:google_cloud_gax" : "^1.2.3" ,
5857 "package:http" : "^4.5.6" ,
5958 "package:google_cloud_location" : "^7.8.9" ,
Original file line number Diff line number Diff line change @@ -44,12 +44,7 @@ final class {{Codec.Name}} {
4444 ///
4545 /// See [API Keys Overview](https://cloud.google.com/api-keys/docs/overview).
4646 factory { {Codec.Name} }.fromApiKey([String? apiKey]) {
47- apiKey ??= _apiKeys.map(environmentVariable).nonNulls.firstOrNull;
48- if (apiKey == null) {
49- throw ArgumentError(' apiKey or one of these environment variables must '
50- ' be set to an API key: ${_apiKeys.join(' , ' )}' );
51- }
52- return { {Codec.Name} }(client: auth.clientViaApiKey(apiKey));
47+ return {{Codec.Name} }(client: httpClientFromApiKey(apiKey, _apiKeys));
5348 }
5449
5550 { {#Codec.Methods} }
You can’t perform that action at this time.
0 commit comments