Monorepo for Tangled tangled.org
6

Configure Feed

Select the types of activity you want to include in your feed.

1// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 3package tangled 4 5// schema: sh.tangled.ci.defs 6 7import ( 8 "encoding/json" 9 "fmt" 10 11 "github.com/bluesky-social/indigo/lex/util" 12) 13 14const () 15 16// CiDefs_Pipeline is a "pipeline" in the sh.tangled.ci.defs schema. 17type CiDefs_Pipeline struct { 18 // commit: Commit Id this pipeline is running on 19 Commit string `json:"commit" cborgen:"commit"` 20 CreatedAt *string `json:"createdAt,omitempty" cborgen:"createdAt,omitempty"` 21 // id: Spindle-local pipeline id 22 Id string `json:"id" cborgen:"id"` 23 // repo: Repository DID 24 Repo *string `json:"repo,omitempty" cborgen:"repo,omitempty"` 25 // trigger: Trigger event metadata 26 Trigger *CiDefs_Pipeline_Trigger `json:"trigger" cborgen:"trigger"` 27 // workflows: Triggered workflows 28 Workflows []*CiDefs_Workflow `json:"workflows" cborgen:"workflows"` 29} 30 31// Trigger event metadata 32type CiDefs_Pipeline_Trigger struct { 33 CiTrigger_Push *CiTrigger_Push 34 CiTrigger_PullRequest *CiTrigger_PullRequest 35 CiTrigger_Manual *CiTrigger_Manual 36} 37 38func (t *CiDefs_Pipeline_Trigger) MarshalJSON() ([]byte, error) { 39 if t.CiTrigger_Push != nil { 40 t.CiTrigger_Push.LexiconTypeID = "sh.tangled.ci.trigger#push" 41 return json.Marshal(t.CiTrigger_Push) 42 } 43 if t.CiTrigger_PullRequest != nil { 44 t.CiTrigger_PullRequest.LexiconTypeID = "sh.tangled.ci.trigger#pullRequest" 45 return json.Marshal(t.CiTrigger_PullRequest) 46 } 47 if t.CiTrigger_Manual != nil { 48 t.CiTrigger_Manual.LexiconTypeID = "sh.tangled.ci.trigger#manual" 49 return json.Marshal(t.CiTrigger_Manual) 50 } 51 return nil, fmt.Errorf("cannot marshal empty enum") 52} 53func (t *CiDefs_Pipeline_Trigger) UnmarshalJSON(b []byte) error { 54 typ, err := util.TypeExtract(b) 55 if err != nil { 56 return err 57 } 58 59 switch typ { 60 case "sh.tangled.ci.trigger#push": 61 t.CiTrigger_Push = new(CiTrigger_Push) 62 return json.Unmarshal(b, t.CiTrigger_Push) 63 case "sh.tangled.ci.trigger#pullRequest": 64 t.CiTrigger_PullRequest = new(CiTrigger_PullRequest) 65 return json.Unmarshal(b, t.CiTrigger_PullRequest) 66 case "sh.tangled.ci.trigger#manual": 67 t.CiTrigger_Manual = new(CiTrigger_Manual) 68 return json.Unmarshal(b, t.CiTrigger_Manual) 69 70 default: 71 return nil 72 } 73} 74 75// CiDefs_Workflow is a "workflow" in the sh.tangled.ci.defs schema. 76type CiDefs_Workflow struct { 77 FinishedAt *string `json:"finishedAt,omitempty" cborgen:"finishedAt,omitempty"` 78 // id: Spindle-local workflow id. Used to fetch workflow logs 79 Id int64 `json:"id" cborgen:"id"` 80 // name: Name of the workflow 81 Name string `json:"name" cborgen:"name"` 82 StartedAt *string `json:"startedAt,omitempty" cborgen:"startedAt,omitempty"` 83 // status: Workflow status 84 Status string `json:"status" cborgen:"status"` 85}