···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+package tangled
44+55+// schema: sh.tangled.git.listRefs
66+77+import (
88+ "context"
99+1010+ "github.com/bluesky-social/indigo/lex/util"
1111+)
1212+1313+const (
1414+ GitListRefsNSID = "sh.tangled.git.listRefs"
1515+)
1616+1717+// GitListRefs_DefaultBranch is a "defaultBranch" in the sh.tangled.git.listRefs schema.
1818+type GitListRefs_DefaultBranch struct {
1919+ // head: Commit SHA at the tip of the default branch, for reconciling against a last-known state. Width depends on the repo's git object-format.
2020+ Head *string `json:"head,omitempty" cborgen:"head,omitempty"`
2121+ // ref: Default branch ref name that HEAD points at, eg. refs/heads/main.
2222+ Ref string `json:"ref" cborgen:"ref"`
2323+}
2424+2525+// GitListRefs_Output is the output of a sh.tangled.git.listRefs call.
2626+type GitListRefs_Output struct {
2727+ // cursor: Cursor for the next page, absent when the last page is reached
2828+ Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
2929+ DefaultBranch *GitListRefs_DefaultBranch `json:"defaultBranch,omitempty" cborgen:"defaultBranch,omitempty"`
3030+ Refs []*GitListRefs_Ref `json:"refs" cborgen:"refs"`
3131+}
3232+3333+// GitListRefs_Ref is a "ref" in the sh.tangled.git.listRefs schema.
3434+type GitListRefs_Ref struct {
3535+ // ref: Full ref name, eg. refs/heads/main or refs/tags/v1.0
3636+ Ref string `json:"ref" cborgen:"ref"`
3737+ // sha: Object SHA the ref points at. Width depends on the repo's git object-format.
3838+ Sha string `json:"sha" cborgen:"sha"`
3939+}
4040+4141+// GitListRefs calls the XRPC method "sh.tangled.git.listRefs".
4242+//
4343+// cursor: Pagination cursor
4444+// limit: Maximum number of refs to return in this page
4545+// repo: DID of the git repo as minted by the knot
4646+func GitListRefs(ctx context.Context, c util.LexClient, cursor string, limit int64, repo string) (*GitListRefs_Output, error) {
4747+ var out GitListRefs_Output
4848+4949+ params := map[string]interface{}{}
5050+ if cursor != "" {
5151+ params["cursor"] = cursor
5252+ }
5353+ if limit != 0 {
5454+ params["limit"] = limit
5555+ }
5656+ params["repo"] = repo
5757+ if err := c.LexDo(ctx, util.Query, "", "sh.tangled.git.listRefs", params, nil, &out); err != nil {
5858+ return nil, err
5959+ }
6060+6161+ return &out, nil
6262+}