lexicons: add xrpc lexicon to set default branch #346

merged
opened by oppi.li targeting master from push-nozqtwvsrvkx
Changed files
+59
api
lexicons
+30
api/tangled/reposetDefaultBranch.go
···
···
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
+
+
package tangled
+
+
// schema: sh.tangled.repo.setDefaultBranch
+
+
import (
+
"context"
+
+
"github.com/bluesky-social/indigo/lex/util"
+
)
+
+
const (
+
RepoSetDefaultBranchNSID = "sh.tangled.repo.setDefaultBranch"
+
)
+
+
// RepoSetDefaultBranch_Input is the input argument to a sh.tangled.repo.setDefaultBranch call.
+
type RepoSetDefaultBranch_Input struct {
+
DefaultBranch string `json:"defaultBranch" cborgen:"defaultBranch"`
+
Repo string `json:"repo" cborgen:"repo"`
+
}
+
+
// RepoSetDefaultBranch calls the XRPC method "sh.tangled.repo.setDefaultBranch".
+
func RepoSetDefaultBranch(ctx context.Context, c util.LexClient, input *RepoSetDefaultBranch_Input) error {
+
if err := c.LexDo(ctx, util.Procedure, "application/json", "sh.tangled.repo.setDefaultBranch", nil, input, nil); err != nil {
+
return err
+
}
+
+
return nil
+
}
+29
lexicons/defaultBranch.json
···
···
+
{
+
"lexicon": 1,
+
"id": "sh.tangled.repo.setDefaultBranch",
+
"defs": {
+
"main": {
+
"type": "procedure",
+
"description": "Set the default branch for a repository",
+
"input": {
+
"encoding": "application/json",
+
"schema": {
+
"type": "object",
+
"required": [
+
"repo",
+
"defaultBranch"
+
],
+
"properties": {
+
"repo": {
+
"type": "string",
+
"format": "at-uri"
+
},
+
"defaultBranch": {
+
"type": "string"
+
}
+
}
+
}
+
}
+
}
+
}
+
}