feat: create a workspace from any template version (#9471)

This commit is contained in:
Kayla Washburn
2023-08-31 15:07:58 -06:00
committed by GitHub
parent 796a9754a9
commit eded7a4b88
8 changed files with 121 additions and 17 deletions

View File

@ -124,12 +124,16 @@ type CreateTemplateRequest struct {
}
// CreateWorkspaceRequest provides options for creating a new workspace.
// Either TemplateID or TemplateVersionID must be specified. They cannot both be present.
type CreateWorkspaceRequest struct {
TemplateID uuid.UUID `json:"template_id" validate:"required" format:"uuid"`
// TemplateID specifies which template should be used for creating the workspace.
TemplateID uuid.UUID `json:"template_id,omitempty" validate:"required_without=TemplateVersionID,excluded_with=TemplateVersionID" format:"uuid"`
// TemplateVersionID can be used to specify a specific version of a template for creating the workspace.
TemplateVersionID uuid.UUID `json:"template_version_id,omitempty" validate:"required_without=TemplateID,excluded_with=TemplateID" format:"uuid"`
Name string `json:"name" validate:"workspace_name,required"`
AutostartSchedule *string `json:"autostart_schedule"`
TTLMillis *int64 `json:"ttl_ms,omitempty"`
// ParameterValues allows for additional parameters to be provided
// RichParameterValues allows for additional parameters to be provided
// during the initial provision.
RichParameterValues []WorkspaceBuildParameter `json:"rich_parameter_values,omitempty"`
}