-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathworkflow_executions.go
More file actions
89 lines (78 loc) · 2.78 KB
/
workflow_executions.go
File metadata and controls
89 lines (78 loc) · 2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// This file was auto-generated by Fern from our API Definition.
package api
import (
json "encoding/json"
fmt "fmt"
core "github.com/vellum-ai/vellum-client-go/core"
time "time"
)
type RetrieveWorkflowExecutionDetailRequest struct {
// Optional keyset cursor span_id to continue from (exclusive)
PrevSpanId *string `json:"-" url:"prev_span_id,omitempty"`
// Maximum number of spans to return (for lazy loading)
SpanLimit *int `json:"-" url:"span_limit,omitempty"`
}
type WorkflowExecutionDetail struct {
SpanId string `json:"span_id" url:"span_id"`
ParentContext *ParentContext `json:"parent_context,omitempty" url:"parent_context,omitempty"`
Start time.Time `json:"start" url:"start"`
End *time.Time `json:"end,omitempty" url:"end,omitempty"`
Inputs []*ExecutionVellumValue `json:"inputs" url:"inputs"`
Outputs []*ExecutionVellumValue `json:"outputs" url:"outputs"`
Error *WorkflowError `json:"error,omitempty" url:"error,omitempty"`
UsageResults []*WorkflowExecutionUsageResult `json:"usage_results,omitempty" url:"usage_results,omitempty"`
Spans []*VellumSpan `json:"spans" url:"spans"`
State map[string]interface{} `json:"state,omitempty" url:"state,omitempty"`
extraProperties map[string]interface{}
_rawJSON json.RawMessage
}
func (w *WorkflowExecutionDetail) GetExtraProperties() map[string]interface{} {
return w.extraProperties
}
func (w *WorkflowExecutionDetail) UnmarshalJSON(data []byte) error {
type embed WorkflowExecutionDetail
var unmarshaler = struct {
embed
Start *core.DateTime `json:"start"`
End *core.DateTime `json:"end,omitempty"`
}{
embed: embed(*w),
}
if err := json.Unmarshal(data, &unmarshaler); err != nil {
return err
}
*w = WorkflowExecutionDetail(unmarshaler.embed)
w.Start = unmarshaler.Start.Time()
w.End = unmarshaler.End.TimePtr()
extraProperties, err := core.ExtractExtraProperties(data, *w)
if err != nil {
return err
}
w.extraProperties = extraProperties
w._rawJSON = json.RawMessage(data)
return nil
}
func (w *WorkflowExecutionDetail) MarshalJSON() ([]byte, error) {
type embed WorkflowExecutionDetail
var marshaler = struct {
embed
Start *core.DateTime `json:"start"`
End *core.DateTime `json:"end,omitempty"`
}{
embed: embed(*w),
Start: core.NewDateTime(w.Start),
End: core.NewOptionalDateTime(w.End),
}
return json.Marshal(marshaler)
}
func (w *WorkflowExecutionDetail) String() string {
if len(w._rawJSON) > 0 {
if value, err := core.StringifyJSON(w._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(w); err == nil {
return value
}
return fmt.Sprintf("%#v", w)
}