// Code generated by glex; DO NOT EDIT. // Lexicon schema: place.stream.server.settings package placestream import ( "encoding/json" "io" glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { glex.RegisterType("place.stream.server.settings", &ServerSettings{}) } // Record containing user settings for a particular Streamplace node type ServerSettings struct { LexiconTypeID string `json:"$type,omitempty"` // debugRecording: Whether this node may archive your livestream for improving the service DebugRecording *bool `json:"debugRecording,omitempty"` // livestreamRecording: Whether this node should record your livestreams into VODs that you can publish LivestreamRecording *bool `json:"livestreamRecording,omitempty"` } // RecordTypeID implements glex.Record. func (t *ServerSettings) RecordTypeID() string { return "place.stream.server.settings" } // MarshalJSON stamps the $type field, like MarshalCBOR does. The value // receiver operates on a copy, so the record is never mutated and both // ServerSettings and *ServerSettings marshal with $type. func (t ServerSettings) MarshalJSON() ([]byte, error) { t.LexiconTypeID = "place.stream.server.settings" type alias ServerSettings return json.Marshal((alias)(t)) } func (t *ServerSettings) 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.server.settings" return glex.MarshalCBOR(w, &cp) } func (t *ServerSettings) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) }