// Code generated by glex; DO NOT EDIT. // Lexicon schema: place.stream.vod.draftDefs package placestream import ( "io" glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) // VodDraftDefs_DraftView is a "draftView" in the place.stream.vod.draftDefs schema. // // A draft VOD with its ats:// URI and CID, for list/get responses. type VodDraftDefs_DraftView struct { LexiconTypeID string `json:"$type,omitempty"` // cid: CID (sha256 of CBOR record bytes, base32) of the draft record. Cid string `json:"cid"` // record: The place.stream.vod.draftVideo record body. Typed as unknown (matching commentView/livestreamView/videoView) because the @atproto/api client validator cannot validate a ref to a record-type lexicon. Record *glex.LexiconTypeDecoder `json:"record"` // uri: The ats:// URI of the draft record. Uri string `json:"uri"` } // RecordTypeID implements glex.Record. func (t *VodDraftDefs_DraftView) RecordTypeID() string { return "place.stream.vod.draftDefs#draftView" } func (t *VodDraftDefs_DraftView) 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.vod.draftDefs#draftView" return glex.MarshalCBOR(w, &cp) } func (t *VodDraftDefs_DraftView) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) }