Something went wrong. Try again.
Monorepo for Tangled tangled.org
Something went wrong. Try again.
3.4 kB · 100 lines
Go
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
package org_tangled
// schema: org.tangled.ci.pipeline
import ( "encoding/json" "fmt"
"github.com/bluesky-social/indigo/lex/util")
const ( CiPipelineNSID = "org.tangled.ci.pipeline")
// CiPipeline is a "main" in the org.tangled.ci.pipeline schema.//// A CI pipeline. Record-like, but owned by the spindle rather than a PDS.type CiPipeline struct { // commit: Commit Id this pipeline is running on Commit string `json:"commit" cborgen:"commit"` CreatedAt *string `json:"createdAt,omitempty" cborgen:"createdAt,omitempty"` // id: Spindle-local pipeline id Id string `json:"id" cborgen:"id"` // repo: Repository DID Repo string `json:"repo" cborgen:"repo"` // sourceRepo: Repository DID that the commit was checked out from, if different from repo (e.g. a fork for a fork-based pull request) SourceRepo *string `json:"sourceRepo,omitempty" cborgen:"sourceRepo,omitempty"` // trigger: Trigger event that triggered this pipeline. Trigger *CiPipeline_Trigger `json:"trigger" cborgen:"trigger"` // workflows: Triggered workflows Workflows []*CiPipeline_Workflow `json:"workflows" cborgen:"workflows"`}
// Trigger event that triggered this pipeline.type CiPipeline_Trigger struct { EventPush *EventPush EventPullRequest *EventPullRequest CiTriggerManual *CiTriggerManual Unknown json.RawMessage}
func (t *CiPipeline_Trigger) MarshalJSON() ([]byte, error) { if t.EventPush != nil { t.EventPush.LexiconTypeID = "org.tangled.event.push" return json.Marshal(t.EventPush) } if t.EventPullRequest != nil { t.EventPullRequest.LexiconTypeID = "org.tangled.event.pullRequest" return json.Marshal(t.EventPullRequest) } if t.CiTriggerManual != nil { t.CiTriggerManual.LexiconTypeID = "org.tangled.ci.trigger.manual" return json.Marshal(t.CiTriggerManual) } if t.Unknown != nil { return t.Unknown, nil } return nil, fmt.Errorf("cannot marshal empty enum")}func (t *CiPipeline_Trigger) UnmarshalJSON(b []byte) error { typ, err := util.TypeExtract(b) if err != nil { return err }
*t = CiPipeline_Trigger{} switch typ { case "org.tangled.event.push": t.EventPush = new(EventPush) return json.Unmarshal(b, t.EventPush) case "org.tangled.event.pullRequest": t.EventPullRequest = new(EventPullRequest) return json.Unmarshal(b, t.EventPullRequest) case "org.tangled.ci.trigger.manual": t.CiTriggerManual = new(CiTriggerManual) return json.Unmarshal(b, t.CiTriggerManual)
default: t.Unknown = append(t.Unknown[:0], b...) return nil }}
// CiPipeline_Workflow is a "workflow" in the org.tangled.ci.pipeline schema.type CiPipeline_Workflow struct { // definition: Workflow definition where this workflow run is originated from. Definition *CiWorkflow `json:"definition" cborgen:"definition"` Error *string `json:"error,omitempty" cborgen:"error,omitempty"` FinishedAt *string `json:"finishedAt,omitempty" cborgen:"finishedAt,omitempty"` // id: Pipeline-local workflow id, usually same as name. Id string `json:"id" cborgen:"id"` // name: Human-readable name of the workflow Name *string `json:"name,omitempty" cborgen:"name,omitempty"` StartedAt *string `json:"startedAt,omitempty" cborgen:"startedAt,omitempty"` // status: Workflow status Status string `json:"status" cborgen:"status"`}