// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.

package tangled

// schema: sh.tangled.ci.pipeline.cancelPipeline

import (
	"context"

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

const (
	CiPipelineCancelPipelineNSID = "sh.tangled.ci.pipeline.cancelPipeline"
)

// CiPipelineCancelPipeline_Input is the input argument to a sh.tangled.ci.pipeline.cancelPipeline call.
type CiPipelineCancelPipeline_Input struct {
	// pipeline: pipeline TID
	Pipeline string `json:"pipeline" cborgen:"pipeline"`
	// repo: git repository DID
	Repo string `json:"repo" cborgen:"repo"`
	// workflows: Workflow names to filter. When not provided, entire pipeline will be canceled.
	Workflows []string `json:"workflows,omitempty" cborgen:"workflows,omitempty"`
}

// CiPipelineCancelPipeline calls the XRPC method "sh.tangled.ci.pipeline.cancelPipeline".
func CiPipelineCancelPipeline(ctx context.Context, c util.LexClient, input *CiPipelineCancelPipeline_Input) error {
	if err := c.LexDo(ctx, util.Procedure, "application/json", "sh.tangled.ci.pipeline.cancelPipeline", nil, input, nil); err != nil {
		return err
	}

	return nil
}
