// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. package org_tangled // schema: org.tangled.git.listBranches import ( "context" "github.com/bluesky-social/indigo/lex/util" ) const ( GitListBranchesNSID = "org.tangled.git.listBranches" ) // GitListBranches_BranchInfo is a "branchInfo" in the org.tangled.git.listBranches schema. type GitListBranches_BranchInfo struct { Author *GitDefs_Signature `json:"author" cborgen:"author"` Committer *GitDefs_Signature `json:"committer" cborgen:"committer"` // message: Latest commit message Message string `json:"message" cborgen:"message"` // name: Branch name Name string `json:"name" cborgen:"name"` // oid: Latest commit oid on this branch Oid string `json:"oid" cborgen:"oid"` } // GitListBranches_Output is the output of a org.tangled.git.listBranches call. type GitListBranches_Output struct { Branches []*GitListBranches_BranchInfo `json:"branches" cborgen:"branches"` Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` // defaultBranch: Name of the default branch DefaultBranch *string `json:"defaultBranch,omitempty" cborgen:"defaultBranch,omitempty"` // total: Total number of branches in the repository Total int64 `json:"total" cborgen:"total"` } // GitListBranches calls the XRPC method "org.tangled.git.listBranches". // // cursor: Pagination cursor // limit: Maximum number of branches to return // repo: DID of the repository func GitListBranches(ctx context.Context, c util.LexClient, cursor string, limit int64, repo string) (*GitListBranches_Output, error) { var out GitListBranches_Output params := map[string]interface{}{} if cursor != "" { params["cursor"] = cursor } if limit != 0 { params["limit"] = limit } params["repo"] = repo if err := c.LexDo(ctx, util.Query, "", "org.tangled.git.listBranches", params, nil, &out); err != nil { return nil, err } return &out, nil }