This repository has no description
1// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
3package tangled
4
5// schema: sh.tangled.repo.checkPushAllowed
6
7import (
8 "context"
9
10 "github.com/bluesky-social/indigo/lex/util"
11)
12
13const (
14 RepoCheckPushAllowedNSID = "sh.tangled.repo.checkPushAllowed"
15)
16
17// RepoCheckPushAllowed_Output is the output of a sh.tangled.repo.checkPushAllowed call.
18type RepoCheckPushAllowed_Output struct {
19 // allowed: Whether the key's owner may push to the repo.
20 Allowed bool `json:"allowed" cborgen:"allowed"`
21 // did: DID the key resolved to, if a match was found.
22 Did *string `json:"did,omitempty" cborgen:"did,omitempty"`
23}
24
25// RepoCheckPushAllowed calls the XRPC method "sh.tangled.repo.checkPushAllowed".
26//
27// key: Public key in OpenSSH authorized_keys format.
28// repo: A repo DID.
29func RepoCheckPushAllowed(ctx context.Context, c util.LexClient, key string, repo string) (*RepoCheckPushAllowed_Output, error) {
30 var out RepoCheckPushAllowed_Output
31
32 params := map[string]interface{}{}
33 params["key"] = key
34 params["repo"] = repo
35 if err := c.LexDo(ctx, util.Query, "", "sh.tangled.repo.checkPushAllowed", params, nil, &out); err != nil {
36 return nil, err
37 }
38
39 return &out, nil
40}