···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+package atproto
44+55+// schema: com.atproto.temp.pushBlob
66+77+import (
88+ "context"
99+ "io"
1010+1111+ "github.com/bluesky-social/indigo/xrpc"
1212+)
1313+1414+// TempPushBlob calls the XRPC method "com.atproto.temp.pushBlob".
1515+//
1616+// did: The DID of the repo.
1717+func TempPushBlob(ctx context.Context, c *xrpc.Client, input io.Reader, did string) error {
1818+1919+ params := map[string]interface{}{
2020+ "did": did,
2121+ }
2222+ if err := c.Do(ctx, xrpc.Procedure, "*/*", "com.atproto.temp.pushBlob", params, input, nil); err != nil {
2323+ return err
2424+ }
2525+2626+ return nil
2727+}
+37
api/atproto/temptransferAccount.go
···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+package atproto
44+55+// schema: com.atproto.temp.transferAccount
66+77+import (
88+ "context"
99+1010+ "github.com/bluesky-social/indigo/lex/util"
1111+ "github.com/bluesky-social/indigo/xrpc"
1212+)
1313+1414+// TempTransferAccount_Input is the input argument to a com.atproto.temp.transferAccount call.
1515+type TempTransferAccount_Input struct {
1616+ Did string `json:"did" cborgen:"did"`
1717+ Handle string `json:"handle" cborgen:"handle"`
1818+ PlcOp *util.LexiconTypeDecoder `json:"plcOp" cborgen:"plcOp"`
1919+}
2020+2121+// TempTransferAccount_Output is the output of a com.atproto.temp.transferAccount call.
2222+type TempTransferAccount_Output struct {
2323+ AccessJwt string `json:"accessJwt" cborgen:"accessJwt"`
2424+ Did string `json:"did" cborgen:"did"`
2525+ Handle string `json:"handle" cborgen:"handle"`
2626+ RefreshJwt string `json:"refreshJwt" cborgen:"refreshJwt"`
2727+}
2828+2929+// TempTransferAccount calls the XRPC method "com.atproto.temp.transferAccount".
3030+func TempTransferAccount(ctx context.Context, c *xrpc.Client, input *TempTransferAccount_Input) (*TempTransferAccount_Output, error) {
3131+ var out TempTransferAccount_Output
3232+ if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.temp.transferAccount", nil, input, &out); err != nil {
3333+ return nil, err
3434+ }
3535+3636+ return &out, nil
3737+}
+720-42
api/bsky/cbor_gen.go
···370370 }
371371372372 for i := 0; i < int(extra); i++ {
373373-374373 {
375375- sval, err := cbg.ReadString(cr)
376376- if err != nil {
377377- return err
378378- }
374374+ var maj byte
375375+ var extra uint64
376376+ var err error
377377+ _ = maj
378378+ _ = extra
379379+ _ = err
379380380380- t.Tags[i] = string(sval)
381381+ {
382382+ sval, err := cbg.ReadString(cr)
383383+ if err != nil {
384384+ return err
385385+ }
386386+387387+ t.Tags[i] = string(sval)
388388+ }
381389 }
382390 }
383391···444452 }
445453446454 for i := 0; i < int(extra); i++ {
447447-448455 {
449449- sval, err := cbg.ReadString(cr)
450450- if err != nil {
451451- return err
452452- }
456456+ var maj byte
457457+ var extra uint64
458458+ var err error
459459+ _ = maj
460460+ _ = extra
461461+ _ = err
453462454454- t.Langs[i] = string(sval)
463463+ {
464464+ sval, err := cbg.ReadString(cr)
465465+ if err != nil {
466466+ return err
467467+ }
468468+469469+ t.Langs[i] = string(sval)
470470+ }
455471 }
456472 }
457473···496512 }
497513498514 for i := 0; i < int(extra); i++ {
515515+ {
516516+ var maj byte
517517+ var extra uint64
518518+ var err error
519519+ _ = maj
520520+ _ = extra
521521+ _ = err
499522500500- var v RichtextFacet
501501- if err := v.UnmarshalCBOR(cr); err != nil {
502502- return err
503503- }
523523+ {
524524+525525+ b, err := cr.ReadByte()
526526+ if err != nil {
527527+ return err
528528+ }
529529+ if b != cbg.CborNull[0] {
530530+ if err := cr.UnreadByte(); err != nil {
531531+ return err
532532+ }
533533+ t.Facets[i] = new(RichtextFacet)
534534+ if err := t.Facets[i].UnmarshalCBOR(cr); err != nil {
535535+ return xerrors.Errorf("unmarshaling t.Facets[i] pointer: %w", err)
536536+ }
537537+ }
504538505505- t.Facets[i] = &v
539539+ }
540540+ }
506541 }
507542508543 // t.Labels (bsky.FeedPost_Labels) (struct)
···546581 }
547582548583 for i := 0; i < int(extra); i++ {
584584+ {
585585+ var maj byte
586586+ var extra uint64
587587+ var err error
588588+ _ = maj
589589+ _ = extra
590590+ _ = err
549591550550- var v FeedPost_Entity
551551- if err := v.UnmarshalCBOR(cr); err != nil {
552552- return err
592592+ {
593593+594594+ b, err := cr.ReadByte()
595595+ if err != nil {
596596+ return err
597597+ }
598598+ if b != cbg.CborNull[0] {
599599+ if err := cr.UnreadByte(); err != nil {
600600+ return err
601601+ }
602602+ t.Entities[i] = new(FeedPost_Entity)
603603+ if err := t.Entities[i].UnmarshalCBOR(cr); err != nil {
604604+ return xerrors.Errorf("unmarshaling t.Entities[i] pointer: %w", err)
605605+ }
606606+ }
607607+608608+ }
553609 }
554554-555555- t.Entities[i] = &v
556610 }
557611558612 // t.CreatedAt (string) (string)
···13191373 }
1320137413211375 for i := 0; i < int(extra); i++ {
13761376+ {
13771377+ var maj byte
13781378+ var extra uint64
13791379+ var err error
13801380+ _ = maj
13811381+ _ = extra
13821382+ _ = err
1322138313231323- var v EmbedImages_Image
13241324- if err := v.UnmarshalCBOR(cr); err != nil {
13251325- return err
13261326- }
13841384+ {
13851385+13861386+ b, err := cr.ReadByte()
13871387+ if err != nil {
13881388+ return err
13891389+ }
13901390+ if b != cbg.CborNull[0] {
13911391+ if err := cr.UnreadByte(); err != nil {
13921392+ return err
13931393+ }
13941394+ t.Images[i] = new(EmbedImages_Image)
13951395+ if err := t.Images[i].UnmarshalCBOR(cr); err != nil {
13961396+ return xerrors.Errorf("unmarshaling t.Images[i] pointer: %w", err)
13971397+ }
13981398+ }
1327139913281328- t.Images[i] = &v
14001400+ }
14011401+ }
13291402 }
1330140313311404 default:
···27612834 }
2762283527632836 for i := 0; i < int(extra); i++ {
28372837+ {
28382838+ var maj byte
28392839+ var extra uint64
28402840+ var err error
28412841+ _ = maj
28422842+ _ = extra
28432843+ _ = err
2764284427652765- var v RichtextFacet_Features_Elem
27662766- if err := v.UnmarshalCBOR(cr); err != nil {
27672767- return err
27682768- }
28452845+ {
28462846+28472847+ b, err := cr.ReadByte()
28482848+ if err != nil {
28492849+ return err
28502850+ }
28512851+ if b != cbg.CborNull[0] {
28522852+ if err := cr.UnreadByte(); err != nil {
28532853+ return err
28542854+ }
28552855+ t.Features[i] = new(RichtextFacet_Features_Elem)
28562856+ if err := t.Features[i].UnmarshalCBOR(cr); err != nil {
28572857+ return xerrors.Errorf("unmarshaling t.Features[i] pointer: %w", err)
28582858+ }
28592859+ }
2769286027702770- t.Features[i] = &v
28612861+ }
28622862+ }
27712863 }
2772286427732865 default:
···41884280 }
4189428141904282 for i := 0; i < int(extra); i++ {
42834283+ {
42844284+ var maj byte
42854285+ var extra uint64
42864286+ var err error
42874287+ _ = maj
42884288+ _ = extra
42894289+ _ = err
4191429041924192- var v RichtextFacet
41934193- if err := v.UnmarshalCBOR(cr); err != nil {
41944194- return err
41954195- }
42914291+ {
42924292+42934293+ b, err := cr.ReadByte()
42944294+ if err != nil {
42954295+ return err
42964296+ }
42974297+ if b != cbg.CborNull[0] {
42984298+ if err := cr.UnreadByte(); err != nil {
42994299+ return err
43004300+ }
43014301+ t.DescriptionFacets[i] = new(RichtextFacet)
43024302+ if err := t.DescriptionFacets[i].UnmarshalCBOR(cr); err != nil {
43034303+ return xerrors.Errorf("unmarshaling t.DescriptionFacets[i] pointer: %w", err)
43044304+ }
43054305+ }
4196430641974197- t.DescriptionFacets[i] = &v
43074307+ }
43084308+ }
41984309 }
4199431042004311 default:
···47794890 }
4780489147814892 for i := 0; i < int(extra); i++ {
48934893+ {
48944894+ var maj byte
48954895+ var extra uint64
48964896+ var err error
48974897+ _ = maj
48984898+ _ = extra
48994899+ _ = err
4782490047834783- var v RichtextFacet
47844784- if err := v.UnmarshalCBOR(cr); err != nil {
47854785- return err
49014901+ {
49024902+49034903+ b, err := cr.ReadByte()
49044904+ if err != nil {
49054905+ return err
49064906+ }
49074907+ if b != cbg.CborNull[0] {
49084908+ if err := cr.UnreadByte(); err != nil {
49094909+ return err
49104910+ }
49114911+ t.DescriptionFacets[i] = new(RichtextFacet)
49124912+ if err := t.DescriptionFacets[i].UnmarshalCBOR(cr); err != nil {
49134913+ return xerrors.Errorf("unmarshaling t.DescriptionFacets[i] pointer: %w", err)
49144914+ }
49154915+ }
49164916+49174917+ }
47864918 }
47874787-47884788- t.DescriptionFacets[i] = &v
47894919 }
4790492047914921 default:
···5112524251135243 return nil
51145244}
52455245+func (t *FeedThreadgate) MarshalCBOR(w io.Writer) error {
52465246+ if t == nil {
52475247+ _, err := w.Write(cbg.CborNull)
52485248+ return err
52495249+ }
52505250+52515251+ cw := cbg.NewCborWriter(w)
52525252+ fieldCount := 4
52535253+52545254+ if t.Allow == nil {
52555255+ fieldCount--
52565256+ }
52575257+52585258+ if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
52595259+ return err
52605260+ }
52615261+52625262+ // t.Post (string) (string)
52635263+ if len("post") > cbg.MaxLength {
52645264+ return xerrors.Errorf("Value in field \"post\" was too long")
52655265+ }
52665266+52675267+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("post"))); err != nil {
52685268+ return err
52695269+ }
52705270+ if _, err := cw.WriteString(string("post")); err != nil {
52715271+ return err
52725272+ }
52735273+52745274+ if len(t.Post) > cbg.MaxLength {
52755275+ return xerrors.Errorf("Value in field t.Post was too long")
52765276+ }
52775277+52785278+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Post))); err != nil {
52795279+ return err
52805280+ }
52815281+ if _, err := cw.WriteString(string(t.Post)); err != nil {
52825282+ return err
52835283+ }
52845284+52855285+ // t.LexiconTypeID (string) (string)
52865286+ if len("$type") > cbg.MaxLength {
52875287+ return xerrors.Errorf("Value in field \"$type\" was too long")
52885288+ }
52895289+52905290+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
52915291+ return err
52925292+ }
52935293+ if _, err := cw.WriteString(string("$type")); err != nil {
52945294+ return err
52955295+ }
52965296+52975297+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("app.bsky.feed.threadgate"))); err != nil {
52985298+ return err
52995299+ }
53005300+ if _, err := cw.WriteString(string("app.bsky.feed.threadgate")); err != nil {
53015301+ return err
53025302+ }
53035303+53045304+ // t.Allow ([]*bsky.FeedThreadgate_Allow_Elem) (slice)
53055305+ if t.Allow != nil {
53065306+53075307+ if len("allow") > cbg.MaxLength {
53085308+ return xerrors.Errorf("Value in field \"allow\" was too long")
53095309+ }
53105310+53115311+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("allow"))); err != nil {
53125312+ return err
53135313+ }
53145314+ if _, err := cw.WriteString(string("allow")); err != nil {
53155315+ return err
53165316+ }
53175317+53185318+ if len(t.Allow) > cbg.MaxLength {
53195319+ return xerrors.Errorf("Slice value in field t.Allow was too long")
53205320+ }
53215321+53225322+ if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Allow))); err != nil {
53235323+ return err
53245324+ }
53255325+ for _, v := range t.Allow {
53265326+ if err := v.MarshalCBOR(cw); err != nil {
53275327+ return err
53285328+ }
53295329+ }
53305330+ }
53315331+53325332+ // t.CreatedAt (string) (string)
53335333+ if len("createdAt") > cbg.MaxLength {
53345334+ return xerrors.Errorf("Value in field \"createdAt\" was too long")
53355335+ }
53365336+53375337+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil {
53385338+ return err
53395339+ }
53405340+ if _, err := cw.WriteString(string("createdAt")); err != nil {
53415341+ return err
53425342+ }
53435343+53445344+ if len(t.CreatedAt) > cbg.MaxLength {
53455345+ return xerrors.Errorf("Value in field t.CreatedAt was too long")
53465346+ }
53475347+53485348+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil {
53495349+ return err
53505350+ }
53515351+ if _, err := cw.WriteString(string(t.CreatedAt)); err != nil {
53525352+ return err
53535353+ }
53545354+ return nil
53555355+}
53565356+53575357+func (t *FeedThreadgate) UnmarshalCBOR(r io.Reader) (err error) {
53585358+ *t = FeedThreadgate{}
53595359+53605360+ cr := cbg.NewCborReader(r)
53615361+53625362+ maj, extra, err := cr.ReadHeader()
53635363+ if err != nil {
53645364+ return err
53655365+ }
53665366+ defer func() {
53675367+ if err == io.EOF {
53685368+ err = io.ErrUnexpectedEOF
53695369+ }
53705370+ }()
53715371+53725372+ if maj != cbg.MajMap {
53735373+ return fmt.Errorf("cbor input should be of type map")
53745374+ }
53755375+53765376+ if extra > cbg.MaxLength {
53775377+ return fmt.Errorf("FeedThreadgate: map struct too large (%d)", extra)
53785378+ }
53795379+53805380+ var name string
53815381+ n := extra
53825382+53835383+ for i := uint64(0); i < n; i++ {
53845384+53855385+ {
53865386+ sval, err := cbg.ReadString(cr)
53875387+ if err != nil {
53885388+ return err
53895389+ }
53905390+53915391+ name = string(sval)
53925392+ }
53935393+53945394+ switch name {
53955395+ // t.Post (string) (string)
53965396+ case "post":
53975397+53985398+ {
53995399+ sval, err := cbg.ReadString(cr)
54005400+ if err != nil {
54015401+ return err
54025402+ }
54035403+54045404+ t.Post = string(sval)
54055405+ }
54065406+ // t.LexiconTypeID (string) (string)
54075407+ case "$type":
54085408+54095409+ {
54105410+ sval, err := cbg.ReadString(cr)
54115411+ if err != nil {
54125412+ return err
54135413+ }
54145414+54155415+ t.LexiconTypeID = string(sval)
54165416+ }
54175417+ // t.Allow ([]*bsky.FeedThreadgate_Allow_Elem) (slice)
54185418+ case "allow":
54195419+54205420+ maj, extra, err = cr.ReadHeader()
54215421+ if err != nil {
54225422+ return err
54235423+ }
54245424+54255425+ if extra > cbg.MaxLength {
54265426+ return fmt.Errorf("t.Allow: array too large (%d)", extra)
54275427+ }
54285428+54295429+ if maj != cbg.MajArray {
54305430+ return fmt.Errorf("expected cbor array")
54315431+ }
54325432+54335433+ if extra > 0 {
54345434+ t.Allow = make([]*FeedThreadgate_Allow_Elem, extra)
54355435+ }
54365436+54375437+ for i := 0; i < int(extra); i++ {
54385438+ {
54395439+ var maj byte
54405440+ var extra uint64
54415441+ var err error
54425442+ _ = maj
54435443+ _ = extra
54445444+ _ = err
54455445+54465446+ {
54475447+54485448+ b, err := cr.ReadByte()
54495449+ if err != nil {
54505450+ return err
54515451+ }
54525452+ if b != cbg.CborNull[0] {
54535453+ if err := cr.UnreadByte(); err != nil {
54545454+ return err
54555455+ }
54565456+ t.Allow[i] = new(FeedThreadgate_Allow_Elem)
54575457+ if err := t.Allow[i].UnmarshalCBOR(cr); err != nil {
54585458+ return xerrors.Errorf("unmarshaling t.Allow[i] pointer: %w", err)
54595459+ }
54605460+ }
54615461+54625462+ }
54635463+ }
54645464+ }
54655465+54665466+ // t.CreatedAt (string) (string)
54675467+ case "createdAt":
54685468+54695469+ {
54705470+ sval, err := cbg.ReadString(cr)
54715471+ if err != nil {
54725472+ return err
54735473+ }
54745474+54755475+ t.CreatedAt = string(sval)
54765476+ }
54775477+54785478+ default:
54795479+ // Field doesn't exist on this type, so ignore it
54805480+ cbg.ScanForLinks(r, func(cid.Cid) {})
54815481+ }
54825482+ }
54835483+54845484+ return nil
54855485+}
54865486+func (t *FeedThreadgate_ListRule) MarshalCBOR(w io.Writer) error {
54875487+ if t == nil {
54885488+ _, err := w.Write(cbg.CborNull)
54895489+ return err
54905490+ }
54915491+54925492+ cw := cbg.NewCborWriter(w)
54935493+54945494+ if _, err := cw.Write([]byte{162}); err != nil {
54955495+ return err
54965496+ }
54975497+54985498+ // t.List (string) (string)
54995499+ if len("list") > cbg.MaxLength {
55005500+ return xerrors.Errorf("Value in field \"list\" was too long")
55015501+ }
55025502+55035503+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("list"))); err != nil {
55045504+ return err
55055505+ }
55065506+ if _, err := cw.WriteString(string("list")); err != nil {
55075507+ return err
55085508+ }
55095509+55105510+ if len(t.List) > cbg.MaxLength {
55115511+ return xerrors.Errorf("Value in field t.List was too long")
55125512+ }
55135513+55145514+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.List))); err != nil {
55155515+ return err
55165516+ }
55175517+ if _, err := cw.WriteString(string(t.List)); err != nil {
55185518+ return err
55195519+ }
55205520+55215521+ // t.LexiconTypeID (string) (string)
55225522+ if len("$type") > cbg.MaxLength {
55235523+ return xerrors.Errorf("Value in field \"$type\" was too long")
55245524+ }
55255525+55265526+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
55275527+ return err
55285528+ }
55295529+ if _, err := cw.WriteString(string("$type")); err != nil {
55305530+ return err
55315531+ }
55325532+55335533+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("app.bsky.feed.threadgate#listRule"))); err != nil {
55345534+ return err
55355535+ }
55365536+ if _, err := cw.WriteString(string("app.bsky.feed.threadgate#listRule")); err != nil {
55375537+ return err
55385538+ }
55395539+ return nil
55405540+}
55415541+55425542+func (t *FeedThreadgate_ListRule) UnmarshalCBOR(r io.Reader) (err error) {
55435543+ *t = FeedThreadgate_ListRule{}
55445544+55455545+ cr := cbg.NewCborReader(r)
55465546+55475547+ maj, extra, err := cr.ReadHeader()
55485548+ if err != nil {
55495549+ return err
55505550+ }
55515551+ defer func() {
55525552+ if err == io.EOF {
55535553+ err = io.ErrUnexpectedEOF
55545554+ }
55555555+ }()
55565556+55575557+ if maj != cbg.MajMap {
55585558+ return fmt.Errorf("cbor input should be of type map")
55595559+ }
55605560+55615561+ if extra > cbg.MaxLength {
55625562+ return fmt.Errorf("FeedThreadgate_ListRule: map struct too large (%d)", extra)
55635563+ }
55645564+55655565+ var name string
55665566+ n := extra
55675567+55685568+ for i := uint64(0); i < n; i++ {
55695569+55705570+ {
55715571+ sval, err := cbg.ReadString(cr)
55725572+ if err != nil {
55735573+ return err
55745574+ }
55755575+55765576+ name = string(sval)
55775577+ }
55785578+55795579+ switch name {
55805580+ // t.List (string) (string)
55815581+ case "list":
55825582+55835583+ {
55845584+ sval, err := cbg.ReadString(cr)
55855585+ if err != nil {
55865586+ return err
55875587+ }
55885588+55895589+ t.List = string(sval)
55905590+ }
55915591+ // t.LexiconTypeID (string) (string)
55925592+ case "$type":
55935593+55945594+ {
55955595+ sval, err := cbg.ReadString(cr)
55965596+ if err != nil {
55975597+ return err
55985598+ }
55995599+56005600+ t.LexiconTypeID = string(sval)
56015601+ }
56025602+56035603+ default:
56045604+ // Field doesn't exist on this type, so ignore it
56055605+ cbg.ScanForLinks(r, func(cid.Cid) {})
56065606+ }
56075607+ }
56085608+56095609+ return nil
56105610+}
56115611+func (t *FeedThreadgate_MentionRule) MarshalCBOR(w io.Writer) error {
56125612+ if t == nil {
56135613+ _, err := w.Write(cbg.CborNull)
56145614+ return err
56155615+ }
56165616+56175617+ cw := cbg.NewCborWriter(w)
56185618+56195619+ if _, err := cw.Write([]byte{161}); err != nil {
56205620+ return err
56215621+ }
56225622+56235623+ // t.LexiconTypeID (string) (string)
56245624+ if len("$type") > cbg.MaxLength {
56255625+ return xerrors.Errorf("Value in field \"$type\" was too long")
56265626+ }
56275627+56285628+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
56295629+ return err
56305630+ }
56315631+ if _, err := cw.WriteString(string("$type")); err != nil {
56325632+ return err
56335633+ }
56345634+56355635+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("app.bsky.feed.threadgate#mentionRule"))); err != nil {
56365636+ return err
56375637+ }
56385638+ if _, err := cw.WriteString(string("app.bsky.feed.threadgate#mentionRule")); err != nil {
56395639+ return err
56405640+ }
56415641+ return nil
56425642+}
56435643+56445644+func (t *FeedThreadgate_MentionRule) UnmarshalCBOR(r io.Reader) (err error) {
56455645+ *t = FeedThreadgate_MentionRule{}
56465646+56475647+ cr := cbg.NewCborReader(r)
56485648+56495649+ maj, extra, err := cr.ReadHeader()
56505650+ if err != nil {
56515651+ return err
56525652+ }
56535653+ defer func() {
56545654+ if err == io.EOF {
56555655+ err = io.ErrUnexpectedEOF
56565656+ }
56575657+ }()
56585658+56595659+ if maj != cbg.MajMap {
56605660+ return fmt.Errorf("cbor input should be of type map")
56615661+ }
56625662+56635663+ if extra > cbg.MaxLength {
56645664+ return fmt.Errorf("FeedThreadgate_MentionRule: map struct too large (%d)", extra)
56655665+ }
56665666+56675667+ var name string
56685668+ n := extra
56695669+56705670+ for i := uint64(0); i < n; i++ {
56715671+56725672+ {
56735673+ sval, err := cbg.ReadString(cr)
56745674+ if err != nil {
56755675+ return err
56765676+ }
56775677+56785678+ name = string(sval)
56795679+ }
56805680+56815681+ switch name {
56825682+ // t.LexiconTypeID (string) (string)
56835683+ case "$type":
56845684+56855685+ {
56865686+ sval, err := cbg.ReadString(cr)
56875687+ if err != nil {
56885688+ return err
56895689+ }
56905690+56915691+ t.LexiconTypeID = string(sval)
56925692+ }
56935693+56945694+ default:
56955695+ // Field doesn't exist on this type, so ignore it
56965696+ cbg.ScanForLinks(r, func(cid.Cid) {})
56975697+ }
56985698+ }
56995699+57005700+ return nil
57015701+}
57025702+func (t *FeedThreadgate_FollowingRule) MarshalCBOR(w io.Writer) error {
57035703+ if t == nil {
57045704+ _, err := w.Write(cbg.CborNull)
57055705+ return err
57065706+ }
57075707+57085708+ cw := cbg.NewCborWriter(w)
57095709+57105710+ if _, err := cw.Write([]byte{161}); err != nil {
57115711+ return err
57125712+ }
57135713+57145714+ // t.LexiconTypeID (string) (string)
57155715+ if len("$type") > cbg.MaxLength {
57165716+ return xerrors.Errorf("Value in field \"$type\" was too long")
57175717+ }
57185718+57195719+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
57205720+ return err
57215721+ }
57225722+ if _, err := cw.WriteString(string("$type")); err != nil {
57235723+ return err
57245724+ }
57255725+57265726+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("app.bsky.feed.threadgate#followingRule"))); err != nil {
57275727+ return err
57285728+ }
57295729+ if _, err := cw.WriteString(string("app.bsky.feed.threadgate#followingRule")); err != nil {
57305730+ return err
57315731+ }
57325732+ return nil
57335733+}
57345734+57355735+func (t *FeedThreadgate_FollowingRule) UnmarshalCBOR(r io.Reader) (err error) {
57365736+ *t = FeedThreadgate_FollowingRule{}
57375737+57385738+ cr := cbg.NewCborReader(r)
57395739+57405740+ maj, extra, err := cr.ReadHeader()
57415741+ if err != nil {
57425742+ return err
57435743+ }
57445744+ defer func() {
57455745+ if err == io.EOF {
57465746+ err = io.ErrUnexpectedEOF
57475747+ }
57485748+ }()
57495749+57505750+ if maj != cbg.MajMap {
57515751+ return fmt.Errorf("cbor input should be of type map")
57525752+ }
57535753+57545754+ if extra > cbg.MaxLength {
57555755+ return fmt.Errorf("FeedThreadgate_FollowingRule: map struct too large (%d)", extra)
57565756+ }
57575757+57585758+ var name string
57595759+ n := extra
57605760+57615761+ for i := uint64(0); i < n; i++ {
57625762+57635763+ {
57645764+ sval, err := cbg.ReadString(cr)
57655765+ if err != nil {
57665766+ return err
57675767+ }
57685768+57695769+ name = string(sval)
57705770+ }
57715771+57725772+ switch name {
57735773+ // t.LexiconTypeID (string) (string)
57745774+ case "$type":
57755775+57765776+ {
57775777+ sval, err := cbg.ReadString(cr)
57785778+ if err != nil {
57795779+ return err
57805780+ }
57815781+57825782+ t.LexiconTypeID = string(sval)
57835783+ }
57845784+57855785+ default:
57865786+ // Field doesn't exist on this type, so ignore it
57875787+ cbg.ScanForLinks(r, func(cid.Cid) {})
57885788+ }
57895789+ }
57905790+57915791+ return nil
57925792+}
+3-8
api/bsky/feeddefs.go
···314314 Parent *FeedDefs_ThreadViewPost_Parent `json:"parent,omitempty" cborgen:"parent,omitempty"`
315315 Post *FeedDefs_PostView `json:"post" cborgen:"post"`
316316 Replies []*FeedDefs_ThreadViewPost_Replies_Elem `json:"replies,omitempty" cborgen:"replies,omitempty"`
317317- Viewer *FeedDefs_ViewerThreadState `json:"viewer,omitempty" cborgen:"viewer,omitempty"`
318317}
319318320319type FeedDefs_ThreadViewPost_Parent struct {
···413412414413// FeedDefs_ViewerState is a "viewerState" in the app.bsky.feed.defs schema.
415414type FeedDefs_ViewerState struct {
416416- Like *string `json:"like,omitempty" cborgen:"like,omitempty"`
417417- Repost *string `json:"repost,omitempty" cborgen:"repost,omitempty"`
418418-}
419419-420420-// FeedDefs_ViewerThreadState is a "viewerThreadState" in the app.bsky.feed.defs schema.
421421-type FeedDefs_ViewerThreadState struct {
422422- CanReply *bool `json:"canReply,omitempty" cborgen:"canReply,omitempty"`
415415+ Like *string `json:"like,omitempty" cborgen:"like,omitempty"`
416416+ ReplyDisabled *bool `json:"replyDisabled,omitempty" cborgen:"replyDisabled,omitempty"`
417417+ Repost *string `json:"repost,omitempty" cborgen:"repost,omitempty"`
423418}
+136
api/bsky/feedthreadgate.go
···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+package bsky
44+55+// schema: app.bsky.feed.threadgate
66+77+import (
88+ "bytes"
99+ "encoding/json"
1010+ "fmt"
1111+ "io"
1212+1313+ "github.com/bluesky-social/indigo/lex/util"
1414+ cbg "github.com/whyrusleeping/cbor-gen"
1515+)
1616+1717+func init() {
1818+ util.RegisterType("app.bsky.feed.threadgate", &FeedThreadgate{})
1919+} //
2020+// RECORDTYPE: FeedThreadgate
2121+type FeedThreadgate struct {
2222+ LexiconTypeID string `json:"$type,const=app.bsky.feed.threadgate" cborgen:"$type,const=app.bsky.feed.threadgate"`
2323+ Allow []*FeedThreadgate_Allow_Elem `json:"allow,omitempty" cborgen:"allow,omitempty"`
2424+ CreatedAt string `json:"createdAt" cborgen:"createdAt"`
2525+ Post string `json:"post" cborgen:"post"`
2626+}
2727+2828+type FeedThreadgate_Allow_Elem struct {
2929+ FeedThreadgate_MentionRule *FeedThreadgate_MentionRule
3030+ FeedThreadgate_FollowingRule *FeedThreadgate_FollowingRule
3131+ FeedThreadgate_ListRule *FeedThreadgate_ListRule
3232+}
3333+3434+func (t *FeedThreadgate_Allow_Elem) MarshalJSON() ([]byte, error) {
3535+ if t.FeedThreadgate_MentionRule != nil {
3636+ t.FeedThreadgate_MentionRule.LexiconTypeID = "app.bsky.feed.threadgate#mentionRule"
3737+ return json.Marshal(t.FeedThreadgate_MentionRule)
3838+ }
3939+ if t.FeedThreadgate_FollowingRule != nil {
4040+ t.FeedThreadgate_FollowingRule.LexiconTypeID = "app.bsky.feed.threadgate#followingRule"
4141+ return json.Marshal(t.FeedThreadgate_FollowingRule)
4242+ }
4343+ if t.FeedThreadgate_ListRule != nil {
4444+ t.FeedThreadgate_ListRule.LexiconTypeID = "app.bsky.feed.threadgate#listRule"
4545+ return json.Marshal(t.FeedThreadgate_ListRule)
4646+ }
4747+ return nil, fmt.Errorf("cannot marshal empty enum")
4848+}
4949+func (t *FeedThreadgate_Allow_Elem) UnmarshalJSON(b []byte) error {
5050+ typ, err := util.TypeExtract(b)
5151+ if err != nil {
5252+ return err
5353+ }
5454+5555+ switch typ {
5656+ case "app.bsky.feed.threadgate#mentionRule":
5757+ t.FeedThreadgate_MentionRule = new(FeedThreadgate_MentionRule)
5858+ return json.Unmarshal(b, t.FeedThreadgate_MentionRule)
5959+ case "app.bsky.feed.threadgate#followingRule":
6060+ t.FeedThreadgate_FollowingRule = new(FeedThreadgate_FollowingRule)
6161+ return json.Unmarshal(b, t.FeedThreadgate_FollowingRule)
6262+ case "app.bsky.feed.threadgate#listRule":
6363+ t.FeedThreadgate_ListRule = new(FeedThreadgate_ListRule)
6464+ return json.Unmarshal(b, t.FeedThreadgate_ListRule)
6565+6666+ default:
6767+ return nil
6868+ }
6969+}
7070+7171+func (t *FeedThreadgate_Allow_Elem) MarshalCBOR(w io.Writer) error {
7272+7373+ if t == nil {
7474+ _, err := w.Write(cbg.CborNull)
7575+ return err
7676+ }
7777+ if t.FeedThreadgate_MentionRule != nil {
7878+ return t.FeedThreadgate_MentionRule.MarshalCBOR(w)
7979+ }
8080+ if t.FeedThreadgate_FollowingRule != nil {
8181+ return t.FeedThreadgate_FollowingRule.MarshalCBOR(w)
8282+ }
8383+ if t.FeedThreadgate_ListRule != nil {
8484+ return t.FeedThreadgate_ListRule.MarshalCBOR(w)
8585+ }
8686+ return fmt.Errorf("cannot cbor marshal empty enum")
8787+}
8888+func (t *FeedThreadgate_Allow_Elem) UnmarshalCBOR(r io.Reader) error {
8989+ typ, b, err := util.CborTypeExtractReader(r)
9090+ if err != nil {
9191+ return err
9292+ }
9393+9494+ switch typ {
9595+ case "app.bsky.feed.threadgate#mentionRule":
9696+ t.FeedThreadgate_MentionRule = new(FeedThreadgate_MentionRule)
9797+ return t.FeedThreadgate_MentionRule.UnmarshalCBOR(bytes.NewReader(b))
9898+ case "app.bsky.feed.threadgate#followingRule":
9999+ t.FeedThreadgate_FollowingRule = new(FeedThreadgate_FollowingRule)
100100+ return t.FeedThreadgate_FollowingRule.UnmarshalCBOR(bytes.NewReader(b))
101101+ case "app.bsky.feed.threadgate#listRule":
102102+ t.FeedThreadgate_ListRule = new(FeedThreadgate_ListRule)
103103+ return t.FeedThreadgate_ListRule.UnmarshalCBOR(bytes.NewReader(b))
104104+105105+ default:
106106+ return nil
107107+ }
108108+}
109109+110110+// FeedThreadgate_FollowingRule is a "followingRule" in the app.bsky.feed.threadgate schema.
111111+//
112112+// Allow replies from actors you follow.
113113+//
114114+// RECORDTYPE: FeedThreadgate_FollowingRule
115115+type FeedThreadgate_FollowingRule struct {
116116+ LexiconTypeID string `json:"$type,const=app.bsky.feed.threadgate#followingRule" cborgen:"$type,const=app.bsky.feed.threadgate#followingRule"`
117117+}
118118+119119+// FeedThreadgate_ListRule is a "listRule" in the app.bsky.feed.threadgate schema.
120120+//
121121+// Allow replies from actors on a list.
122122+//
123123+// RECORDTYPE: FeedThreadgate_ListRule
124124+type FeedThreadgate_ListRule struct {
125125+ LexiconTypeID string `json:"$type,const=app.bsky.feed.threadgate#listRule" cborgen:"$type,const=app.bsky.feed.threadgate#listRule"`
126126+ List string `json:"list" cborgen:"list"`
127127+}
128128+129129+// FeedThreadgate_MentionRule is a "mentionRule" in the app.bsky.feed.threadgate schema.
130130+//
131131+// Allow replies from actors mentioned in your post.
132132+//
133133+// RECORDTYPE: FeedThreadgate_MentionRule
134134+type FeedThreadgate_MentionRule struct {
135135+ LexiconTypeID string `json:"$type,const=app.bsky.feed.threadgate#mentionRule" cborgen:"$type,const=app.bsky.feed.threadgate#mentionRule"`
136136+}
+1
api/bsky/graphdefs.go
···77// GraphDefs_ListItemView is a "listItemView" in the app.bsky.graph.defs schema.
88type GraphDefs_ListItemView struct {
99 Subject *ActorDefs_ProfileView `json:"subject" cborgen:"subject"`
1010+ Uri string `json:"uri" cborgen:"uri"`
1011}
11121213// GraphDefs_ListView is a "listView" in the app.bsky.graph.defs schema.
+24-5
api/label/cbor_gen.go
···719719 }
720720721721 for i := 0; i < int(extra); i++ {
722722+ {
723723+ var maj byte
724724+ var extra uint64
725725+ var err error
726726+ _ = maj
727727+ _ = extra
728728+ _ = err
722729723723- var v Label
724724- if err := v.UnmarshalCBOR(cr); err != nil {
725725- return err
726726- }
730730+ {
731731+732732+ b, err := cr.ReadByte()
733733+ if err != nil {
734734+ return err
735735+ }
736736+ if b != cbg.CborNull[0] {
737737+ if err := cr.UnreadByte(); err != nil {
738738+ return err
739739+ }
740740+ t.Labels[i] = new(Label)
741741+ if err := t.Labels[i].UnmarshalCBOR(cr); err != nil {
742742+ return xerrors.Errorf("unmarshaling t.Labels[i] pointer: %w", err)
743743+ }
744744+ }
727745728728- t.Labels[i] = &v
746746+ }
747747+ }
729748 }
730749731750 default: