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

Function taskPatchFromRequest

internal/api/core/tasks.go:2166–2189  ·  view source on GitHub ↗
(req contract.UpdateTaskRequest)

Source from the content-addressed store, hash-verified

2164}
2165
2166func taskPatchFromRequest(req contract.UpdateTaskRequest) (taskpkg.Patch, error) {
2167 if req.NetworkChannel != nil {
2168 if err := validateTaskChannel("task_patch.network_channel", *req.NetworkChannel); err != nil {
2169 return taskpkg.Patch{}, err
2170 }
2171 }
2172
2173 patch := taskpkg.Patch{
2174 Title: trimStringPtr(req.Title),
2175 Description: trimStringPtr(req.Description),
2176 Priority: normalizePriorityPtr(req.Priority),
2177 MaxAttempts: req.MaxAttempts,
2178 AutoEnqueueOnReady: req.AutoEnqueueOnReady,
2179 ApprovalPolicy: normalizeApprovalPolicyPtr(req.ApprovalPolicy),
2180 Metadata: cloneRawMessagePtr(req.Metadata),
2181 NetworkChannel: trimStringPtr(req.NetworkChannel),
2182 Owner: cloneOwnership(req.Owner),
2183 ClearOwner: req.ClearOwner,
2184 }
2185 if err := patch.Validate("task_patch"); err != nil {
2186 return taskpkg.Patch{}, err
2187 }
2188 return patch, nil
2189}
2190
2191func taskExecutionProfileFromRequest(
2192 taskID string,

Callers 1

UpdateTaskMethod · 0.70

Calls 7

ValidateMethod · 0.95
validateTaskChannelFunction · 0.70
trimStringPtrFunction · 0.70
normalizePriorityPtrFunction · 0.70
cloneRawMessagePtrFunction · 0.70
cloneOwnershipFunction · 0.70

Tested by

no test coverage detected