(req contract.ClaimTaskRunRequest)
| 2380 | } |
| 2381 | |
| 2382 | func claimTaskRunFromRequest(req contract.ClaimTaskRunRequest) (taskpkg.ClaimRun, error) { |
| 2383 | claim := taskpkg.ClaimRun{IdempotencyKey: strings.TrimSpace(req.IdempotencyKey)} |
| 2384 | if err := claim.Validate("claim_run"); err != nil { |
| 2385 | return taskpkg.ClaimRun{}, err |
| 2386 | } |
| 2387 | return claim, nil |
| 2388 | } |
| 2389 | |
| 2390 | func startTaskRunFromRequest(req contract.StartTaskRunRequest) (taskpkg.StartRun, error) { |
| 2391 | startReq := taskpkg.StartRun{IdempotencyKey: strings.TrimSpace(req.IdempotencyKey)} |