feat: add template description (#1489)

This commit is contained in:
Colin Adler
2022-05-16 20:56:11 +00:00
committed by GitHub
parent b55d83ca82
commit e925818526
16 changed files with 57 additions and 23 deletions
+8 -4
View File
@@ -36,14 +36,18 @@ type CreateTemplateVersionRequest struct {
// CreateTemplateRequest provides options when creating a template.
type CreateTemplateRequest struct {
// Name is the name of the template.
Name string `json:"name" validate:"username,required"`
// Description is a description of what the template contains. It must be
// less than 128 bytes.
Description string `json:"description,omitempty" validate:"lt=128"`
// VersionID is an in-progress or completed job to use as
// an initial version of the template.
// VersionID is an in-progress or completed job to use as an initial version
// of the template.
//
// This is required on creation to enable a user-flow of validating a
// template works. There is no reason the data-model cannot support
// empty templates, but it doesn't make sense for users.
// template works. There is no reason the data-model cannot support empty
// templates, but it doesn't make sense for users.
VersionID uuid.UUID `json:"template_version_id" validate:"required"`
ParameterValues []CreateParameterRequest `json:"parameter_values,omitempty"`
}
+1
View File
@@ -23,6 +23,7 @@ type Template struct {
Provisioner database.ProvisionerType `json:"provisioner"`
ActiveVersionID uuid.UUID `json:"active_version_id"`
WorkspaceOwnerCount uint32 `json:"workspace_owner_count"`
Description string `json:"description"`
}
type UpdateActiveTemplateVersion struct {