Monorepo for Tangled
tangled.org
1// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
3package tangled
4
5// schema: sh.tangled.ci.queryPipelines
6
7import (
8 "context"
9
10 "github.com/bluesky-social/indigo/lex/util"
11)
12
13const (
14 CiQueryPipelinesNSID = "sh.tangled.ci.queryPipelines"
15)
16
17// CiQueryPipelines_Output is the output of a sh.tangled.ci.queryPipelines call.
18type CiQueryPipelines_Output struct {
19 Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
20 Pipelines []*CiDefs_Pipeline `json:"pipelines" cborgen:"pipelines"`
21 // total: Maximum number of pipelines
22 Total int64 `json:"total" cborgen:"total"`
23}
24
25// CiQueryPipelines calls the XRPC method "sh.tangled.ci.queryPipelines".
26//
27// commits: Filter pipelines by commits. When provided, maximum one pipeline per commit id will be returned.
28// cursor: Pagination cursor
29// limit: Maximum number of pipelines to return
30// repo: DID of the repository
31func CiQueryPipelines(ctx context.Context, c util.LexClient, commits []string, cursor string, limit int64, repo string) (*CiQueryPipelines_Output, error) {
32 var out CiQueryPipelines_Output
33
34 params := map[string]interface{}{}
35 if len(commits) != 0 {
36 params["commits"] = commits
37 }
38 if cursor != "" {
39 params["cursor"] = cursor
40 }
41 if limit != 0 {
42 params["limit"] = limit
43 }
44 params["repo"] = repo
45 if err := c.LexDo(ctx, util.Query, "", "sh.tangled.ci.queryPipelines", params, nil, &out); err != nil {
46 return nil, err
47 }
48
49 return &out, nil
50}