···379379380380// ActorDefs_ProfileAssociated is a "profileAssociated" in the app.bsky.actor.defs schema.
381381type ActorDefs_ProfileAssociated struct {
382382- Chat *ActorDefs_ProfileAssociatedChat `json:"chat,omitempty" cborgen:"chat,omitempty"`
383383- Feedgens *int64 `json:"feedgens,omitempty" cborgen:"feedgens,omitempty"`
384384- Labeler *bool `json:"labeler,omitempty" cborgen:"labeler,omitempty"`
385385- Lists *int64 `json:"lists,omitempty" cborgen:"lists,omitempty"`
386386- StarterPacks *int64 `json:"starterPacks,omitempty" cborgen:"starterPacks,omitempty"`
382382+ ActivitySubscription *ActorDefs_ProfileAssociatedActivitySubscription `json:"activitySubscription,omitempty" cborgen:"activitySubscription,omitempty"`
383383+ Chat *ActorDefs_ProfileAssociatedChat `json:"chat,omitempty" cborgen:"chat,omitempty"`
384384+ Feedgens *int64 `json:"feedgens,omitempty" cborgen:"feedgens,omitempty"`
385385+ Labeler *bool `json:"labeler,omitempty" cborgen:"labeler,omitempty"`
386386+ Lists *int64 `json:"lists,omitempty" cborgen:"lists,omitempty"`
387387+ StarterPacks *int64 `json:"starterPacks,omitempty" cborgen:"starterPacks,omitempty"`
388388+}
389389+390390+// ActorDefs_ProfileAssociatedActivitySubscription is a "profileAssociatedActivitySubscription" in the app.bsky.actor.defs schema.
391391+type ActorDefs_ProfileAssociatedActivitySubscription struct {
392392+ AllowSubscriptions string `json:"allowSubscriptions" cborgen:"allowSubscriptions"`
387393}
388394389395// ActorDefs_ProfileAssociatedChat is a "profileAssociatedChat" in the app.bsky.actor.defs schema.
···562568//
563569// Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests.
564570type ActorDefs_ViewerState struct {
565565- BlockedBy *bool `json:"blockedBy,omitempty" cborgen:"blockedBy,omitempty"`
566566- Blocking *string `json:"blocking,omitempty" cborgen:"blocking,omitempty"`
567567- BlockingByList *GraphDefs_ListViewBasic `json:"blockingByList,omitempty" cborgen:"blockingByList,omitempty"`
568568- FollowedBy *string `json:"followedBy,omitempty" cborgen:"followedBy,omitempty"`
569569- Following *string `json:"following,omitempty" cborgen:"following,omitempty"`
571571+ // activitySubscription: This property is present only in selected cases, as an optimization.
572572+ ActivitySubscription *NotificationDefs_ActivitySubscription `json:"activitySubscription,omitempty" cborgen:"activitySubscription,omitempty"`
573573+ BlockedBy *bool `json:"blockedBy,omitempty" cborgen:"blockedBy,omitempty"`
574574+ Blocking *string `json:"blocking,omitempty" cborgen:"blocking,omitempty"`
575575+ BlockingByList *GraphDefs_ListViewBasic `json:"blockingByList,omitempty" cborgen:"blockingByList,omitempty"`
576576+ FollowedBy *string `json:"followedBy,omitempty" cborgen:"followedBy,omitempty"`
577577+ Following *string `json:"following,omitempty" cborgen:"following,omitempty"`
578578+ // knownFollowers: This property is present only in selected cases, as an optimization.
570579 KnownFollowers *ActorDefs_KnownFollowers `json:"knownFollowers,omitempty" cborgen:"knownFollowers,omitempty"`
571580 Muted *bool `json:"muted,omitempty" cborgen:"muted,omitempty"`
572581 MutedByList *GraphDefs_ListViewBasic `json:"mutedByList,omitempty" cborgen:"mutedByList,omitempty"`
+222-4
api/bsky/cbor_gen.go
···645645 }
646646647647 cw := cbg.NewCborWriter(w)
648648+ fieldCount := 4
648649649649- if _, err := cw.Write([]byte{163}); err != nil {
650650+ if t.Via == nil {
651651+ fieldCount--
652652+ }
653653+654654+ if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
650655 return err
656656+ }
657657+658658+ // t.Via (atproto.RepoStrongRef) (struct)
659659+ if t.Via != nil {
660660+661661+ if len("via") > 1000000 {
662662+ return xerrors.Errorf("Value in field \"via\" was too long")
663663+ }
664664+665665+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("via"))); err != nil {
666666+ return err
667667+ }
668668+ if _, err := cw.WriteString(string("via")); err != nil {
669669+ return err
670670+ }
671671+672672+ if err := t.Via.MarshalCBOR(cw); err != nil {
673673+ return err
674674+ }
651675 }
652676653677 // t.LexiconTypeID (string) (string)
···751775 }
752776753777 switch string(nameBuf[:nameLen]) {
754754- // t.LexiconTypeID (string) (string)
778778+ // t.Via (atproto.RepoStrongRef) (struct)
779779+ case "via":
780780+781781+ {
782782+783783+ b, err := cr.ReadByte()
784784+ if err != nil {
785785+ return err
786786+ }
787787+ if b != cbg.CborNull[0] {
788788+ if err := cr.UnreadByte(); err != nil {
789789+ return err
790790+ }
791791+ t.Via = new(atproto.RepoStrongRef)
792792+ if err := t.Via.UnmarshalCBOR(cr); err != nil {
793793+ return xerrors.Errorf("unmarshaling t.Via pointer: %w", err)
794794+ }
795795+ }
796796+797797+ }
798798+ // t.LexiconTypeID (string) (string)
755799 case "$type":
756800757801 {
···27562800 }
2757280127582802 cw := cbg.NewCborWriter(w)
28032803+ fieldCount := 4
2759280427602760- if _, err := cw.Write([]byte{163}); err != nil {
28052805+ if t.Via == nil {
28062806+ fieldCount--
28072807+ }
28082808+28092809+ if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
27612810 return err
28112811+ }
28122812+28132813+ // t.Via (atproto.RepoStrongRef) (struct)
28142814+ if t.Via != nil {
28152815+28162816+ if len("via") > 1000000 {
28172817+ return xerrors.Errorf("Value in field \"via\" was too long")
28182818+ }
28192819+28202820+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("via"))); err != nil {
28212821+ return err
28222822+ }
28232823+ if _, err := cw.WriteString(string("via")); err != nil {
28242824+ return err
28252825+ }
28262826+28272827+ if err := t.Via.MarshalCBOR(cw); err != nil {
28282828+ return err
28292829+ }
27622830 }
2763283127642832 // t.LexiconTypeID (string) (string)
···28622930 }
2863293128642932 switch string(nameBuf[:nameLen]) {
28652865- // t.LexiconTypeID (string) (string)
29332933+ // t.Via (atproto.RepoStrongRef) (struct)
29342934+ case "via":
29352935+29362936+ {
29372937+29382938+ b, err := cr.ReadByte()
29392939+ if err != nil {
29402940+ return err
29412941+ }
29422942+ if b != cbg.CborNull[0] {
29432943+ if err := cr.UnreadByte(); err != nil {
29442944+ return err
29452945+ }
29462946+ t.Via = new(atproto.RepoStrongRef)
29472947+ if err := t.Via.UnmarshalCBOR(cr); err != nil {
29482948+ return xerrors.Errorf("unmarshaling t.Via pointer: %w", err)
29492949+ }
29502950+ }
29512951+29522952+ }
29532953+ // t.LexiconTypeID (string) (string)
28662954 case "$type":
2867295528682956 {
···9020910890219109 return nil
90229110}
91119111+func (t *NotificationDeclaration) MarshalCBOR(w io.Writer) error {
91129112+ if t == nil {
91139113+ _, err := w.Write(cbg.CborNull)
91149114+ return err
91159115+ }
91169116+91179117+ cw := cbg.NewCborWriter(w)
91189118+91199119+ if _, err := cw.Write([]byte{162}); err != nil {
91209120+ return err
91219121+ }
91229122+91239123+ // t.LexiconTypeID (string) (string)
91249124+ if len("$type") > 1000000 {
91259125+ return xerrors.Errorf("Value in field \"$type\" was too long")
91269126+ }
91279127+91289128+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
91299129+ return err
91309130+ }
91319131+ if _, err := cw.WriteString(string("$type")); err != nil {
91329132+ return err
91339133+ }
91349134+91359135+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("app.bsky.notification.declaration"))); err != nil {
91369136+ return err
91379137+ }
91389138+ if _, err := cw.WriteString(string("app.bsky.notification.declaration")); err != nil {
91399139+ return err
91409140+ }
91419141+91429142+ // t.AllowSubscriptions (string) (string)
91439143+ if len("allowSubscriptions") > 1000000 {
91449144+ return xerrors.Errorf("Value in field \"allowSubscriptions\" was too long")
91459145+ }
91469146+91479147+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("allowSubscriptions"))); err != nil {
91489148+ return err
91499149+ }
91509150+ if _, err := cw.WriteString(string("allowSubscriptions")); err != nil {
91519151+ return err
91529152+ }
91539153+91549154+ if len(t.AllowSubscriptions) > 1000000 {
91559155+ return xerrors.Errorf("Value in field t.AllowSubscriptions was too long")
91569156+ }
91579157+91589158+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.AllowSubscriptions))); err != nil {
91599159+ return err
91609160+ }
91619161+ if _, err := cw.WriteString(string(t.AllowSubscriptions)); err != nil {
91629162+ return err
91639163+ }
91649164+ return nil
91659165+}
91669166+91679167+func (t *NotificationDeclaration) UnmarshalCBOR(r io.Reader) (err error) {
91689168+ *t = NotificationDeclaration{}
91699169+91709170+ cr := cbg.NewCborReader(r)
91719171+91729172+ maj, extra, err := cr.ReadHeader()
91739173+ if err != nil {
91749174+ return err
91759175+ }
91769176+ defer func() {
91779177+ if err == io.EOF {
91789178+ err = io.ErrUnexpectedEOF
91799179+ }
91809180+ }()
91819181+91829182+ if maj != cbg.MajMap {
91839183+ return fmt.Errorf("cbor input should be of type map")
91849184+ }
91859185+91869186+ if extra > cbg.MaxLength {
91879187+ return fmt.Errorf("NotificationDeclaration: map struct too large (%d)", extra)
91889188+ }
91899189+91909190+ n := extra
91919191+91929192+ nameBuf := make([]byte, 18)
91939193+ for i := uint64(0); i < n; i++ {
91949194+ nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
91959195+ if err != nil {
91969196+ return err
91979197+ }
91989198+91999199+ if !ok {
92009200+ // Field doesn't exist on this type, so ignore it
92019201+ if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
92029202+ return err
92039203+ }
92049204+ continue
92059205+ }
92069206+92079207+ switch string(nameBuf[:nameLen]) {
92089208+ // t.LexiconTypeID (string) (string)
92099209+ case "$type":
92109210+92119211+ {
92129212+ sval, err := cbg.ReadStringWithMax(cr, 1000000)
92139213+ if err != nil {
92149214+ return err
92159215+ }
92169216+92179217+ t.LexiconTypeID = string(sval)
92189218+ }
92199219+ // t.AllowSubscriptions (string) (string)
92209220+ case "allowSubscriptions":
92219221+92229222+ {
92239223+ sval, err := cbg.ReadStringWithMax(cr, 1000000)
92249224+ if err != nil {
92259225+ return err
92269226+ }
92279227+92289228+ t.AllowSubscriptions = string(sval)
92299229+ }
92309230+92319231+ default:
92329232+ // Field doesn't exist on this type, so ignore it
92339233+ if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
92349234+ return err
92359235+ }
92369236+ }
92379237+ }
92389238+92399239+ return nil
92409240+}
+19
api/bsky/notificationdeclaration.go
···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+package bsky
44+55+// schema: app.bsky.notification.declaration
66+77+import (
88+ "github.com/bluesky-social/indigo/lex/util"
99+)
1010+1111+func init() {
1212+ util.RegisterType("app.bsky.notification.declaration", &NotificationDeclaration{})
1313+} //
1414+// RECORDTYPE: NotificationDeclaration
1515+type NotificationDeclaration struct {
1616+ LexiconTypeID string `json:"$type,const=app.bsky.notification.declaration" cborgen:"$type,const=app.bsky.notification.declaration"`
1717+ // allowSubscriptions: A declaration of the user's preference for allowing activity subscriptions from other users. Absence of a record implies 'followers'.
1818+ AllowSubscriptions string `json:"allowSubscriptions" cborgen:"allowSubscriptions"`
1919+}
+14
api/bsky/notificationdefs.go
···4455// schema: app.bsky.notification.defs
6677+// NotificationDefs_ActivitySubscription is a "activitySubscription" in the app.bsky.notification.defs schema.
88+type NotificationDefs_ActivitySubscription struct {
99+ Post bool `json:"post" cborgen:"post"`
1010+ Reply bool `json:"reply" cborgen:"reply"`
1111+}
1212+713// NotificationDefs_ChatPreference is a "chatPreference" in the app.bsky.notification.defs schema.
814type NotificationDefs_ChatPreference struct {
915 Include string `json:"include" cborgen:"include"`
···4349// NotificationDefs_RecordDeleted is a "recordDeleted" in the app.bsky.notification.defs schema.
4450type NotificationDefs_RecordDeleted struct {
4551}
5252+5353+// NotificationDefs_SubjectActivitySubscription is a "subjectActivitySubscription" in the app.bsky.notification.defs schema.
5454+//
5555+// Object used to store activity subscription data in stash.
5656+type NotificationDefs_SubjectActivitySubscription struct {
5757+ ActivitySubscription *NotificationDefs_ActivitySubscription `json:"activitySubscription" cborgen:"activitySubscription"`
5858+ Subject string `json:"subject" cborgen:"subject"`
5959+}
+35
api/bsky/notificationlistActivitySubscriptions.go
···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+package bsky
44+55+// schema: app.bsky.notification.listActivitySubscriptions
66+77+import (
88+ "context"
99+1010+ "github.com/bluesky-social/indigo/lex/util"
1111+)
1212+1313+// NotificationListActivitySubscriptions_Output is the output of a app.bsky.notification.listActivitySubscriptions call.
1414+type NotificationListActivitySubscriptions_Output struct {
1515+ Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
1616+ Subscriptions []*ActorDefs_ProfileView `json:"subscriptions" cborgen:"subscriptions"`
1717+}
1818+1919+// NotificationListActivitySubscriptions calls the XRPC method "app.bsky.notification.listActivitySubscriptions".
2020+func NotificationListActivitySubscriptions(ctx context.Context, c util.LexClient, cursor string, limit int64) (*NotificationListActivitySubscriptions_Output, error) {
2121+ var out NotificationListActivitySubscriptions_Output
2222+2323+ params := map[string]interface{}{}
2424+ if cursor != "" {
2525+ params["cursor"] = cursor
2626+ }
2727+ if limit != 0 {
2828+ params["limit"] = limit
2929+ }
3030+ if err := c.LexDo(ctx, util.Query, "", "app.bsky.notification.listActivitySubscriptions", params, nil, &out); err != nil {
3131+ return nil, err
3232+ }
3333+3434+ return &out, nil
3535+}
+33
api/bsky/notificationputActivitySubscription.go
···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+package bsky
44+55+// schema: app.bsky.notification.putActivitySubscription
66+77+import (
88+ "context"
99+1010+ "github.com/bluesky-social/indigo/lex/util"
1111+)
1212+1313+// NotificationPutActivitySubscription_Input is the input argument to a app.bsky.notification.putActivitySubscription call.
1414+type NotificationPutActivitySubscription_Input struct {
1515+ ActivitySubscription *NotificationDefs_ActivitySubscription `json:"activitySubscription" cborgen:"activitySubscription"`
1616+ Subject string `json:"subject" cborgen:"subject"`
1717+}
1818+1919+// NotificationPutActivitySubscription_Output is the output of a app.bsky.notification.putActivitySubscription call.
2020+type NotificationPutActivitySubscription_Output struct {
2121+ ActivitySubscription *NotificationDefs_ActivitySubscription `json:"activitySubscription,omitempty" cborgen:"activitySubscription,omitempty"`
2222+ Subject string `json:"subject" cborgen:"subject"`
2323+}
2424+2525+// NotificationPutActivitySubscription calls the XRPC method "app.bsky.notification.putActivitySubscription".
2626+func NotificationPutActivitySubscription(ctx context.Context, c util.LexClient, input *NotificationPutActivitySubscription_Input) (*NotificationPutActivitySubscription_Output, error) {
2727+ var out NotificationPutActivitySubscription_Output
2828+ if err := c.LexDo(ctx, util.Procedure, "application/json", "app.bsky.notification.putActivitySubscription", nil, input, &out); err != nil {
2929+ return nil, err
3030+ }
3131+3232+ return &out, nil
3333+}
+40
api/bsky/unspecceddefs.go
···3131 Topic string `json:"topic" cborgen:"topic"`
3232}
33333434+// UnspeccedDefs_ThreadItemBlocked is a "threadItemBlocked" in the app.bsky.unspecced.defs schema.
3535+//
3636+// RECORDTYPE: UnspeccedDefs_ThreadItemBlocked
3737+type UnspeccedDefs_ThreadItemBlocked struct {
3838+ LexiconTypeID string `json:"$type,const=app.bsky.unspecced.defs#threadItemBlocked" cborgen:"$type,const=app.bsky.unspecced.defs#threadItemBlocked"`
3939+ Author *FeedDefs_BlockedAuthor `json:"author" cborgen:"author"`
4040+}
4141+4242+// UnspeccedDefs_ThreadItemNoUnauthenticated is a "threadItemNoUnauthenticated" in the app.bsky.unspecced.defs schema.
4343+//
4444+// RECORDTYPE: UnspeccedDefs_ThreadItemNoUnauthenticated
4545+type UnspeccedDefs_ThreadItemNoUnauthenticated struct {
4646+ LexiconTypeID string `json:"$type,const=app.bsky.unspecced.defs#threadItemNoUnauthenticated" cborgen:"$type,const=app.bsky.unspecced.defs#threadItemNoUnauthenticated"`
4747+}
4848+4949+// UnspeccedDefs_ThreadItemNotFound is a "threadItemNotFound" in the app.bsky.unspecced.defs schema.
5050+//
5151+// RECORDTYPE: UnspeccedDefs_ThreadItemNotFound
5252+type UnspeccedDefs_ThreadItemNotFound struct {
5353+ LexiconTypeID string `json:"$type,const=app.bsky.unspecced.defs#threadItemNotFound" cborgen:"$type,const=app.bsky.unspecced.defs#threadItemNotFound"`
5454+}
5555+5656+// UnspeccedDefs_ThreadItemPost is a "threadItemPost" in the app.bsky.unspecced.defs schema.
5757+//
5858+// RECORDTYPE: UnspeccedDefs_ThreadItemPost
5959+type UnspeccedDefs_ThreadItemPost struct {
6060+ LexiconTypeID string `json:"$type,const=app.bsky.unspecced.defs#threadItemPost" cborgen:"$type,const=app.bsky.unspecced.defs#threadItemPost"`
6161+ // hiddenByThreadgate: The threadgate created by the author indicates this post as a reply to be hidden for everyone consuming the thread.
6262+ HiddenByThreadgate bool `json:"hiddenByThreadgate" cborgen:"hiddenByThreadgate"`
6363+ // moreParents: This post has more parents that were not present in the response. This is just a boolean, without the number of parents.
6464+ MoreParents bool `json:"moreParents" cborgen:"moreParents"`
6565+ // moreReplies: This post has more replies that were not present in the response. This is a numeric value, which is best-effort and might not be accurate.
6666+ MoreReplies int64 `json:"moreReplies" cborgen:"moreReplies"`
6767+ // mutedByViewer: This is by an account muted by the viewer requesting it.
6868+ MutedByViewer bool `json:"mutedByViewer" cborgen:"mutedByViewer"`
6969+ // opThread: This post is part of a contiguous thread by the OP from the thread root. Many different OP threads can happen in the same thread.
7070+ OpThread bool `json:"opThread" cborgen:"opThread"`
7171+ Post *FeedDefs_PostView `json:"post" cborgen:"post"`
7272+}
7373+3474// UnspeccedDefs_TrendView is a "trendView" in the app.bsky.unspecced.defs schema.
3575type UnspeccedDefs_TrendView struct {
3676 Actors []*ActorDefs_ProfileViewBasic `json:"actors" cborgen:"actors"`
+73
api/bsky/unspeccedgetPostThreadOtherV2.go
···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+package bsky
44+55+// schema: app.bsky.unspecced.getPostThreadOtherV2
66+77+import (
88+ "context"
99+ "encoding/json"
1010+ "fmt"
1111+1212+ "github.com/bluesky-social/indigo/lex/util"
1313+)
1414+1515+// UnspeccedGetPostThreadOtherV2_Output is the output of a app.bsky.unspecced.getPostThreadOtherV2 call.
1616+type UnspeccedGetPostThreadOtherV2_Output struct {
1717+ // thread: A flat list of other thread items. The depth of each item is indicated by the depth property inside the item.
1818+ Thread []*UnspeccedGetPostThreadOtherV2_ThreadItem `json:"thread" cborgen:"thread"`
1919+}
2020+2121+// UnspeccedGetPostThreadOtherV2_ThreadItem is a "threadItem" in the app.bsky.unspecced.getPostThreadOtherV2 schema.
2222+type UnspeccedGetPostThreadOtherV2_ThreadItem struct {
2323+ // depth: The nesting level of this item in the thread. Depth 0 means the anchor item. Items above have negative depths, items below have positive depths.
2424+ Depth int64 `json:"depth" cborgen:"depth"`
2525+ Uri string `json:"uri" cborgen:"uri"`
2626+ Value *UnspeccedGetPostThreadOtherV2_ThreadItem_Value `json:"value" cborgen:"value"`
2727+}
2828+2929+type UnspeccedGetPostThreadOtherV2_ThreadItem_Value struct {
3030+ UnspeccedDefs_ThreadItemPost *UnspeccedDefs_ThreadItemPost
3131+}
3232+3333+func (t *UnspeccedGetPostThreadOtherV2_ThreadItem_Value) MarshalJSON() ([]byte, error) {
3434+ if t.UnspeccedDefs_ThreadItemPost != nil {
3535+ t.UnspeccedDefs_ThreadItemPost.LexiconTypeID = "app.bsky.unspecced.defs#threadItemPost"
3636+ return json.Marshal(t.UnspeccedDefs_ThreadItemPost)
3737+ }
3838+ return nil, fmt.Errorf("cannot marshal empty enum")
3939+}
4040+func (t *UnspeccedGetPostThreadOtherV2_ThreadItem_Value) UnmarshalJSON(b []byte) error {
4141+ typ, err := util.TypeExtract(b)
4242+ if err != nil {
4343+ return err
4444+ }
4545+4646+ switch typ {
4747+ case "app.bsky.unspecced.defs#threadItemPost":
4848+ t.UnspeccedDefs_ThreadItemPost = new(UnspeccedDefs_ThreadItemPost)
4949+ return json.Unmarshal(b, t.UnspeccedDefs_ThreadItemPost)
5050+5151+ default:
5252+ return nil
5353+ }
5454+}
5555+5656+// UnspeccedGetPostThreadOtherV2 calls the XRPC method "app.bsky.unspecced.getPostThreadOtherV2".
5757+//
5858+// anchor: Reference (AT-URI) to post record. This is the anchor post.
5959+// prioritizeFollowedUsers: Whether to prioritize posts from followed users. It only has effect when the user is authenticated.
6060+func UnspeccedGetPostThreadOtherV2(ctx context.Context, c util.LexClient, anchor string, prioritizeFollowedUsers bool) (*UnspeccedGetPostThreadOtherV2_Output, error) {
6161+ var out UnspeccedGetPostThreadOtherV2_Output
6262+6363+ params := map[string]interface{}{}
6464+ params["anchor"] = anchor
6565+ if prioritizeFollowedUsers {
6666+ params["prioritizeFollowedUsers"] = prioritizeFollowedUsers
6767+ }
6868+ if err := c.LexDo(ctx, util.Query, "", "app.bsky.unspecced.getPostThreadOtherV2", params, nil, &out); err != nil {
6969+ return nil, err
7070+ }
7171+7272+ return &out, nil
7373+}
+116
api/bsky/unspeccedgetPostThreadV2.go
···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+package bsky
44+55+// schema: app.bsky.unspecced.getPostThreadV2
66+77+import (
88+ "context"
99+ "encoding/json"
1010+ "fmt"
1111+1212+ "github.com/bluesky-social/indigo/lex/util"
1313+)
1414+1515+// UnspeccedGetPostThreadV2_Output is the output of a app.bsky.unspecced.getPostThreadV2 call.
1616+type UnspeccedGetPostThreadV2_Output struct {
1717+ // hasOtherReplies: Whether this thread has additional replies. If true, a call can be made to the `getPostThreadOtherV2` endpoint to retrieve them.
1818+ HasOtherReplies bool `json:"hasOtherReplies" cborgen:"hasOtherReplies"`
1919+ // thread: A flat list of thread items. The depth of each item is indicated by the depth property inside the item.
2020+ Thread []*UnspeccedGetPostThreadV2_ThreadItem `json:"thread" cborgen:"thread"`
2121+ Threadgate *FeedDefs_ThreadgateView `json:"threadgate,omitempty" cborgen:"threadgate,omitempty"`
2222+}
2323+2424+// UnspeccedGetPostThreadV2_ThreadItem is a "threadItem" in the app.bsky.unspecced.getPostThreadV2 schema.
2525+type UnspeccedGetPostThreadV2_ThreadItem struct {
2626+ // depth: The nesting level of this item in the thread. Depth 0 means the anchor item. Items above have negative depths, items below have positive depths.
2727+ Depth int64 `json:"depth" cborgen:"depth"`
2828+ Uri string `json:"uri" cborgen:"uri"`
2929+ Value *UnspeccedGetPostThreadV2_ThreadItem_Value `json:"value" cborgen:"value"`
3030+}
3131+3232+type UnspeccedGetPostThreadV2_ThreadItem_Value struct {
3333+ UnspeccedDefs_ThreadItemPost *UnspeccedDefs_ThreadItemPost
3434+ UnspeccedDefs_ThreadItemNoUnauthenticated *UnspeccedDefs_ThreadItemNoUnauthenticated
3535+ UnspeccedDefs_ThreadItemNotFound *UnspeccedDefs_ThreadItemNotFound
3636+ UnspeccedDefs_ThreadItemBlocked *UnspeccedDefs_ThreadItemBlocked
3737+}
3838+3939+func (t *UnspeccedGetPostThreadV2_ThreadItem_Value) MarshalJSON() ([]byte, error) {
4040+ if t.UnspeccedDefs_ThreadItemPost != nil {
4141+ t.UnspeccedDefs_ThreadItemPost.LexiconTypeID = "app.bsky.unspecced.defs#threadItemPost"
4242+ return json.Marshal(t.UnspeccedDefs_ThreadItemPost)
4343+ }
4444+ if t.UnspeccedDefs_ThreadItemNoUnauthenticated != nil {
4545+ t.UnspeccedDefs_ThreadItemNoUnauthenticated.LexiconTypeID = "app.bsky.unspecced.defs#threadItemNoUnauthenticated"
4646+ return json.Marshal(t.UnspeccedDefs_ThreadItemNoUnauthenticated)
4747+ }
4848+ if t.UnspeccedDefs_ThreadItemNotFound != nil {
4949+ t.UnspeccedDefs_ThreadItemNotFound.LexiconTypeID = "app.bsky.unspecced.defs#threadItemNotFound"
5050+ return json.Marshal(t.UnspeccedDefs_ThreadItemNotFound)
5151+ }
5252+ if t.UnspeccedDefs_ThreadItemBlocked != nil {
5353+ t.UnspeccedDefs_ThreadItemBlocked.LexiconTypeID = "app.bsky.unspecced.defs#threadItemBlocked"
5454+ return json.Marshal(t.UnspeccedDefs_ThreadItemBlocked)
5555+ }
5656+ return nil, fmt.Errorf("cannot marshal empty enum")
5757+}
5858+func (t *UnspeccedGetPostThreadV2_ThreadItem_Value) UnmarshalJSON(b []byte) error {
5959+ typ, err := util.TypeExtract(b)
6060+ if err != nil {
6161+ return err
6262+ }
6363+6464+ switch typ {
6565+ case "app.bsky.unspecced.defs#threadItemPost":
6666+ t.UnspeccedDefs_ThreadItemPost = new(UnspeccedDefs_ThreadItemPost)
6767+ return json.Unmarshal(b, t.UnspeccedDefs_ThreadItemPost)
6868+ case "app.bsky.unspecced.defs#threadItemNoUnauthenticated":
6969+ t.UnspeccedDefs_ThreadItemNoUnauthenticated = new(UnspeccedDefs_ThreadItemNoUnauthenticated)
7070+ return json.Unmarshal(b, t.UnspeccedDefs_ThreadItemNoUnauthenticated)
7171+ case "app.bsky.unspecced.defs#threadItemNotFound":
7272+ t.UnspeccedDefs_ThreadItemNotFound = new(UnspeccedDefs_ThreadItemNotFound)
7373+ return json.Unmarshal(b, t.UnspeccedDefs_ThreadItemNotFound)
7474+ case "app.bsky.unspecced.defs#threadItemBlocked":
7575+ t.UnspeccedDefs_ThreadItemBlocked = new(UnspeccedDefs_ThreadItemBlocked)
7676+ return json.Unmarshal(b, t.UnspeccedDefs_ThreadItemBlocked)
7777+7878+ default:
7979+ return nil
8080+ }
8181+}
8282+8383+// UnspeccedGetPostThreadV2 calls the XRPC method "app.bsky.unspecced.getPostThreadV2".
8484+//
8585+// above: Whether to include parents above the anchor.
8686+// anchor: Reference (AT-URI) to post record. This is the anchor post, and the thread will be built around it. It can be any post in the tree, not necessarily a root post.
8787+// below: How many levels of replies to include below the anchor.
8888+// branchingFactor: Maximum of replies to include at each level of the thread, except for the direct replies to the anchor, which are (NOTE: currently, during unspecced phase) all returned (NOTE: later they might be paginated).
8989+// prioritizeFollowedUsers: Whether to prioritize posts from followed users. It only has effect when the user is authenticated.
9090+// sort: Sorting for the thread replies.
9191+func UnspeccedGetPostThreadV2(ctx context.Context, c util.LexClient, above bool, anchor string, below int64, branchingFactor int64, prioritizeFollowedUsers bool, sort string) (*UnspeccedGetPostThreadV2_Output, error) {
9292+ var out UnspeccedGetPostThreadV2_Output
9393+9494+ params := map[string]interface{}{}
9595+ if above {
9696+ params["above"] = above
9797+ }
9898+ params["anchor"] = anchor
9999+ if below != 0 {
100100+ params["below"] = below
101101+ }
102102+ if branchingFactor != 0 {
103103+ params["branchingFactor"] = branchingFactor
104104+ }
105105+ if prioritizeFollowedUsers {
106106+ params["prioritizeFollowedUsers"] = prioritizeFollowedUsers
107107+ }
108108+ if sort != "" {
109109+ params["sort"] = sort
110110+ }
111111+ if err := c.LexDo(ctx, util.Query, "", "app.bsky.unspecced.getPostThreadV2", params, nil, &out); err != nil {
112112+ return nil, err
113113+ }
114114+115115+ return &out, nil
116116+}