chore: remove coder/preview dependency from codersdk (#17939)

This commit is contained in:
Steven Masley
2025-05-20 10:45:12 -05:00
committed by GitHub
parent e76d58f2b6
commit a123900fe8
11 changed files with 292 additions and 87 deletions

View File

@ -9,8 +9,6 @@ import (
"time"
"github.com/google/uuid"
previewtypes "github.com/coder/preview/types"
)
type TemplateVersionWarning string
@ -125,20 +123,6 @@ func (c *Client) CancelTemplateVersion(ctx context.Context, version uuid.UUID) e
return nil
}
type DynamicParametersRequest struct {
// ID identifies the request. The response contains the same
// ID so that the client can match it to the request.
ID int `json:"id"`
Inputs map[string]string `json:"inputs"`
}
type DynamicParametersResponse struct {
ID int `json:"id"`
Diagnostics previewtypes.Diagnostics `json:"diagnostics"`
Parameters []previewtypes.Parameter `json:"parameters"`
// TODO: Workspace tags
}
// TemplateVersionParameters returns parameters a template version exposes.
func (c *Client) TemplateVersionRichParameters(ctx context.Context, version uuid.UUID) ([]TemplateVersionParameter, error) {
res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/templateversions/%s/rich-parameters", version), nil)