@@ -33,20 +33,20 @@ const (
3333
3434// listWorkflowsRequest represents the request structure for listing workflows
3535type listWorkflowsRequest struct {
36- WorkflowUUIDs []string `json:"workflow_uuids"` // Filter by specific workflow IDs
37- AuthenticatedUser * string `json:"authenticated_user"` // Filter by user who initiated the workflow
38- StartTime * time.Time `json:"start_time"` // Filter workflows created after this time (RFC3339 format)
39- EndTime * time.Time `json:"end_time"` // Filter workflows created before this time (RFC3339 format)
40- Status []WorkflowStatusType `json:"status"` // Filter by workflow status(es)
41- ApplicationVersion * string `json:"application_version"` // Filter by application version
42- WorkflowName * string `json:"workflow_name"` // Filter by workflow function name
43- Limit * int `json:"limit"` // Maximum number of results to return
44- Offset * int `json:"offset"` // Offset for pagination
45- SortDesc * bool `json:"sort_desc"` // Sort in descending order by creation time
46- WorkflowIDPrefix * string `json:"workflow_id_prefix"` // Filter by workflow ID prefix
47- LoadInput * bool `json:"load_input"` // Include workflow input in response
48- LoadOutput * bool `json:"load_output"` // Include workflow output in response
49- QueueName * string `json:"queue_name"` // Filter by queue name (for queued workflows)
36+ WorkflowUUIDs []string `json:"workflow_uuids"` // Filter by specific workflow IDs
37+ AuthenticatedUser * string `json:"authenticated_user"` // Filter by user who initiated the workflow
38+ StartTime * time.Time `json:"start_time"` // Filter workflows created after this time (RFC3339 format)
39+ EndTime * time.Time `json:"end_time"` // Filter workflows created before this time (RFC3339 format)
40+ Status []string `json:"status"` // Filter by workflow status(es)
41+ ApplicationVersion * string `json:"application_version"` // Filter by application version
42+ WorkflowName * string `json:"workflow_name"` // Filter by workflow function name
43+ Limit * int `json:"limit"` // Maximum number of results to return
44+ Offset * int `json:"offset"` // Offset for pagination
45+ SortDesc * bool `json:"sort_desc"` // Sort in descending order by creation time
46+ WorkflowIDPrefix * string `json:"workflow_id_prefix"` // Filter by workflow ID prefix
47+ LoadInput * bool `json:"load_input"` // Include workflow input in response
48+ LoadOutput * bool `json:"load_output"` // Include workflow output in response
49+ QueueName * string `json:"queue_name"` // Filter by queue name (for queued workflows)
5050}
5151
5252// buildOptions converts the request struct into a slice of ListWorkflowsOption
@@ -65,7 +65,11 @@ func (req *listWorkflowsRequest) toListWorkflowsOptions() []ListWorkflowsOption
6565 opts = append (opts , WithEndTime (* req .EndTime ))
6666 }
6767 if len (req .Status ) > 0 {
68- opts = append (opts , WithStatus (req .Status ))
68+ statuses := make ([]WorkflowStatusType , len (req .Status ))
69+ for i , s := range req .Status {
70+ statuses [i ] = WorkflowStatusType (s )
71+ }
72+ opts = append (opts , WithStatus (statuses ))
6973 }
7074 if req .ApplicationVersion != nil {
7175 opts = append (opts , WithAppVersion (* req .ApplicationVersion ))
0 commit comments