Skip to content

Commit 511be13

Browse files
committed
add sdk types
1 parent 79c761e commit 511be13

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

codersdk/workspaceapps.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import (
44
"github.com/google/uuid"
55
)
66

7-
// type WorkspaceAppHealth string
7+
type WorkspaceAppHealth string
88

9-
// const (
10-
// WorkspaceAppHealthInitializing = "initializing"
11-
// WorkspaceAppHealthHealthy = "healthy"
12-
// WorkspaceAppHealthUnhealthy = "unhealthy"
13-
// )
9+
const (
10+
WorkspaceAppInitializing WorkspaceAppHealth = "initializing"
11+
WorkspaceAppHealthy WorkspaceAppHealth = "healthy"
12+
WorkspaceAppUnhealthy WorkspaceAppHealth = "unhealthy"
13+
)
1414

1515
type WorkspaceApp struct {
1616
ID uuid.UUID `json:"id"`
@@ -19,6 +19,6 @@ type WorkspaceApp struct {
1919
Command string `json:"command,omitempty"`
2020
// Icon is a relative path or external URL that specifies
2121
// an icon to be displayed in the dashboard.
22-
Icon string `json:"icon,omitempty"`
23-
// Status WorkspaceAppHealth `json:"health"`
22+
Icon string `json:"icon,omitempty"`
23+
Status WorkspaceAppHealth `json:"health"`
2424
}

site/src/api/typesGenerated.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,7 @@ export interface WorkspaceApp {
616616
readonly name: string
617617
readonly command?: string
618618
readonly icon?: string
619+
readonly health: WorkspaceAppHealth
619620
}
620621

621622
// From codersdk/workspacebuilds.go
@@ -738,5 +739,8 @@ export type UserStatus = "active" | "suspended"
738739
// From codersdk/workspaceresources.go
739740
export type WorkspaceAgentStatus = "connected" | "connecting" | "disconnected"
740741

742+
// From codersdk/workspaceapps.go
743+
export type WorkspaceAppHealth = "healthy" | "initializing" | "unhealthy"
744+
741745
// From codersdk/workspacebuilds.go
742746
export type WorkspaceTransition = "delete" | "start" | "stop"

0 commit comments

Comments
 (0)