···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+package atproto
44+55+// schema: com.atproto.server.reserveSigningKey
66+77+import (
88+ "context"
99+1010+ "github.com/bluesky-social/indigo/xrpc"
1111+)
1212+1313+// ServerReserveSigningKey_Input is the input argument to a com.atproto.server.reserveSigningKey call.
1414+type ServerReserveSigningKey_Input struct {
1515+ // did: The did to reserve a new did:key for
1616+ Did *string `json:"did,omitempty" cborgen:"did,omitempty"`
1717+}
1818+1919+// ServerReserveSigningKey_Output is the output of a com.atproto.server.reserveSigningKey call.
2020+type ServerReserveSigningKey_Output struct {
2121+ // signingKey: Public signing key in the form of a did:key.
2222+ SigningKey string `json:"signingKey" cborgen:"signingKey"`
2323+}
2424+2525+// ServerReserveSigningKey calls the XRPC method "com.atproto.server.reserveSigningKey".
2626+func ServerReserveSigningKey(ctx context.Context, c *xrpc.Client, input *ServerReserveSigningKey_Input) (*ServerReserveSigningKey_Output, error) {
2727+ var out ServerReserveSigningKey_Output
2828+ if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.server.reserveSigningKey", nil, input, &out); err != nil {
2929+ return nil, err
3030+ }
3131+3232+ return &out, nil
3333+}
+31
api/atproto/tempfetchLabels.go
···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+package atproto
44+55+// schema: com.atproto.temp.fetchLabels
66+77+import (
88+ "context"
99+1010+ "github.com/bluesky-social/indigo/xrpc"
1111+)
1212+1313+// TempFetchLabels_Output is the output of a com.atproto.temp.fetchLabels call.
1414+type TempFetchLabels_Output struct {
1515+ Labels []*LabelDefs_Label `json:"labels" cborgen:"labels"`
1616+}
1717+1818+// TempFetchLabels calls the XRPC method "com.atproto.temp.fetchLabels".
1919+func TempFetchLabels(ctx context.Context, c *xrpc.Client, limit int64, since int64) (*TempFetchLabels_Output, error) {
2020+ var out TempFetchLabels_Output
2121+2222+ params := map[string]interface{}{
2323+ "limit": limit,
2424+ "since": since,
2525+ }
2626+ if err := c.Do(ctx, xrpc.Query, "", "com.atproto.temp.fetchLabels", params, nil, &out); err != nil {
2727+ return nil, err
2828+ }
2929+3030+ return &out, nil
3131+}
···16771677 }
1678167816791679 cw := cbg.NewCborWriter(w)
16801680+ fieldCount := 3
1680168116811681- if _, err := cw.Write([]byte{162}); err != nil {
16821682+ if t.AspectRatio == nil {
16831683+ fieldCount--
16841684+ }
16851685+16861686+ if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
16821687 return err
16831688 }
16841689···17201725 if err := t.Image.MarshalCBOR(cw); err != nil {
17211726 return err
17221727 }
17281728+17291729+ // t.AspectRatio (bsky.EmbedImages_AspectRatio) (struct)
17301730+ if t.AspectRatio != nil {
17311731+17321732+ if len("aspectRatio") > cbg.MaxLength {
17331733+ return xerrors.Errorf("Value in field \"aspectRatio\" was too long")
17341734+ }
17351735+17361736+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("aspectRatio"))); err != nil {
17371737+ return err
17381738+ }
17391739+ if _, err := cw.WriteString(string("aspectRatio")); err != nil {
17401740+ return err
17411741+ }
17421742+17431743+ if err := t.AspectRatio.MarshalCBOR(cw); err != nil {
17441744+ return err
17451745+ }
17461746+ }
17231747 return nil
17241748}
17251749···17881812 t.Image = new(util.LexBlob)
17891813 if err := t.Image.UnmarshalCBOR(cr); err != nil {
17901814 return xerrors.Errorf("unmarshaling t.Image pointer: %w", err)
18151815+ }
18161816+ }
18171817+18181818+ }
18191819+ // t.AspectRatio (bsky.EmbedImages_AspectRatio) (struct)
18201820+ case "aspectRatio":
18211821+18221822+ {
18231823+18241824+ b, err := cr.ReadByte()
18251825+ if err != nil {
18261826+ return err
18271827+ }
18281828+ if b != cbg.CborNull[0] {
18291829+ if err := cr.UnreadByte(); err != nil {
18301830+ return err
18311831+ }
18321832+ t.AspectRatio = new(EmbedImages_AspectRatio)
18331833+ if err := t.AspectRatio.UnmarshalCBOR(cr); err != nil {
18341834+ return xerrors.Errorf("unmarshaling t.AspectRatio pointer: %w", err)
17911835 }
17921836 }
17931837···4752479647534797 return nil
47544798}
47994799+func (t *GraphListblock) MarshalCBOR(w io.Writer) error {
48004800+ if t == nil {
48014801+ _, err := w.Write(cbg.CborNull)
48024802+ return err
48034803+ }
48044804+48054805+ cw := cbg.NewCborWriter(w)
48064806+48074807+ if _, err := cw.Write([]byte{163}); err != nil {
48084808+ return err
48094809+ }
48104810+48114811+ // t.LexiconTypeID (string) (string)
48124812+ if len("$type") > cbg.MaxLength {
48134813+ return xerrors.Errorf("Value in field \"$type\" was too long")
48144814+ }
48154815+48164816+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
48174817+ return err
48184818+ }
48194819+ if _, err := cw.WriteString(string("$type")); err != nil {
48204820+ return err
48214821+ }
48224822+48234823+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("app.bsky.graph.listblock"))); err != nil {
48244824+ return err
48254825+ }
48264826+ if _, err := cw.WriteString(string("app.bsky.graph.listblock")); err != nil {
48274827+ return err
48284828+ }
48294829+48304830+ // t.Subject (string) (string)
48314831+ if len("subject") > cbg.MaxLength {
48324832+ return xerrors.Errorf("Value in field \"subject\" was too long")
48334833+ }
48344834+48354835+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("subject"))); err != nil {
48364836+ return err
48374837+ }
48384838+ if _, err := cw.WriteString(string("subject")); err != nil {
48394839+ return err
48404840+ }
48414841+48424842+ if len(t.Subject) > cbg.MaxLength {
48434843+ return xerrors.Errorf("Value in field t.Subject was too long")
48444844+ }
48454845+48464846+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Subject))); err != nil {
48474847+ return err
48484848+ }
48494849+ if _, err := cw.WriteString(string(t.Subject)); err != nil {
48504850+ return err
48514851+ }
48524852+48534853+ // t.CreatedAt (string) (string)
48544854+ if len("createdAt") > cbg.MaxLength {
48554855+ return xerrors.Errorf("Value in field \"createdAt\" was too long")
48564856+ }
48574857+48584858+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil {
48594859+ return err
48604860+ }
48614861+ if _, err := cw.WriteString(string("createdAt")); err != nil {
48624862+ return err
48634863+ }
48644864+48654865+ if len(t.CreatedAt) > cbg.MaxLength {
48664866+ return xerrors.Errorf("Value in field t.CreatedAt was too long")
48674867+ }
48684868+48694869+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil {
48704870+ return err
48714871+ }
48724872+ if _, err := cw.WriteString(string(t.CreatedAt)); err != nil {
48734873+ return err
48744874+ }
48754875+ return nil
48764876+}
48774877+48784878+func (t *GraphListblock) UnmarshalCBOR(r io.Reader) (err error) {
48794879+ *t = GraphListblock{}
48804880+48814881+ cr := cbg.NewCborReader(r)
48824882+48834883+ maj, extra, err := cr.ReadHeader()
48844884+ if err != nil {
48854885+ return err
48864886+ }
48874887+ defer func() {
48884888+ if err == io.EOF {
48894889+ err = io.ErrUnexpectedEOF
48904890+ }
48914891+ }()
48924892+48934893+ if maj != cbg.MajMap {
48944894+ return fmt.Errorf("cbor input should be of type map")
48954895+ }
48964896+48974897+ if extra > cbg.MaxLength {
48984898+ return fmt.Errorf("GraphListblock: map struct too large (%d)", extra)
48994899+ }
49004900+49014901+ var name string
49024902+ n := extra
49034903+49044904+ for i := uint64(0); i < n; i++ {
49054905+49064906+ {
49074907+ sval, err := cbg.ReadString(cr)
49084908+ if err != nil {
49094909+ return err
49104910+ }
49114911+49124912+ name = string(sval)
49134913+ }
49144914+49154915+ switch name {
49164916+ // t.LexiconTypeID (string) (string)
49174917+ case "$type":
49184918+49194919+ {
49204920+ sval, err := cbg.ReadString(cr)
49214921+ if err != nil {
49224922+ return err
49234923+ }
49244924+49254925+ t.LexiconTypeID = string(sval)
49264926+ }
49274927+ // t.Subject (string) (string)
49284928+ case "subject":
49294929+49304930+ {
49314931+ sval, err := cbg.ReadString(cr)
49324932+ if err != nil {
49334933+ return err
49344934+ }
49354935+49364936+ t.Subject = string(sval)
49374937+ }
49384938+ // t.CreatedAt (string) (string)
49394939+ case "createdAt":
49404940+49414941+ {
49424942+ sval, err := cbg.ReadString(cr)
49434943+ if err != nil {
49444944+ return err
49454945+ }
49464946+49474947+ t.CreatedAt = string(sval)
49484948+ }
49494949+49504950+ default:
49514951+ // Field doesn't exist on this type, so ignore it
49524952+ cbg.ScanForLinks(r, func(cid.Cid) {})
49534953+ }
49544954+ }
49554955+49564956+ return nil
49574957+}
49584958+func (t *EmbedImages_AspectRatio) MarshalCBOR(w io.Writer) error {
49594959+ if t == nil {
49604960+ _, err := w.Write(cbg.CborNull)
49614961+ return err
49624962+ }
49634963+49644964+ cw := cbg.NewCborWriter(w)
49654965+49664966+ if _, err := cw.Write([]byte{162}); err != nil {
49674967+ return err
49684968+ }
49694969+49704970+ // t.Width (int64) (int64)
49714971+ if len("width") > cbg.MaxLength {
49724972+ return xerrors.Errorf("Value in field \"width\" was too long")
49734973+ }
49744974+49754975+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("width"))); err != nil {
49764976+ return err
49774977+ }
49784978+ if _, err := cw.WriteString(string("width")); err != nil {
49794979+ return err
49804980+ }
49814981+49824982+ if t.Width >= 0 {
49834983+ if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Width)); err != nil {
49844984+ return err
49854985+ }
49864986+ } else {
49874987+ if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Width-1)); err != nil {
49884988+ return err
49894989+ }
49904990+ }
49914991+49924992+ // t.Height (int64) (int64)
49934993+ if len("height") > cbg.MaxLength {
49944994+ return xerrors.Errorf("Value in field \"height\" was too long")
49954995+ }
49964996+49974997+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("height"))); err != nil {
49984998+ return err
49994999+ }
50005000+ if _, err := cw.WriteString(string("height")); err != nil {
50015001+ return err
50025002+ }
50035003+50045004+ if t.Height >= 0 {
50055005+ if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Height)); err != nil {
50065006+ return err
50075007+ }
50085008+ } else {
50095009+ if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Height-1)); err != nil {
50105010+ return err
50115011+ }
50125012+ }
50135013+ return nil
50145014+}
50155015+50165016+func (t *EmbedImages_AspectRatio) UnmarshalCBOR(r io.Reader) (err error) {
50175017+ *t = EmbedImages_AspectRatio{}
50185018+50195019+ cr := cbg.NewCborReader(r)
50205020+50215021+ maj, extra, err := cr.ReadHeader()
50225022+ if err != nil {
50235023+ return err
50245024+ }
50255025+ defer func() {
50265026+ if err == io.EOF {
50275027+ err = io.ErrUnexpectedEOF
50285028+ }
50295029+ }()
50305030+50315031+ if maj != cbg.MajMap {
50325032+ return fmt.Errorf("cbor input should be of type map")
50335033+ }
50345034+50355035+ if extra > cbg.MaxLength {
50365036+ return fmt.Errorf("EmbedImages_AspectRatio: map struct too large (%d)", extra)
50375037+ }
50385038+50395039+ var name string
50405040+ n := extra
50415041+50425042+ for i := uint64(0); i < n; i++ {
50435043+50445044+ {
50455045+ sval, err := cbg.ReadString(cr)
50465046+ if err != nil {
50475047+ return err
50485048+ }
50495049+50505050+ name = string(sval)
50515051+ }
50525052+50535053+ switch name {
50545054+ // t.Width (int64) (int64)
50555055+ case "width":
50565056+ {
50575057+ maj, extra, err := cr.ReadHeader()
50585058+ var extraI int64
50595059+ if err != nil {
50605060+ return err
50615061+ }
50625062+ switch maj {
50635063+ case cbg.MajUnsignedInt:
50645064+ extraI = int64(extra)
50655065+ if extraI < 0 {
50665066+ return fmt.Errorf("int64 positive overflow")
50675067+ }
50685068+ case cbg.MajNegativeInt:
50695069+ extraI = int64(extra)
50705070+ if extraI < 0 {
50715071+ return fmt.Errorf("int64 negative overflow")
50725072+ }
50735073+ extraI = -1 - extraI
50745074+ default:
50755075+ return fmt.Errorf("wrong type for int64 field: %d", maj)
50765076+ }
50775077+50785078+ t.Width = int64(extraI)
50795079+ }
50805080+ // t.Height (int64) (int64)
50815081+ case "height":
50825082+ {
50835083+ maj, extra, err := cr.ReadHeader()
50845084+ var extraI int64
50855085+ if err != nil {
50865086+ return err
50875087+ }
50885088+ switch maj {
50895089+ case cbg.MajUnsignedInt:
50905090+ extraI = int64(extra)
50915091+ if extraI < 0 {
50925092+ return fmt.Errorf("int64 positive overflow")
50935093+ }
50945094+ case cbg.MajNegativeInt:
50955095+ extraI = int64(extra)
50965096+ if extraI < 0 {
50975097+ return fmt.Errorf("int64 negative overflow")
50985098+ }
50995099+ extraI = -1 - extraI
51005100+ default:
51015101+ return fmt.Errorf("wrong type for int64 field: %d", maj)
51025102+ }
51035103+51045104+ t.Height = int64(extraI)
51055105+ }
51065106+51075107+ default:
51085108+ // Field doesn't exist on this type, so ignore it
51095109+ cbg.ScanForLinks(r, func(cid.Cid) {})
51105110+ }
51115111+ }
51125112+51135113+ return nil
51145114+}
+15-5
api/bsky/embedimages.go
···1717 Images []*EmbedImages_Image `json:"images" cborgen:"images"`
1818}
19192020+// EmbedImages_AspectRatio is a "aspectRatio" in the app.bsky.embed.images schema.
2121+//
2222+// width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit.
2323+type EmbedImages_AspectRatio struct {
2424+ Height int64 `json:"height" cborgen:"height"`
2525+ Width int64 `json:"width" cborgen:"width"`
2626+}
2727+2028// EmbedImages_Image is a "image" in the app.bsky.embed.images schema.
2129type EmbedImages_Image struct {
2222- Alt string `json:"alt" cborgen:"alt"`
2323- Image *util.LexBlob `json:"image" cborgen:"image"`
3030+ Alt string `json:"alt" cborgen:"alt"`
3131+ AspectRatio *EmbedImages_AspectRatio `json:"aspectRatio,omitempty" cborgen:"aspectRatio,omitempty"`
3232+ Image *util.LexBlob `json:"image" cborgen:"image"`
2433}
25342635// EmbedImages_View is a "view" in the app.bsky.embed.images schema.
···33423443// EmbedImages_ViewImage is a "viewImage" in the app.bsky.embed.images schema.
3544type EmbedImages_ViewImage struct {
3636- Alt string `json:"alt" cborgen:"alt"`
3737- Fullsize string `json:"fullsize" cborgen:"fullsize"`
3838- Thumb string `json:"thumb" cborgen:"thumb"`
4545+ Alt string `json:"alt" cborgen:"alt"`
4646+ AspectRatio *EmbedImages_AspectRatio `json:"aspectRatio,omitempty" cborgen:"aspectRatio,omitempty"`
4747+ Fullsize string `json:"fullsize" cborgen:"fullsize"`
4848+ Thumb string `json:"thumb" cborgen:"thumb"`
3949}