@@ -126,6 +126,7 @@ func TestFind(t *testing.T) {
126126 Path : "google/cloud/aiplatform/v1/schema/predict/instance" ,
127127 ServiceConfig : "google/cloud/aiplatform/v1/schema/aiplatform_v1.yaml" ,
128128 ServiceName : "aiplatform.googleapis.com" ,
129+ ShortName : "aiplatform" ,
129130 Title : "Vertex AI API" ,
130131 Transports : map [string ]Transport {"python" : "grpc" },
131132 },
@@ -149,10 +150,11 @@ func TestFind(t *testing.T) {
149150 name : "discovery" ,
150151 api : "discoveries/compute.v1.json" ,
151152 want : & API {
152- Path : "google/cloud/compute/v1" ,
153153 Discovery : "discoveries/compute.v1.json" ,
154+ Path : "google/cloud/compute/v1" ,
154155 ServiceConfig : "google/cloud/compute/v1/compute_v1.yaml" ,
155156 ServiceName : "compute.googleapis.com" ,
157+ ShortName : "compute" ,
156158 Title : "Google Compute Engine API" ,
157159 Transports : map [string ]Transport {"csharp" : "rest" , "go" : "rest" , "java" : "rest" , "php" : "rest" },
158160 },
@@ -287,6 +289,17 @@ func TestPopulateFromServiceConfig(t *testing.T) {
287289 ShortName : "override short name" ,
288290 },
289291 },
292+ {
293+ name : "default short name" ,
294+ api : & API {},
295+ cfg : & Service {
296+ Name : "accessapproval.googleapis.com" ,
297+ },
298+ want : & API {
299+ ServiceName : "accessapproval.googleapis.com" ,
300+ ShortName : "accessapproval" ,
301+ },
302+ },
290303 } {
291304 t .Run (test .name , func (t * testing.T ) {
292305 got := populateFromServiceConfig (test .api , test .cfg )
0 commit comments