Skip to content

Commit 4fcedb0

Browse files
committed
Groups
1 parent 77be926 commit 4fcedb0

18 files changed

+2545
-53
lines changed

coderd/apidoc/docs.go

Lines changed: 743 additions & 36 deletions
Large diffs are not rendered by default.

coderd/apidoc/swagger.json

Lines changed: 635 additions & 1 deletion
Large diffs are not rendered by default.

codersdk/groups.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ type CreateGroupRequest struct {
1717
}
1818

1919
type Group struct {
20-
ID uuid.UUID `json:"id"`
20+
ID uuid.UUID `json:"id" format:"uuid"`
2121
Name string `json:"name"`
22-
OrganizationID uuid.UUID `json:"organization_id"`
22+
OrganizationID uuid.UUID `json:"organization_id" format:"uuid"`
2323
Members []User `json:"members"`
2424
AvatarURL string `json:"avatar_url"`
2525
QuotaAllowance int `json:"quota_allowance"`

codersdk/licenses.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ type AddLicenseRequest struct {
1616

1717
type License struct {
1818
ID int32 `json:"id"`
19-
UUID uuid.UUID `json:"uuid"`
20-
UploadedAt time.Time `json:"uploaded_at"`
19+
UUID uuid.UUID `json:"uuid" format:"uuid"`
20+
UploadedAt time.Time `json:"uploaded_at" format:"date-time"`
2121
// Claims are the JWT claims asserted by the license. Here we use
2222
// a generic string map to ensure that all data from the server is
2323
// parsed verbatim, not just the fields this version of Coder

codersdk/provisionerdaemons.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ const (
3737
)
3838

3939
type ProvisionerDaemon struct {
40-
ID uuid.UUID `json:"id"`
41-
CreatedAt time.Time `json:"created_at"`
42-
UpdatedAt sql.NullTime `json:"updated_at"`
40+
ID uuid.UUID `json:"id" format:"uuid"`
41+
CreatedAt time.Time `json:"created_at" format:"date-time"`
42+
UpdatedAt sql.NullTime `json:"updated_at" format:"date-time"`
4343
Name string `json:"name"`
4444
Provisioners []ProvisionerType `json:"provisioners"`
4545
Tags map[string]string `json:"tags"`

codersdk/replicas.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ import (
1212

1313
type Replica struct {
1414
// ID is the unique identifier for the replica.
15-
ID uuid.UUID `json:"id"`
15+
ID uuid.UUID `json:"id" format:"uuid"`
1616
// Hostname is the hostname of the replica.
1717
Hostname string `json:"hostname"`
1818
// CreatedAt is when the replica was first seen.
19-
CreatedAt time.Time `json:"created_at"`
19+
CreatedAt time.Time `json:"created_at" format:"date-time"`
2020
// RelayAddress is the accessible address to relay DERP connections.
2121
RelayAddress string `json:"relay_address"`
2222
// RegionID is the region of the replica.

codersdk/templates.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ type TemplateACL struct {
6060

6161
type TemplateGroup struct {
6262
Group
63-
Role TemplateRole `json:"role"`
63+
Role TemplateRole `json:"role" enums:"admin,use"`
6464
}
6565

6666
type TemplateUser struct {
6767
User
68-
Role TemplateRole `json:"role"`
68+
Role TemplateRole `json:"role" enums:"admin,use"`
6969
}
7070

7171
type UpdateTemplateACL struct {

0 commit comments

Comments
 (0)