From 628e503468b6e633e7662ce4f58c4d6867ed73c4 Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Fri, 25 Jul 2025 11:11:50 +0100 Subject: [PATCH] lexicons: add xrpc lexicon to set default branch Change-Id: tklpvvpnzsvtzxsrnwmzypwrtlwknpky Signed-off-by: oppiliappan --- api/tangled/reposetDefaultBranch.go | 30 +++++++++++++++++++++++++++++ lexicons/defaultBranch.json | 29 ++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 api/tangled/reposetDefaultBranch.go create mode 100644 lexicons/defaultBranch.json diff --git a/api/tangled/reposetDefaultBranch.go b/api/tangled/reposetDefaultBranch.go new file mode 100644 index 0000000..3373d9a --- /dev/null +++ b/api/tangled/reposetDefaultBranch.go @@ -0,0 +1,30 @@ +// 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 +} diff --git a/lexicons/defaultBranch.json b/lexicons/defaultBranch.json new file mode 100644 index 0000000..a0a4ae3 --- /dev/null +++ b/lexicons/defaultBranch.json @@ -0,0 +1,29 @@ +{ + "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" + } + } + } + } + } + } +} -- 2.43.0