// Code generated by glex; DO NOT EDIT. // Lexicon schema: app.bsky.embed.images 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.images#main", &EmbedImages{}) } type EmbedImages struct { LexiconTypeID string `json:"$type,omitempty"` Images []EmbedImages_Image `json:"images"` } // RecordTypeID implements glex.Record. func (t *EmbedImages) RecordTypeID() string { return "app.bsky.embed.images" } // MarshalJSON stamps the $type field, like MarshalCBOR does. The value // receiver operates on a copy, so the record is never mutated and both // EmbedImages and *EmbedImages marshal with $type. func (t EmbedImages) MarshalJSON() ([]byte, error) { t.LexiconTypeID = "app.bsky.embed.images" type alias EmbedImages return json.Marshal((alias)(t)) } func (t *EmbedImages) 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.images" return glex.MarshalCBOR(w, &cp) } func (t *EmbedImages) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) } // EmbedImages_Image is a "image" in the app.bsky.embed.images schema. type EmbedImages_Image struct { LexiconTypeID string `json:"$type,omitempty"` // alt: Alt text description of the image, for accessibility. Alt string `json:"alt"` AspectRatio *EmbedDefs_AspectRatio `json:"aspectRatio,omitempty"` // image: The raw image file. May be up to 2 MB, formerly limited to 1 MB. Image glex.Blob `json:"image"` } // RecordTypeID implements glex.Record. func (t *EmbedImages_Image) RecordTypeID() string { return "app.bsky.embed.images#image" } func (t *EmbedImages_Image) 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.images#image" return glex.MarshalCBOR(w, &cp) } func (t *EmbedImages_Image) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) } // EmbedImages_View is a "view" in the app.bsky.embed.images schema. type EmbedImages_View struct { LexiconTypeID string `json:"$type,omitempty"` Images []EmbedImages_ViewImage `json:"images"` } // RecordTypeID implements glex.Record. func (t *EmbedImages_View) RecordTypeID() string { return "app.bsky.embed.images#view" } func (t *EmbedImages_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.images#view" return glex.MarshalCBOR(w, &cp) } func (t *EmbedImages_View) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) } // EmbedImages_ViewImage is a "viewImage" in the app.bsky.embed.images schema. type EmbedImages_ViewImage struct { LexiconTypeID string `json:"$type,omitempty"` // alt: Alt text description of the image, for accessibility. Alt string `json:"alt"` AspectRatio *EmbedDefs_AspectRatio `json:"aspectRatio,omitempty"` // fullsize: Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View. Fullsize string `json:"fullsize"` // thumb: Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View. Thumb string `json:"thumb"` } // RecordTypeID implements glex.Record. func (t *EmbedImages_ViewImage) RecordTypeID() string { return "app.bsky.embed.images#viewImage" } func (t *EmbedImages_ViewImage) 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.images#viewImage" return glex.MarshalCBOR(w, &cp) } func (t *EmbedImages_ViewImage) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) }