( ctx context.Context, client DaemonClient, scopeRaw string, workspaceRef string, sourceRaw string, last int, )
| 818 | } |
| 819 | |
| 820 | func parseAutomationJobListQuery( |
| 821 | ctx context.Context, |
| 822 | client DaemonClient, |
| 823 | scopeRaw string, |
| 824 | workspaceRef string, |
| 825 | sourceRaw string, |
| 826 | last int, |
| 827 | ) (AutomationJobQuery, error) { |
| 828 | query := AutomationJobQuery{} |
| 829 | if err := validateAutomationLast(last); err != nil { |
| 830 | return AutomationJobQuery{}, err |
| 831 | } |
| 832 | query.Limit = last |
| 833 | |
| 834 | scope, err := parseOptionalAutomationScope(scopeRaw) |
| 835 | if err != nil { |
| 836 | return AutomationJobQuery{}, err |
| 837 | } |
| 838 | query.Scope = scope |
| 839 | |
| 840 | if trimmed := strings.TrimSpace(workspaceRef); trimmed != "" { |
| 841 | workspaceID, err := resolveAutomationWorkspaceID(ctx, client, trimmed) |
| 842 | if err != nil { |
| 843 | return AutomationJobQuery{}, err |
| 844 | } |
| 845 | query.WorkspaceID = workspaceID |
| 846 | } |
| 847 | |
| 848 | source, err := parseOptionalAutomationSource(sourceRaw) |
| 849 | if err != nil { |
| 850 | return AutomationJobQuery{}, err |
| 851 | } |
| 852 | query.Source = source |
| 853 | return query, nil |
| 854 | } |
| 855 | |
| 856 | func parseAutomationTriggerListQuery( |
| 857 | ctx context.Context, |
no test coverage detected