// Code generated by glex; DO NOT EDIT. // Lexicon schema: place.stream.broadcast.syndication package placestream import ( "encoding/json" "io" glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { glex.RegisterType("place.stream.broadcast.syndication", &BroadcastSyndication{}) } // Record created by a Streamplace broadcaster to indicate that they will be replicating a livestream. NYI type BroadcastSyndication struct { LexiconTypeID string `json:"$type,omitempty"` // broadcaster: DID of the Streamplace broadcaster that will be replicating the livestream Broadcaster string `json:"broadcaster"` // createdAt: Client-declared timestamp when this syndication was created. CreatedAt string `json:"createdAt"` // streamer: DID of the streamer whose livestream is being replicated Streamer string `json:"streamer"` } // RecordTypeID implements glex.Record. func (t *BroadcastSyndication) RecordTypeID() string { return "place.stream.broadcast.syndication" } // MarshalJSON stamps the $type field, like MarshalCBOR does. The value // receiver operates on a copy, so the record is never mutated and both // BroadcastSyndication and *BroadcastSyndication marshal with $type. func (t BroadcastSyndication) MarshalJSON() ([]byte, error) { t.LexiconTypeID = "place.stream.broadcast.syndication" type alias BroadcastSyndication return json.Marshal((alias)(t)) } func (t *BroadcastSyndication) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } // stamp $type on a copy so marshal never mutates the record cp := *t cp.LexiconTypeID = "place.stream.broadcast.syndication" return glex.MarshalCBOR(w, &cp) } func (t *BroadcastSyndication) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) }