Movatterモバイル変換


[0]ホーム

URL:


database

package
v2.23.0Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2025 License:AGPL-3.0Imports:25Imported by:0

Details

Repository

github.com/coder/coder

Links

Documentation

Overview

Package database connects to external services for stateful storage.

Query functions are generated using sqlc.

To modify the database schema:1. Add a new migration using "create_migration.sh" in database/migrations/ and run "make gen" to generate models.2. Add/Edit queries in "query.sql" and run "make gen" to create Go code.

Code generated by scripts/dbgen/main.go. DO NOT EDIT.

Code generated by scripts/dbgen/main.go. DO NOT EDIT.

Index

Constants

View Source
const (LockIDDeploymentSetup =iota + 1LockIDEnterpriseDeploymentSetupLockIDDBRollupLockIDDBPurgeLockIDNotificationsReportGeneratorLockIDCryptoKeyRotationLockIDReconcilePrebuilds)

Well-known lock IDs for lock functions in the database. These should notchange. If locks are deprecated, they should be kept in this list to avoidreusing the same ID.

View Source
const EveryoneGroup = "Everyone"

Variables

This section is empty.

Functions

funcExpectOneadded inv2.13.0

func ExpectOne[Tany](ret []T, errerror) (T,error)

ExpectOne can be used to convert a ':many:' query into a ':one'query. To reduce the quantity of SQL queries, a :many with a filter is used.These filters sometimes are expected to return just 1 row.

A :many query will never return a sql.ErrNoRows, but a :one does.This function will correct the error for the empty set.

funcGenLockID

func GenLockID(namestring)int64

GenLockID generates a unique and consistent lock ID from a given string.

funcIncrementExecutionCountadded inv2.17.0

func IncrementExecutionCount(opts *TxOptions)

IncrementExecutionCount is a helper function for external packagesto increment the unexported count.Mainly for `dbmem`.

funcIsForeignKeyViolationadded inv2.2.0

func IsForeignKeyViolation(errerror, foreignKeyConstraints ...ForeignKeyConstraint)bool

IsForeignKeyViolation checks if the error is due to a foreign key violation.If one or more specific foreign key constraints are given as arguments,the error must be caused by one of them. If no constraints are given,this function returns true for any foreign key violation.

funcIsQueryCanceledError

func IsQueryCanceledError(errerror)bool

IsQueryCanceledError checks if the error is due to a query being canceled.

funcIsSerializedError

func IsSerializedError(errerror)bool

funcIsUniqueViolation

func IsUniqueViolation(errerror, uniqueConstraints ...UniqueConstraint)bool

IsUniqueViolation checks if the error is due to a unique violation.If one or more specific unique constraints are given as arguments,the error must be caused by one of them. If no constraints are given,this function returns true for any unique violation.

funcIsWorkspaceAgentLogsLimitError

func IsWorkspaceAgentLogsLimitError(errerror)bool

funcReadModifyUpdate

func ReadModifyUpdate(dbStore, f func(txStore)error,)error

ReadModifyUpdate is a helper function to run a db transaction that reads someobject(s), modifies some of the data, and writes the modified object(s) backto the database. It is run in a transaction at RepeatableRead isolation sothat if another database client also modifies the data we are writing andcommits, then the transaction is rolled back and restarted.

This is needed because we typically read all object columns, modify somesubset, and then write all columns. Consider an object with columns A, B andinitial values A=1, B=1. Two database clients work simultaneously, with oneclient attempting to set A=2, and another attempting to set B=2. They bothinitially read A=1, B=1, and then one writes A=2, B=1, and the other writesA=1, B=2. With default PostgreSQL isolation of ReadCommitted, both of thesetransactions would succeed and we end up with either A=2, B=1 or A=1, B=2.One or other client gets their transaction wiped out even though the datathey wanted to change didn't conflict.

If we run at RepeatableRead isolation, then one or other transaction willfail. Let's say the transaction that sets A=2 succeeds. Then the first B=2transaction fails, but here we retry. The second attempt we read A=2, B=1,then write A=2, B=2 as desired, and this succeeds.

funcWithSerialRetryCountadded inv2.17.0

func WithSerialRetryCount(countint) func(*sqlQuerier)

Types

typeAPIKey

type APIKey struct {IDstring `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.HashedSecret    []byte      `db:"hashed_secret" json:"hashed_secret"`UserIDuuid.UUID   `db:"user_id" json:"user_id"`LastUsedtime.Time   `db:"last_used" json:"last_used"`ExpiresAttime.Time   `db:"expires_at" json:"expires_at"`CreatedAttime.Time   `db:"created_at" json:"created_at"`UpdatedAttime.Time   `db:"updated_at" json:"updated_at"`LoginTypeLoginType   `db:"login_type" json:"login_type"`LifetimeSecondsint64       `db:"lifetime_seconds" json:"lifetime_seconds"`IPAddresspqtype.Inet `db:"ip_address" json:"ip_address"`ScopeAPIKeyScope `db:"scope" json:"scope"`TokenNamestring      `db:"token_name" json:"token_name"`}

func (APIKey)RBACObject

func (kAPIKey) RBACObject()rbac.Object

typeAPIKeyScope

type APIKeyScopestring
const (APIKeyScopeAllAPIKeyScope = "all"APIKeyScopeApplicationConnectAPIKeyScope = "application_connect")

funcAllAPIKeyScopeValues

func AllAPIKeyScopeValues() []APIKeyScope

func (*APIKeyScope)Scan

func (e *APIKeyScope) Scan(src interface{})error

func (APIKeyScope)ToRBAC

func (sAPIKeyScope) ToRBAC()rbac.ScopeName

func (APIKeyScope)Valid

func (eAPIKeyScope) Valid()bool

typeAcquireNotificationMessagesParamsadded inv2.13.0

type AcquireNotificationMessagesParams struct {NotifierIDuuid.UUID `db:"notifier_id" json:"notifier_id"`LeaseSecondsint32     `db:"lease_seconds" json:"lease_seconds"`MaxAttemptCountint32     `db:"max_attempt_count" json:"max_attempt_count"`Countint32     `db:"count" json:"count"`}

typeAcquireNotificationMessagesRowadded inv2.13.0

type AcquireNotificationMessagesRow struct {IDuuid.UUID          `db:"id" json:"id"`Payloadjson.RawMessage    `db:"payload" json:"payload"`MethodNotificationMethod `db:"method" json:"method"`AttemptCountint32              `db:"attempt_count" json:"attempt_count"`QueuedSecondsfloat64            `db:"queued_seconds" json:"queued_seconds"`TemplateIDuuid.UUID          `db:"template_id" json:"template_id"`TitleTemplatestring             `db:"title_template" json:"title_template"`BodyTemplatestring             `db:"body_template" json:"body_template"`Disabledbool               `db:"disabled" json:"disabled"`}

typeAcquireProvisionerJobParams

type AcquireProvisionerJobParams struct {StartedAtsql.NullTime      `db:"started_at" json:"started_at"`WorkerIDuuid.NullUUID     `db:"worker_id" json:"worker_id"`OrganizationIDuuid.UUID         `db:"organization_id" json:"organization_id"`Types           []ProvisionerType `db:"types" json:"types"`ProvisionerTagsjson.RawMessage   `db:"provisioner_tags" json:"provisioner_tags"`}

typeActions

type Actions []policy.Action

func (*Actions)Scan

func (a *Actions) Scan(src interface{})error

func (*Actions)Value

func (a *Actions) Value() (driver.Value,error)

typeActivityBumpWorkspaceParamsadded inv2.4.0

type ActivityBumpWorkspaceParams struct {NextAutostarttime.Time `db:"next_autostart" json:"next_autostart"`WorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`}

typeAgentIDNamePairadded inv2.18.0

type AgentIDNamePair struct {IDuuid.UUID `db:"id" json:"id"`Namestring    `db:"name" json:"name"`}

AgentIDNamePair is used as a result tuple for workspace and agent rows.

func (*AgentIDNamePair)Scanadded inv2.18.0

func (p *AgentIDNamePair) Scan(src interface{})error

func (AgentIDNamePair)Valueadded inv2.18.0

func (pAgentIDNamePair) Value() (driver.Value,error)

typeAgentKeyScopeEnumadded inv2.22.0

type AgentKeyScopeEnumstring
const (AgentKeyScopeEnumAllAgentKeyScopeEnum = "all"AgentKeyScopeEnumNoUserDataAgentKeyScopeEnum = "no_user_data")

funcAllAgentKeyScopeEnumValuesadded inv2.22.0

func AllAgentKeyScopeEnumValues() []AgentKeyScopeEnum

func (*AgentKeyScopeEnum)Scanadded inv2.22.0

func (e *AgentKeyScopeEnum) Scan(src interface{})error

func (AgentKeyScopeEnum)Validadded inv2.22.0

func (eAgentKeyScopeEnum) Valid()bool

typeAppSharingLevel

type AppSharingLevelstring
const (AppSharingLevelOwnerAppSharingLevel = "owner"AppSharingLevelAuthenticatedAppSharingLevel = "authenticated"AppSharingLevelPublicAppSharingLevel = "public")

funcAllAppSharingLevelValues

func AllAppSharingLevelValues() []AppSharingLevel

func (*AppSharingLevel)Scan

func (e *AppSharingLevel) Scan(src interface{})error

func (AppSharingLevel)Valid

func (eAppSharingLevel) Valid()bool

typeArchiveUnusedTemplateVersionsParamsadded inv2.3.0

type ArchiveUnusedTemplateVersionsParams struct {UpdatedAttime.Time                `db:"updated_at" json:"updated_at"`TemplateIDuuid.UUID                `db:"template_id" json:"template_id"`TemplateVersionIDuuid.UUID                `db:"template_version_id" json:"template_version_id"`JobStatusNullProvisionerJobStatus `db:"job_status" json:"job_status"`}

typeAuditAction

type AuditActionstring
const (AuditActionCreateAuditAction = "create"AuditActionWriteAuditAction = "write"AuditActionDeleteAuditAction = "delete"AuditActionStartAuditAction = "start"AuditActionStopAuditAction = "stop"AuditActionLoginAuditAction = "login"AuditActionLogoutAuditAction = "logout"AuditActionRegisterAuditAction = "register"AuditActionRequestPasswordResetAuditAction = "request_password_reset"AuditActionConnectAuditAction = "connect"AuditActionDisconnectAuditAction = "disconnect"AuditActionOpenAuditAction = "open"AuditActionCloseAuditAction = "close")

funcAllAuditActionValues

func AllAuditActionValues() []AuditAction

func (*AuditAction)Scan

func (e *AuditAction) Scan(src interface{})error

func (AuditAction)Valid

func (eAuditAction) Valid()bool

typeAuditLog

type AuditLog struct {IDuuid.UUID       `db:"id" json:"id"`Timetime.Time       `db:"time" json:"time"`UserIDuuid.UUID       `db:"user_id" json:"user_id"`OrganizationIDuuid.UUID       `db:"organization_id" json:"organization_id"`Ippqtype.Inet     `db:"ip" json:"ip"`UserAgentsql.NullString  `db:"user_agent" json:"user_agent"`ResourceTypeResourceType    `db:"resource_type" json:"resource_type"`ResourceIDuuid.UUID       `db:"resource_id" json:"resource_id"`ResourceTargetstring          `db:"resource_target" json:"resource_target"`ActionAuditAction     `db:"action" json:"action"`Diffjson.RawMessage `db:"diff" json:"diff"`StatusCodeint32           `db:"status_code" json:"status_code"`AdditionalFieldsjson.RawMessage `db:"additional_fields" json:"additional_fields"`RequestIDuuid.UUID       `db:"request_id" json:"request_id"`ResourceIconstring          `db:"resource_icon" json:"resource_icon"`}

func (AuditLog)RBACObjectadded inv2.14.0

func (wAuditLog) RBACObject()rbac.Object

typeAuditOAuthConvertState

type AuditOAuthConvertState struct {CreatedAttime.Time `db:"created_at" json:"created_at"`// The time at which the state string expires, a merge request times out if the user does not perform it quick enough.ExpiresAttime.Time `db:"expires_at" json:"expires_at"`FromLoginTypeLoginType `db:"from_login_type" json:"from_login_type"`// The login type the user is converting to. Should be github or oidc.ToLoginTypeLoginType `db:"to_login_type" json:"to_login_type"`UserIDuuid.UUID `db:"user_id" json:"user_id"`}

AuditOAuthConvertState is never stored in the database. It is stored in a cookieclientside as a JWT. This type is provided for audit logging purposes.

typeAuditableGroup

type AuditableGroup struct {GroupMembers []GroupMemberTable `json:"members"`}

typeAuditableOrganizationMemberadded inv2.13.0

type AuditableOrganizationMember struct {OrganizationMemberUsernamestring `json:"username"`}

typeAutomaticUpdatesadded inv2.3.0

type AutomaticUpdatesstring
const (AutomaticUpdatesAlwaysAutomaticUpdates = "always"AutomaticUpdatesNeverAutomaticUpdates = "never")

funcAllAutomaticUpdatesValuesadded inv2.3.0

func AllAutomaticUpdatesValues() []AutomaticUpdates

func (*AutomaticUpdates)Scanadded inv2.3.0

func (e *AutomaticUpdates) Scan(src interface{})error

func (AutomaticUpdates)Validadded inv2.3.0

func (eAutomaticUpdates) Valid()bool

typeBatchUpdateWorkspaceLastUsedAtParamsadded inv2.7.0

type BatchUpdateWorkspaceLastUsedAtParams struct {LastUsedAttime.Time   `db:"last_used_at" json:"last_used_at"`IDs        []uuid.UUID `db:"ids" json:"ids"`}

typeBatchUpdateWorkspaceNextStartAtParamsadded inv2.19.0

type BatchUpdateWorkspaceNextStartAtParams struct {IDs          []uuid.UUID `db:"ids" json:"ids"`NextStartAts []time.Time `db:"next_start_ats" json:"next_start_ats"`}

typeBuildReason

type BuildReasonstring
const (BuildReasonInitiatorBuildReason = "initiator"BuildReasonAutostartBuildReason = "autostart"BuildReasonAutostopBuildReason = "autostop"BuildReasonDormancyBuildReason = "dormancy"BuildReasonFailedstopBuildReason = "failedstop"BuildReasonAutodeleteBuildReason = "autodelete")

funcAllBuildReasonValues

func AllBuildReasonValues() []BuildReason

func (*BuildReason)Scan

func (e *BuildReason) Scan(src interface{})error

func (BuildReason)Valid

func (eBuildReason) Valid()bool

typeBulkMarkNotificationMessagesFailedParamsadded inv2.13.0

type BulkMarkNotificationMessagesFailedParams struct {MaxAttemptsint32                       `db:"max_attempts" json:"max_attempts"`RetryIntervalint32                       `db:"retry_interval" json:"retry_interval"`IDs           []uuid.UUID                 `db:"ids" json:"ids"`FailedAts     []time.Time                 `db:"failed_ats" json:"failed_ats"`Statuses      []NotificationMessageStatus `db:"statuses" json:"statuses"`StatusReasons []string                    `db:"status_reasons" json:"status_reasons"`}

typeBulkMarkNotificationMessagesSentParamsadded inv2.13.0

type BulkMarkNotificationMessagesSentParams struct {IDs     []uuid.UUID `db:"ids" json:"ids"`SentAts []time.Time `db:"sent_ats" json:"sent_ats"`}

typeChatadded inv2.22.1

type Chat struct {IDuuid.UUID `db:"id" json:"id"`OwnerIDuuid.UUID `db:"owner_id" json:"owner_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`Titlestring    `db:"title" json:"title"`}

func (Chat)RBACObjectadded inv2.23.0

func (cChat) RBACObject()rbac.Object

typeChatMessageadded inv2.22.1

type ChatMessage struct {IDint64           `db:"id" json:"id"`ChatIDuuid.UUID       `db:"chat_id" json:"chat_id"`CreatedAttime.Time       `db:"created_at" json:"created_at"`Modelstring          `db:"model" json:"model"`Providerstring          `db:"provider" json:"provider"`Contentjson.RawMessage `db:"content" json:"content"`}

typeClaimPrebuiltWorkspaceParamsadded inv2.22.0

type ClaimPrebuiltWorkspaceParams struct {NewUserIDuuid.UUID `db:"new_user_id" json:"new_user_id"`NewNamestring    `db:"new_name" json:"new_name"`PresetIDuuid.UUID `db:"preset_id" json:"preset_id"`}

typeClaimPrebuiltWorkspaceRowadded inv2.22.0

type ClaimPrebuiltWorkspaceRow struct {IDuuid.UUID `db:"id" json:"id"`Namestring    `db:"name" json:"name"`}

typeConnectorCreatoradded inv2.15.0

type ConnectorCreator interface {driver.DriverConnector(namestring) (driver.Connector,error)}

ConnectorCreator is a driver.Driver that can create a driver.Connector.

typeCountInProgressPrebuildsRowadded inv2.22.0

type CountInProgressPrebuildsRow struct {TemplateIDuuid.UUID           `db:"template_id" json:"template_id"`TemplateVersionIDuuid.UUID           `db:"template_version_id" json:"template_version_id"`TransitionWorkspaceTransition `db:"transition" json:"transition"`Countint32               `db:"count" json:"count"`PresetIDuuid.NullUUID       `db:"preset_id" json:"preset_id"`}

typeCryptoKeyadded inv2.16.0

type CryptoKey struct {FeatureCryptoKeyFeature `db:"feature" json:"feature"`Sequenceint32            `db:"sequence" json:"sequence"`Secretsql.NullString   `db:"secret" json:"secret"`SecretKeyIDsql.NullString   `db:"secret_key_id" json:"secret_key_id"`StartsAttime.Time        `db:"starts_at" json:"starts_at"`DeletesAtsql.NullTime     `db:"deletes_at" json:"deletes_at"`}

func (CryptoKey)CanSignadded inv2.17.0

func (kCryptoKey) CanSign(nowtime.Time)bool

func (CryptoKey)CanVerifyadded inv2.17.0

func (kCryptoKey) CanVerify(nowtime.Time)bool

func (CryptoKey)DecodeStringadded inv2.17.0

func (kCryptoKey) DecodeString() ([]byte,error)

func (CryptoKey)ExpiresAtadded inv2.16.0

func (kCryptoKey) ExpiresAt(keyDurationtime.Duration)time.Time

typeCryptoKeyFeatureadded inv2.16.0

type CryptoKeyFeaturestring
const (CryptoKeyFeatureWorkspaceAppsTokenCryptoKeyFeature = "workspace_apps_token"CryptoKeyFeatureWorkspaceAppsAPIKeyCryptoKeyFeature = "workspace_apps_api_key"CryptoKeyFeatureOIDCConvertCryptoKeyFeature = "oidc_convert"CryptoKeyFeatureTailnetResumeCryptoKeyFeature = "tailnet_resume")

funcAllCryptoKeyFeatureValuesadded inv2.16.0

func AllCryptoKeyFeatureValues() []CryptoKeyFeature

func (*CryptoKeyFeature)Scanadded inv2.16.0

func (e *CryptoKeyFeature) Scan(src interface{})error

func (CryptoKeyFeature)Validadded inv2.16.0

func (eCryptoKeyFeature) Valid()bool

typeCustomRoleadded inv2.12.0

type CustomRole struct {Namestring                `db:"name" json:"name"`DisplayNamestring                `db:"display_name" json:"display_name"`SitePermissionsCustomRolePermissions `db:"site_permissions" json:"site_permissions"`OrgPermissionsCustomRolePermissions `db:"org_permissions" json:"org_permissions"`UserPermissionsCustomRolePermissions `db:"user_permissions" json:"user_permissions"`CreatedAttime.Time             `db:"created_at" json:"created_at"`UpdatedAttime.Time             `db:"updated_at" json:"updated_at"`// Roles can optionally be scoped to an organizationOrganizationIDuuid.NullUUID `db:"organization_id" json:"organization_id"`// Custom roles ID is used purely for auditing purposes. Name is a better unique identifier.IDuuid.UUID `db:"id" json:"id"`}

Custom roles allow dynamic roles expanded at runtime

func (CustomRole)RoleIdentifieradded inv2.13.0

func (rCustomRole) RoleIdentifier()rbac.RoleIdentifier

typeCustomRolePermissionadded inv2.13.0

type CustomRolePermission struct {Negatebool          `json:"negate"`ResourceTypestring        `json:"resource_type"`Actionpolicy.Action `json:"action"`}

func (CustomRolePermission)Stringadded inv2.13.0

typeCustomRolePermissionsadded inv2.13.0

type CustomRolePermissions []CustomRolePermission

func (*CustomRolePermissions)Scanadded inv2.13.0

func (a *CustomRolePermissions) Scan(src interface{})error

func (CustomRolePermissions)Valueadded inv2.13.0

typeCustomRolesParamsadded inv2.12.0

type CustomRolesParams struct {LookupRoles     []NameOrganizationPair `db:"lookup_roles" json:"lookup_roles"`ExcludeOrgRolesbool                   `db:"exclude_org_roles" json:"exclude_org_roles"`OrganizationIDuuid.UUID              `db:"organization_id" json:"organization_id"`}

typeDBCryptKeyadded inv2.2.0

type DBCryptKey struct {// An integer used to identify the key.Numberint32 `db:"number" json:"number"`// If the key is active, the digest of the active key.ActiveKeyDigestsql.NullString `db:"active_key_digest" json:"active_key_digest"`// If the key has been revoked, the digest of the revoked key.RevokedKeyDigestsql.NullString `db:"revoked_key_digest" json:"revoked_key_digest"`// The time at which the key was created.CreatedAtsql.NullTime `db:"created_at" json:"created_at"`// The time at which the key was revoked.RevokedAtsql.NullTime `db:"revoked_at" json:"revoked_at"`// A column used to test the encryption.Teststring `db:"test" json:"test"`}

A table used to store the keys used to encrypt the database.

typeDBTX

type DBTX interface {ExecContext(context.Context,string, ...interface{}) (sql.Result,error)PrepareContext(context.Context,string) (*sql.Stmt,error)QueryContext(context.Context,string, ...interface{}) (*sql.Rows,error)QueryRowContext(context.Context,string, ...interface{}) *sql.RowSelectContext(ctxcontext.Context, dest interface{}, querystring, args ...interface{})errorGetContext(ctxcontext.Context, dest interface{}, querystring, args ...interface{})error}

DBTX represents a database connection or transaction.

typeDeleteAllTailnetClientSubscriptionsParamsadded inv2.2.0

type DeleteAllTailnetClientSubscriptionsParams struct {ClientIDuuid.UUID `db:"client_id" json:"client_id"`CoordinatorIDuuid.UUID `db:"coordinator_id" json:"coordinator_id"`}

typeDeleteAllTailnetTunnelsParamsadded inv2.4.0

type DeleteAllTailnetTunnelsParams struct {CoordinatorIDuuid.UUID `db:"coordinator_id" json:"coordinator_id"`SrcIDuuid.UUID `db:"src_id" json:"src_id"`}

typeDeleteCryptoKeyParamsadded inv2.16.0

type DeleteCryptoKeyParams struct {FeatureCryptoKeyFeature `db:"feature" json:"feature"`Sequenceint32            `db:"sequence" json:"sequence"`}

typeDeleteCustomRoleParamsadded inv2.15.0

type DeleteCustomRoleParams struct {Namestring        `db:"name" json:"name"`OrganizationIDuuid.NullUUID `db:"organization_id" json:"organization_id"`}

typeDeleteExternalAuthLinkParamsadded inv2.5.0

type DeleteExternalAuthLinkParams struct {ProviderIDstring    `db:"provider_id" json:"provider_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`}

typeDeleteGroupMemberFromGroupParams

type DeleteGroupMemberFromGroupParams struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`GroupIDuuid.UUID `db:"group_id" json:"group_id"`}

typeDeleteOAuth2ProviderAppCodesByAppAndUserIDParamsadded inv2.9.0

type DeleteOAuth2ProviderAppCodesByAppAndUserIDParams struct {AppIDuuid.UUID `db:"app_id" json:"app_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`}

typeDeleteOAuth2ProviderAppTokensByAppAndUserIDParamsadded inv2.9.0

type DeleteOAuth2ProviderAppTokensByAppAndUserIDParams struct {AppIDuuid.UUID `db:"app_id" json:"app_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`}

typeDeleteOrganizationMemberParamsadded inv2.13.0

type DeleteOrganizationMemberParams struct {OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`}

typeDeleteTailnetAgentParams

type DeleteTailnetAgentParams struct {IDuuid.UUID `db:"id" json:"id"`CoordinatorIDuuid.UUID `db:"coordinator_id" json:"coordinator_id"`}

typeDeleteTailnetAgentRow

type DeleteTailnetAgentRow struct {IDuuid.UUID `db:"id" json:"id"`CoordinatorIDuuid.UUID `db:"coordinator_id" json:"coordinator_id"`}

typeDeleteTailnetClientParams

type DeleteTailnetClientParams struct {IDuuid.UUID `db:"id" json:"id"`CoordinatorIDuuid.UUID `db:"coordinator_id" json:"coordinator_id"`}

typeDeleteTailnetClientRow

type DeleteTailnetClientRow struct {IDuuid.UUID `db:"id" json:"id"`CoordinatorIDuuid.UUID `db:"coordinator_id" json:"coordinator_id"`}

typeDeleteTailnetClientSubscriptionParamsadded inv2.2.0

type DeleteTailnetClientSubscriptionParams struct {ClientIDuuid.UUID `db:"client_id" json:"client_id"`AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`CoordinatorIDuuid.UUID `db:"coordinator_id" json:"coordinator_id"`}

typeDeleteTailnetPeerParamsadded inv2.4.0

type DeleteTailnetPeerParams struct {IDuuid.UUID `db:"id" json:"id"`CoordinatorIDuuid.UUID `db:"coordinator_id" json:"coordinator_id"`}

typeDeleteTailnetPeerRowadded inv2.4.0

type DeleteTailnetPeerRow struct {IDuuid.UUID `db:"id" json:"id"`CoordinatorIDuuid.UUID `db:"coordinator_id" json:"coordinator_id"`}

typeDeleteTailnetTunnelParamsadded inv2.4.0

type DeleteTailnetTunnelParams struct {CoordinatorIDuuid.UUID `db:"coordinator_id" json:"coordinator_id"`SrcIDuuid.UUID `db:"src_id" json:"src_id"`DstIDuuid.UUID `db:"dst_id" json:"dst_id"`}

typeDeleteTailnetTunnelRowadded inv2.4.0

type DeleteTailnetTunnelRow struct {CoordinatorIDuuid.UUID `db:"coordinator_id" json:"coordinator_id"`SrcIDuuid.UUID `db:"src_id" json:"src_id"`DstIDuuid.UUID `db:"dst_id" json:"dst_id"`}

typeDeleteWebpushSubscriptionByUserIDAndEndpointParamsadded inv2.21.0

type DeleteWebpushSubscriptionByUserIDAndEndpointParams struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`Endpointstring    `db:"endpoint" json:"endpoint"`}

typeDeleteWorkspaceAgentPortShareParamsadded inv2.9.0

type DeleteWorkspaceAgentPortShareParams struct {WorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`AgentNamestring    `db:"agent_name" json:"agent_name"`Portint32     `db:"port" json:"port"`}

typeDialerConnectoradded inv2.15.0

type DialerConnector interface {driver.ConnectorDialer(dialerpq.Dialer)}

DialerConnector is a driver.Connector that can set a pq.Dialer.

typeDisplayAppadded inv2.1.5

type DisplayAppstring
const (DisplayAppVscodeDisplayApp = "vscode"DisplayAppVscodeInsidersDisplayApp = "vscode_insiders"DisplayAppWebTerminalDisplayApp = "web_terminal"DisplayAppSSHHelperDisplayApp = "ssh_helper"DisplayAppPortForwardingHelperDisplayApp = "port_forwarding_helper")

funcAllDisplayAppValuesadded inv2.1.5

func AllDisplayAppValues() []DisplayApp

func (*DisplayApp)Scanadded inv2.1.5

func (e *DisplayApp) Scan(src interface{})error

func (DisplayApp)Validadded inv2.1.5

func (eDisplayApp) Valid()bool

typeEnqueueNotificationMessageParamsadded inv2.13.0

type EnqueueNotificationMessageParams struct {IDuuid.UUID          `db:"id" json:"id"`NotificationTemplateIDuuid.UUID          `db:"notification_template_id" json:"notification_template_id"`UserIDuuid.UUID          `db:"user_id" json:"user_id"`MethodNotificationMethod `db:"method" json:"method"`Payloadjson.RawMessage    `db:"payload" json:"payload"`Targets                []uuid.UUID        `db:"targets" json:"targets"`CreatedBystring             `db:"created_by" json:"created_by"`CreatedAttime.Time          `db:"created_at" json:"created_at"`}

typeExternalAuthLinkadded inv2.2.1

type ExternalAuthLink struct {ProviderIDstring    `db:"provider_id" json:"provider_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`OAuthAccessTokenstring    `db:"oauth_access_token" json:"oauth_access_token"`OAuthRefreshTokenstring    `db:"oauth_refresh_token" json:"oauth_refresh_token"`OAuthExpirytime.Time `db:"oauth_expiry" json:"oauth_expiry"`// The ID of the key used to encrypt the OAuth access token. If this is NULL, the access token is not encryptedOAuthAccessTokenKeyIDsql.NullString `db:"oauth_access_token_key_id" json:"oauth_access_token_key_id"`// The ID of the key used to encrypt the OAuth refresh token. If this is NULL, the refresh token is not encryptedOAuthRefreshTokenKeyIDsql.NullString        `db:"oauth_refresh_token_key_id" json:"oauth_refresh_token_key_id"`OAuthExtrapqtype.NullRawMessage `db:"oauth_extra" json:"oauth_extra"`}

func (ExternalAuthLink)OAuthTokenadded inv2.8.0

func (uExternalAuthLink) OAuthToken() *oauth2.Token

func (ExternalAuthLink)RBACObjectadded inv2.2.1

func (uExternalAuthLink) RBACObject()rbac.Object

typeExternalAuthProvideradded inv2.9.0

type ExternalAuthProvider struct {IDstring `json:"id"`Optionalbool   `json:"optional,omitempty"`}

typeFetchNewMessageMetadataParamsadded inv2.13.0

type FetchNewMessageMetadataParams struct {NotificationTemplateIDuuid.UUID `db:"notification_template_id" json:"notification_template_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`}

typeFetchNewMessageMetadataRowadded inv2.13.0

type FetchNewMessageMetadataRow struct {NotificationNamestring                 `db:"notification_name" json:"notification_name"`NotificationTemplateIDuuid.UUID              `db:"notification_template_id" json:"notification_template_id"`Actions                []byte                 `db:"actions" json:"actions"`CustomMethodNullNotificationMethod `db:"custom_method" json:"custom_method"`UserIDuuid.UUID              `db:"user_id" json:"user_id"`UserEmailstring                 `db:"user_email" json:"user_email"`UserNamestring                 `db:"user_name" json:"user_name"`UserUsernamestring                 `db:"user_username" json:"user_username"`}

typeFile

type File struct {Hashstring    `db:"hash" json:"hash"`CreatedAttime.Time `db:"created_at" json:"created_at"`CreatedByuuid.UUID `db:"created_by" json:"created_by"`Mimetypestring    `db:"mimetype" json:"mimetype"`Data      []byte    `db:"data" json:"data"`IDuuid.UUID `db:"id" json:"id"`}

func (File)RBACObject

func (fFile) RBACObject()rbac.Object

typeForeignKeyConstraintadded inv2.2.0

type ForeignKeyConstraintstring

ForeignKeyConstraint represents a named foreign key constraint on a table.

const (ForeignKeyAPIKeysUserIDUUIDForeignKeyConstraint = "api_keys_user_id_uuid_fkey"// ALTER TABLE ONLY api_keys ADD CONSTRAINT api_keys_user_id_uuid_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;ForeignKeyChatMessagesChatIDForeignKeyConstraint = "chat_messages_chat_id_fkey"// ALTER TABLE ONLY chat_messages ADD CONSTRAINT chat_messages_chat_id_fkey FOREIGN KEY (chat_id) REFERENCES chats(id) ON DELETE CASCADE;ForeignKeyChatsOwnerIDForeignKeyConstraint = "chats_owner_id_fkey"// ALTER TABLE ONLY chats ADD CONSTRAINT chats_owner_id_fkey FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE CASCADE;ForeignKeyCryptoKeysSecretKeyIDForeignKeyConstraint = "crypto_keys_secret_key_id_fkey"// ALTER TABLE ONLY crypto_keys ADD CONSTRAINT crypto_keys_secret_key_id_fkey FOREIGN KEY (secret_key_id) REFERENCES dbcrypt_keys(active_key_digest);ForeignKeyGitAuthLinksOauthAccessTokenKeyIDForeignKeyConstraint = "git_auth_links_oauth_access_token_key_id_fkey"// ALTER TABLE ONLY external_auth_links ADD CONSTRAINT git_auth_links_oauth_access_token_key_id_fkey FOREIGN KEY (oauth_access_token_key_id) REFERENCES dbcrypt_keys(active_key_digest);ForeignKeyGitAuthLinksOauthRefreshTokenKeyIDForeignKeyConstraint = "git_auth_links_oauth_refresh_token_key_id_fkey"// ALTER TABLE ONLY external_auth_links ADD CONSTRAINT git_auth_links_oauth_refresh_token_key_id_fkey FOREIGN KEY (oauth_refresh_token_key_id) REFERENCES dbcrypt_keys(active_key_digest);ForeignKeyGitSSHKeysUserIDForeignKeyConstraint = "gitsshkeys_user_id_fkey"// ALTER TABLE ONLY gitsshkeys ADD CONSTRAINT gitsshkeys_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);ForeignKeyGroupMembersGroupIDForeignKeyConstraint = "group_members_group_id_fkey"// ALTER TABLE ONLY group_members ADD CONSTRAINT group_members_group_id_fkey FOREIGN KEY (group_id) REFERENCES groups(id) ON DELETE CASCADE;ForeignKeyGroupMembersUserIDForeignKeyConstraint = "group_members_user_id_fkey"// ALTER TABLE ONLY group_members ADD CONSTRAINT group_members_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;ForeignKeyGroupsOrganizationIDForeignKeyConstraint = "groups_organization_id_fkey"// ALTER TABLE ONLY groups ADD CONSTRAINT groups_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE;ForeignKeyInboxNotificationsTemplateIDForeignKeyConstraint = "inbox_notifications_template_id_fkey"// ALTER TABLE ONLY inbox_notifications ADD CONSTRAINT inbox_notifications_template_id_fkey FOREIGN KEY (template_id) REFERENCES notification_templates(id) ON DELETE CASCADE;ForeignKeyInboxNotificationsUserIDForeignKeyConstraint = "inbox_notifications_user_id_fkey"// ALTER TABLE ONLY inbox_notifications ADD CONSTRAINT inbox_notifications_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;ForeignKeyJfrogXrayScansAgentIDForeignKeyConstraint = "jfrog_xray_scans_agent_id_fkey"// ALTER TABLE ONLY jfrog_xray_scans ADD CONSTRAINT jfrog_xray_scans_agent_id_fkey FOREIGN KEY (agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE;ForeignKeyJfrogXrayScansWorkspaceIDForeignKeyConstraint = "jfrog_xray_scans_workspace_id_fkey"// ALTER TABLE ONLY jfrog_xray_scans ADD CONSTRAINT jfrog_xray_scans_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspaces(id) ON DELETE CASCADE;ForeignKeyNotificationMessagesNotificationTemplateIDForeignKeyConstraint = "notification_messages_notification_template_id_fkey"// ALTER TABLE ONLY notification_messages ADD CONSTRAINT notification_messages_notification_template_id_fkey FOREIGN KEY (notification_template_id) REFERENCES notification_templates(id) ON DELETE CASCADE;ForeignKeyNotificationMessagesUserIDForeignKeyConstraint = "notification_messages_user_id_fkey"// ALTER TABLE ONLY notification_messages ADD CONSTRAINT notification_messages_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;ForeignKeyNotificationPreferencesNotificationTemplateIDForeignKeyConstraint = "notification_preferences_notification_template_id_fkey"// ALTER TABLE ONLY notification_preferences ADD CONSTRAINT notification_preferences_notification_template_id_fkey FOREIGN KEY (notification_template_id) REFERENCES notification_templates(id) ON DELETE CASCADE;ForeignKeyNotificationPreferencesUserIDForeignKeyConstraint = "notification_preferences_user_id_fkey"// ALTER TABLE ONLY notification_preferences ADD CONSTRAINT notification_preferences_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;ForeignKeyOauth2ProviderAppCodesAppIDForeignKeyConstraint = "oauth2_provider_app_codes_app_id_fkey"// ALTER TABLE ONLY oauth2_provider_app_codes ADD CONSTRAINT oauth2_provider_app_codes_app_id_fkey FOREIGN KEY (app_id) REFERENCES oauth2_provider_apps(id) ON DELETE CASCADE;ForeignKeyOauth2ProviderAppCodesUserIDForeignKeyConstraint = "oauth2_provider_app_codes_user_id_fkey"// ALTER TABLE ONLY oauth2_provider_app_codes ADD CONSTRAINT oauth2_provider_app_codes_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;ForeignKeyOauth2ProviderAppSecretsAppIDForeignKeyConstraint = "oauth2_provider_app_secrets_app_id_fkey"// ALTER TABLE ONLY oauth2_provider_app_secrets ADD CONSTRAINT oauth2_provider_app_secrets_app_id_fkey FOREIGN KEY (app_id) REFERENCES oauth2_provider_apps(id) ON DELETE CASCADE;ForeignKeyOauth2ProviderAppTokensAPIKeyIDForeignKeyConstraint = "oauth2_provider_app_tokens_api_key_id_fkey"// ALTER TABLE ONLY oauth2_provider_app_tokens ADD CONSTRAINT oauth2_provider_app_tokens_api_key_id_fkey FOREIGN KEY (api_key_id) REFERENCES api_keys(id) ON DELETE CASCADE;ForeignKeyOauth2ProviderAppTokensAppSecretIDForeignKeyConstraint = "oauth2_provider_app_tokens_app_secret_id_fkey"// ALTER TABLE ONLY oauth2_provider_app_tokens ADD CONSTRAINT oauth2_provider_app_tokens_app_secret_id_fkey FOREIGN KEY (app_secret_id) REFERENCES oauth2_provider_app_secrets(id) ON DELETE CASCADE;ForeignKeyOrganizationMembersOrganizationIDUUIDForeignKeyConstraint = "organization_members_organization_id_uuid_fkey"// ALTER TABLE ONLY organization_members ADD CONSTRAINT organization_members_organization_id_uuid_fkey FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE;ForeignKeyOrganizationMembersUserIDUUIDForeignKeyConstraint = "organization_members_user_id_uuid_fkey"// ALTER TABLE ONLY organization_members ADD CONSTRAINT organization_members_user_id_uuid_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;ForeignKeyParameterSchemasJobIDForeignKeyConstraint = "parameter_schemas_job_id_fkey"// ALTER TABLE ONLY parameter_schemas ADD CONSTRAINT parameter_schemas_job_id_fkey FOREIGN KEY (job_id) REFERENCES provisioner_jobs(id) ON DELETE CASCADE;ForeignKeyProvisionerDaemonsKeyIDForeignKeyConstraint = "provisioner_daemons_key_id_fkey"// ALTER TABLE ONLY provisioner_daemons ADD CONSTRAINT provisioner_daemons_key_id_fkey FOREIGN KEY (key_id) REFERENCES provisioner_keys(id) ON DELETE CASCADE;ForeignKeyProvisionerDaemonsOrganizationIDForeignKeyConstraint = "provisioner_daemons_organization_id_fkey"// ALTER TABLE ONLY provisioner_daemons ADD CONSTRAINT provisioner_daemons_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE;ForeignKeyProvisionerJobLogsJobIDForeignKeyConstraint = "provisioner_job_logs_job_id_fkey"// ALTER TABLE ONLY provisioner_job_logs ADD CONSTRAINT provisioner_job_logs_job_id_fkey FOREIGN KEY (job_id) REFERENCES provisioner_jobs(id) ON DELETE CASCADE;ForeignKeyProvisionerJobTimingsJobIDForeignKeyConstraint = "provisioner_job_timings_job_id_fkey"// ALTER TABLE ONLY provisioner_job_timings ADD CONSTRAINT provisioner_job_timings_job_id_fkey FOREIGN KEY (job_id) REFERENCES provisioner_jobs(id) ON DELETE CASCADE;ForeignKeyProvisionerJobsOrganizationIDForeignKeyConstraint = "provisioner_jobs_organization_id_fkey"// ALTER TABLE ONLY provisioner_jobs ADD CONSTRAINT provisioner_jobs_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE;ForeignKeyProvisionerKeysOrganizationIDForeignKeyConstraint = "provisioner_keys_organization_id_fkey"// ALTER TABLE ONLY provisioner_keys ADD CONSTRAINT provisioner_keys_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE;ForeignKeyTailnetAgentsCoordinatorIDForeignKeyConstraint = "tailnet_agents_coordinator_id_fkey"// ALTER TABLE ONLY tailnet_agents ADD CONSTRAINT tailnet_agents_coordinator_id_fkey FOREIGN KEY (coordinator_id) REFERENCES tailnet_coordinators(id) ON DELETE CASCADE;ForeignKeyTailnetClientSubscriptionsCoordinatorIDForeignKeyConstraint = "tailnet_client_subscriptions_coordinator_id_fkey"// ALTER TABLE ONLY tailnet_client_subscriptions ADD CONSTRAINT tailnet_client_subscriptions_coordinator_id_fkey FOREIGN KEY (coordinator_id) REFERENCES tailnet_coordinators(id) ON DELETE CASCADE;ForeignKeyTailnetClientsCoordinatorIDForeignKeyConstraint = "tailnet_clients_coordinator_id_fkey"// ALTER TABLE ONLY tailnet_clients ADD CONSTRAINT tailnet_clients_coordinator_id_fkey FOREIGN KEY (coordinator_id) REFERENCES tailnet_coordinators(id) ON DELETE CASCADE;ForeignKeyTailnetPeersCoordinatorIDForeignKeyConstraint = "tailnet_peers_coordinator_id_fkey"// ALTER TABLE ONLY tailnet_peers ADD CONSTRAINT tailnet_peers_coordinator_id_fkey FOREIGN KEY (coordinator_id) REFERENCES tailnet_coordinators(id) ON DELETE CASCADE;ForeignKeyTailnetTunnelsCoordinatorIDForeignKeyConstraint = "tailnet_tunnels_coordinator_id_fkey"// ALTER TABLE ONLY tailnet_tunnels ADD CONSTRAINT tailnet_tunnels_coordinator_id_fkey FOREIGN KEY (coordinator_id) REFERENCES tailnet_coordinators(id) ON DELETE CASCADE;ForeignKeyTemplateVersionParametersTemplateVersionIDForeignKeyConstraint = "template_version_parameters_template_version_id_fkey"// ALTER TABLE ONLY template_version_parameters ADD CONSTRAINT template_version_parameters_template_version_id_fkey FOREIGN KEY (template_version_id) REFERENCES template_versions(id) ON DELETE CASCADE;ForeignKeyTemplateVersionPresetParametTemplateVersionPresetIDForeignKeyConstraint = "template_version_preset_paramet_template_version_preset_id_fkey"// ALTER TABLE ONLY template_version_preset_parameters ADD CONSTRAINT template_version_preset_paramet_template_version_preset_id_fkey FOREIGN KEY (template_version_preset_id) REFERENCES template_version_presets(id) ON DELETE CASCADE;ForeignKeyTemplateVersionPresetsTemplateVersionIDForeignKeyConstraint = "template_version_presets_template_version_id_fkey"// ALTER TABLE ONLY template_version_presets ADD CONSTRAINT template_version_presets_template_version_id_fkey FOREIGN KEY (template_version_id) REFERENCES template_versions(id) ON DELETE CASCADE;ForeignKeyTemplateVersionTerraformValuesCachedModuleFilesForeignKeyConstraint = "template_version_terraform_values_cached_module_files_fkey"// ALTER TABLE ONLY template_version_terraform_values ADD CONSTRAINT template_version_terraform_values_cached_module_files_fkey FOREIGN KEY (cached_module_files) REFERENCES files(id);ForeignKeyTemplateVersionTerraformValuesTemplateVersionIDForeignKeyConstraint = "template_version_terraform_values_template_version_id_fkey"// ALTER TABLE ONLY template_version_terraform_values ADD CONSTRAINT template_version_terraform_values_template_version_id_fkey FOREIGN KEY (template_version_id) REFERENCES template_versions(id) ON DELETE CASCADE;ForeignKeyTemplateVersionVariablesTemplateVersionIDForeignKeyConstraint = "template_version_variables_template_version_id_fkey"// ALTER TABLE ONLY template_version_variables ADD CONSTRAINT template_version_variables_template_version_id_fkey FOREIGN KEY (template_version_id) REFERENCES template_versions(id) ON DELETE CASCADE;ForeignKeyTemplateVersionWorkspaceTagsTemplateVersionIDForeignKeyConstraint = "template_version_workspace_tags_template_version_id_fkey"// ALTER TABLE ONLY template_version_workspace_tags ADD CONSTRAINT template_version_workspace_tags_template_version_id_fkey FOREIGN KEY (template_version_id) REFERENCES template_versions(id) ON DELETE CASCADE;ForeignKeyTemplateVersionsCreatedByForeignKeyConstraint = "template_versions_created_by_fkey"// ALTER TABLE ONLY template_versions ADD CONSTRAINT template_versions_created_by_fkey FOREIGN KEY (created_by) REFERENCES users(id) ON DELETE RESTRICT;ForeignKeyTemplateVersionsOrganizationIDForeignKeyConstraint = "template_versions_organization_id_fkey"// ALTER TABLE ONLY template_versions ADD CONSTRAINT template_versions_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE;ForeignKeyTemplateVersionsTemplateIDForeignKeyConstraint = "template_versions_template_id_fkey"// ALTER TABLE ONLY template_versions ADD CONSTRAINT template_versions_template_id_fkey FOREIGN KEY (template_id) REFERENCES templates(id) ON DELETE CASCADE;ForeignKeyTemplatesCreatedByForeignKeyConstraint = "templates_created_by_fkey"// ALTER TABLE ONLY templates ADD CONSTRAINT templates_created_by_fkey FOREIGN KEY (created_by) REFERENCES users(id) ON DELETE RESTRICT;ForeignKeyTemplatesOrganizationIDForeignKeyConstraint = "templates_organization_id_fkey"// ALTER TABLE ONLY templates ADD CONSTRAINT templates_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE;ForeignKeyUserConfigsUserIDForeignKeyConstraint = "user_configs_user_id_fkey"// ALTER TABLE ONLY user_configs ADD CONSTRAINT user_configs_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;ForeignKeyUserDeletedUserIDForeignKeyConstraint = "user_deleted_user_id_fkey"// ALTER TABLE ONLY user_deleted ADD CONSTRAINT user_deleted_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);ForeignKeyUserLinksOauthAccessTokenKeyIDForeignKeyConstraint = "user_links_oauth_access_token_key_id_fkey"// ALTER TABLE ONLY user_links ADD CONSTRAINT user_links_oauth_access_token_key_id_fkey FOREIGN KEY (oauth_access_token_key_id) REFERENCES dbcrypt_keys(active_key_digest);ForeignKeyUserLinksOauthRefreshTokenKeyIDForeignKeyConstraint = "user_links_oauth_refresh_token_key_id_fkey"// ALTER TABLE ONLY user_links ADD CONSTRAINT user_links_oauth_refresh_token_key_id_fkey FOREIGN KEY (oauth_refresh_token_key_id) REFERENCES dbcrypt_keys(active_key_digest);ForeignKeyUserLinksUserIDForeignKeyConstraint = "user_links_user_id_fkey"// ALTER TABLE ONLY user_links ADD CONSTRAINT user_links_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;ForeignKeyUserStatusChangesUserIDForeignKeyConstraint = "user_status_changes_user_id_fkey"// ALTER TABLE ONLY user_status_changes ADD CONSTRAINT user_status_changes_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);ForeignKeyWebpushSubscriptionsUserIDForeignKeyConstraint = "webpush_subscriptions_user_id_fkey"// ALTER TABLE ONLY webpush_subscriptions ADD CONSTRAINT webpush_subscriptions_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;ForeignKeyWorkspaceAgentDevcontainersWorkspaceAgentIDForeignKeyConstraint = "workspace_agent_devcontainers_workspace_agent_id_fkey"// ALTER TABLE ONLY workspace_agent_devcontainers ADD CONSTRAINT workspace_agent_devcontainers_workspace_agent_id_fkey FOREIGN KEY (workspace_agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE;ForeignKeyWorkspaceAgentLogSourcesWorkspaceAgentIDForeignKeyConstraint = "workspace_agent_log_sources_workspace_agent_id_fkey"// ALTER TABLE ONLY workspace_agent_log_sources ADD CONSTRAINT workspace_agent_log_sources_workspace_agent_id_fkey FOREIGN KEY (workspace_agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE;ForeignKeyWorkspaceAgentMemoryResourceMonitorsAgentIDForeignKeyConstraint = "workspace_agent_memory_resource_monitors_agent_id_fkey"// ALTER TABLE ONLY workspace_agent_memory_resource_monitors ADD CONSTRAINT workspace_agent_memory_resource_monitors_agent_id_fkey FOREIGN KEY (agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE;ForeignKeyWorkspaceAgentMetadataWorkspaceAgentIDForeignKeyConstraint = "workspace_agent_metadata_workspace_agent_id_fkey"// ALTER TABLE ONLY workspace_agent_metadata ADD CONSTRAINT workspace_agent_metadata_workspace_agent_id_fkey FOREIGN KEY (workspace_agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE;ForeignKeyWorkspaceAgentPortShareWorkspaceIDForeignKeyConstraint = "workspace_agent_port_share_workspace_id_fkey"// ALTER TABLE ONLY workspace_agent_port_share ADD CONSTRAINT workspace_agent_port_share_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspaces(id) ON DELETE CASCADE;ForeignKeyWorkspaceAgentScriptTimingsScriptIDForeignKeyConstraint = "workspace_agent_script_timings_script_id_fkey"// ALTER TABLE ONLY workspace_agent_script_timings ADD CONSTRAINT workspace_agent_script_timings_script_id_fkey FOREIGN KEY (script_id) REFERENCES workspace_agent_scripts(id) ON DELETE CASCADE;ForeignKeyWorkspaceAgentScriptsWorkspaceAgentIDForeignKeyConstraint = "workspace_agent_scripts_workspace_agent_id_fkey"// ALTER TABLE ONLY workspace_agent_scripts ADD CONSTRAINT workspace_agent_scripts_workspace_agent_id_fkey FOREIGN KEY (workspace_agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE;ForeignKeyWorkspaceAgentStartupLogsAgentIDForeignKeyConstraint = "workspace_agent_startup_logs_agent_id_fkey"// ALTER TABLE ONLY workspace_agent_logs ADD CONSTRAINT workspace_agent_startup_logs_agent_id_fkey FOREIGN KEY (agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE;ForeignKeyWorkspaceAgentVolumeResourceMonitorsAgentIDForeignKeyConstraint = "workspace_agent_volume_resource_monitors_agent_id_fkey"// ALTER TABLE ONLY workspace_agent_volume_resource_monitors ADD CONSTRAINT workspace_agent_volume_resource_monitors_agent_id_fkey FOREIGN KEY (agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE;ForeignKeyWorkspaceAgentsParentIDForeignKeyConstraint = "workspace_agents_parent_id_fkey"// ALTER TABLE ONLY workspace_agents ADD CONSTRAINT workspace_agents_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE;ForeignKeyWorkspaceAgentsResourceIDForeignKeyConstraint = "workspace_agents_resource_id_fkey"// ALTER TABLE ONLY workspace_agents ADD CONSTRAINT workspace_agents_resource_id_fkey FOREIGN KEY (resource_id) REFERENCES workspace_resources(id) ON DELETE CASCADE;ForeignKeyWorkspaceAppAuditSessionsAgentIDForeignKeyConstraint = "workspace_app_audit_sessions_agent_id_fkey"// ALTER TABLE ONLY workspace_app_audit_sessions ADD CONSTRAINT workspace_app_audit_sessions_agent_id_fkey FOREIGN KEY (agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE;ForeignKeyWorkspaceAppStatsAgentIDForeignKeyConstraint = "workspace_app_stats_agent_id_fkey"// ALTER TABLE ONLY workspace_app_stats ADD CONSTRAINT workspace_app_stats_agent_id_fkey FOREIGN KEY (agent_id) REFERENCES workspace_agents(id);ForeignKeyWorkspaceAppStatsUserIDForeignKeyConstraint = "workspace_app_stats_user_id_fkey"// ALTER TABLE ONLY workspace_app_stats ADD CONSTRAINT workspace_app_stats_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);ForeignKeyWorkspaceAppStatsWorkspaceIDForeignKeyConstraint = "workspace_app_stats_workspace_id_fkey"// ALTER TABLE ONLY workspace_app_stats ADD CONSTRAINT workspace_app_stats_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspaces(id);ForeignKeyWorkspaceAppStatusesAgentIDForeignKeyConstraint = "workspace_app_statuses_agent_id_fkey"// ALTER TABLE ONLY workspace_app_statuses ADD CONSTRAINT workspace_app_statuses_agent_id_fkey FOREIGN KEY (agent_id) REFERENCES workspace_agents(id);ForeignKeyWorkspaceAppStatusesAppIDForeignKeyConstraint = "workspace_app_statuses_app_id_fkey"// ALTER TABLE ONLY workspace_app_statuses ADD CONSTRAINT workspace_app_statuses_app_id_fkey FOREIGN KEY (app_id) REFERENCES workspace_apps(id);ForeignKeyWorkspaceAppStatusesWorkspaceIDForeignKeyConstraint = "workspace_app_statuses_workspace_id_fkey"// ALTER TABLE ONLY workspace_app_statuses ADD CONSTRAINT workspace_app_statuses_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspaces(id);ForeignKeyWorkspaceAppsAgentIDForeignKeyConstraint = "workspace_apps_agent_id_fkey"// ALTER TABLE ONLY workspace_apps ADD CONSTRAINT workspace_apps_agent_id_fkey FOREIGN KEY (agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE;ForeignKeyWorkspaceBuildParametersWorkspaceBuildIDForeignKeyConstraint = "workspace_build_parameters_workspace_build_id_fkey"// ALTER TABLE ONLY workspace_build_parameters ADD CONSTRAINT workspace_build_parameters_workspace_build_id_fkey FOREIGN KEY (workspace_build_id) REFERENCES workspace_builds(id) ON DELETE CASCADE;ForeignKeyWorkspaceBuildsJobIDForeignKeyConstraint = "workspace_builds_job_id_fkey"// ALTER TABLE ONLY workspace_builds ADD CONSTRAINT workspace_builds_job_id_fkey FOREIGN KEY (job_id) REFERENCES provisioner_jobs(id) ON DELETE CASCADE;ForeignKeyWorkspaceBuildsTemplateVersionIDForeignKeyConstraint = "workspace_builds_template_version_id_fkey"// ALTER TABLE ONLY workspace_builds ADD CONSTRAINT workspace_builds_template_version_id_fkey FOREIGN KEY (template_version_id) REFERENCES template_versions(id) ON DELETE CASCADE;ForeignKeyWorkspaceBuildsTemplateVersionPresetIDForeignKeyConstraint = "workspace_builds_template_version_preset_id_fkey"// ALTER TABLE ONLY workspace_builds ADD CONSTRAINT workspace_builds_template_version_preset_id_fkey FOREIGN KEY (template_version_preset_id) REFERENCES template_version_presets(id) ON DELETE SET NULL;ForeignKeyWorkspaceBuildsWorkspaceIDForeignKeyConstraint = "workspace_builds_workspace_id_fkey"// ALTER TABLE ONLY workspace_builds ADD CONSTRAINT workspace_builds_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspaces(id) ON DELETE CASCADE;ForeignKeyWorkspaceModulesJobIDForeignKeyConstraint = "workspace_modules_job_id_fkey"// ALTER TABLE ONLY workspace_modules ADD CONSTRAINT workspace_modules_job_id_fkey FOREIGN KEY (job_id) REFERENCES provisioner_jobs(id) ON DELETE CASCADE;ForeignKeyWorkspaceResourceMetadataWorkspaceResourceIDForeignKeyConstraint = "workspace_resource_metadata_workspace_resource_id_fkey"// ALTER TABLE ONLY workspace_resource_metadata ADD CONSTRAINT workspace_resource_metadata_workspace_resource_id_fkey FOREIGN KEY (workspace_resource_id) REFERENCES workspace_resources(id) ON DELETE CASCADE;ForeignKeyWorkspaceResourcesJobIDForeignKeyConstraint = "workspace_resources_job_id_fkey"// ALTER TABLE ONLY workspace_resources ADD CONSTRAINT workspace_resources_job_id_fkey FOREIGN KEY (job_id) REFERENCES provisioner_jobs(id) ON DELETE CASCADE;ForeignKeyWorkspacesOrganizationIDForeignKeyConstraint = "workspaces_organization_id_fkey"// ALTER TABLE ONLY workspaces ADD CONSTRAINT workspaces_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE RESTRICT;ForeignKeyWorkspacesOwnerIDForeignKeyConstraint = "workspaces_owner_id_fkey"// ALTER TABLE ONLY workspaces ADD CONSTRAINT workspaces_owner_id_fkey FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE RESTRICT;ForeignKeyWorkspacesTemplateIDForeignKeyConstraint = "workspaces_template_id_fkey"// ALTER TABLE ONLY workspaces ADD CONSTRAINT workspaces_template_id_fkey FOREIGN KEY (template_id) REFERENCES templates(id) ON DELETE RESTRICT;)

ForeignKeyConstraint enums.

typeGetAPIKeyByNameParams

type GetAPIKeyByNameParams struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`TokenNamestring    `db:"token_name" json:"token_name"`}

typeGetAPIKeysByUserIDParams

type GetAPIKeysByUserIDParams struct {LoginTypeLoginType `db:"login_type" json:"login_type"`UserIDuuid.UUID `db:"user_id" json:"user_id"`}

typeGetAuditLogsOffsetParams

type GetAuditLogsOffsetParams struct {ResourceTypestring    `db:"resource_type" json:"resource_type"`ResourceIDuuid.UUID `db:"resource_id" json:"resource_id"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`ResourceTargetstring    `db:"resource_target" json:"resource_target"`Actionstring    `db:"action" json:"action"`UserIDuuid.UUID `db:"user_id" json:"user_id"`Usernamestring    `db:"username" json:"username"`Emailstring    `db:"email" json:"email"`DateFromtime.Time `db:"date_from" json:"date_from"`DateTotime.Time `db:"date_to" json:"date_to"`BuildReasonstring    `db:"build_reason" json:"build_reason"`RequestIDuuid.UUID `db:"request_id" json:"request_id"`OffsetOptint32     `db:"offset_opt" json:"offset_opt"`LimitOptint32     `db:"limit_opt" json:"limit_opt"`}

typeGetAuditLogsOffsetRow

type GetAuditLogsOffsetRow struct {AuditLogAuditLog       `db:"audit_log" json:"audit_log"`UserUsernamesql.NullString `db:"user_username" json:"user_username"`UserNamesql.NullString `db:"user_name" json:"user_name"`UserEmailsql.NullString `db:"user_email" json:"user_email"`UserCreatedAtsql.NullTime   `db:"user_created_at" json:"user_created_at"`UserUpdatedAtsql.NullTime   `db:"user_updated_at" json:"user_updated_at"`UserLastSeenAtsql.NullTime   `db:"user_last_seen_at" json:"user_last_seen_at"`UserStatusNullUserStatus `db:"user_status" json:"user_status"`UserLoginTypeNullLoginType  `db:"user_login_type" json:"user_login_type"`UserRolespq.StringArray `db:"user_roles" json:"user_roles"`UserAvatarUrlsql.NullString `db:"user_avatar_url" json:"user_avatar_url"`UserDeletedsql.NullBool   `db:"user_deleted" json:"user_deleted"`UserQuietHoursSchedulesql.NullString `db:"user_quiet_hours_schedule" json:"user_quiet_hours_schedule"`OrganizationNamestring         `db:"organization_name" json:"organization_name"`OrganizationDisplayNamestring         `db:"organization_display_name" json:"organization_display_name"`OrganizationIconstring         `db:"organization_icon" json:"organization_icon"`Countint64          `db:"count" json:"count"`}

func (GetAuditLogsOffsetRow)RBACObjectadded inv2.14.0

func (wGetAuditLogsOffsetRow) RBACObject()rbac.Object

typeGetAuthorizationUserRolesRow

type GetAuthorizationUserRolesRow struct {IDuuid.UUID  `db:"id" json:"id"`Usernamestring     `db:"username" json:"username"`StatusUserStatus `db:"status" json:"status"`Emailstring     `db:"email" json:"email"`Roles    []string   `db:"roles" json:"roles"`Groups   []string   `db:"groups" json:"groups"`}

func (GetAuthorizationUserRolesRow)RoleNamesadded inv2.13.0

typeGetCryptoKeyByFeatureAndSequenceParamsadded inv2.16.0

type GetCryptoKeyByFeatureAndSequenceParams struct {FeatureCryptoKeyFeature `db:"feature" json:"feature"`Sequenceint32            `db:"sequence" json:"sequence"`}

typeGetDefaultProxyConfigRow

type GetDefaultProxyConfigRow struct {DisplayNamestring `db:"display_name" json:"display_name"`IconUrlstring `db:"icon_url" json:"icon_url"`}

typeGetDeploymentDAUsRow

type GetDeploymentDAUsRow struct {Datetime.Time `db:"date" json:"date"`UserIDuuid.UUID `db:"user_id" json:"user_id"`}

typeGetDeploymentWorkspaceAgentStatsRow

type GetDeploymentWorkspaceAgentStatsRow struct {WorkspaceRxBytesint64   `db:"workspace_rx_bytes" json:"workspace_rx_bytes"`WorkspaceTxBytesint64   `db:"workspace_tx_bytes" json:"workspace_tx_bytes"`WorkspaceConnectionLatency50float64 `db:"workspace_connection_latency_50" json:"workspace_connection_latency_50"`WorkspaceConnectionLatency95float64 `db:"workspace_connection_latency_95" json:"workspace_connection_latency_95"`SessionCountVSCodeint64   `db:"session_count_vscode" json:"session_count_vscode"`SessionCountSSHint64   `db:"session_count_ssh" json:"session_count_ssh"`SessionCountJetBrainsint64   `db:"session_count_jetbrains" json:"session_count_jetbrains"`SessionCountReconnectingPTYint64   `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"`}

typeGetDeploymentWorkspaceAgentUsageStatsRowadded inv2.16.0

type GetDeploymentWorkspaceAgentUsageStatsRow struct {WorkspaceRxBytesint64   `db:"workspace_rx_bytes" json:"workspace_rx_bytes"`WorkspaceTxBytesint64   `db:"workspace_tx_bytes" json:"workspace_tx_bytes"`WorkspaceConnectionLatency50float64 `db:"workspace_connection_latency_50" json:"workspace_connection_latency_50"`WorkspaceConnectionLatency95float64 `db:"workspace_connection_latency_95" json:"workspace_connection_latency_95"`SessionCountVSCodeint64   `db:"session_count_vscode" json:"session_count_vscode"`SessionCountSSHint64   `db:"session_count_ssh" json:"session_count_ssh"`SessionCountJetBrainsint64   `db:"session_count_jetbrains" json:"session_count_jetbrains"`SessionCountReconnectingPTYint64   `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"`}

typeGetDeploymentWorkspaceStatsRow

type GetDeploymentWorkspaceStatsRow struct {PendingWorkspacesint64 `db:"pending_workspaces" json:"pending_workspaces"`BuildingWorkspacesint64 `db:"building_workspaces" json:"building_workspaces"`RunningWorkspacesint64 `db:"running_workspaces" json:"running_workspaces"`FailedWorkspacesint64 `db:"failed_workspaces" json:"failed_workspaces"`StoppedWorkspacesint64 `db:"stopped_workspaces" json:"stopped_workspaces"`}

typeGetEligibleProvisionerDaemonsByProvisionerJobIDsRowadded inv2.18.1

type GetEligibleProvisionerDaemonsByProvisionerJobIDsRow struct {JobIDuuid.UUID         `db:"job_id" json:"job_id"`ProvisionerDaemonProvisionerDaemon `db:"provisioner_daemon" json:"provisioner_daemon"`}

func (GetEligibleProvisionerDaemonsByProvisionerJobIDsRow)RBACObjectadded inv2.18.1

typeGetExternalAuthLinkParamsadded inv2.2.1

type GetExternalAuthLinkParams struct {ProviderIDstring    `db:"provider_id" json:"provider_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`}

typeGetFailedWorkspaceBuildsByTemplateIDParamsadded inv2.16.0

type GetFailedWorkspaceBuildsByTemplateIDParams struct {TemplateIDuuid.UUID `db:"template_id" json:"template_id"`Sincetime.Time `db:"since" json:"since"`}

typeGetFailedWorkspaceBuildsByTemplateIDRowadded inv2.16.0

type GetFailedWorkspaceBuildsByTemplateIDRow struct {TemplateVersionNamestring    `db:"template_version_name" json:"template_version_name"`WorkspaceOwnerUsernamestring    `db:"workspace_owner_username" json:"workspace_owner_username"`WorkspaceNamestring    `db:"workspace_name" json:"workspace_name"`WorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`WorkspaceBuildNumberint32     `db:"workspace_build_number" json:"workspace_build_number"`}

typeGetFileByHashAndCreatorParams

type GetFileByHashAndCreatorParams struct {Hashstring    `db:"hash" json:"hash"`CreatedByuuid.UUID `db:"created_by" json:"created_by"`}

typeGetFileTemplatesRow

type GetFileTemplatesRow struct {FileIDuuid.UUID   `db:"file_id" json:"file_id"`FileCreatedByuuid.UUID   `db:"file_created_by" json:"file_created_by"`TemplateIDuuid.UUID   `db:"template_id" json:"template_id"`TemplateOrganizationIDuuid.UUID   `db:"template_organization_id" json:"template_organization_id"`TemplateCreatedByuuid.UUID   `db:"template_created_by" json:"template_created_by"`UserACLTemplateACL `db:"user_acl" json:"user_acl"`GroupACLTemplateACL `db:"group_acl" json:"group_acl"`}

func (GetFileTemplatesRow)RBACObject

func (tGetFileTemplatesRow) RBACObject()rbac.Object

typeGetFilteredInboxNotificationsByUserIDParamsadded inv2.21.0

type GetFilteredInboxNotificationsByUserIDParams struct {UserIDuuid.UUID                   `db:"user_id" json:"user_id"`Templates    []uuid.UUID                 `db:"templates" json:"templates"`Targets      []uuid.UUID                 `db:"targets" json:"targets"`ReadStatusInboxNotificationReadStatus `db:"read_status" json:"read_status"`CreatedAtOpttime.Time                   `db:"created_at_opt" json:"created_at_opt"`LimitOptint32                       `db:"limit_opt" json:"limit_opt"`}

typeGetGroupByOrgAndNameParams

type GetGroupByOrgAndNameParams struct {OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`Namestring    `db:"name" json:"name"`}

typeGetGroupMembersByGroupIDParamsadded inv2.21.0

type GetGroupMembersByGroupIDParams struct {GroupIDuuid.UUID `db:"group_id" json:"group_id"`IncludeSystembool      `db:"include_system" json:"include_system"`}

typeGetGroupMembersCountByGroupIDParamsadded inv2.21.0

type GetGroupMembersCountByGroupIDParams struct {GroupIDuuid.UUID `db:"group_id" json:"group_id"`IncludeSystembool      `db:"include_system" json:"include_system"`}

typeGetGroupsParamsadded inv2.15.0

type GetGroupsParams struct {OrganizationIDuuid.UUID   `db:"organization_id" json:"organization_id"`HasMemberIDuuid.UUID   `db:"has_member_id" json:"has_member_id"`GroupNames     []string    `db:"group_names" json:"group_names"`GroupIds       []uuid.UUID `db:"group_ids" json:"group_ids"`}

typeGetGroupsRowadded inv2.15.0

type GetGroupsRow struct {GroupGroup  `db:"group" json:"group"`OrganizationNamestring `db:"organization_name" json:"organization_name"`OrganizationDisplayNamestring `db:"organization_display_name" json:"organization_display_name"`}

func (GetGroupsRow)RBACObjectadded inv2.15.0

func (gGetGroupsRow) RBACObject()rbac.Object

typeGetInboxNotificationsByUserIDParamsadded inv2.21.0

type GetInboxNotificationsByUserIDParams struct {UserIDuuid.UUID                   `db:"user_id" json:"user_id"`ReadStatusInboxNotificationReadStatus `db:"read_status" json:"read_status"`CreatedAtOpttime.Time                   `db:"created_at_opt" json:"created_at_opt"`LimitOptint32                       `db:"limit_opt" json:"limit_opt"`}

typeGetNotificationMessagesByStatusParamsadded inv2.14.0

type GetNotificationMessagesByStatusParams struct {StatusNotificationMessageStatus `db:"status" json:"status"`Limitint32                     `db:"limit" json:"limit"`}

typeGetOAuth2ProviderAppsByUserIDRowadded inv2.9.0

type GetOAuth2ProviderAppsByUserIDRow struct {TokenCountint64             `db:"token_count" json:"token_count"`OAuth2ProviderAppOAuth2ProviderApp `db:"oauth2_provider_app" json:"oauth2_provider_app"`}

func (GetOAuth2ProviderAppsByUserIDRow)RBACObjectadded inv2.9.0

typeGetOrganizationByNameParamsadded inv2.20.0

type GetOrganizationByNameParams struct {Deletedbool   `db:"deleted" json:"deleted"`Namestring `db:"name" json:"name"`}

typeGetOrganizationIDsByMemberIDsRow

type GetOrganizationIDsByMemberIDsRow struct {UserIDuuid.UUID   `db:"user_id" json:"user_id"`OrganizationIDs []uuid.UUID `db:"organization_IDs" json:"organization_IDs"`}

func (GetOrganizationIDsByMemberIDsRow)RBACObject

typeGetOrganizationResourceCountByIDRowadded inv2.21.0

type GetOrganizationResourceCountByIDRow struct {WorkspaceCountint64 `db:"workspace_count" json:"workspace_count"`GroupCountint64 `db:"group_count" json:"group_count"`TemplateCountint64 `db:"template_count" json:"template_count"`MemberCountint64 `db:"member_count" json:"member_count"`ProvisionerKeyCountint64 `db:"provisioner_key_count" json:"provisioner_key_count"`}

typeGetOrganizationsByUserIDParamsadded inv2.20.0

type GetOrganizationsByUserIDParams struct {UserIDuuid.UUID    `db:"user_id" json:"user_id"`Deletedsql.NullBool `db:"deleted" json:"deleted"`}

typeGetOrganizationsParamsadded inv2.15.0

type GetOrganizationsParams struct {Deletedbool        `db:"deleted" json:"deleted"`IDs     []uuid.UUID `db:"ids" json:"ids"`Namestring      `db:"name" json:"name"`}

typeGetPrebuildMetricsRowadded inv2.22.0

type GetPrebuildMetricsRow struct {TemplateNamestring `db:"template_name" json:"template_name"`PresetNamestring `db:"preset_name" json:"preset_name"`OrganizationNamestring `db:"organization_name" json:"organization_name"`CreatedCountint64  `db:"created_count" json:"created_count"`FailedCountint64  `db:"failed_count" json:"failed_count"`ClaimedCountint64  `db:"claimed_count" json:"claimed_count"`}

typeGetPresetByIDRowadded inv2.22.0

type GetPresetByIDRow struct {IDuuid.UUID      `db:"id" json:"id"`TemplateVersionIDuuid.UUID      `db:"template_version_id" json:"template_version_id"`Namestring         `db:"name" json:"name"`CreatedAttime.Time      `db:"created_at" json:"created_at"`DesiredInstancessql.NullInt32  `db:"desired_instances" json:"desired_instances"`InvalidateAfterSecssql.NullInt32  `db:"invalidate_after_secs" json:"invalidate_after_secs"`PrebuildStatusPrebuildStatus `db:"prebuild_status" json:"prebuild_status"`TemplateIDuuid.NullUUID  `db:"template_id" json:"template_id"`OrganizationIDuuid.UUID      `db:"organization_id" json:"organization_id"`}

typeGetPresetsAtFailureLimitRowadded inv2.23.0

type GetPresetsAtFailureLimitRow struct {TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`PresetIDuuid.UUID `db:"preset_id" json:"preset_id"`}

typeGetPresetsBackoffRowadded inv2.22.0

type GetPresetsBackoffRow struct {TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`PresetIDuuid.UUID `db:"preset_id" json:"preset_id"`NumFailedint32     `db:"num_failed" json:"num_failed"`LastBuildAttime.Time `db:"last_build_at" json:"last_build_at"`}

typeGetPreviousTemplateVersionParams

type GetPreviousTemplateVersionParams struct {OrganizationIDuuid.UUID     `db:"organization_id" json:"organization_id"`Namestring        `db:"name" json:"name"`TemplateIDuuid.NullUUID `db:"template_id" json:"template_id"`}

typeGetProvisionerDaemonsByOrganizationParamsadded inv2.18.0

type GetProvisionerDaemonsByOrganizationParams struct {OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`WantTagsStringMap `db:"want_tags" json:"want_tags"`}

typeGetProvisionerDaemonsWithStatusByOrganizationParamsadded inv2.19.0

type GetProvisionerDaemonsWithStatusByOrganizationParams struct {StaleIntervalMSint64         `db:"stale_interval_ms" json:"stale_interval_ms"`OrganizationIDuuid.UUID     `db:"organization_id" json:"organization_id"`IDs             []uuid.UUID   `db:"ids" json:"ids"`TagsStringMap     `db:"tags" json:"tags"`Limitsql.NullInt32 `db:"limit" json:"limit"`}

typeGetProvisionerDaemonsWithStatusByOrganizationRowadded inv2.19.0

type GetProvisionerDaemonsWithStatusByOrganizationRow struct {ProvisionerDaemonProvisionerDaemon        `db:"provisioner_daemon" json:"provisioner_daemon"`StatusProvisionerDaemonStatus  `db:"status" json:"status"`KeyNamestring                   `db:"key_name" json:"key_name"`CurrentJobIDuuid.NullUUID            `db:"current_job_id" json:"current_job_id"`CurrentJobStatusNullProvisionerJobStatus `db:"current_job_status" json:"current_job_status"`PreviousJobIDuuid.NullUUID            `db:"previous_job_id" json:"previous_job_id"`PreviousJobStatusNullProvisionerJobStatus `db:"previous_job_status" json:"previous_job_status"`CurrentJobTemplateNamestring                   `db:"current_job_template_name" json:"current_job_template_name"`CurrentJobTemplateDisplayNamestring                   `db:"current_job_template_display_name" json:"current_job_template_display_name"`CurrentJobTemplateIconstring                   `db:"current_job_template_icon" json:"current_job_template_icon"`PreviousJobTemplateNamestring                   `db:"previous_job_template_name" json:"previous_job_template_name"`PreviousJobTemplateDisplayNamestring                   `db:"previous_job_template_display_name" json:"previous_job_template_display_name"`PreviousJobTemplateIconstring                   `db:"previous_job_template_icon" json:"previous_job_template_icon"`}

func (GetProvisionerDaemonsWithStatusByOrganizationRow)RBACObjectadded inv2.19.0

typeGetProvisionerJobsByIDsWithQueuePositionRow

type GetProvisionerJobsByIDsWithQueuePositionRow struct {IDuuid.UUID      `db:"id" json:"id"`CreatedAttime.Time      `db:"created_at" json:"created_at"`ProvisionerJobProvisionerJob `db:"provisioner_job" json:"provisioner_job"`QueuePositionint64          `db:"queue_position" json:"queue_position"`QueueSizeint64          `db:"queue_size" json:"queue_size"`}

typeGetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerParamsadded inv2.19.0

type GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerParams struct {OrganizationIDuuid.UUID              `db:"organization_id" json:"organization_id"`IDs            []uuid.UUID            `db:"ids" json:"ids"`Status         []ProvisionerJobStatus `db:"status" json:"status"`TagsStringMap              `db:"tags" json:"tags"`Limitsql.NullInt32          `db:"limit" json:"limit"`}

typeGetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerRowadded inv2.19.0

type GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerRow struct {ProvisionerJobProvisionerJob `db:"provisioner_job" json:"provisioner_job"`QueuePositionint64          `db:"queue_position" json:"queue_position"`QueueSizeint64          `db:"queue_size" json:"queue_size"`AvailableWorkers    []uuid.UUID    `db:"available_workers" json:"available_workers"`TemplateVersionNamestring         `db:"template_version_name" json:"template_version_name"`TemplateIDuuid.NullUUID  `db:"template_id" json:"template_id"`TemplateNamestring         `db:"template_name" json:"template_name"`TemplateDisplayNamestring         `db:"template_display_name" json:"template_display_name"`TemplateIconstring         `db:"template_icon" json:"template_icon"`WorkspaceIDuuid.NullUUID  `db:"workspace_id" json:"workspace_id"`WorkspaceNamestring         `db:"workspace_name" json:"workspace_name"`WorkerNamestring         `db:"worker_name" json:"worker_name"`}

func (GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerRow)RBACObjectadded inv2.19.0

typeGetProvisionerJobsToBeReapedParamsadded inv2.23.0

type GetProvisionerJobsToBeReapedParams struct {PendingSincetime.Time `db:"pending_since" json:"pending_since"`HungSincetime.Time `db:"hung_since" json:"hung_since"`MaxJobsint32     `db:"max_jobs" json:"max_jobs"`}

typeGetProvisionerKeyByNameParamsadded inv2.14.0

type GetProvisionerKeyByNameParams struct {OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`Namestring    `db:"name" json:"name"`}

typeGetProvisionerLogsAfterIDParams

type GetProvisionerLogsAfterIDParams struct {JobIDuuid.UUID `db:"job_id" json:"job_id"`CreatedAfterint64     `db:"created_after" json:"created_after"`}

typeGetQuotaAllowanceForUserParamsadded inv2.15.0

type GetQuotaAllowanceForUserParams struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`}

typeGetQuotaConsumedForUserParamsadded inv2.15.0

type GetQuotaConsumedForUserParams struct {OwnerIDuuid.UUID `db:"owner_id" json:"owner_id"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`}

typeGetRunningPrebuiltWorkspacesRowadded inv2.22.0

type GetRunningPrebuiltWorkspacesRow struct {IDuuid.UUID     `db:"id" json:"id"`Namestring        `db:"name" json:"name"`TemplateIDuuid.UUID     `db:"template_id" json:"template_id"`TemplateVersionIDuuid.UUID     `db:"template_version_id" json:"template_version_id"`CurrentPresetIDuuid.NullUUID `db:"current_preset_id" json:"current_preset_id"`Readybool          `db:"ready" json:"ready"`CreatedAttime.Time     `db:"created_at" json:"created_at"`}

typeGetTailnetTunnelPeerBindingsRowadded inv2.4.0

type GetTailnetTunnelPeerBindingsRow struct {PeerIDuuid.UUID     `db:"peer_id" json:"peer_id"`CoordinatorIDuuid.UUID     `db:"coordinator_id" json:"coordinator_id"`UpdatedAttime.Time     `db:"updated_at" json:"updated_at"`Node          []byte        `db:"node" json:"node"`StatusTailnetStatus `db:"status" json:"status"`}

typeGetTailnetTunnelPeerIDsRowadded inv2.4.0

type GetTailnetTunnelPeerIDsRow struct {PeerIDuuid.UUID `db:"peer_id" json:"peer_id"`CoordinatorIDuuid.UUID `db:"coordinator_id" json:"coordinator_id"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`}

typeGetTemplateAppInsightsByTemplateParamsadded inv2.4.0

type GetTemplateAppInsightsByTemplateParams struct {StartTimetime.Time `db:"start_time" json:"start_time"`EndTimetime.Time `db:"end_time" json:"end_time"`}

typeGetTemplateAppInsightsByTemplateRowadded inv2.4.0

type GetTemplateAppInsightsByTemplateRow struct {TemplateIDuuid.UUID `db:"template_id" json:"template_id"`SlugOrPortstring    `db:"slug_or_port" json:"slug_or_port"`DisplayNamestring    `db:"display_name" json:"display_name"`ActiveUsersint64     `db:"active_users" json:"active_users"`UsageSecondsint64     `db:"usage_seconds" json:"usage_seconds"`}

typeGetTemplateAppInsightsParams

type GetTemplateAppInsightsParams struct {TemplateIDs []uuid.UUID `db:"template_ids" json:"template_ids"`StartTimetime.Time   `db:"start_time" json:"start_time"`EndTimetime.Time   `db:"end_time" json:"end_time"`}

typeGetTemplateAppInsightsRow

type GetTemplateAppInsightsRow struct {TemplateIDs  []uuid.UUID `db:"template_ids" json:"template_ids"`ActiveUsersint64       `db:"active_users" json:"active_users"`Slugstring      `db:"slug" json:"slug"`DisplayNamestring      `db:"display_name" json:"display_name"`Iconstring      `db:"icon" json:"icon"`UsageSecondsint64       `db:"usage_seconds" json:"usage_seconds"`TimesUsedint64       `db:"times_used" json:"times_used"`}

typeGetTemplateAverageBuildTimeParams

type GetTemplateAverageBuildTimeParams struct {TemplateIDuuid.NullUUID `db:"template_id" json:"template_id"`StartTimesql.NullTime  `db:"start_time" json:"start_time"`}

typeGetTemplateAverageBuildTimeRow

type GetTemplateAverageBuildTimeRow struct {Start50float64 `db:"start_50" json:"start_50"`Stop50float64 `db:"stop_50" json:"stop_50"`Delete50float64 `db:"delete_50" json:"delete_50"`Start95float64 `db:"start_95" json:"start_95"`Stop95float64 `db:"stop_95" json:"stop_95"`Delete95float64 `db:"delete_95" json:"delete_95"`}

typeGetTemplateByOrganizationAndNameParams

type GetTemplateByOrganizationAndNameParams struct {OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`Deletedbool      `db:"deleted" json:"deleted"`Namestring    `db:"name" json:"name"`}

typeGetTemplateDAUsParams

type GetTemplateDAUsParams struct {TemplateIDuuid.UUID `db:"template_id" json:"template_id"`TzOffsetint32     `db:"tz_offset" json:"tz_offset"`}

typeGetTemplateDAUsRow

type GetTemplateDAUsRow struct {Datetime.Time `db:"date" json:"date"`UserIDuuid.UUID `db:"user_id" json:"user_id"`}

typeGetTemplateInsightsByIntervalParamsadded inv2.2.0

type GetTemplateInsightsByIntervalParams struct {TemplateIDs  []uuid.UUID `db:"template_ids" json:"template_ids"`IntervalDaysint32       `db:"interval_days" json:"interval_days"`EndTimetime.Time   `db:"end_time" json:"end_time"`StartTimetime.Time   `db:"start_time" json:"start_time"`}

typeGetTemplateInsightsByIntervalRowadded inv2.2.0

type GetTemplateInsightsByIntervalRow struct {StartTimetime.Time   `db:"start_time" json:"start_time"`EndTimetime.Time   `db:"end_time" json:"end_time"`TemplateIDs []uuid.UUID `db:"template_ids" json:"template_ids"`ActiveUsersint64       `db:"active_users" json:"active_users"`}

typeGetTemplateInsightsByTemplateParamsadded inv2.3.2

type GetTemplateInsightsByTemplateParams struct {StartTimetime.Time `db:"start_time" json:"start_time"`EndTimetime.Time `db:"end_time" json:"end_time"`}

typeGetTemplateInsightsByTemplateRowadded inv2.3.2

type GetTemplateInsightsByTemplateRow struct {TemplateIDuuid.UUID `db:"template_id" json:"template_id"`ActiveUsersint64     `db:"active_users" json:"active_users"`UsageVscodeSecondsint64     `db:"usage_vscode_seconds" json:"usage_vscode_seconds"`UsageJetbrainsSecondsint64     `db:"usage_jetbrains_seconds" json:"usage_jetbrains_seconds"`UsageReconnectingPtySecondsint64     `db:"usage_reconnecting_pty_seconds" json:"usage_reconnecting_pty_seconds"`UsageSshSecondsint64     `db:"usage_ssh_seconds" json:"usage_ssh_seconds"`}

typeGetTemplateInsightsParams

type GetTemplateInsightsParams struct {StartTimetime.Time   `db:"start_time" json:"start_time"`EndTimetime.Time   `db:"end_time" json:"end_time"`TemplateIDs []uuid.UUID `db:"template_ids" json:"template_ids"`}

typeGetTemplateInsightsRow

type GetTemplateInsightsRow struct {TemplateIDs                 []uuid.UUID `db:"template_ids" json:"template_ids"`SshTemplateIds              []uuid.UUID `db:"ssh_template_ids" json:"ssh_template_ids"`SftpTemplateIds             []uuid.UUID `db:"sftp_template_ids" json:"sftp_template_ids"`ReconnectingPtyTemplateIds  []uuid.UUID `db:"reconnecting_pty_template_ids" json:"reconnecting_pty_template_ids"`VscodeTemplateIds           []uuid.UUID `db:"vscode_template_ids" json:"vscode_template_ids"`JetbrainsTemplateIds        []uuid.UUID `db:"jetbrains_template_ids" json:"jetbrains_template_ids"`ActiveUsersint64       `db:"active_users" json:"active_users"`UsageTotalSecondsint64       `db:"usage_total_seconds" json:"usage_total_seconds"`UsageSshSecondsint64       `db:"usage_ssh_seconds" json:"usage_ssh_seconds"`UsageSftpSecondsint64       `db:"usage_sftp_seconds" json:"usage_sftp_seconds"`UsageReconnectingPtySecondsint64       `db:"usage_reconnecting_pty_seconds" json:"usage_reconnecting_pty_seconds"`UsageVscodeSecondsint64       `db:"usage_vscode_seconds" json:"usage_vscode_seconds"`UsageJetbrainsSecondsint64       `db:"usage_jetbrains_seconds" json:"usage_jetbrains_seconds"`}

typeGetTemplateParameterInsightsParams

type GetTemplateParameterInsightsParams struct {StartTimetime.Time   `db:"start_time" json:"start_time"`EndTimetime.Time   `db:"end_time" json:"end_time"`TemplateIDs []uuid.UUID `db:"template_ids" json:"template_ids"`}

typeGetTemplateParameterInsightsRow

type GetTemplateParameterInsightsRow struct {Numint64           `db:"num" json:"num"`TemplateIDs []uuid.UUID     `db:"template_ids" json:"template_ids"`Namestring          `db:"name" json:"name"`Typestring          `db:"type" json:"type"`DisplayNamestring          `db:"display_name" json:"display_name"`Descriptionstring          `db:"description" json:"description"`Optionsjson.RawMessage `db:"options" json:"options"`Valuestring          `db:"value" json:"value"`Countint64           `db:"count" json:"count"`}

typeGetTemplatePresetsWithPrebuildsRowadded inv2.22.0

type GetTemplatePresetsWithPrebuildsRow struct {TemplateIDuuid.UUID      `db:"template_id" json:"template_id"`TemplateNamestring         `db:"template_name" json:"template_name"`OrganizationIDuuid.UUID      `db:"organization_id" json:"organization_id"`OrganizationNamestring         `db:"organization_name" json:"organization_name"`TemplateVersionIDuuid.UUID      `db:"template_version_id" json:"template_version_id"`TemplateVersionNamestring         `db:"template_version_name" json:"template_version_name"`UsingActiveVersionbool           `db:"using_active_version" json:"using_active_version"`IDuuid.UUID      `db:"id" json:"id"`Namestring         `db:"name" json:"name"`DesiredInstancessql.NullInt32  `db:"desired_instances" json:"desired_instances"`Ttlsql.NullInt32  `db:"ttl" json:"ttl"`PrebuildStatusPrebuildStatus `db:"prebuild_status" json:"prebuild_status"`Deletedbool           `db:"deleted" json:"deleted"`Deprecatedbool           `db:"deprecated" json:"deprecated"`}

typeGetTemplateUsageStatsParamsadded inv2.10.0

type GetTemplateUsageStatsParams struct {StartTimetime.Time   `db:"start_time" json:"start_time"`EndTimetime.Time   `db:"end_time" json:"end_time"`TemplateIDs []uuid.UUID `db:"template_ids" json:"template_ids"`}

typeGetTemplateVersionByTemplateIDAndNameParams

type GetTemplateVersionByTemplateIDAndNameParams struct {TemplateIDuuid.NullUUID `db:"template_id" json:"template_id"`Namestring        `db:"name" json:"name"`}

typeGetTemplateVersionsByTemplateIDParams

type GetTemplateVersionsByTemplateIDParams struct {TemplateIDuuid.UUID    `db:"template_id" json:"template_id"`Archivedsql.NullBool `db:"archived" json:"archived"`AfterIDuuid.UUID    `db:"after_id" json:"after_id"`OffsetOptint32        `db:"offset_opt" json:"offset_opt"`LimitOptint32        `db:"limit_opt" json:"limit_opt"`}

typeGetTemplatesWithFilterParams

type GetTemplatesWithFilterParams struct {Deletedbool         `db:"deleted" json:"deleted"`OrganizationIDuuid.UUID    `db:"organization_id" json:"organization_id"`ExactNamestring       `db:"exact_name" json:"exact_name"`FuzzyNamestring       `db:"fuzzy_name" json:"fuzzy_name"`IDs            []uuid.UUID  `db:"ids" json:"ids"`Deprecatedsql.NullBool `db:"deprecated" json:"deprecated"`}

typeGetUserActivityInsightsParamsadded inv2.2.0

type GetUserActivityInsightsParams struct {StartTimetime.Time   `db:"start_time" json:"start_time"`EndTimetime.Time   `db:"end_time" json:"end_time"`TemplateIDs []uuid.UUID `db:"template_ids" json:"template_ids"`}

typeGetUserActivityInsightsRowadded inv2.2.0

type GetUserActivityInsightsRow struct {UserIDuuid.UUID   `db:"user_id" json:"user_id"`Usernamestring      `db:"username" json:"username"`AvatarURLstring      `db:"avatar_url" json:"avatar_url"`TemplateIDs  []uuid.UUID `db:"template_ids" json:"template_ids"`UsageSecondsint64       `db:"usage_seconds" json:"usage_seconds"`}

typeGetUserByEmailOrUsernameParams

type GetUserByEmailOrUsernameParams struct {Usernamestring `db:"username" json:"username"`Emailstring `db:"email" json:"email"`}

typeGetUserLatencyInsightsParams

type GetUserLatencyInsightsParams struct {StartTimetime.Time   `db:"start_time" json:"start_time"`EndTimetime.Time   `db:"end_time" json:"end_time"`TemplateIDs []uuid.UUID `db:"template_ids" json:"template_ids"`}

typeGetUserLatencyInsightsRow

type GetUserLatencyInsightsRow struct {UserIDuuid.UUID   `db:"user_id" json:"user_id"`Usernamestring      `db:"username" json:"username"`AvatarURLstring      `db:"avatar_url" json:"avatar_url"`TemplateIDs                  []uuid.UUID `db:"template_ids" json:"template_ids"`WorkspaceConnectionLatency50float64     `db:"workspace_connection_latency_50" json:"workspace_connection_latency_50"`WorkspaceConnectionLatency95float64     `db:"workspace_connection_latency_95" json:"workspace_connection_latency_95"`}

typeGetUserLinkByUserIDLoginTypeParams

type GetUserLinkByUserIDLoginTypeParams struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`LoginTypeLoginType `db:"login_type" json:"login_type"`}

typeGetUserStatusCountsParamsadded inv2.19.0

type GetUserStatusCountsParams struct {StartTimetime.Time `db:"start_time" json:"start_time"`EndTimetime.Time `db:"end_time" json:"end_time"`Intervalint32     `db:"interval" json:"interval"`}

typeGetUserStatusCountsRowadded inv2.19.0

type GetUserStatusCountsRow struct {Datetime.Time  `db:"date" json:"date"`StatusUserStatus `db:"status" json:"status"`Countint64      `db:"count" json:"count"`}

typeGetUserWorkspaceBuildParametersParamsadded inv2.8.0

type GetUserWorkspaceBuildParametersParams struct {OwnerIDuuid.UUID `db:"owner_id" json:"owner_id"`TemplateIDuuid.UUID `db:"template_id" json:"template_id"`}

typeGetUserWorkspaceBuildParametersRowadded inv2.8.0

type GetUserWorkspaceBuildParametersRow struct {Namestring `db:"name" json:"name"`Valuestring `db:"value" json:"value"`}

typeGetUsersParams

type GetUsersParams struct {AfterIDuuid.UUID    `db:"after_id" json:"after_id"`Searchstring       `db:"search" json:"search"`Status          []UserStatus `db:"status" json:"status"`RbacRole        []string     `db:"rbac_role" json:"rbac_role"`LastSeenBeforetime.Time    `db:"last_seen_before" json:"last_seen_before"`LastSeenAftertime.Time    `db:"last_seen_after" json:"last_seen_after"`CreatedBeforetime.Time    `db:"created_before" json:"created_before"`CreatedAftertime.Time    `db:"created_after" json:"created_after"`IncludeSystembool         `db:"include_system" json:"include_system"`GithubComUserIDint64        `db:"github_com_user_id" json:"github_com_user_id"`LoginType       []LoginType  `db:"login_type" json:"login_type"`OffsetOptint32        `db:"offset_opt" json:"offset_opt"`LimitOptint32        `db:"limit_opt" json:"limit_opt"`}

typeGetUsersRow

type GetUsersRow struct {IDuuid.UUID      `db:"id" json:"id"`Emailstring         `db:"email" json:"email"`Usernamestring         `db:"username" json:"username"`HashedPassword           []byte         `db:"hashed_password" json:"hashed_password"`CreatedAttime.Time      `db:"created_at" json:"created_at"`UpdatedAttime.Time      `db:"updated_at" json:"updated_at"`StatusUserStatus     `db:"status" json:"status"`RBACRolespq.StringArray `db:"rbac_roles" json:"rbac_roles"`LoginTypeLoginType      `db:"login_type" json:"login_type"`AvatarURLstring         `db:"avatar_url" json:"avatar_url"`Deletedbool           `db:"deleted" json:"deleted"`LastSeenAttime.Time      `db:"last_seen_at" json:"last_seen_at"`QuietHoursSchedulestring         `db:"quiet_hours_schedule" json:"quiet_hours_schedule"`Namestring         `db:"name" json:"name"`GithubComUserIDsql.NullInt64  `db:"github_com_user_id" json:"github_com_user_id"`HashedOneTimePasscode    []byte         `db:"hashed_one_time_passcode" json:"hashed_one_time_passcode"`OneTimePasscodeExpiresAtsql.NullTime   `db:"one_time_passcode_expires_at" json:"one_time_passcode_expires_at"`IsSystembool           `db:"is_system" json:"is_system"`Countint64          `db:"count" json:"count"`}

func (GetUsersRow)RBACObject

func (uGetUsersRow) RBACObject()rbac.Object

typeGetWebpushVAPIDKeysRowadded inv2.21.0

type GetWebpushVAPIDKeysRow struct {VapidPublicKeystring `db:"vapid_public_key" json:"vapid_public_key"`VapidPrivateKeystring `db:"vapid_private_key" json:"vapid_private_key"`}

typeGetWorkspaceAgentAndLatestBuildByAuthTokenRowadded inv2.10.0

type GetWorkspaceAgentAndLatestBuildByAuthTokenRow struct {WorkspaceTableWorkspaceTable `db:"workspace_table" json:"workspace_table"`WorkspaceAgentWorkspaceAgent `db:"workspace_agent" json:"workspace_agent"`WorkspaceBuildWorkspaceBuild `db:"workspace_build" json:"workspace_build"`}

typeGetWorkspaceAgentLifecycleStateByIDRow

type GetWorkspaceAgentLifecycleStateByIDRow struct {LifecycleStateWorkspaceAgentLifecycleState `db:"lifecycle_state" json:"lifecycle_state"`StartedAtsql.NullTime                 `db:"started_at" json:"started_at"`ReadyAtsql.NullTime                 `db:"ready_at" json:"ready_at"`}

typeGetWorkspaceAgentLogsAfterParams

type GetWorkspaceAgentLogsAfterParams struct {AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`CreatedAfterint64     `db:"created_after" json:"created_after"`}

typeGetWorkspaceAgentMetadataParamsadded inv2.3.1

type GetWorkspaceAgentMetadataParams struct {WorkspaceAgentIDuuid.UUID `db:"workspace_agent_id" json:"workspace_agent_id"`Keys             []string  `db:"keys" json:"keys"`}

typeGetWorkspaceAgentPortShareParamsadded inv2.9.0

type GetWorkspaceAgentPortShareParams struct {WorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`AgentNamestring    `db:"agent_name" json:"agent_name"`Portint32     `db:"port" json:"port"`}

typeGetWorkspaceAgentScriptTimingsByBuildIDRowadded inv2.17.0

type GetWorkspaceAgentScriptTimingsByBuildIDRow struct {ScriptIDuuid.UUID                        `db:"script_id" json:"script_id"`StartedAttime.Time                        `db:"started_at" json:"started_at"`EndedAttime.Time                        `db:"ended_at" json:"ended_at"`ExitCodeint32                            `db:"exit_code" json:"exit_code"`StageWorkspaceAgentScriptTimingStage  `db:"stage" json:"stage"`StatusWorkspaceAgentScriptTimingStatus `db:"status" json:"status"`DisplayNamestring                           `db:"display_name" json:"display_name"`WorkspaceAgentIDuuid.UUID                        `db:"workspace_agent_id" json:"workspace_agent_id"`WorkspaceAgentNamestring                           `db:"workspace_agent_name" json:"workspace_agent_name"`}

typeGetWorkspaceAgentStatsAndLabelsRow

type GetWorkspaceAgentStatsAndLabelsRow struct {Usernamestring  `db:"username" json:"username"`AgentNamestring  `db:"agent_name" json:"agent_name"`WorkspaceNamestring  `db:"workspace_name" json:"workspace_name"`RxBytesint64   `db:"rx_bytes" json:"rx_bytes"`TxBytesint64   `db:"tx_bytes" json:"tx_bytes"`SessionCountVSCodeint64   `db:"session_count_vscode" json:"session_count_vscode"`SessionCountSSHint64   `db:"session_count_ssh" json:"session_count_ssh"`SessionCountJetBrainsint64   `db:"session_count_jetbrains" json:"session_count_jetbrains"`SessionCountReconnectingPTYint64   `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"`ConnectionCountint64   `db:"connection_count" json:"connection_count"`ConnectionMedianLatencyMSfloat64 `db:"connection_median_latency_ms" json:"connection_median_latency_ms"`}

typeGetWorkspaceAgentStatsRow

type GetWorkspaceAgentStatsRow struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`WorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`TemplateIDuuid.UUID `db:"template_id" json:"template_id"`AggregatedFromtime.Time `db:"aggregated_from" json:"aggregated_from"`WorkspaceRxBytesint64     `db:"workspace_rx_bytes" json:"workspace_rx_bytes"`WorkspaceTxBytesint64     `db:"workspace_tx_bytes" json:"workspace_tx_bytes"`WorkspaceConnectionLatency50float64   `db:"workspace_connection_latency_50" json:"workspace_connection_latency_50"`WorkspaceConnectionLatency95float64   `db:"workspace_connection_latency_95" json:"workspace_connection_latency_95"`AgentID_2uuid.UUID `db:"agent_id_2" json:"agent_id_2"`SessionCountVSCodeint64     `db:"session_count_vscode" json:"session_count_vscode"`SessionCountSSHint64     `db:"session_count_ssh" json:"session_count_ssh"`SessionCountJetBrainsint64     `db:"session_count_jetbrains" json:"session_count_jetbrains"`SessionCountReconnectingPTYint64     `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"`}

typeGetWorkspaceAgentUsageStatsAndLabelsRowadded inv2.16.0

type GetWorkspaceAgentUsageStatsAndLabelsRow struct {Usernamestring  `db:"username" json:"username"`AgentNamestring  `db:"agent_name" json:"agent_name"`WorkspaceNamestring  `db:"workspace_name" json:"workspace_name"`RxBytesint64   `db:"rx_bytes" json:"rx_bytes"`TxBytesint64   `db:"tx_bytes" json:"tx_bytes"`SessionCountVSCodeint64   `db:"session_count_vscode" json:"session_count_vscode"`SessionCountSSHint64   `db:"session_count_ssh" json:"session_count_ssh"`SessionCountJetBrainsint64   `db:"session_count_jetbrains" json:"session_count_jetbrains"`SessionCountReconnectingPTYint64   `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"`ConnectionCountint64   `db:"connection_count" json:"connection_count"`ConnectionMedianLatencyMSfloat64 `db:"connection_median_latency_ms" json:"connection_median_latency_ms"`}

typeGetWorkspaceAgentUsageStatsRowadded inv2.16.0

type GetWorkspaceAgentUsageStatsRow struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`WorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`TemplateIDuuid.UUID `db:"template_id" json:"template_id"`AggregatedFromtime.Time `db:"aggregated_from" json:"aggregated_from"`WorkspaceRxBytesint64     `db:"workspace_rx_bytes" json:"workspace_rx_bytes"`WorkspaceTxBytesint64     `db:"workspace_tx_bytes" json:"workspace_tx_bytes"`WorkspaceConnectionLatency50float64   `db:"workspace_connection_latency_50" json:"workspace_connection_latency_50"`WorkspaceConnectionLatency95float64   `db:"workspace_connection_latency_95" json:"workspace_connection_latency_95"`AgentID_2uuid.UUID `db:"agent_id_2" json:"agent_id_2"`SessionCountVSCodeint64     `db:"session_count_vscode" json:"session_count_vscode"`SessionCountSSHint64     `db:"session_count_ssh" json:"session_count_ssh"`SessionCountJetBrainsint64     `db:"session_count_jetbrains" json:"session_count_jetbrains"`SessionCountReconnectingPTYint64     `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"`}

typeGetWorkspaceAgentsByWorkspaceAndBuildNumberParamsadded inv2.22.0

type GetWorkspaceAgentsByWorkspaceAndBuildNumberParams struct {WorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`BuildNumberint32     `db:"build_number" json:"build_number"`}

typeGetWorkspaceAppByAgentIDAndSlugParams

type GetWorkspaceAppByAgentIDAndSlugParams struct {AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`Slugstring    `db:"slug" json:"slug"`}

typeGetWorkspaceBuildByWorkspaceIDAndBuildNumberParams

type GetWorkspaceBuildByWorkspaceIDAndBuildNumberParams struct {WorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`BuildNumberint32     `db:"build_number" json:"build_number"`}

typeGetWorkspaceBuildStatsByTemplatesRowadded inv2.16.0

type GetWorkspaceBuildStatsByTemplatesRow struct {TemplateIDuuid.UUID `db:"template_id" json:"template_id"`TemplateNamestring    `db:"template_name" json:"template_name"`TemplateDisplayNamestring    `db:"template_display_name" json:"template_display_name"`TemplateOrganizationIDuuid.UUID `db:"template_organization_id" json:"template_organization_id"`TotalBuildsint64     `db:"total_builds" json:"total_builds"`FailedBuildsint64     `db:"failed_builds" json:"failed_builds"`}

typeGetWorkspaceBuildsByWorkspaceIDParams

type GetWorkspaceBuildsByWorkspaceIDParams struct {WorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`Sincetime.Time `db:"since" json:"since"`AfterIDuuid.UUID `db:"after_id" json:"after_id"`OffsetOptint32     `db:"offset_opt" json:"offset_opt"`LimitOptint32     `db:"limit_opt" json:"limit_opt"`}

typeGetWorkspaceByOwnerIDAndNameParams

type GetWorkspaceByOwnerIDAndNameParams struct {OwnerIDuuid.UUID `db:"owner_id" json:"owner_id"`Deletedbool      `db:"deleted" json:"deleted"`Namestring    `db:"name" json:"name"`}

typeGetWorkspaceProxyByHostnameParams

type GetWorkspaceProxyByHostnameParams struct {Hostnamestring `db:"hostname" json:"hostname"`AllowAccessUrlbool   `db:"allow_access_url" json:"allow_access_url"`AllowWildcardHostnamebool   `db:"allow_wildcard_hostname" json:"allow_wildcard_hostname"`}

typeGetWorkspaceUniqueOwnerCountByTemplateIDsRowadded inv2.5.0

type GetWorkspaceUniqueOwnerCountByTemplateIDsRow struct {TemplateIDuuid.UUID `db:"template_id" json:"template_id"`UniqueOwnersSumint64     `db:"unique_owners_sum" json:"unique_owners_sum"`}

typeGetWorkspacesAndAgentsByOwnerIDRowadded inv2.18.0

type GetWorkspacesAndAgentsByOwnerIDRow struct {IDuuid.UUID            `db:"id" json:"id"`Namestring               `db:"name" json:"name"`JobStatusProvisionerJobStatus `db:"job_status" json:"job_status"`TransitionWorkspaceTransition  `db:"transition" json:"transition"`Agents     []AgentIDNamePair    `db:"agents" json:"agents"`}

typeGetWorkspacesEligibleForTransitionRowadded inv2.18.0

type GetWorkspacesEligibleForTransitionRow struct {IDuuid.UUID `db:"id" json:"id"`Namestring    `db:"name" json:"name"`}

typeGetWorkspacesParams

type GetWorkspacesParams struct {ParamNames                            []string     `db:"param_names" json:"param_names"`ParamValues                           []string     `db:"param_values" json:"param_values"`Deletedbool         `db:"deleted" json:"deleted"`Statusstring       `db:"status" json:"status"`OwnerIDuuid.UUID    `db:"owner_id" json:"owner_id"`OrganizationIDuuid.UUID    `db:"organization_id" json:"organization_id"`HasParam                              []string     `db:"has_param" json:"has_param"`OwnerUsernamestring       `db:"owner_username" json:"owner_username"`TemplateNamestring       `db:"template_name" json:"template_name"`TemplateIDs                           []uuid.UUID  `db:"template_ids" json:"template_ids"`WorkspaceIds                          []uuid.UUID  `db:"workspace_ids" json:"workspace_ids"`Namestring       `db:"name" json:"name"`HasAgentstring       `db:"has_agent" json:"has_agent"`AgentInactiveDisconnectTimeoutSecondsint64        `db:"agent_inactive_disconnect_timeout_seconds" json:"agent_inactive_disconnect_timeout_seconds"`Dormantbool         `db:"dormant" json:"dormant"`LastUsedBeforetime.Time    `db:"last_used_before" json:"last_used_before"`LastUsedAftertime.Time    `db:"last_used_after" json:"last_used_after"`UsingActivesql.NullBool `db:"using_active" json:"using_active"`RequesterIDuuid.UUID    `db:"requester_id" json:"requester_id"`Offsetint32        `db:"offset_" json:"offset_"`Limitint32        `db:"limit_" json:"limit_"`WithSummarybool         `db:"with_summary" json:"with_summary"`}

typeGetWorkspacesRow

type GetWorkspacesRow struct {IDuuid.UUID            `db:"id" json:"id"`CreatedAttime.Time            `db:"created_at" json:"created_at"`UpdatedAttime.Time            `db:"updated_at" json:"updated_at"`OwnerIDuuid.UUID            `db:"owner_id" json:"owner_id"`OrganizationIDuuid.UUID            `db:"organization_id" json:"organization_id"`TemplateIDuuid.UUID            `db:"template_id" json:"template_id"`Deletedbool                 `db:"deleted" json:"deleted"`Namestring               `db:"name" json:"name"`AutostartSchedulesql.NullString       `db:"autostart_schedule" json:"autostart_schedule"`Ttlsql.NullInt64        `db:"ttl" json:"ttl"`LastUsedAttime.Time            `db:"last_used_at" json:"last_used_at"`DormantAtsql.NullTime         `db:"dormant_at" json:"dormant_at"`DeletingAtsql.NullTime         `db:"deleting_at" json:"deleting_at"`AutomaticUpdatesAutomaticUpdates     `db:"automatic_updates" json:"automatic_updates"`Favoritebool                 `db:"favorite" json:"favorite"`NextStartAtsql.NullTime         `db:"next_start_at" json:"next_start_at"`OwnerAvatarUrlstring               `db:"owner_avatar_url" json:"owner_avatar_url"`OwnerUsernamestring               `db:"owner_username" json:"owner_username"`OwnerNamestring               `db:"owner_name" json:"owner_name"`OrganizationNamestring               `db:"organization_name" json:"organization_name"`OrganizationDisplayNamestring               `db:"organization_display_name" json:"organization_display_name"`OrganizationIconstring               `db:"organization_icon" json:"organization_icon"`OrganizationDescriptionstring               `db:"organization_description" json:"organization_description"`TemplateNamestring               `db:"template_name" json:"template_name"`TemplateDisplayNamestring               `db:"template_display_name" json:"template_display_name"`TemplateIconstring               `db:"template_icon" json:"template_icon"`TemplateDescriptionstring               `db:"template_description" json:"template_description"`TemplateVersionIDuuid.UUID            `db:"template_version_id" json:"template_version_id"`TemplateVersionNamesql.NullString       `db:"template_version_name" json:"template_version_name"`LatestBuildCompletedAtsql.NullTime         `db:"latest_build_completed_at" json:"latest_build_completed_at"`LatestBuildCanceledAtsql.NullTime         `db:"latest_build_canceled_at" json:"latest_build_canceled_at"`LatestBuildErrorsql.NullString       `db:"latest_build_error" json:"latest_build_error"`LatestBuildTransitionWorkspaceTransition  `db:"latest_build_transition" json:"latest_build_transition"`LatestBuildStatusProvisionerJobStatus `db:"latest_build_status" json:"latest_build_status"`Countint64                `db:"count" json:"count"`}

typeGitSSHKey

type GitSSHKey struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`PrivateKeystring    `db:"private_key" json:"private_key"`PublicKeystring    `db:"public_key" json:"public_key"`}

func (GitSSHKey)RBACObject

func (uGitSSHKey) RBACObject()rbac.Object

typeGroup

type Group struct {IDuuid.UUID `db:"id" json:"id"`Namestring    `db:"name" json:"name"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`AvatarURLstring    `db:"avatar_url" json:"avatar_url"`QuotaAllowanceint32     `db:"quota_allowance" json:"quota_allowance"`// Display name is a custom, human-friendly group name that user can set. This is not required to be unique and can be the empty string.DisplayNamestring `db:"display_name" json:"display_name"`// Source indicates how the group was created. It can be created by a user manually, or through some system process like OIDC group sync.SourceGroupSource `db:"source" json:"source"`}

func (Group)Auditable

func (gGroup) Auditable(members []GroupMember)AuditableGroup

Auditable returns an object that can be used in audit logs.Covers both group and group member changes.

func (Group)IsEveryone

func (gGroup) IsEveryone()bool

func (Group)RBACObject

func (gGroup) RBACObject()rbac.Object

typeGroupMember

type GroupMember struct {UserIDuuid.UUID     `db:"user_id" json:"user_id"`UserEmailstring        `db:"user_email" json:"user_email"`UserUsernamestring        `db:"user_username" json:"user_username"`UserHashedPassword     []byte        `db:"user_hashed_password" json:"user_hashed_password"`UserCreatedAttime.Time     `db:"user_created_at" json:"user_created_at"`UserUpdatedAttime.Time     `db:"user_updated_at" json:"user_updated_at"`UserStatusUserStatus    `db:"user_status" json:"user_status"`UserRbacRoles          []string      `db:"user_rbac_roles" json:"user_rbac_roles"`UserLoginTypeLoginType     `db:"user_login_type" json:"user_login_type"`UserAvatarUrlstring        `db:"user_avatar_url" json:"user_avatar_url"`UserDeletedbool          `db:"user_deleted" json:"user_deleted"`UserLastSeenAttime.Time     `db:"user_last_seen_at" json:"user_last_seen_at"`UserQuietHoursSchedulestring        `db:"user_quiet_hours_schedule" json:"user_quiet_hours_schedule"`UserNamestring        `db:"user_name" json:"user_name"`UserGithubComUserIDsql.NullInt64 `db:"user_github_com_user_id" json:"user_github_com_user_id"`UserIsSystembool          `db:"user_is_system" json:"user_is_system"`OrganizationIDuuid.UUID     `db:"organization_id" json:"organization_id"`GroupNamestring        `db:"group_name" json:"group_name"`GroupIDuuid.UUID     `db:"group_id" json:"group_id"`}

Joins group members with user information, organization ID, group name. Includes both regular group members and organization members (as part of the "Everyone" group).

func (GroupMember)RBACObjectadded inv2.15.0

func (gmGroupMember) RBACObject()rbac.Object

typeGroupMemberTableadded inv2.15.0

type GroupMemberTable struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`GroupIDuuid.UUID `db:"group_id" json:"group_id"`}

typeGroupSource

type GroupSourcestring
const (GroupSourceUserGroupSource = "user"GroupSourceOidcGroupSource = "oidc")

funcAllGroupSourceValues

func AllGroupSourceValues() []GroupSource

func (*GroupSource)Scan

func (e *GroupSource) Scan(src interface{})error

func (GroupSource)Valid

func (eGroupSource) Valid()bool

typeHealthSettingsadded inv2.5.0

type HealthSettings struct {IDuuid.UUID `db:"id" json:"id"`DismissedHealthchecks []string  `db:"dismissed_healthchecks" json:"dismissed_healthchecks"`}

typeInboxNotificationadded inv2.21.0

type InboxNotification struct {IDuuid.UUID       `db:"id" json:"id"`UserIDuuid.UUID       `db:"user_id" json:"user_id"`TemplateIDuuid.UUID       `db:"template_id" json:"template_id"`Targets    []uuid.UUID     `db:"targets" json:"targets"`Titlestring          `db:"title" json:"title"`Contentstring          `db:"content" json:"content"`Iconstring          `db:"icon" json:"icon"`Actionsjson.RawMessage `db:"actions" json:"actions"`ReadAtsql.NullTime    `db:"read_at" json:"read_at"`CreatedAttime.Time       `db:"created_at" json:"created_at"`}

func (InboxNotification)RBACObjectadded inv2.21.0

func (iInboxNotification) RBACObject()rbac.Object

typeInboxNotificationReadStatusadded inv2.21.0

type InboxNotificationReadStatusstring
const (InboxNotificationReadStatusAllInboxNotificationReadStatus = "all"InboxNotificationReadStatusUnreadInboxNotificationReadStatus = "unread"InboxNotificationReadStatusReadInboxNotificationReadStatus = "read")

funcAllInboxNotificationReadStatusValuesadded inv2.21.0

func AllInboxNotificationReadStatusValues() []InboxNotificationReadStatus

func (*InboxNotificationReadStatus)Scanadded inv2.21.0

func (e *InboxNotificationReadStatus) Scan(src interface{})error

func (InboxNotificationReadStatus)Validadded inv2.21.0

typeInsertAPIKeyParams

type InsertAPIKeyParams struct {IDstring      `db:"id" json:"id"`LifetimeSecondsint64       `db:"lifetime_seconds" json:"lifetime_seconds"`HashedSecret    []byte      `db:"hashed_secret" json:"hashed_secret"`IPAddresspqtype.Inet `db:"ip_address" json:"ip_address"`UserIDuuid.UUID   `db:"user_id" json:"user_id"`LastUsedtime.Time   `db:"last_used" json:"last_used"`ExpiresAttime.Time   `db:"expires_at" json:"expires_at"`CreatedAttime.Time   `db:"created_at" json:"created_at"`UpdatedAttime.Time   `db:"updated_at" json:"updated_at"`LoginTypeLoginType   `db:"login_type" json:"login_type"`ScopeAPIKeyScope `db:"scope" json:"scope"`TokenNamestring      `db:"token_name" json:"token_name"`}

typeInsertAuditLogParams

type InsertAuditLogParams struct {IDuuid.UUID       `db:"id" json:"id"`Timetime.Time       `db:"time" json:"time"`UserIDuuid.UUID       `db:"user_id" json:"user_id"`OrganizationIDuuid.UUID       `db:"organization_id" json:"organization_id"`Ippqtype.Inet     `db:"ip" json:"ip"`UserAgentsql.NullString  `db:"user_agent" json:"user_agent"`ResourceTypeResourceType    `db:"resource_type" json:"resource_type"`ResourceIDuuid.UUID       `db:"resource_id" json:"resource_id"`ResourceTargetstring          `db:"resource_target" json:"resource_target"`ActionAuditAction     `db:"action" json:"action"`Diffjson.RawMessage `db:"diff" json:"diff"`StatusCodeint32           `db:"status_code" json:"status_code"`AdditionalFieldsjson.RawMessage `db:"additional_fields" json:"additional_fields"`RequestIDuuid.UUID       `db:"request_id" json:"request_id"`ResourceIconstring          `db:"resource_icon" json:"resource_icon"`}

typeInsertChatMessagesParamsadded inv2.23.0

type InsertChatMessagesParams struct {ChatIDuuid.UUID       `db:"chat_id" json:"chat_id"`CreatedAttime.Time       `db:"created_at" json:"created_at"`Modelstring          `db:"model" json:"model"`Providerstring          `db:"provider" json:"provider"`Contentjson.RawMessage `db:"content" json:"content"`}

typeInsertChatParamsadded inv2.23.0

type InsertChatParams struct {OwnerIDuuid.UUID `db:"owner_id" json:"owner_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`Titlestring    `db:"title" json:"title"`}

typeInsertCryptoKeyParamsadded inv2.16.0

type InsertCryptoKeyParams struct {FeatureCryptoKeyFeature `db:"feature" json:"feature"`Sequenceint32            `db:"sequence" json:"sequence"`Secretsql.NullString   `db:"secret" json:"secret"`StartsAttime.Time        `db:"starts_at" json:"starts_at"`SecretKeyIDsql.NullString   `db:"secret_key_id" json:"secret_key_id"`}

typeInsertCustomRoleParamsadded inv2.15.0

type InsertCustomRoleParams struct {Namestring                `db:"name" json:"name"`DisplayNamestring                `db:"display_name" json:"display_name"`OrganizationIDuuid.NullUUID         `db:"organization_id" json:"organization_id"`SitePermissionsCustomRolePermissions `db:"site_permissions" json:"site_permissions"`OrgPermissionsCustomRolePermissions `db:"org_permissions" json:"org_permissions"`UserPermissionsCustomRolePermissions `db:"user_permissions" json:"user_permissions"`}

typeInsertDBCryptKeyParamsadded inv2.2.0

type InsertDBCryptKeyParams struct {Numberint32  `db:"number" json:"number"`ActiveKeyDigeststring `db:"active_key_digest" json:"active_key_digest"`Teststring `db:"test" json:"test"`}

typeInsertExternalAuthLinkParamsadded inv2.2.1

type InsertExternalAuthLinkParams struct {ProviderIDstring                `db:"provider_id" json:"provider_id"`UserIDuuid.UUID             `db:"user_id" json:"user_id"`CreatedAttime.Time             `db:"created_at" json:"created_at"`UpdatedAttime.Time             `db:"updated_at" json:"updated_at"`OAuthAccessTokenstring                `db:"oauth_access_token" json:"oauth_access_token"`OAuthAccessTokenKeyIDsql.NullString        `db:"oauth_access_token_key_id" json:"oauth_access_token_key_id"`OAuthRefreshTokenstring                `db:"oauth_refresh_token" json:"oauth_refresh_token"`OAuthRefreshTokenKeyIDsql.NullString        `db:"oauth_refresh_token_key_id" json:"oauth_refresh_token_key_id"`OAuthExpirytime.Time             `db:"oauth_expiry" json:"oauth_expiry"`OAuthExtrapqtype.NullRawMessage `db:"oauth_extra" json:"oauth_extra"`}

typeInsertFileParams

type InsertFileParams struct {IDuuid.UUID `db:"id" json:"id"`Hashstring    `db:"hash" json:"hash"`CreatedAttime.Time `db:"created_at" json:"created_at"`CreatedByuuid.UUID `db:"created_by" json:"created_by"`Mimetypestring    `db:"mimetype" json:"mimetype"`Data      []byte    `db:"data" json:"data"`}

typeInsertGitSSHKeyParams

type InsertGitSSHKeyParams struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`PrivateKeystring    `db:"private_key" json:"private_key"`PublicKeystring    `db:"public_key" json:"public_key"`}

typeInsertGroupMemberParams

type InsertGroupMemberParams struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`GroupIDuuid.UUID `db:"group_id" json:"group_id"`}

typeInsertGroupParams

type InsertGroupParams struct {IDuuid.UUID `db:"id" json:"id"`Namestring    `db:"name" json:"name"`DisplayNamestring    `db:"display_name" json:"display_name"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`AvatarURLstring    `db:"avatar_url" json:"avatar_url"`QuotaAllowanceint32     `db:"quota_allowance" json:"quota_allowance"`}

typeInsertInboxNotificationParamsadded inv2.21.0

type InsertInboxNotificationParams struct {IDuuid.UUID       `db:"id" json:"id"`UserIDuuid.UUID       `db:"user_id" json:"user_id"`TemplateIDuuid.UUID       `db:"template_id" json:"template_id"`Targets    []uuid.UUID     `db:"targets" json:"targets"`Titlestring          `db:"title" json:"title"`Contentstring          `db:"content" json:"content"`Iconstring          `db:"icon" json:"icon"`Actionsjson.RawMessage `db:"actions" json:"actions"`CreatedAttime.Time       `db:"created_at" json:"created_at"`}

typeInsertLicenseParams

type InsertLicenseParams struct {UploadedAttime.Time `db:"uploaded_at" json:"uploaded_at"`JWTstring    `db:"jwt" json:"jwt"`Exptime.Time `db:"exp" json:"exp"`UUIDuuid.UUID `db:"uuid" json:"uuid"`}

typeInsertMemoryResourceMonitorParamsadded inv2.20.0

type InsertMemoryResourceMonitorParams struct {AgentIDuuid.UUID                  `db:"agent_id" json:"agent_id"`Enabledbool                       `db:"enabled" json:"enabled"`StateWorkspaceAgentMonitorState `db:"state" json:"state"`Thresholdint32                      `db:"threshold" json:"threshold"`CreatedAttime.Time                  `db:"created_at" json:"created_at"`UpdatedAttime.Time                  `db:"updated_at" json:"updated_at"`DebouncedUntiltime.Time                  `db:"debounced_until" json:"debounced_until"`}

typeInsertMissingGroupsParams

type InsertMissingGroupsParams struct {OrganizationIDuuid.UUID   `db:"organization_id" json:"organization_id"`SourceGroupSource `db:"source" json:"source"`GroupNames     []string    `db:"group_names" json:"group_names"`}

typeInsertOAuth2ProviderAppCodeParamsadded inv2.9.0

type InsertOAuth2ProviderAppCodeParams struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`ExpiresAttime.Time `db:"expires_at" json:"expires_at"`SecretPrefix []byte    `db:"secret_prefix" json:"secret_prefix"`HashedSecret []byte    `db:"hashed_secret" json:"hashed_secret"`AppIDuuid.UUID `db:"app_id" json:"app_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`}

typeInsertOAuth2ProviderAppParamsadded inv2.6.0

type InsertOAuth2ProviderAppParams struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`Namestring    `db:"name" json:"name"`Iconstring    `db:"icon" json:"icon"`CallbackURLstring    `db:"callback_url" json:"callback_url"`}

typeInsertOAuth2ProviderAppSecretParamsadded inv2.6.0

type InsertOAuth2ProviderAppSecretParams struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`SecretPrefix  []byte    `db:"secret_prefix" json:"secret_prefix"`HashedSecret  []byte    `db:"hashed_secret" json:"hashed_secret"`DisplaySecretstring    `db:"display_secret" json:"display_secret"`AppIDuuid.UUID `db:"app_id" json:"app_id"`}

typeInsertOAuth2ProviderAppTokenParamsadded inv2.9.0

type InsertOAuth2ProviderAppTokenParams struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`ExpiresAttime.Time `db:"expires_at" json:"expires_at"`HashPrefix  []byte    `db:"hash_prefix" json:"hash_prefix"`RefreshHash []byte    `db:"refresh_hash" json:"refresh_hash"`AppSecretIDuuid.UUID `db:"app_secret_id" json:"app_secret_id"`APIKeyIDstring    `db:"api_key_id" json:"api_key_id"`}

typeInsertOrganizationMemberParams

type InsertOrganizationMemberParams struct {OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`Roles          []string  `db:"roles" json:"roles"`}

typeInsertOrganizationParams

type InsertOrganizationParams struct {IDuuid.UUID `db:"id" json:"id"`Namestring    `db:"name" json:"name"`DisplayNamestring    `db:"display_name" json:"display_name"`Descriptionstring    `db:"description" json:"description"`Iconstring    `db:"icon" json:"icon"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`}

typeInsertPresetParametersParamsadded inv2.20.0

type InsertPresetParametersParams struct {TemplateVersionPresetIDuuid.UUID `db:"template_version_preset_id" json:"template_version_preset_id"`Names                   []string  `db:"names" json:"names"`Values                  []string  `db:"values" json:"values"`}

typeInsertPresetParamsadded inv2.20.0

type InsertPresetParams struct {IDuuid.UUID     `db:"id" json:"id"`TemplateVersionIDuuid.UUID     `db:"template_version_id" json:"template_version_id"`Namestring        `db:"name" json:"name"`CreatedAttime.Time     `db:"created_at" json:"created_at"`DesiredInstancessql.NullInt32 `db:"desired_instances" json:"desired_instances"`InvalidateAfterSecssql.NullInt32 `db:"invalidate_after_secs" json:"invalidate_after_secs"`}

typeInsertProvisionerJobLogsParams

type InsertProvisionerJobLogsParams struct {JobIDuuid.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"`Stage     []string    `db:"stage" json:"stage"`Output    []string    `db:"output" json:"output"`}

typeInsertProvisionerJobParams

type InsertProvisionerJobParams struct {IDuuid.UUID                `db:"id" json:"id"`CreatedAttime.Time                `db:"created_at" json:"created_at"`UpdatedAttime.Time                `db:"updated_at" json:"updated_at"`OrganizationIDuuid.UUID                `db:"organization_id" json:"organization_id"`InitiatorIDuuid.UUID                `db:"initiator_id" json:"initiator_id"`ProvisionerProvisionerType          `db:"provisioner" json:"provisioner"`StorageMethodProvisionerStorageMethod `db:"storage_method" json:"storage_method"`FileIDuuid.UUID                `db:"file_id" json:"file_id"`TypeProvisionerJobType       `db:"type" json:"type"`Inputjson.RawMessage          `db:"input" json:"input"`TagsStringMap                `db:"tags" json:"tags"`TraceMetadatapqtype.NullRawMessage    `db:"trace_metadata" json:"trace_metadata"`}

typeInsertProvisionerJobTimingsParamsadded inv2.15.0

type InsertProvisionerJobTimingsParams struct {JobIDuuid.UUID                   `db:"job_id" json:"job_id"`StartedAt []time.Time                 `db:"started_at" json:"started_at"`EndedAt   []time.Time                 `db:"ended_at" json:"ended_at"`Stage     []ProvisionerJobTimingStage `db:"stage" json:"stage"`Source    []string                    `db:"source" json:"source"`Action    []string                    `db:"action" json:"action"`Resource  []string                    `db:"resource" json:"resource"`}

typeInsertProvisionerKeyParamsadded inv2.14.0

type InsertProvisionerKeyParams struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`HashedSecret   []byte    `db:"hashed_secret" json:"hashed_secret"`TagsStringMap `db:"tags" json:"tags"`Namestring    `db:"name" json:"name"`}

typeInsertReplicaParams

type InsertReplicaParams struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`StartedAttime.Time `db:"started_at" json:"started_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`Hostnamestring    `db:"hostname" json:"hostname"`RegionIDint32     `db:"region_id" json:"region_id"`RelayAddressstring    `db:"relay_address" json:"relay_address"`Versionstring    `db:"version" json:"version"`DatabaseLatencyint32     `db:"database_latency" json:"database_latency"`Primarybool      `db:"primary" json:"primary"`}

typeInsertTelemetryItemIfNotExistsParamsadded inv2.19.0

type InsertTelemetryItemIfNotExistsParams struct {Keystring `db:"key" json:"key"`Valuestring `db:"value" json:"value"`}

typeInsertTemplateParams

type InsertTemplateParams struct {IDuuid.UUID       `db:"id" json:"id"`CreatedAttime.Time       `db:"created_at" json:"created_at"`UpdatedAttime.Time       `db:"updated_at" json:"updated_at"`OrganizationIDuuid.UUID       `db:"organization_id" json:"organization_id"`Namestring          `db:"name" json:"name"`ProvisionerProvisionerType `db:"provisioner" json:"provisioner"`ActiveVersionIDuuid.UUID       `db:"active_version_id" json:"active_version_id"`Descriptionstring          `db:"description" json:"description"`CreatedByuuid.UUID       `db:"created_by" json:"created_by"`Iconstring          `db:"icon" json:"icon"`UserACLTemplateACL     `db:"user_acl" json:"user_acl"`GroupACLTemplateACL     `db:"group_acl" json:"group_acl"`DisplayNamestring          `db:"display_name" json:"display_name"`AllowUserCancelWorkspaceJobsbool            `db:"allow_user_cancel_workspace_jobs" json:"allow_user_cancel_workspace_jobs"`MaxPortSharingLevelAppSharingLevel `db:"max_port_sharing_level" json:"max_port_sharing_level"`}

typeInsertTemplateVersionParameterParams

type InsertTemplateVersionParameterParams struct {TemplateVersionIDuuid.UUID       `db:"template_version_id" json:"template_version_id"`Namestring          `db:"name" json:"name"`Descriptionstring          `db:"description" json:"description"`Typestring          `db:"type" json:"type"`Mutablebool            `db:"mutable" json:"mutable"`DefaultValuestring          `db:"default_value" json:"default_value"`Iconstring          `db:"icon" json:"icon"`Optionsjson.RawMessage `db:"options" json:"options"`ValidationRegexstring          `db:"validation_regex" json:"validation_regex"`ValidationMinsql.NullInt32   `db:"validation_min" json:"validation_min"`ValidationMaxsql.NullInt32   `db:"validation_max" json:"validation_max"`ValidationErrorstring          `db:"validation_error" json:"validation_error"`ValidationMonotonicstring          `db:"validation_monotonic" json:"validation_monotonic"`Requiredbool            `db:"required" json:"required"`DisplayNamestring          `db:"display_name" json:"display_name"`DisplayOrderint32           `db:"display_order" json:"display_order"`Ephemeralbool            `db:"ephemeral" json:"ephemeral"`}

typeInsertTemplateVersionParams

type InsertTemplateVersionParams struct {IDuuid.UUID      `db:"id" json:"id"`TemplateIDuuid.NullUUID  `db:"template_id" json:"template_id"`OrganizationIDuuid.UUID      `db:"organization_id" json:"organization_id"`CreatedAttime.Time      `db:"created_at" json:"created_at"`UpdatedAttime.Time      `db:"updated_at" json:"updated_at"`Namestring         `db:"name" json:"name"`Messagestring         `db:"message" json:"message"`Readmestring         `db:"readme" json:"readme"`JobIDuuid.UUID      `db:"job_id" json:"job_id"`CreatedByuuid.UUID      `db:"created_by" json:"created_by"`SourceExampleIDsql.NullString `db:"source_example_id" json:"source_example_id"`}

typeInsertTemplateVersionTerraformValuesByJobIDParamsadded inv2.21.0

type InsertTemplateVersionTerraformValuesByJobIDParams struct {JobIDuuid.UUID       `db:"job_id" json:"job_id"`CachedPlanjson.RawMessage `db:"cached_plan" json:"cached_plan"`CachedModuleFilesuuid.NullUUID   `db:"cached_module_files" json:"cached_module_files"`UpdatedAttime.Time       `db:"updated_at" json:"updated_at"`ProvisionerdVersionstring          `db:"provisionerd_version" json:"provisionerd_version"`}

typeInsertTemplateVersionVariableParams

type InsertTemplateVersionVariableParams struct {TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`Namestring    `db:"name" json:"name"`Descriptionstring    `db:"description" json:"description"`Typestring    `db:"type" json:"type"`Valuestring    `db:"value" json:"value"`DefaultValuestring    `db:"default_value" json:"default_value"`Requiredbool      `db:"required" json:"required"`Sensitivebool      `db:"sensitive" json:"sensitive"`}

typeInsertTemplateVersionWorkspaceTagParamsadded inv2.12.0

type InsertTemplateVersionWorkspaceTagParams struct {TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`Keystring    `db:"key" json:"key"`Valuestring    `db:"value" json:"value"`}

typeInsertUserGroupsByIDParamsadded inv2.16.0

type InsertUserGroupsByIDParams struct {UserIDuuid.UUID   `db:"user_id" json:"user_id"`GroupIds []uuid.UUID `db:"group_ids" json:"group_ids"`}

typeInsertUserGroupsByNameParams

type InsertUserGroupsByNameParams struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`GroupNames     []string  `db:"group_names" json:"group_names"`}

typeInsertUserLinkParams

type InsertUserLinkParams struct {UserIDuuid.UUID      `db:"user_id" json:"user_id"`LoginTypeLoginType      `db:"login_type" json:"login_type"`LinkedIDstring         `db:"linked_id" json:"linked_id"`OAuthAccessTokenstring         `db:"oauth_access_token" json:"oauth_access_token"`OAuthAccessTokenKeyIDsql.NullString `db:"oauth_access_token_key_id" json:"oauth_access_token_key_id"`OAuthRefreshTokenstring         `db:"oauth_refresh_token" json:"oauth_refresh_token"`OAuthRefreshTokenKeyIDsql.NullString `db:"oauth_refresh_token_key_id" json:"oauth_refresh_token_key_id"`OAuthExpirytime.Time      `db:"oauth_expiry" json:"oauth_expiry"`ClaimsUserLinkClaims `db:"claims" json:"claims"`}

typeInsertUserParams

type InsertUserParams struct {IDuuid.UUID      `db:"id" json:"id"`Emailstring         `db:"email" json:"email"`Usernamestring         `db:"username" json:"username"`Namestring         `db:"name" json:"name"`HashedPassword []byte         `db:"hashed_password" json:"hashed_password"`CreatedAttime.Time      `db:"created_at" json:"created_at"`UpdatedAttime.Time      `db:"updated_at" json:"updated_at"`RBACRolespq.StringArray `db:"rbac_roles" json:"rbac_roles"`LoginTypeLoginType      `db:"login_type" json:"login_type"`Statusstring         `db:"status" json:"status"`}

typeInsertVolumeResourceMonitorParamsadded inv2.20.0

type InsertVolumeResourceMonitorParams struct {AgentIDuuid.UUID                  `db:"agent_id" json:"agent_id"`Pathstring                     `db:"path" json:"path"`Enabledbool                       `db:"enabled" json:"enabled"`StateWorkspaceAgentMonitorState `db:"state" json:"state"`Thresholdint32                      `db:"threshold" json:"threshold"`CreatedAttime.Time                  `db:"created_at" json:"created_at"`UpdatedAttime.Time                  `db:"updated_at" json:"updated_at"`DebouncedUntiltime.Time                  `db:"debounced_until" json:"debounced_until"`}

typeInsertWebpushSubscriptionParamsadded inv2.21.0

type InsertWebpushSubscriptionParams struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`Endpointstring    `db:"endpoint" json:"endpoint"`EndpointP256dhKeystring    `db:"endpoint_p256dh_key" json:"endpoint_p256dh_key"`EndpointAuthKeystring    `db:"endpoint_auth_key" json:"endpoint_auth_key"`}

typeInsertWorkspaceAgentDevcontainersParamsadded inv2.21.0

type InsertWorkspaceAgentDevcontainersParams struct {WorkspaceAgentIDuuid.UUID   `db:"workspace_agent_id" json:"workspace_agent_id"`CreatedAttime.Time   `db:"created_at" json:"created_at"`ID               []uuid.UUID `db:"id" json:"id"`Name             []string    `db:"name" json:"name"`WorkspaceFolder  []string    `db:"workspace_folder" json:"workspace_folder"`ConfigPath       []string    `db:"config_path" json:"config_path"`}

typeInsertWorkspaceAgentLogSourcesParamsadded inv2.2.0

type InsertWorkspaceAgentLogSourcesParams struct {WorkspaceAgentIDuuid.UUID   `db:"workspace_agent_id" json:"workspace_agent_id"`CreatedAttime.Time   `db:"created_at" json:"created_at"`ID               []uuid.UUID `db:"id" json:"id"`DisplayName      []string    `db:"display_name" json:"display_name"`Icon             []string    `db:"icon" json:"icon"`}

typeInsertWorkspaceAgentLogsParams

type InsertWorkspaceAgentLogsParams struct {AgentIDuuid.UUID  `db:"agent_id" json:"agent_id"`CreatedAttime.Time  `db:"created_at" json:"created_at"`Output       []string   `db:"output" json:"output"`Level        []LogLevel `db:"level" json:"level"`LogSourceIDuuid.UUID  `db:"log_source_id" json:"log_source_id"`OutputLengthint32      `db:"output_length" json:"output_length"`}

typeInsertWorkspaceAgentMetadataParams

type InsertWorkspaceAgentMetadataParams struct {WorkspaceAgentIDuuid.UUID `db:"workspace_agent_id" json:"workspace_agent_id"`DisplayNamestring    `db:"display_name" json:"display_name"`Keystring    `db:"key" json:"key"`Scriptstring    `db:"script" json:"script"`Timeoutint64     `db:"timeout" json:"timeout"`Intervalint64     `db:"interval" json:"interval"`DisplayOrderint32     `db:"display_order" json:"display_order"`}

typeInsertWorkspaceAgentParams

type InsertWorkspaceAgentParams struct {IDuuid.UUID             `db:"id" json:"id"`ParentIDuuid.NullUUID         `db:"parent_id" json:"parent_id"`CreatedAttime.Time             `db:"created_at" json:"created_at"`UpdatedAttime.Time             `db:"updated_at" json:"updated_at"`Namestring                `db:"name" json:"name"`ResourceIDuuid.UUID             `db:"resource_id" json:"resource_id"`AuthTokenuuid.UUID             `db:"auth_token" json:"auth_token"`AuthInstanceIDsql.NullString        `db:"auth_instance_id" json:"auth_instance_id"`Architecturestring                `db:"architecture" json:"architecture"`EnvironmentVariablespqtype.NullRawMessage `db:"environment_variables" json:"environment_variables"`OperatingSystemstring                `db:"operating_system" json:"operating_system"`Directorystring                `db:"directory" json:"directory"`InstanceMetadatapqtype.NullRawMessage `db:"instance_metadata" json:"instance_metadata"`ResourceMetadatapqtype.NullRawMessage `db:"resource_metadata" json:"resource_metadata"`ConnectionTimeoutSecondsint32                 `db:"connection_timeout_seconds" json:"connection_timeout_seconds"`TroubleshootingURLstring                `db:"troubleshooting_url" json:"troubleshooting_url"`MOTDFilestring                `db:"motd_file" json:"motd_file"`DisplayApps              []DisplayApp          `db:"display_apps" json:"display_apps"`DisplayOrderint32                 `db:"display_order" json:"display_order"`APIKeyScopeAgentKeyScopeEnum     `db:"api_key_scope" json:"api_key_scope"`}

typeInsertWorkspaceAgentScriptTimingsParamsadded inv2.16.0

type InsertWorkspaceAgentScriptTimingsParams struct {ScriptIDuuid.UUID                        `db:"script_id" json:"script_id"`StartedAttime.Time                        `db:"started_at" json:"started_at"`EndedAttime.Time                        `db:"ended_at" json:"ended_at"`ExitCodeint32                            `db:"exit_code" json:"exit_code"`StageWorkspaceAgentScriptTimingStage  `db:"stage" json:"stage"`StatusWorkspaceAgentScriptTimingStatus `db:"status" json:"status"`}

typeInsertWorkspaceAgentScriptsParamsadded inv2.2.0

type InsertWorkspaceAgentScriptsParams struct {WorkspaceAgentIDuuid.UUID   `db:"workspace_agent_id" json:"workspace_agent_id"`CreatedAttime.Time   `db:"created_at" json:"created_at"`LogSourceID      []uuid.UUID `db:"log_source_id" json:"log_source_id"`LogPath          []string    `db:"log_path" json:"log_path"`Script           []string    `db:"script" json:"script"`Cron             []string    `db:"cron" json:"cron"`StartBlocksLogin []bool      `db:"start_blocks_login" json:"start_blocks_login"`RunOnStart       []bool      `db:"run_on_start" json:"run_on_start"`RunOnStop        []bool      `db:"run_on_stop" json:"run_on_stop"`TimeoutSeconds   []int32     `db:"timeout_seconds" json:"timeout_seconds"`DisplayName      []string    `db:"display_name" json:"display_name"`ID               []uuid.UUID `db:"id" json:"id"`}

typeInsertWorkspaceAgentStatsParams

type InsertWorkspaceAgentStatsParams 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"`WorkspaceID                 []uuid.UUID     `db:"workspace_id" json:"workspace_id"`TemplateID                  []uuid.UUID     `db:"template_id" json:"template_id"`AgentID                     []uuid.UUID     `db:"agent_id" json:"agent_id"`ConnectionsByProtojson.RawMessage `db:"connections_by_proto" json:"connections_by_proto"`ConnectionCount             []int64         `db:"connection_count" json:"connection_count"`RxPackets                   []int64         `db:"rx_packets" json:"rx_packets"`RxBytes                     []int64         `db:"rx_bytes" json:"rx_bytes"`TxPackets                   []int64         `db:"tx_packets" json:"tx_packets"`TxBytes                     []int64         `db:"tx_bytes" json:"tx_bytes"`SessionCountVSCode          []int64         `db:"session_count_vscode" json:"session_count_vscode"`SessionCountJetBrains       []int64         `db:"session_count_jetbrains" json:"session_count_jetbrains"`SessionCountReconnectingPTY []int64         `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"`SessionCountSSH             []int64         `db:"session_count_ssh" json:"session_count_ssh"`ConnectionMedianLatencyMS   []float64       `db:"connection_median_latency_ms" json:"connection_median_latency_ms"`Usage                       []bool          `db:"usage" json:"usage"`}

typeInsertWorkspaceAppParams

type InsertWorkspaceAppParams struct {IDuuid.UUID          `db:"id" json:"id"`CreatedAttime.Time          `db:"created_at" json:"created_at"`AgentIDuuid.UUID          `db:"agent_id" json:"agent_id"`Slugstring             `db:"slug" json:"slug"`DisplayNamestring             `db:"display_name" json:"display_name"`Iconstring             `db:"icon" json:"icon"`Commandsql.NullString     `db:"command" json:"command"`Urlsql.NullString     `db:"url" json:"url"`Externalbool               `db:"external" json:"external"`Subdomainbool               `db:"subdomain" json:"subdomain"`SharingLevelAppSharingLevel    `db:"sharing_level" json:"sharing_level"`HealthcheckUrlstring             `db:"healthcheck_url" json:"healthcheck_url"`HealthcheckIntervalint32              `db:"healthcheck_interval" json:"healthcheck_interval"`HealthcheckThresholdint32              `db:"healthcheck_threshold" json:"healthcheck_threshold"`HealthWorkspaceAppHealth `db:"health" json:"health"`DisplayOrderint32              `db:"display_order" json:"display_order"`Hiddenbool               `db:"hidden" json:"hidden"`OpenInWorkspaceAppOpenIn `db:"open_in" json:"open_in"`DisplayGroupsql.NullString     `db:"display_group" json:"display_group"`}

typeInsertWorkspaceAppStatsParams

type InsertWorkspaceAppStatsParams struct {UserID           []uuid.UUID `db:"user_id" json:"user_id"`WorkspaceID      []uuid.UUID `db:"workspace_id" json:"workspace_id"`AgentID          []uuid.UUID `db:"agent_id" json:"agent_id"`AccessMethod     []string    `db:"access_method" json:"access_method"`SlugOrPort       []string    `db:"slug_or_port" json:"slug_or_port"`SessionID        []uuid.UUID `db:"session_id" json:"session_id"`SessionStartedAt []time.Time `db:"session_started_at" json:"session_started_at"`SessionEndedAt   []time.Time `db:"session_ended_at" json:"session_ended_at"`Requests         []int32     `db:"requests" json:"requests"`}

typeInsertWorkspaceAppStatusParamsadded inv2.21.0

type InsertWorkspaceAppStatusParams struct {IDuuid.UUID               `db:"id" json:"id"`CreatedAttime.Time               `db:"created_at" json:"created_at"`WorkspaceIDuuid.UUID               `db:"workspace_id" json:"workspace_id"`AgentIDuuid.UUID               `db:"agent_id" json:"agent_id"`AppIDuuid.UUID               `db:"app_id" json:"app_id"`StateWorkspaceAppStatusState `db:"state" json:"state"`Messagestring                  `db:"message" json:"message"`Urisql.NullString          `db:"uri" json:"uri"`}

typeInsertWorkspaceBuildParametersParams

type InsertWorkspaceBuildParametersParams struct {WorkspaceBuildIDuuid.UUID `db:"workspace_build_id" json:"workspace_build_id"`Name             []string  `db:"name" json:"name"`Value            []string  `db:"value" json:"value"`}

typeInsertWorkspaceBuildParams

type InsertWorkspaceBuildParams struct {IDuuid.UUID           `db:"id" json:"id"`CreatedAttime.Time           `db:"created_at" json:"created_at"`UpdatedAttime.Time           `db:"updated_at" json:"updated_at"`WorkspaceIDuuid.UUID           `db:"workspace_id" json:"workspace_id"`TemplateVersionIDuuid.UUID           `db:"template_version_id" json:"template_version_id"`BuildNumberint32               `db:"build_number" json:"build_number"`TransitionWorkspaceTransition `db:"transition" json:"transition"`InitiatorIDuuid.UUID           `db:"initiator_id" json:"initiator_id"`JobIDuuid.UUID           `db:"job_id" json:"job_id"`ProvisionerState        []byte              `db:"provisioner_state" json:"provisioner_state"`Deadlinetime.Time           `db:"deadline" json:"deadline"`MaxDeadlinetime.Time           `db:"max_deadline" json:"max_deadline"`ReasonBuildReason         `db:"reason" json:"reason"`TemplateVersionPresetIDuuid.NullUUID       `db:"template_version_preset_id" json:"template_version_preset_id"`}

typeInsertWorkspaceModuleParamsadded inv2.18.0

type InsertWorkspaceModuleParams struct {IDuuid.UUID           `db:"id" json:"id"`JobIDuuid.UUID           `db:"job_id" json:"job_id"`TransitionWorkspaceTransition `db:"transition" json:"transition"`Sourcestring              `db:"source" json:"source"`Versionstring              `db:"version" json:"version"`Keystring              `db:"key" json:"key"`CreatedAttime.Time           `db:"created_at" json:"created_at"`}

typeInsertWorkspaceParams

type InsertWorkspaceParams struct {IDuuid.UUID        `db:"id" json:"id"`CreatedAttime.Time        `db:"created_at" json:"created_at"`UpdatedAttime.Time        `db:"updated_at" json:"updated_at"`OwnerIDuuid.UUID        `db:"owner_id" json:"owner_id"`OrganizationIDuuid.UUID        `db:"organization_id" json:"organization_id"`TemplateIDuuid.UUID        `db:"template_id" json:"template_id"`Namestring           `db:"name" json:"name"`AutostartSchedulesql.NullString   `db:"autostart_schedule" json:"autostart_schedule"`Ttlsql.NullInt64    `db:"ttl" json:"ttl"`LastUsedAttime.Time        `db:"last_used_at" json:"last_used_at"`AutomaticUpdatesAutomaticUpdates `db:"automatic_updates" json:"automatic_updates"`NextStartAtsql.NullTime     `db:"next_start_at" json:"next_start_at"`}

typeInsertWorkspaceProxyParams

type InsertWorkspaceProxyParams struct {IDuuid.UUID `db:"id" json:"id"`Namestring    `db:"name" json:"name"`DisplayNamestring    `db:"display_name" json:"display_name"`Iconstring    `db:"icon" json:"icon"`DerpEnabledbool      `db:"derp_enabled" json:"derp_enabled"`DerpOnlybool      `db:"derp_only" json:"derp_only"`TokenHashedSecret []byte    `db:"token_hashed_secret" json:"token_hashed_secret"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`}

typeInsertWorkspaceResourceMetadataParams

type InsertWorkspaceResourceMetadataParams struct {WorkspaceResourceIDuuid.UUID `db:"workspace_resource_id" json:"workspace_resource_id"`Key                 []string  `db:"key" json:"key"`Value               []string  `db:"value" json:"value"`Sensitive           []bool    `db:"sensitive" json:"sensitive"`}

typeInsertWorkspaceResourceParams

type InsertWorkspaceResourceParams struct {IDuuid.UUID           `db:"id" json:"id"`CreatedAttime.Time           `db:"created_at" json:"created_at"`JobIDuuid.UUID           `db:"job_id" json:"job_id"`TransitionWorkspaceTransition `db:"transition" json:"transition"`Typestring              `db:"type" json:"type"`Namestring              `db:"name" json:"name"`Hidebool                `db:"hide" json:"hide"`Iconstring              `db:"icon" json:"icon"`InstanceTypesql.NullString      `db:"instance_type" json:"instance_type"`DailyCostint32               `db:"daily_cost" json:"daily_cost"`ModulePathsql.NullString      `db:"module_path" json:"module_path"`}

typeJfrogXrayScanadded inv2.8.0

type JfrogXrayScan struct {AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`WorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`Criticalint32     `db:"critical" json:"critical"`Highint32     `db:"high" json:"high"`Mediumint32     `db:"medium" json:"medium"`ResultsUrlstring    `db:"results_url" json:"results_url"`}

typeLicense

type License struct {IDint32     `db:"id" json:"id"`UploadedAttime.Time `db:"uploaded_at" json:"uploaded_at"`JWTstring    `db:"jwt" json:"jwt"`// 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.Exptime.Time `db:"exp" json:"exp"`UUIDuuid.UUID `db:"uuid" json:"uuid"`}

func (License)RBACObject

func (lLicense) RBACObject()rbac.Object

typeLogLevel

type LogLevelstring
const (LogLevelTraceLogLevel = "trace"LogLevelDebugLogLevel = "debug"LogLevelInfoLogLevel = "info"LogLevelWarnLogLevel = "warn"LogLevelErrorLogLevel = "error")

funcAllLogLevelValues

func AllLogLevelValues() []LogLevel

func (*LogLevel)Scan

func (e *LogLevel) Scan(src interface{})error

func (LogLevel)Valid

func (eLogLevel) Valid()bool

typeLogSource

type LogSourcestring
const (LogSourceProvisionerDaemonLogSource = "provisioner_daemon"LogSourceProvisionerLogSource = "provisioner")

funcAllLogSourceValues

func AllLogSourceValues() []LogSource

func (*LogSource)Scan

func (e *LogSource) Scan(src interface{})error

func (LogSource)Valid

func (eLogSource) Valid()bool

typeLoginType

type LoginTypestring

Specifies the method of authentication. "none" is a special case in which no authentication method is allowed.

const (LoginTypePasswordLoginType = "password"LoginTypeGithubLoginType = "github"LoginTypeOIDCLoginType = "oidc"LoginTypeTokenLoginType = "token"LoginTypeNoneLoginType = "none"LoginTypeOAuth2ProviderAppLoginType = "oauth2_provider_app")

funcAllLoginTypeValues

func AllLoginTypeValues() []LoginType

func (*LoginType)Scan

func (e *LoginType) Scan(src interface{})error

func (LoginType)Valid

func (eLoginType) Valid()bool

typeMarkAllInboxNotificationsAsReadParamsadded inv2.21.0

type MarkAllInboxNotificationsAsReadParams struct {ReadAtsql.NullTime `db:"read_at" json:"read_at"`UserIDuuid.UUID    `db:"user_id" json:"user_id"`}

typeNameOrganizationPairadded inv2.13.0

type NameOrganizationPair struct {Namestring `db:"name" json:"name"`// OrganizationID if unset will assume a null column valueOrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`}

NameOrganizationPair is used as a lookup tuple for custom role rows.

func (*NameOrganizationPair)Scanadded inv2.13.0

func (*NameOrganizationPair) Scan(_ interface{})error

func (NameOrganizationPair)Valueadded inv2.13.0

Value returns the tuple **literal**To get the literal value to return, you can use the expression syntax in a psqlshell.

SELECT ('customrole'::text,'ece79dac-926e-44ca-9790-2ff7c5eb6e0c'::uuid);To see 'null' option. Using the nil uuid as null to avoid empty string literals for null.SELECT ('customrole',00000000-0000-0000-0000-000000000000);

This value is usually used as an array, NameOrganizationPair[]. You can seewhat that literal is as well, with proper quoting.

SELECT ARRAY[('customrole'::text,'ece79dac-926e-44ca-9790-2ff7c5eb6e0c'::uuid)];

typeNotificationMessageadded inv2.13.0

type NotificationMessage struct {IDuuid.UUID                 `db:"id" json:"id"`NotificationTemplateIDuuid.UUID                 `db:"notification_template_id" json:"notification_template_id"`UserIDuuid.UUID                 `db:"user_id" json:"user_id"`MethodNotificationMethod        `db:"method" json:"method"`StatusNotificationMessageStatus `db:"status" json:"status"`StatusReasonsql.NullString            `db:"status_reason" json:"status_reason"`CreatedBystring                    `db:"created_by" json:"created_by"`Payload                []byte                    `db:"payload" json:"payload"`AttemptCountsql.NullInt32             `db:"attempt_count" json:"attempt_count"`Targets                []uuid.UUID               `db:"targets" json:"targets"`CreatedAttime.Time                 `db:"created_at" json:"created_at"`UpdatedAtsql.NullTime              `db:"updated_at" json:"updated_at"`LeasedUntilsql.NullTime              `db:"leased_until" json:"leased_until"`NextRetryAftersql.NullTime              `db:"next_retry_after" json:"next_retry_after"`QueuedSecondssql.NullFloat64           `db:"queued_seconds" json:"queued_seconds"`// Auto-generated by insert/update trigger, used to prevent duplicate notifications from being enqueued on the same dayDedupeHashsql.NullString `db:"dedupe_hash" json:"dedupe_hash"`}

typeNotificationMessageStatusadded inv2.13.0

type NotificationMessageStatusstring
const (NotificationMessageStatusPendingNotificationMessageStatus = "pending"NotificationMessageStatusLeasedNotificationMessageStatus = "leased"NotificationMessageStatusSentNotificationMessageStatus = "sent"NotificationMessageStatusPermanentFailureNotificationMessageStatus = "permanent_failure"NotificationMessageStatusTemporaryFailureNotificationMessageStatus = "temporary_failure"NotificationMessageStatusUnknownNotificationMessageStatus = "unknown"NotificationMessageStatusInhibitedNotificationMessageStatus = "inhibited")

funcAllNotificationMessageStatusValuesadded inv2.13.0

func AllNotificationMessageStatusValues() []NotificationMessageStatus

func (*NotificationMessageStatus)Scanadded inv2.13.0

func (e *NotificationMessageStatus) Scan(src interface{})error

func (NotificationMessageStatus)Validadded inv2.13.0

typeNotificationMethodadded inv2.13.0

type NotificationMethodstring
const (NotificationMethodSmtpNotificationMethod = "smtp"NotificationMethodWebhookNotificationMethod = "webhook"NotificationMethodInboxNotificationMethod = "inbox")

funcAllNotificationMethodValuesadded inv2.13.0

func AllNotificationMethodValues() []NotificationMethod

func (*NotificationMethod)Scanadded inv2.13.0

func (e *NotificationMethod) Scan(src interface{})error

func (NotificationMethod)Validadded inv2.13.0

func (eNotificationMethod) Valid()bool

typeNotificationPreferenceadded inv2.15.0

type NotificationPreference struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`NotificationTemplateIDuuid.UUID `db:"notification_template_id" json:"notification_template_id"`Disabledbool      `db:"disabled" json:"disabled"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`}

typeNotificationReportGeneratorLogadded inv2.16.0

type NotificationReportGeneratorLog struct {NotificationTemplateIDuuid.UUID `db:"notification_template_id" json:"notification_template_id"`LastGeneratedAttime.Time `db:"last_generated_at" json:"last_generated_at"`}

Log of generated reports for users.

typeNotificationTemplateadded inv2.13.0

type NotificationTemplate struct {IDuuid.UUID      `db:"id" json:"id"`Namestring         `db:"name" json:"name"`TitleTemplatestring         `db:"title_template" json:"title_template"`BodyTemplatestring         `db:"body_template" json:"body_template"`Actions       []byte         `db:"actions" json:"actions"`Groupsql.NullString `db:"group" json:"group"`// NULL defers to the deployment-level methodMethodNullNotificationMethod   `db:"method" json:"method"`KindNotificationTemplateKind `db:"kind" json:"kind"`EnabledByDefaultbool                     `db:"enabled_by_default" json:"enabled_by_default"`}

Templates from which to create notification messages.

typeNotificationTemplateKindadded inv2.15.0

type NotificationTemplateKindstring
const (NotificationTemplateKindSystemNotificationTemplateKind = "system")

funcAllNotificationTemplateKindValuesadded inv2.15.0

func AllNotificationTemplateKindValues() []NotificationTemplateKind

func (*NotificationTemplateKind)Scanadded inv2.15.0

func (e *NotificationTemplateKind) Scan(src interface{})error

func (NotificationTemplateKind)Validadded inv2.15.0

typeNotificationsSettingsadded inv2.14.0

type NotificationsSettings struct {IDuuid.UUID `db:"id" json:"id"`NotifierPausedbool      `db:"notifier_paused" json:"notifier_paused"`}

typeNullAPIKeyScope

type NullAPIKeyScope struct {APIKeyScopeAPIKeyScope `json:"api_key_scope"`Validbool        `json:"valid"`// Valid is true if APIKeyScope is not NULL}

func (*NullAPIKeyScope)Scan

func (ns *NullAPIKeyScope) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullAPIKeyScope)Value

func (nsNullAPIKeyScope) Value() (driver.Value,error)

Value implements the driver Valuer interface.

typeNullAgentKeyScopeEnumadded inv2.22.0

type NullAgentKeyScopeEnum struct {AgentKeyScopeEnumAgentKeyScopeEnum `json:"agent_key_scope_enum"`Validbool              `json:"valid"`// Valid is true if AgentKeyScopeEnum is not NULL}

func (*NullAgentKeyScopeEnum)Scanadded inv2.22.0

func (ns *NullAgentKeyScopeEnum) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullAgentKeyScopeEnum)Valueadded inv2.22.0

Value implements the driver Valuer interface.

typeNullAppSharingLevel

type NullAppSharingLevel struct {AppSharingLevelAppSharingLevel `json:"app_sharing_level"`Validbool            `json:"valid"`// Valid is true if AppSharingLevel is not NULL}

func (*NullAppSharingLevel)Scan

func (ns *NullAppSharingLevel) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullAppSharingLevel)Value

Value implements the driver Valuer interface.

typeNullAuditAction

type NullAuditAction struct {AuditActionAuditAction `json:"audit_action"`Validbool        `json:"valid"`// Valid is true if AuditAction is not NULL}

func (*NullAuditAction)Scan

func (ns *NullAuditAction) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullAuditAction)Value

func (nsNullAuditAction) Value() (driver.Value,error)

Value implements the driver Valuer interface.

typeNullAutomaticUpdatesadded inv2.3.0

type NullAutomaticUpdates struct {AutomaticUpdatesAutomaticUpdates `json:"automatic_updates"`Validbool             `json:"valid"`// Valid is true if AutomaticUpdates is not NULL}

func (*NullAutomaticUpdates)Scanadded inv2.3.0

func (ns *NullAutomaticUpdates) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullAutomaticUpdates)Valueadded inv2.3.0

Value implements the driver Valuer interface.

typeNullBuildReason

type NullBuildReason struct {BuildReasonBuildReason `json:"build_reason"`Validbool        `json:"valid"`// Valid is true if BuildReason is not NULL}

func (*NullBuildReason)Scan

func (ns *NullBuildReason) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullBuildReason)Value

func (nsNullBuildReason) Value() (driver.Value,error)

Value implements the driver Valuer interface.

typeNullCryptoKeyFeatureadded inv2.16.0

type NullCryptoKeyFeature struct {CryptoKeyFeatureCryptoKeyFeature `json:"crypto_key_feature"`Validbool             `json:"valid"`// Valid is true if CryptoKeyFeature is not NULL}

func (*NullCryptoKeyFeature)Scanadded inv2.16.0

func (ns *NullCryptoKeyFeature) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullCryptoKeyFeature)Valueadded inv2.16.0

Value implements the driver Valuer interface.

typeNullDisplayAppadded inv2.1.5

type NullDisplayApp struct {DisplayAppDisplayApp `json:"display_app"`Validbool       `json:"valid"`// Valid is true if DisplayApp is not NULL}

func (*NullDisplayApp)Scanadded inv2.1.5

func (ns *NullDisplayApp) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullDisplayApp)Valueadded inv2.1.5

func (nsNullDisplayApp) Value() (driver.Value,error)

Value implements the driver Valuer interface.

typeNullGroupSource

type NullGroupSource struct {GroupSourceGroupSource `json:"group_source"`Validbool        `json:"valid"`// Valid is true if GroupSource is not NULL}

func (*NullGroupSource)Scan

func (ns *NullGroupSource) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullGroupSource)Value

func (nsNullGroupSource) Value() (driver.Value,error)

Value implements the driver Valuer interface.

typeNullInboxNotificationReadStatusadded inv2.21.0

type NullInboxNotificationReadStatus struct {InboxNotificationReadStatusInboxNotificationReadStatus `json:"inbox_notification_read_status"`Validbool                        `json:"valid"`// Valid is true if InboxNotificationReadStatus is not NULL}

func (*NullInboxNotificationReadStatus)Scanadded inv2.21.0

func (ns *NullInboxNotificationReadStatus) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullInboxNotificationReadStatus)Valueadded inv2.21.0

Value implements the driver Valuer interface.

typeNullLogLevel

type NullLogLevel struct {LogLevelLogLevel `json:"log_level"`Validbool     `json:"valid"`// Valid is true if LogLevel is not NULL}

func (*NullLogLevel)Scan

func (ns *NullLogLevel) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullLogLevel)Value

func (nsNullLogLevel) Value() (driver.Value,error)

Value implements the driver Valuer interface.

typeNullLogSource

type NullLogSource struct {LogSourceLogSource `json:"log_source"`Validbool      `json:"valid"`// Valid is true if LogSource is not NULL}

func (*NullLogSource)Scan

func (ns *NullLogSource) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullLogSource)Value

func (nsNullLogSource) Value() (driver.Value,error)

Value implements the driver Valuer interface.

typeNullLoginType

type NullLoginType struct {LoginTypeLoginType `json:"login_type"`Validbool      `json:"valid"`// Valid is true if LoginType is not NULL}

func (*NullLoginType)Scan

func (ns *NullLoginType) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullLoginType)Value

func (nsNullLoginType) Value() (driver.Value,error)

Value implements the driver Valuer interface.

typeNullNotificationMessageStatusadded inv2.13.0

type NullNotificationMessageStatus struct {NotificationMessageStatusNotificationMessageStatus `json:"notification_message_status"`Validbool                      `json:"valid"`// Valid is true if NotificationMessageStatus is not NULL}

func (*NullNotificationMessageStatus)Scanadded inv2.13.0

func (ns *NullNotificationMessageStatus) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullNotificationMessageStatus)Valueadded inv2.13.0

Value implements the driver Valuer interface.

typeNullNotificationMethodadded inv2.13.0

type NullNotificationMethod struct {NotificationMethodNotificationMethod `json:"notification_method"`Validbool               `json:"valid"`// Valid is true if NotificationMethod is not NULL}

func (*NullNotificationMethod)Scanadded inv2.13.0

func (ns *NullNotificationMethod) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullNotificationMethod)Valueadded inv2.13.0

Value implements the driver Valuer interface.

typeNullNotificationTemplateKindadded inv2.15.0

type NullNotificationTemplateKind struct {NotificationTemplateKindNotificationTemplateKind `json:"notification_template_kind"`Validbool                     `json:"valid"`// Valid is true if NotificationTemplateKind is not NULL}

func (*NullNotificationTemplateKind)Scanadded inv2.15.0

func (ns *NullNotificationTemplateKind) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullNotificationTemplateKind)Valueadded inv2.15.0

Value implements the driver Valuer interface.

typeNullParameterDestinationScheme

type NullParameterDestinationScheme struct {ParameterDestinationSchemeParameterDestinationScheme `json:"parameter_destination_scheme"`Validbool                       `json:"valid"`// Valid is true if ParameterDestinationScheme is not NULL}

func (*NullParameterDestinationScheme)Scan

func (ns *NullParameterDestinationScheme) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullParameterDestinationScheme)Value

Value implements the driver Valuer interface.

typeNullParameterScope

type NullParameterScope struct {ParameterScopeParameterScope `json:"parameter_scope"`Validbool           `json:"valid"`// Valid is true if ParameterScope is not NULL}

func (*NullParameterScope)Scan

func (ns *NullParameterScope) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullParameterScope)Value

Value implements the driver Valuer interface.

typeNullParameterSourceScheme

type NullParameterSourceScheme struct {ParameterSourceSchemeParameterSourceScheme `json:"parameter_source_scheme"`Validbool                  `json:"valid"`// Valid is true if ParameterSourceScheme is not NULL}

func (*NullParameterSourceScheme)Scan

func (ns *NullParameterSourceScheme) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullParameterSourceScheme)Value

Value implements the driver Valuer interface.

typeNullParameterTypeSystem

type NullParameterTypeSystem struct {ParameterTypeSystemParameterTypeSystem `json:"parameter_type_system"`Validbool                `json:"valid"`// Valid is true if ParameterTypeSystem is not NULL}

func (*NullParameterTypeSystem)Scan

func (ns *NullParameterTypeSystem) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullParameterTypeSystem)Value

Value implements the driver Valuer interface.

typeNullPortShareProtocoladded inv2.9.0

type NullPortShareProtocol struct {PortShareProtocolPortShareProtocol `json:"port_share_protocol"`Validbool              `json:"valid"`// Valid is true if PortShareProtocol is not NULL}

func (*NullPortShareProtocol)Scanadded inv2.9.0

func (ns *NullPortShareProtocol) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullPortShareProtocol)Valueadded inv2.9.0

Value implements the driver Valuer interface.

typeNullPrebuildStatusadded inv2.23.0

type NullPrebuildStatus struct {PrebuildStatusPrebuildStatus `json:"prebuild_status"`Validbool           `json:"valid"`// Valid is true if PrebuildStatus is not NULL}

func (*NullPrebuildStatus)Scanadded inv2.23.0

func (ns *NullPrebuildStatus) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullPrebuildStatus)Valueadded inv2.23.0

Value implements the driver Valuer interface.

typeNullProvisionerDaemonStatusadded inv2.19.0

type NullProvisionerDaemonStatus struct {ProvisionerDaemonStatusProvisionerDaemonStatus `json:"provisioner_daemon_status"`Validbool                    `json:"valid"`// Valid is true if ProvisionerDaemonStatus is not NULL}

func (*NullProvisionerDaemonStatus)Scanadded inv2.19.0

func (ns *NullProvisionerDaemonStatus) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullProvisionerDaemonStatus)Valueadded inv2.19.0

Value implements the driver Valuer interface.

typeNullProvisionerJobStatusadded inv2.3.0

type NullProvisionerJobStatus struct {ProvisionerJobStatusProvisionerJobStatus `json:"provisioner_job_status"`Validbool                 `json:"valid"`// Valid is true if ProvisionerJobStatus is not NULL}

func (*NullProvisionerJobStatus)Scanadded inv2.3.0

func (ns *NullProvisionerJobStatus) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullProvisionerJobStatus)Valueadded inv2.3.0

Value implements the driver Valuer interface.

typeNullProvisionerJobTimingStageadded inv2.15.0

type NullProvisionerJobTimingStage struct {ProvisionerJobTimingStageProvisionerJobTimingStage `json:"provisioner_job_timing_stage"`Validbool                      `json:"valid"`// Valid is true if ProvisionerJobTimingStage is not NULL}

func (*NullProvisionerJobTimingStage)Scanadded inv2.15.0

func (ns *NullProvisionerJobTimingStage) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullProvisionerJobTimingStage)Valueadded inv2.15.0

Value implements the driver Valuer interface.

typeNullProvisionerJobType

type NullProvisionerJobType struct {ProvisionerJobTypeProvisionerJobType `json:"provisioner_job_type"`Validbool               `json:"valid"`// Valid is true if ProvisionerJobType is not NULL}

func (*NullProvisionerJobType)Scan

func (ns *NullProvisionerJobType) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullProvisionerJobType)Value

Value implements the driver Valuer interface.

typeNullProvisionerStorageMethod

type NullProvisionerStorageMethod struct {ProvisionerStorageMethodProvisionerStorageMethod `json:"provisioner_storage_method"`Validbool                     `json:"valid"`// Valid is true if ProvisionerStorageMethod is not NULL}

func (*NullProvisionerStorageMethod)Scan

func (ns *NullProvisionerStorageMethod) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullProvisionerStorageMethod)Value

Value implements the driver Valuer interface.

typeNullProvisionerType

type NullProvisionerType struct {ProvisionerTypeProvisionerType `json:"provisioner_type"`Validbool            `json:"valid"`// Valid is true if ProvisionerType is not NULL}

func (*NullProvisionerType)Scan

func (ns *NullProvisionerType) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullProvisionerType)Value

Value implements the driver Valuer interface.

typeNullResourceType

type NullResourceType struct {ResourceTypeResourceType `json:"resource_type"`Validbool         `json:"valid"`// Valid is true if ResourceType is not NULL}

func (*NullResourceType)Scan

func (ns *NullResourceType) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullResourceType)Value

func (nsNullResourceType) Value() (driver.Value,error)

Value implements the driver Valuer interface.

typeNullStartupScriptBehavior

type NullStartupScriptBehavior struct {StartupScriptBehaviorStartupScriptBehavior `json:"startup_script_behavior"`Validbool                  `json:"valid"`// Valid is true if StartupScriptBehavior is not NULL}

func (*NullStartupScriptBehavior)Scan

func (ns *NullStartupScriptBehavior) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullStartupScriptBehavior)Value

Value implements the driver Valuer interface.

typeNullTailnetStatusadded inv2.4.0

type NullTailnetStatus struct {TailnetStatusTailnetStatus `json:"tailnet_status"`Validbool          `json:"valid"`// Valid is true if TailnetStatus is not NULL}

func (*NullTailnetStatus)Scanadded inv2.4.0

func (ns *NullTailnetStatus) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullTailnetStatus)Valueadded inv2.4.0

func (nsNullTailnetStatus) Value() (driver.Value,error)

Value implements the driver Valuer interface.

typeNullUserStatus

type NullUserStatus struct {UserStatusUserStatus `json:"user_status"`Validbool       `json:"valid"`// Valid is true if UserStatus is not NULL}

func (*NullUserStatus)Scan

func (ns *NullUserStatus) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullUserStatus)Value

func (nsNullUserStatus) Value() (driver.Value,error)

Value implements the driver Valuer interface.

typeNullWorkspaceAgentLifecycleState

type NullWorkspaceAgentLifecycleState struct {WorkspaceAgentLifecycleStateWorkspaceAgentLifecycleState `json:"workspace_agent_lifecycle_state"`Validbool                         `json:"valid"`// Valid is true if WorkspaceAgentLifecycleState is not NULL}

func (*NullWorkspaceAgentLifecycleState)Scan

func (ns *NullWorkspaceAgentLifecycleState) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullWorkspaceAgentLifecycleState)Value

Value implements the driver Valuer interface.

typeNullWorkspaceAgentMonitorStateadded inv2.20.0

type NullWorkspaceAgentMonitorState struct {WorkspaceAgentMonitorStateWorkspaceAgentMonitorState `json:"workspace_agent_monitor_state"`Validbool                       `json:"valid"`// Valid is true if WorkspaceAgentMonitorState is not NULL}

func (*NullWorkspaceAgentMonitorState)Scanadded inv2.20.0

func (ns *NullWorkspaceAgentMonitorState) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullWorkspaceAgentMonitorState)Valueadded inv2.20.0

Value implements the driver Valuer interface.

typeNullWorkspaceAgentScriptTimingStageadded inv2.16.0

type NullWorkspaceAgentScriptTimingStage struct {WorkspaceAgentScriptTimingStageWorkspaceAgentScriptTimingStage `json:"workspace_agent_script_timing_stage"`Validbool                            `json:"valid"`// Valid is true if WorkspaceAgentScriptTimingStage is not NULL}

func (*NullWorkspaceAgentScriptTimingStage)Scanadded inv2.16.0

func (ns *NullWorkspaceAgentScriptTimingStage) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullWorkspaceAgentScriptTimingStage)Valueadded inv2.16.0

Value implements the driver Valuer interface.

typeNullWorkspaceAgentScriptTimingStatusadded inv2.16.0

type NullWorkspaceAgentScriptTimingStatus struct {WorkspaceAgentScriptTimingStatusWorkspaceAgentScriptTimingStatus `json:"workspace_agent_script_timing_status"`Validbool                             `json:"valid"`// Valid is true if WorkspaceAgentScriptTimingStatus is not NULL}

func (*NullWorkspaceAgentScriptTimingStatus)Scanadded inv2.16.0

func (ns *NullWorkspaceAgentScriptTimingStatus) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullWorkspaceAgentScriptTimingStatus)Valueadded inv2.16.0

Value implements the driver Valuer interface.

typeNullWorkspaceAgentSubsystem

type NullWorkspaceAgentSubsystem struct {WorkspaceAgentSubsystemWorkspaceAgentSubsystem `json:"workspace_agent_subsystem"`Validbool                    `json:"valid"`// Valid is true if WorkspaceAgentSubsystem is not NULL}

func (*NullWorkspaceAgentSubsystem)Scan

func (ns *NullWorkspaceAgentSubsystem) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullWorkspaceAgentSubsystem)Value

Value implements the driver Valuer interface.

typeNullWorkspaceAppHealth

type NullWorkspaceAppHealth struct {WorkspaceAppHealthWorkspaceAppHealth `json:"workspace_app_health"`Validbool               `json:"valid"`// Valid is true if WorkspaceAppHealth is not NULL}

func (*NullWorkspaceAppHealth)Scan

func (ns *NullWorkspaceAppHealth) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullWorkspaceAppHealth)Value

Value implements the driver Valuer interface.

typeNullWorkspaceAppOpenInadded inv2.19.0

type NullWorkspaceAppOpenIn struct {WorkspaceAppOpenInWorkspaceAppOpenIn `json:"workspace_app_open_in"`Validbool               `json:"valid"`// Valid is true if WorkspaceAppOpenIn is not NULL}

func (*NullWorkspaceAppOpenIn)Scanadded inv2.19.0

func (ns *NullWorkspaceAppOpenIn) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullWorkspaceAppOpenIn)Valueadded inv2.19.0

Value implements the driver Valuer interface.

typeNullWorkspaceAppStatusStateadded inv2.21.0

type NullWorkspaceAppStatusState struct {WorkspaceAppStatusStateWorkspaceAppStatusState `json:"workspace_app_status_state"`Validbool                    `json:"valid"`// Valid is true if WorkspaceAppStatusState is not NULL}

func (*NullWorkspaceAppStatusState)Scanadded inv2.21.0

func (ns *NullWorkspaceAppStatusState) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullWorkspaceAppStatusState)Valueadded inv2.21.0

Value implements the driver Valuer interface.

typeNullWorkspaceTransition

type NullWorkspaceTransition struct {WorkspaceTransitionWorkspaceTransition `json:"workspace_transition"`Validbool                `json:"valid"`// Valid is true if WorkspaceTransition is not NULL}

func (*NullWorkspaceTransition)Scan

func (ns *NullWorkspaceTransition) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullWorkspaceTransition)Value

Value implements the driver Valuer interface.

typeOAuth2ProviderAppadded inv2.6.0

type OAuth2ProviderApp struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`Namestring    `db:"name" json:"name"`Iconstring    `db:"icon" json:"icon"`CallbackURLstring    `db:"callback_url" json:"callback_url"`}

A table used to configure apps that can use Coder as an OAuth2 provider, the reverse of what we are calling external authentication.

func (OAuth2ProviderApp)RBACObjectadded inv2.9.0

func (OAuth2ProviderApp) RBACObject()rbac.Object

typeOAuth2ProviderAppCodeadded inv2.9.0

type OAuth2ProviderAppCode struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`ExpiresAttime.Time `db:"expires_at" json:"expires_at"`SecretPrefix []byte    `db:"secret_prefix" json:"secret_prefix"`HashedSecret []byte    `db:"hashed_secret" json:"hashed_secret"`UserIDuuid.UUID `db:"user_id" json:"user_id"`AppIDuuid.UUID `db:"app_id" json:"app_id"`}

Codes are meant to be exchanged for access tokens.

func (OAuth2ProviderAppCode)RBACObjectadded inv2.9.0

func (cOAuth2ProviderAppCode) RBACObject()rbac.Object

typeOAuth2ProviderAppSecretadded inv2.6.0

type OAuth2ProviderAppSecret struct {IDuuid.UUID    `db:"id" json:"id"`CreatedAttime.Time    `db:"created_at" json:"created_at"`LastUsedAtsql.NullTime `db:"last_used_at" json:"last_used_at"`HashedSecret []byte       `db:"hashed_secret" json:"hashed_secret"`// The tail end of the original secret so secrets can be differentiated.DisplaySecretstring    `db:"display_secret" json:"display_secret"`AppIDuuid.UUID `db:"app_id" json:"app_id"`SecretPrefix  []byte    `db:"secret_prefix" json:"secret_prefix"`}

func (OAuth2ProviderAppSecret)RBACObjectadded inv2.9.0

typeOAuth2ProviderAppTokenadded inv2.9.0

type OAuth2ProviderAppToken struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`ExpiresAttime.Time `db:"expires_at" json:"expires_at"`HashPrefix []byte    `db:"hash_prefix" json:"hash_prefix"`// Refresh tokens provide a way to refresh an access token (API key). An expired API key can be refreshed if this token is not yet expired, meaning this expiry can outlive an API key.RefreshHash []byte    `db:"refresh_hash" json:"refresh_hash"`AppSecretIDuuid.UUID `db:"app_secret_id" json:"app_secret_id"`APIKeyIDstring    `db:"api_key_id" json:"api_key_id"`}

typeOIDCClaimFieldValuesParamsadded inv2.18.0

type OIDCClaimFieldValuesParams struct {ClaimFieldstring    `db:"claim_field" json:"claim_field"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`}

typeOrganization

type Organization struct {IDuuid.UUID `db:"id" json:"id"`Namestring    `db:"name" json:"name"`Descriptionstring    `db:"description" json:"description"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`IsDefaultbool      `db:"is_default" json:"is_default"`DisplayNamestring    `db:"display_name" json:"display_name"`Iconstring    `db:"icon" json:"icon"`Deletedbool      `db:"deleted" json:"deleted"`}

func (Organization)RBACObject

func (oOrganization) RBACObject()rbac.Object

typeOrganizationMember

type OrganizationMember struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`Roles          []string  `db:"roles" json:"roles"`}

func (OrganizationMember)Auditableadded inv2.13.0

func (OrganizationMember)RBACObject

func (mOrganizationMember) RBACObject()rbac.Object

typeOrganizationMembersParamsadded inv2.13.0

type OrganizationMembersParams struct {OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`IncludeSystembool      `db:"include_system" json:"include_system"`}

typeOrganizationMembersRowadded inv2.13.0

type OrganizationMembersRow struct {OrganizationMemberOrganizationMember `db:"organization_member" json:"organization_member"`Usernamestring             `db:"username" json:"username"`AvatarURLstring             `db:"avatar_url" json:"avatar_url"`Namestring             `db:"name" json:"name"`Emailstring             `db:"email" json:"email"`GlobalRolespq.StringArray     `db:"global_roles" json:"global_roles"`}

func (OrganizationMembersRow)RBACObjectadded inv2.13.0

func (mOrganizationMembersRow) RBACObject()rbac.Object

typePGLockadded inv2.17.0

type PGLock struct {// LockType see:https://www.postgresql.org/docs/current/monitoring-stats.html#WAIT-EVENT-LOCK-TABLELockType           *string    `db:"locktype"`Database           *string    `db:"database"`// oidRelation           *string    `db:"relation"`// oidRelationName       *string    `db:"relation_name"`Page               *int       `db:"page"`Tuple              *int       `db:"tuple"`VirtualXID         *string    `db:"virtualxid"`TransactionID      *string    `db:"transactionid"`// xidClassID            *string    `db:"classid"`// oidObjID              *string    `db:"objid"`// oidObjSubID           *int       `db:"objsubid"`VirtualTransaction *string    `db:"virtualtransaction"`PIDint        `db:"pid"`Mode               *string    `db:"mode"`Grantedbool       `db:"granted"`FastPath           *bool      `db:"fastpath"`WaitStart          *time.Time `db:"waitstart"`}

PGLock docs see:https://www.postgresql.org/docs/current/view-pg-locks.html#VIEW-PG-LOCKS

func (PGLock)Equaladded inv2.17.0

func (lPGLock) Equal(bPGLock)bool

func (PGLock)Stringadded inv2.17.0

func (lPGLock) String()string

typePGLocksadded inv2.17.0

type PGLocks []PGLock

func (PGLocks)Differenceadded inv2.17.0

func (lPGLocks) Difference(toPGLocks) (newValPGLocks, removedPGLocks)

Difference returns the difference between two sets of locks.This is helpful to determine what changed between the two sets.

func (PGLocks)Stringadded inv2.17.0

func (lPGLocks) String()string

typePaginatedOrganizationMembersParamsadded inv2.21.0

type PaginatedOrganizationMembersParams struct {OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`OffsetOptint32     `db:"offset_opt" json:"offset_opt"`LimitOptint32     `db:"limit_opt" json:"limit_opt"`}

typePaginatedOrganizationMembersRowadded inv2.21.0

type PaginatedOrganizationMembersRow struct {OrganizationMemberOrganizationMember `db:"organization_member" json:"organization_member"`Usernamestring             `db:"username" json:"username"`AvatarURLstring             `db:"avatar_url" json:"avatar_url"`Namestring             `db:"name" json:"name"`Emailstring             `db:"email" json:"email"`GlobalRolespq.StringArray     `db:"global_roles" json:"global_roles"`Countint64              `db:"count" json:"count"`}

func (PaginatedOrganizationMembersRow)RBACObjectadded inv2.21.0

typeParameterDestinationScheme

type ParameterDestinationSchemestring
const (ParameterDestinationSchemeNoneParameterDestinationScheme = "none"ParameterDestinationSchemeEnvironmentVariableParameterDestinationScheme = "environment_variable"ParameterDestinationSchemeProvisionerVariableParameterDestinationScheme = "provisioner_variable")

funcAllParameterDestinationSchemeValues

func AllParameterDestinationSchemeValues() []ParameterDestinationScheme

func (*ParameterDestinationScheme)Scan

func (e *ParameterDestinationScheme) Scan(src interface{})error

func (ParameterDestinationScheme)Valid

typeParameterSchema

type ParameterSchema struct {IDuuid.UUID                  `db:"id" json:"id"`CreatedAttime.Time                  `db:"created_at" json:"created_at"`JobIDuuid.UUID                  `db:"job_id" json:"job_id"`Namestring                     `db:"name" json:"name"`Descriptionstring                     `db:"description" json:"description"`DefaultSourceSchemeParameterSourceScheme      `db:"default_source_scheme" json:"default_source_scheme"`DefaultSourceValuestring                     `db:"default_source_value" json:"default_source_value"`AllowOverrideSourcebool                       `db:"allow_override_source" json:"allow_override_source"`DefaultDestinationSchemeParameterDestinationScheme `db:"default_destination_scheme" json:"default_destination_scheme"`AllowOverrideDestinationbool                       `db:"allow_override_destination" json:"allow_override_destination"`DefaultRefreshstring                     `db:"default_refresh" json:"default_refresh"`RedisplayValuebool                       `db:"redisplay_value" json:"redisplay_value"`ValidationErrorstring                     `db:"validation_error" json:"validation_error"`ValidationConditionstring                     `db:"validation_condition" json:"validation_condition"`ValidationTypeSystemParameterTypeSystem        `db:"validation_type_system" json:"validation_type_system"`ValidationValueTypestring                     `db:"validation_value_type" json:"validation_value_type"`Indexint32                      `db:"index" json:"index"`}

typeParameterScope

type ParameterScopestring
const (ParameterScopeTemplateParameterScope = "template"ParameterScopeImportJobParameterScope = "import_job"ParameterScopeWorkspaceParameterScope = "workspace")

funcAllParameterScopeValues

func AllParameterScopeValues() []ParameterScope

func (*ParameterScope)Scan

func (e *ParameterScope) Scan(src interface{})error

func (ParameterScope)Valid

func (eParameterScope) Valid()bool

typeParameterSourceScheme

type ParameterSourceSchemestring
const (ParameterSourceSchemeNoneParameterSourceScheme = "none"ParameterSourceSchemeDataParameterSourceScheme = "data")

funcAllParameterSourceSchemeValues

func AllParameterSourceSchemeValues() []ParameterSourceScheme

func (*ParameterSourceScheme)Scan

func (e *ParameterSourceScheme) Scan(src interface{})error

func (ParameterSourceScheme)Valid

typeParameterTypeSystem

type ParameterTypeSystemstring
const (ParameterTypeSystemNoneParameterTypeSystem = "none"ParameterTypeSystemHCLParameterTypeSystem = "hcl")

funcAllParameterTypeSystemValues

func AllParameterTypeSystemValues() []ParameterTypeSystem

func (*ParameterTypeSystem)Scan

func (e *ParameterTypeSystem) Scan(src interface{})error

func (ParameterTypeSystem)Valid

func (eParameterTypeSystem) Valid()bool

typeParameterValue

type ParameterValue struct {IDuuid.UUID                  `db:"id" json:"id"`CreatedAttime.Time                  `db:"created_at" json:"created_at"`UpdatedAttime.Time                  `db:"updated_at" json:"updated_at"`ScopeParameterScope             `db:"scope" json:"scope"`ScopeIDuuid.UUID                  `db:"scope_id" json:"scope_id"`Namestring                     `db:"name" json:"name"`SourceSchemeParameterSourceScheme      `db:"source_scheme" json:"source_scheme"`SourceValuestring                     `db:"source_value" json:"source_value"`DestinationSchemeParameterDestinationScheme `db:"destination_scheme" json:"destination_scheme"`}

typePortShareProtocoladded inv2.9.0

type PortShareProtocolstring
const (PortShareProtocolHttpPortShareProtocol = "http"PortShareProtocolHttpsPortShareProtocol = "https")

funcAllPortShareProtocolValuesadded inv2.9.0

func AllPortShareProtocolValues() []PortShareProtocol

func (*PortShareProtocol)Scanadded inv2.9.0

func (e *PortShareProtocol) Scan(src interface{})error

func (PortShareProtocol)Validadded inv2.9.0

func (ePortShareProtocol) Valid()bool

typePrebuildStatusadded inv2.23.0

type PrebuildStatusstring
const (PrebuildStatusHealthyPrebuildStatus = "healthy"PrebuildStatusHardLimitedPrebuildStatus = "hard_limited"PrebuildStatusValidationFailedPrebuildStatus = "validation_failed")

funcAllPrebuildStatusValuesadded inv2.23.0

func AllPrebuildStatusValues() []PrebuildStatus

func (*PrebuildStatus)Scanadded inv2.23.0

func (e *PrebuildStatus) Scan(src interface{})error

func (PrebuildStatus)Validadded inv2.23.0

func (ePrebuildStatus) Valid()bool

typeProvisionerDaemon

type ProvisionerDaemon struct {IDuuid.UUID         `db:"id" json:"id"`CreatedAttime.Time         `db:"created_at" json:"created_at"`Namestring            `db:"name" json:"name"`Provisioners []ProvisionerType `db:"provisioners" json:"provisioners"`ReplicaIDuuid.NullUUID     `db:"replica_id" json:"replica_id"`TagsStringMap         `db:"tags" json:"tags"`LastSeenAtsql.NullTime      `db:"last_seen_at" json:"last_seen_at"`Versionstring            `db:"version" json:"version"`// The API version of the provisioner daemonAPIVersionstring    `db:"api_version" json:"api_version"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`KeyIDuuid.UUID `db:"key_id" json:"key_id"`}

func (ProvisionerDaemon)RBACObject

func (pProvisionerDaemon) RBACObject()rbac.Object

typeProvisionerDaemonStatusadded inv2.19.0

type ProvisionerDaemonStatusstring

The status of a provisioner daemon.

const (ProvisionerDaemonStatusOfflineProvisionerDaemonStatus = "offline"ProvisionerDaemonStatusIdleProvisionerDaemonStatus = "idle"ProvisionerDaemonStatusBusyProvisionerDaemonStatus = "busy")

funcAllProvisionerDaemonStatusValuesadded inv2.19.0

func AllProvisionerDaemonStatusValues() []ProvisionerDaemonStatus

func (*ProvisionerDaemonStatus)Scanadded inv2.19.0

func (e *ProvisionerDaemonStatus) Scan(src interface{})error

func (ProvisionerDaemonStatus)Validadded inv2.19.0

typeProvisionerJob

type ProvisionerJob struct {IDuuid.UUID                `db:"id" json:"id"`CreatedAttime.Time                `db:"created_at" json:"created_at"`UpdatedAttime.Time                `db:"updated_at" json:"updated_at"`StartedAtsql.NullTime             `db:"started_at" json:"started_at"`CanceledAtsql.NullTime             `db:"canceled_at" json:"canceled_at"`CompletedAtsql.NullTime             `db:"completed_at" json:"completed_at"`Errorsql.NullString           `db:"error" json:"error"`OrganizationIDuuid.UUID                `db:"organization_id" json:"organization_id"`InitiatorIDuuid.UUID                `db:"initiator_id" json:"initiator_id"`ProvisionerProvisionerType          `db:"provisioner" json:"provisioner"`StorageMethodProvisionerStorageMethod `db:"storage_method" json:"storage_method"`TypeProvisionerJobType       `db:"type" json:"type"`Inputjson.RawMessage          `db:"input" json:"input"`WorkerIDuuid.NullUUID            `db:"worker_id" json:"worker_id"`FileIDuuid.UUID                `db:"file_id" json:"file_id"`TagsStringMap                `db:"tags" json:"tags"`ErrorCodesql.NullString           `db:"error_code" json:"error_code"`TraceMetadatapqtype.NullRawMessage    `db:"trace_metadata" json:"trace_metadata"`// Computed column to track the status of the job.JobStatusProvisionerJobStatus `db:"job_status" json:"job_status"`}

func (ProvisionerJob)Finishedadded inv2.3.0

func (pProvisionerJob) Finished()bool

func (ProvisionerJob)FinishedAtadded inv2.3.0

func (pProvisionerJob) FinishedAt()time.Time

func (ProvisionerJob)RBACObjectadded inv2.19.0

func (pProvisionerJob) RBACObject()rbac.Object

typeProvisionerJobLog

type ProvisionerJobLog struct {JobIDuuid.UUID `db:"job_id" json:"job_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`SourceLogSource `db:"source" json:"source"`LevelLogLevel  `db:"level" json:"level"`Stagestring    `db:"stage" json:"stage"`Outputstring    `db:"output" json:"output"`IDint64     `db:"id" json:"id"`}

typeProvisionerJobStatadded inv2.15.0

type ProvisionerJobStat struct {JobIDuuid.UUID            `db:"job_id" json:"job_id"`JobStatusProvisionerJobStatus `db:"job_status" json:"job_status"`WorkspaceIDuuid.UUID            `db:"workspace_id" json:"workspace_id"`WorkerIDuuid.NullUUID        `db:"worker_id" json:"worker_id"`Errorsql.NullString       `db:"error" json:"error"`ErrorCodesql.NullString       `db:"error_code" json:"error_code"`UpdatedAttime.Time            `db:"updated_at" json:"updated_at"`QueuedSecsfloat64              `db:"queued_secs" json:"queued_secs"`CompletionSecsfloat64              `db:"completion_secs" json:"completion_secs"`CanceledSecsfloat64              `db:"canceled_secs" json:"canceled_secs"`InitSecsfloat64              `db:"init_secs" json:"init_secs"`PlanSecsfloat64              `db:"plan_secs" json:"plan_secs"`GraphSecsfloat64              `db:"graph_secs" json:"graph_secs"`ApplySecsfloat64              `db:"apply_secs" json:"apply_secs"`}

typeProvisionerJobStatusadded inv2.3.0

type ProvisionerJobStatusstring

Computed status of a provisioner job. Jobs could be stuck in a hung state, these states do not guarantee any transition to another state.

const (ProvisionerJobStatusPendingProvisionerJobStatus = "pending"ProvisionerJobStatusRunningProvisionerJobStatus = "running"ProvisionerJobStatusSucceededProvisionerJobStatus = "succeeded"ProvisionerJobStatusCancelingProvisionerJobStatus = "canceling"ProvisionerJobStatusCanceledProvisionerJobStatus = "canceled"ProvisionerJobStatusFailedProvisionerJobStatus = "failed"ProvisionerJobStatusUnknownProvisionerJobStatus = "unknown")

funcAllProvisionerJobStatusValuesadded inv2.3.0

func AllProvisionerJobStatusValues() []ProvisionerJobStatus

func (*ProvisionerJobStatus)Scanadded inv2.3.0

func (e *ProvisionerJobStatus) Scan(src interface{})error

func (ProvisionerJobStatus)Validadded inv2.3.0

func (eProvisionerJobStatus) Valid()bool

typeProvisionerJobTimingadded inv2.15.0

type ProvisionerJobTiming struct {JobIDuuid.UUID                 `db:"job_id" json:"job_id"`StartedAttime.Time                 `db:"started_at" json:"started_at"`EndedAttime.Time                 `db:"ended_at" json:"ended_at"`StageProvisionerJobTimingStage `db:"stage" json:"stage"`Sourcestring                    `db:"source" json:"source"`Actionstring                    `db:"action" json:"action"`Resourcestring                    `db:"resource" json:"resource"`}

typeProvisionerJobTimingStageadded inv2.15.0

type ProvisionerJobTimingStagestring
const (ProvisionerJobTimingStageInitProvisionerJobTimingStage = "init"ProvisionerJobTimingStagePlanProvisionerJobTimingStage = "plan"ProvisionerJobTimingStageGraphProvisionerJobTimingStage = "graph"ProvisionerJobTimingStageApplyProvisionerJobTimingStage = "apply")

funcAllProvisionerJobTimingStageValuesadded inv2.15.0

func AllProvisionerJobTimingStageValues() []ProvisionerJobTimingStage

func (*ProvisionerJobTimingStage)Scanadded inv2.15.0

func (e *ProvisionerJobTimingStage) Scan(src interface{})error

func (ProvisionerJobTimingStage)Validadded inv2.15.0

typeProvisionerJobType

type ProvisionerJobTypestring
const (ProvisionerJobTypeTemplateVersionImportProvisionerJobType = "template_version_import"ProvisionerJobTypeWorkspaceBuildProvisionerJobType = "workspace_build"ProvisionerJobTypeTemplateVersionDryRunProvisionerJobType = "template_version_dry_run")

funcAllProvisionerJobTypeValues

func AllProvisionerJobTypeValues() []ProvisionerJobType

func (*ProvisionerJobType)Scan

func (e *ProvisionerJobType) Scan(src interface{})error

func (ProvisionerJobType)Valid

func (eProvisionerJobType) Valid()bool

typeProvisionerKeyadded inv2.14.0

type ProvisionerKey struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`Namestring    `db:"name" json:"name"`HashedSecret   []byte    `db:"hashed_secret" json:"hashed_secret"`TagsStringMap `db:"tags" json:"tags"`}

func (ProvisionerKey)RBACObjectadded inv2.14.0

func (pProvisionerKey) RBACObject()rbac.Object

RBACObject for a provisioner key is the same as a provisioner daemon.Keys == provisioners from a RBAC perspective.

typeProvisionerStorageMethod

type ProvisionerStorageMethodstring
const (ProvisionerStorageMethodFileProvisionerStorageMethod = "file")

funcAllProvisionerStorageMethodValues

func AllProvisionerStorageMethodValues() []ProvisionerStorageMethod

func (*ProvisionerStorageMethod)Scan

func (e *ProvisionerStorageMethod) Scan(src interface{})error

func (ProvisionerStorageMethod)Valid

typeProvisionerType

type ProvisionerTypestring
const (ProvisionerTypeEchoProvisionerType = "echo"ProvisionerTypeTerraformProvisionerType = "terraform")

funcAllProvisionerTypeValues

func AllProvisionerTypeValues() []ProvisionerType

func (*ProvisionerType)Scan

func (e *ProvisionerType) Scan(src interface{})error

func (ProvisionerType)Valid

func (eProvisionerType) Valid()bool

typeRegisterWorkspaceProxyParams

type RegisterWorkspaceProxyParams struct {Urlstring    `db:"url" json:"url"`WildcardHostnamestring    `db:"wildcard_hostname" json:"wildcard_hostname"`DerpEnabledbool      `db:"derp_enabled" json:"derp_enabled"`DerpOnlybool      `db:"derp_only" json:"derp_only"`Versionstring    `db:"version" json:"version"`IDuuid.UUID `db:"id" json:"id"`}

typeRemoveUserFromGroupsParamsadded inv2.16.0

type RemoveUserFromGroupsParams struct {UserIDuuid.UUID   `db:"user_id" json:"user_id"`GroupIds []uuid.UUID `db:"group_ids" json:"group_ids"`}

typeReplica

type Replica struct {IDuuid.UUID    `db:"id" json:"id"`CreatedAttime.Time    `db:"created_at" json:"created_at"`StartedAttime.Time    `db:"started_at" json:"started_at"`StoppedAtsql.NullTime `db:"stopped_at" json:"stopped_at"`UpdatedAttime.Time    `db:"updated_at" json:"updated_at"`Hostnamestring       `db:"hostname" json:"hostname"`RegionIDint32        `db:"region_id" json:"region_id"`RelayAddressstring       `db:"relay_address" json:"relay_address"`DatabaseLatencyint32        `db:"database_latency" json:"database_latency"`Versionstring       `db:"version" json:"version"`Errorstring       `db:"error" json:"error"`Primarybool         `db:"primary" json:"primary"`}

typeResourceType

type ResourceTypestring
const (ResourceTypeOrganizationResourceType = "organization"ResourceTypeTemplateResourceType = "template"ResourceTypeTemplateVersionResourceType = "template_version"ResourceTypeUserResourceType = "user"ResourceTypeWorkspaceResourceType = "workspace"ResourceTypeGitSshKeyResourceType = "git_ssh_key"ResourceTypeApiKeyResourceType = "api_key"ResourceTypeGroupResourceType = "group"ResourceTypeWorkspaceBuildResourceType = "workspace_build"ResourceTypeLicenseResourceType = "license"ResourceTypeWorkspaceProxyResourceType = "workspace_proxy"ResourceTypeConvertLoginResourceType = "convert_login"ResourceTypeHealthSettingsResourceType = "health_settings"ResourceTypeOauth2ProviderAppResourceType = "oauth2_provider_app"ResourceTypeOauth2ProviderAppSecretResourceType = "oauth2_provider_app_secret"ResourceTypeCustomRoleResourceType = "custom_role"ResourceTypeOrganizationMemberResourceType = "organization_member"ResourceTypeNotificationsSettingsResourceType = "notifications_settings"ResourceTypeNotificationTemplateResourceType = "notification_template"ResourceTypeIdpSyncSettingsOrganizationResourceType = "idp_sync_settings_organization"ResourceTypeIdpSyncSettingsGroupResourceType = "idp_sync_settings_group"ResourceTypeIdpSyncSettingsRoleResourceType = "idp_sync_settings_role"ResourceTypeWorkspaceAgentResourceType = "workspace_agent"ResourceTypeWorkspaceAppResourceType = "workspace_app")

funcAllResourceTypeValues

func AllResourceTypeValues() []ResourceType

func (*ResourceType)Scan

func (e *ResourceType) Scan(src interface{})error

func (ResourceType)Valid

func (eResourceType) Valid()bool

typeSiteConfig

type SiteConfig struct {Keystring `db:"key" json:"key"`Valuestring `db:"value" json:"value"`}

typeStartupScriptBehavior

type StartupScriptBehaviorstring
const (StartupScriptBehaviorBlockingStartupScriptBehavior = "blocking"StartupScriptBehaviorNonBlockingStartupScriptBehavior = "non-blocking")

funcAllStartupScriptBehaviorValues

func AllStartupScriptBehaviorValues() []StartupScriptBehavior

func (*StartupScriptBehavior)Scan

func (e *StartupScriptBehavior) Scan(src interface{})error

func (StartupScriptBehavior)Valid

typeStore

type Store interface {Ping(ctxcontext.Context) (time.Duration,error)PGLocks(ctxcontext.Context) (PGLocks,error)InTx(func(Store)error, *TxOptions)error// contains filtered or unexported methods}

Store contains all queryable database functions.It extends the generated interface to add transaction support.

funcNew

func New(sdb *sql.DB, opts ...func(*sqlQuerier))Store

New creates a new database store using a SQL database connection.

typeStringMap

type StringMap map[string]string

func (*StringMap)Scan

func (m *StringMap) Scan(src interface{})error

func (StringMap)Value

func (mStringMap) Value() (driver.Value,error)

typeStringMapOfIntadded inv2.10.0

type StringMapOfInt map[string]int64

func (*StringMapOfInt)Scanadded inv2.10.0

func (m *StringMapOfInt) Scan(src interface{})error

func (StringMapOfInt)Valueadded inv2.10.0

func (mStringMapOfInt) Value() (driver.Value,error)

typeTailnetAgent

type TailnetAgent struct {IDuuid.UUID       `db:"id" json:"id"`CoordinatorIDuuid.UUID       `db:"coordinator_id" json:"coordinator_id"`UpdatedAttime.Time       `db:"updated_at" json:"updated_at"`Nodejson.RawMessage `db:"node" json:"node"`}

typeTailnetClient

type TailnetClient struct {IDuuid.UUID       `db:"id" json:"id"`CoordinatorIDuuid.UUID       `db:"coordinator_id" json:"coordinator_id"`UpdatedAttime.Time       `db:"updated_at" json:"updated_at"`Nodejson.RawMessage `db:"node" json:"node"`}

typeTailnetClientSubscriptionadded inv2.2.0

type TailnetClientSubscription struct {ClientIDuuid.UUID `db:"client_id" json:"client_id"`CoordinatorIDuuid.UUID `db:"coordinator_id" json:"coordinator_id"`AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`}

typeTailnetCoordinator

type TailnetCoordinator struct {IDuuid.UUID `db:"id" json:"id"`HeartbeatAttime.Time `db:"heartbeat_at" json:"heartbeat_at"`}

We keep this separate from replicas in case we need to break the coordinator out into its own service

typeTailnetPeeradded inv2.4.0

type TailnetPeer struct {IDuuid.UUID     `db:"id" json:"id"`CoordinatorIDuuid.UUID     `db:"coordinator_id" json:"coordinator_id"`UpdatedAttime.Time     `db:"updated_at" json:"updated_at"`Node          []byte        `db:"node" json:"node"`StatusTailnetStatus `db:"status" json:"status"`}

typeTailnetStatusadded inv2.4.0

type TailnetStatusstring
const (TailnetStatusOkTailnetStatus = "ok"TailnetStatusLostTailnetStatus = "lost")

funcAllTailnetStatusValuesadded inv2.4.0

func AllTailnetStatusValues() []TailnetStatus

func (*TailnetStatus)Scanadded inv2.4.0

func (e *TailnetStatus) Scan(src interface{})error

func (TailnetStatus)Validadded inv2.4.0

func (eTailnetStatus) Valid()bool

typeTailnetTunneladded inv2.4.0

type TailnetTunnel struct {CoordinatorIDuuid.UUID `db:"coordinator_id" json:"coordinator_id"`SrcIDuuid.UUID `db:"src_id" json:"src_id"`DstIDuuid.UUID `db:"dst_id" json:"dst_id"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`}

typeTelemetryItemadded inv2.19.0

type TelemetryItem struct {Keystring    `db:"key" json:"key"`Valuestring    `db:"value" json:"value"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`}

typeTemplate

type Template struct {IDuuid.UUID       `db:"id" json:"id"`CreatedAttime.Time       `db:"created_at" json:"created_at"`UpdatedAttime.Time       `db:"updated_at" json:"updated_at"`OrganizationIDuuid.UUID       `db:"organization_id" json:"organization_id"`Deletedbool            `db:"deleted" json:"deleted"`Namestring          `db:"name" json:"name"`ProvisionerProvisionerType `db:"provisioner" json:"provisioner"`ActiveVersionIDuuid.UUID       `db:"active_version_id" json:"active_version_id"`Descriptionstring          `db:"description" json:"description"`DefaultTTLint64           `db:"default_ttl" json:"default_ttl"`CreatedByuuid.UUID       `db:"created_by" json:"created_by"`Iconstring          `db:"icon" json:"icon"`UserACLTemplateACL     `db:"user_acl" json:"user_acl"`GroupACLTemplateACL     `db:"group_acl" json:"group_acl"`DisplayNamestring          `db:"display_name" json:"display_name"`AllowUserCancelWorkspaceJobsbool            `db:"allow_user_cancel_workspace_jobs" json:"allow_user_cancel_workspace_jobs"`AllowUserAutostartbool            `db:"allow_user_autostart" json:"allow_user_autostart"`AllowUserAutostopbool            `db:"allow_user_autostop" json:"allow_user_autostop"`FailureTTLint64           `db:"failure_ttl" json:"failure_ttl"`TimeTilDormantint64           `db:"time_til_dormant" json:"time_til_dormant"`TimeTilDormantAutoDeleteint64           `db:"time_til_dormant_autodelete" json:"time_til_dormant_autodelete"`AutostopRequirementDaysOfWeekint16           `db:"autostop_requirement_days_of_week" json:"autostop_requirement_days_of_week"`AutostopRequirementWeeksint64           `db:"autostop_requirement_weeks" json:"autostop_requirement_weeks"`AutostartBlockDaysOfWeekint16           `db:"autostart_block_days_of_week" json:"autostart_block_days_of_week"`RequireActiveVersionbool            `db:"require_active_version" json:"require_active_version"`Deprecatedstring          `db:"deprecated" json:"deprecated"`ActivityBumpint64           `db:"activity_bump" json:"activity_bump"`MaxPortSharingLevelAppSharingLevel `db:"max_port_sharing_level" json:"max_port_sharing_level"`UseClassicParameterFlowbool            `db:"use_classic_parameter_flow" json:"use_classic_parameter_flow"`CreatedByAvatarURLstring          `db:"created_by_avatar_url" json:"created_by_avatar_url"`CreatedByUsernamestring          `db:"created_by_username" json:"created_by_username"`CreatedByNamestring          `db:"created_by_name" json:"created_by_name"`OrganizationNamestring          `db:"organization_name" json:"organization_name"`OrganizationDisplayNamestring          `db:"organization_display_name" json:"organization_display_name"`OrganizationIconstring          `db:"organization_icon" json:"organization_icon"`}

Joins in the display name information such as username, avatar, and organization name.

func (Template)AutostartAllowedDaysadded inv2.3.1

func (tTemplate) AutostartAllowedDays()uint8

AutostartAllowedDays returns the inverse of 'AutostartBlockDaysOfWeek'.It is more useful to have the days that are allowed to autostart from a UXPOV. The database prefers the 0 value being 'all days allowed'.

func (Template)DeepCopy

func (tTemplate) DeepCopy()Template

func (Template)RBACObject

func (tTemplate) RBACObject()rbac.Object

typeTemplateACL

type TemplateACL map[string][]policy.Action

TemplateACL is a map of ids to permissions.

func (*TemplateACL)Scan

func (t *TemplateACL) Scan(src interface{})error

func (TemplateACL)Value

func (tTemplateACL) Value() (driver.Value,error)

typeTemplateGroup

type TemplateGroup struct {GroupActionsActions `db:"actions"`}

typeTemplateTable

type TemplateTable struct {IDuuid.UUID       `db:"id" json:"id"`CreatedAttime.Time       `db:"created_at" json:"created_at"`UpdatedAttime.Time       `db:"updated_at" json:"updated_at"`OrganizationIDuuid.UUID       `db:"organization_id" json:"organization_id"`Deletedbool            `db:"deleted" json:"deleted"`Namestring          `db:"name" json:"name"`ProvisionerProvisionerType `db:"provisioner" json:"provisioner"`ActiveVersionIDuuid.UUID       `db:"active_version_id" json:"active_version_id"`Descriptionstring          `db:"description" json:"description"`// The default duration for autostop for workspaces created from this template.DefaultTTLint64       `db:"default_ttl" json:"default_ttl"`CreatedByuuid.UUID   `db:"created_by" json:"created_by"`Iconstring      `db:"icon" json:"icon"`UserACLTemplateACL `db:"user_acl" json:"user_acl"`GroupACLTemplateACL `db:"group_acl" json:"group_acl"`// Display name is a custom, human-friendly template name that user can set.DisplayNamestring `db:"display_name" json:"display_name"`// Allow users to cancel in-progress workspace jobs.AllowUserCancelWorkspaceJobsbool `db:"allow_user_cancel_workspace_jobs" json:"allow_user_cancel_workspace_jobs"`// Allow users to specify an autostart schedule for workspaces (enterprise).AllowUserAutostartbool `db:"allow_user_autostart" json:"allow_user_autostart"`// Allow users to specify custom autostop values for workspaces (enterprise).AllowUserAutostopbool  `db:"allow_user_autostop" json:"allow_user_autostop"`FailureTTLint64 `db:"failure_ttl" json:"failure_ttl"`TimeTilDormantint64 `db:"time_til_dormant" json:"time_til_dormant"`TimeTilDormantAutoDeleteint64 `db:"time_til_dormant_autodelete" json:"time_til_dormant_autodelete"`// A bitmap of days of week to restart the workspace on, starting with Monday as the 0th bit, and Sunday as the 6th bit. The 7th bit is unused.AutostopRequirementDaysOfWeekint16 `db:"autostop_requirement_days_of_week" json:"autostop_requirement_days_of_week"`// The number of weeks between restarts. 0 or 1 weeks means "every week", 2 week means "every second week", etc. Weeks are counted from January 2, 2023, which is the first Monday of 2023. This is to ensure workspaces are started consistently for all customers on the same n-week cycles.AutostopRequirementWeeksint64 `db:"autostop_requirement_weeks" json:"autostop_requirement_weeks"`// A bitmap of days of week that autostart of a workspace is not allowed. Default allows all days. This is intended as a cost savings measure to prevent auto start on weekends (for example).AutostartBlockDaysOfWeekint16 `db:"autostart_block_days_of_week" json:"autostart_block_days_of_week"`RequireActiveVersionbool  `db:"require_active_version" json:"require_active_version"`// If set to a non empty string, the template will no longer be able to be used. The message will be displayed to the user.Deprecatedstring          `db:"deprecated" json:"deprecated"`ActivityBumpint64           `db:"activity_bump" json:"activity_bump"`MaxPortSharingLevelAppSharingLevel `db:"max_port_sharing_level" json:"max_port_sharing_level"`// Determines whether to default to the dynamic parameter creation flow for this template or continue using the legacy classic parameter creation flow.This is a template wide setting, the template admin can revert to the classic flow if there are any issues. An escape hatch is required, as workspace creation is a core workflow and cannot break. This column will be removed when the dynamic parameter creation flow is stable.UseClassicParameterFlowbool `db:"use_classic_parameter_flow" json:"use_classic_parameter_flow"`}

typeTemplateUsageStatadded inv2.10.0

type TemplateUsageStat struct {// Start time of the usage period.StartTimetime.Time `db:"start_time" json:"start_time"`// End time of the usage period.EndTimetime.Time `db:"end_time" json:"end_time"`// ID of the template being used.TemplateIDuuid.UUID `db:"template_id" json:"template_id"`// ID of the user using the template.UserIDuuid.UUID `db:"user_id" json:"user_id"`// Median latency the user is experiencing, in milliseconds. Null means no value was recorded.MedianLatencyMssql.NullFloat64 `db:"median_latency_ms" json:"median_latency_ms"`// Total minutes the user has been using the template.UsageMinsint16 `db:"usage_mins" json:"usage_mins"`// Total minutes the user has been using SSH.SshMinsint16 `db:"ssh_mins" json:"ssh_mins"`// Total minutes the user has been using SFTP.SftpMinsint16 `db:"sftp_mins" json:"sftp_mins"`// Total minutes the user has been using the reconnecting PTY.ReconnectingPtyMinsint16 `db:"reconnecting_pty_mins" json:"reconnecting_pty_mins"`// Total minutes the user has been using VSCode.VscodeMinsint16 `db:"vscode_mins" json:"vscode_mins"`// Total minutes the user has been using JetBrains.JetbrainsMinsint16 `db:"jetbrains_mins" json:"jetbrains_mins"`// Object with app names as keys and total minutes used as values. Null means no app usage was recorded.AppUsageMinsStringMapOfInt `db:"app_usage_mins" json:"app_usage_mins"`}

Records aggregated usage statistics for templates/users. All usage is rounded up to the nearest minute.

typeTemplateUser

type TemplateUser struct {UserActionsActions `db:"actions"`}

typeTemplateVersion

type TemplateVersion struct {IDuuid.UUID       `db:"id" json:"id"`TemplateIDuuid.NullUUID   `db:"template_id" json:"template_id"`OrganizationIDuuid.UUID       `db:"organization_id" json:"organization_id"`CreatedAttime.Time       `db:"created_at" json:"created_at"`UpdatedAttime.Time       `db:"updated_at" json:"updated_at"`Namestring          `db:"name" json:"name"`Readmestring          `db:"readme" json:"readme"`JobIDuuid.UUID       `db:"job_id" json:"job_id"`CreatedByuuid.UUID       `db:"created_by" json:"created_by"`ExternalAuthProvidersjson.RawMessage `db:"external_auth_providers" json:"external_auth_providers"`Messagestring          `db:"message" json:"message"`Archivedbool            `db:"archived" json:"archived"`SourceExampleIDsql.NullString  `db:"source_example_id" json:"source_example_id"`CreatedByAvatarURLstring          `db:"created_by_avatar_url" json:"created_by_avatar_url"`CreatedByUsernamestring          `db:"created_by_username" json:"created_by_username"`CreatedByNamestring          `db:"created_by_name" json:"created_by_name"`}

Joins in the username + avatar url of the created by user.

func (TemplateVersion)RBACObject

func (TemplateVersion) RBACObject(templateTemplate)rbac.Object

func (TemplateVersion)RBACObjectNoTemplate

func (vTemplateVersion) RBACObjectNoTemplate()rbac.Object

RBACObjectNoTemplate is for orphaned template versions.

typeTemplateVersionParameter

type TemplateVersionParameter struct {TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`// Parameter nameNamestring `db:"name" json:"name"`// Parameter descriptionDescriptionstring `db:"description" json:"description"`// Parameter typeTypestring `db:"type" json:"type"`// Is parameter mutable?Mutablebool `db:"mutable" json:"mutable"`// Default valueDefaultValuestring `db:"default_value" json:"default_value"`// IconIconstring `db:"icon" json:"icon"`// Additional optionsOptionsjson.RawMessage `db:"options" json:"options"`// Validation: regex patternValidationRegexstring `db:"validation_regex" json:"validation_regex"`// Validation: minimum length of valueValidationMinsql.NullInt32 `db:"validation_min" json:"validation_min"`// Validation: maximum length of valueValidationMaxsql.NullInt32 `db:"validation_max" json:"validation_max"`// Validation: error displayed when the regex does not match.ValidationErrorstring `db:"validation_error" json:"validation_error"`// Validation: consecutive values preserve the monotonic orderValidationMonotonicstring `db:"validation_monotonic" json:"validation_monotonic"`// Is parameter required?Requiredbool `db:"required" json:"required"`// Display name of the rich parameterDisplayNamestring `db:"display_name" json:"display_name"`// Specifies the order in which to display parameters in user interfaces.DisplayOrderint32 `db:"display_order" json:"display_order"`// The value of an ephemeral parameter will not be preserved between consecutive workspace builds.Ephemeralbool `db:"ephemeral" json:"ephemeral"`}

typeTemplateVersionPresetadded inv2.20.0

type TemplateVersionPreset struct {IDuuid.UUID      `db:"id" json:"id"`TemplateVersionIDuuid.UUID      `db:"template_version_id" json:"template_version_id"`Namestring         `db:"name" json:"name"`CreatedAttime.Time      `db:"created_at" json:"created_at"`DesiredInstancessql.NullInt32  `db:"desired_instances" json:"desired_instances"`InvalidateAfterSecssql.NullInt32  `db:"invalidate_after_secs" json:"invalidate_after_secs"`PrebuildStatusPrebuildStatus `db:"prebuild_status" json:"prebuild_status"`}

typeTemplateVersionPresetParameteradded inv2.20.0

type TemplateVersionPresetParameter struct {IDuuid.UUID `db:"id" json:"id"`TemplateVersionPresetIDuuid.UUID `db:"template_version_preset_id" json:"template_version_preset_id"`Namestring    `db:"name" json:"name"`Valuestring    `db:"value" json:"value"`}

typeTemplateVersionTable

type TemplateVersionTable struct {IDuuid.UUID     `db:"id" json:"id"`TemplateIDuuid.NullUUID `db:"template_id" json:"template_id"`OrganizationIDuuid.UUID     `db:"organization_id" json:"organization_id"`CreatedAttime.Time     `db:"created_at" json:"created_at"`UpdatedAttime.Time     `db:"updated_at" json:"updated_at"`Namestring        `db:"name" json:"name"`Readmestring        `db:"readme" json:"readme"`JobIDuuid.UUID     `db:"job_id" json:"job_id"`CreatedByuuid.UUID     `db:"created_by" json:"created_by"`// IDs of External auth providers for a specific template versionExternalAuthProvidersjson.RawMessage `db:"external_auth_providers" json:"external_auth_providers"`// Message describing the changes in this version of the template, similar to a Git commit message. Like a commit message, this should be a short, high-level description of the changes in this version of the template. This message is immutable and should not be updated after the fact.Messagestring         `db:"message" json:"message"`Archivedbool           `db:"archived" json:"archived"`SourceExampleIDsql.NullString `db:"source_example_id" json:"source_example_id"`}

typeTemplateVersionTerraformValueadded inv2.21.0

type TemplateVersionTerraformValue struct {TemplateVersionIDuuid.UUID       `db:"template_version_id" json:"template_version_id"`UpdatedAttime.Time       `db:"updated_at" json:"updated_at"`CachedPlanjson.RawMessage `db:"cached_plan" json:"cached_plan"`CachedModuleFilesuuid.NullUUID   `db:"cached_module_files" json:"cached_module_files"`// What version of the provisioning engine was used to generate the cached plan and module files.ProvisionerdVersionstring `db:"provisionerd_version" json:"provisionerd_version"`}

typeTemplateVersionVariable

type TemplateVersionVariable struct {TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`// Variable nameNamestring `db:"name" json:"name"`// Variable descriptionDescriptionstring `db:"description" json:"description"`// Variable typeTypestring `db:"type" json:"type"`// Variable valueValuestring `db:"value" json:"value"`// Variable default valueDefaultValuestring `db:"default_value" json:"default_value"`// Required variables needs a default value or a value provided by template adminRequiredbool `db:"required" json:"required"`// Sensitive variables have their values redacted in logs or site UISensitivebool `db:"sensitive" json:"sensitive"`}

typeTemplateVersionWorkspaceTagadded inv2.12.0

type TemplateVersionWorkspaceTag struct {TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`Keystring    `db:"key" json:"key"`Valuestring    `db:"value" json:"value"`}

typeTxOptionsadded inv2.17.0

type TxOptions struct {// Isolation is the transaction isolation level.// If zero, the driver or database's default level is used.Isolationsql.IsolationLevelReadOnlybool// -- Coder specific metadata --// TxIdentifier is a unique identifier for the transaction to be used// in metrics. Can be any string.TxIdentifierstring// contains filtered or unexported fields}

TxOptions is used to pass some execution metadata to the callers.Ideally we could throw this into a context, but no context is used fortransactions. So instead, the return context is attached to the optionspassed in.This metadata should not be returned in the method signature, because itis only used for metric tracking. It should never be used by business logic.

funcDefaultTXOptionsadded inv2.17.0

func DefaultTXOptions() *TxOptions

func (TxOptions)ExecutionCountadded inv2.17.0

func (oTxOptions) ExecutionCount()int

func (*TxOptions)WithIDadded inv2.17.0

func (o *TxOptions) WithID(idstring) *TxOptions

typeUnarchiveTemplateVersionParamsadded inv2.3.0

type UnarchiveTemplateVersionParams struct {UpdatedAttime.Time `db:"updated_at" json:"updated_at"`TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`}

typeUniqueConstraint

type UniqueConstraintstring

UniqueConstraint represents a named unique constraint on a table.

const (UniqueAgentStatsPkeyUniqueConstraint = "agent_stats_pkey"// ALTER TABLE ONLY workspace_agent_stats ADD CONSTRAINT agent_stats_pkey PRIMARY KEY (id);UniqueAPIKeysPkeyUniqueConstraint = "api_keys_pkey"// ALTER TABLE ONLY api_keys ADD CONSTRAINT api_keys_pkey PRIMARY KEY (id);UniqueAuditLogsPkeyUniqueConstraint = "audit_logs_pkey"// ALTER TABLE ONLY audit_logs ADD CONSTRAINT audit_logs_pkey PRIMARY KEY (id);UniqueChatMessagesPkeyUniqueConstraint = "chat_messages_pkey"// ALTER TABLE ONLY chat_messages ADD CONSTRAINT chat_messages_pkey PRIMARY KEY (id);UniqueChatsPkeyUniqueConstraint = "chats_pkey"// ALTER TABLE ONLY chats ADD CONSTRAINT chats_pkey PRIMARY KEY (id);UniqueCryptoKeysPkeyUniqueConstraint = "crypto_keys_pkey"// ALTER TABLE ONLY crypto_keys ADD CONSTRAINT crypto_keys_pkey PRIMARY KEY (feature, sequence);UniqueCustomRolesUniqueKeyUniqueConstraint = "custom_roles_unique_key"// ALTER TABLE ONLY custom_roles ADD CONSTRAINT custom_roles_unique_key UNIQUE (name, organization_id);UniqueDbcryptKeysActiveKeyDigestKeyUniqueConstraint = "dbcrypt_keys_active_key_digest_key"// ALTER TABLE ONLY dbcrypt_keys ADD CONSTRAINT dbcrypt_keys_active_key_digest_key UNIQUE (active_key_digest);UniqueDbcryptKeysPkeyUniqueConstraint = "dbcrypt_keys_pkey"// ALTER TABLE ONLY dbcrypt_keys ADD CONSTRAINT dbcrypt_keys_pkey PRIMARY KEY (number);UniqueDbcryptKeysRevokedKeyDigestKeyUniqueConstraint = "dbcrypt_keys_revoked_key_digest_key"// ALTER TABLE ONLY dbcrypt_keys ADD CONSTRAINT dbcrypt_keys_revoked_key_digest_key UNIQUE (revoked_key_digest);UniqueFilesHashCreatedByKeyUniqueConstraint = "files_hash_created_by_key"// ALTER TABLE ONLY files ADD CONSTRAINT files_hash_created_by_key UNIQUE (hash, created_by);UniqueFilesPkeyUniqueConstraint = "files_pkey"// ALTER TABLE ONLY files ADD CONSTRAINT files_pkey PRIMARY KEY (id);UniqueGitAuthLinksProviderIDUserIDKeyUniqueConstraint = "git_auth_links_provider_id_user_id_key"// ALTER TABLE ONLY external_auth_links ADD CONSTRAINT git_auth_links_provider_id_user_id_key UNIQUE (provider_id, user_id);UniqueGitSSHKeysPkeyUniqueConstraint = "gitsshkeys_pkey"// ALTER TABLE ONLY gitsshkeys ADD CONSTRAINT gitsshkeys_pkey PRIMARY KEY (user_id);UniqueGroupMembersUserIDGroupIDKeyUniqueConstraint = "group_members_user_id_group_id_key"// ALTER TABLE ONLY group_members ADD CONSTRAINT group_members_user_id_group_id_key UNIQUE (user_id, group_id);UniqueGroupsNameOrganizationIDKeyUniqueConstraint = "groups_name_organization_id_key"// ALTER TABLE ONLY groups ADD CONSTRAINT groups_name_organization_id_key UNIQUE (name, organization_id);UniqueGroupsPkeyUniqueConstraint = "groups_pkey"// ALTER TABLE ONLY groups ADD CONSTRAINT groups_pkey PRIMARY KEY (id);UniqueInboxNotificationsPkeyUniqueConstraint = "inbox_notifications_pkey"// ALTER TABLE ONLY inbox_notifications ADD CONSTRAINT inbox_notifications_pkey PRIMARY KEY (id);UniqueJfrogXrayScansPkeyUniqueConstraint = "jfrog_xray_scans_pkey"// ALTER TABLE ONLY jfrog_xray_scans ADD CONSTRAINT jfrog_xray_scans_pkey PRIMARY KEY (agent_id, workspace_id);UniqueLicensesJWTKeyUniqueConstraint = "licenses_jwt_key"// ALTER TABLE ONLY licenses ADD CONSTRAINT licenses_jwt_key UNIQUE (jwt);UniqueLicensesPkeyUniqueConstraint = "licenses_pkey"// ALTER TABLE ONLY licenses ADD CONSTRAINT licenses_pkey PRIMARY KEY (id);UniqueNotificationMessagesPkeyUniqueConstraint = "notification_messages_pkey"// ALTER TABLE ONLY notification_messages ADD CONSTRAINT notification_messages_pkey PRIMARY KEY (id);UniqueNotificationPreferencesPkeyUniqueConstraint = "notification_preferences_pkey"// ALTER TABLE ONLY notification_preferences ADD CONSTRAINT notification_preferences_pkey PRIMARY KEY (user_id, notification_template_id);UniqueNotificationReportGeneratorLogsPkeyUniqueConstraint = "notification_report_generator_logs_pkey"// ALTER TABLE ONLY notification_report_generator_logs ADD CONSTRAINT notification_report_generator_logs_pkey PRIMARY KEY (notification_template_id);UniqueNotificationTemplatesNameKeyUniqueConstraint = "notification_templates_name_key"// ALTER TABLE ONLY notification_templates ADD CONSTRAINT notification_templates_name_key UNIQUE (name);UniqueNotificationTemplatesPkeyUniqueConstraint = "notification_templates_pkey"// ALTER TABLE ONLY notification_templates ADD CONSTRAINT notification_templates_pkey PRIMARY KEY (id);UniqueOauth2ProviderAppCodesPkeyUniqueConstraint = "oauth2_provider_app_codes_pkey"// ALTER TABLE ONLY oauth2_provider_app_codes ADD CONSTRAINT oauth2_provider_app_codes_pkey PRIMARY KEY (id);UniqueOauth2ProviderAppCodesSecretPrefixKeyUniqueConstraint = "oauth2_provider_app_codes_secret_prefix_key"// ALTER TABLE ONLY oauth2_provider_app_codes ADD CONSTRAINT oauth2_provider_app_codes_secret_prefix_key UNIQUE (secret_prefix);UniqueOauth2ProviderAppSecretsPkeyUniqueConstraint = "oauth2_provider_app_secrets_pkey"// ALTER TABLE ONLY oauth2_provider_app_secrets ADD CONSTRAINT oauth2_provider_app_secrets_pkey PRIMARY KEY (id);UniqueOauth2ProviderAppSecretsSecretPrefixKeyUniqueConstraint = "oauth2_provider_app_secrets_secret_prefix_key"// ALTER TABLE ONLY oauth2_provider_app_secrets ADD CONSTRAINT oauth2_provider_app_secrets_secret_prefix_key UNIQUE (secret_prefix);UniqueOauth2ProviderAppTokensHashPrefixKeyUniqueConstraint = "oauth2_provider_app_tokens_hash_prefix_key"// ALTER TABLE ONLY oauth2_provider_app_tokens ADD CONSTRAINT oauth2_provider_app_tokens_hash_prefix_key UNIQUE (hash_prefix);UniqueOauth2ProviderAppTokensPkeyUniqueConstraint = "oauth2_provider_app_tokens_pkey"// ALTER TABLE ONLY oauth2_provider_app_tokens ADD CONSTRAINT oauth2_provider_app_tokens_pkey PRIMARY KEY (id);UniqueOauth2ProviderAppsNameKeyUniqueConstraint = "oauth2_provider_apps_name_key"// ALTER TABLE ONLY oauth2_provider_apps ADD CONSTRAINT oauth2_provider_apps_name_key UNIQUE (name);UniqueOauth2ProviderAppsPkeyUniqueConstraint = "oauth2_provider_apps_pkey"// ALTER TABLE ONLY oauth2_provider_apps ADD CONSTRAINT oauth2_provider_apps_pkey PRIMARY KEY (id);UniqueOrganizationMembersPkeyUniqueConstraint = "organization_members_pkey"// ALTER TABLE ONLY organization_members ADD CONSTRAINT organization_members_pkey PRIMARY KEY (organization_id, user_id);UniqueOrganizationsPkeyUniqueConstraint = "organizations_pkey"// ALTER TABLE ONLY organizations ADD CONSTRAINT organizations_pkey PRIMARY KEY (id);UniqueParameterSchemasJobIDNameKeyUniqueConstraint = "parameter_schemas_job_id_name_key"// ALTER TABLE ONLY parameter_schemas ADD CONSTRAINT parameter_schemas_job_id_name_key UNIQUE (job_id, name);UniqueParameterSchemasPkeyUniqueConstraint = "parameter_schemas_pkey"// ALTER TABLE ONLY parameter_schemas ADD CONSTRAINT parameter_schemas_pkey PRIMARY KEY (id);UniqueParameterValuesPkeyUniqueConstraint = "parameter_values_pkey"// ALTER TABLE ONLY parameter_values ADD CONSTRAINT parameter_values_pkey PRIMARY KEY (id);UniqueParameterValuesScopeIDNameKeyUniqueConstraint = "parameter_values_scope_id_name_key"// ALTER TABLE ONLY parameter_values ADD CONSTRAINT parameter_values_scope_id_name_key UNIQUE (scope_id, name);UniqueProvisionerDaemonsPkeyUniqueConstraint = "provisioner_daemons_pkey"// ALTER TABLE ONLY provisioner_daemons ADD CONSTRAINT provisioner_daemons_pkey PRIMARY KEY (id);UniqueProvisionerJobLogsPkeyUniqueConstraint = "provisioner_job_logs_pkey"// ALTER TABLE ONLY provisioner_job_logs ADD CONSTRAINT provisioner_job_logs_pkey PRIMARY KEY (id);UniqueProvisionerJobsPkeyUniqueConstraint = "provisioner_jobs_pkey"// ALTER TABLE ONLY provisioner_jobs ADD CONSTRAINT provisioner_jobs_pkey PRIMARY KEY (id);UniqueProvisionerKeysPkeyUniqueConstraint = "provisioner_keys_pkey"// ALTER TABLE ONLY provisioner_keys ADD CONSTRAINT provisioner_keys_pkey PRIMARY KEY (id);UniqueSiteConfigsKeyKeyUniqueConstraint = "site_configs_key_key"// ALTER TABLE ONLY site_configs ADD CONSTRAINT site_configs_key_key UNIQUE (key);UniqueTailnetAgentsPkeyUniqueConstraint = "tailnet_agents_pkey"// ALTER TABLE ONLY tailnet_agents ADD CONSTRAINT tailnet_agents_pkey PRIMARY KEY (id, coordinator_id);UniqueTailnetClientSubscriptionsPkeyUniqueConstraint = "tailnet_client_subscriptions_pkey"// ALTER TABLE ONLY tailnet_client_subscriptions ADD CONSTRAINT tailnet_client_subscriptions_pkey PRIMARY KEY (client_id, coordinator_id, agent_id);UniqueTailnetClientsPkeyUniqueConstraint = "tailnet_clients_pkey"// ALTER TABLE ONLY tailnet_clients ADD CONSTRAINT tailnet_clients_pkey PRIMARY KEY (id, coordinator_id);UniqueTailnetCoordinatorsPkeyUniqueConstraint = "tailnet_coordinators_pkey"// ALTER TABLE ONLY tailnet_coordinators ADD CONSTRAINT tailnet_coordinators_pkey PRIMARY KEY (id);UniqueTailnetPeersPkeyUniqueConstraint = "tailnet_peers_pkey"// ALTER TABLE ONLY tailnet_peers ADD CONSTRAINT tailnet_peers_pkey PRIMARY KEY (id, coordinator_id);UniqueTailnetTunnelsPkeyUniqueConstraint = "tailnet_tunnels_pkey"// ALTER TABLE ONLY tailnet_tunnels ADD CONSTRAINT tailnet_tunnels_pkey PRIMARY KEY (coordinator_id, src_id, dst_id);UniqueTelemetryItemsPkeyUniqueConstraint = "telemetry_items_pkey"// ALTER TABLE ONLY telemetry_items ADD CONSTRAINT telemetry_items_pkey PRIMARY KEY (key);UniqueTemplateUsageStatsPkeyUniqueConstraint = "template_usage_stats_pkey"// ALTER TABLE ONLY template_usage_stats ADD CONSTRAINT template_usage_stats_pkey PRIMARY KEY (start_time, template_id, user_id);UniqueTemplateVersionParametersTemplateVersionIDNameKeyUniqueConstraint = "template_version_parameters_template_version_id_name_key"// ALTER TABLE ONLY template_version_parameters ADD CONSTRAINT template_version_parameters_template_version_id_name_key UNIQUE (template_version_id, name);UniqueTemplateVersionPresetParametersPkeyUniqueConstraint = "template_version_preset_parameters_pkey"// ALTER TABLE ONLY template_version_preset_parameters ADD CONSTRAINT template_version_preset_parameters_pkey PRIMARY KEY (id);UniqueTemplateVersionPresetsPkeyUniqueConstraint = "template_version_presets_pkey"// ALTER TABLE ONLY template_version_presets ADD CONSTRAINT template_version_presets_pkey PRIMARY KEY (id);UniqueTemplateVersionTerraformValuesTemplateVersionIDKeyUniqueConstraint = "template_version_terraform_values_template_version_id_key"// ALTER TABLE ONLY template_version_terraform_values ADD CONSTRAINT template_version_terraform_values_template_version_id_key UNIQUE (template_version_id);UniqueTemplateVersionVariablesTemplateVersionIDNameKeyUniqueConstraint = "template_version_variables_template_version_id_name_key"// ALTER TABLE ONLY template_version_variables ADD CONSTRAINT template_version_variables_template_version_id_name_key UNIQUE (template_version_id, name);UniqueTemplateVersionWorkspaceTagsTemplateVersionIDKeyKeyUniqueConstraint = "template_version_workspace_tags_template_version_id_key_key"// ALTER TABLE ONLY template_version_workspace_tags ADD CONSTRAINT template_version_workspace_tags_template_version_id_key_key UNIQUE (template_version_id, key);UniqueTemplateVersionsPkeyUniqueConstraint = "template_versions_pkey"// ALTER TABLE ONLY template_versions ADD CONSTRAINT template_versions_pkey PRIMARY KEY (id);UniqueTemplateVersionsTemplateIDNameKeyUniqueConstraint = "template_versions_template_id_name_key"// ALTER TABLE ONLY template_versions ADD CONSTRAINT template_versions_template_id_name_key UNIQUE (template_id, name);UniqueTemplatesPkeyUniqueConstraint = "templates_pkey"// ALTER TABLE ONLY templates ADD CONSTRAINT templates_pkey PRIMARY KEY (id);UniqueUserConfigsPkeyUniqueConstraint = "user_configs_pkey"// ALTER TABLE ONLY user_configs ADD CONSTRAINT user_configs_pkey PRIMARY KEY (user_id, key);UniqueUserDeletedPkeyUniqueConstraint = "user_deleted_pkey"// ALTER TABLE ONLY user_deleted ADD CONSTRAINT user_deleted_pkey PRIMARY KEY (id);UniqueUserLinksPkeyUniqueConstraint = "user_links_pkey"// ALTER TABLE ONLY user_links ADD CONSTRAINT user_links_pkey PRIMARY KEY (user_id, login_type);UniqueUserStatusChangesPkeyUniqueConstraint = "user_status_changes_pkey"// ALTER TABLE ONLY user_status_changes ADD CONSTRAINT user_status_changes_pkey PRIMARY KEY (id);UniqueUsersPkeyUniqueConstraint = "users_pkey"// ALTER TABLE ONLY users ADD CONSTRAINT users_pkey PRIMARY KEY (id);UniqueWebpushSubscriptionsPkeyUniqueConstraint = "webpush_subscriptions_pkey"// ALTER TABLE ONLY webpush_subscriptions ADD CONSTRAINT webpush_subscriptions_pkey PRIMARY KEY (id);UniqueWorkspaceAgentDevcontainersPkeyUniqueConstraint = "workspace_agent_devcontainers_pkey"// ALTER TABLE ONLY workspace_agent_devcontainers ADD CONSTRAINT workspace_agent_devcontainers_pkey PRIMARY KEY (id);UniqueWorkspaceAgentLogSourcesPkeyUniqueConstraint = "workspace_agent_log_sources_pkey"// ALTER TABLE ONLY workspace_agent_log_sources ADD CONSTRAINT workspace_agent_log_sources_pkey PRIMARY KEY (workspace_agent_id, id);UniqueWorkspaceAgentMemoryResourceMonitorsPkeyUniqueConstraint = "workspace_agent_memory_resource_monitors_pkey"// ALTER TABLE ONLY workspace_agent_memory_resource_monitors ADD CONSTRAINT workspace_agent_memory_resource_monitors_pkey PRIMARY KEY (agent_id);UniqueWorkspaceAgentMetadataPkeyUniqueConstraint = "workspace_agent_metadata_pkey"// ALTER TABLE ONLY workspace_agent_metadata ADD CONSTRAINT workspace_agent_metadata_pkey PRIMARY KEY (workspace_agent_id, key);UniqueWorkspaceAgentPortSharePkeyUniqueConstraint = "workspace_agent_port_share_pkey"// ALTER TABLE ONLY workspace_agent_port_share ADD CONSTRAINT workspace_agent_port_share_pkey PRIMARY KEY (workspace_id, agent_name, port);UniqueWorkspaceAgentScriptTimingsScriptIDStartedAtKeyUniqueConstraint = "workspace_agent_script_timings_script_id_started_at_key"// ALTER TABLE ONLY workspace_agent_script_timings ADD CONSTRAINT workspace_agent_script_timings_script_id_started_at_key UNIQUE (script_id, started_at);UniqueWorkspaceAgentScriptsIDKeyUniqueConstraint = "workspace_agent_scripts_id_key"// ALTER TABLE ONLY workspace_agent_scripts ADD CONSTRAINT workspace_agent_scripts_id_key UNIQUE (id);UniqueWorkspaceAgentStartupLogsPkeyUniqueConstraint = "workspace_agent_startup_logs_pkey"// ALTER TABLE ONLY workspace_agent_logs ADD CONSTRAINT workspace_agent_startup_logs_pkey PRIMARY KEY (id);UniqueWorkspaceAgentVolumeResourceMonitorsPkeyUniqueConstraint = "workspace_agent_volume_resource_monitors_pkey"// ALTER TABLE ONLY workspace_agent_volume_resource_monitors ADD CONSTRAINT workspace_agent_volume_resource_monitors_pkey PRIMARY KEY (agent_id, path);UniqueWorkspaceAgentsPkeyUniqueConstraint = "workspace_agents_pkey"// ALTER TABLE ONLY workspace_agents ADD CONSTRAINT workspace_agents_pkey PRIMARY KEY (id);UniqueWorkspaceAppAuditSessionsAgentIDAppIDUserIDIpUseKeyUniqueConstraint = "workspace_app_audit_sessions_agent_id_app_id_user_id_ip_use_key"// ALTER TABLE ONLY workspace_app_audit_sessions ADD CONSTRAINT workspace_app_audit_sessions_agent_id_app_id_user_id_ip_use_key UNIQUE (agent_id, app_id, user_id, ip, user_agent, slug_or_port, status_code);UniqueWorkspaceAppAuditSessionsPkeyUniqueConstraint = "workspace_app_audit_sessions_pkey"// ALTER TABLE ONLY workspace_app_audit_sessions ADD CONSTRAINT workspace_app_audit_sessions_pkey PRIMARY KEY (id);UniqueWorkspaceAppStatsPkeyUniqueConstraint = "workspace_app_stats_pkey"// ALTER TABLE ONLY workspace_app_stats ADD CONSTRAINT workspace_app_stats_pkey PRIMARY KEY (id);UniqueWorkspaceAppStatsUserIDAgentIDSessionIDKeyUniqueConstraint = "workspace_app_stats_user_id_agent_id_session_id_key"// ALTER TABLE ONLY workspace_app_stats ADD CONSTRAINT workspace_app_stats_user_id_agent_id_session_id_key UNIQUE (user_id, agent_id, session_id);UniqueWorkspaceAppStatusesPkeyUniqueConstraint = "workspace_app_statuses_pkey"// ALTER TABLE ONLY workspace_app_statuses ADD CONSTRAINT workspace_app_statuses_pkey PRIMARY KEY (id);UniqueWorkspaceAppsAgentIDSlugIndexUniqueConstraint = "workspace_apps_agent_id_slug_idx"// ALTER TABLE ONLY workspace_apps ADD CONSTRAINT workspace_apps_agent_id_slug_idx UNIQUE (agent_id, slug);UniqueWorkspaceAppsPkeyUniqueConstraint = "workspace_apps_pkey"// ALTER TABLE ONLY workspace_apps ADD CONSTRAINT workspace_apps_pkey PRIMARY KEY (id);UniqueWorkspaceBuildParametersWorkspaceBuildIDNameKeyUniqueConstraint = "workspace_build_parameters_workspace_build_id_name_key"// ALTER TABLE ONLY workspace_build_parameters ADD CONSTRAINT workspace_build_parameters_workspace_build_id_name_key UNIQUE (workspace_build_id, name);UniqueWorkspaceBuildsJobIDKeyUniqueConstraint = "workspace_builds_job_id_key"// ALTER TABLE ONLY workspace_builds ADD CONSTRAINT workspace_builds_job_id_key UNIQUE (job_id);UniqueWorkspaceBuildsPkeyUniqueConstraint = "workspace_builds_pkey"// ALTER TABLE ONLY workspace_builds ADD CONSTRAINT workspace_builds_pkey PRIMARY KEY (id);UniqueWorkspaceBuildsWorkspaceIDBuildNumberKeyUniqueConstraint = "workspace_builds_workspace_id_build_number_key"// ALTER TABLE ONLY workspace_builds ADD CONSTRAINT workspace_builds_workspace_id_build_number_key UNIQUE (workspace_id, build_number);UniqueWorkspaceProxiesPkeyUniqueConstraint = "workspace_proxies_pkey"// ALTER TABLE ONLY workspace_proxies ADD CONSTRAINT workspace_proxies_pkey PRIMARY KEY (id);UniqueWorkspaceProxiesRegionIDUniqueUniqueConstraint = "workspace_proxies_region_id_unique"// ALTER TABLE ONLY workspace_proxies ADD CONSTRAINT workspace_proxies_region_id_unique UNIQUE (region_id);UniqueWorkspaceResourceMetadataNameUniqueConstraint = "workspace_resource_metadata_name"// ALTER TABLE ONLY workspace_resource_metadata ADD CONSTRAINT workspace_resource_metadata_name UNIQUE (workspace_resource_id, key);UniqueWorkspaceResourceMetadataPkeyUniqueConstraint = "workspace_resource_metadata_pkey"// ALTER TABLE ONLY workspace_resource_metadata ADD CONSTRAINT workspace_resource_metadata_pkey PRIMARY KEY (id);UniqueWorkspaceResourcesPkeyUniqueConstraint = "workspace_resources_pkey"// ALTER TABLE ONLY workspace_resources ADD CONSTRAINT workspace_resources_pkey PRIMARY KEY (id);UniqueWorkspacesPkeyUniqueConstraint = "workspaces_pkey"// ALTER TABLE ONLY workspaces ADD CONSTRAINT workspaces_pkey PRIMARY KEY (id);UniqueIndexAPIKeyNameUniqueConstraint = "idx_api_key_name"// CREATE UNIQUE INDEX idx_api_key_name ON api_keys USING btree (user_id, token_name) WHERE (login_type = 'token'::login_type);UniqueIndexCustomRolesNameLowerUniqueConstraint = "idx_custom_roles_name_lower"// CREATE UNIQUE INDEX idx_custom_roles_name_lower ON custom_roles USING btree (lower(name));UniqueIndexOrganizationNameLowerUniqueConstraint = "idx_organization_name_lower"// CREATE UNIQUE INDEX idx_organization_name_lower ON organizations USING btree (lower(name)) WHERE (deleted = false);UniqueIndexProvisionerDaemonsOrgNameOwnerKeyUniqueConstraint = "idx_provisioner_daemons_org_name_owner_key"// CREATE UNIQUE INDEX idx_provisioner_daemons_org_name_owner_key ON provisioner_daemons USING btree (organization_id, name, lower(COALESCE((tags ->> 'owner'::text), ”::text)));UniqueIndexUniquePresetNameUniqueConstraint = "idx_unique_preset_name"// CREATE UNIQUE INDEX idx_unique_preset_name ON template_version_presets USING btree (name, template_version_id);UniqueIndexUsersEmailUniqueConstraint = "idx_users_email"// CREATE UNIQUE INDEX idx_users_email ON users USING btree (email) WHERE (deleted = false);UniqueIndexUsersUsernameUniqueConstraint = "idx_users_username"// CREATE UNIQUE INDEX idx_users_username ON users USING btree (username) WHERE (deleted = false);UniqueNotificationMessagesDedupeHashIndexUniqueConstraint = "notification_messages_dedupe_hash_idx"// CREATE UNIQUE INDEX notification_messages_dedupe_hash_idx ON notification_messages USING btree (dedupe_hash);UniqueOrganizationsSingleDefaultOrgUniqueConstraint = "organizations_single_default_org"// CREATE UNIQUE INDEX organizations_single_default_org ON organizations USING btree (is_default) WHERE (is_default = true);UniqueProvisionerKeysOrganizationIDNameIndexUniqueConstraint = "provisioner_keys_organization_id_name_idx"// CREATE UNIQUE INDEX provisioner_keys_organization_id_name_idx ON provisioner_keys USING btree (organization_id, lower((name)::text));UniqueTemplateUsageStatsStartTimeTemplateIDUserIDIndexUniqueConstraint = "template_usage_stats_start_time_template_id_user_id_idx"// CREATE UNIQUE INDEX template_usage_stats_start_time_template_id_user_id_idx ON template_usage_stats USING btree (start_time, template_id, user_id);UniqueTemplatesOrganizationIDNameIndexUniqueConstraint = "templates_organization_id_name_idx"// CREATE UNIQUE INDEX templates_organization_id_name_idx ON templates USING btree (organization_id, lower((name)::text)) WHERE (deleted = false);UniqueUserLinksLinkedIDLoginTypeIndexUniqueConstraint = "user_links_linked_id_login_type_idx"// CREATE UNIQUE INDEX user_links_linked_id_login_type_idx ON user_links USING btree (linked_id, login_type) WHERE (linked_id <> ”::text);UniqueUsersEmailLowerIndexUniqueConstraint = "users_email_lower_idx"// CREATE UNIQUE INDEX users_email_lower_idx ON users USING btree (lower(email)) WHERE (deleted = false);UniqueUsersUsernameLowerIndexUniqueConstraint = "users_username_lower_idx"// CREATE UNIQUE INDEX users_username_lower_idx ON users USING btree (lower(username)) WHERE (deleted = false);UniqueWorkspaceAppAuditSessionsUniqueIndexUniqueConstraint = "workspace_app_audit_sessions_unique_index"// CREATE UNIQUE INDEX workspace_app_audit_sessions_unique_index ON workspace_app_audit_sessions USING btree (agent_id, app_id, user_id, ip, user_agent, slug_or_port, status_code);UniqueWorkspaceProxiesLowerNameIndexUniqueConstraint = "workspace_proxies_lower_name_idx"// CREATE UNIQUE INDEX workspace_proxies_lower_name_idx ON workspace_proxies USING btree (lower(name)) WHERE (deleted = false);UniqueWorkspacesOwnerIDLowerIndexUniqueConstraint = "workspaces_owner_id_lower_idx"// CREATE UNIQUE INDEX workspaces_owner_id_lower_idx ON workspaces USING btree (owner_id, lower((name)::text)) WHERE (deleted = false);)

UniqueConstraint enums.

typeUpdateAPIKeyByIDParams

type UpdateAPIKeyByIDParams struct {IDstring      `db:"id" json:"id"`LastUsedtime.Time   `db:"last_used" json:"last_used"`ExpiresAttime.Time   `db:"expires_at" json:"expires_at"`IPAddresspqtype.Inet `db:"ip_address" json:"ip_address"`}

typeUpdateChatByIDParamsadded inv2.23.0

type UpdateChatByIDParams struct {IDuuid.UUID `db:"id" json:"id"`Titlestring    `db:"title" json:"title"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`}

typeUpdateCryptoKeyDeletesAtParamsadded inv2.16.0

type UpdateCryptoKeyDeletesAtParams struct {FeatureCryptoKeyFeature `db:"feature" json:"feature"`Sequenceint32            `db:"sequence" json:"sequence"`DeletesAtsql.NullTime     `db:"deletes_at" json:"deletes_at"`}

typeUpdateCustomRoleParamsadded inv2.15.0

type UpdateCustomRoleParams struct {DisplayNamestring                `db:"display_name" json:"display_name"`SitePermissionsCustomRolePermissions `db:"site_permissions" json:"site_permissions"`OrgPermissionsCustomRolePermissions `db:"org_permissions" json:"org_permissions"`UserPermissionsCustomRolePermissions `db:"user_permissions" json:"user_permissions"`Namestring                `db:"name" json:"name"`OrganizationIDuuid.NullUUID         `db:"organization_id" json:"organization_id"`}

typeUpdateExternalAuthLinkParamsadded inv2.2.1

type UpdateExternalAuthLinkParams struct {ProviderIDstring                `db:"provider_id" json:"provider_id"`UserIDuuid.UUID             `db:"user_id" json:"user_id"`UpdatedAttime.Time             `db:"updated_at" json:"updated_at"`OAuthAccessTokenstring                `db:"oauth_access_token" json:"oauth_access_token"`OAuthAccessTokenKeyIDsql.NullString        `db:"oauth_access_token_key_id" json:"oauth_access_token_key_id"`OAuthRefreshTokenstring                `db:"oauth_refresh_token" json:"oauth_refresh_token"`OAuthRefreshTokenKeyIDsql.NullString        `db:"oauth_refresh_token_key_id" json:"oauth_refresh_token_key_id"`OAuthExpirytime.Time             `db:"oauth_expiry" json:"oauth_expiry"`OAuthExtrapqtype.NullRawMessage `db:"oauth_extra" json:"oauth_extra"`}

typeUpdateExternalAuthLinkRefreshTokenParamsadded inv2.18.0

type UpdateExternalAuthLinkRefreshTokenParams struct {OAuthRefreshTokenstring    `db:"oauth_refresh_token" json:"oauth_refresh_token"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`ProviderIDstring    `db:"provider_id" json:"provider_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`OAuthRefreshTokenKeyIDstring    `db:"oauth_refresh_token_key_id" json:"oauth_refresh_token_key_id"`}

typeUpdateGitSSHKeyParams

type UpdateGitSSHKeyParams struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`PrivateKeystring    `db:"private_key" json:"private_key"`PublicKeystring    `db:"public_key" json:"public_key"`}

typeUpdateGroupByIDParams

type UpdateGroupByIDParams struct {Namestring    `db:"name" json:"name"`DisplayNamestring    `db:"display_name" json:"display_name"`AvatarURLstring    `db:"avatar_url" json:"avatar_url"`QuotaAllowanceint32     `db:"quota_allowance" json:"quota_allowance"`IDuuid.UUID `db:"id" json:"id"`}

typeUpdateInactiveUsersToDormantParams

type UpdateInactiveUsersToDormantParams struct {UpdatedAttime.Time `db:"updated_at" json:"updated_at"`LastSeenAftertime.Time `db:"last_seen_after" json:"last_seen_after"`}

typeUpdateInactiveUsersToDormantRow

type UpdateInactiveUsersToDormantRow struct {IDuuid.UUID `db:"id" json:"id"`Emailstring    `db:"email" json:"email"`Usernamestring    `db:"username" json:"username"`LastSeenAttime.Time `db:"last_seen_at" json:"last_seen_at"`}

typeUpdateInboxNotificationReadStatusParamsadded inv2.21.0

type UpdateInboxNotificationReadStatusParams struct {ReadAtsql.NullTime `db:"read_at" json:"read_at"`IDuuid.UUID    `db:"id" json:"id"`}

typeUpdateMemberRolesParams

type UpdateMemberRolesParams struct {GrantedRoles []string  `db:"granted_roles" json:"granted_roles"`UserIDuuid.UUID `db:"user_id" json:"user_id"`OrgIDuuid.UUID `db:"org_id" json:"org_id"`}

typeUpdateMemoryResourceMonitorParamsadded inv2.20.0

type UpdateMemoryResourceMonitorParams struct {AgentIDuuid.UUID                  `db:"agent_id" json:"agent_id"`UpdatedAttime.Time                  `db:"updated_at" json:"updated_at"`StateWorkspaceAgentMonitorState `db:"state" json:"state"`DebouncedUntiltime.Time                  `db:"debounced_until" json:"debounced_until"`}

typeUpdateNotificationTemplateMethodByIDParamsadded inv2.15.0

type UpdateNotificationTemplateMethodByIDParams struct {MethodNullNotificationMethod `db:"method" json:"method"`IDuuid.UUID              `db:"id" json:"id"`}

typeUpdateOAuth2ProviderAppByIDParamsadded inv2.6.0

type UpdateOAuth2ProviderAppByIDParams struct {IDuuid.UUID `db:"id" json:"id"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`Namestring    `db:"name" json:"name"`Iconstring    `db:"icon" json:"icon"`CallbackURLstring    `db:"callback_url" json:"callback_url"`}

typeUpdateOAuth2ProviderAppSecretByIDParamsadded inv2.6.0

type UpdateOAuth2ProviderAppSecretByIDParams struct {IDuuid.UUID    `db:"id" json:"id"`LastUsedAtsql.NullTime `db:"last_used_at" json:"last_used_at"`}

typeUpdateOrganizationDeletedByIDParamsadded inv2.20.0

type UpdateOrganizationDeletedByIDParams struct {UpdatedAttime.Time `db:"updated_at" json:"updated_at"`IDuuid.UUID `db:"id" json:"id"`}

typeUpdateOrganizationParamsadded inv2.12.0

type UpdateOrganizationParams struct {UpdatedAttime.Time `db:"updated_at" json:"updated_at"`Namestring    `db:"name" json:"name"`DisplayNamestring    `db:"display_name" json:"display_name"`Descriptionstring    `db:"description" json:"description"`Iconstring    `db:"icon" json:"icon"`IDuuid.UUID `db:"id" json:"id"`}

typeUpdatePresetPrebuildStatusParamsadded inv2.23.0

type UpdatePresetPrebuildStatusParams struct {StatusPrebuildStatus `db:"status" json:"status"`PresetIDuuid.UUID      `db:"preset_id" json:"preset_id"`}

typeUpdateProvisionerDaemonLastSeenAtParamsadded inv2.6.0

type UpdateProvisionerDaemonLastSeenAtParams struct {LastSeenAtsql.NullTime `db:"last_seen_at" json:"last_seen_at"`IDuuid.UUID    `db:"id" json:"id"`}

typeUpdateProvisionerJobByIDParams

type UpdateProvisionerJobByIDParams struct {IDuuid.UUID `db:"id" json:"id"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`}

typeUpdateProvisionerJobWithCancelByIDParams

type UpdateProvisionerJobWithCancelByIDParams struct {IDuuid.UUID    `db:"id" json:"id"`CanceledAtsql.NullTime `db:"canceled_at" json:"canceled_at"`CompletedAtsql.NullTime `db:"completed_at" json:"completed_at"`}

typeUpdateProvisionerJobWithCompleteByIDParams

type UpdateProvisionerJobWithCompleteByIDParams struct {IDuuid.UUID      `db:"id" json:"id"`UpdatedAttime.Time      `db:"updated_at" json:"updated_at"`CompletedAtsql.NullTime   `db:"completed_at" json:"completed_at"`Errorsql.NullString `db:"error" json:"error"`ErrorCodesql.NullString `db:"error_code" json:"error_code"`}

typeUpdateProvisionerJobWithCompleteWithStartedAtByIDParamsadded inv2.23.0

type UpdateProvisionerJobWithCompleteWithStartedAtByIDParams struct {IDuuid.UUID      `db:"id" json:"id"`UpdatedAttime.Time      `db:"updated_at" json:"updated_at"`CompletedAtsql.NullTime   `db:"completed_at" json:"completed_at"`Errorsql.NullString `db:"error" json:"error"`ErrorCodesql.NullString `db:"error_code" json:"error_code"`StartedAtsql.NullTime   `db:"started_at" json:"started_at"`}

typeUpdateReplicaParams

type UpdateReplicaParams struct {IDuuid.UUID    `db:"id" json:"id"`UpdatedAttime.Time    `db:"updated_at" json:"updated_at"`StartedAttime.Time    `db:"started_at" json:"started_at"`StoppedAtsql.NullTime `db:"stopped_at" json:"stopped_at"`RelayAddressstring       `db:"relay_address" json:"relay_address"`RegionIDint32        `db:"region_id" json:"region_id"`Hostnamestring       `db:"hostname" json:"hostname"`Versionstring       `db:"version" json:"version"`Errorstring       `db:"error" json:"error"`DatabaseLatencyint32        `db:"database_latency" json:"database_latency"`Primarybool         `db:"primary" json:"primary"`}

typeUpdateTailnetPeerStatusByCoordinatorParamsadded inv2.15.0

type UpdateTailnetPeerStatusByCoordinatorParams struct {CoordinatorIDuuid.UUID     `db:"coordinator_id" json:"coordinator_id"`StatusTailnetStatus `db:"status" json:"status"`}

typeUpdateTemplateACLByIDParams

type UpdateTemplateACLByIDParams struct {GroupACLTemplateACL `db:"group_acl" json:"group_acl"`UserACLTemplateACL `db:"user_acl" json:"user_acl"`IDuuid.UUID   `db:"id" json:"id"`}

typeUpdateTemplateAccessControlByIDParamsadded inv2.3.2

type UpdateTemplateAccessControlByIDParams struct {IDuuid.UUID `db:"id" json:"id"`RequireActiveVersionbool      `db:"require_active_version" json:"require_active_version"`Deprecatedstring    `db:"deprecated" json:"deprecated"`}

typeUpdateTemplateActiveVersionByIDParams

type UpdateTemplateActiveVersionByIDParams struct {IDuuid.UUID `db:"id" json:"id"`ActiveVersionIDuuid.UUID `db:"active_version_id" json:"active_version_id"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`}

typeUpdateTemplateDeletedByIDParams

type UpdateTemplateDeletedByIDParams struct {IDuuid.UUID `db:"id" json:"id"`Deletedbool      `db:"deleted" json:"deleted"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`}

typeUpdateTemplateMetaByIDParams

type UpdateTemplateMetaByIDParams struct {IDuuid.UUID       `db:"id" json:"id"`UpdatedAttime.Time       `db:"updated_at" json:"updated_at"`Descriptionstring          `db:"description" json:"description"`Namestring          `db:"name" json:"name"`Iconstring          `db:"icon" json:"icon"`DisplayNamestring          `db:"display_name" json:"display_name"`AllowUserCancelWorkspaceJobsbool            `db:"allow_user_cancel_workspace_jobs" json:"allow_user_cancel_workspace_jobs"`GroupACLTemplateACL     `db:"group_acl" json:"group_acl"`MaxPortSharingLevelAppSharingLevel `db:"max_port_sharing_level" json:"max_port_sharing_level"`UseClassicParameterFlowbool            `db:"use_classic_parameter_flow" json:"use_classic_parameter_flow"`}

typeUpdateTemplateScheduleByIDParams

type UpdateTemplateScheduleByIDParams struct {IDuuid.UUID `db:"id" json:"id"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`AllowUserAutostartbool      `db:"allow_user_autostart" json:"allow_user_autostart"`AllowUserAutostopbool      `db:"allow_user_autostop" json:"allow_user_autostop"`DefaultTTLint64     `db:"default_ttl" json:"default_ttl"`ActivityBumpint64     `db:"activity_bump" json:"activity_bump"`AutostopRequirementDaysOfWeekint16     `db:"autostop_requirement_days_of_week" json:"autostop_requirement_days_of_week"`AutostopRequirementWeeksint64     `db:"autostop_requirement_weeks" json:"autostop_requirement_weeks"`AutostartBlockDaysOfWeekint16     `db:"autostart_block_days_of_week" json:"autostart_block_days_of_week"`FailureTTLint64     `db:"failure_ttl" json:"failure_ttl"`TimeTilDormantint64     `db:"time_til_dormant" json:"time_til_dormant"`TimeTilDormantAutoDeleteint64     `db:"time_til_dormant_autodelete" json:"time_til_dormant_autodelete"`}

typeUpdateTemplateVersionByIDParams

type UpdateTemplateVersionByIDParams struct {IDuuid.UUID     `db:"id" json:"id"`TemplateIDuuid.NullUUID `db:"template_id" json:"template_id"`UpdatedAttime.Time     `db:"updated_at" json:"updated_at"`Namestring        `db:"name" json:"name"`Messagestring        `db:"message" json:"message"`}

typeUpdateTemplateVersionDescriptionByJobIDParams

type UpdateTemplateVersionDescriptionByJobIDParams struct {JobIDuuid.UUID `db:"job_id" json:"job_id"`Readmestring    `db:"readme" json:"readme"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`}

typeUpdateTemplateVersionExternalAuthProvidersByJobIDParamsadded inv2.2.1

type UpdateTemplateVersionExternalAuthProvidersByJobIDParams struct {JobIDuuid.UUID       `db:"job_id" json:"job_id"`ExternalAuthProvidersjson.RawMessage `db:"external_auth_providers" json:"external_auth_providers"`UpdatedAttime.Time       `db:"updated_at" json:"updated_at"`}

typeUpdateTemplateWorkspacesLastUsedAtParamsadded inv2.1.2

type UpdateTemplateWorkspacesLastUsedAtParams struct {LastUsedAttime.Time `db:"last_used_at" json:"last_used_at"`TemplateIDuuid.UUID `db:"template_id" json:"template_id"`}

typeUpdateUserGithubComUserIDParamsadded inv2.14.0

type UpdateUserGithubComUserIDParams struct {IDuuid.UUID     `db:"id" json:"id"`GithubComUserIDsql.NullInt64 `db:"github_com_user_id" json:"github_com_user_id"`}

typeUpdateUserHashedOneTimePasscodeParamsadded inv2.17.0

type UpdateUserHashedOneTimePasscodeParams struct {IDuuid.UUID    `db:"id" json:"id"`HashedOneTimePasscode    []byte       `db:"hashed_one_time_passcode" json:"hashed_one_time_passcode"`OneTimePasscodeExpiresAtsql.NullTime `db:"one_time_passcode_expires_at" json:"one_time_passcode_expires_at"`}

typeUpdateUserHashedPasswordParams

type UpdateUserHashedPasswordParams struct {IDuuid.UUID `db:"id" json:"id"`HashedPassword []byte    `db:"hashed_password" json:"hashed_password"`}

typeUpdateUserLastSeenAtParams

type UpdateUserLastSeenAtParams struct {IDuuid.UUID `db:"id" json:"id"`LastSeenAttime.Time `db:"last_seen_at" json:"last_seen_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`}

typeUpdateUserLinkParams

type UpdateUserLinkParams struct {OAuthAccessTokenstring         `db:"oauth_access_token" json:"oauth_access_token"`OAuthAccessTokenKeyIDsql.NullString `db:"oauth_access_token_key_id" json:"oauth_access_token_key_id"`OAuthRefreshTokenstring         `db:"oauth_refresh_token" json:"oauth_refresh_token"`OAuthRefreshTokenKeyIDsql.NullString `db:"oauth_refresh_token_key_id" json:"oauth_refresh_token_key_id"`OAuthExpirytime.Time      `db:"oauth_expiry" json:"oauth_expiry"`ClaimsUserLinkClaims `db:"claims" json:"claims"`UserIDuuid.UUID      `db:"user_id" json:"user_id"`LoginTypeLoginType      `db:"login_type" json:"login_type"`}

typeUpdateUserLinkedIDParams

type UpdateUserLinkedIDParams struct {LinkedIDstring    `db:"linked_id" json:"linked_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`LoginTypeLoginType `db:"login_type" json:"login_type"`}

typeUpdateUserLoginTypeParams

type UpdateUserLoginTypeParams struct {NewLoginTypeLoginType `db:"new_login_type" json:"new_login_type"`UserIDuuid.UUID `db:"user_id" json:"user_id"`}

typeUpdateUserNotificationPreferencesParamsadded inv2.15.0

type UpdateUserNotificationPreferencesParams struct {UserIDuuid.UUID   `db:"user_id" json:"user_id"`NotificationTemplateIds []uuid.UUID `db:"notification_template_ids" json:"notification_template_ids"`Disableds               []bool      `db:"disableds" json:"disableds"`}

typeUpdateUserProfileParams

type UpdateUserProfileParams struct {IDuuid.UUID `db:"id" json:"id"`Emailstring    `db:"email" json:"email"`Usernamestring    `db:"username" json:"username"`AvatarURLstring    `db:"avatar_url" json:"avatar_url"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`Namestring    `db:"name" json:"name"`}

typeUpdateUserQuietHoursScheduleParams

type UpdateUserQuietHoursScheduleParams struct {IDuuid.UUID `db:"id" json:"id"`QuietHoursSchedulestring    `db:"quiet_hours_schedule" json:"quiet_hours_schedule"`}

typeUpdateUserRolesParams

type UpdateUserRolesParams struct {GrantedRoles []string  `db:"granted_roles" json:"granted_roles"`IDuuid.UUID `db:"id" json:"id"`}

typeUpdateUserStatusParams

type UpdateUserStatusParams struct {IDuuid.UUID  `db:"id" json:"id"`StatusUserStatus `db:"status" json:"status"`UpdatedAttime.Time  `db:"updated_at" json:"updated_at"`}

typeUpdateUserTerminalFontParamsadded inv2.22.0

type UpdateUserTerminalFontParams struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`TerminalFontstring    `db:"terminal_font" json:"terminal_font"`}

typeUpdateUserThemePreferenceParamsadded inv2.22.0

type UpdateUserThemePreferenceParams struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`ThemePreferencestring    `db:"theme_preference" json:"theme_preference"`}

typeUpdateVolumeResourceMonitorParamsadded inv2.20.0

type UpdateVolumeResourceMonitorParams struct {AgentIDuuid.UUID                  `db:"agent_id" json:"agent_id"`Pathstring                     `db:"path" json:"path"`UpdatedAttime.Time                  `db:"updated_at" json:"updated_at"`StateWorkspaceAgentMonitorState `db:"state" json:"state"`DebouncedUntiltime.Time                  `db:"debounced_until" json:"debounced_until"`}

typeUpdateWorkspaceAgentConnectionByIDParams

type UpdateWorkspaceAgentConnectionByIDParams struct {IDuuid.UUID     `db:"id" json:"id"`FirstConnectedAtsql.NullTime  `db:"first_connected_at" json:"first_connected_at"`LastConnectedAtsql.NullTime  `db:"last_connected_at" json:"last_connected_at"`LastConnectedReplicaIDuuid.NullUUID `db:"last_connected_replica_id" json:"last_connected_replica_id"`DisconnectedAtsql.NullTime  `db:"disconnected_at" json:"disconnected_at"`UpdatedAttime.Time     `db:"updated_at" json:"updated_at"`}

typeUpdateWorkspaceAgentLifecycleStateByIDParams

type UpdateWorkspaceAgentLifecycleStateByIDParams struct {IDuuid.UUID                    `db:"id" json:"id"`LifecycleStateWorkspaceAgentLifecycleState `db:"lifecycle_state" json:"lifecycle_state"`StartedAtsql.NullTime                 `db:"started_at" json:"started_at"`ReadyAtsql.NullTime                 `db:"ready_at" json:"ready_at"`}

typeUpdateWorkspaceAgentLogOverflowByIDParams

type UpdateWorkspaceAgentLogOverflowByIDParams struct {IDuuid.UUID `db:"id" json:"id"`LogsOverflowedbool      `db:"logs_overflowed" json:"logs_overflowed"`}

typeUpdateWorkspaceAgentMetadataParams

type UpdateWorkspaceAgentMetadataParams struct {WorkspaceAgentIDuuid.UUID   `db:"workspace_agent_id" json:"workspace_agent_id"`Key              []string    `db:"key" json:"key"`Value            []string    `db:"value" json:"value"`Error            []string    `db:"error" json:"error"`CollectedAt      []time.Time `db:"collected_at" json:"collected_at"`}

typeUpdateWorkspaceAgentStartupByIDParams

type UpdateWorkspaceAgentStartupByIDParams struct {IDuuid.UUID                 `db:"id" json:"id"`Versionstring                    `db:"version" json:"version"`ExpandedDirectorystring                    `db:"expanded_directory" json:"expanded_directory"`Subsystems        []WorkspaceAgentSubsystem `db:"subsystems" json:"subsystems"`APIVersionstring                    `db:"api_version" json:"api_version"`}

typeUpdateWorkspaceAppHealthByIDParams

type UpdateWorkspaceAppHealthByIDParams struct {IDuuid.UUID          `db:"id" json:"id"`HealthWorkspaceAppHealth `db:"health" json:"health"`}

typeUpdateWorkspaceAutomaticUpdatesParamsadded inv2.3.0

type UpdateWorkspaceAutomaticUpdatesParams struct {IDuuid.UUID        `db:"id" json:"id"`AutomaticUpdatesAutomaticUpdates `db:"automatic_updates" json:"automatic_updates"`}

typeUpdateWorkspaceAutostartParams

type UpdateWorkspaceAutostartParams struct {IDuuid.UUID      `db:"id" json:"id"`AutostartSchedulesql.NullString `db:"autostart_schedule" json:"autostart_schedule"`NextStartAtsql.NullTime   `db:"next_start_at" json:"next_start_at"`}

typeUpdateWorkspaceBuildCostByIDParams

type UpdateWorkspaceBuildCostByIDParams struct {IDuuid.UUID `db:"id" json:"id"`DailyCostint32     `db:"daily_cost" json:"daily_cost"`}

typeUpdateWorkspaceBuildDeadlineByIDParamsadded inv2.2.0

type UpdateWorkspaceBuildDeadlineByIDParams struct {Deadlinetime.Time `db:"deadline" json:"deadline"`MaxDeadlinetime.Time `db:"max_deadline" json:"max_deadline"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`IDuuid.UUID `db:"id" json:"id"`}

typeUpdateWorkspaceBuildProvisionerStateByIDParamsadded inv2.2.0

type UpdateWorkspaceBuildProvisionerStateByIDParams struct {ProvisionerState []byte    `db:"provisioner_state" json:"provisioner_state"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`IDuuid.UUID `db:"id" json:"id"`}

typeUpdateWorkspaceDeletedByIDParams

type UpdateWorkspaceDeletedByIDParams struct {IDuuid.UUID `db:"id" json:"id"`Deletedbool      `db:"deleted" json:"deleted"`}

typeUpdateWorkspaceDormantDeletingAtParamsadded inv2.1.4

type UpdateWorkspaceDormantDeletingAtParams struct {IDuuid.UUID    `db:"id" json:"id"`DormantAtsql.NullTime `db:"dormant_at" json:"dormant_at"`}

typeUpdateWorkspaceLastUsedAtParams

type UpdateWorkspaceLastUsedAtParams struct {IDuuid.UUID `db:"id" json:"id"`LastUsedAttime.Time `db:"last_used_at" json:"last_used_at"`}

typeUpdateWorkspaceNextStartAtParamsadded inv2.19.0

type UpdateWorkspaceNextStartAtParams struct {IDuuid.UUID    `db:"id" json:"id"`NextStartAtsql.NullTime `db:"next_start_at" json:"next_start_at"`}

typeUpdateWorkspaceParams

type UpdateWorkspaceParams struct {IDuuid.UUID `db:"id" json:"id"`Namestring    `db:"name" json:"name"`}

typeUpdateWorkspaceProxyDeletedParams

type UpdateWorkspaceProxyDeletedParams struct {Deletedbool      `db:"deleted" json:"deleted"`IDuuid.UUID `db:"id" json:"id"`}

typeUpdateWorkspaceProxyParams

type UpdateWorkspaceProxyParams struct {Namestring    `db:"name" json:"name"`DisplayNamestring    `db:"display_name" json:"display_name"`Iconstring    `db:"icon" json:"icon"`TokenHashedSecret []byte    `db:"token_hashed_secret" json:"token_hashed_secret"`IDuuid.UUID `db:"id" json:"id"`}

typeUpdateWorkspaceTTLParams

type UpdateWorkspaceTTLParams struct {IDuuid.UUID     `db:"id" json:"id"`Ttlsql.NullInt64 `db:"ttl" json:"ttl"`}

typeUpdateWorkspacesDormantDeletingAtByTemplateIDParamsadded inv2.1.4

type UpdateWorkspacesDormantDeletingAtByTemplateIDParams struct {TimeTilDormantAutodeleteMsint64     `db:"time_til_dormant_autodelete_ms" json:"time_til_dormant_autodelete_ms"`DormantAttime.Time `db:"dormant_at" json:"dormant_at"`TemplateIDuuid.UUID `db:"template_id" json:"template_id"`}

typeUpdateWorkspacesTTLByTemplateIDParamsadded inv2.19.0

type UpdateWorkspacesTTLByTemplateIDParams struct {TemplateIDuuid.UUID     `db:"template_id" json:"template_id"`Ttlsql.NullInt64 `db:"ttl" json:"ttl"`}

typeUpsertDefaultProxyParams

type UpsertDefaultProxyParams struct {DisplayNamestring `db:"display_name" json:"display_name"`IconUrlstring `db:"icon_url" json:"icon_url"`}

typeUpsertNotificationReportGeneratorLogParamsadded inv2.16.0

type UpsertNotificationReportGeneratorLogParams struct {NotificationTemplateIDuuid.UUID `db:"notification_template_id" json:"notification_template_id"`LastGeneratedAttime.Time `db:"last_generated_at" json:"last_generated_at"`}

typeUpsertProvisionerDaemonParamsadded inv2.5.1

type UpsertProvisionerDaemonParams struct {CreatedAttime.Time         `db:"created_at" json:"created_at"`Namestring            `db:"name" json:"name"`Provisioners   []ProvisionerType `db:"provisioners" json:"provisioners"`TagsStringMap         `db:"tags" json:"tags"`LastSeenAtsql.NullTime      `db:"last_seen_at" json:"last_seen_at"`Versionstring            `db:"version" json:"version"`OrganizationIDuuid.UUID         `db:"organization_id" json:"organization_id"`APIVersionstring            `db:"api_version" json:"api_version"`KeyIDuuid.UUID         `db:"key_id" json:"key_id"`}

typeUpsertRuntimeConfigParamsadded inv2.16.0

type UpsertRuntimeConfigParams struct {Keystring `db:"key" json:"key"`Valuestring `db:"value" json:"value"`}

typeUpsertTailnetAgentParams

type UpsertTailnetAgentParams struct {IDuuid.UUID       `db:"id" json:"id"`CoordinatorIDuuid.UUID       `db:"coordinator_id" json:"coordinator_id"`Nodejson.RawMessage `db:"node" json:"node"`}

typeUpsertTailnetClientParams

type UpsertTailnetClientParams struct {IDuuid.UUID       `db:"id" json:"id"`CoordinatorIDuuid.UUID       `db:"coordinator_id" json:"coordinator_id"`Nodejson.RawMessage `db:"node" json:"node"`}

typeUpsertTailnetClientSubscriptionParamsadded inv2.2.0

type UpsertTailnetClientSubscriptionParams struct {ClientIDuuid.UUID `db:"client_id" json:"client_id"`CoordinatorIDuuid.UUID `db:"coordinator_id" json:"coordinator_id"`AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`}

typeUpsertTailnetPeerParamsadded inv2.4.0

type UpsertTailnetPeerParams struct {IDuuid.UUID     `db:"id" json:"id"`CoordinatorIDuuid.UUID     `db:"coordinator_id" json:"coordinator_id"`Node          []byte        `db:"node" json:"node"`StatusTailnetStatus `db:"status" json:"status"`}

typeUpsertTailnetTunnelParamsadded inv2.4.0

type UpsertTailnetTunnelParams struct {CoordinatorIDuuid.UUID `db:"coordinator_id" json:"coordinator_id"`SrcIDuuid.UUID `db:"src_id" json:"src_id"`DstIDuuid.UUID `db:"dst_id" json:"dst_id"`}

typeUpsertTelemetryItemParamsadded inv2.19.0

type UpsertTelemetryItemParams struct {Keystring `db:"key" json:"key"`Valuestring `db:"value" json:"value"`}

typeUpsertWebpushVAPIDKeysParamsadded inv2.21.0

type UpsertWebpushVAPIDKeysParams struct {VapidPublicKeystring `db:"vapid_public_key" json:"vapid_public_key"`VapidPrivateKeystring `db:"vapid_private_key" json:"vapid_private_key"`}

typeUpsertWorkspaceAgentPortShareParamsadded inv2.9.0

type UpsertWorkspaceAgentPortShareParams struct {WorkspaceIDuuid.UUID         `db:"workspace_id" json:"workspace_id"`AgentNamestring            `db:"agent_name" json:"agent_name"`Portint32             `db:"port" json:"port"`ShareLevelAppSharingLevel   `db:"share_level" json:"share_level"`ProtocolPortShareProtocol `db:"protocol" json:"protocol"`}

typeUpsertWorkspaceAppAuditSessionParamsadded inv2.21.0

type UpsertWorkspaceAppAuditSessionParams struct {IDuuid.UUID `db:"id" json:"id"`AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`AppIDuuid.UUID `db:"app_id" json:"app_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`Ipstring    `db:"ip" json:"ip"`UserAgentstring    `db:"user_agent" json:"user_agent"`SlugOrPortstring    `db:"slug_or_port" json:"slug_or_port"`StatusCodeint32     `db:"status_code" json:"status_code"`StartedAttime.Time `db:"started_at" json:"started_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`StaleIntervalMSint64     `db:"stale_interval_ms" json:"stale_interval_ms"`}

typeUser

type User struct {IDuuid.UUID      `db:"id" json:"id"`Emailstring         `db:"email" json:"email"`Usernamestring         `db:"username" json:"username"`HashedPassword []byte         `db:"hashed_password" json:"hashed_password"`CreatedAttime.Time      `db:"created_at" json:"created_at"`UpdatedAttime.Time      `db:"updated_at" json:"updated_at"`StatusUserStatus     `db:"status" json:"status"`RBACRolespq.StringArray `db:"rbac_roles" json:"rbac_roles"`LoginTypeLoginType      `db:"login_type" json:"login_type"`AvatarURLstring         `db:"avatar_url" json:"avatar_url"`Deletedbool           `db:"deleted" json:"deleted"`LastSeenAttime.Time      `db:"last_seen_at" json:"last_seen_at"`// Daily (!) cron schedule (with optional CRON_TZ) signifying the start of the user's quiet hours. If empty, the default quiet hours on the instance is used instead.QuietHoursSchedulestring `db:"quiet_hours_schedule" json:"quiet_hours_schedule"`// Name of the Coder userNamestring `db:"name" json:"name"`// The GitHub.com numerical user ID. It is used to check if the user has starred the Coder repository. It is also used for filtering users in the users list CLI command, and may become more widely used in the future.GithubComUserIDsql.NullInt64 `db:"github_com_user_id" json:"github_com_user_id"`// A hash of the one-time-passcode given to the user.HashedOneTimePasscode []byte `db:"hashed_one_time_passcode" json:"hashed_one_time_passcode"`// The time when the one-time-passcode expires.OneTimePasscodeExpiresAtsql.NullTime `db:"one_time_passcode_expires_at" json:"one_time_passcode_expires_at"`// Determines if a user is a system user, and therefore cannot login or perform normal actionsIsSystembool `db:"is_system" json:"is_system"`}

funcConvertUserRows

func ConvertUserRows(rows []GetUsersRow) []User

func (User)RBACObject

func (uUser) RBACObject()rbac.Object

RBACObject returns the RBAC object for the site wide user resource.

typeUserConfigadded inv2.21.0

type UserConfig struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`Keystring    `db:"key" json:"key"`Valuestring    `db:"value" json:"value"`}

typeUserDeletedadded inv2.19.0

type UserDeleted struct {IDuuid.UUID `db:"id" json:"id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`DeletedAttime.Time `db:"deleted_at" json:"deleted_at"`}

Tracks when users were deleted

typeUserLink

type UserLink struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`LoginTypeLoginType `db:"login_type" json:"login_type"`LinkedIDstring    `db:"linked_id" json:"linked_id"`OAuthAccessTokenstring    `db:"oauth_access_token" json:"oauth_access_token"`OAuthRefreshTokenstring    `db:"oauth_refresh_token" json:"oauth_refresh_token"`OAuthExpirytime.Time `db:"oauth_expiry" json:"oauth_expiry"`// The ID of the key used to encrypt the OAuth access token. If this is NULL, the access token is not encryptedOAuthAccessTokenKeyIDsql.NullString `db:"oauth_access_token_key_id" json:"oauth_access_token_key_id"`// The ID of the key used to encrypt the OAuth refresh token. If this is NULL, the refresh token is not encryptedOAuthRefreshTokenKeyIDsql.NullString `db:"oauth_refresh_token_key_id" json:"oauth_refresh_token_key_id"`// Claims from the IDP for the linked user. Includes both id_token and userinfo claims.ClaimsUserLinkClaims `db:"claims" json:"claims"`}

func (UserLink)RBACObject

func (uUserLink) RBACObject()rbac.Object

typeUserLinkClaimsadded inv2.18.0

type UserLinkClaims struct {IDTokenClaims  map[string]interface{} `json:"id_token_claims"`UserInfoClaims map[string]interface{} `json:"user_info_claims"`// MergeClaims are computed in Golang. It is the result of merging// the IDTokenClaims and UserInfoClaims. UserInfoClaims take precedence.MergedClaims map[string]interface{} `json:"merged_claims"`}

UserLinkClaims is the returned IDP claims for a given user link.These claims are fetched at login time. These are the claims that wereused for IDP sync.

func (*UserLinkClaims)Scanadded inv2.18.0

func (a *UserLinkClaims) Scan(src interface{})error

func (UserLinkClaims)Valueadded inv2.18.0

func (aUserLinkClaims) Value() (driver.Value,error)

typeUserStatus

type UserStatusstring

Defines the users status: active, dormant, or suspended.

const (UserStatusActiveUserStatus = "active"UserStatusSuspendedUserStatus = "suspended"UserStatusDormantUserStatus = "dormant")

funcAllUserStatusValues

func AllUserStatusValues() []UserStatus

func (*UserStatus)Scan

func (e *UserStatus) Scan(src interface{})error

func (UserStatus)Valid

func (eUserStatus) Valid()bool

typeUserStatusChangeadded inv2.19.0

type UserStatusChange struct {IDuuid.UUID  `db:"id" json:"id"`UserIDuuid.UUID  `db:"user_id" json:"user_id"`NewStatusUserStatus `db:"new_status" json:"new_status"`ChangedAttime.Time  `db:"changed_at" json:"changed_at"`}

Tracks the history of user status changes

typeVisibleUser

type VisibleUser struct {IDuuid.UUID `db:"id" json:"id"`Usernamestring    `db:"username" json:"username"`Namestring    `db:"name" json:"name"`AvatarURLstring    `db:"avatar_url" json:"avatar_url"`}

Visible fields of users are allowed to be joined with other tables for including context of other resources.

typeWebpushSubscriptionadded inv2.21.0

type WebpushSubscription struct {IDuuid.UUID `db:"id" json:"id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`Endpointstring    `db:"endpoint" json:"endpoint"`EndpointP256dhKeystring    `db:"endpoint_p256dh_key" json:"endpoint_p256dh_key"`EndpointAuthKeystring    `db:"endpoint_auth_key" json:"endpoint_auth_key"`}

typeWorkspace

type Workspace struct {IDuuid.UUID        `db:"id" json:"id"`CreatedAttime.Time        `db:"created_at" json:"created_at"`UpdatedAttime.Time        `db:"updated_at" json:"updated_at"`OwnerIDuuid.UUID        `db:"owner_id" json:"owner_id"`OrganizationIDuuid.UUID        `db:"organization_id" json:"organization_id"`TemplateIDuuid.UUID        `db:"template_id" json:"template_id"`Deletedbool             `db:"deleted" json:"deleted"`Namestring           `db:"name" json:"name"`AutostartSchedulesql.NullString   `db:"autostart_schedule" json:"autostart_schedule"`Ttlsql.NullInt64    `db:"ttl" json:"ttl"`LastUsedAttime.Time        `db:"last_used_at" json:"last_used_at"`DormantAtsql.NullTime     `db:"dormant_at" json:"dormant_at"`DeletingAtsql.NullTime     `db:"deleting_at" json:"deleting_at"`AutomaticUpdatesAutomaticUpdates `db:"automatic_updates" json:"automatic_updates"`Favoritebool             `db:"favorite" json:"favorite"`NextStartAtsql.NullTime     `db:"next_start_at" json:"next_start_at"`OwnerAvatarUrlstring           `db:"owner_avatar_url" json:"owner_avatar_url"`OwnerUsernamestring           `db:"owner_username" json:"owner_username"`OwnerNamestring           `db:"owner_name" json:"owner_name"`OrganizationNamestring           `db:"organization_name" json:"organization_name"`OrganizationDisplayNamestring           `db:"organization_display_name" json:"organization_display_name"`OrganizationIconstring           `db:"organization_icon" json:"organization_icon"`OrganizationDescriptionstring           `db:"organization_description" json:"organization_description"`TemplateNamestring           `db:"template_name" json:"template_name"`TemplateDisplayNamestring           `db:"template_display_name" json:"template_display_name"`TemplateIconstring           `db:"template_icon" json:"template_icon"`TemplateDescriptionstring           `db:"template_description" json:"template_description"`}

Joins in the display name information such as username, avatar, and organization name.

funcConvertWorkspaceRows

func ConvertWorkspaceRows(rows []GetWorkspacesRow) []Workspace

func (Workspace)RBACObject

func (wWorkspace) RBACObject()rbac.Object

func (Workspace)WorkspaceTableadded inv2.17.0

func (wWorkspace) WorkspaceTable()WorkspaceTable

WorkspaceTable converts a Workspace to it's reduced version.A more generalized solution is to use json marshaling toconsistently keep these two structs in sync.That would be a lot of overhead, and a more costly unit test iswritten to make sure these match up.

typeWorkspaceAgent

type WorkspaceAgent struct {IDuuid.UUID             `db:"id" json:"id"`CreatedAttime.Time             `db:"created_at" json:"created_at"`UpdatedAttime.Time             `db:"updated_at" json:"updated_at"`Namestring                `db:"name" json:"name"`FirstConnectedAtsql.NullTime          `db:"first_connected_at" json:"first_connected_at"`LastConnectedAtsql.NullTime          `db:"last_connected_at" json:"last_connected_at"`DisconnectedAtsql.NullTime          `db:"disconnected_at" json:"disconnected_at"`ResourceIDuuid.UUID             `db:"resource_id" json:"resource_id"`AuthTokenuuid.UUID             `db:"auth_token" json:"auth_token"`AuthInstanceIDsql.NullString        `db:"auth_instance_id" json:"auth_instance_id"`Architecturestring                `db:"architecture" json:"architecture"`EnvironmentVariablespqtype.NullRawMessage `db:"environment_variables" json:"environment_variables"`OperatingSystemstring                `db:"operating_system" json:"operating_system"`InstanceMetadatapqtype.NullRawMessage `db:"instance_metadata" json:"instance_metadata"`ResourceMetadatapqtype.NullRawMessage `db:"resource_metadata" json:"resource_metadata"`Directorystring                `db:"directory" json:"directory"`// Version tracks the version of the currently running workspace agent. Workspace agents register their version upon start.Versionstring        `db:"version" json:"version"`LastConnectedReplicaIDuuid.NullUUID `db:"last_connected_replica_id" json:"last_connected_replica_id"`// Connection timeout in seconds, 0 means disabled.ConnectionTimeoutSecondsint32 `db:"connection_timeout_seconds" json:"connection_timeout_seconds"`// URL for troubleshooting the agent.TroubleshootingURLstring `db:"troubleshooting_url" json:"troubleshooting_url"`// Path to file inside workspace containing the message of the day (MOTD) to show to the user when logging in via SSH.MOTDFilestring `db:"motd_file" json:"motd_file"`// The current lifecycle state reported by the workspace agent.LifecycleStateWorkspaceAgentLifecycleState `db:"lifecycle_state" json:"lifecycle_state"`// The resolved path of a user-specified directory. e.g. ~/coder -> /home/coder/coderExpandedDirectorystring `db:"expanded_directory" json:"expanded_directory"`// Total length of startup logsLogsLengthint32 `db:"logs_length" json:"logs_length"`// Whether the startup logs overflowed in lengthLogsOverflowedbool `db:"logs_overflowed" json:"logs_overflowed"`// The time the agent entered the starting lifecycle stateStartedAtsql.NullTime `db:"started_at" json:"started_at"`// The time the agent entered the ready or start_error lifecycle stateReadyAtsql.NullTime              `db:"ready_at" json:"ready_at"`Subsystems  []WorkspaceAgentSubsystem `db:"subsystems" json:"subsystems"`DisplayApps []DisplayApp              `db:"display_apps" json:"display_apps"`APIVersionstring                    `db:"api_version" json:"api_version"`// Specifies the order in which to display agents in user interfaces.DisplayOrderint32         `db:"display_order" json:"display_order"`ParentIDuuid.NullUUID `db:"parent_id" json:"parent_id"`// Defines the scope of the API key associated with the agent. 'all' allows access to everything, 'no_user_data' restricts it to exclude user data.APIKeyScopeAgentKeyScopeEnum `db:"api_key_scope" json:"api_key_scope"`}

func (WorkspaceAgent)Status

typeWorkspaceAgentConnectionStatus

type WorkspaceAgentConnectionStatus struct {StatusWorkspaceAgentStatus `json:"status"`FirstConnectedAt *time.Time           `json:"first_connected_at"`LastConnectedAt  *time.Time           `json:"last_connected_at"`DisconnectedAt   *time.Time           `json:"disconnected_at"`}

typeWorkspaceAgentDevcontaineradded inv2.21.0

type WorkspaceAgentDevcontainer struct {// Unique identifierIDuuid.UUID `db:"id" json:"id"`// Workspace agent foreign keyWorkspaceAgentIDuuid.UUID `db:"workspace_agent_id" json:"workspace_agent_id"`// Creation timestampCreatedAttime.Time `db:"created_at" json:"created_at"`// Workspace folderWorkspaceFolderstring `db:"workspace_folder" json:"workspace_folder"`// Path to devcontainer.json.ConfigPathstring `db:"config_path" json:"config_path"`// The name of the Dev Container.Namestring `db:"name" json:"name"`}

Workspace agent devcontainer configuration

typeWorkspaceAgentLifecycleState

type WorkspaceAgentLifecycleStatestring
const (WorkspaceAgentLifecycleStateCreatedWorkspaceAgentLifecycleState = "created"WorkspaceAgentLifecycleStateStartingWorkspaceAgentLifecycleState = "starting"WorkspaceAgentLifecycleStateStartTimeoutWorkspaceAgentLifecycleState = "start_timeout"WorkspaceAgentLifecycleStateStartErrorWorkspaceAgentLifecycleState = "start_error"WorkspaceAgentLifecycleStateReadyWorkspaceAgentLifecycleState = "ready"WorkspaceAgentLifecycleStateShuttingDownWorkspaceAgentLifecycleState = "shutting_down"WorkspaceAgentLifecycleStateShutdownTimeoutWorkspaceAgentLifecycleState = "shutdown_timeout"WorkspaceAgentLifecycleStateShutdownErrorWorkspaceAgentLifecycleState = "shutdown_error"WorkspaceAgentLifecycleStateOffWorkspaceAgentLifecycleState = "off")

funcAllWorkspaceAgentLifecycleStateValues

func AllWorkspaceAgentLifecycleStateValues() []WorkspaceAgentLifecycleState

func (*WorkspaceAgentLifecycleState)Scan

func (e *WorkspaceAgentLifecycleState) Scan(src interface{})error

func (WorkspaceAgentLifecycleState)Valid

typeWorkspaceAgentLog

type WorkspaceAgentLog struct {AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`Outputstring    `db:"output" json:"output"`IDint64     `db:"id" json:"id"`LevelLogLevel  `db:"level" json:"level"`LogSourceIDuuid.UUID `db:"log_source_id" json:"log_source_id"`}

typeWorkspaceAgentLogSource

type WorkspaceAgentLogSource struct {WorkspaceAgentIDuuid.UUID `db:"workspace_agent_id" json:"workspace_agent_id"`IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`DisplayNamestring    `db:"display_name" json:"display_name"`Iconstring    `db:"icon" json:"icon"`}

typeWorkspaceAgentMemoryResourceMonitoradded inv2.20.0

type WorkspaceAgentMemoryResourceMonitor struct {AgentIDuuid.UUID                  `db:"agent_id" json:"agent_id"`Enabledbool                       `db:"enabled" json:"enabled"`Thresholdint32                      `db:"threshold" json:"threshold"`CreatedAttime.Time                  `db:"created_at" json:"created_at"`UpdatedAttime.Time                  `db:"updated_at" json:"updated_at"`StateWorkspaceAgentMonitorState `db:"state" json:"state"`DebouncedUntiltime.Time                  `db:"debounced_until" json:"debounced_until"`}

func (WorkspaceAgentMemoryResourceMonitor)Debounceadded inv2.20.0

typeWorkspaceAgentMetadatum

type WorkspaceAgentMetadatum struct {WorkspaceAgentIDuuid.UUID `db:"workspace_agent_id" json:"workspace_agent_id"`DisplayNamestring    `db:"display_name" json:"display_name"`Keystring    `db:"key" json:"key"`Scriptstring    `db:"script" json:"script"`Valuestring    `db:"value" json:"value"`Errorstring    `db:"error" json:"error"`Timeoutint64     `db:"timeout" json:"timeout"`Intervalint64     `db:"interval" json:"interval"`CollectedAttime.Time `db:"collected_at" json:"collected_at"`// Specifies the order in which to display agent metadata in user interfaces.DisplayOrderint32 `db:"display_order" json:"display_order"`}

typeWorkspaceAgentMonitorStateadded inv2.20.0

type WorkspaceAgentMonitorStatestring
const (WorkspaceAgentMonitorStateOKWorkspaceAgentMonitorState = "OK"WorkspaceAgentMonitorStateNOKWorkspaceAgentMonitorState = "NOK")

funcAllWorkspaceAgentMonitorStateValuesadded inv2.20.0

func AllWorkspaceAgentMonitorStateValues() []WorkspaceAgentMonitorState

func (*WorkspaceAgentMonitorState)Scanadded inv2.20.0

func (e *WorkspaceAgentMonitorState) Scan(src interface{})error

func (WorkspaceAgentMonitorState)Validadded inv2.20.0

typeWorkspaceAgentPortShareadded inv2.9.0

type WorkspaceAgentPortShare struct {WorkspaceIDuuid.UUID         `db:"workspace_id" json:"workspace_id"`AgentNamestring            `db:"agent_name" json:"agent_name"`Portint32             `db:"port" json:"port"`ShareLevelAppSharingLevel   `db:"share_level" json:"share_level"`ProtocolPortShareProtocol `db:"protocol" json:"protocol"`}

typeWorkspaceAgentScriptadded inv2.2.0

type WorkspaceAgentScript struct {WorkspaceAgentIDuuid.UUID `db:"workspace_agent_id" json:"workspace_agent_id"`LogSourceIDuuid.UUID `db:"log_source_id" json:"log_source_id"`LogPathstring    `db:"log_path" json:"log_path"`CreatedAttime.Time `db:"created_at" json:"created_at"`Scriptstring    `db:"script" json:"script"`Cronstring    `db:"cron" json:"cron"`StartBlocksLoginbool      `db:"start_blocks_login" json:"start_blocks_login"`RunOnStartbool      `db:"run_on_start" json:"run_on_start"`RunOnStopbool      `db:"run_on_stop" json:"run_on_stop"`TimeoutSecondsint32     `db:"timeout_seconds" json:"timeout_seconds"`DisplayNamestring    `db:"display_name" json:"display_name"`IDuuid.UUID `db:"id" json:"id"`}

typeWorkspaceAgentScriptTimingadded inv2.16.0

type WorkspaceAgentScriptTiming struct {ScriptIDuuid.UUID                        `db:"script_id" json:"script_id"`StartedAttime.Time                        `db:"started_at" json:"started_at"`EndedAttime.Time                        `db:"ended_at" json:"ended_at"`ExitCodeint32                            `db:"exit_code" json:"exit_code"`StageWorkspaceAgentScriptTimingStage  `db:"stage" json:"stage"`StatusWorkspaceAgentScriptTimingStatus `db:"status" json:"status"`}

typeWorkspaceAgentScriptTimingStageadded inv2.16.0

type WorkspaceAgentScriptTimingStagestring

What stage the script was ran in.

const (WorkspaceAgentScriptTimingStageStartWorkspaceAgentScriptTimingStage = "start"WorkspaceAgentScriptTimingStageStopWorkspaceAgentScriptTimingStage = "stop"WorkspaceAgentScriptTimingStageCronWorkspaceAgentScriptTimingStage = "cron")

funcAllWorkspaceAgentScriptTimingStageValuesadded inv2.16.0

func AllWorkspaceAgentScriptTimingStageValues() []WorkspaceAgentScriptTimingStage

func (*WorkspaceAgentScriptTimingStage)Scanadded inv2.16.0

func (e *WorkspaceAgentScriptTimingStage) Scan(src interface{})error

func (WorkspaceAgentScriptTimingStage)Validadded inv2.16.0

typeWorkspaceAgentScriptTimingStatusadded inv2.16.0

type WorkspaceAgentScriptTimingStatusstring

What the exit status of the script is.

const (WorkspaceAgentScriptTimingStatusOkWorkspaceAgentScriptTimingStatus = "ok"WorkspaceAgentScriptTimingStatusExitFailureWorkspaceAgentScriptTimingStatus = "exit_failure"WorkspaceAgentScriptTimingStatusTimedOutWorkspaceAgentScriptTimingStatus = "timed_out"WorkspaceAgentScriptTimingStatusPipesLeftOpenWorkspaceAgentScriptTimingStatus = "pipes_left_open")

funcAllWorkspaceAgentScriptTimingStatusValuesadded inv2.16.0

func AllWorkspaceAgentScriptTimingStatusValues() []WorkspaceAgentScriptTimingStatus

func (*WorkspaceAgentScriptTimingStatus)Scanadded inv2.16.0

func (e *WorkspaceAgentScriptTimingStatus) Scan(src interface{})error

func (WorkspaceAgentScriptTimingStatus)Validadded inv2.16.0

typeWorkspaceAgentStat

type WorkspaceAgentStat struct {IDuuid.UUID       `db:"id" json:"id"`CreatedAttime.Time       `db:"created_at" json:"created_at"`UserIDuuid.UUID       `db:"user_id" json:"user_id"`AgentIDuuid.UUID       `db:"agent_id" json:"agent_id"`WorkspaceIDuuid.UUID       `db:"workspace_id" json:"workspace_id"`TemplateIDuuid.UUID       `db:"template_id" json:"template_id"`ConnectionsByProtojson.RawMessage `db:"connections_by_proto" json:"connections_by_proto"`ConnectionCountint64           `db:"connection_count" json:"connection_count"`RxPacketsint64           `db:"rx_packets" json:"rx_packets"`RxBytesint64           `db:"rx_bytes" json:"rx_bytes"`TxPacketsint64           `db:"tx_packets" json:"tx_packets"`TxBytesint64           `db:"tx_bytes" json:"tx_bytes"`ConnectionMedianLatencyMSfloat64         `db:"connection_median_latency_ms" json:"connection_median_latency_ms"`SessionCountVSCodeint64           `db:"session_count_vscode" json:"session_count_vscode"`SessionCountJetBrainsint64           `db:"session_count_jetbrains" json:"session_count_jetbrains"`SessionCountReconnectingPTYint64           `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"`SessionCountSSHint64           `db:"session_count_ssh" json:"session_count_ssh"`Usagebool            `db:"usage" json:"usage"`}

typeWorkspaceAgentStatus

type WorkspaceAgentStatusstring
const (WorkspaceAgentStatusConnectingWorkspaceAgentStatus = "connecting"WorkspaceAgentStatusConnectedWorkspaceAgentStatus = "connected"WorkspaceAgentStatusDisconnectedWorkspaceAgentStatus = "disconnected"WorkspaceAgentStatusTimeoutWorkspaceAgentStatus = "timeout")

This is also in codersdk/workspaceagents.go and should be kept in sync.

func (WorkspaceAgentStatus)Valid

func (sWorkspaceAgentStatus) Valid()bool

typeWorkspaceAgentSubsystem

type WorkspaceAgentSubsystemstring
const (WorkspaceAgentSubsystemEnvbuilderWorkspaceAgentSubsystem = "envbuilder"WorkspaceAgentSubsystemEnvboxWorkspaceAgentSubsystem = "envbox"WorkspaceAgentSubsystemNoneWorkspaceAgentSubsystem = "none"WorkspaceAgentSubsystemExectraceWorkspaceAgentSubsystem = "exectrace")

funcAllWorkspaceAgentSubsystemValues

func AllWorkspaceAgentSubsystemValues() []WorkspaceAgentSubsystem

func (*WorkspaceAgentSubsystem)Scan

func (e *WorkspaceAgentSubsystem) Scan(src interface{})error

func (WorkspaceAgentSubsystem)Valid

typeWorkspaceAgentVolumeResourceMonitoradded inv2.20.0

type WorkspaceAgentVolumeResourceMonitor struct {AgentIDuuid.UUID                  `db:"agent_id" json:"agent_id"`Enabledbool                       `db:"enabled" json:"enabled"`Thresholdint32                      `db:"threshold" json:"threshold"`Pathstring                     `db:"path" json:"path"`CreatedAttime.Time                  `db:"created_at" json:"created_at"`UpdatedAttime.Time                  `db:"updated_at" json:"updated_at"`StateWorkspaceAgentMonitorState `db:"state" json:"state"`DebouncedUntiltime.Time                  `db:"debounced_until" json:"debounced_until"`}

func (WorkspaceAgentVolumeResourceMonitor)Debounceadded inv2.20.0

func (mWorkspaceAgentVolumeResourceMonitor) Debounce(bytime.Duration,nowtime.Time,oldState, newStateWorkspaceAgentMonitorState,) (debouncedUntiltime.Time, shouldNotifybool)

typeWorkspaceApp

type WorkspaceApp struct {IDuuid.UUID          `db:"id" json:"id"`CreatedAttime.Time          `db:"created_at" json:"created_at"`AgentIDuuid.UUID          `db:"agent_id" json:"agent_id"`DisplayNamestring             `db:"display_name" json:"display_name"`Iconstring             `db:"icon" json:"icon"`Commandsql.NullString     `db:"command" json:"command"`Urlsql.NullString     `db:"url" json:"url"`HealthcheckUrlstring             `db:"healthcheck_url" json:"healthcheck_url"`HealthcheckIntervalint32              `db:"healthcheck_interval" json:"healthcheck_interval"`HealthcheckThresholdint32              `db:"healthcheck_threshold" json:"healthcheck_threshold"`HealthWorkspaceAppHealth `db:"health" json:"health"`Subdomainbool               `db:"subdomain" json:"subdomain"`SharingLevelAppSharingLevel    `db:"sharing_level" json:"sharing_level"`Slugstring             `db:"slug" json:"slug"`Externalbool               `db:"external" json:"external"`// Specifies the order in which to display agent app in user interfaces.DisplayOrderint32 `db:"display_order" json:"display_order"`// Determines if the app is not shown in user interfaces.Hiddenbool               `db:"hidden" json:"hidden"`OpenInWorkspaceAppOpenIn `db:"open_in" json:"open_in"`DisplayGroupsql.NullString     `db:"display_group" json:"display_group"`}

typeWorkspaceAppAuditSessionadded inv2.21.0

type WorkspaceAppAuditSession struct {// The agent that the workspace app or port forward belongs to.AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`// The app that is currently in the workspace app. This is may be uuid.Nil because ports are not associated with an app.AppIDuuid.UUID `db:"app_id" json:"app_id"`// The user that is currently using the workspace app. This is may be uuid.Nil if we cannot determine the user.UserIDuuid.UUID `db:"user_id" json:"user_id"`// The IP address of the user that is currently using the workspace app.Ipstring `db:"ip" json:"ip"`// The user agent of the user that is currently using the workspace app.UserAgentstring `db:"user_agent" json:"user_agent"`// The slug or port of the workspace app that the user is currently using.SlugOrPortstring `db:"slug_or_port" json:"slug_or_port"`// The HTTP status produced by the token authorization. Defaults to 200 if no status is provided.StatusCodeint32 `db:"status_code" json:"status_code"`// The time the user started the session.StartedAttime.Time `db:"started_at" json:"started_at"`// The time the session was last updated.UpdatedAttime.Time `db:"updated_at" json:"updated_at"`IDuuid.UUID `db:"id" json:"id"`}

Audit sessions for workspace apps, the data in this table is ephemeral and is used to deduplicate audit log entries for workspace apps. While a session is active, the same data will not be logged again. This table does not store historical data.

typeWorkspaceAppHealth

type WorkspaceAppHealthstring
const (WorkspaceAppHealthDisabledWorkspaceAppHealth = "disabled"WorkspaceAppHealthInitializingWorkspaceAppHealth = "initializing"WorkspaceAppHealthHealthyWorkspaceAppHealth = "healthy"WorkspaceAppHealthUnhealthyWorkspaceAppHealth = "unhealthy")

funcAllWorkspaceAppHealthValues

func AllWorkspaceAppHealthValues() []WorkspaceAppHealth

func (*WorkspaceAppHealth)Scan

func (e *WorkspaceAppHealth) Scan(src interface{})error

func (WorkspaceAppHealth)Valid

func (eWorkspaceAppHealth) Valid()bool

typeWorkspaceAppOpenInadded inv2.19.0

type WorkspaceAppOpenInstring
const (WorkspaceAppOpenInTabWorkspaceAppOpenIn = "tab"WorkspaceAppOpenInWindowWorkspaceAppOpenIn = "window"WorkspaceAppOpenInSlimWindowWorkspaceAppOpenIn = "slim-window")

funcAllWorkspaceAppOpenInValuesadded inv2.19.0

func AllWorkspaceAppOpenInValues() []WorkspaceAppOpenIn

func (*WorkspaceAppOpenIn)Scanadded inv2.19.0

func (e *WorkspaceAppOpenIn) Scan(src interface{})error

func (WorkspaceAppOpenIn)Validadded inv2.19.0

func (eWorkspaceAppOpenIn) Valid()bool

typeWorkspaceAppStat

type WorkspaceAppStat struct {// The ID of the recordIDint64 `db:"id" json:"id"`// The user who used the workspace appUserIDuuid.UUID `db:"user_id" json:"user_id"`// The workspace that the workspace app was used inWorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`// The workspace agent that was usedAgentIDuuid.UUID `db:"agent_id" json:"agent_id"`// The method used to access the workspace appAccessMethodstring `db:"access_method" json:"access_method"`// The slug or port used to to identify the appSlugOrPortstring `db:"slug_or_port" json:"slug_or_port"`// The unique identifier for the sessionSessionIDuuid.UUID `db:"session_id" json:"session_id"`// The time the session startedSessionStartedAttime.Time `db:"session_started_at" json:"session_started_at"`// The time the session endedSessionEndedAttime.Time `db:"session_ended_at" json:"session_ended_at"`// The number of requests made during the session, a number larger than 1 indicates that multiple sessions were rolled up into oneRequestsint32 `db:"requests" json:"requests"`}

A record of workspace app usage statistics

typeWorkspaceAppStatusadded inv2.21.0

type WorkspaceAppStatus struct {IDuuid.UUID               `db:"id" json:"id"`CreatedAttime.Time               `db:"created_at" json:"created_at"`AgentIDuuid.UUID               `db:"agent_id" json:"agent_id"`AppIDuuid.UUID               `db:"app_id" json:"app_id"`WorkspaceIDuuid.UUID               `db:"workspace_id" json:"workspace_id"`StateWorkspaceAppStatusState `db:"state" json:"state"`Messagestring                  `db:"message" json:"message"`Urisql.NullString          `db:"uri" json:"uri"`}

typeWorkspaceAppStatusStateadded inv2.21.0

type WorkspaceAppStatusStatestring
const (WorkspaceAppStatusStateWorkingWorkspaceAppStatusState = "working"WorkspaceAppStatusStateCompleteWorkspaceAppStatusState = "complete"WorkspaceAppStatusStateFailureWorkspaceAppStatusState = "failure")

funcAllWorkspaceAppStatusStateValuesadded inv2.21.0

func AllWorkspaceAppStatusStateValues() []WorkspaceAppStatusState

func (*WorkspaceAppStatusState)Scanadded inv2.21.0

func (e *WorkspaceAppStatusState) Scan(src interface{})error

func (WorkspaceAppStatusState)Validadded inv2.21.0

typeWorkspaceBuild

type WorkspaceBuild struct {IDuuid.UUID           `db:"id" json:"id"`CreatedAttime.Time           `db:"created_at" json:"created_at"`UpdatedAttime.Time           `db:"updated_at" json:"updated_at"`WorkspaceIDuuid.UUID           `db:"workspace_id" json:"workspace_id"`TemplateVersionIDuuid.UUID           `db:"template_version_id" json:"template_version_id"`BuildNumberint32               `db:"build_number" json:"build_number"`TransitionWorkspaceTransition `db:"transition" json:"transition"`InitiatorIDuuid.UUID           `db:"initiator_id" json:"initiator_id"`ProvisionerState        []byte              `db:"provisioner_state" json:"provisioner_state"`JobIDuuid.UUID           `db:"job_id" json:"job_id"`Deadlinetime.Time           `db:"deadline" json:"deadline"`ReasonBuildReason         `db:"reason" json:"reason"`DailyCostint32               `db:"daily_cost" json:"daily_cost"`MaxDeadlinetime.Time           `db:"max_deadline" json:"max_deadline"`TemplateVersionPresetIDuuid.NullUUID       `db:"template_version_preset_id" json:"template_version_preset_id"`InitiatorByAvatarUrlstring              `db:"initiator_by_avatar_url" json:"initiator_by_avatar_url"`InitiatorByUsernamestring              `db:"initiator_by_username" json:"initiator_by_username"`InitiatorByNamestring              `db:"initiator_by_name" json:"initiator_by_name"`}

Joins in the username + avatar url of the initiated by user.

typeWorkspaceBuildParameter

type WorkspaceBuildParameter struct {WorkspaceBuildIDuuid.UUID `db:"workspace_build_id" json:"workspace_build_id"`// Parameter nameNamestring `db:"name" json:"name"`// Parameter valueValuestring `db:"value" json:"value"`}

typeWorkspaceBuildTable

type WorkspaceBuildTable struct {IDuuid.UUID           `db:"id" json:"id"`CreatedAttime.Time           `db:"created_at" json:"created_at"`UpdatedAttime.Time           `db:"updated_at" json:"updated_at"`WorkspaceIDuuid.UUID           `db:"workspace_id" json:"workspace_id"`TemplateVersionIDuuid.UUID           `db:"template_version_id" json:"template_version_id"`BuildNumberint32               `db:"build_number" json:"build_number"`TransitionWorkspaceTransition `db:"transition" json:"transition"`InitiatorIDuuid.UUID           `db:"initiator_id" json:"initiator_id"`ProvisionerState        []byte              `db:"provisioner_state" json:"provisioner_state"`JobIDuuid.UUID           `db:"job_id" json:"job_id"`Deadlinetime.Time           `db:"deadline" json:"deadline"`ReasonBuildReason         `db:"reason" json:"reason"`DailyCostint32               `db:"daily_cost" json:"daily_cost"`MaxDeadlinetime.Time           `db:"max_deadline" json:"max_deadline"`TemplateVersionPresetIDuuid.NullUUID       `db:"template_version_preset_id" json:"template_version_preset_id"`}

typeWorkspaceLatestBuildadded inv2.22.0

type WorkspaceLatestBuild struct {IDuuid.UUID            `db:"id" json:"id"`WorkspaceIDuuid.UUID            `db:"workspace_id" json:"workspace_id"`TemplateVersionIDuuid.UUID            `db:"template_version_id" json:"template_version_id"`JobIDuuid.UUID            `db:"job_id" json:"job_id"`TemplateVersionPresetIDuuid.NullUUID        `db:"template_version_preset_id" json:"template_version_preset_id"`TransitionWorkspaceTransition  `db:"transition" json:"transition"`CreatedAttime.Time            `db:"created_at" json:"created_at"`JobStatusProvisionerJobStatus `db:"job_status" json:"job_status"`}

typeWorkspaceModuleadded inv2.18.0

type WorkspaceModule struct {IDuuid.UUID           `db:"id" json:"id"`JobIDuuid.UUID           `db:"job_id" json:"job_id"`TransitionWorkspaceTransition `db:"transition" json:"transition"`Sourcestring              `db:"source" json:"source"`Versionstring              `db:"version" json:"version"`Keystring              `db:"key" json:"key"`CreatedAttime.Time           `db:"created_at" json:"created_at"`}

typeWorkspacePrebuildadded inv2.22.0

type WorkspacePrebuild struct {IDuuid.UUID     `db:"id" json:"id"`Namestring        `db:"name" json:"name"`TemplateIDuuid.UUID     `db:"template_id" json:"template_id"`CreatedAttime.Time     `db:"created_at" json:"created_at"`Readybool          `db:"ready" json:"ready"`CurrentPresetIDuuid.NullUUID `db:"current_preset_id" json:"current_preset_id"`}

typeWorkspacePrebuildBuildadded inv2.22.0

type WorkspacePrebuildBuild struct {IDuuid.UUID           `db:"id" json:"id"`WorkspaceIDuuid.UUID           `db:"workspace_id" json:"workspace_id"`TemplateVersionIDuuid.UUID           `db:"template_version_id" json:"template_version_id"`TransitionWorkspaceTransition `db:"transition" json:"transition"`JobIDuuid.UUID           `db:"job_id" json:"job_id"`TemplateVersionPresetIDuuid.NullUUID       `db:"template_version_preset_id" json:"template_version_preset_id"`BuildNumberint32               `db:"build_number" json:"build_number"`}

typeWorkspaceProxy

type WorkspaceProxy struct {IDuuid.UUID `db:"id" json:"id"`Namestring    `db:"name" json:"name"`DisplayNamestring    `db:"display_name" json:"display_name"`// Expects an emoji character. (/emojis/1f1fa-1f1f8.png)Iconstring `db:"icon" json:"icon"`// Full url including scheme of the proxy api url:https://us.example.comUrlstring `db:"url" json:"url"`// Hostname with the wildcard for subdomain based app hosting: *.us.example.comWildcardHostnamestring    `db:"wildcard_hostname" json:"wildcard_hostname"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`// Boolean indicator of a deleted workspace proxy. Proxies are soft-deleted.Deletedbool `db:"deleted" json:"deleted"`// Hashed secret is used to authenticate the workspace proxy using a session token.TokenHashedSecret []byte `db:"token_hashed_secret" json:"token_hashed_secret"`RegionIDint32  `db:"region_id" json:"region_id"`DerpEnabledbool   `db:"derp_enabled" json:"derp_enabled"`// Disables app/terminal proxying for this proxy and only acts as a DERP relay.DerpOnlybool   `db:"derp_only" json:"derp_only"`Versionstring `db:"version" json:"version"`}

func (WorkspaceProxy)IsPrimary

func (wWorkspaceProxy) IsPrimary()bool

func (WorkspaceProxy)RBACObject

func (wWorkspaceProxy) RBACObject()rbac.Object

typeWorkspaceResource

type WorkspaceResource struct {IDuuid.UUID           `db:"id" json:"id"`CreatedAttime.Time           `db:"created_at" json:"created_at"`JobIDuuid.UUID           `db:"job_id" json:"job_id"`TransitionWorkspaceTransition `db:"transition" json:"transition"`Typestring              `db:"type" json:"type"`Namestring              `db:"name" json:"name"`Hidebool                `db:"hide" json:"hide"`Iconstring              `db:"icon" json:"icon"`InstanceTypesql.NullString      `db:"instance_type" json:"instance_type"`DailyCostint32               `db:"daily_cost" json:"daily_cost"`ModulePathsql.NullString      `db:"module_path" json:"module_path"`}

typeWorkspaceResourceMetadatum

type WorkspaceResourceMetadatum struct {WorkspaceResourceIDuuid.UUID      `db:"workspace_resource_id" json:"workspace_resource_id"`Keystring         `db:"key" json:"key"`Valuesql.NullString `db:"value" json:"value"`Sensitivebool           `db:"sensitive" json:"sensitive"`IDint64          `db:"id" json:"id"`}

typeWorkspaceStatus

type WorkspaceStatusstring
const (WorkspaceStatusPendingWorkspaceStatus = "pending"WorkspaceStatusStartingWorkspaceStatus = "starting"WorkspaceStatusRunningWorkspaceStatus = "running"WorkspaceStatusStoppingWorkspaceStatus = "stopping"WorkspaceStatusStoppedWorkspaceStatus = "stopped"WorkspaceStatusFailedWorkspaceStatus = "failed"WorkspaceStatusCancelingWorkspaceStatus = "canceling"WorkspaceStatusCanceledWorkspaceStatus = "canceled"WorkspaceStatusDeletingWorkspaceStatus = "deleting"WorkspaceStatusDeletedWorkspaceStatus = "deleted")

func (WorkspaceStatus)Valid

func (sWorkspaceStatus) Valid()bool

typeWorkspaceTableadded inv2.17.0

type WorkspaceTable struct {IDuuid.UUID        `db:"id" json:"id"`CreatedAttime.Time        `db:"created_at" json:"created_at"`UpdatedAttime.Time        `db:"updated_at" json:"updated_at"`OwnerIDuuid.UUID        `db:"owner_id" json:"owner_id"`OrganizationIDuuid.UUID        `db:"organization_id" json:"organization_id"`TemplateIDuuid.UUID        `db:"template_id" json:"template_id"`Deletedbool             `db:"deleted" json:"deleted"`Namestring           `db:"name" json:"name"`AutostartSchedulesql.NullString   `db:"autostart_schedule" json:"autostart_schedule"`Ttlsql.NullInt64    `db:"ttl" json:"ttl"`LastUsedAttime.Time        `db:"last_used_at" json:"last_used_at"`DormantAtsql.NullTime     `db:"dormant_at" json:"dormant_at"`DeletingAtsql.NullTime     `db:"deleting_at" json:"deleting_at"`AutomaticUpdatesAutomaticUpdates `db:"automatic_updates" json:"automatic_updates"`// Favorite is true if the workspace owner has favorited the workspace.Favoritebool         `db:"favorite" json:"favorite"`NextStartAtsql.NullTime `db:"next_start_at" json:"next_start_at"`}

func (WorkspaceTable)DormantRBACadded inv2.17.0

func (wWorkspaceTable) DormantRBAC()rbac.Object

func (WorkspaceTable)RBACObjectadded inv2.17.0

func (wWorkspaceTable) RBACObject()rbac.Object

typeWorkspaceTransition

type WorkspaceTransitionstring
const (WorkspaceTransitionStartWorkspaceTransition = "start"WorkspaceTransitionStopWorkspaceTransition = "stop"WorkspaceTransitionDeleteWorkspaceTransition = "delete")

funcAllWorkspaceTransitionValues

func AllWorkspaceTransitionValues() []WorkspaceTransition

func (*WorkspaceTransition)Scan

func (e *WorkspaceTransition) Scan(src interface{})error

func (WorkspaceTransition)Valid

func (eWorkspaceTransition) Valid()bool

Source Files

View all Source files

Directories

PathSynopsis
Package db2sdk provides common conversion routines from database types to codersdk types
Package db2sdk provides common conversion routines from database types to codersdk types
Package dbauthz provides an authorization layer on top of the database.
Package dbauthz provides an authorization layer on top of the database.
Code generated by coderd/database/gen/metrics.
Code generated by coderd/database/gen/metrics.
Package dbmock is a generated GoMock package.
Package dbmock is a generated GoMock package.
gen
Package gentest contains tests that are run at db generate time.
Package gentest contains tests that are run at db generate time.
psmock
package psmock contains a mocked implementation of the pubsub.Pubsub interface for use in tests
package psmock contains a mocked implementation of the pubsub.Pubsub interface for use in tests

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp