Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
8.9 kB · 238 lines
Go
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239// Code generated by glex; DO NOT EDIT.
// Lexicon schema: app.bsky.embed.external
package appbsky
import ( "encoding/json" "io"
glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" comatproto "stream.place/streamplace/pkg/comatproto")
func init() { glex.RegisterType("app.bsky.embed.external#main", &EmbedExternal{})}
// A representation of some externally linked content (eg, a URL and 'card'), embedded in a Bluesky record (eg, a post).type EmbedExternal struct { LexiconTypeID string `json:"$type,omitempty"` External EmbedExternal_External `json:"external"`}
// RecordTypeID implements glex.Record.func (t *EmbedExternal) RecordTypeID() string { return "app.bsky.embed.external" }
// MarshalJSON stamps the $type field, like MarshalCBOR does. The value// receiver operates on a copy, so the record is never mutated and both// EmbedExternal and *EmbedExternal marshal with $type.func (t EmbedExternal) MarshalJSON() ([]byte, error) { t.LexiconTypeID = "app.bsky.embed.external" type alias EmbedExternal return json.Marshal((alias)(t))}
func (t *EmbedExternal) 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.external" return glex.MarshalCBOR(w, &cp)}
func (t *EmbedExternal) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
// EmbedExternal_ColorRGB is a "colorRGB" in the app.bsky.embed.external schema.//// RGB color definition, inspired by site.standard.theme.color#rgbtype EmbedExternal_ColorRGB struct { LexiconTypeID string `json:"$type,omitempty"` B int64 `json:"b"` G int64 `json:"g"` R int64 `json:"r"`}
// RecordTypeID implements glex.Record.func (t *EmbedExternal_ColorRGB) RecordTypeID() string { return "app.bsky.embed.external#colorRGB" }
func (t *EmbedExternal_ColorRGB) 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.external#colorRGB" return glex.MarshalCBOR(w, &cp)}
func (t *EmbedExternal_ColorRGB) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
// EmbedExternal_External is a "external" in the app.bsky.embed.external schema.type EmbedExternal_External struct { LexiconTypeID string `json:"$type,omitempty"` // associatedRefs: StrongRefs (uri+cid) of the Atmosphere records that backed this view. AssociatedRefs []comatproto.RepoStrongRef `json:"associatedRefs,omitempty"` Description string `json:"description"` Thumb *glex.Blob `json:"thumb,omitempty"` Title string `json:"title"` Uri string `json:"uri"`}
// RecordTypeID implements glex.Record.func (t *EmbedExternal_External) RecordTypeID() string { return "app.bsky.embed.external#external" }
func (t *EmbedExternal_External) 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.external#external" return glex.MarshalCBOR(w, &cp)}
func (t *EmbedExternal_External) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
// EmbedExternal_View is a "view" in the app.bsky.embed.external schema.type EmbedExternal_View struct { LexiconTypeID string `json:"$type,omitempty"` External EmbedExternal_ViewExternal `json:"external"`}
// RecordTypeID implements glex.Record.func (t *EmbedExternal_View) RecordTypeID() string { return "app.bsky.embed.external#view" }
func (t *EmbedExternal_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.external#view" return glex.MarshalCBOR(w, &cp)}
func (t *EmbedExternal_View) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
// EmbedExternal_ViewExternal is a "viewExternal" in the app.bsky.embed.external schema.type EmbedExternal_ViewExternal struct { LexiconTypeID string `json:"$type,omitempty"` // associatedProfiles: Profiles of the owners of the Atmosphere records that backed this view. AssociatedProfiles []ActorDefs_ProfileViewBasic `json:"associatedProfiles,omitempty"` // associatedRefs: StrongRefs (uri+cid) of the Atmosphere records that backed this view. AssociatedRefs []comatproto.RepoStrongRef `json:"associatedRefs,omitempty"` // createdAt: When the external content was created, if available. Example: a publication date, for an article. CreatedAt *string `json:"createdAt,omitempty"` Description string `json:"description"` Labels []comatproto.LabelDefs_Label `json:"labels,omitempty"` // readingTime: Estimated reading time in minutes, if applicable and available. ReadingTime *int64 `json:"readingTime,omitempty"` Source *EmbedExternal_ViewExternalSource `json:"source,omitempty"` Thumb *string `json:"thumb,omitempty"` Title string `json:"title"` // updatedAt: When the external content was updated, if available. UpdatedAt *string `json:"updatedAt,omitempty"` Uri string `json:"uri"`}
// RecordTypeID implements glex.Record.func (t *EmbedExternal_ViewExternal) RecordTypeID() string { return "app.bsky.embed.external#viewExternal"}
func (t *EmbedExternal_ViewExternal) 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.external#viewExternal" return glex.MarshalCBOR(w, &cp)}
func (t *EmbedExternal_ViewExternal) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
// EmbedExternal_ViewExternalSource is a "viewExternalSource" in the app.bsky.embed.external schema.//// The source of an external embed, such as a standard.site publication.type EmbedExternal_ViewExternalSource struct { LexiconTypeID string `json:"$type,omitempty"` Description *string `json:"description,omitempty"` // icon: Fully-qualified URL where an icon representing the source can be fetched. For example, CDN location provided by the App View. Icon *string `json:"icon,omitempty"` Theme *EmbedExternal_ViewExternalSourceTheme `json:"theme,omitempty"` Title string `json:"title"` // uri: URI of the source, if available. Example: the https:// URL of a site.standard.publication record. Uri string `json:"uri"`}
// RecordTypeID implements glex.Record.func (t *EmbedExternal_ViewExternalSource) RecordTypeID() string { return "app.bsky.embed.external#viewExternalSource"}
func (t *EmbedExternal_ViewExternalSource) 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.external#viewExternalSource" return glex.MarshalCBOR(w, &cp)}
func (t *EmbedExternal_ViewExternalSource) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
// EmbedExternal_ViewExternalSourceTheme is a "viewExternalSourceTheme" in the app.bsky.embed.external schema.//// The theme colors of an external source, such as a site.standard.publication. These colors may be used when rendering an embed from that source.type EmbedExternal_ViewExternalSourceTheme struct { LexiconTypeID string `json:"$type,omitempty"` AccentForegroundRGB *EmbedExternal_ColorRGB `json:"accentForegroundRGB,omitempty"` AccentRGB *EmbedExternal_ColorRGB `json:"accentRGB,omitempty"` BackgroundRGB *EmbedExternal_ColorRGB `json:"backgroundRGB,omitempty"` ForegroundRGB *EmbedExternal_ColorRGB `json:"foregroundRGB,omitempty"`}
// RecordTypeID implements glex.Record.func (t *EmbedExternal_ViewExternalSourceTheme) RecordTypeID() string { return "app.bsky.embed.external#viewExternalSourceTheme"}
func (t *EmbedExternal_ViewExternalSourceTheme) 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.external#viewExternalSourceTheme" return glex.MarshalCBOR(w, &cp)}
func (t *EmbedExternal_ViewExternalSourceTheme) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}