fix(site/src/api/typesGenerated): generate HealthSection enums (#11049)

Relates to #8971

- Introduces a codersdk.HealthSection enum type
- Refactors existing references using strings to use new HealthSection type
This commit is contained in:
Cian Johnston
2023-12-05 20:00:27 +00:00
committed by GitHub
parent f66e802fae
commit feaa9894a4
13 changed files with 149 additions and 73 deletions

View File

@ -8,12 +8,31 @@ import (
"golang.org/x/xerrors"
)
type HealthSection string
// If you add another const below, make sure to add it to HealthSections!
const (
HealthSectionDERP HealthSection = "DERP"
HealthSectionAccessURL HealthSection = "AccessURL"
HealthSectionWebsocket HealthSection = "Websocket"
HealthSectionDatabase HealthSection = "Database"
HealthSectionWorkspaceProxy HealthSection = "WorkspaceProxy"
)
var HealthSections = []HealthSection{
HealthSectionDERP,
HealthSectionAccessURL,
HealthSectionWebsocket,
HealthSectionDatabase,
HealthSectionWorkspaceProxy,
}
type HealthSettings struct {
DismissedHealthchecks []string `json:"dismissed_healthchecks"`
DismissedHealthchecks []HealthSection `json:"dismissed_healthchecks"`
}
type UpdateHealthSettings struct {
DismissedHealthchecks []string `json:"dismissed_healthchecks"`
DismissedHealthchecks []HealthSection `json:"dismissed_healthchecks"`
}
func (c *Client) HealthSettings(ctx context.Context) (HealthSettings, error) {