Something went wrong. Try again.
Monorepo for Tangled forked from tangled.org/core
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
package org_tangled
// schema: org.tangled.event.notifyEvent
import ( "context" "encoding/json" "fmt"
"github.com/bluesky-social/indigo/lex/util")
const ( EventNotifyEventNSID = "org.tangled.event.notifyEvent")
// EventNotifyEvent_CiOutput is a "ciOutput" in the org.tangled.event.notifyEvent schema.type EventNotifyEvent_CiOutput struct { // message: Text returned by the server for this push, like how to follow a started CI. Message *string `json:"message,omitempty" cborgen:"message,omitempty"` // pipelines: IDs of the scheduled pipelines Pipelines []string `json:"pipelines,omitempty" cborgen:"pipelines,omitempty"`}
// EventNotifyEvent_Input is the input argument to a org.tangled.event.notifyEvent call.type EventNotifyEvent_Input struct { // event: Tangled event object Event *EventNotifyEvent_Input_Event `json:"event" cborgen:"event"` // repo: Repository DID Repo string `json:"repo" cborgen:"repo"`}
// Tangled event objecttype EventNotifyEvent_Input_Event struct { CiTriggerManual *CiTriggerManual EventPush *EventPush}
func (t *EventNotifyEvent_Input_Event) MarshalJSON() ([]byte, error) { if t.CiTriggerManual != nil { t.CiTriggerManual.LexiconTypeID = "org.tangled.ci.trigger.manual" return json.Marshal(t.CiTriggerManual) } if t.EventPush != nil { t.EventPush.LexiconTypeID = "org.tangled.event.push" return json.Marshal(t.EventPush) } return nil, fmt.Errorf("cannot marshal empty enum")}func (t *EventNotifyEvent_Input_Event) UnmarshalJSON(b []byte) error { typ, err := util.TypeExtract(b) if err != nil { return err }
switch typ { case "org.tangled.ci.trigger.manual": t.CiTriggerManual = new(CiTriggerManual) return json.Unmarshal(b, t.CiTriggerManual) case "org.tangled.event.push": t.EventPush = new(EventPush) return json.Unmarshal(b, t.EventPush)
default: return nil }}
// EventNotifyEvent_Output is the output of a org.tangled.event.notifyEvent call.type EventNotifyEvent_Output struct { Ci *EventNotifyEvent_CiOutput `json:"ci,omitempty" cborgen:"ci,omitempty"`}
// EventNotifyEvent calls the XRPC method "org.tangled.event.notifyEvent".func EventNotifyEvent(ctx context.Context, c util.LexClient, input *EventNotifyEvent_Input) (*EventNotifyEvent_Output, error) { var out EventNotifyEvent_Output if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.event.notifyEvent", nil, input, &out); err != nil { return nil, err }
return &out, nil}