~james/core

core/api/tangled/gittemp2getCommitStats.go -rw-r--r-- 1.4 KiB
452f17b7 — james chore(import): snapshot james.dad.town/core at f70c71c7696a 16 hours ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.

package tangled

// schema: sh.tangled.git.temp2.getCommitStats

import (
	"context"

	"github.com/bluesky-social/indigo/lex/util"
)

const (
	GitTemp2GetCommitStatsNSID = "sh.tangled.git.temp2.getCommitStats"
)

// GitTemp2GetCommitStats_Month is a "month" in the sh.tangled.git.temp2.getCommitStats schema.
type GitTemp2GetCommitStats_Month struct {
	// commits: Commits attributed to the actor during this month.
	Commits int64 `json:"commits" cborgen:"commits"`
	// start: Start of this UTC calendar month.
	Start string `json:"start" cborgen:"start"`
}

// GitTemp2GetCommitStats_Output is the output of a sh.tangled.git.temp2.getCommitStats call.
type GitTemp2GetCommitStats_Output struct {
	Months []*GitTemp2GetCommitStats_Month `json:"months" cborgen:"months"`
}

// GitTemp2GetCommitStats calls the XRPC method "sh.tangled.git.temp2.getCommitStats".
//
// actor: Actor whose commits to count.
func GitTemp2GetCommitStats(ctx context.Context, c util.LexClient, actor string, months int64) (*GitTemp2GetCommitStats_Output, error) {
	var out GitTemp2GetCommitStats_Output

	params := map[string]interface{}{}
	params["actor"] = actor
	if months != 0 {
		params["months"] = months
	}
	if err := c.LexDo(ctx, util.Query, "", "sh.tangled.git.temp2.getCommitStats", params, nil, &out); err != nil {
		return nil, err
	}

	return &out, nil
}