~james/core

core/api/org_tangled/ciqueryPipelines.go -rw-r--r-- 1.6 KiB
452f17b7 — james chore(import): snapshot james.dad.town/core at f70c71c7696a 15 hours ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.

package org_tangled

// schema: org.tangled.ci.queryPipelines

import (
	"context"

	"github.com/bluesky-social/indigo/lex/util"
)

const (
	CiQueryPipelinesNSID = "org.tangled.ci.queryPipelines"
)

// CiQueryPipelines_Output is the output of a org.tangled.ci.queryPipelines call.
type CiQueryPipelines_Output struct {
	Cursor    *string            `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
	Pipelines []*CiDefs_Pipeline `json:"pipelines" cborgen:"pipelines"`
	// total: Number of matching pipelines
	Total int64 `json:"total" cborgen:"total"`
}

// CiQueryPipelines calls the XRPC method "org.tangled.ci.queryPipelines".
//
// commits: Filter pipelines by commit ids.
// cursor: Pagination cursor
// limit: Maximum number of pipelines to return
// repo: DID of the repository
// triggers: Filter pipelines by trigger kind. When provided, pipelines matching any listed kind are returned; when omitted, every kind is returned.
func CiQueryPipelines(ctx context.Context, c util.LexClient, commits []string, cursor string, limit int64, repo string, triggers []string) (*CiQueryPipelines_Output, error) {
	var out CiQueryPipelines_Output

	params := map[string]interface{}{}
	if len(commits) != 0 {
		params["commits"] = commits
	}
	if cursor != "" {
		params["cursor"] = cursor
	}
	if limit != 0 {
		params["limit"] = limit
	}
	params["repo"] = repo
	if len(triggers) != 0 {
		params["triggers"] = triggers
	}
	if err := c.LexDo(ctx, util.Query, "", "org.tangled.ci.queryPipelines", params, nil, &out); err != nil {
		return nil, err
	}

	return &out, nil
}