(spec CreateTask)
| 2549 | } |
| 2550 | |
| 2551 | func normalizeCreateTaskSpec(spec CreateTask) (CreateTask, error) { |
| 2552 | normalized := spec |
| 2553 | normalized.ID = strings.TrimSpace(normalized.ID) |
| 2554 | normalized.Identifier = strings.TrimSpace(normalized.Identifier) |
| 2555 | normalized.Scope = normalized.Scope.Normalize() |
| 2556 | normalized.WorkspaceID = strings.TrimSpace(normalized.WorkspaceID) |
| 2557 | normalized.ParentTaskID = strings.TrimSpace(normalized.ParentTaskID) |
| 2558 | normalized.NetworkChannel = strings.TrimSpace(normalized.NetworkChannel) |
| 2559 | normalized.Title = strings.TrimSpace(normalized.Title) |
| 2560 | normalized.Description = strings.TrimSpace(normalized.Description) |
| 2561 | normalized.Priority = normalizePriorityOrDefault(normalized.Priority) |
| 2562 | if normalized.MaxAttempts != nil { |
| 2563 | maxAttempts := *normalized.MaxAttempts |
| 2564 | normalized.MaxAttempts = &maxAttempts |
| 2565 | } |
| 2566 | if normalized.WakeCreator != nil { |
| 2567 | wakeCreator := *normalized.WakeCreator |
| 2568 | normalized.WakeCreator = &wakeCreator |
| 2569 | } |
| 2570 | normalized.ApprovalPolicy = normalizeApprovalPolicyOrDefault(normalized.ApprovalPolicy) |
| 2571 | if normalized.Owner != nil { |
| 2572 | normalized.Owner = normalizeOwnership(normalized.Owner) |
| 2573 | } |
| 2574 | normalized.Metadata = normalizeRawJSON(normalized.Metadata) |
| 2575 | if err := normalized.Validate("create_task"); err != nil { |
| 2576 | return CreateTask{}, err |
| 2577 | } |
| 2578 | return normalized, nil |
| 2579 | } |
| 2580 | |
| 2581 | func createTaskWakeCreator(spec CreateTask) bool { |
| 2582 | if spec.WakeCreator == nil { |
no test coverage detected