| 997 | } |
| 998 | |
| 999 | func parseOptionalAutomationSource(raw string) (automationpkg.JobSource, error) { |
| 1000 | trimmed := strings.ToLower(strings.TrimSpace(raw)) |
| 1001 | if trimmed == "" { |
| 1002 | return "", nil |
| 1003 | } |
| 1004 | source := automationpkg.JobSource(trimmed) |
| 1005 | if err := source.Validate(automationSourceKey); err != nil { |
| 1006 | return "", fmt.Errorf("cli: %w", err) |
| 1007 | } |
| 1008 | return source, nil |
| 1009 | } |
| 1010 | |
| 1011 | func parseOptionalAutomationRunStatus(raw string) (automationpkg.RunStatus, error) { |
| 1012 | trimmed := strings.ToLower(strings.TrimSpace(raw)) |