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

Method SetTaskExecutionProfile

internal/api/core/tasks.go:635–676  ·  view source on GitHub ↗

SetTaskExecutionProfile replaces one task-owned execution profile.

(c *gin.Context)

Source from the content-addressed store, hash-verified

633
634// SetTaskExecutionProfile replaces one task-owned execution profile.
635func (h *BaseHandlers) SetTaskExecutionProfile(c *gin.Context) {
636 manager, ok := h.requireTaskManager(c)
637 if !ok {
638 return
639 }
640
641 taskID, err := requiredPathID(c.Param("id"), "task id")
642 if err != nil {
643 h.respondError(c, StatusForTaskError(err), err)
644 return
645 }
646
647 var req contract.SetTaskExecutionProfileRequest
648 if err := c.ShouldBindJSON(&req); err != nil {
649 h.respondError(
650 c,
651 http.StatusBadRequest,
652 NewTaskValidationError(fmt.Errorf("%s: decode task execution profile request: %w", h.transportName(), err)),
653 )
654 return
655 }
656
657 profile, err := taskExecutionProfileFromRequest(taskID, &req)
658 if err != nil {
659 h.respondError(c, StatusForTaskError(err), err)
660 return
661 }
662
663 actor, err := h.taskActorContext(c, taskActionSetProfile)
664 if err != nil {
665 h.respondError(c, StatusForTaskError(err), err)
666 return
667 }
668
669 stored, err := manager.SetExecutionProfile(c.Request.Context(), taskID, profile, actor)
670 if err != nil {
671 h.respondError(c, StatusForTaskError(err), err)
672 return
673 }
674
675 c.JSON(http.StatusOK, contract.TaskExecutionProfileResponse{Profile: stored})
676}
677
678// DeleteTaskExecutionProfile removes one persisted task-owned execution profile.
679func (h *BaseHandlers) DeleteTaskExecutionProfile(c *gin.Context) {

Callers

nothing calls this directly

Calls 9

requireTaskManagerMethod · 0.95
respondErrorMethod · 0.95
transportNameMethod · 0.95
taskActorContextMethod · 0.95
requiredPathIDFunction · 0.85
StatusForTaskErrorFunction · 0.85
NewTaskValidationErrorFunction · 0.85
SetExecutionProfileMethod · 0.65

Tested by

no test coverage detected