fix(codersdk): make codersdk.ProvisionerDaemon.UpdatedAt a codersdk.NullTime (#11037)

This commit is contained in:
Cian Johnston
2023-12-05 15:40:45 +00:00
committed by GitHub
parent fab343a2e9
commit a235644046
6 changed files with 31 additions and 88 deletions
+2 -18
View File
@@ -9562,12 +9562,8 @@ const docTemplate = `{
}
},
"updated_at": {
"format": "date-time",
"allOf": [
{
"$ref": "#/definitions/sql.NullTime"
}
]
"type": "string",
"format": "date-time"
},
"version": {
"type": "string"
@@ -12741,18 +12737,6 @@ const docTemplate = `{
}
}
},
"sql.NullTime": {
"type": "object",
"properties": {
"time": {
"type": "string"
},
"valid": {
"description": "Valid is true if Time is not NULL",
"type": "boolean"
}
}
},
"tailcfg.DERPHomeParams": {
"type": "object",
"properties": {
+2 -18
View File
@@ -8601,12 +8601,8 @@
}
},
"updated_at": {
"format": "date-time",
"allOf": [
{
"$ref": "#/definitions/sql.NullTime"
}
]
"type": "string",
"format": "date-time"
},
"version": {
"type": "string"
@@ -11614,18 +11610,6 @@
}
}
},
"sql.NullTime": {
"type": "object",
"properties": {
"time": {
"type": "string"
},
"valid": {
"description": "Valid is true if Time is not NULL",
"type": "boolean"
}
}
},
"tailcfg.DERPHomeParams": {
"type": "object",
"properties": {
+1 -2
View File
@@ -2,7 +2,6 @@ package codersdk
import (
"context"
"database/sql"
"encoding/json"
"fmt"
"io"
@@ -39,7 +38,7 @@ const (
type ProvisionerDaemon struct {
ID uuid.UUID `json:"id" format:"uuid"`
CreatedAt time.Time `json:"created_at" format:"date-time"`
UpdatedAt sql.NullTime `json:"updated_at" format:"date-time"`
UpdatedAt NullTime `json:"updated_at,omitempty" format:"date-time"`
LastSeenAt NullTime `json:"last_seen_at,omitempty" format:"date-time"`
Name string `json:"name"`
Version string `json:"version"`
+13 -18
View File
@@ -707,10 +707,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisi
"property1": "string",
"property2": "string"
},
"updated_at": {
"time": "string",
"valid": true
},
"updated_at": "2019-08-24T14:15:22Z",
"version": "string"
}
]
@@ -726,20 +723,18 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisi
Status Code **200**
| Name | Type | Required | Restrictions | Description |
| ------------------- | -------------------------------------- | -------- | ------------ | --------------------------------- |
| `[array item]` | array | false | | |
| `» created_at` | string(date-time) | false | | |
| `» id` | string(uuid) | false | | |
| `» last_seen_at` | string(date-time) | false | | |
| `» name` | string | false | | |
| `» provisioners` | array | false | | |
| `» tags` | object | false | | |
| `»» [any property]` | string | false | | |
| `» updated_at` | [sql.NullTime](schemas.md#sqlnulltime) | false | | |
| `»» time` | string | false | | |
| `»» valid` | boolean | false | | Valid is true if Time is not NULL |
| `» version` | string | false | | |
| Name | Type | Required | Restrictions | Description |
| ------------------- | ----------------- | -------- | ------------ | ----------- |
| `[array item]` | array | false | | |
| `» created_at` | string(date-time) | false | | |
| `» id` | string(uuid) | false | | |
| `» last_seen_at` | string(date-time) | false | | |
| `» name` | string | false | | |
| `» provisioners` | array | false | | |
| `» tags` | object | false | | |
| `»» [any property]` | string | false | | |
| `» updated_at` | string(date-time) | false | | |
| `» version` | string | false | | |
To perform this operation, you must be authenticated. [Learn more](authentication.md).
+12 -31
View File
@@ -3777,27 +3777,24 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
"property1": "string",
"property2": "string"
},
"updated_at": {
"time": "string",
"valid": true
},
"updated_at": "2019-08-24T14:15:22Z",
"version": "string"
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ------------------ | ---------------------------- | -------- | ------------ | ----------- |
| `created_at` | string | false | | |
| `id` | string | false | | |
| `last_seen_at` | string | false | | |
| `name` | string | false | | |
| `provisioners` | array of string | false | | |
| `tags` | object | false | | |
| » `[any property]` | string | false | | |
| `updated_at` | [sql.NullTime](#sqlnulltime) | false | | |
| `version` | string | false | | |
| Name | Type | Required | Restrictions | Description |
| ------------------ | --------------- | -------- | ------------ | ----------- |
| `created_at` | string | false | | |
| `id` | string | false | | |
| `last_seen_at` | string | false | | |
| `name` | string | false | | |
| `provisioners` | array of string | false | | |
| `tags` | object | false | | |
| » `[any property]` | string | false | | |
| `updated_at` | string | false | | |
| `version` | string | false | | |
## codersdk.ProvisionerJob
@@ -8184,22 +8181,6 @@ If the schedule is empty, the user will be updated to use the default schedule.|
| `udp` | boolean | false | | a UDP STUN round trip completed |
| `upnP` | string | false | | Upnp is whether UPnP appears present on the LAN. Empty means not checked. |
## sql.NullTime
```json
{
"time": "string",
"valid": true
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ------- | ------- | -------- | ------------ | --------------------------------- |
| `time` | string | false | | |
| `valid` | boolean | false | | Valid is true if Time is not NULL |
## tailcfg.DERPHomeParams
```json
+1 -1
View File
@@ -312,7 +312,7 @@ func convertProvisionerDaemon(daemon database.ProvisionerDaemon) codersdk.Provis
result := codersdk.ProvisionerDaemon{
ID: daemon.ID,
CreatedAt: daemon.CreatedAt,
UpdatedAt: daemon.UpdatedAt,
UpdatedAt: codersdk.NullTime{NullTime: daemon.UpdatedAt},
LastSeenAt: codersdk.NullTime{NullTime: daemon.LastSeenAt},
Name: daemon.Name,
Tags: daemon.Tags,