MCPcopy Create free account
hub / github.com/compozy/agh / parseAutomationTriggerListQuery

Function parseAutomationTriggerListQuery

internal/cli/automation.go:856–893  ·  view source on GitHub ↗
(
	ctx context.Context,
	client DaemonClient,
	scopeRaw string,
	workspaceRef string,
	eventRaw string,
	sourceRaw string,
	last int,
)

Source from the content-addressed store, hash-verified

854}
855
856func parseAutomationTriggerListQuery(
857 ctx context.Context,
858 client DaemonClient,
859 scopeRaw string,
860 workspaceRef string,
861 eventRaw string,
862 sourceRaw string,
863 last int,
864) (AutomationTriggerQuery, error) {
865 query := AutomationTriggerQuery{
866 Event: strings.TrimSpace(eventRaw),
867 }
868 if err := validateAutomationLast(last); err != nil {
869 return AutomationTriggerQuery{}, err
870 }
871 query.Limit = last
872
873 scope, err := parseOptionalAutomationScope(scopeRaw)
874 if err != nil {
875 return AutomationTriggerQuery{}, err
876 }
877 query.Scope = scope
878
879 if trimmed := strings.TrimSpace(workspaceRef); trimmed != "" {
880 workspaceID, err := resolveAutomationWorkspaceID(ctx, client, trimmed)
881 if err != nil {
882 return AutomationTriggerQuery{}, err
883 }
884 query.WorkspaceID = workspaceID
885 }
886
887 source, err := parseOptionalAutomationSource(sourceRaw)
888 if err != nil {
889 return AutomationTriggerQuery{}, err
890 }
891 query.Source = source
892 return query, nil
893}
894
895func parseAutomationRunListQuery(
896 statusRaw string,

Callers 1

Tested by

no test coverage detected