( bridgeInstanceID string, scopeRaw string, workspaceID string, last int, )
| 938 | } |
| 939 | |
| 940 | func buildTaskBridgeNotificationSubscriptionListQuery( |
| 941 | bridgeInstanceID string, |
| 942 | scopeRaw string, |
| 943 | workspaceID string, |
| 944 | last int, |
| 945 | ) (TaskBridgeNotificationSubscriptionQuery, error) { |
| 946 | if last < 0 { |
| 947 | return TaskBridgeNotificationSubscriptionQuery{}, errors.New( |
| 948 | "cli: --last must be zero or positive", |
| 949 | ) |
| 950 | } |
| 951 | query := TaskBridgeNotificationSubscriptionQuery{ |
| 952 | BridgeInstanceID: strings.TrimSpace(bridgeInstanceID), |
| 953 | WorkspaceID: strings.TrimSpace(workspaceID), |
| 954 | Limit: last, |
| 955 | } |
| 956 | if trimmed := strings.TrimSpace(scopeRaw); trimmed != "" { |
| 957 | scope := bridgepkg.Scope(trimmed).Normalize() |
| 958 | if err := scope.Validate(); err != nil { |
| 959 | return TaskBridgeNotificationSubscriptionQuery{}, fmt.Errorf( |
| 960 | "cli: invalid notification scope: %w", |
| 961 | err, |
| 962 | ) |
| 963 | } |
| 964 | query.Scope = scope |
| 965 | } |
| 966 | return query, nil |
| 967 | } |
| 968 | |
| 969 | func newTaskReviewCommand(deps commandDeps) *cobra.Command { |
| 970 | cmd := &cobra.Command{ |
no test coverage detected