@@ -342,6 +342,124 @@ func TestToSidekickConfig(t *testing.T) {
342342 },
343343 },
344344 },
345+ {
346+ name : "with title override" ,
347+ library : & config.Library {
348+ Name : "google-cloud-apps-script-type-gmail" ,
349+ Rust : & config.RustCrate {
350+ TitleOverride : "Google Apps Script Types" ,
351+ },
352+ },
353+ channel : & config.Channel {
354+ Path : "google/apps/script/type/gmail" ,
355+ },
356+ googleapisDir : "/tmp/googleapis" ,
357+ want : & sidekickconfig.Config {
358+ General : sidekickconfig.GeneralConfig {
359+ Language : "rust" ,
360+ SpecificationFormat : "protobuf" ,
361+ SpecificationSource : "google/apps/script/type/gmail" ,
362+ },
363+ Source : map [string ]string {
364+ "googleapis-root" : "/tmp/googleapis" ,
365+ "title-override" : "Google Apps Script Types" ,
366+ },
367+ Codec : map [string ]string {
368+ "package-name-override" : "google-cloud-apps-script-type-gmail" ,
369+ },
370+ },
371+ },
372+ {
373+ name : "with description override" ,
374+ library : & config.Library {
375+ Name : "google-cloud-longrunning" ,
376+ Rust : & config.RustCrate {
377+ DescriptionOverride : "Defines types and an abstract service to handle long-running operations." ,
378+ },
379+ },
380+ channel : & config.Channel {
381+ Path : "google/longrunning" ,
382+ ServiceConfig : "google/longrunning/longrunning.yaml" ,
383+ },
384+ googleapisDir : "/tmp/googleapis" ,
385+ want : & sidekickconfig.Config {
386+ General : sidekickconfig.GeneralConfig {
387+ Language : "rust" ,
388+ SpecificationFormat : "protobuf" ,
389+ ServiceConfig : "google/longrunning/longrunning.yaml" ,
390+ SpecificationSource : "google/longrunning" ,
391+ },
392+ Source : map [string ]string {
393+ "googleapis-root" : "/tmp/googleapis" ,
394+ "description-override" : "Defines types and an abstract service to handle long-running operations." ,
395+ },
396+ Codec : map [string ]string {
397+ "package-name-override" : "google-cloud-longrunning" ,
398+ },
399+ },
400+ },
401+ {
402+ name : "with skipped ids" ,
403+ library : & config.Library {
404+ Name : "google-cloud-spanner-admin-database-v1" ,
405+ Rust : & config.RustCrate {
406+ SkippedIds : []string {
407+ ".google.spanner.admin.database.v1.DatabaseAdmin.InternalUpdateGraphOperation" ,
408+ ".google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest" ,
409+ ".google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse" ,
410+ },
411+ },
412+ },
413+ channel : & config.Channel {
414+ Path : "google/spanner/admin/database/v1" ,
415+ ServiceConfig : "google/spanner/admin/database/v1/spanner.yaml" ,
416+ },
417+ googleapisDir : "/tmp/googleapis" ,
418+ want : & sidekickconfig.Config {
419+ General : sidekickconfig.GeneralConfig {
420+ Language : "rust" ,
421+ SpecificationFormat : "protobuf" ,
422+ ServiceConfig : "google/spanner/admin/database/v1/spanner.yaml" ,
423+ SpecificationSource : "google/spanner/admin/database/v1" ,
424+ },
425+ Source : map [string ]string {
426+ "googleapis-root" : "/tmp/googleapis" ,
427+ "skipped-ids" : ".google.spanner.admin.database.v1.DatabaseAdmin.InternalUpdateGraphOperation,.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest,.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse" ,
428+ },
429+ Codec : map [string ]string {
430+ "package-name-override" : "google-cloud-spanner-admin-database-v1" ,
431+ },
432+ },
433+ },
434+ {
435+ name : "with name overrides" ,
436+ library : & config.Library {
437+ Name : "google-cloud-storageinsights-v1" ,
438+ Rust : & config.RustCrate {
439+ NameOverrides : ".google.cloud.storageinsights.v1.DatasetConfig.cloud_storage_buckets=CloudStorageBucketsOneOf,.google.cloud.storageinsights.v1.DatasetConfig.cloud_storage_locations=CloudStorageLocationsOneOf" ,
440+ },
441+ },
442+ channel : & config.Channel {
443+ Path : "google/cloud/storageinsights/v1" ,
444+ ServiceConfig : "google/cloud/storageinsights/v1/storageinsights_v1.yaml" ,
445+ },
446+ googleapisDir : "/tmp/googleapis" ,
447+ want : & sidekickconfig.Config {
448+ General : sidekickconfig.GeneralConfig {
449+ Language : "rust" ,
450+ SpecificationFormat : "protobuf" ,
451+ ServiceConfig : "google/cloud/storageinsights/v1/storageinsights_v1.yaml" ,
452+ SpecificationSource : "google/cloud/storageinsights/v1" ,
453+ },
454+ Source : map [string ]string {
455+ "googleapis-root" : "/tmp/googleapis" ,
456+ },
457+ Codec : map [string ]string {
458+ "package-name-override" : "google-cloud-storageinsights-v1" ,
459+ "name-overrides" : ".google.cloud.storageinsights.v1.DatasetConfig.cloud_storage_buckets=CloudStorageBucketsOneOf,.google.cloud.storageinsights.v1.DatasetConfig.cloud_storage_locations=CloudStorageLocationsOneOf" ,
460+ },
461+ },
462+ },
345463 } {
346464 t .Run (test .name , func (t * testing.T ) {
347465 got := toSidekickConfig (test .library , test .channel , test .googleapisDir , test .discoveryDir )
0 commit comments