2022-01-05 15:20:56 +00:00
// Code generated by sqlc. DO NOT EDIT.
2022-05-02 19:30:46 +00:00
// versions:
2023-01-23 11:14:47 +00:00
// sqlc v1.16.0
2022-01-05 15:20:56 +00:00
package database
2022-01-12 18:04:11 +00:00
import (
2022-01-24 17:07:42 +00:00
"database/sql"
2023-01-23 11:14:47 +00:00
"database/sql/driver"
2022-01-12 18:04:11 +00:00
"encoding/json"
"fmt"
"time"
2022-01-24 17:07:42 +00:00
2022-11-16 22:34:06 +00:00
"github.com/coder/coder/coderd/database/dbtype"
2022-01-24 17:07:42 +00:00
"github.com/google/uuid"
2022-10-10 20:37:06 +00:00
"github.com/lib/pq"
2022-02-28 18:00:52 +00:00
"github.com/tabbed/pqtype"
2022-01-12 18:04:11 +00:00
)
2022-09-19 17:39:02 +00:00
type APIKeyScope string
const (
APIKeyScopeAll APIKeyScope = "all"
APIKeyScopeApplicationConnect APIKeyScope = "application_connect"
)
func ( e * APIKeyScope ) Scan ( src interface { } ) error {
switch s := src . ( type ) {
case [ ] byte :
* e = APIKeyScope ( s )
case string :
* e = APIKeyScope ( s )
default :
return fmt . Errorf ( "unsupported scan type for APIKeyScope: %T" , src )
}
return nil
}
2023-01-23 11:14:47 +00:00
type NullAPIKeyScope struct {
APIKeyScope APIKeyScope
Valid bool // Valid is true if APIKeyScope is not NULL
}
// Scan implements the Scanner interface.
func ( ns * NullAPIKeyScope ) Scan ( value interface { } ) error {
if value == nil {
ns . APIKeyScope , ns . Valid = "" , false
return nil
}
ns . Valid = true
return ns . APIKeyScope . Scan ( value )
}
// Value implements the driver Valuer interface.
func ( ns NullAPIKeyScope ) Value ( ) ( driver . Value , error ) {
if ! ns . Valid {
return nil , nil
}
return ns . APIKeyScope , nil
}
func ( e APIKeyScope ) Valid ( ) bool {
switch e {
case APIKeyScopeAll ,
APIKeyScopeApplicationConnect :
return true
}
return false
}
func AllAPIKeyScopeValues ( ) [ ] APIKeyScope {
return [ ] APIKeyScope {
APIKeyScopeAll ,
APIKeyScopeApplicationConnect ,
}
}
2022-10-14 16:46:38 +00:00
type AppSharingLevel string
const (
AppSharingLevelOwner AppSharingLevel = "owner"
AppSharingLevelAuthenticated AppSharingLevel = "authenticated"
AppSharingLevelPublic AppSharingLevel = "public"
)
func ( e * AppSharingLevel ) Scan ( src interface { } ) error {
switch s := src . ( type ) {
case [ ] byte :
* e = AppSharingLevel ( s )
case string :
* e = AppSharingLevel ( s )
default :
return fmt . Errorf ( "unsupported scan type for AppSharingLevel: %T" , src )
}
return nil
}
2023-01-23 11:14:47 +00:00
type NullAppSharingLevel struct {
AppSharingLevel AppSharingLevel
Valid bool // Valid is true if AppSharingLevel is not NULL
}
// Scan implements the Scanner interface.
func ( ns * NullAppSharingLevel ) Scan ( value interface { } ) error {
if value == nil {
ns . AppSharingLevel , ns . Valid = "" , false
return nil
}
ns . Valid = true
return ns . AppSharingLevel . Scan ( value )
}
// Value implements the driver Valuer interface.
func ( ns NullAppSharingLevel ) Value ( ) ( driver . Value , error ) {
if ! ns . Valid {
return nil , nil
}
return ns . AppSharingLevel , nil
}
func ( e AppSharingLevel ) Valid ( ) bool {
switch e {
case AppSharingLevelOwner ,
AppSharingLevelAuthenticated ,
AppSharingLevelPublic :
return true
}
return false
}
func AllAppSharingLevelValues ( ) [ ] AppSharingLevel {
return [ ] AppSharingLevel {
AppSharingLevelOwner ,
AppSharingLevelAuthenticated ,
AppSharingLevelPublic ,
}
}
2022-05-02 19:30:46 +00:00
type AuditAction string
const (
AuditActionCreate AuditAction = "create"
AuditActionWrite AuditAction = "write"
AuditActionDelete AuditAction = "delete"
2022-10-25 19:34:48 +00:00
AuditActionStart AuditAction = "start"
AuditActionStop AuditAction = "stop"
2022-05-02 19:30:46 +00:00
)
func ( e * AuditAction ) Scan ( src interface { } ) error {
switch s := src . ( type ) {
case [ ] byte :
* e = AuditAction ( s )
case string :
* e = AuditAction ( s )
default :
return fmt . Errorf ( "unsupported scan type for AuditAction: %T" , src )
}
return nil
}
2023-01-23 11:14:47 +00:00
type NullAuditAction struct {
AuditAction AuditAction
Valid bool // Valid is true if AuditAction is not NULL
}
// Scan implements the Scanner interface.
func ( ns * NullAuditAction ) Scan ( value interface { } ) error {
if value == nil {
ns . AuditAction , ns . Valid = "" , false
return nil
}
ns . Valid = true
return ns . AuditAction . Scan ( value )
}
// Value implements the driver Valuer interface.
func ( ns NullAuditAction ) Value ( ) ( driver . Value , error ) {
if ! ns . Valid {
return nil , nil
}
return ns . AuditAction , nil
}
func ( e AuditAction ) Valid ( ) bool {
switch e {
case AuditActionCreate ,
AuditActionWrite ,
AuditActionDelete ,
AuditActionStart ,
AuditActionStop :
return true
}
return false
}
func AllAuditActionValues ( ) [ ] AuditAction {
return [ ] AuditAction {
AuditActionCreate ,
AuditActionWrite ,
AuditActionDelete ,
AuditActionStart ,
AuditActionStop ,
}
}
2022-06-17 17:41:11 +00:00
type BuildReason string
const (
BuildReasonInitiator BuildReason = "initiator"
BuildReasonAutostart BuildReason = "autostart"
BuildReasonAutostop BuildReason = "autostop"
)
func ( e * BuildReason ) Scan ( src interface { } ) error {
switch s := src . ( type ) {
case [ ] byte :
* e = BuildReason ( s )
case string :
* e = BuildReason ( s )
default :
return fmt . Errorf ( "unsupported scan type for BuildReason: %T" , src )
}
return nil
}
2023-01-23 11:14:47 +00:00
type NullBuildReason struct {
BuildReason BuildReason
Valid bool // Valid is true if BuildReason is not NULL
}
// Scan implements the Scanner interface.
func ( ns * NullBuildReason ) Scan ( value interface { } ) error {
if value == nil {
ns . BuildReason , ns . Valid = "" , false
return nil
}
ns . Valid = true
return ns . BuildReason . Scan ( value )
}
// Value implements the driver Valuer interface.
func ( ns NullBuildReason ) Value ( ) ( driver . Value , error ) {
if ! ns . Valid {
return nil , nil
}
return ns . BuildReason , nil
}
func ( e BuildReason ) Valid ( ) bool {
switch e {
case BuildReasonInitiator ,
BuildReasonAutostart ,
BuildReasonAutostop :
return true
}
return false
}
func AllBuildReasonValues ( ) [ ] BuildReason {
return [ ] BuildReason {
BuildReasonInitiator ,
BuildReasonAutostart ,
BuildReasonAutostop ,
}
}
2022-01-25 19:52:58 +00:00
type LogLevel string
const (
LogLevelTrace LogLevel = "trace"
LogLevelDebug LogLevel = "debug"
LogLevelInfo LogLevel = "info"
LogLevelWarn LogLevel = "warn"
LogLevelError LogLevel = "error"
)
func ( e * LogLevel ) Scan ( src interface { } ) error {
switch s := src . ( type ) {
case [ ] byte :
* e = LogLevel ( s )
case string :
* e = LogLevel ( s )
default :
return fmt . Errorf ( "unsupported scan type for LogLevel: %T" , src )
}
return nil
}
2023-01-23 11:14:47 +00:00
type NullLogLevel struct {
LogLevel LogLevel
Valid bool // Valid is true if LogLevel is not NULL
}
// Scan implements the Scanner interface.
func ( ns * NullLogLevel ) Scan ( value interface { } ) error {
if value == nil {
ns . LogLevel , ns . Valid = "" , false
return nil
}
ns . Valid = true
return ns . LogLevel . Scan ( value )
}
// Value implements the driver Valuer interface.
func ( ns NullLogLevel ) Value ( ) ( driver . Value , error ) {
if ! ns . Valid {
return nil , nil
}
return ns . LogLevel , nil
}
func ( e LogLevel ) Valid ( ) bool {
switch e {
case LogLevelTrace ,
LogLevelDebug ,
LogLevelInfo ,
LogLevelWarn ,
LogLevelError :
return true
}
return false
}
func AllLogLevelValues ( ) [ ] LogLevel {
return [ ] LogLevel {
LogLevelTrace ,
LogLevelDebug ,
LogLevelInfo ,
LogLevelWarn ,
LogLevelError ,
}
}
2022-02-01 05:36:15 +00:00
type LogSource string
const (
LogSourceProvisionerDaemon LogSource = "provisioner_daemon"
LogSourceProvisioner LogSource = "provisioner"
)
func ( e * LogSource ) Scan ( src interface { } ) error {
switch s := src . ( type ) {
case [ ] byte :
* e = LogSource ( s )
case string :
* e = LogSource ( s )
default :
return fmt . Errorf ( "unsupported scan type for LogSource: %T" , src )
}
return nil
}
2023-01-23 11:14:47 +00:00
type NullLogSource struct {
LogSource LogSource
Valid bool // Valid is true if LogSource is not NULL
}
// Scan implements the Scanner interface.
func ( ns * NullLogSource ) Scan ( value interface { } ) error {
if value == nil {
ns . LogSource , ns . Valid = "" , false
return nil
}
ns . Valid = true
return ns . LogSource . Scan ( value )
}
// Value implements the driver Valuer interface.
func ( ns NullLogSource ) Value ( ) ( driver . Value , error ) {
if ! ns . Valid {
return nil , nil
}
return ns . LogSource , nil
}
func ( e LogSource ) Valid ( ) bool {
switch e {
case LogSourceProvisionerDaemon ,
LogSourceProvisioner :
return true
}
return false
}
func AllLogSourceValues ( ) [ ] LogSource {
return [ ] LogSource {
LogSourceProvisionerDaemon ,
LogSourceProvisioner ,
}
}
2022-01-12 18:04:11 +00:00
type LoginType string
const (
2022-04-23 22:58:57 +00:00
LoginTypePassword LoginType = "password"
LoginTypeGithub LoginType = "github"
2022-08-01 04:05:35 +00:00
LoginTypeOIDC LoginType = "oidc"
2022-10-06 19:02:27 +00:00
LoginTypeToken LoginType = "token"
2022-01-12 18:04:11 +00:00
)
func ( e * LoginType ) Scan ( src interface { } ) error {
switch s := src . ( type ) {
case [ ] byte :
* e = LoginType ( s )
case string :
* e = LoginType ( s )
default :
return fmt . Errorf ( "unsupported scan type for LoginType: %T" , src )
}
return nil
}
2023-01-23 11:14:47 +00:00
type NullLoginType struct {
LoginType LoginType
Valid bool // Valid is true if LoginType is not NULL
}
// Scan implements the Scanner interface.
func ( ns * NullLoginType ) Scan ( value interface { } ) error {
if value == nil {
ns . LoginType , ns . Valid = "" , false
return nil
}
ns . Valid = true
return ns . LoginType . Scan ( value )
}
// Value implements the driver Valuer interface.
func ( ns NullLoginType ) Value ( ) ( driver . Value , error ) {
if ! ns . Valid {
return nil , nil
}
return ns . LoginType , nil
}
func ( e LoginType ) Valid ( ) bool {
switch e {
case LoginTypePassword ,
LoginTypeGithub ,
LoginTypeOIDC ,
LoginTypeToken :
return true
}
return false
}
func AllLoginTypeValues ( ) [ ] LoginType {
return [ ] LoginType {
LoginTypePassword ,
LoginTypeGithub ,
LoginTypeOIDC ,
LoginTypeToken ,
}
}
2022-01-29 23:38:32 +00:00
type ParameterDestinationScheme string
const (
2022-02-04 19:36:43 +00:00
ParameterDestinationSchemeNone ParameterDestinationScheme = "none"
2022-01-29 23:38:32 +00:00
ParameterDestinationSchemeEnvironmentVariable ParameterDestinationScheme = "environment_variable"
ParameterDestinationSchemeProvisionerVariable ParameterDestinationScheme = "provisioner_variable"
)
func ( e * ParameterDestinationScheme ) Scan ( src interface { } ) error {
switch s := src . ( type ) {
case [ ] byte :
* e = ParameterDestinationScheme ( s )
case string :
* e = ParameterDestinationScheme ( s )
default :
return fmt . Errorf ( "unsupported scan type for ParameterDestinationScheme: %T" , src )
}
return nil
}
2023-01-23 11:14:47 +00:00
type NullParameterDestinationScheme struct {
ParameterDestinationScheme ParameterDestinationScheme
Valid bool // Valid is true if ParameterDestinationScheme is not NULL
}
// Scan implements the Scanner interface.
func ( ns * NullParameterDestinationScheme ) Scan ( value interface { } ) error {
if value == nil {
ns . ParameterDestinationScheme , ns . Valid = "" , false
return nil
}
ns . Valid = true
return ns . ParameterDestinationScheme . Scan ( value )
}
// Value implements the driver Valuer interface.
func ( ns NullParameterDestinationScheme ) Value ( ) ( driver . Value , error ) {
if ! ns . Valid {
return nil , nil
}
return ns . ParameterDestinationScheme , nil
}
func ( e ParameterDestinationScheme ) Valid ( ) bool {
switch e {
case ParameterDestinationSchemeNone ,
ParameterDestinationSchemeEnvironmentVariable ,
ParameterDestinationSchemeProvisionerVariable :
return true
}
return false
}
func AllParameterDestinationSchemeValues ( ) [ ] ParameterDestinationScheme {
return [ ] ParameterDestinationScheme {
ParameterDestinationSchemeNone ,
ParameterDestinationSchemeEnvironmentVariable ,
ParameterDestinationSchemeProvisionerVariable ,
}
}
2022-01-29 23:38:32 +00:00
type ParameterScope string
const (
2022-06-03 18:49:58 +00:00
ParameterScopeTemplate ParameterScope = "template"
ParameterScopeImportJob ParameterScope = "import_job"
ParameterScopeWorkspace ParameterScope = "workspace"
2022-01-29 23:38:32 +00:00
)
func ( e * ParameterScope ) Scan ( src interface { } ) error {
switch s := src . ( type ) {
case [ ] byte :
* e = ParameterScope ( s )
case string :
* e = ParameterScope ( s )
default :
return fmt . Errorf ( "unsupported scan type for ParameterScope: %T" , src )
}
return nil
}
2023-01-23 11:14:47 +00:00
type NullParameterScope struct {
ParameterScope ParameterScope
Valid bool // Valid is true if ParameterScope is not NULL
}
// Scan implements the Scanner interface.
func ( ns * NullParameterScope ) Scan ( value interface { } ) error {
if value == nil {
ns . ParameterScope , ns . Valid = "" , false
return nil
}
ns . Valid = true
return ns . ParameterScope . Scan ( value )
}
// Value implements the driver Valuer interface.
func ( ns NullParameterScope ) Value ( ) ( driver . Value , error ) {
if ! ns . Valid {
return nil , nil
}
return ns . ParameterScope , nil
}
func ( e ParameterScope ) Valid ( ) bool {
switch e {
case ParameterScopeTemplate ,
ParameterScopeImportJob ,
ParameterScopeWorkspace :
return true
}
return false
}
func AllParameterScopeValues ( ) [ ] ParameterScope {
return [ ] ParameterScope {
ParameterScopeTemplate ,
ParameterScopeImportJob ,
ParameterScopeWorkspace ,
}
}
2022-01-29 23:38:32 +00:00
type ParameterSourceScheme string
const (
2022-02-04 19:36:43 +00:00
ParameterSourceSchemeNone ParameterSourceScheme = "none"
2022-01-29 23:38:32 +00:00
ParameterSourceSchemeData ParameterSourceScheme = "data"
)
func ( e * ParameterSourceScheme ) Scan ( src interface { } ) error {
switch s := src . ( type ) {
case [ ] byte :
* e = ParameterSourceScheme ( s )
case string :
* e = ParameterSourceScheme ( s )
default :
return fmt . Errorf ( "unsupported scan type for ParameterSourceScheme: %T" , src )
}
return nil
}
2023-01-23 11:14:47 +00:00
type NullParameterSourceScheme struct {
ParameterSourceScheme ParameterSourceScheme
Valid bool // Valid is true if ParameterSourceScheme is not NULL
}
// Scan implements the Scanner interface.
func ( ns * NullParameterSourceScheme ) Scan ( value interface { } ) error {
if value == nil {
ns . ParameterSourceScheme , ns . Valid = "" , false
return nil
}
ns . Valid = true
return ns . ParameterSourceScheme . Scan ( value )
}
// Value implements the driver Valuer interface.
func ( ns NullParameterSourceScheme ) Value ( ) ( driver . Value , error ) {
if ! ns . Valid {
return nil , nil
}
return ns . ParameterSourceScheme , nil
}
func ( e ParameterSourceScheme ) Valid ( ) bool {
switch e {
case ParameterSourceSchemeNone ,
ParameterSourceSchemeData :
return true
}
return false
}
func AllParameterSourceSchemeValues ( ) [ ] ParameterSourceScheme {
return [ ] ParameterSourceScheme {
ParameterSourceSchemeNone ,
ParameterSourceSchemeData ,
}
}
2022-01-24 17:07:42 +00:00
type ParameterTypeSystem string
const (
2022-02-04 19:36:43 +00:00
ParameterTypeSystemNone ParameterTypeSystem = "none"
ParameterTypeSystemHCL ParameterTypeSystem = "hcl"
2022-01-24 17:07:42 +00:00
)
func ( e * ParameterTypeSystem ) Scan ( src interface { } ) error {
switch s := src . ( type ) {
case [ ] byte :
* e = ParameterTypeSystem ( s )
case string :
* e = ParameterTypeSystem ( s )
default :
return fmt . Errorf ( "unsupported scan type for ParameterTypeSystem: %T" , src )
}
return nil
}
2023-01-23 11:14:47 +00:00
type NullParameterTypeSystem struct {
ParameterTypeSystem ParameterTypeSystem
Valid bool // Valid is true if ParameterTypeSystem is not NULL
}
// Scan implements the Scanner interface.
func ( ns * NullParameterTypeSystem ) Scan ( value interface { } ) error {
if value == nil {
ns . ParameterTypeSystem , ns . Valid = "" , false
return nil
}
ns . Valid = true
return ns . ParameterTypeSystem . Scan ( value )
}
// Value implements the driver Valuer interface.
func ( ns NullParameterTypeSystem ) Value ( ) ( driver . Value , error ) {
if ! ns . Valid {
return nil , nil
}
return ns . ParameterTypeSystem , nil
}
func ( e ParameterTypeSystem ) Valid ( ) bool {
switch e {
case ParameterTypeSystemNone ,
ParameterTypeSystemHCL :
return true
}
return false
}
func AllParameterTypeSystemValues ( ) [ ] ParameterTypeSystem {
return [ ] ParameterTypeSystem {
ParameterTypeSystemNone ,
ParameterTypeSystemHCL ,
}
}
2022-02-08 18:00:44 +00:00
type ProvisionerJobType string
2022-01-24 17:07:42 +00:00
const (
2022-04-06 17:42:40 +00:00
ProvisionerJobTypeTemplateVersionImport ProvisionerJobType = "template_version_import"
ProvisionerJobTypeWorkspaceBuild ProvisionerJobType = "workspace_build"
2022-06-01 14:44:53 +00:00
ProvisionerJobTypeTemplateVersionDryRun ProvisionerJobType = "template_version_dry_run"
2022-01-24 17:07:42 +00:00
)
2022-02-08 18:00:44 +00:00
func ( e * ProvisionerJobType ) Scan ( src interface { } ) error {
2022-01-24 17:07:42 +00:00
switch s := src . ( type ) {
case [ ] byte :
2022-02-08 18:00:44 +00:00
* e = ProvisionerJobType ( s )
2022-01-24 17:07:42 +00:00
case string :
2022-02-08 18:00:44 +00:00
* e = ProvisionerJobType ( s )
2022-01-24 17:07:42 +00:00
default :
2022-02-08 18:00:44 +00:00
return fmt . Errorf ( "unsupported scan type for ProvisionerJobType: %T" , src )
2022-01-24 17:07:42 +00:00
}
return nil
}
2023-01-23 11:14:47 +00:00
type NullProvisionerJobType struct {
ProvisionerJobType ProvisionerJobType
Valid bool // Valid is true if ProvisionerJobType is not NULL
}
// Scan implements the Scanner interface.
func ( ns * NullProvisionerJobType ) Scan ( value interface { } ) error {
if value == nil {
ns . ProvisionerJobType , ns . Valid = "" , false
return nil
}
ns . Valid = true
return ns . ProvisionerJobType . Scan ( value )
}
// Value implements the driver Valuer interface.
func ( ns NullProvisionerJobType ) Value ( ) ( driver . Value , error ) {
if ! ns . Valid {
return nil , nil
}
return ns . ProvisionerJobType , nil
}
func ( e ProvisionerJobType ) Valid ( ) bool {
switch e {
case ProvisionerJobTypeTemplateVersionImport ,
ProvisionerJobTypeWorkspaceBuild ,
ProvisionerJobTypeTemplateVersionDryRun :
return true
}
return false
}
func AllProvisionerJobTypeValues ( ) [ ] ProvisionerJobType {
return [ ] ProvisionerJobType {
ProvisionerJobTypeTemplateVersionImport ,
ProvisionerJobTypeWorkspaceBuild ,
ProvisionerJobTypeTemplateVersionDryRun ,
}
}
2022-02-08 18:00:44 +00:00
type ProvisionerStorageMethod string
2022-01-29 23:38:32 +00:00
const (
2022-02-08 18:00:44 +00:00
ProvisionerStorageMethodFile ProvisionerStorageMethod = "file"
2022-01-29 23:38:32 +00:00
)
2022-02-08 18:00:44 +00:00
func ( e * ProvisionerStorageMethod ) Scan ( src interface { } ) error {
2022-01-29 23:38:32 +00:00
switch s := src . ( type ) {
case [ ] byte :
2022-02-08 18:00:44 +00:00
* e = ProvisionerStorageMethod ( s )
2022-01-29 23:38:32 +00:00
case string :
2022-02-08 18:00:44 +00:00
* e = ProvisionerStorageMethod ( s )
2022-01-29 23:38:32 +00:00
default :
2022-02-08 18:00:44 +00:00
return fmt . Errorf ( "unsupported scan type for ProvisionerStorageMethod: %T" , src )
2022-01-29 23:38:32 +00:00
}
return nil
}
2023-01-23 11:14:47 +00:00
type NullProvisionerStorageMethod struct {
ProvisionerStorageMethod ProvisionerStorageMethod
Valid bool // Valid is true if ProvisionerStorageMethod is not NULL
}
// Scan implements the Scanner interface.
func ( ns * NullProvisionerStorageMethod ) Scan ( value interface { } ) error {
if value == nil {
ns . ProvisionerStorageMethod , ns . Valid = "" , false
return nil
}
ns . Valid = true
return ns . ProvisionerStorageMethod . Scan ( value )
}
// Value implements the driver Valuer interface.
func ( ns NullProvisionerStorageMethod ) Value ( ) ( driver . Value , error ) {
if ! ns . Valid {
return nil , nil
}
return ns . ProvisionerStorageMethod , nil
}
func ( e ProvisionerStorageMethod ) Valid ( ) bool {
switch e {
case ProvisionerStorageMethodFile :
return true
}
return false
}
func AllProvisionerStorageMethodValues ( ) [ ] ProvisionerStorageMethod {
return [ ] ProvisionerStorageMethod {
ProvisionerStorageMethodFile ,
}
}
2022-01-24 17:07:42 +00:00
type ProvisionerType string
const (
2022-02-04 22:51:54 +00:00
ProvisionerTypeEcho ProvisionerType = "echo"
2022-01-24 17:07:42 +00:00
ProvisionerTypeTerraform ProvisionerType = "terraform"
)
func ( e * ProvisionerType ) Scan ( src interface { } ) error {
switch s := src . ( type ) {
case [ ] byte :
* e = ProvisionerType ( s )
case string :
* e = ProvisionerType ( s )
default :
return fmt . Errorf ( "unsupported scan type for ProvisionerType: %T" , src )
}
return nil
}
2023-01-23 11:14:47 +00:00
type NullProvisionerType struct {
ProvisionerType ProvisionerType
Valid bool // Valid is true if ProvisionerType is not NULL
}
// Scan implements the Scanner interface.
func ( ns * NullProvisionerType ) Scan ( value interface { } ) error {
if value == nil {
ns . ProvisionerType , ns . Valid = "" , false
return nil
}
ns . Valid = true
return ns . ProvisionerType . Scan ( value )
}
// Value implements the driver Valuer interface.
func ( ns NullProvisionerType ) Value ( ) ( driver . Value , error ) {
if ! ns . Valid {
return nil , nil
}
return ns . ProvisionerType , nil
}
func ( e ProvisionerType ) Valid ( ) bool {
switch e {
case ProvisionerTypeEcho ,
ProvisionerTypeTerraform :
return true
}
return false
}
func AllProvisionerTypeValues ( ) [ ] ProvisionerType {
return [ ] ProvisionerType {
ProvisionerTypeEcho ,
ProvisionerTypeTerraform ,
}
}
2022-05-02 19:30:46 +00:00
type ResourceType string
const (
ResourceTypeOrganization ResourceType = "organization"
ResourceTypeTemplate ResourceType = "template"
ResourceTypeTemplateVersion ResourceType = "template_version"
ResourceTypeUser ResourceType = "user"
ResourceTypeWorkspace ResourceType = "workspace"
2022-09-08 14:36:34 +00:00
ResourceTypeGitSshKey ResourceType = "git_ssh_key"
ResourceTypeApiKey ResourceType = "api_key"
2022-10-19 07:00:45 +00:00
ResourceTypeGroup ResourceType = "group"
2022-10-25 19:34:48 +00:00
ResourceTypeWorkspaceBuild ResourceType = "workspace_build"
2022-05-02 19:30:46 +00:00
)
func ( e * ResourceType ) Scan ( src interface { } ) error {
switch s := src . ( type ) {
case [ ] byte :
* e = ResourceType ( s )
case string :
* e = ResourceType ( s )
default :
return fmt . Errorf ( "unsupported scan type for ResourceType: %T" , src )
}
return nil
}
2023-01-23 11:14:47 +00:00
type NullResourceType struct {
ResourceType ResourceType
Valid bool // Valid is true if ResourceType is not NULL
}
// Scan implements the Scanner interface.
func ( ns * NullResourceType ) Scan ( value interface { } ) error {
if value == nil {
ns . ResourceType , ns . Valid = "" , false
return nil
}
ns . Valid = true
return ns . ResourceType . Scan ( value )
}
// Value implements the driver Valuer interface.
func ( ns NullResourceType ) Value ( ) ( driver . Value , error ) {
if ! ns . Valid {
return nil , nil
}
return ns . ResourceType , nil
}
func ( e ResourceType ) Valid ( ) bool {
switch e {
case ResourceTypeOrganization ,
ResourceTypeTemplate ,
ResourceTypeTemplateVersion ,
ResourceTypeUser ,
ResourceTypeWorkspace ,
ResourceTypeGitSshKey ,
ResourceTypeApiKey ,
ResourceTypeGroup ,
ResourceTypeWorkspaceBuild :
return true
}
return false
}
func AllResourceTypeValues ( ) [ ] ResourceType {
return [ ] ResourceType {
ResourceTypeOrganization ,
ResourceTypeTemplate ,
ResourceTypeTemplateVersion ,
ResourceTypeUser ,
ResourceTypeWorkspace ,
ResourceTypeGitSshKey ,
ResourceTypeApiKey ,
ResourceTypeGroup ,
ResourceTypeWorkspaceBuild ,
}
}
2022-04-26 14:00:07 +00:00
type UserStatus string
const (
UserStatusActive UserStatus = "active"
UserStatusSuspended UserStatus = "suspended"
)
func ( e * UserStatus ) Scan ( src interface { } ) error {
switch s := src . ( type ) {
case [ ] byte :
* e = UserStatus ( s )
case string :
* e = UserStatus ( s )
default :
return fmt . Errorf ( "unsupported scan type for UserStatus: %T" , src )
}
return nil
}
2023-01-23 11:14:47 +00:00
type NullUserStatus struct {
UserStatus UserStatus
Valid bool // Valid is true if UserStatus is not NULL
}
// Scan implements the Scanner interface.
func ( ns * NullUserStatus ) Scan ( value interface { } ) error {
if value == nil {
ns . UserStatus , ns . Valid = "" , false
return nil
}
ns . Valid = true
return ns . UserStatus . Scan ( value )
}
// Value implements the driver Valuer interface.
func ( ns NullUserStatus ) Value ( ) ( driver . Value , error ) {
if ! ns . Valid {
return nil , nil
}
return ns . UserStatus , nil
}
func ( e UserStatus ) Valid ( ) bool {
switch e {
case UserStatusActive ,
UserStatusSuspended :
return true
}
return false
}
func AllUserStatusValues ( ) [ ] UserStatus {
return [ ] UserStatus {
UserStatusActive ,
UserStatusSuspended ,
}
}
2023-01-24 12:24:27 +00:00
type WorkspaceAgentLifecycleState string
const (
WorkspaceAgentLifecycleStateCreated WorkspaceAgentLifecycleState = "created"
WorkspaceAgentLifecycleStateStarting WorkspaceAgentLifecycleState = "starting"
WorkspaceAgentLifecycleStateStartTimeout WorkspaceAgentLifecycleState = "start_timeout"
WorkspaceAgentLifecycleStateStartError WorkspaceAgentLifecycleState = "start_error"
WorkspaceAgentLifecycleStateReady WorkspaceAgentLifecycleState = "ready"
)
func ( e * WorkspaceAgentLifecycleState ) Scan ( src interface { } ) error {
switch s := src . ( type ) {
case [ ] byte :
* e = WorkspaceAgentLifecycleState ( s )
case string :
* e = WorkspaceAgentLifecycleState ( s )
default :
return fmt . Errorf ( "unsupported scan type for WorkspaceAgentLifecycleState: %T" , src )
}
return nil
}
type NullWorkspaceAgentLifecycleState struct {
WorkspaceAgentLifecycleState WorkspaceAgentLifecycleState
Valid bool // Valid is true if WorkspaceAgentLifecycleState is not NULL
}
// Scan implements the Scanner interface.
func ( ns * NullWorkspaceAgentLifecycleState ) Scan ( value interface { } ) error {
if value == nil {
ns . WorkspaceAgentLifecycleState , ns . Valid = "" , false
return nil
}
ns . Valid = true
return ns . WorkspaceAgentLifecycleState . Scan ( value )
}
// Value implements the driver Valuer interface.
func ( ns NullWorkspaceAgentLifecycleState ) Value ( ) ( driver . Value , error ) {
if ! ns . Valid {
return nil , nil
}
return ns . WorkspaceAgentLifecycleState , nil
}
func ( e WorkspaceAgentLifecycleState ) Valid ( ) bool {
switch e {
case WorkspaceAgentLifecycleStateCreated ,
WorkspaceAgentLifecycleStateStarting ,
WorkspaceAgentLifecycleStateStartTimeout ,
WorkspaceAgentLifecycleStateStartError ,
WorkspaceAgentLifecycleStateReady :
return true
}
return false
}
func AllWorkspaceAgentLifecycleStateValues ( ) [ ] WorkspaceAgentLifecycleState {
return [ ] WorkspaceAgentLifecycleState {
WorkspaceAgentLifecycleStateCreated ,
WorkspaceAgentLifecycleStateStarting ,
WorkspaceAgentLifecycleStateStartTimeout ,
WorkspaceAgentLifecycleStateStartError ,
WorkspaceAgentLifecycleStateReady ,
}
}
2022-09-23 19:51:04 +00:00
type WorkspaceAppHealth string
const (
WorkspaceAppHealthDisabled WorkspaceAppHealth = "disabled"
WorkspaceAppHealthInitializing WorkspaceAppHealth = "initializing"
WorkspaceAppHealthHealthy WorkspaceAppHealth = "healthy"
WorkspaceAppHealthUnhealthy WorkspaceAppHealth = "unhealthy"
)
func ( e * WorkspaceAppHealth ) Scan ( src interface { } ) error {
switch s := src . ( type ) {
case [ ] byte :
* e = WorkspaceAppHealth ( s )
case string :
* e = WorkspaceAppHealth ( s )
default :
return fmt . Errorf ( "unsupported scan type for WorkspaceAppHealth: %T" , src )
}
return nil
}
2023-01-23 11:14:47 +00:00
type NullWorkspaceAppHealth struct {
WorkspaceAppHealth WorkspaceAppHealth
Valid bool // Valid is true if WorkspaceAppHealth is not NULL
}
// Scan implements the Scanner interface.
func ( ns * NullWorkspaceAppHealth ) Scan ( value interface { } ) error {
if value == nil {
ns . WorkspaceAppHealth , ns . Valid = "" , false
return nil
}
ns . Valid = true
return ns . WorkspaceAppHealth . Scan ( value )
}
// Value implements the driver Valuer interface.
func ( ns NullWorkspaceAppHealth ) Value ( ) ( driver . Value , error ) {
if ! ns . Valid {
return nil , nil
}
return ns . WorkspaceAppHealth , nil
}
func ( e WorkspaceAppHealth ) Valid ( ) bool {
switch e {
case WorkspaceAppHealthDisabled ,
WorkspaceAppHealthInitializing ,
WorkspaceAppHealthHealthy ,
WorkspaceAppHealthUnhealthy :
return true
}
return false
}
func AllWorkspaceAppHealthValues ( ) [ ] WorkspaceAppHealth {
return [ ] WorkspaceAppHealth {
WorkspaceAppHealthDisabled ,
WorkspaceAppHealthInitializing ,
WorkspaceAppHealthHealthy ,
WorkspaceAppHealthUnhealthy ,
}
}
2022-01-25 19:52:58 +00:00
type WorkspaceTransition string
const (
WorkspaceTransitionStart WorkspaceTransition = "start"
WorkspaceTransitionStop WorkspaceTransition = "stop"
WorkspaceTransitionDelete WorkspaceTransition = "delete"
)
func ( e * WorkspaceTransition ) Scan ( src interface { } ) error {
switch s := src . ( type ) {
case [ ] byte :
* e = WorkspaceTransition ( s )
case string :
* e = WorkspaceTransition ( s )
default :
return fmt . Errorf ( "unsupported scan type for WorkspaceTransition: %T" , src )
}
return nil
}
2023-01-23 11:14:47 +00:00
type NullWorkspaceTransition struct {
WorkspaceTransition WorkspaceTransition
Valid bool // Valid is true if WorkspaceTransition is not NULL
}
// Scan implements the Scanner interface.
func ( ns * NullWorkspaceTransition ) Scan ( value interface { } ) error {
if value == nil {
ns . WorkspaceTransition , ns . Valid = "" , false
return nil
}
ns . Valid = true
return ns . WorkspaceTransition . Scan ( value )
}
// Value implements the driver Valuer interface.
func ( ns NullWorkspaceTransition ) Value ( ) ( driver . Value , error ) {
if ! ns . Valid {
return nil , nil
}
return ns . WorkspaceTransition , nil
}
func ( e WorkspaceTransition ) Valid ( ) bool {
switch e {
case WorkspaceTransitionStart ,
WorkspaceTransitionStop ,
WorkspaceTransitionDelete :
return true
}
return false
}
func AllWorkspaceTransitionValues ( ) [ ] WorkspaceTransition {
return [ ] WorkspaceTransition {
WorkspaceTransitionStart ,
WorkspaceTransitionStop ,
WorkspaceTransitionDelete ,
}
}
2022-01-20 13:46:51 +00:00
type APIKey struct {
2022-09-22 22:30:32 +00:00
ID string ` db:"id" json:"id" `
// hashed_secret contains a SHA256 hash of the key secret. This is considered a secret and MUST NOT be returned from the API as it is used for API key encryption in app proxying code.
2022-08-17 23:00:53 +00:00
HashedSecret [ ] byte ` db:"hashed_secret" json:"hashed_secret" `
UserID uuid . UUID ` db:"user_id" json:"user_id" `
LastUsed time . Time ` db:"last_used" json:"last_used" `
ExpiresAt time . Time ` db:"expires_at" json:"expires_at" `
CreatedAt time . Time ` db:"created_at" json:"created_at" `
UpdatedAt time . Time ` db:"updated_at" json:"updated_at" `
LoginType LoginType ` db:"login_type" json:"login_type" `
LifetimeSeconds int64 ` db:"lifetime_seconds" json:"lifetime_seconds" `
IPAddress pqtype . Inet ` db:"ip_address" json:"ip_address" `
2022-09-19 17:39:02 +00:00
Scope APIKeyScope ` db:"scope" json:"scope" `
2022-01-12 18:04:11 +00:00
}
2022-09-01 19:58:23 +00:00
type AgentStat struct {
ID uuid . UUID ` db:"id" json:"id" `
CreatedAt time . Time ` db:"created_at" json:"created_at" `
UserID uuid . UUID ` db:"user_id" json:"user_id" `
AgentID uuid . UUID ` db:"agent_id" json:"agent_id" `
WorkspaceID uuid . UUID ` db:"workspace_id" json:"workspace_id" `
TemplateID uuid . UUID ` db:"template_id" json:"template_id" `
Payload json . RawMessage ` db:"payload" json:"payload" `
}
2022-05-02 19:30:46 +00:00
type AuditLog struct {
2022-08-31 21:12:54 +00:00
ID uuid . UUID ` db:"id" json:"id" `
Time time . Time ` db:"time" json:"time" `
UserID uuid . UUID ` db:"user_id" json:"user_id" `
OrganizationID uuid . UUID ` db:"organization_id" json:"organization_id" `
Ip pqtype . Inet ` db:"ip" json:"ip" `
2022-11-22 18:22:56 +00:00
UserAgent sql . NullString ` db:"user_agent" json:"user_agent" `
2022-08-31 21:12:54 +00:00
ResourceType ResourceType ` db:"resource_type" json:"resource_type" `
ResourceID uuid . UUID ` db:"resource_id" json:"resource_id" `
ResourceTarget string ` db:"resource_target" json:"resource_target" `
Action AuditAction ` db:"action" json:"action" `
Diff json . RawMessage ` db:"diff" json:"diff" `
StatusCode int32 ` db:"status_code" json:"status_code" `
AdditionalFields json . RawMessage ` db:"additional_fields" json:"additional_fields" `
RequestID uuid . UUID ` db:"request_id" json:"request_id" `
ResourceIcon string ` db:"resource_icon" json:"resource_icon" `
2022-05-02 19:30:46 +00:00
}
2022-02-07 21:32:37 +00:00
type File struct {
Hash string ` db:"hash" json:"hash" `
CreatedAt time . Time ` db:"created_at" json:"created_at" `
2022-04-01 19:42:36 +00:00
CreatedBy uuid . UUID ` db:"created_by" json:"created_by" `
2022-02-07 21:32:37 +00:00
Mimetype string ` db:"mimetype" json:"mimetype" `
Data [ ] byte ` db:"data" json:"data" `
2022-10-13 23:02:52 +00:00
ID uuid . UUID ` db:"id" json:"id" `
2022-02-07 21:32:37 +00:00
}
2022-10-25 00:46:24 +00:00
type GitAuthLink struct {
ProviderID string ` db:"provider_id" json:"provider_id" `
UserID uuid . UUID ` db:"user_id" json:"user_id" `
CreatedAt time . Time ` db:"created_at" json:"created_at" `
UpdatedAt time . Time ` db:"updated_at" json:"updated_at" `
OAuthAccessToken string ` db:"oauth_access_token" json:"oauth_access_token" `
OAuthRefreshToken string ` db:"oauth_refresh_token" json:"oauth_refresh_token" `
OAuthExpiry time . Time ` db:"oauth_expiry" json:"oauth_expiry" `
}
2022-04-06 00:18:26 +00:00
type GitSSHKey struct {
UserID uuid . UUID ` db:"user_id" json:"user_id" `
CreatedAt time . Time ` db:"created_at" json:"created_at" `
UpdatedAt time . Time ` db:"updated_at" json:"updated_at" `
PrivateKey string ` db:"private_key" json:"private_key" `
PublicKey string ` db:"public_key" json:"public_key" `
}
2022-10-10 20:37:06 +00:00
type Group struct {
ID uuid . UUID ` db:"id" json:"id" `
Name string ` db:"name" json:"name" `
OrganizationID uuid . UUID ` db:"organization_id" json:"organization_id" `
2022-10-17 22:46:01 +00:00
AvatarURL string ` db:"avatar_url" json:"avatar_url" `
2022-11-14 17:57:33 +00:00
QuotaAllowance int32 ` db:"quota_allowance" json:"quota_allowance" `
2022-10-10 20:37:06 +00:00
}
type GroupMember struct {
UserID uuid . UUID ` db:"user_id" json:"user_id" `
GroupID uuid . UUID ` db:"group_id" json:"group_id" `
}
2022-01-12 18:04:11 +00:00
type License struct {
2022-08-22 22:02:50 +00:00
ID int32 ` db:"id" json:"id" `
UploadedAt time . Time ` db:"uploaded_at" json:"uploaded_at" `
JWT string ` db:"jwt" json:"jwt" `
2022-08-24 12:44:30 +00:00
// exp tracks the claim of the same name in the JWT, and we include it here so that we can easily query for licenses that have not yet expired.
2022-11-16 23:09:49 +00:00
Exp time . Time ` db:"exp" json:"exp" `
Uuid uuid . NullUUID ` db:"uuid" json:"uuid" `
2022-01-12 18:04:11 +00:00
}
type Organization struct {
2022-04-01 19:42:36 +00:00
ID uuid . UUID ` db:"id" json:"id" `
Name string ` db:"name" json:"name" `
Description string ` db:"description" json:"description" `
CreatedAt time . Time ` db:"created_at" json:"created_at" `
UpdatedAt time . Time ` db:"updated_at" json:"updated_at" `
2022-01-12 18:04:11 +00:00
}
type OrganizationMember struct {
2022-04-01 19:42:36 +00:00
UserID uuid . UUID ` db:"user_id" json:"user_id" `
OrganizationID uuid . UUID ` db:"organization_id" json:"organization_id" `
2022-01-12 18:04:11 +00:00
CreatedAt time . Time ` db:"created_at" json:"created_at" `
UpdatedAt time . Time ` db:"updated_at" json:"updated_at" `
Roles [ ] string ` db:"roles" json:"roles" `
}
2022-02-08 18:00:44 +00:00
type ParameterSchema struct {
ID uuid . UUID ` db:"id" json:"id" `
CreatedAt time . Time ` db:"created_at" json:"created_at" `
JobID uuid . UUID ` db:"job_id" json:"job_id" `
Name string ` db:"name" json:"name" `
Description string ` db:"description" json:"description" `
DefaultSourceScheme ParameterSourceScheme ` db:"default_source_scheme" json:"default_source_scheme" `
2022-02-12 19:34:04 +00:00
DefaultSourceValue string ` db:"default_source_value" json:"default_source_value" `
2022-02-08 18:00:44 +00:00
AllowOverrideSource bool ` db:"allow_override_source" json:"allow_override_source" `
DefaultDestinationScheme ParameterDestinationScheme ` db:"default_destination_scheme" json:"default_destination_scheme" `
AllowOverrideDestination bool ` db:"allow_override_destination" json:"allow_override_destination" `
DefaultRefresh string ` db:"default_refresh" json:"default_refresh" `
RedisplayValue bool ` db:"redisplay_value" json:"redisplay_value" `
ValidationError string ` db:"validation_error" json:"validation_error" `
ValidationCondition string ` db:"validation_condition" json:"validation_condition" `
ValidationTypeSystem ParameterTypeSystem ` db:"validation_type_system" json:"validation_type_system" `
ValidationValueType string ` db:"validation_value_type" json:"validation_value_type" `
2022-07-13 20:29:34 +00:00
Index int32 ` db:"index" json:"index" `
2022-02-08 18:00:44 +00:00
}
2022-01-29 23:38:32 +00:00
type ParameterValue struct {
ID uuid . UUID ` db:"id" json:"id" `
CreatedAt time . Time ` db:"created_at" json:"created_at" `
UpdatedAt time . Time ` db:"updated_at" json:"updated_at" `
Scope ParameterScope ` db:"scope" json:"scope" `
2022-04-01 19:42:36 +00:00
ScopeID uuid . UUID ` db:"scope_id" json:"scope_id" `
2022-03-07 17:40:54 +00:00
Name string ` db:"name" json:"name" `
2022-01-29 23:38:32 +00:00
SourceScheme ParameterSourceScheme ` db:"source_scheme" json:"source_scheme" `
SourceValue string ` db:"source_value" json:"source_value" `
DestinationScheme ParameterDestinationScheme ` db:"destination_scheme" json:"destination_scheme" `
}
type ProvisionerDaemon struct {
2022-05-26 16:20:54 +00:00
ID uuid . UUID ` db:"id" json:"id" `
CreatedAt time . Time ` db:"created_at" json:"created_at" `
UpdatedAt sql . NullTime ` db:"updated_at" json:"updated_at" `
Name string ` db:"name" json:"name" `
Provisioners [ ] ProvisionerType ` db:"provisioners" json:"provisioners" `
2022-10-17 13:43:30 +00:00
ReplicaID uuid . NullUUID ` db:"replica_id" json:"replica_id" `
2022-11-16 22:34:06 +00:00
Tags dbtype . StringMap ` db:"tags" json:"tags" `
2022-01-29 23:38:32 +00:00
}
type ProvisionerJob struct {
2022-02-08 18:00:44 +00:00
ID uuid . UUID ` db:"id" json:"id" `
CreatedAt time . Time ` db:"created_at" json:"created_at" `
UpdatedAt time . Time ` db:"updated_at" json:"updated_at" `
StartedAt sql . NullTime ` db:"started_at" json:"started_at" `
2022-03-22 19:17:50 +00:00
CanceledAt sql . NullTime ` db:"canceled_at" json:"canceled_at" `
2022-02-08 18:00:44 +00:00
CompletedAt sql . NullTime ` db:"completed_at" json:"completed_at" `
Error sql . NullString ` db:"error" json:"error" `
2022-04-01 19:42:36 +00:00
OrganizationID uuid . UUID ` db:"organization_id" json:"organization_id" `
InitiatorID uuid . UUID ` db:"initiator_id" json:"initiator_id" `
2022-02-08 18:00:44 +00:00
Provisioner ProvisionerType ` db:"provisioner" json:"provisioner" `
StorageMethod ProvisionerStorageMethod ` db:"storage_method" json:"storage_method" `
Type ProvisionerJobType ` db:"type" json:"type" `
Input json . RawMessage ` db:"input" json:"input" `
WorkerID uuid . NullUUID ` db:"worker_id" json:"worker_id" `
2022-10-13 23:02:52 +00:00
FileID uuid . UUID ` db:"file_id" json:"file_id" `
2022-11-16 22:34:06 +00:00
Tags dbtype . StringMap ` db:"tags" json:"tags" `
2022-01-24 17:07:42 +00:00
}
2022-02-07 21:32:37 +00:00
type ProvisionerJobLog struct {
JobID uuid . UUID ` db:"job_id" json:"job_id" `
CreatedAt time . Time ` db:"created_at" json:"created_at" `
Source LogSource ` db:"source" json:"source" `
Level LogLevel ` db:"level" json:"level" `
2022-03-28 18:43:22 +00:00
Stage string ` db:"stage" json:"stage" `
2022-02-07 21:32:37 +00:00
Output string ` db:"output" json:"output" `
2022-11-07 02:50:34 +00:00
ID int64 ` db:"id" json:"id" `
2022-02-07 21:32:37 +00:00
}
2022-10-17 13:43:30 +00:00
type Replica struct {
ID uuid . UUID ` db:"id" json:"id" `
CreatedAt time . Time ` db:"created_at" json:"created_at" `
StartedAt time . Time ` db:"started_at" json:"started_at" `
StoppedAt sql . NullTime ` db:"stopped_at" json:"stopped_at" `
UpdatedAt time . Time ` db:"updated_at" json:"updated_at" `
Hostname string ` db:"hostname" json:"hostname" `
RegionID int32 ` db:"region_id" json:"region_id" `
RelayAddress string ` db:"relay_address" json:"relay_address" `
DatabaseLatency int32 ` db:"database_latency" json:"database_latency" `
Version string ` db:"version" json:"version" `
Error string ` db:"error" json:"error" `
}
2022-06-17 05:26:40 +00:00
type SiteConfig struct {
Key string ` db:"key" json:"key" `
Value string ` db:"value" json:"value" `
}
2022-04-06 17:42:40 +00:00
type Template struct {
2022-11-09 19:36:25 +00:00
ID uuid . UUID ` db:"id" json:"id" `
CreatedAt time . Time ` db:"created_at" json:"created_at" `
UpdatedAt time . Time ` db:"updated_at" json:"updated_at" `
OrganizationID uuid . UUID ` db:"organization_id" json:"organization_id" `
Deleted bool ` db:"deleted" json:"deleted" `
Name string ` db:"name" json:"name" `
Provisioner ProvisionerType ` db:"provisioner" json:"provisioner" `
ActiveVersionID uuid . UUID ` db:"active_version_id" json:"active_version_id" `
Description string ` db:"description" json:"description" `
// The default duration for auto-stop for workspaces created from this template.
2022-11-14 18:14:08 +00:00
DefaultTTL int64 ` db:"default_ttl" json:"default_ttl" `
2022-11-09 19:36:25 +00:00
CreatedBy uuid . UUID ` db:"created_by" json:"created_by" `
Icon string ` db:"icon" json:"icon" `
UserACL TemplateACL ` db:"user_acl" json:"user_acl" `
GroupACL TemplateACL ` db:"group_acl" json:"group_acl" `
2022-11-10 20:51:09 +00:00
// Display name is a custom, human-friendly template name that user can set.
DisplayName string ` db:"display_name" json:"display_name" `
2022-11-21 10:43:53 +00:00
// Allow users to cancel in-progress workspace jobs.
AllowUserCancelWorkspaceJobs bool ` db:"allow_user_cancel_workspace_jobs" json:"allow_user_cancel_workspace_jobs" `
2022-04-06 17:42:40 +00:00
}
type TemplateVersion struct {
ID uuid . UUID ` db:"id" json:"id" `
TemplateID uuid . NullUUID ` db:"template_id" json:"template_id" `
OrganizationID uuid . UUID ` db:"organization_id" json:"organization_id" `
CreatedAt time . Time ` db:"created_at" json:"created_at" `
UpdatedAt time . Time ` db:"updated_at" json:"updated_at" `
Name string ` db:"name" json:"name" `
2022-05-17 20:00:48 +00:00
Readme string ` db:"readme" json:"readme" `
2022-04-06 17:42:40 +00:00
JobID uuid . UUID ` db:"job_id" json:"job_id" `
2022-10-31 16:38:07 +00:00
CreatedBy uuid . UUID ` db:"created_by" json:"created_by" `
2022-04-06 17:42:40 +00:00
}
2023-01-17 10:22:11 +00:00
type TemplateVersionParameter struct {
TemplateVersionID uuid . UUID ` db:"template_version_id" json:"template_version_id" `
// Parameter name
Name string ` db:"name" json:"name" `
// Parameter description
Description string ` db:"description" json:"description" `
// Parameter type
Type string ` db:"type" json:"type" `
// Is parameter mutable?
Mutable bool ` db:"mutable" json:"mutable" `
// Default value
DefaultValue string ` db:"default_value" json:"default_value" `
// Icon
Icon string ` db:"icon" json:"icon" `
// Additional options
Options json . RawMessage ` db:"options" json:"options" `
// Validation: regex pattern
ValidationRegex string ` db:"validation_regex" json:"validation_regex" `
// Validation: minimum length of value
ValidationMin int32 ` db:"validation_min" json:"validation_min" `
// Validation: maximum length of value
ValidationMax int32 ` db:"validation_max" json:"validation_max" `
2023-01-24 13:22:00 +00:00
// Validation: error displayed when the regex does not match.
ValidationError string ` db:"validation_error" json:"validation_error" `
2023-01-17 10:22:11 +00:00
}
2022-01-12 18:04:11 +00:00
type User struct {
2022-09-04 16:44:27 +00:00
ID uuid . UUID ` db:"id" json:"id" `
Email string ` db:"email" json:"email" `
Username string ` db:"username" json:"username" `
HashedPassword [ ] byte ` db:"hashed_password" json:"hashed_password" `
CreatedAt time . Time ` db:"created_at" json:"created_at" `
UpdatedAt time . Time ` db:"updated_at" json:"updated_at" `
Status UserStatus ` db:"status" json:"status" `
2022-10-10 20:37:06 +00:00
RBACRoles pq . StringArray ` db:"rbac_roles" json:"rbac_roles" `
2022-09-04 16:44:27 +00:00
LoginType LoginType ` db:"login_type" json:"login_type" `
AvatarURL sql . NullString ` db:"avatar_url" json:"avatar_url" `
2022-09-12 23:24:20 +00:00
Deleted bool ` db:"deleted" json:"deleted" `
2022-09-26 15:31:03 +00:00
LastSeenAt time . Time ` db:"last_seen_at" json:"last_seen_at" `
2022-08-17 23:00:53 +00:00
}
type UserLink struct {
UserID uuid . UUID ` db:"user_id" json:"user_id" `
LoginType LoginType ` db:"login_type" json:"login_type" `
LinkedID string ` db:"linked_id" json:"linked_id" `
OAuthAccessToken string ` db:"oauth_access_token" json:"oauth_access_token" `
OAuthRefreshToken string ` db:"oauth_refresh_token" json:"oauth_refresh_token" `
OAuthExpiry time . Time ` db:"oauth_expiry" json:"oauth_expiry" `
2022-01-12 18:04:11 +00:00
}
2022-01-25 19:52:58 +00:00
type Workspace struct {
2022-04-07 09:03:35 +00:00
ID uuid . UUID ` db:"id" json:"id" `
CreatedAt time . Time ` db:"created_at" json:"created_at" `
UpdatedAt time . Time ` db:"updated_at" json:"updated_at" `
OwnerID uuid . UUID ` db:"owner_id" json:"owner_id" `
2022-04-25 21:11:03 +00:00
OrganizationID uuid . UUID ` db:"organization_id" json:"organization_id" `
2022-04-07 09:03:35 +00:00
TemplateID uuid . UUID ` db:"template_id" json:"template_id" `
Deleted bool ` db:"deleted" json:"deleted" `
Name string ` db:"name" json:"name" `
AutostartSchedule sql . NullString ` db:"autostart_schedule" json:"autostart_schedule" `
2022-05-19 19:09:27 +00:00
Ttl sql . NullInt64 ` db:"ttl" json:"ttl" `
2022-09-02 00:08:51 +00:00
LastUsedAt time . Time ` db:"last_used_at" json:"last_used_at" `
2022-01-25 19:52:58 +00:00
}
2022-03-07 17:40:54 +00:00
type WorkspaceAgent struct {
2022-09-01 01:09:44 +00:00
ID uuid . UUID ` db:"id" json:"id" `
CreatedAt time . Time ` db:"created_at" json:"created_at" `
UpdatedAt time . Time ` db:"updated_at" json:"updated_at" `
Name string ` db:"name" json:"name" `
FirstConnectedAt sql . NullTime ` db:"first_connected_at" json:"first_connected_at" `
LastConnectedAt sql . NullTime ` db:"last_connected_at" json:"last_connected_at" `
DisconnectedAt sql . NullTime ` db:"disconnected_at" json:"disconnected_at" `
ResourceID uuid . UUID ` db:"resource_id" json:"resource_id" `
AuthToken uuid . UUID ` db:"auth_token" json:"auth_token" `
AuthInstanceID sql . NullString ` db:"auth_instance_id" json:"auth_instance_id" `
Architecture string ` db:"architecture" json:"architecture" `
EnvironmentVariables pqtype . NullRawMessage ` db:"environment_variables" json:"environment_variables" `
OperatingSystem string ` db:"operating_system" json:"operating_system" `
StartupScript sql . NullString ` db:"startup_script" json:"startup_script" `
InstanceMetadata pqtype . NullRawMessage ` db:"instance_metadata" json:"instance_metadata" `
ResourceMetadata pqtype . NullRawMessage ` db:"resource_metadata" json:"resource_metadata" `
Directory string ` db:"directory" json:"directory" `
2022-08-31 15:33:50 +00:00
// Version tracks the version of the currently running workspace agent. Workspace agents register their version upon start.
2022-11-06 21:27:09 +00:00
Version string ` db:"version" json:"version" `
LastConnectedReplicaID uuid . NullUUID ` db:"last_connected_replica_id" json:"last_connected_replica_id" `
2022-11-09 15:27:05 +00:00
// Connection timeout in seconds, 0 means disabled.
ConnectionTimeoutSeconds int32 ` db:"connection_timeout_seconds" json:"connection_timeout_seconds" `
// URL for troubleshooting the agent.
TroubleshootingURL string ` db:"troubleshooting_url" json:"troubleshooting_url" `
2022-11-24 12:22:20 +00:00
// Path to file inside workspace containing the message of the day (MOTD) to show to the user when logging in via SSH.
MOTDFile string ` db:"motd_file" json:"motd_file" `
2023-01-24 12:24:27 +00:00
// The current lifecycle state reported by the workspace agent.
LifecycleState WorkspaceAgentLifecycleState ` db:"lifecycle_state" json:"lifecycle_state" `
2023-01-27 20:07:47 +00:00
// If true, the agent will not prevent login before it is ready (e.g. startup script is still executing).
LoginBeforeReady bool ` db:"login_before_ready" json:"login_before_ready" `
2023-01-24 12:24:27 +00:00
// The number of seconds to wait for the startup script to complete. If the script does not complete within this time, the agent lifecycle will be marked as start_timeout.
StartupScriptTimeoutSeconds int32 ` db:"startup_script_timeout_seconds" json:"startup_script_timeout_seconds" `
2022-03-07 17:40:54 +00:00
}
2022-06-04 20:13:37 +00:00
type WorkspaceApp struct {
2022-09-23 19:51:04 +00:00
ID uuid . UUID ` db:"id" json:"id" `
CreatedAt time . Time ` db:"created_at" json:"created_at" `
AgentID uuid . UUID ` db:"agent_id" json:"agent_id" `
2022-10-28 17:41:31 +00:00
DisplayName string ` db:"display_name" json:"display_name" `
2022-09-23 19:51:04 +00:00
Icon string ` db:"icon" json:"icon" `
Command sql . NullString ` db:"command" json:"command" `
Url sql . NullString ` db:"url" json:"url" `
HealthcheckUrl string ` db:"healthcheck_url" json:"healthcheck_url" `
HealthcheckInterval int32 ` db:"healthcheck_interval" json:"healthcheck_interval" `
HealthcheckThreshold int32 ` db:"healthcheck_threshold" json:"healthcheck_threshold" `
Health WorkspaceAppHealth ` db:"health" json:"health" `
2022-10-05 19:23:01 +00:00
Subdomain bool ` db:"subdomain" json:"subdomain" `
2022-10-14 16:46:38 +00:00
SharingLevel AppSharingLevel ` db:"sharing_level" json:"sharing_level" `
2022-10-28 17:41:31 +00:00
Slug string ` db:"slug" json:"slug" `
2022-12-14 21:54:18 +00:00
External bool ` db:"external" json:"external" `
2022-06-04 20:13:37 +00:00
}
2022-03-07 17:40:54 +00:00
type WorkspaceBuild struct {
2022-04-06 17:42:40 +00:00
ID uuid . UUID ` db:"id" json:"id" `
CreatedAt time . Time ` db:"created_at" json:"created_at" `
UpdatedAt time . Time ` db:"updated_at" json:"updated_at" `
WorkspaceID uuid . UUID ` db:"workspace_id" json:"workspace_id" `
TemplateVersionID uuid . UUID ` db:"template_version_id" json:"template_version_id" `
2022-05-18 16:33:33 +00:00
BuildNumber int32 ` db:"build_number" json:"build_number" `
2022-04-06 17:42:40 +00:00
Transition WorkspaceTransition ` db:"transition" json:"transition" `
InitiatorID uuid . UUID ` db:"initiator_id" json:"initiator_id" `
ProvisionerState [ ] byte ` db:"provisioner_state" json:"provisioner_state" `
JobID uuid . UUID ` db:"job_id" json:"job_id" `
2022-05-26 17:08:11 +00:00
Deadline time . Time ` db:"deadline" json:"deadline" `
2022-06-17 17:41:11 +00:00
Reason BuildReason ` db:"reason" json:"reason" `
2022-11-14 17:57:33 +00:00
DailyCost int32 ` db:"daily_cost" json:"daily_cost" `
2022-03-07 17:40:54 +00:00
}
2023-01-17 10:22:11 +00:00
type WorkspaceBuildParameter struct {
WorkspaceBuildID uuid . UUID ` db:"workspace_build_id" json:"workspace_build_id" `
// Parameter name
Name string ` db:"name" json:"name" `
// Parameter value
Value string ` db:"value" json:"value" `
}
2022-03-07 17:40:54 +00:00
type WorkspaceResource struct {
2022-11-01 21:51:57 +00:00
ID uuid . UUID ` db:"id" json:"id" `
CreatedAt time . Time ` db:"created_at" json:"created_at" `
JobID uuid . UUID ` db:"job_id" json:"job_id" `
Transition WorkspaceTransition ` db:"transition" json:"transition" `
Type string ` db:"type" json:"type" `
Name string ` db:"name" json:"name" `
Hide bool ` db:"hide" json:"hide" `
Icon string ` db:"icon" json:"icon" `
InstanceType sql . NullString ` db:"instance_type" json:"instance_type" `
2022-11-14 17:57:33 +00:00
DailyCost int32 ` db:"daily_cost" json:"daily_cost" `
2022-01-25 19:52:58 +00:00
}
2022-08-01 21:53:05 +00:00
type WorkspaceResourceMetadatum struct {
WorkspaceResourceID uuid . UUID ` db:"workspace_resource_id" json:"workspace_resource_id" `
Key string ` db:"key" json:"key" `
Value sql . NullString ` db:"value" json:"value" `
Sensitive bool ` db:"sensitive" json:"sensitive" `
2022-12-14 19:08:22 +00:00
ID int64 ` db:"id" json:"id" `
2022-08-01 21:53:05 +00:00
}