// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
package org_tangled
// schema: org.tangled.temp.git.getRef
import (
"context"
"github.com/bluesky-social/indigo/lex/util"
)
const (
TempGitGetRefNSID = "org.tangled.temp.git.getRef"
)
// TempGitGetRef_Output is the output of a org.tangled.temp.git.getRef call.
type TempGitGetRef_Output struct {
// annotation: Present only for annotated tags
Annotation *TempGitListTags_Annotation `json:"annotation,omitempty" cborgen:"annotation,omitempty"`
Author *GitDefs_Signature `json:"author" cborgen:"author"`
// message: Latest commit message
Message string `json:"message" cborgen:"message"`
// name: Full reference name. Example: refs/heads/master
Name string `json:"name" cborgen:"name"`
// oid: Latest commit oid on this reference.
Oid string `json:"oid" cborgen:"oid"`
// totalCommits: Number of commits reachable from this tip
TotalCommits int64 `json:"totalCommits" cborgen:"totalCommits"`
}
// TempGitGetRef calls the XRPC method "org.tangled.temp.git.getRef".
//
// ref: Reference name. Such as master, refs/heads/master, or v1.16.0-alpha.
// repo: DID of the repository
func TempGitGetRef(ctx context.Context, c util.LexClient, ref string, repo string) (*TempGitGetRef_Output, error) {
var out TempGitGetRef_Output
params := map[string]interface{}{}
params["ref"] = ref
params["repo"] = repo
if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.git.getRef", params, nil, &out); err != nil {
return nil, err
}
return &out, nil
}