1// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
3package tangled
4
5// schema: sh.tangled.repo.languages
6
7import (
8 "context"
9
10 "github.com/bluesky-social/indigo/lex/util"
11)
12
13const (
14 RepoLanguagesNSID = "sh.tangled.repo.languages"
15)
16
17// RepoLanguages_Language is a "language" in the sh.tangled.repo.languages schema.
18type RepoLanguages_Language struct {
19 // color: Hex color code for this language
20 Color *string `json:"color,omitempty" cborgen:"color,omitempty"`
21 // extensions: File extensions associated with this language
22 Extensions []string `json:"extensions,omitempty" cborgen:"extensions,omitempty"`
23 // fileCount: Number of files in this language
24 FileCount *int64 `json:"fileCount,omitempty" cborgen:"fileCount,omitempty"`
25 // name: Programming language name
26 Name string `json:"name" cborgen:"name"`
27 // percentage: Percentage of total codebase (0-100)
28 Percentage int64 `json:"percentage" cborgen:"percentage"`
29 // size: Total size of files in this language (bytes)
30 Size int64 `json:"size" cborgen:"size"`
31}
32
33// RepoLanguages_Output is the output of a sh.tangled.repo.languages call.
34type RepoLanguages_Output struct {
35 Languages []*RepoLanguages_Language `json:"languages" cborgen:"languages"`
36 // ref: The git reference used
37 Ref string `json:"ref" cborgen:"ref"`
38 // totalFiles: Total number of files analyzed
39 TotalFiles *int64 `json:"totalFiles,omitempty" cborgen:"totalFiles,omitempty"`
40 // totalSize: Total size of all analyzed files in bytes
41 TotalSize *int64 `json:"totalSize,omitempty" cborgen:"totalSize,omitempty"`
42}
43
44// RepoLanguages calls the XRPC method "sh.tangled.repo.languages".
45//
46// ref: Git reference (branch, tag, or commit SHA)
47// repo: Repository identifier in format 'did:plc:.../repoName'
48func RepoLanguages(ctx context.Context, c util.LexClient, ref string, repo string) (*RepoLanguages_Output, error) {
49 var out RepoLanguages_Output
50
51 params := map[string]interface{}{}
52 if ref != "" {
53 params["ref"] = ref
54 }
55 params["repo"] = repo
56 if err := c.LexDo(ctx, util.Query, "", "sh.tangled.repo.languages", params, nil, &out); err != nil {
57 return nil, err
58 }
59
60 return &out, nil
61}