···4975497549764976 return nil
49774977}
49784978+func (t *LiveRecommendations) MarshalCBOR(w io.Writer) error {
49794979+ if t == nil {
49804980+ _, err := w.Write(cbg.CborNull)
49814981+ return err
49824982+ }
49834983+49844984+ cw := cbg.NewCborWriter(w)
49854985+49864986+ if _, err := cw.Write([]byte{163}); err != nil {
49874987+ return err
49884988+ }
49894989+49904990+ // t.LexiconTypeID (string) (string)
49914991+ if len("$type") > 1000000 {
49924992+ return xerrors.Errorf("Value in field \"$type\" was too long")
49934993+ }
49944994+49954995+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
49964996+ return err
49974997+ }
49984998+ if _, err := cw.WriteString(string("$type")); err != nil {
49994999+ return err
50005000+ }
50015001+50025002+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("place.stream.live.recommendations"))); err != nil {
50035003+ return err
50045004+ }
50055005+ if _, err := cw.WriteString(string("place.stream.live.recommendations")); err != nil {
50065006+ return err
50075007+ }
50085008+50095009+ // t.CreatedAt (string) (string)
50105010+ if len("createdAt") > 1000000 {
50115011+ return xerrors.Errorf("Value in field \"createdAt\" was too long")
50125012+ }
50135013+50145014+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil {
50155015+ return err
50165016+ }
50175017+ if _, err := cw.WriteString(string("createdAt")); err != nil {
50185018+ return err
50195019+ }
50205020+50215021+ if len(t.CreatedAt) > 1000000 {
50225022+ return xerrors.Errorf("Value in field t.CreatedAt was too long")
50235023+ }
50245024+50255025+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil {
50265026+ return err
50275027+ }
50285028+ if _, err := cw.WriteString(string(t.CreatedAt)); err != nil {
50295029+ return err
50305030+ }
50315031+50325032+ // t.Streamers ([]string) (slice)
50335033+ if len("streamers") > 1000000 {
50345034+ return xerrors.Errorf("Value in field \"streamers\" was too long")
50355035+ }
50365036+50375037+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("streamers"))); err != nil {
50385038+ return err
50395039+ }
50405040+ if _, err := cw.WriteString(string("streamers")); err != nil {
50415041+ return err
50425042+ }
50435043+50445044+ if len(t.Streamers) > 8192 {
50455045+ return xerrors.Errorf("Slice value in field t.Streamers was too long")
50465046+ }
50475047+50485048+ if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Streamers))); err != nil {
50495049+ return err
50505050+ }
50515051+ for _, v := range t.Streamers {
50525052+ if len(v) > 1000000 {
50535053+ return xerrors.Errorf("Value in field v was too long")
50545054+ }
50555055+50565056+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil {
50575057+ return err
50585058+ }
50595059+ if _, err := cw.WriteString(string(v)); err != nil {
50605060+ return err
50615061+ }
50625062+50635063+ }
50645064+ return nil
50655065+}
50665066+50675067+func (t *LiveRecommendations) UnmarshalCBOR(r io.Reader) (err error) {
50685068+ *t = LiveRecommendations{}
50695069+50705070+ cr := cbg.NewCborReader(r)
50715071+50725072+ maj, extra, err := cr.ReadHeader()
50735073+ if err != nil {
50745074+ return err
50755075+ }
50765076+ defer func() {
50775077+ if err == io.EOF {
50785078+ err = io.ErrUnexpectedEOF
50795079+ }
50805080+ }()
50815081+50825082+ if maj != cbg.MajMap {
50835083+ return fmt.Errorf("cbor input should be of type map")
50845084+ }
50855085+50865086+ if extra > cbg.MaxLength {
50875087+ return fmt.Errorf("LiveRecommendations: map struct too large (%d)", extra)
50885088+ }
50895089+50905090+ n := extra
50915091+50925092+ nameBuf := make([]byte, 9)
50935093+ for i := uint64(0); i < n; i++ {
50945094+ nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
50955095+ if err != nil {
50965096+ return err
50975097+ }
50985098+50995099+ if !ok {
51005100+ // Field doesn't exist on this type, so ignore it
51015101+ if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
51025102+ return err
51035103+ }
51045104+ continue
51055105+ }
51065106+51075107+ switch string(nameBuf[:nameLen]) {
51085108+ // t.LexiconTypeID (string) (string)
51095109+ case "$type":
51105110+51115111+ {
51125112+ sval, err := cbg.ReadStringWithMax(cr, 1000000)
51135113+ if err != nil {
51145114+ return err
51155115+ }
51165116+51175117+ t.LexiconTypeID = string(sval)
51185118+ }
51195119+ // t.CreatedAt (string) (string)
51205120+ case "createdAt":
51215121+51225122+ {
51235123+ sval, err := cbg.ReadStringWithMax(cr, 1000000)
51245124+ if err != nil {
51255125+ return err
51265126+ }
51275127+51285128+ t.CreatedAt = string(sval)
51295129+ }
51305130+ // t.Streamers ([]string) (slice)
51315131+ case "streamers":
51325132+51335133+ maj, extra, err = cr.ReadHeader()
51345134+ if err != nil {
51355135+ return err
51365136+ }
51375137+51385138+ if extra > 8192 {
51395139+ return fmt.Errorf("t.Streamers: array too large (%d)", extra)
51405140+ }
51415141+51425142+ if maj != cbg.MajArray {
51435143+ return fmt.Errorf("expected cbor array")
51445144+ }
51455145+51465146+ if extra > 0 {
51475147+ t.Streamers = make([]string, extra)
51485148+ }
51495149+51505150+ for i := 0; i < int(extra); i++ {
51515151+ {
51525152+ var maj byte
51535153+ var extra uint64
51545154+ var err error
51555155+ _ = maj
51565156+ _ = extra
51575157+ _ = err
51585158+51595159+ {
51605160+ sval, err := cbg.ReadStringWithMax(cr, 1000000)
51615161+ if err != nil {
51625162+ return err
51635163+ }
51645164+51655165+ t.Streamers[i] = string(sval)
51665166+ }
51675167+51685168+ }
51695169+ }
51705170+51715171+ default:
51725172+ // Field doesn't exist on this type, so ignore it
51735173+ if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
51745174+ return err
51755175+ }
51765176+ }
51775177+ }
51785178+51795179+ return nil
51805180+}
+34
pkg/streamplace/livegetRecommendations.go
···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+package streamplace
44+55+// schema: place.stream.live.getRecommendations
66+77+import (
88+ "context"
99+1010+ "github.com/bluesky-social/indigo/lex/util"
1111+)
1212+1313+// LiveGetRecommendations_Output is the output of a place.stream.live.getRecommendations call.
1414+type LiveGetRecommendations_Output struct {
1515+ // streamers: Ordered list of recommended streamer DIDs
1616+ Streamers []string `json:"streamers" cborgen:"streamers"`
1717+ // userDID: The user who created this recommendation list
1818+ UserDID *string `json:"userDID,omitempty" cborgen:"userDID,omitempty"`
1919+}
2020+2121+// LiveGetRecommendations calls the XRPC method "place.stream.live.getRecommendations".
2222+//
2323+// userDID: The DID of the user whose recommendations to fetch
2424+func LiveGetRecommendations(ctx context.Context, c util.LexClient, userDID string) (*LiveGetRecommendations_Output, error) {
2525+ var out LiveGetRecommendations_Output
2626+2727+ params := map[string]interface{}{}
2828+ params["userDID"] = userDID
2929+ if err := c.LexDo(ctx, util.Query, "", "place.stream.live.getRecommendations", params, nil, &out); err != nil {
3030+ return nil, err
3131+ }
3232+3333+ return &out, nil
3434+}
+21
pkg/streamplace/liverecommendations.go
···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+package streamplace
44+55+// schema: place.stream.live.recommendations
66+77+import (
88+ "github.com/bluesky-social/indigo/lex/util"
99+)
1010+1111+func init() {
1212+ util.RegisterType("place.stream.live.recommendations", &LiveRecommendations{})
1313+} //
1414+// RECORDTYPE: LiveRecommendations
1515+type LiveRecommendations struct {
1616+ LexiconTypeID string `json:"$type,const=place.stream.live.recommendations" cborgen:"$type,const=place.stream.live.recommendations"`
1717+ // createdAt: Client-declared timestamp when this list was created.
1818+ CreatedAt string `json:"createdAt" cborgen:"createdAt"`
1919+ // streamers: Ordered list of recommended streamer DIDs
2020+ Streamers []string `json:"streamers" cborgen:"streamers"`
2121+}
+44
pkg/streamplace/livesearchActorsTypeahead.go
···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+package streamplace
44+55+// schema: place.stream.live.searchActorsTypeahead
66+77+import (
88+ "context"
99+1010+ "github.com/bluesky-social/indigo/lex/util"
1111+)
1212+1313+// LiveSearchActorsTypeahead_Actor is a "actor" in the place.stream.live.searchActorsTypeahead schema.
1414+type LiveSearchActorsTypeahead_Actor struct {
1515+ // did: The actor's DID
1616+ Did string `json:"did" cborgen:"did"`
1717+ // handle: The actor's handle
1818+ Handle string `json:"handle" cborgen:"handle"`
1919+}
2020+2121+// LiveSearchActorsTypeahead_Output is the output of a place.stream.live.searchActorsTypeahead call.
2222+type LiveSearchActorsTypeahead_Output struct {
2323+ Actors []*LiveSearchActorsTypeahead_Actor `json:"actors" cborgen:"actors"`
2424+}
2525+2626+// LiveSearchActorsTypeahead calls the XRPC method "place.stream.live.searchActorsTypeahead".
2727+//
2828+// q: Search query prefix; not a full query string.
2929+func LiveSearchActorsTypeahead(ctx context.Context, c util.LexClient, limit int64, q string) (*LiveSearchActorsTypeahead_Output, error) {
3030+ var out LiveSearchActorsTypeahead_Output
3131+3232+ params := map[string]interface{}{}
3333+ if limit != 0 {
3434+ params["limit"] = limit
3535+ }
3636+ if q != "" {
3737+ params["q"] = q
3838+ }
3939+ if err := c.LexDo(ctx, util.Query, "", "place.stream.live.searchActorsTypeahead", params, nil, &out); err != nil {
4040+ return nil, err
4141+ }
4242+4343+ return &out, nil
4444+}