(patch Patch)
| 2586 | } |
| 2587 | |
| 2588 | func normalizeTaskPatch(patch Patch) (Patch, error) { |
| 2589 | normalized := patch |
| 2590 | if normalized.Title != nil { |
| 2591 | title := strings.TrimSpace(*normalized.Title) |
| 2592 | normalized.Title = &title |
| 2593 | } |
| 2594 | if normalized.Description != nil { |
| 2595 | description := strings.TrimSpace(*normalized.Description) |
| 2596 | normalized.Description = &description |
| 2597 | } |
| 2598 | if normalized.Priority != nil { |
| 2599 | priority := normalized.Priority.Normalize() |
| 2600 | normalized.Priority = &priority |
| 2601 | } |
| 2602 | if normalized.MaxAttempts != nil { |
| 2603 | maxAttempts := *normalized.MaxAttempts |
| 2604 | normalized.MaxAttempts = &maxAttempts |
| 2605 | } |
| 2606 | if normalized.AutoEnqueueOnReady != nil { |
| 2607 | autoEnqueue := *normalized.AutoEnqueueOnReady |
| 2608 | normalized.AutoEnqueueOnReady = &autoEnqueue |
| 2609 | } |
| 2610 | if normalized.ApprovalPolicy != nil { |
| 2611 | approvalPolicy := normalized.ApprovalPolicy.Normalize() |
| 2612 | normalized.ApprovalPolicy = &approvalPolicy |
| 2613 | } |
| 2614 | if normalized.Metadata != nil { |
| 2615 | metadata := normalizeRawJSON(*normalized.Metadata) |
| 2616 | normalized.Metadata = &metadata |
| 2617 | } |
| 2618 | if normalized.NetworkChannel != nil { |
| 2619 | channel := strings.TrimSpace(*normalized.NetworkChannel) |
| 2620 | normalized.NetworkChannel = &channel |
| 2621 | } |
| 2622 | if normalized.Owner != nil { |
| 2623 | normalized.Owner = normalizeOwnership(normalized.Owner) |
| 2624 | } |
| 2625 | if err := normalized.Validate("task_patch"); err != nil { |
| 2626 | return Patch{}, err |
| 2627 | } |
| 2628 | return normalized, nil |
| 2629 | } |
| 2630 | |
| 2631 | func normalizeAddDependencySpec(spec AddDependency) (AddDependency, error) { |
| 2632 | normalized := spec |
no test coverage detected