2024-10-21 19:29:58 +00:00
|
|
|
package resources
|
|
|
|
|
2024-10-23 13:57:38 +00:00
|
|
|
import "github.com/databricks/cli/bundle"
|
2024-10-21 19:29:58 +00:00
|
|
|
|
2024-10-23 13:57:38 +00:00
|
|
|
// Completions returns the same as [References] except
|
|
|
|
// that every key maps directly to a single reference.
|
|
|
|
func Completions(b *bundle.Bundle) map[string]Reference {
|
|
|
|
out := make(map[string]Reference)
|
|
|
|
for k, refs := range References(b) {
|
|
|
|
if len(refs) != 1 {
|
2024-10-21 19:29:58 +00:00
|
|
|
continue
|
|
|
|
}
|
2024-10-23 13:57:38 +00:00
|
|
|
out[k] = refs[0]
|
2024-10-21 19:29:58 +00:00
|
|
|
}
|
|
|
|
return out
|
|
|
|
}
|