···8508850885098509 return nil
85108510}
85118511+func (t *GraphVerification) MarshalCBOR(w io.Writer) error {
85128512+ if t == nil {
85138513+ _, err := w.Write(cbg.CborNull)
85148514+ return err
85158515+ }
85168516+85178517+ cw := cbg.NewCborWriter(w)
85188518+85198519+ if _, err := cw.Write([]byte{165}); err != nil {
85208520+ return err
85218521+ }
85228522+85238523+ // t.LexiconTypeID (string) (string)
85248524+ if len("$type") > 1000000 {
85258525+ return xerrors.Errorf("Value in field \"$type\" was too long")
85268526+ }
85278527+85288528+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
85298529+ return err
85308530+ }
85318531+ if _, err := cw.WriteString(string("$type")); err != nil {
85328532+ return err
85338533+ }
85348534+85358535+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("app.bsky.graph.verification"))); err != nil {
85368536+ return err
85378537+ }
85388538+ if _, err := cw.WriteString(string("app.bsky.graph.verification")); err != nil {
85398539+ return err
85408540+ }
85418541+85428542+ // t.Handle (string) (string)
85438543+ if len("handle") > 1000000 {
85448544+ return xerrors.Errorf("Value in field \"handle\" was too long")
85458545+ }
85468546+85478547+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("handle"))); err != nil {
85488548+ return err
85498549+ }
85508550+ if _, err := cw.WriteString(string("handle")); err != nil {
85518551+ return err
85528552+ }
85538553+85548554+ if len(t.Handle) > 1000000 {
85558555+ return xerrors.Errorf("Value in field t.Handle was too long")
85568556+ }
85578557+85588558+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Handle))); err != nil {
85598559+ return err
85608560+ }
85618561+ if _, err := cw.WriteString(string(t.Handle)); err != nil {
85628562+ return err
85638563+ }
85648564+85658565+ // t.Subject (string) (string)
85668566+ if len("subject") > 1000000 {
85678567+ return xerrors.Errorf("Value in field \"subject\" was too long")
85688568+ }
85698569+85708570+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("subject"))); err != nil {
85718571+ return err
85728572+ }
85738573+ if _, err := cw.WriteString(string("subject")); err != nil {
85748574+ return err
85758575+ }
85768576+85778577+ if len(t.Subject) > 1000000 {
85788578+ return xerrors.Errorf("Value in field t.Subject was too long")
85798579+ }
85808580+85818581+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Subject))); err != nil {
85828582+ return err
85838583+ }
85848584+ if _, err := cw.WriteString(string(t.Subject)); err != nil {
85858585+ return err
85868586+ }
85878587+85888588+ // t.CreatedAt (string) (string)
85898589+ if len("createdAt") > 1000000 {
85908590+ return xerrors.Errorf("Value in field \"createdAt\" was too long")
85918591+ }
85928592+85938593+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil {
85948594+ return err
85958595+ }
85968596+ if _, err := cw.WriteString(string("createdAt")); err != nil {
85978597+ return err
85988598+ }
85998599+86008600+ if len(t.CreatedAt) > 1000000 {
86018601+ return xerrors.Errorf("Value in field t.CreatedAt was too long")
86028602+ }
86038603+86048604+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil {
86058605+ return err
86068606+ }
86078607+ if _, err := cw.WriteString(string(t.CreatedAt)); err != nil {
86088608+ return err
86098609+ }
86108610+86118611+ // t.DisplayName (string) (string)
86128612+ if len("displayName") > 1000000 {
86138613+ return xerrors.Errorf("Value in field \"displayName\" was too long")
86148614+ }
86158615+86168616+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("displayName"))); err != nil {
86178617+ return err
86188618+ }
86198619+ if _, err := cw.WriteString(string("displayName")); err != nil {
86208620+ return err
86218621+ }
86228622+86238623+ if len(t.DisplayName) > 1000000 {
86248624+ return xerrors.Errorf("Value in field t.DisplayName was too long")
86258625+ }
86268626+86278627+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.DisplayName))); err != nil {
86288628+ return err
86298629+ }
86308630+ if _, err := cw.WriteString(string(t.DisplayName)); err != nil {
86318631+ return err
86328632+ }
86338633+ return nil
86348634+}
86358635+86368636+func (t *GraphVerification) UnmarshalCBOR(r io.Reader) (err error) {
86378637+ *t = GraphVerification{}
86388638+86398639+ cr := cbg.NewCborReader(r)
86408640+86418641+ maj, extra, err := cr.ReadHeader()
86428642+ if err != nil {
86438643+ return err
86448644+ }
86458645+ defer func() {
86468646+ if err == io.EOF {
86478647+ err = io.ErrUnexpectedEOF
86488648+ }
86498649+ }()
86508650+86518651+ if maj != cbg.MajMap {
86528652+ return fmt.Errorf("cbor input should be of type map")
86538653+ }
86548654+86558655+ if extra > cbg.MaxLength {
86568656+ return fmt.Errorf("GraphVerification: map struct too large (%d)", extra)
86578657+ }
86588658+86598659+ n := extra
86608660+86618661+ nameBuf := make([]byte, 11)
86628662+ for i := uint64(0); i < n; i++ {
86638663+ nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
86648664+ if err != nil {
86658665+ return err
86668666+ }
86678667+86688668+ if !ok {
86698669+ // Field doesn't exist on this type, so ignore it
86708670+ if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil {
86718671+ return err
86728672+ }
86738673+ continue
86748674+ }
86758675+86768676+ switch string(nameBuf[:nameLen]) {
86778677+ // t.LexiconTypeID (string) (string)
86788678+ case "$type":
86798679+86808680+ {
86818681+ sval, err := cbg.ReadStringWithMax(cr, 1000000)
86828682+ if err != nil {
86838683+ return err
86848684+ }
86858685+86868686+ t.LexiconTypeID = string(sval)
86878687+ }
86888688+ // t.Handle (string) (string)
86898689+ case "handle":
86908690+86918691+ {
86928692+ sval, err := cbg.ReadStringWithMax(cr, 1000000)
86938693+ if err != nil {
86948694+ return err
86958695+ }
86968696+86978697+ t.Handle = string(sval)
86988698+ }
86998699+ // t.Subject (string) (string)
87008700+ case "subject":
87018701+87028702+ {
87038703+ sval, err := cbg.ReadStringWithMax(cr, 1000000)
87048704+ if err != nil {
87058705+ return err
87068706+ }
87078707+87088708+ t.Subject = string(sval)
87098709+ }
87108710+ // t.CreatedAt (string) (string)
87118711+ case "createdAt":
87128712+87138713+ {
87148714+ sval, err := cbg.ReadStringWithMax(cr, 1000000)
87158715+ if err != nil {
87168716+ return err
87178717+ }
87188718+87198719+ t.CreatedAt = string(sval)
87208720+ }
87218721+ // t.DisplayName (string) (string)
87228722+ case "displayName":
87238723+87248724+ {
87258725+ sval, err := cbg.ReadStringWithMax(cr, 1000000)
87268726+ if err != nil {
87278727+ return err
87288728+ }
87298729+87308730+ t.DisplayName = string(sval)
87318731+ }
87328732+87338733+ default:
87348734+ // Field doesn't exist on this type, so ignore it
87358735+ if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil {
87368736+ return err
87378737+ }
87388738+ }
87398739+ }
87408740+87418741+ return nil
87428742+}
+25
api/bsky/graphverification.go
···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+package bsky
44+55+// schema: app.bsky.graph.verification
66+77+import (
88+ "github.com/bluesky-social/indigo/lex/util"
99+)
1010+1111+func init() {
1212+ util.RegisterType("app.bsky.graph.verification", &GraphVerification{})
1313+} //
1414+// RECORDTYPE: GraphVerification
1515+type GraphVerification struct {
1616+ LexiconTypeID string `json:"$type,const=app.bsky.graph.verification" cborgen:"$type,const=app.bsky.graph.verification"`
1717+ // createdAt: Date of when the verification was created.
1818+ CreatedAt string `json:"createdAt" cborgen:"createdAt"`
1919+ // displayName: Display name of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current displayName matches the one at the time of verifying.
2020+ DisplayName string `json:"displayName" cborgen:"displayName"`
2121+ // handle: Handle of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current handle matches the one at the time of verifying.
2222+ Handle string `json:"handle" cborgen:"handle"`
2323+ // subject: DID of the subject the verification applies to.
2424+ Subject string `json:"subject" cborgen:"subject"`
2525+}