Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
3.5 kB · 111 lines
Go
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112// Code generated by glex; DO NOT EDIT.
// Lexicon schema: app.bsky.embed.video
package appbsky
import ( "encoding/json" "io"
glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen")
func init() { glex.RegisterType("app.bsky.embed.video#main", &EmbedVideo{})}
type EmbedVideo struct { LexiconTypeID string `json:"$type,omitempty"` // alt: Alt text description of the video, for accessibility. Alt *string `json:"alt,omitempty"` AspectRatio *EmbedDefs_AspectRatio `json:"aspectRatio,omitempty"` Captions []EmbedVideo_Caption `json:"captions,omitempty"` // presentation: A hint to the client about how to present the video. Presentation *string `json:"presentation,omitempty"` // video: The mp4 video file. May be up to 100mb, formerly limited to 50mb. Video glex.Blob `json:"video"`}
// RecordTypeID implements glex.Record.func (t *EmbedVideo) RecordTypeID() string { return "app.bsky.embed.video" }
// MarshalJSON stamps the $type field, like MarshalCBOR does. The value// receiver operates on a copy, so the record is never mutated and both// EmbedVideo and *EmbedVideo marshal with $type.func (t EmbedVideo) MarshalJSON() ([]byte, error) { t.LexiconTypeID = "app.bsky.embed.video" type alias EmbedVideo return json.Marshal((alias)(t))}
func (t *EmbedVideo) 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 = "app.bsky.embed.video" return glex.MarshalCBOR(w, &cp)}
func (t *EmbedVideo) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
// EmbedVideo_Caption is a "caption" in the app.bsky.embed.video schema.type EmbedVideo_Caption struct { LexiconTypeID string `json:"$type,omitempty"` File glex.Blob `json:"file"` Lang string `json:"lang"`}
// RecordTypeID implements glex.Record.func (t *EmbedVideo_Caption) RecordTypeID() string { return "app.bsky.embed.video#caption" }
func (t *EmbedVideo_Caption) 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 = "app.bsky.embed.video#caption" return glex.MarshalCBOR(w, &cp)}
func (t *EmbedVideo_Caption) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
// EmbedVideo_View is a "view" in the app.bsky.embed.video schema.type EmbedVideo_View struct { LexiconTypeID string `json:"$type,omitempty"` Alt *string `json:"alt,omitempty"` AspectRatio *EmbedDefs_AspectRatio `json:"aspectRatio,omitempty"` Cid string `json:"cid"` Playlist string `json:"playlist"` // presentation: A hint to the client about how to present the video. Presentation *string `json:"presentation,omitempty"` Thumbnail *string `json:"thumbnail,omitempty"`}
// RecordTypeID implements glex.Record.func (t *EmbedVideo_View) RecordTypeID() string { return "app.bsky.embed.video#view" }
func (t *EmbedVideo_View) 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 = "app.bsky.embed.video#view" return glex.MarshalCBOR(w, &cp)}
func (t *EmbedVideo_View) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}