( ctx context.Context, client DaemonClient, ref string, )
| 958 | } |
| 959 | |
| 960 | func resolveAutomationWorkspaceID( |
| 961 | ctx context.Context, |
| 962 | client DaemonClient, |
| 963 | ref string, |
| 964 | ) (string, error) { |
| 965 | trimmed := strings.TrimSpace(ref) |
| 966 | if trimmed == "" { |
| 967 | return "", nil |
| 968 | } |
| 969 | detail, err := client.GetWorkspace(ctx, trimmed) |
| 970 | if err != nil { |
| 971 | return "", fmt.Errorf("cli: resolve workspace %q: %w", trimmed, err) |
| 972 | } |
| 973 | id := strings.TrimSpace(detail.Workspace.ID) |
| 974 | if id == "" { |
| 975 | return "", fmt.Errorf("cli: resolve workspace %q: missing workspace id", trimmed) |
| 976 | } |
| 977 | return id, nil |
| 978 | } |
| 979 | |
| 980 | func parseRequiredAutomationScope(raw string) (automationpkg.Scope, error) { |
| 981 | if strings.TrimSpace(raw) == "" { |
no test coverage detected