// 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
}