~james/core

core/api/org_tangled/temprepogetRepoByName.go -rw-r--r-- 2.1 KiB
452f17b7 — james chore(import): snapshot james.dad.town/core at f70c71c7696a 15 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
47
48
49
50
51
52
53
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.

package org_tangled

// schema: org.tangled.temp.repo.getRepoByName

import (
	"context"

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

const (
	TempRepoGetRepoByNameNSID = "org.tangled.temp.repo.getRepoByName"
)

// TempRepoGetRepoByName_GitInfo is a "gitInfo" in the org.tangled.temp.repo.getRepoByName schema.
type TempRepoGetRepoByName_GitInfo struct {
	// defaultBranch: Default branch name from `org.tangled.git.refs/self` record.
	DefaultBranch string `json:"defaultBranch" cborgen:"defaultBranch"`
	// isEmpty: True if `refs` in `org.tangled.git.refs/self` record is empty.
	IsEmpty bool `json:"isEmpty" cborgen:"isEmpty"`
	// languages: Languages on the default branch ordered by size, largest first. Absent until the mirror has indexed the repo.
	Languages []*RepoDefs_Language `json:"languages,omitempty" cborgen:"languages,omitempty"`
}

// TempRepoGetRepoByName_Output is the output of a org.tangled.temp.repo.getRepoByName call.
type TempRepoGetRepoByName_Output struct {
	Cid *string                        `json:"cid,omitempty" cborgen:"cid,omitempty"`
	Git *TempRepoGetRepoByName_GitInfo `json:"git,omitempty" cborgen:"git,omitempty"`
	// knot: Host of the knot named by the #tangled_knot service in the repo's DID document. Absent when it names none.
	Knot *string `json:"knot,omitempty" cborgen:"knot,omitempty"`
	Uri  string  `json:"uri" cborgen:"uri"`
	// value: Embedded org.tangled.repo.manifest record.
	Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"`
}

// TempRepoGetRepoByName calls the XRPC method "org.tangled.temp.repo.getRepoByName".
//
// name: Name of the repo as it appears in its url.
// owner: DID of the account that owns the repo.
func TempRepoGetRepoByName(ctx context.Context, c util.LexClient, name string, owner string) (*TempRepoGetRepoByName_Output, error) {
	var out TempRepoGetRepoByName_Output

	params := map[string]interface{}{}
	params["name"] = name
	params["owner"] = owner
	if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.repo.getRepoByName", params, nil, &out); err != nil {
		return nil, err
	}

	return &out, nil
}