-
Notifications
You must be signed in to change notification settings - Fork 10
/
client.go
51 lines (46 loc) · 1.58 KB
/
client.go
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
package tasks
import "github.com/ipld/go-ipld-prime/schema"
// accessor methods for working with client structs
func (ptp *_PopTask__Prototype) Of(workedBy string, status Status, tags ...string) *_PopTask {
s := make([]_String, len(tags))
for i := range tags {
s[i] = _String{tags[i]}
}
ls := _List_String{
x: s,
}
pt := _PopTask{
WorkedBy: _String{workedBy},
Status: *status,
Tags: _List_String__Maybe{m: schema.Maybe_Value, v: ls},
}
return &pt
}
func (utp *_UpdateTask__Prototype) Of(workedBy string, status Status, runCount int) *_UpdateTask {
ut := _UpdateTask{
WorkedBy: _String{workedBy},
Status: *status,
ErrorMessage: _String__Maybe{m: schema.Maybe_Absent},
CurrentStageDetails: _StageDetails__Maybe{m: schema.Maybe_Absent},
Stage: _String__Maybe{m: schema.Maybe_Absent},
RunCount: _Int{int64(runCount)},
}
return &ut
}
func (utp *_UpdateTask__Prototype) OfStage(workedBy string, status Status, errorMessage string, stage string, details StageDetails, runCount int) *_UpdateTask {
var err _String__Maybe
if errorMessage == "" {
err = _String__Maybe{m: schema.Maybe_Absent}
} else {
err = _String__Maybe{m: schema.Maybe_Value, v: _String{errorMessage}}
}
ut := _UpdateTask{
WorkedBy: _String{workedBy},
Status: *status,
ErrorMessage: err,
CurrentStageDetails: _StageDetails__Maybe{m: schema.Maybe_Value, v: details},
Stage: _String__Maybe{m: schema.Maybe_Value, v: _String{stage}},
RunCount: _Int{int64(runCount)},
}
return &ut
}