Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
48 kB · 1315 lines
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316// Code generated by glex; DO NOT EDIT.
// Lexicon schema: app.bsky.feed.defs
package appbsky
import ( "encoding/json" "fmt" "io"
glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" comatproto "stream.place/streamplace/pkg/comatproto")
// FeedDefs_BlockedAuthor is a "blockedAuthor" in the app.bsky.feed.defs schema.type FeedDefs_BlockedAuthor struct { LexiconTypeID string `json:"$type,omitempty"` Did string `json:"did"` Viewer *ActorDefs_ViewerState `json:"viewer,omitempty"`}
// RecordTypeID implements glex.Record.func (t *FeedDefs_BlockedAuthor) RecordTypeID() string { return "app.bsky.feed.defs#blockedAuthor" }
func (t *FeedDefs_BlockedAuthor) 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.feed.defs#blockedAuthor" return glex.MarshalCBOR(w, &cp)}
func (t *FeedDefs_BlockedAuthor) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
// FeedDefs_BlockedPost is a "blockedPost" in the app.bsky.feed.defs schema.type FeedDefs_BlockedPost struct { LexiconTypeID string `json:"$type,omitempty"` Author FeedDefs_BlockedAuthor `json:"author"` Blocked bool `json:"blocked"` Uri string `json:"uri"`}
// RecordTypeID implements glex.Record.func (t *FeedDefs_BlockedPost) RecordTypeID() string { return "app.bsky.feed.defs#blockedPost" }
func (t *FeedDefs_BlockedPost) 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.feed.defs#blockedPost" return glex.MarshalCBOR(w, &cp)}
func (t *FeedDefs_BlockedPost) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
// FeedDefs_FeedViewPost is a "feedViewPost" in the app.bsky.feed.defs schema.type FeedDefs_FeedViewPost struct { LexiconTypeID string `json:"$type,omitempty"` // feedContext: Context provided by feed generator that may be passed back alongside interactions. FeedContext *string `json:"feedContext,omitempty"` Post FeedDefs_PostView `json:"post"` Reason *FeedDefs_FeedViewPost_Reason `json:"reason,omitempty"` Reply *FeedDefs_ReplyRef `json:"reply,omitempty"` // reqId: Unique identifier per request that may be passed back alongside interactions. ReqId *string `json:"reqId,omitempty"`}
// RecordTypeID implements glex.Record.func (t *FeedDefs_FeedViewPost) RecordTypeID() string { return "app.bsky.feed.defs#feedViewPost" }
func (t *FeedDefs_FeedViewPost) 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.feed.defs#feedViewPost" return glex.MarshalCBOR(w, &cp)}
func (t *FeedDefs_FeedViewPost) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
type FeedDefs_FeedViewPost_Reason struct { FeedDefs_ReasonPin *FeedDefs_ReasonPin FeedDefs_ReasonRepost *FeedDefs_ReasonRepost // Raw preserves a variant whose $type is not in this union's generated // set, so unrecognized variants still round-trip losslessly through // decode/re-encode. Nil when a known variant is set. Raw *glex.RawRecord}
// MarshalJSON emits the set variant, stamped with its $type, per the atproto// union wire format. The value receiver stamps a copy, so the variant is// never mutated and both FeedDefs_FeedViewPost_Reason and *FeedDefs_FeedViewPost_Reason marshal correctly.func (t FeedDefs_FeedViewPost_Reason) MarshalJSON() ([]byte, error) { if t.FeedDefs_ReasonPin != nil { cp := *t.FeedDefs_ReasonPin cp.LexiconTypeID = "app.bsky.feed.defs#reasonPin" return json.Marshal(&cp) } if t.FeedDefs_ReasonRepost != nil { cp := *t.FeedDefs_ReasonRepost cp.LexiconTypeID = "app.bsky.feed.defs#reasonRepost" return json.Marshal(&cp) } if t.Raw != nil { if t.Raw.Encoding != "json" { return nil, fmt.Errorf("cannot marshal raw %s record as JSON in union FeedDefs_FeedViewPost_Reason", t.Raw.Encoding) } return t.Raw.Bytes, nil } return nil, fmt.Errorf("cannot marshal empty union FeedDefs_FeedViewPost_Reason as JSON")}
func (t *FeedDefs_FeedViewPost_Reason) UnmarshalJSON(b []byte) error { typ, err := glex.TypeExtract(b) if err != nil { return err }
switch typ { case "app.bsky.feed.defs#reasonPin": t.FeedDefs_ReasonPin = new(FeedDefs_ReasonPin) return json.Unmarshal(b, t.FeedDefs_ReasonPin) case "app.bsky.feed.defs#reasonRepost": t.FeedDefs_ReasonRepost = new(FeedDefs_ReasonRepost) return json.Unmarshal(b, t.FeedDefs_ReasonRepost) default: t.Raw = &glex.RawRecord{Type: typ, Encoding: "json", Bytes: append([]byte(nil), b...)} return nil }}
// MarshalCBOR implements drisl.Marshaler, emitting the set variant (stamped// with its $type) per the atproto union wire format. go-dasl invokes this// when the union appears inside another record, so nested unions serialize// correctly.func (t FeedDefs_FeedViewPost_Reason) MarshalCBOR() ([]byte, error) { if t.FeedDefs_ReasonPin != nil { cp := *t.FeedDefs_ReasonPin cp.LexiconTypeID = "app.bsky.feed.defs#reasonPin" return glex.MarshalCBORBytes(&cp) } if t.FeedDefs_ReasonRepost != nil { cp := *t.FeedDefs_ReasonRepost cp.LexiconTypeID = "app.bsky.feed.defs#reasonRepost" return glex.MarshalCBORBytes(&cp) } if t.Raw != nil { if t.Raw.Encoding != "cbor" { return nil, fmt.Errorf("cannot marshal raw %s record as CBOR in union FeedDefs_FeedViewPost_Reason", t.Raw.Encoding) } return t.Raw.Bytes, nil } return nil, fmt.Errorf("cannot marshal empty union FeedDefs_FeedViewPost_Reason as CBOR")}
func (t *FeedDefs_FeedViewPost_Reason) UnmarshalCBOR(b []byte) error { typ, err := glex.CborTypeExtract(b) if err != nil { return err }
switch typ { case "app.bsky.feed.defs#reasonPin": t.FeedDefs_ReasonPin = new(FeedDefs_ReasonPin) return glex.UnmarshalCBORBytes(b, t.FeedDefs_ReasonPin) case "app.bsky.feed.defs#reasonRepost": t.FeedDefs_ReasonRepost = new(FeedDefs_ReasonRepost) return glex.UnmarshalCBORBytes(b, t.FeedDefs_ReasonRepost) default: t.Raw = &glex.RawRecord{Type: typ, Encoding: "cbor", Bytes: append([]byte(nil), b...)} return nil }}
// FeedDefs_GeneratorView is a "generatorView" in the app.bsky.feed.defs schema.type FeedDefs_GeneratorView struct { LexiconTypeID string `json:"$type,omitempty"` AcceptsInteractions *bool `json:"acceptsInteractions,omitempty"` Avatar *string `json:"avatar,omitempty"` Cid string `json:"cid"` ContentMode *string `json:"contentMode,omitempty"` Creator ActorDefs_ProfileView `json:"creator"` Description *string `json:"description,omitempty"` DescriptionFacets []RichtextFacet `json:"descriptionFacets,omitempty"` Did string `json:"did"` DisplayName string `json:"displayName"` IndexedAt string `json:"indexedAt"` Labels []comatproto.LabelDefs_Label `json:"labels,omitempty"` LikeCount *int64 `json:"likeCount,omitempty"` Uri string `json:"uri"` Viewer *FeedDefs_GeneratorViewerState `json:"viewer,omitempty"`}
// RecordTypeID implements glex.Record.func (t *FeedDefs_GeneratorView) RecordTypeID() string { return "app.bsky.feed.defs#generatorView" }
func (t *FeedDefs_GeneratorView) 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.feed.defs#generatorView" return glex.MarshalCBOR(w, &cp)}
func (t *FeedDefs_GeneratorView) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
// FeedDefs_GeneratorViewerState is a "generatorViewerState" in the app.bsky.feed.defs schema.type FeedDefs_GeneratorViewerState struct { LexiconTypeID string `json:"$type,omitempty"` Like *string `json:"like,omitempty"`}
// RecordTypeID implements glex.Record.func (t *FeedDefs_GeneratorViewerState) RecordTypeID() string { return "app.bsky.feed.defs#generatorViewerState"}
func (t *FeedDefs_GeneratorViewerState) 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.feed.defs#generatorViewerState" return glex.MarshalCBOR(w, &cp)}
func (t *FeedDefs_GeneratorViewerState) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
// FeedDefs_Interaction is a "interaction" in the app.bsky.feed.defs schema.type FeedDefs_Interaction struct { LexiconTypeID string `json:"$type,omitempty"` Event *string `json:"event,omitempty"` // feedContext: Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton. FeedContext *string `json:"feedContext,omitempty"` Item *string `json:"item,omitempty"` // reqId: Unique identifier per request that may be passed back alongside interactions. ReqId *string `json:"reqId,omitempty"`}
// RecordTypeID implements glex.Record.func (t *FeedDefs_Interaction) RecordTypeID() string { return "app.bsky.feed.defs#interaction" }
func (t *FeedDefs_Interaction) 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.feed.defs#interaction" return glex.MarshalCBOR(w, &cp)}
func (t *FeedDefs_Interaction) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
// FeedDefs_NotFoundPost is a "notFoundPost" in the app.bsky.feed.defs schema.type FeedDefs_NotFoundPost struct { LexiconTypeID string `json:"$type,omitempty"` NotFound bool `json:"notFound"` Uri string `json:"uri"`}
// RecordTypeID implements glex.Record.func (t *FeedDefs_NotFoundPost) RecordTypeID() string { return "app.bsky.feed.defs#notFoundPost" }
func (t *FeedDefs_NotFoundPost) 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.feed.defs#notFoundPost" return glex.MarshalCBOR(w, &cp)}
func (t *FeedDefs_NotFoundPost) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
// FeedDefs_PostView is a "postView" in the app.bsky.feed.defs schema.type FeedDefs_PostView struct { LexiconTypeID string `json:"$type,omitempty"` Author ActorDefs_ProfileViewBasic `json:"author"` BookmarkCount *int64 `json:"bookmarkCount,omitempty"` Cid string `json:"cid"` // debug: Debug information for internal development Debug *glex.LexiconTypeDecoder `json:"debug,omitempty"` Embed *FeedDefs_PostView_Embed `json:"embed,omitempty"` IndexedAt string `json:"indexedAt"` Labels []comatproto.LabelDefs_Label `json:"labels,omitempty"` LikeCount *int64 `json:"likeCount,omitempty"` QuoteCount *int64 `json:"quoteCount,omitempty"` Record *glex.LexiconTypeDecoder `json:"record"` ReplyCount *int64 `json:"replyCount,omitempty"` RepostCount *int64 `json:"repostCount,omitempty"` Threadgate *FeedDefs_ThreadgateView `json:"threadgate,omitempty"` Uri string `json:"uri"` Viewer *FeedDefs_ViewerState `json:"viewer,omitempty"`}
// RecordTypeID implements glex.Record.func (t *FeedDefs_PostView) RecordTypeID() string { return "app.bsky.feed.defs#postView" }
func (t *FeedDefs_PostView) 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.feed.defs#postView" return glex.MarshalCBOR(w, &cp)}
func (t *FeedDefs_PostView) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
type FeedDefs_PostView_Embed struct { EmbedExternal_View *EmbedExternal_View EmbedGallery_View *EmbedGallery_View EmbedImages_View *EmbedImages_View EmbedRecordWithMedia_View *EmbedRecordWithMedia_View EmbedRecord_View *EmbedRecord_View EmbedVideo_View *EmbedVideo_View // Raw preserves a variant whose $type is not in this union's generated // set, so unrecognized variants still round-trip losslessly through // decode/re-encode. Nil when a known variant is set. Raw *glex.RawRecord}
// MarshalJSON emits the set variant, stamped with its $type, per the atproto// union wire format. The value receiver stamps a copy, so the variant is// never mutated and both FeedDefs_PostView_Embed and *FeedDefs_PostView_Embed marshal correctly.func (t FeedDefs_PostView_Embed) MarshalJSON() ([]byte, error) { if t.EmbedExternal_View != nil { cp := *t.EmbedExternal_View cp.LexiconTypeID = "app.bsky.embed.external#view" return json.Marshal(&cp) } if t.EmbedGallery_View != nil { cp := *t.EmbedGallery_View cp.LexiconTypeID = "app.bsky.embed.gallery#view" return json.Marshal(&cp) } if t.EmbedImages_View != nil { cp := *t.EmbedImages_View cp.LexiconTypeID = "app.bsky.embed.images#view" return json.Marshal(&cp) } if t.EmbedRecordWithMedia_View != nil { cp := *t.EmbedRecordWithMedia_View cp.LexiconTypeID = "app.bsky.embed.recordWithMedia#view" return json.Marshal(&cp) } if t.EmbedRecord_View != nil { cp := *t.EmbedRecord_View cp.LexiconTypeID = "app.bsky.embed.record#view" return json.Marshal(&cp) } if t.EmbedVideo_View != nil { cp := *t.EmbedVideo_View cp.LexiconTypeID = "app.bsky.embed.video#view" return json.Marshal(&cp) } if t.Raw != nil { if t.Raw.Encoding != "json" { return nil, fmt.Errorf("cannot marshal raw %s record as JSON in union FeedDefs_PostView_Embed", t.Raw.Encoding) } return t.Raw.Bytes, nil } return nil, fmt.Errorf("cannot marshal empty union FeedDefs_PostView_Embed as JSON")}
func (t *FeedDefs_PostView_Embed) UnmarshalJSON(b []byte) error { typ, err := glex.TypeExtract(b) if err != nil { return err }
switch typ { case "app.bsky.embed.external#view": t.EmbedExternal_View = new(EmbedExternal_View) return json.Unmarshal(b, t.EmbedExternal_View) case "app.bsky.embed.gallery#view": t.EmbedGallery_View = new(EmbedGallery_View) return json.Unmarshal(b, t.EmbedGallery_View) case "app.bsky.embed.images#view": t.EmbedImages_View = new(EmbedImages_View) return json.Unmarshal(b, t.EmbedImages_View) case "app.bsky.embed.recordWithMedia#view": t.EmbedRecordWithMedia_View = new(EmbedRecordWithMedia_View) return json.Unmarshal(b, t.EmbedRecordWithMedia_View) case "app.bsky.embed.record#view": t.EmbedRecord_View = new(EmbedRecord_View) return json.Unmarshal(b, t.EmbedRecord_View) case "app.bsky.embed.video#view": t.EmbedVideo_View = new(EmbedVideo_View) return json.Unmarshal(b, t.EmbedVideo_View) default: t.Raw = &glex.RawRecord{Type: typ, Encoding: "json", Bytes: append([]byte(nil), b...)} return nil }}
// MarshalCBOR implements drisl.Marshaler, emitting the set variant (stamped// with its $type) per the atproto union wire format. go-dasl invokes this// when the union appears inside another record, so nested unions serialize// correctly.func (t FeedDefs_PostView_Embed) MarshalCBOR() ([]byte, error) { if t.EmbedExternal_View != nil { cp := *t.EmbedExternal_View cp.LexiconTypeID = "app.bsky.embed.external#view" return glex.MarshalCBORBytes(&cp) } if t.EmbedGallery_View != nil { cp := *t.EmbedGallery_View cp.LexiconTypeID = "app.bsky.embed.gallery#view" return glex.MarshalCBORBytes(&cp) } if t.EmbedImages_View != nil { cp := *t.EmbedImages_View cp.LexiconTypeID = "app.bsky.embed.images#view" return glex.MarshalCBORBytes(&cp) } if t.EmbedRecordWithMedia_View != nil { cp := *t.EmbedRecordWithMedia_View cp.LexiconTypeID = "app.bsky.embed.recordWithMedia#view" return glex.MarshalCBORBytes(&cp) } if t.EmbedRecord_View != nil { cp := *t.EmbedRecord_View cp.LexiconTypeID = "app.bsky.embed.record#view" return glex.MarshalCBORBytes(&cp) } if t.EmbedVideo_View != nil { cp := *t.EmbedVideo_View cp.LexiconTypeID = "app.bsky.embed.video#view" return glex.MarshalCBORBytes(&cp) } if t.Raw != nil { if t.Raw.Encoding != "cbor" { return nil, fmt.Errorf("cannot marshal raw %s record as CBOR in union FeedDefs_PostView_Embed", t.Raw.Encoding) } return t.Raw.Bytes, nil } return nil, fmt.Errorf("cannot marshal empty union FeedDefs_PostView_Embed as CBOR")}
func (t *FeedDefs_PostView_Embed) UnmarshalCBOR(b []byte) error { typ, err := glex.CborTypeExtract(b) if err != nil { return err }
switch typ { case "app.bsky.embed.external#view": t.EmbedExternal_View = new(EmbedExternal_View) return glex.UnmarshalCBORBytes(b, t.EmbedExternal_View) case "app.bsky.embed.gallery#view": t.EmbedGallery_View = new(EmbedGallery_View) return glex.UnmarshalCBORBytes(b, t.EmbedGallery_View) case "app.bsky.embed.images#view": t.EmbedImages_View = new(EmbedImages_View) return glex.UnmarshalCBORBytes(b, t.EmbedImages_View) case "app.bsky.embed.recordWithMedia#view": t.EmbedRecordWithMedia_View = new(EmbedRecordWithMedia_View) return glex.UnmarshalCBORBytes(b, t.EmbedRecordWithMedia_View) case "app.bsky.embed.record#view": t.EmbedRecord_View = new(EmbedRecord_View) return glex.UnmarshalCBORBytes(b, t.EmbedRecord_View) case "app.bsky.embed.video#view": t.EmbedVideo_View = new(EmbedVideo_View) return glex.UnmarshalCBORBytes(b, t.EmbedVideo_View) default: t.Raw = &glex.RawRecord{Type: typ, Encoding: "cbor", Bytes: append([]byte(nil), b...)} return nil }}
// FeedDefs_ReasonPin is a "reasonPin" in the app.bsky.feed.defs schema.type FeedDefs_ReasonPin struct { LexiconTypeID string `json:"$type,omitempty"`}
// RecordTypeID implements glex.Record.func (t *FeedDefs_ReasonPin) RecordTypeID() string { return "app.bsky.feed.defs#reasonPin" }
func (t *FeedDefs_ReasonPin) 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.feed.defs#reasonPin" return glex.MarshalCBOR(w, &cp)}
func (t *FeedDefs_ReasonPin) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
// FeedDefs_ReasonRepost is a "reasonRepost" in the app.bsky.feed.defs schema.type FeedDefs_ReasonRepost struct { LexiconTypeID string `json:"$type,omitempty"` By ActorDefs_ProfileViewBasic `json:"by"` Cid *string `json:"cid,omitempty"` IndexedAt string `json:"indexedAt"` Uri *string `json:"uri,omitempty"`}
// RecordTypeID implements glex.Record.func (t *FeedDefs_ReasonRepost) RecordTypeID() string { return "app.bsky.feed.defs#reasonRepost" }
func (t *FeedDefs_ReasonRepost) 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.feed.defs#reasonRepost" return glex.MarshalCBOR(w, &cp)}
func (t *FeedDefs_ReasonRepost) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
// FeedDefs_ReplyRef is a "replyRef" in the app.bsky.feed.defs schema.type FeedDefs_ReplyRef struct { LexiconTypeID string `json:"$type,omitempty"` // grandparentAuthor: When parent is a reply to another post, this is the author of that post. GrandparentAuthor *ActorDefs_ProfileViewBasic `json:"grandparentAuthor,omitempty"` Parent FeedDefs_ReplyRef_Parent `json:"parent"` Root FeedDefs_ReplyRef_Root `json:"root"`}
// RecordTypeID implements glex.Record.func (t *FeedDefs_ReplyRef) RecordTypeID() string { return "app.bsky.feed.defs#replyRef" }
func (t *FeedDefs_ReplyRef) 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.feed.defs#replyRef" return glex.MarshalCBOR(w, &cp)}
func (t *FeedDefs_ReplyRef) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
type FeedDefs_ReplyRef_Parent struct { FeedDefs_BlockedPost *FeedDefs_BlockedPost FeedDefs_NotFoundPost *FeedDefs_NotFoundPost FeedDefs_PostView *FeedDefs_PostView // Raw preserves a variant whose $type is not in this union's generated // set, so unrecognized variants still round-trip losslessly through // decode/re-encode. Nil when a known variant is set. Raw *glex.RawRecord}
// MarshalJSON emits the set variant, stamped with its $type, per the atproto// union wire format. The value receiver stamps a copy, so the variant is// never mutated and both FeedDefs_ReplyRef_Parent and *FeedDefs_ReplyRef_Parent marshal correctly.func (t FeedDefs_ReplyRef_Parent) MarshalJSON() ([]byte, error) { if t.FeedDefs_BlockedPost != nil { cp := *t.FeedDefs_BlockedPost cp.LexiconTypeID = "app.bsky.feed.defs#blockedPost" return json.Marshal(&cp) } if t.FeedDefs_NotFoundPost != nil { cp := *t.FeedDefs_NotFoundPost cp.LexiconTypeID = "app.bsky.feed.defs#notFoundPost" return json.Marshal(&cp) } if t.FeedDefs_PostView != nil { cp := *t.FeedDefs_PostView cp.LexiconTypeID = "app.bsky.feed.defs#postView" return json.Marshal(&cp) } if t.Raw != nil { if t.Raw.Encoding != "json" { return nil, fmt.Errorf("cannot marshal raw %s record as JSON in union FeedDefs_ReplyRef_Parent", t.Raw.Encoding) } return t.Raw.Bytes, nil } return nil, fmt.Errorf("cannot marshal empty union FeedDefs_ReplyRef_Parent as JSON")}
func (t *FeedDefs_ReplyRef_Parent) UnmarshalJSON(b []byte) error { typ, err := glex.TypeExtract(b) if err != nil { return err }
switch typ { case "app.bsky.feed.defs#blockedPost": t.FeedDefs_BlockedPost = new(FeedDefs_BlockedPost) return json.Unmarshal(b, t.FeedDefs_BlockedPost) case "app.bsky.feed.defs#notFoundPost": t.FeedDefs_NotFoundPost = new(FeedDefs_NotFoundPost) return json.Unmarshal(b, t.FeedDefs_NotFoundPost) case "app.bsky.feed.defs#postView": t.FeedDefs_PostView = new(FeedDefs_PostView) return json.Unmarshal(b, t.FeedDefs_PostView) default: t.Raw = &glex.RawRecord{Type: typ, Encoding: "json", Bytes: append([]byte(nil), b...)} return nil }}
// MarshalCBOR implements drisl.Marshaler, emitting the set variant (stamped// with its $type) per the atproto union wire format. go-dasl invokes this// when the union appears inside another record, so nested unions serialize// correctly.func (t FeedDefs_ReplyRef_Parent) MarshalCBOR() ([]byte, error) { if t.FeedDefs_BlockedPost != nil { cp := *t.FeedDefs_BlockedPost cp.LexiconTypeID = "app.bsky.feed.defs#blockedPost" return glex.MarshalCBORBytes(&cp) } if t.FeedDefs_NotFoundPost != nil { cp := *t.FeedDefs_NotFoundPost cp.LexiconTypeID = "app.bsky.feed.defs#notFoundPost" return glex.MarshalCBORBytes(&cp) } if t.FeedDefs_PostView != nil { cp := *t.FeedDefs_PostView cp.LexiconTypeID = "app.bsky.feed.defs#postView" return glex.MarshalCBORBytes(&cp) } if t.Raw != nil { if t.Raw.Encoding != "cbor" { return nil, fmt.Errorf("cannot marshal raw %s record as CBOR in union FeedDefs_ReplyRef_Parent", t.Raw.Encoding) } return t.Raw.Bytes, nil } return nil, fmt.Errorf("cannot marshal empty union FeedDefs_ReplyRef_Parent as CBOR")}
func (t *FeedDefs_ReplyRef_Parent) UnmarshalCBOR(b []byte) error { typ, err := glex.CborTypeExtract(b) if err != nil { return err }
switch typ { case "app.bsky.feed.defs#blockedPost": t.FeedDefs_BlockedPost = new(FeedDefs_BlockedPost) return glex.UnmarshalCBORBytes(b, t.FeedDefs_BlockedPost) case "app.bsky.feed.defs#notFoundPost": t.FeedDefs_NotFoundPost = new(FeedDefs_NotFoundPost) return glex.UnmarshalCBORBytes(b, t.FeedDefs_NotFoundPost) case "app.bsky.feed.defs#postView": t.FeedDefs_PostView = new(FeedDefs_PostView) return glex.UnmarshalCBORBytes(b, t.FeedDefs_PostView) default: t.Raw = &glex.RawRecord{Type: typ, Encoding: "cbor", Bytes: append([]byte(nil), b...)} return nil }}
type FeedDefs_ReplyRef_Root struct { FeedDefs_BlockedPost *FeedDefs_BlockedPost FeedDefs_NotFoundPost *FeedDefs_NotFoundPost FeedDefs_PostView *FeedDefs_PostView // Raw preserves a variant whose $type is not in this union's generated // set, so unrecognized variants still round-trip losslessly through // decode/re-encode. Nil when a known variant is set. Raw *glex.RawRecord}
// MarshalJSON emits the set variant, stamped with its $type, per the atproto// union wire format. The value receiver stamps a copy, so the variant is// never mutated and both FeedDefs_ReplyRef_Root and *FeedDefs_ReplyRef_Root marshal correctly.func (t FeedDefs_ReplyRef_Root) MarshalJSON() ([]byte, error) { if t.FeedDefs_BlockedPost != nil { cp := *t.FeedDefs_BlockedPost cp.LexiconTypeID = "app.bsky.feed.defs#blockedPost" return json.Marshal(&cp) } if t.FeedDefs_NotFoundPost != nil { cp := *t.FeedDefs_NotFoundPost cp.LexiconTypeID = "app.bsky.feed.defs#notFoundPost" return json.Marshal(&cp) } if t.FeedDefs_PostView != nil { cp := *t.FeedDefs_PostView cp.LexiconTypeID = "app.bsky.feed.defs#postView" return json.Marshal(&cp) } if t.Raw != nil { if t.Raw.Encoding != "json" { return nil, fmt.Errorf("cannot marshal raw %s record as JSON in union FeedDefs_ReplyRef_Root", t.Raw.Encoding) } return t.Raw.Bytes, nil } return nil, fmt.Errorf("cannot marshal empty union FeedDefs_ReplyRef_Root as JSON")}
func (t *FeedDefs_ReplyRef_Root) UnmarshalJSON(b []byte) error { typ, err := glex.TypeExtract(b) if err != nil { return err }
switch typ { case "app.bsky.feed.defs#blockedPost": t.FeedDefs_BlockedPost = new(FeedDefs_BlockedPost) return json.Unmarshal(b, t.FeedDefs_BlockedPost) case "app.bsky.feed.defs#notFoundPost": t.FeedDefs_NotFoundPost = new(FeedDefs_NotFoundPost) return json.Unmarshal(b, t.FeedDefs_NotFoundPost) case "app.bsky.feed.defs#postView": t.FeedDefs_PostView = new(FeedDefs_PostView) return json.Unmarshal(b, t.FeedDefs_PostView) default: t.Raw = &glex.RawRecord{Type: typ, Encoding: "json", Bytes: append([]byte(nil), b...)} return nil }}
// MarshalCBOR implements drisl.Marshaler, emitting the set variant (stamped// with its $type) per the atproto union wire format. go-dasl invokes this// when the union appears inside another record, so nested unions serialize// correctly.func (t FeedDefs_ReplyRef_Root) MarshalCBOR() ([]byte, error) { if t.FeedDefs_BlockedPost != nil { cp := *t.FeedDefs_BlockedPost cp.LexiconTypeID = "app.bsky.feed.defs#blockedPost" return glex.MarshalCBORBytes(&cp) } if t.FeedDefs_NotFoundPost != nil { cp := *t.FeedDefs_NotFoundPost cp.LexiconTypeID = "app.bsky.feed.defs#notFoundPost" return glex.MarshalCBORBytes(&cp) } if t.FeedDefs_PostView != nil { cp := *t.FeedDefs_PostView cp.LexiconTypeID = "app.bsky.feed.defs#postView" return glex.MarshalCBORBytes(&cp) } if t.Raw != nil { if t.Raw.Encoding != "cbor" { return nil, fmt.Errorf("cannot marshal raw %s record as CBOR in union FeedDefs_ReplyRef_Root", t.Raw.Encoding) } return t.Raw.Bytes, nil } return nil, fmt.Errorf("cannot marshal empty union FeedDefs_ReplyRef_Root as CBOR")}
func (t *FeedDefs_ReplyRef_Root) UnmarshalCBOR(b []byte) error { typ, err := glex.CborTypeExtract(b) if err != nil { return err }
switch typ { case "app.bsky.feed.defs#blockedPost": t.FeedDefs_BlockedPost = new(FeedDefs_BlockedPost) return glex.UnmarshalCBORBytes(b, t.FeedDefs_BlockedPost) case "app.bsky.feed.defs#notFoundPost": t.FeedDefs_NotFoundPost = new(FeedDefs_NotFoundPost) return glex.UnmarshalCBORBytes(b, t.FeedDefs_NotFoundPost) case "app.bsky.feed.defs#postView": t.FeedDefs_PostView = new(FeedDefs_PostView) return glex.UnmarshalCBORBytes(b, t.FeedDefs_PostView) default: t.Raw = &glex.RawRecord{Type: typ, Encoding: "cbor", Bytes: append([]byte(nil), b...)} return nil }}
// FeedDefs_SkeletonFeedPost is a "skeletonFeedPost" in the app.bsky.feed.defs schema.type FeedDefs_SkeletonFeedPost struct { LexiconTypeID string `json:"$type,omitempty"` // feedContext: Context that will be passed through to client and may be passed to feed generator back alongside interactions. FeedContext *string `json:"feedContext,omitempty"` Post string `json:"post"` Reason *FeedDefs_SkeletonFeedPost_Reason `json:"reason,omitempty"`}
// RecordTypeID implements glex.Record.func (t *FeedDefs_SkeletonFeedPost) RecordTypeID() string { return "app.bsky.feed.defs#skeletonFeedPost"}
func (t *FeedDefs_SkeletonFeedPost) 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.feed.defs#skeletonFeedPost" return glex.MarshalCBOR(w, &cp)}
func (t *FeedDefs_SkeletonFeedPost) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
type FeedDefs_SkeletonFeedPost_Reason struct { FeedDefs_SkeletonReasonPin *FeedDefs_SkeletonReasonPin FeedDefs_SkeletonReasonRepost *FeedDefs_SkeletonReasonRepost // Raw preserves a variant whose $type is not in this union's generated // set, so unrecognized variants still round-trip losslessly through // decode/re-encode. Nil when a known variant is set. Raw *glex.RawRecord}
// MarshalJSON emits the set variant, stamped with its $type, per the atproto// union wire format. The value receiver stamps a copy, so the variant is// never mutated and both FeedDefs_SkeletonFeedPost_Reason and *FeedDefs_SkeletonFeedPost_Reason marshal correctly.func (t FeedDefs_SkeletonFeedPost_Reason) MarshalJSON() ([]byte, error) { if t.FeedDefs_SkeletonReasonPin != nil { cp := *t.FeedDefs_SkeletonReasonPin cp.LexiconTypeID = "app.bsky.feed.defs#skeletonReasonPin" return json.Marshal(&cp) } if t.FeedDefs_SkeletonReasonRepost != nil { cp := *t.FeedDefs_SkeletonReasonRepost cp.LexiconTypeID = "app.bsky.feed.defs#skeletonReasonRepost" return json.Marshal(&cp) } if t.Raw != nil { if t.Raw.Encoding != "json" { return nil, fmt.Errorf("cannot marshal raw %s record as JSON in union FeedDefs_SkeletonFeedPost_Reason", t.Raw.Encoding) } return t.Raw.Bytes, nil } return nil, fmt.Errorf("cannot marshal empty union FeedDefs_SkeletonFeedPost_Reason as JSON")}
func (t *FeedDefs_SkeletonFeedPost_Reason) UnmarshalJSON(b []byte) error { typ, err := glex.TypeExtract(b) if err != nil { return err }
switch typ { case "app.bsky.feed.defs#skeletonReasonPin": t.FeedDefs_SkeletonReasonPin = new(FeedDefs_SkeletonReasonPin) return json.Unmarshal(b, t.FeedDefs_SkeletonReasonPin) case "app.bsky.feed.defs#skeletonReasonRepost": t.FeedDefs_SkeletonReasonRepost = new(FeedDefs_SkeletonReasonRepost) return json.Unmarshal(b, t.FeedDefs_SkeletonReasonRepost) default: t.Raw = &glex.RawRecord{Type: typ, Encoding: "json", Bytes: append([]byte(nil), b...)} return nil }}
// MarshalCBOR implements drisl.Marshaler, emitting the set variant (stamped// with its $type) per the atproto union wire format. go-dasl invokes this// when the union appears inside another record, so nested unions serialize// correctly.func (t FeedDefs_SkeletonFeedPost_Reason) MarshalCBOR() ([]byte, error) { if t.FeedDefs_SkeletonReasonPin != nil { cp := *t.FeedDefs_SkeletonReasonPin cp.LexiconTypeID = "app.bsky.feed.defs#skeletonReasonPin" return glex.MarshalCBORBytes(&cp) } if t.FeedDefs_SkeletonReasonRepost != nil { cp := *t.FeedDefs_SkeletonReasonRepost cp.LexiconTypeID = "app.bsky.feed.defs#skeletonReasonRepost" return glex.MarshalCBORBytes(&cp) } if t.Raw != nil { if t.Raw.Encoding != "cbor" { return nil, fmt.Errorf("cannot marshal raw %s record as CBOR in union FeedDefs_SkeletonFeedPost_Reason", t.Raw.Encoding) } return t.Raw.Bytes, nil } return nil, fmt.Errorf("cannot marshal empty union FeedDefs_SkeletonFeedPost_Reason as CBOR")}
func (t *FeedDefs_SkeletonFeedPost_Reason) UnmarshalCBOR(b []byte) error { typ, err := glex.CborTypeExtract(b) if err != nil { return err }
switch typ { case "app.bsky.feed.defs#skeletonReasonPin": t.FeedDefs_SkeletonReasonPin = new(FeedDefs_SkeletonReasonPin) return glex.UnmarshalCBORBytes(b, t.FeedDefs_SkeletonReasonPin) case "app.bsky.feed.defs#skeletonReasonRepost": t.FeedDefs_SkeletonReasonRepost = new(FeedDefs_SkeletonReasonRepost) return glex.UnmarshalCBORBytes(b, t.FeedDefs_SkeletonReasonRepost) default: t.Raw = &glex.RawRecord{Type: typ, Encoding: "cbor", Bytes: append([]byte(nil), b...)} return nil }}
// FeedDefs_SkeletonReasonPin is a "skeletonReasonPin" in the app.bsky.feed.defs schema.type FeedDefs_SkeletonReasonPin struct { LexiconTypeID string `json:"$type,omitempty"`}
// RecordTypeID implements glex.Record.func (t *FeedDefs_SkeletonReasonPin) RecordTypeID() string { return "app.bsky.feed.defs#skeletonReasonPin"}
func (t *FeedDefs_SkeletonReasonPin) 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.feed.defs#skeletonReasonPin" return glex.MarshalCBOR(w, &cp)}
func (t *FeedDefs_SkeletonReasonPin) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
// FeedDefs_SkeletonReasonRepost is a "skeletonReasonRepost" in the app.bsky.feed.defs schema.type FeedDefs_SkeletonReasonRepost struct { LexiconTypeID string `json:"$type,omitempty"` Repost string `json:"repost"`}
// RecordTypeID implements glex.Record.func (t *FeedDefs_SkeletonReasonRepost) RecordTypeID() string { return "app.bsky.feed.defs#skeletonReasonRepost"}
func (t *FeedDefs_SkeletonReasonRepost) 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.feed.defs#skeletonReasonRepost" return glex.MarshalCBOR(w, &cp)}
func (t *FeedDefs_SkeletonReasonRepost) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
// FeedDefs_ThreadContext is a "threadContext" in the app.bsky.feed.defs schema.//// Metadata about this post within the context of the thread it is in.type FeedDefs_ThreadContext struct { LexiconTypeID string `json:"$type,omitempty"` RootAuthorLike *string `json:"rootAuthorLike,omitempty"`}
// RecordTypeID implements glex.Record.func (t *FeedDefs_ThreadContext) RecordTypeID() string { return "app.bsky.feed.defs#threadContext" }
func (t *FeedDefs_ThreadContext) 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.feed.defs#threadContext" return glex.MarshalCBOR(w, &cp)}
func (t *FeedDefs_ThreadContext) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
// FeedDefs_ThreadViewPost is a "threadViewPost" in the app.bsky.feed.defs schema.type FeedDefs_ThreadViewPost struct { LexiconTypeID string `json:"$type,omitempty"` Parent *FeedDefs_ThreadViewPost_Parent `json:"parent,omitempty"` Post FeedDefs_PostView `json:"post"` Replies []FeedDefs_ThreadViewPost_Replies_Elem `json:"replies,omitempty"` ThreadContext *FeedDefs_ThreadContext `json:"threadContext,omitempty"`}
// RecordTypeID implements glex.Record.func (t *FeedDefs_ThreadViewPost) RecordTypeID() string { return "app.bsky.feed.defs#threadViewPost" }
func (t *FeedDefs_ThreadViewPost) 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.feed.defs#threadViewPost" return glex.MarshalCBOR(w, &cp)}
func (t *FeedDefs_ThreadViewPost) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
type FeedDefs_ThreadViewPost_Parent struct { FeedDefs_BlockedPost *FeedDefs_BlockedPost FeedDefs_NotFoundPost *FeedDefs_NotFoundPost FeedDefs_ThreadViewPost *FeedDefs_ThreadViewPost // Raw preserves a variant whose $type is not in this union's generated // set, so unrecognized variants still round-trip losslessly through // decode/re-encode. Nil when a known variant is set. Raw *glex.RawRecord}
// MarshalJSON emits the set variant, stamped with its $type, per the atproto// union wire format. The value receiver stamps a copy, so the variant is// never mutated and both FeedDefs_ThreadViewPost_Parent and *FeedDefs_ThreadViewPost_Parent marshal correctly.func (t FeedDefs_ThreadViewPost_Parent) MarshalJSON() ([]byte, error) { if t.FeedDefs_BlockedPost != nil { cp := *t.FeedDefs_BlockedPost cp.LexiconTypeID = "app.bsky.feed.defs#blockedPost" return json.Marshal(&cp) } if t.FeedDefs_NotFoundPost != nil { cp := *t.FeedDefs_NotFoundPost cp.LexiconTypeID = "app.bsky.feed.defs#notFoundPost" return json.Marshal(&cp) } if t.FeedDefs_ThreadViewPost != nil { cp := *t.FeedDefs_ThreadViewPost cp.LexiconTypeID = "app.bsky.feed.defs#threadViewPost" return json.Marshal(&cp) } if t.Raw != nil { if t.Raw.Encoding != "json" { return nil, fmt.Errorf("cannot marshal raw %s record as JSON in union FeedDefs_ThreadViewPost_Parent", t.Raw.Encoding) } return t.Raw.Bytes, nil } return nil, fmt.Errorf("cannot marshal empty union FeedDefs_ThreadViewPost_Parent as JSON")}
func (t *FeedDefs_ThreadViewPost_Parent) UnmarshalJSON(b []byte) error { typ, err := glex.TypeExtract(b) if err != nil { return err }
switch typ { case "app.bsky.feed.defs#blockedPost": t.FeedDefs_BlockedPost = new(FeedDefs_BlockedPost) return json.Unmarshal(b, t.FeedDefs_BlockedPost) case "app.bsky.feed.defs#notFoundPost": t.FeedDefs_NotFoundPost = new(FeedDefs_NotFoundPost) return json.Unmarshal(b, t.FeedDefs_NotFoundPost) case "app.bsky.feed.defs#threadViewPost": t.FeedDefs_ThreadViewPost = new(FeedDefs_ThreadViewPost) return json.Unmarshal(b, t.FeedDefs_ThreadViewPost) default: t.Raw = &glex.RawRecord{Type: typ, Encoding: "json", Bytes: append([]byte(nil), b...)} return nil }}
// MarshalCBOR implements drisl.Marshaler, emitting the set variant (stamped// with its $type) per the atproto union wire format. go-dasl invokes this// when the union appears inside another record, so nested unions serialize// correctly.func (t FeedDefs_ThreadViewPost_Parent) MarshalCBOR() ([]byte, error) { if t.FeedDefs_BlockedPost != nil { cp := *t.FeedDefs_BlockedPost cp.LexiconTypeID = "app.bsky.feed.defs#blockedPost" return glex.MarshalCBORBytes(&cp) } if t.FeedDefs_NotFoundPost != nil { cp := *t.FeedDefs_NotFoundPost cp.LexiconTypeID = "app.bsky.feed.defs#notFoundPost" return glex.MarshalCBORBytes(&cp) } if t.FeedDefs_ThreadViewPost != nil { cp := *t.FeedDefs_ThreadViewPost cp.LexiconTypeID = "app.bsky.feed.defs#threadViewPost" return glex.MarshalCBORBytes(&cp) } if t.Raw != nil { if t.Raw.Encoding != "cbor" { return nil, fmt.Errorf("cannot marshal raw %s record as CBOR in union FeedDefs_ThreadViewPost_Parent", t.Raw.Encoding) } return t.Raw.Bytes, nil } return nil, fmt.Errorf("cannot marshal empty union FeedDefs_ThreadViewPost_Parent as CBOR")}
func (t *FeedDefs_ThreadViewPost_Parent) UnmarshalCBOR(b []byte) error { typ, err := glex.CborTypeExtract(b) if err != nil { return err }
switch typ { case "app.bsky.feed.defs#blockedPost": t.FeedDefs_BlockedPost = new(FeedDefs_BlockedPost) return glex.UnmarshalCBORBytes(b, t.FeedDefs_BlockedPost) case "app.bsky.feed.defs#notFoundPost": t.FeedDefs_NotFoundPost = new(FeedDefs_NotFoundPost) return glex.UnmarshalCBORBytes(b, t.FeedDefs_NotFoundPost) case "app.bsky.feed.defs#threadViewPost": t.FeedDefs_ThreadViewPost = new(FeedDefs_ThreadViewPost) return glex.UnmarshalCBORBytes(b, t.FeedDefs_ThreadViewPost) default: t.Raw = &glex.RawRecord{Type: typ, Encoding: "cbor", Bytes: append([]byte(nil), b...)} return nil }}
type FeedDefs_ThreadViewPost_Replies_Elem struct { FeedDefs_BlockedPost *FeedDefs_BlockedPost FeedDefs_NotFoundPost *FeedDefs_NotFoundPost FeedDefs_ThreadViewPost *FeedDefs_ThreadViewPost // Raw preserves a variant whose $type is not in this union's generated // set, so unrecognized variants still round-trip losslessly through // decode/re-encode. Nil when a known variant is set. Raw *glex.RawRecord}
// MarshalJSON emits the set variant, stamped with its $type, per the atproto// union wire format. The value receiver stamps a copy, so the variant is// never mutated and both FeedDefs_ThreadViewPost_Replies_Elem and *FeedDefs_ThreadViewPost_Replies_Elem marshal correctly.func (t FeedDefs_ThreadViewPost_Replies_Elem) MarshalJSON() ([]byte, error) { if t.FeedDefs_BlockedPost != nil { cp := *t.FeedDefs_BlockedPost cp.LexiconTypeID = "app.bsky.feed.defs#blockedPost" return json.Marshal(&cp) } if t.FeedDefs_NotFoundPost != nil { cp := *t.FeedDefs_NotFoundPost cp.LexiconTypeID = "app.bsky.feed.defs#notFoundPost" return json.Marshal(&cp) } if t.FeedDefs_ThreadViewPost != nil { cp := *t.FeedDefs_ThreadViewPost cp.LexiconTypeID = "app.bsky.feed.defs#threadViewPost" return json.Marshal(&cp) } if t.Raw != nil { if t.Raw.Encoding != "json" { return nil, fmt.Errorf("cannot marshal raw %s record as JSON in union FeedDefs_ThreadViewPost_Replies_Elem", t.Raw.Encoding) } return t.Raw.Bytes, nil } return nil, fmt.Errorf("cannot marshal empty union FeedDefs_ThreadViewPost_Replies_Elem as JSON")}
func (t *FeedDefs_ThreadViewPost_Replies_Elem) UnmarshalJSON(b []byte) error { typ, err := glex.TypeExtract(b) if err != nil { return err }
switch typ { case "app.bsky.feed.defs#blockedPost": t.FeedDefs_BlockedPost = new(FeedDefs_BlockedPost) return json.Unmarshal(b, t.FeedDefs_BlockedPost) case "app.bsky.feed.defs#notFoundPost": t.FeedDefs_NotFoundPost = new(FeedDefs_NotFoundPost) return json.Unmarshal(b, t.FeedDefs_NotFoundPost) case "app.bsky.feed.defs#threadViewPost": t.FeedDefs_ThreadViewPost = new(FeedDefs_ThreadViewPost) return json.Unmarshal(b, t.FeedDefs_ThreadViewPost) default: t.Raw = &glex.RawRecord{Type: typ, Encoding: "json", Bytes: append([]byte(nil), b...)} return nil }}
// MarshalCBOR implements drisl.Marshaler, emitting the set variant (stamped// with its $type) per the atproto union wire format. go-dasl invokes this// when the union appears inside another record, so nested unions serialize// correctly.func (t FeedDefs_ThreadViewPost_Replies_Elem) MarshalCBOR() ([]byte, error) { if t.FeedDefs_BlockedPost != nil { cp := *t.FeedDefs_BlockedPost cp.LexiconTypeID = "app.bsky.feed.defs#blockedPost" return glex.MarshalCBORBytes(&cp) } if t.FeedDefs_NotFoundPost != nil { cp := *t.FeedDefs_NotFoundPost cp.LexiconTypeID = "app.bsky.feed.defs#notFoundPost" return glex.MarshalCBORBytes(&cp) } if t.FeedDefs_ThreadViewPost != nil { cp := *t.FeedDefs_ThreadViewPost cp.LexiconTypeID = "app.bsky.feed.defs#threadViewPost" return glex.MarshalCBORBytes(&cp) } if t.Raw != nil { if t.Raw.Encoding != "cbor" { return nil, fmt.Errorf("cannot marshal raw %s record as CBOR in union FeedDefs_ThreadViewPost_Replies_Elem", t.Raw.Encoding) } return t.Raw.Bytes, nil } return nil, fmt.Errorf("cannot marshal empty union FeedDefs_ThreadViewPost_Replies_Elem as CBOR")}
func (t *FeedDefs_ThreadViewPost_Replies_Elem) UnmarshalCBOR(b []byte) error { typ, err := glex.CborTypeExtract(b) if err != nil { return err }
switch typ { case "app.bsky.feed.defs#blockedPost": t.FeedDefs_BlockedPost = new(FeedDefs_BlockedPost) return glex.UnmarshalCBORBytes(b, t.FeedDefs_BlockedPost) case "app.bsky.feed.defs#notFoundPost": t.FeedDefs_NotFoundPost = new(FeedDefs_NotFoundPost) return glex.UnmarshalCBORBytes(b, t.FeedDefs_NotFoundPost) case "app.bsky.feed.defs#threadViewPost": t.FeedDefs_ThreadViewPost = new(FeedDefs_ThreadViewPost) return glex.UnmarshalCBORBytes(b, t.FeedDefs_ThreadViewPost) default: t.Raw = &glex.RawRecord{Type: typ, Encoding: "cbor", Bytes: append([]byte(nil), b...)} return nil }}
// FeedDefs_ThreadgateView is a "threadgateView" in the app.bsky.feed.defs schema.type FeedDefs_ThreadgateView struct { LexiconTypeID string `json:"$type,omitempty"` Cid *string `json:"cid,omitempty"` Lists []GraphDefs_ListViewBasic `json:"lists,omitempty"` Record *glex.LexiconTypeDecoder `json:"record,omitempty"` Uri *string `json:"uri,omitempty"`}
// RecordTypeID implements glex.Record.func (t *FeedDefs_ThreadgateView) RecordTypeID() string { return "app.bsky.feed.defs#threadgateView" }
func (t *FeedDefs_ThreadgateView) 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.feed.defs#threadgateView" return glex.MarshalCBOR(w, &cp)}
func (t *FeedDefs_ThreadgateView) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
// FeedDefs_ViewerState is a "viewerState" in the app.bsky.feed.defs schema.//// Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests.type FeedDefs_ViewerState struct { LexiconTypeID string `json:"$type,omitempty"` Bookmarked *bool `json:"bookmarked,omitempty"` EmbeddingDisabled *bool `json:"embeddingDisabled,omitempty"` Like *string `json:"like,omitempty"` Pinned *bool `json:"pinned,omitempty"` ReplyDisabled *bool `json:"replyDisabled,omitempty"` Repost *string `json:"repost,omitempty"` ThreadMuted *bool `json:"threadMuted,omitempty"`}
// RecordTypeID implements glex.Record.func (t *FeedDefs_ViewerState) RecordTypeID() string { return "app.bsky.feed.defs#viewerState" }
func (t *FeedDefs_ViewerState) 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.feed.defs#viewerState" return glex.MarshalCBOR(w, &cp)}
func (t *FeedDefs_ViewerState) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}