forked from
tangled.org/core
Monorepo for Tangled
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 []*CiPipeline `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// kinds: Filter pipelines by trigger kind. When provided, pipelines matching any listed kind are returned; when omitted, every kind is returned.
30// limit: Maximum number of pipelines to return
31// repo: DID of the repository
32func CiQueryPipelines(ctx context.Context, c util.LexClient, commits []string, cursor string, kinds []string, limit int64, repo string) (*CiQueryPipelines_Output, error) {
33 var out CiQueryPipelines_Output
34
35 params := map[string]interface{}{}
36 if len(commits) != 0 {
37 params["commits"] = commits
38 }
39 if cursor != "" {
40 params["cursor"] = cursor
41 }
42 if len(kinds) != 0 {
43 params["kinds"] = kinds
44 }
45 if limit != 0 {
46 params["limit"] = limit
47 }
48 params["repo"] = repo
49 if err := c.LexDo(ctx, util.Query, "", "sh.tangled.ci.queryPipelines", params, nil, &out); err != nil {
50 return nil, err
51 }
52
53 return &out, nil
54}