Füge Modelle für Flows, FlowRuns, TaskRuns, WorkPools, WorkQueues, Deployments, Variablen, FlowRunStates, Logs, und Blocks samt zugehöriger Unmarshal-Logik und Zeitfeld-Unterstützung hinzu; ergänze Tests für die FlowRunStates-Service-Methoden.

This commit is contained in:
Gregor Schulte
2026-03-27 14:02:32 +01:00
parent 3aff707116
commit 57531a7d95
36 changed files with 3165 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
package client
import (
"context"
"fmt"
"git.schultes.dev/schultesdev/prefect-go/pkg/models"
)
// TaskWorkersService handles operations related to task workers.
type TaskWorkersService struct {
client *Client
}
// List retrieves task workers matching the filter.
func (s *TaskWorkersService) List(ctx context.Context, filter *models.TaskWorkerFilter) ([]models.TaskWorkerResponse, error) {
if filter == nil {
filter = &models.TaskWorkerFilter{}
}
var workers []models.TaskWorkerResponse
if err := s.client.post(ctx, "/task_workers/filter", filter, &workers); err != nil {
return nil, fmt.Errorf("failed to list task workers: %w", err)
}
return workers, nil
}