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

package tangled

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

import (
	"context"

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

const (
	CiPipelineTriggerPipelineNSID = "sh.tangled.ci.pipeline.triggerPipeline"
)

// CiPipelineTriggerPipeline_Input is the input argument to a sh.tangled.ci.pipeline.triggerPipeline call.
type CiPipelineTriggerPipeline_Input struct {
	// ref: optional ref the SHA was resolved from, for display
	Ref *string `json:"ref,omitempty" cborgen:"ref,omitempty"`
	// repo: AT-URI of the sh.tangled.repo record
	Repo string `json:"repo" cborgen:"repo"`
	// sha: commit SHA to run the pipeline at
	Sha string `json:"sha" cborgen:"sha"`
	// workflows: Workflow names to run. When not provided, every dispatchable workflow is run.
	Workflows []string `json:"workflows,omitempty" cborgen:"workflows,omitempty"`
}

// CiPipelineTriggerPipeline_Output is the output of a sh.tangled.ci.pipeline.triggerPipeline call.
type CiPipelineTriggerPipeline_Output struct {
	// pipeline: AT-URI of the created pipeline
	Pipeline string `json:"pipeline" cborgen:"pipeline"`
}

// CiPipelineTriggerPipeline calls the XRPC method "sh.tangled.ci.pipeline.triggerPipeline".
func CiPipelineTriggerPipeline(ctx context.Context, c util.LexClient, input *CiPipelineTriggerPipeline_Input) (*CiPipelineTriggerPipeline_Output, error) {
	var out CiPipelineTriggerPipeline_Output
	if err := c.LexDo(ctx, util.Procedure, "application/json", "sh.tangled.ci.pipeline.triggerPipeline", nil, input, &out); err != nil {
		return nil, err
	}

	return &out, nil
}
