Movatterモバイル変換


[0]ホーム

URL:


codersdk

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:53Imported by:9

Details

Repository

github.com/coder/coder

Links

Documentation

Overview

Code generated by typegen/main.go. DO NOT EDIT.

Index

Constants

View Source
const (// SessionTokenCookie represents the name of the cookie or query parameter the API key is stored in.SessionTokenCookie = "coder_session_token"// SessionTokenHeader is the custom header to use for authentication.SessionTokenHeader = "Coder-Session-Token"// OAuth2StateCookie is the name of the cookie that stores the oauth2 state.OAuth2StateCookie = "oauth_state"// OAuth2RedirectCookie is the name of the cookie that stores the oauth2 redirect.OAuth2RedirectCookie = "oauth_redirect"// PathAppSessionTokenCookie is the name of the cookie that stores an// application-scoped API token on workspace proxy path app domains.//nolint:gosecPathAppSessionTokenCookie = "coder_path_app_session_token"// SubdomainAppSessionTokenCookie is the name of the cookie that stores an// application-scoped API token on subdomain app domains (both the primary// and proxies).//nolint:gosecSubdomainAppSessionTokenCookie = "coder_subdomain_app_session_token"// SignedAppTokenCookie is the name of the cookie that stores a temporary// JWT that can be used to authenticate instead of the app session token.//nolint:gosecSignedAppTokenCookie = "coder_signed_app_token"// SignedAppTokenQueryParameter is the name of the query parameter that// stores a temporary JWT that can be used to authenticate instead of the// session token. This is only acceptable on reconnecting-pty requests, not// apps.//// It has a random suffix to avoid conflict with user query parameters on// apps.//nolint:gosecSignedAppTokenQueryParameter = "coder_signed_app_token_23db1dde"// BypassRatelimitHeader is the custom header to use to bypass ratelimits.// Only owners can bypass rate limits. This is typically used for scale testing.// nolint: gosecBypassRatelimitHeader = "X-Coder-Bypass-Ratelimit"// CLITelemetryHeader contains a base64-encoded representation of the CLI// command that was invoked to produce the request. It is for internal use// only.CLITelemetryHeader = "Coder-CLI-Telemetry"// CoderDesktopTelemetryHeader contains a JSON-encoded representation of Desktop telemetry// fields, including device ID, OS, and Desktop version.CoderDesktopTelemetryHeader = "Coder-Desktop-Telemetry"// ProvisionerDaemonPSK contains the authentication pre-shared key for an external provisioner daemonProvisionerDaemonPSK = "Coder-Provisioner-Daemon-PSK"// ProvisionerDaemonKey contains the authentication key for an external provisioner daemonProvisionerDaemonKey = "Coder-Provisioner-Daemon-Key"// BuildVersionHeader contains build information of Coder.BuildVersionHeader = "X-Coder-Build-Version"// EntitlementsWarnings contains active warnings for the user's entitlements.EntitlementsWarningHeader = "X-Coder-Entitlements-Warning")

These cookies are Coder-specific. If a new one is added or changed, the nameshouldn't be likely to conflict with any user-application set cookies.Be sure to strip additional cookies in httpapi.StripCoderCookies!

View Source
const (ContentTypeTar = "application/x-tar"ContentTypeZip = "application/zip"FormatZip = "zip")
View Source
const (InboxNotificationFallbackIconWorkspace = "DEFAULT_ICON_WORKSPACE"InboxNotificationFallbackIconAccount   = "DEFAULT_ICON_ACCOUNT"InboxNotificationFallbackIconTemplate  = "DEFAULT_ICON_TEMPLATE"InboxNotificationFallbackIconOther     = "DEFAULT_ICON_OTHER")
View Source
const (TemplateBuiltinAppDisplayNameVSCodestring = "Visual Studio Code"TemplateBuiltinAppDisplayNameJetBrainsstring = "JetBrains"TemplateBuiltinAppDisplayNameWebTerminalstring = "Web Terminal"TemplateBuiltinAppDisplayNameSSHstring = "SSH"TemplateBuiltinAppDisplayNameSFTPstring = "SFTP")

Enums define the display name of the builtin app reported.

View Source
const (LicenseExpiryClaim                = "license_expires"LicenseTelemetryRequiredErrorText = "License requires telemetry but telemetry is disabled")
View Source
const (LogSourceProvisionerDaemonLogSource = "provisioner_daemon"LogSourceProvisionerLogSource = "provisioner"LogLevelTraceLogLevel = "trace"LogLevelDebugLogLevel = "debug"LogLevelInfoLogLevel = "info"LogLevelWarnLogLevel = "warn"LogLevelErrorLogLevel = "error")
View Source
const (ProvisionerKeyIDBuiltIn  = "00000000-0000-0000-0000-000000000001"ProvisionerKeyIDUserAuth = "00000000-0000-0000-0000-000000000002"ProvisionerKeyIDPSK      = "00000000-0000-0000-0000-000000000003")
View Source
const (ProvisionerKeyNameBuiltIn  = "built-in"ProvisionerKeyNameUserAuth = "user-auth"ProvisionerKeyNamePSK      = "psk")
View Source
const (RoleOwnerstring = "owner"RoleMemberstring = "member"RoleTemplateAdminstring = "template-admin"RoleUserAdminstring = "user-admin"RoleAuditorstring = "auditor"RoleOrganizationAdminstring = "organization-admin"RoleOrganizationMemberstring = "organization-member"RoleOrganizationAuditorstring = "organization-auditor"RoleOrganizationTemplateAdminstring = "organization-template-admin"RoleOrganizationUserAdminstring = "organization-user-admin"RoleOrganizationWorkspaceCreationBanstring = "organization-workspace-creation-ban")

Ideally this roles would be generated from the rbac/roles.go package.

View Source
const (WorkspaceAgentPortShareLevelOwnerWorkspaceAgentPortShareLevel = "owner"WorkspaceAgentPortShareLevelAuthenticatedWorkspaceAgentPortShareLevel = "authenticated"WorkspaceAgentPortShareLevelPublicWorkspaceAgentPortShareLevel = "public"WorkspaceAgentPortShareProtocolHTTPWorkspaceAgentPortShareProtocol = "http"WorkspaceAgentPortShareProtocolHTTPSWorkspaceAgentPortShareProtocol = "https")
View Source
const DatabaseNotReachable = "database not reachable"

Variables

View Source
var (ProvisionerKeyUUIDBuiltIn  =uuid.MustParse(ProvisionerKeyIDBuiltIn)ProvisionerKeyUUIDUserAuth =uuid.MustParse(ProvisionerKeyIDUserAuth)ProvisionerKeyUUIDPSK      =uuid.MustParse(ProvisionerKeyIDPSK))
View Source
var AllDaysOfWeek = []string{"monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"}
View Source
var Countries = []Country{}/* 249 elements not displayed */
View Source
var DefaultOrganization = "default"

DefaultOrganization is used as a replacement for the default organization.

View Source
var ErrDatabaseNotReachable =xerrors.New(DatabaseNotReachable)

ExperimentsSafe should include all experiments that are safe forusers to opt-in to via --experimental='*'.Experiments that are not ready for consumption by all users shouldnot be included here and will be essentially hidden.

FeatureNames must be kept in-sync with the Feature enum above.

View Source
var MapWorkspaceAppOpenIns = map[WorkspaceAppOpenIn]struct{}{WorkspaceAppOpenInSlimWindow: {},WorkspaceAppOpenInTab:        {},}
View Source
var Me = "me"

Me is used as a replacement for your own ID.

View Source
var RBACResourceActions = map[RBACResource][]RBACAction{ResourceWildcard:                      {},ResourceApiKey:                        {ActionCreate,ActionDelete,ActionRead,ActionUpdate},ResourceAssignOrgRole:                 {ActionAssign,ActionCreate,ActionDelete,ActionRead,ActionUnassign,ActionUpdate},ResourceAssignRole:                    {ActionAssign,ActionRead,ActionUnassign},ResourceAuditLog:                      {ActionCreate,ActionRead},ResourceChat:                          {ActionCreate,ActionDelete,ActionRead,ActionUpdate},ResourceCryptoKey:                     {ActionCreate,ActionDelete,ActionRead,ActionUpdate},ResourceDebugInfo:                     {ActionRead},ResourceDeploymentConfig:              {ActionRead,ActionUpdate},ResourceDeploymentStats:               {ActionRead},ResourceFile:                          {ActionCreate,ActionRead},ResourceGroup:                         {ActionCreate,ActionDelete,ActionRead,ActionUpdate},ResourceGroupMember:                   {ActionRead},ResourceIdpsyncSettings:               {ActionRead,ActionUpdate},ResourceInboxNotification:             {ActionCreate,ActionRead,ActionUpdate},ResourceLicense:                       {ActionCreate,ActionDelete,ActionRead},ResourceNotificationMessage:           {ActionCreate,ActionDelete,ActionRead,ActionUpdate},ResourceNotificationPreference:        {ActionRead,ActionUpdate},ResourceNotificationTemplate:          {ActionRead,ActionUpdate},ResourceOauth2App:                     {ActionCreate,ActionDelete,ActionRead,ActionUpdate},ResourceOauth2AppCodeToken:            {ActionCreate,ActionDelete,ActionRead},ResourceOauth2AppSecret:               {ActionCreate,ActionDelete,ActionRead,ActionUpdate},ResourceOrganization:                  {ActionCreate,ActionDelete,ActionRead,ActionUpdate},ResourceOrganizationMember:            {ActionCreate,ActionDelete,ActionRead,ActionUpdate},ResourceProvisionerDaemon:             {ActionCreate,ActionDelete,ActionRead,ActionUpdate},ResourceProvisionerJobs:               {ActionCreate,ActionRead,ActionUpdate},ResourceReplicas:                      {ActionRead},ResourceSystem:                        {ActionCreate,ActionDelete,ActionRead,ActionUpdate},ResourceTailnetCoordinator:            {ActionCreate,ActionDelete,ActionRead,ActionUpdate},ResourceTemplate:                      {ActionCreate,ActionDelete,ActionRead,ActionUpdate,ActionUse,ActionViewInsights},ResourceUser:                          {ActionCreate,ActionDelete,ActionRead,ActionReadPersonal,ActionUpdate,ActionUpdatePersonal},ResourceWebpushSubscription:           {ActionCreate,ActionDelete,ActionRead},ResourceWorkspace:                     {ActionApplicationConnect,ActionCreate,ActionCreateAgent,ActionDelete,ActionDeleteAgent,ActionRead,ActionSSH,ActionWorkspaceStart,ActionWorkspaceStop,ActionUpdate},ResourceWorkspaceAgentDevcontainers:   {ActionCreate},ResourceWorkspaceAgentResourceMonitor: {ActionCreate,ActionRead,ActionUpdate},ResourceWorkspaceDormant:              {ActionApplicationConnect,ActionCreate,ActionCreateAgent,ActionDelete,ActionDeleteAgent,ActionRead,ActionSSH,ActionWorkspaceStart,ActionWorkspaceStop,ActionUpdate},ResourceWorkspaceProxy:                {ActionCreate,ActionDelete,ActionRead,ActionUpdate},}

RBACResourceActions is the mapping of resources to which actions are valid forsaid resource type.

View Source
var (UsernameValidRegex =regexp.MustCompile("^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$"))

WorkspaceAgentLifecycleOrder is the order in which workspace agentlifecycle states are expected to be reported during the lifetime ofthe agent process. For instance, the agent can go from starting toready without reporting timeout or error, but it should not go fromready to starting. This is merely a hint for the agent process, andis not enforced by the server.

Functions

funcBitmapToWeekdays

func BitmapToWeekdays(bitmapuint8) []string

BitmapToWeekdays converts a bitmap to a list of weekdays in accordance withthe schedule package's rules (see above).

funcDefaultCacheDir

func DefaultCacheDir()string

funcDefaultDocsURLadded inv2.16.0

func DefaultDocsURL()string

funcDeploymentOptionsWithoutSecretsadded inv2.2.1

func DeploymentOptionsWithoutSecrets(setserpent.OptionSet)serpent.OptionSet

DeploymentOptionsWithoutSecrets returns a copy of the OptionSet with secret values omitted.

funcDiscoverVarsFilesadded inv2.14.0

func DiscoverVarsFiles(workDirstring) ([]string,error)

*

  • DiscoverVarsFiles function loads vars files in a predefined order:
  • 1. terraform.tfvars
  • 2. terraform.tfvars.json
  • 3. *.auto.tfvars
  • 4. *.auto.tfvars.json

funcDisplayNameValidadded inv2.16.0

func DisplayNameValid(strstring)error

DisplayNameValid returns whether the input string is a valid template display name.

funcExpectJSONMimeadded inv2.7.0

func ExpectJSONMime(res *http.Response)error

ExpectJSONMime is a helper function that will assert the content typeof the response is application/json.

funcGroupNameValidadded inv2.16.0

func GroupNameValid(strstring)error

GroupNameValid returns whether the input string is a valid group name.

funcIsConnectionError

func IsConnectionError(errerror)bool

IsConnectionError is a convenience function for checking if the source of anerror is due to a 'connection refused', 'no such host', etc.

funcIsSecretDeploymentOption

func IsSecretDeploymentOption(optserpent.Option)bool

funcIsWorkspaceProxies

func IsWorkspaceProxies(optserpent.Option)bool

IsWorkspaceProxies returns true if the cli option is used by workspace proxies.

funcJobIsMissingParameterErrorCodeadded inv2.1.5

func JobIsMissingParameterErrorCode(codeJobErrorCode)bool

JobIsMissingParameterErrorCode returns whether the error is a missing parameter error.This can indicate to consumers that they should check parameters.

funcNameValidadded inv2.16.0

func NameValid(strstring)error

NameValid returns whether the input string is a valid name.It is a generic validator for any name (user, workspace, template, role name, etc.).

funcNormalizeRealUsernameadded inv2.16.0

func NormalizeRealUsername(strstring)string

NormalizeUserRealName normalizes a user name such that it will passvalidation by UserRealNameValid. This is done to avoid blockinglittle Bobby Whitespace from using Coder.

funcParseSSHConfigOption

func ParseSSHConfigOption(optstring) (keystring, valuestring, errerror)

ParseSSHConfigOption parses a single ssh config option into it's key/value pair.

funcProvisionerTypeValidadded inv2.11.0

func ProvisionerTypeValid[TProvisionerType |string](pt T)error

ProvisionerTypeValid accepts string or ProvisionerType for easier usage.Will validate the enum is in the set.

funcReadBodyAsError

func ReadBodyAsError(res *http.Response)error

ReadBodyAsError reads the response as a codersdk.Response, andwraps it in a codersdk.Error type for easy marshaling.

This will always return an error, so only call it if the response failedyour expectations. Usually via status code checking.nolint:staticcheck

funcReservedProvisionerKeyNamesadded inv2.16.0

func ReservedProvisionerKeyNames() []string

funcServerSentEventReader

func ServerSentEventReader(ctxcontext.Context, rcio.ReadCloser) func() (*ServerSentEvent,error)

funcTemplateVersionNameValidadded inv2.16.0

func TemplateVersionNameValid(strstring)error

TemplateVersionNameValid returns whether the input string is a valid template version name.

funcTimezoneOffsetHour

func TimezoneOffsetHour(loc *time.Location)int

funcTimezoneOffsetHourWithTimeadded inv2.8.0

func TimezoneOffsetHourWithTime(nowtime.Time, loc *time.Location)int

TimezoneOffsetHourWithTime is implemented to match the javascript 'getTimezoneOffset()' function.This is the amount of time between this date evaluated in UTC and evaluated in the 'loc'The trivial case of times being on the same day is:'time.Now().UTC().Hour() - time.Now().In(loc).Hour()'

funcUserRealNameValidadded inv2.16.0

func UserRealNameValid(strstring)error

UserRealNameValid returns whether the input string is a valid real user name.

funcUsernameFromadded inv2.16.0

func UsernameFrom(strstring)string

UsernameFrom returns a best-effort username from the provided string.

It first attempts to validate the incoming string, which willbe returned if it is valid. It then will attempt to extractthe username from an email address. If no success happens duringthese steps, a random username will be returned.

funcValidateNewWorkspaceParameters

func ValidateNewWorkspaceParameters(richParameters []TemplateVersionParameter, buildParameters []WorkspaceBuildParameter)error

funcValidateWorkspaceBuildParameter

func ValidateWorkspaceBuildParameter(richParameterTemplateVersionParameter, buildParameter *WorkspaceBuildParameter, lastBuildParameter *WorkspaceBuildParameter)error

funcValidateWorkspaceBuildParameters

func ValidateWorkspaceBuildParameters(richParameters []TemplateVersionParameter, buildParameters, lastBuildParameters []WorkspaceBuildParameter)error

funcWebsocketNetConnadded inv2.9.0

func WebsocketNetConn(ctxcontext.Context, conn *websocket.Conn, msgTypewebsocket.MessageType) (context.Context,net.Conn)

WebsocketNetConn wraps websocket.NetConn and returns a context thatis tied to the parent context and the lifetime of the conn. Any errorduring read or write will cancel the context, but not close theconn. Close should be called to release context resources.

funcWeekdaysToBitmap

func WeekdaysToBitmap(days []string) (uint8,error)

WeekdaysToBitmap converts a list of weekdays to a bitmap in accordance withthe schedule package's rules. The 0th bit is Monday, ..., the 6th bit isSunday. The 7th bit is unused.

funcWorkspaceDisplayStatus

func WorkspaceDisplayStatus(jobStatusProvisionerJobStatus, transitionWorkspaceTransition)string

WorkspaceDisplayStatus computes a status to display on CLI/UI based onthe workspace transition and the status of the provisioner job.This code is in sync with how we compute the status on frontend.Ref: site/src/util/workspace.ts (getWorkspaceStatus)

Types

typeACLAvailable

type ACLAvailable struct {Users  []ReducedUser `json:"users"`Groups []Group       `json:"groups"`}

ACLAvailable is a list of users and groups that can be added to a templateACL.

typeAIConfigadded inv2.23.0

type AIConfig struct {Providers []AIProviderConfig `json:"providers,omitempty" yaml:"providers,omitempty"`}

typeAIProviderConfigadded inv2.23.0

type AIProviderConfig struct {// Type is the type of the API provider.Typestring `json:"type" yaml:"type"`// APIKey is the API key to use for the API provider.APIKeystring `json:"-" yaml:"api_key"`// Models is the list of models to use for the API provider.Models []string `json:"models" yaml:"models"`// BaseURL is the base URL to use for the API provider.BaseURLstring `json:"base_url" yaml:"base_url"`}

typeAPIKey

type APIKey struct {IDstring      `json:"id" validate:"required"`UserIDuuid.UUID   `json:"user_id" validate:"required" format:"uuid"`LastUsedtime.Time   `json:"last_used" validate:"required" format:"date-time"`ExpiresAttime.Time   `json:"expires_at" validate:"required" format:"date-time"`CreatedAttime.Time   `json:"created_at" validate:"required" format:"date-time"`UpdatedAttime.Time   `json:"updated_at" validate:"required" format:"date-time"`LoginTypeLoginType   `json:"login_type" validate:"required" enums:"password,github,oidc,token"`ScopeAPIKeyScope `json:"scope" validate:"required" enums:"all,application_connect"`TokenNamestring      `json:"token_name" validate:"required"`LifetimeSecondsint64       `json:"lifetime_seconds" validate:"required"`}

APIKey: do not ever return the HashedSecret

typeAPIKeyScope

type APIKeyScopestring
const (// APIKeyScopeAll is a scope that allows the user to do everything.APIKeyScopeAllAPIKeyScope = "all"// APIKeyScopeApplicationConnect is a scope that allows the user// to connect to applications in a workspace.APIKeyScopeApplicationConnectAPIKeyScope = "application_connect")

typeAPIKeyWithOwner

type APIKeyWithOwner struct {APIKeyUsernamestring `json:"username"`}

typeAddLicenseRequest

type AddLicenseRequest struct {Licensestring `json:"license" validate:"required"`}

typeAgentConnectionTimingadded inv2.18.0

type AgentConnectionTiming struct {StartedAttime.Time   `json:"started_at" format:"date-time"`EndedAttime.Time   `json:"ended_at" format:"date-time"`StageTimingStage `json:"stage"`WorkspaceAgentIDstring      `json:"workspace_agent_id"`WorkspaceAgentNamestring      `json:"workspace_agent_name"`}

typeAgentScriptTimingadded inv2.17.0

type AgentScriptTiming struct {StartedAttime.Time   `json:"started_at" format:"date-time"`EndedAttime.Time   `json:"ended_at" format:"date-time"`ExitCodeint32       `json:"exit_code"`StageTimingStage `json:"stage"`Statusstring      `json:"status"`DisplayNamestring      `json:"display_name"`WorkspaceAgentIDstring      `json:"workspace_agent_id"`WorkspaceAgentNamestring      `json:"workspace_agent_name"`}

typeAgentStatsReportRequest

type AgentStatsReportRequest struct{}

AgentStatsReportRequest is a WebSocket request by coderdto the agent for stats.@typescript-ignore AgentStatsReportRequest

typeAgentStatsReportResponse

type AgentStatsReportResponse struct {NumConnsint64 `json:"num_comms"`// RxBytes is the number of received bytes.RxBytesint64 `json:"rx_bytes"`// TxBytes is the number of transmitted bytes.TxBytesint64 `json:"tx_bytes"`}

AgentStatsReportResponse is returned for each reportrequest by the agent.

typeAgentSubsystem

type AgentSubsystemstring
const (AgentSubsystemEnvboxAgentSubsystem = "envbox"AgentSubsystemEnvbuilderAgentSubsystem = "envbuilder"AgentSubsystemExectraceAgentSubsystem = "exectrace")

func (AgentSubsystem)Valid

func (sAgentSubsystem) Valid()bool

typeAppHostResponse

type AppHostResponse struct {// Host is the externally accessible URL for the Coder instance.Hoststring `json:"host"`}

typeAppearanceConfig

type AppearanceConfig struct {ApplicationNamestring `json:"application_name"`LogoURLstring `json:"logo_url"`DocsURLstring `json:"docs_url"`// Deprecated: ServiceBanner has been replaced by AnnouncementBanners.ServiceBannerBannerConfig   `json:"service_banner"`AnnouncementBanners []BannerConfig `json:"announcement_banners"`SupportLinks        []LinkConfig   `json:"support_links,omitempty"`}

typeArchiveTemplateVersionsRequestadded inv2.3.0

type ArchiveTemplateVersionsRequest struct {// By default, only failed versions are archived. Set this to true// to archive all unused versions regardless of job status.Allbool `json:"all"`}

typeArchiveTemplateVersionsResponseadded inv2.3.0

type ArchiveTemplateVersionsResponse struct {TemplateIDuuid.UUID   `json:"template_id" format:"uuid"`ArchivedIDs []uuid.UUID `json:"archived_ids"`}

typeAssignableRoles

type AssignableRoles struct {Role       `table:"r,recursive_inline"`Assignablebool `json:"assignable" table:"assignable"`// BuiltIn roles are immutableBuiltInbool `json:"built_in" table:"built_in"`}

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")

func (AuditAction)Friendly

func (aAuditAction) Friendly()string

typeAuditDiff

type AuditDiff map[string]AuditDiffField

typeAuditDiffField

type AuditDiffField struct {Oldany  `json:"old,omitempty"`Newany  `json:"new,omitempty"`Secretbool `json:"secret"`}

typeAuditLog

type AuditLog struct {IDuuid.UUID    `json:"id" format:"uuid"`RequestIDuuid.UUID    `json:"request_id" format:"uuid"`Timetime.Time    `json:"time" format:"date-time"`IPnetip.Addr   `json:"ip"`UserAgentstring       `json:"user_agent"`ResourceTypeResourceType `json:"resource_type"`ResourceIDuuid.UUID    `json:"resource_id" format:"uuid"`// ResourceTarget is the name of the resource.ResourceTargetstring          `json:"resource_target"`ResourceIconstring          `json:"resource_icon"`ActionAuditAction     `json:"action"`DiffAuditDiff       `json:"diff"`StatusCodeint32           `json:"status_code"`AdditionalFieldsjson.RawMessage `json:"additional_fields" swaggertype:"object"`Descriptionstring          `json:"description"`ResourceLinkstring          `json:"resource_link"`IsDeletedbool            `json:"is_deleted"`// Deprecated: Use 'organization.id' instead.OrganizationIDuuid.UUID `json:"organization_id" format:"uuid"`Organization *MinimalOrganization `json:"organization,omitempty"`User *User `json:"user"`}

typeAuditLogResponse

type AuditLogResponse struct {AuditLogs []AuditLog `json:"audit_logs"`Countint64      `json:"count"`}

typeAuditLogsRequest

type AuditLogsRequest struct {SearchQuerystring `json:"q,omitempty"`Pagination}

typeAuthMethod

type AuthMethod struct {Enabledbool `json:"enabled"`}

typeAuthMethods

type AuthMethods struct {TermsOfServiceURLstring           `json:"terms_of_service_url,omitempty"`PasswordAuthMethod       `json:"password"`GithubGithubAuthMethod `json:"github"`OIDCOIDCAuthMethod   `json:"oidc"`}

AuthMethods contains authentication method information like whether they are enabled or not or custom text, etc.

typeAuthorizationCheck

type AuthorizationCheck struct {// Object can represent a "set" of objects, such as: all workspaces in an organization, all workspaces owned by me, and all workspaces across the entire product.// When defining an object, use the most specific language when possible to// produce the smallest set. Meaning to set as many fields on 'Object' as// you can. Example, if you want to check if you can update all workspaces// owned by 'me', try to also add an 'OrganizationID' to the settings.// Omitting the 'OrganizationID' could produce the incorrect value, as// workspaces have both `user` and `organization` owners.ObjectAuthorizationObject `json:"object"`ActionRBACAction          `json:"action" enums:"create,read,update,delete"`}

AuthorizationCheck is used to check if the currently authenticated user (or the specified user) can do a given action to a given set of objects.

@Description AuthorizationCheck is used to check if the currently authenticated user (or the specified user) can do a given action to a given set of objects.

typeAuthorizationObject

type AuthorizationObject struct {// ResourceType is the name of the resource.// `./coderd/rbac/object.go` has the list of valid resource types.ResourceTypeRBACResource `json:"resource_type"`// OwnerID (optional) adds the set constraint to all resources owned by a given user.OwnerIDstring `json:"owner_id,omitempty"`// OrganizationID (optional) adds the set constraint to all resources owned by a given organization.OrganizationIDstring `json:"organization_id,omitempty"`// ResourceID (optional) reduces the set to a singular resource. This assigns// a resource ID to the resource type, eg: a single workspace.// The rbac library will not fetch the resource from the database, so if you// are using this option, you should also set the owner ID and organization ID// if possible. Be as specific as possible using all the fields relevant.ResourceIDstring `json:"resource_id,omitempty"`// AnyOrgOwner (optional) will disregard the org_owner when checking for permissions.// This cannot be set to true if the OrganizationID is set.AnyOrgOwnerbool `json:"any_org,omitempty"`}

AuthorizationObject can represent a "set" of objects, such as: all workspaces in an organization, all workspaces owned by me,all workspaces across the entire product.

@Description AuthorizationObject can represent a "set" of objects, such as: all workspaces in an organization, all workspaces owned by me,@Description all workspaces across the entire product.

typeAuthorizationRequest

type AuthorizationRequest struct {// Checks is a map keyed with an arbitrary string to a permission check.// The key can be any string that is helpful to the caller, and allows// multiple permission checks to be run in a single request.// The key ensures that each permission check has the same key in the// response.Checks map[string]AuthorizationCheck `json:"checks"`}

AuthorizationRequest is a structure instead of a map becausego-playground/validate can only validate structs. If you attempt to passa map into `httpapi.Read`, you will get an invalid type error.

typeAuthorizationResponse

type AuthorizationResponse map[string]bool

typeAutomaticUpdatesadded inv2.3.0

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

typeAvailableExperimentsadded inv2.3.1

type AvailableExperiments struct {Safe []Experiment `json:"safe"`}

AvailableExperiments is an expandable type that returns all safe experimentsavailable to be used with a deployment.

typeBannerConfigadded inv2.12.0

type BannerConfig struct {Enabledbool   `json:"enabled"`Messagestring `json:"message,omitempty"`BackgroundColorstring `json:"background_color,omitempty"`}

typeBuildInfoResponse

type BuildInfoResponse struct {// ExternalURL references the current Coder version.// For production builds, this will link directly to a release. For development builds, this will link to a commit.ExternalURLstring `json:"external_url"`// Version returns the semantic version of the build.Versionstring `json:"version"`// DashboardURL is the URL to hit the deployment's dashboard.// For external workspace proxies, this is the coderd they are connected// to.DashboardURLstring `json:"dashboard_url"`// Telemetry is a boolean that indicates whether telemetry is enabled.Telemetrybool `json:"telemetry"`WorkspaceProxybool `json:"workspace_proxy"`// AgentAPIVersion is the current version of the Agent API (back versions// MAY still be supported).AgentAPIVersionstring `json:"agent_api_version"`// ProvisionerAPIVersion is the current version of the Provisioner APIProvisionerAPIVersionstring `json:"provisioner_api_version"`// UpgradeMessage is the message displayed to users when an outdated client// is detected.UpgradeMessagestring `json:"upgrade_message"`// DeploymentID is the unique identifier for this deployment.DeploymentIDstring `json:"deployment_id"`// WebPushPublicKey is the public key for push notifications via Web Push.WebPushPublicKeystring `json:"webpush_public_key,omitempty"`}

BuildInfoResponse contains build information for this instance of Coder.

func (BuildInfoResponse)CanonicalVersion

func (bBuildInfoResponse) CanonicalVersion()string

CanonicalVersion trims build information from the version.E.g. 'v0.7.4-devel+11573034' -> 'v0.7.4'.

typeBuildReason

type BuildReasonstring
const (// "initiator" is used when a workspace build is triggered by a user.// Combined with the initiator id/username, it indicates which user initiated the build.BuildReasonInitiatorBuildReason = "initiator"// "autostart" is used when a build to start a workspace is triggered by Autostart.// The initiator id/username in this case is the workspace owner and can be ignored.BuildReasonAutostartBuildReason = "autostart"// "autostop" is used when a build to stop a workspace is triggered by Autostop.// The initiator id/username in this case is the workspace owner and can be ignored.BuildReasonAutostopBuildReason = "autostop")

typeChangePasswordWithOneTimePasscodeRequestadded inv2.17.0

type ChangePasswordWithOneTimePasscodeRequest struct {Emailstring `json:"email" validate:"required,email" format:"email"`Passwordstring `json:"password" validate:"required"`OneTimePasscodestring `json:"one_time_passcode" validate:"required"`}

ChangePasswordWithOneTimePasscodeRequest enables callers to change their password when they've forgotten it.

typeChatadded inv2.23.0

type Chat struct {IDuuid.UUID `json:"id" format:"uuid"`CreatedAttime.Time `json:"created_at" format:"date-time"`UpdatedAttime.Time `json:"updated_at" format:"date-time"`Titlestring    `json:"title"`}

typeChatMessageadded inv2.23.0

type ChatMessage = aisdk.Message

typeClient

type Client struct {HTTPClient *http.ClientURL        *url.URL// SessionTokenHeader is an optional custom header to use for setting tokens. By// default 'Coder-Session-Token' is used.SessionTokenHeaderstring// PlainLogger may be set to log HTTP traffic in a human-readable form.// It uses the LogBodies option.PlainLoggerio.Writer// Trace can be enabled to propagate tracing spans to the Coder API.// This is useful for tracking a request end-to-end.Tracebool// DisableDirectConnections forces any connections to workspaces to go// through DERP, regardless of the BlockEndpoints setting on each// connection.DisableDirectConnectionsbool// contains filtered or unexported fields}

Client is an HTTP caller for methods to the Coder API.@typescript-ignore Client

funcNew

func New(serverURL *url.URL) *Client

New creates a Coder client for the provided URL.

func (*Client)APIKeyByID

func (c *Client) APIKeyByID(ctxcontext.Context, userIDstring, idstring) (*APIKey,error)

APIKeyByID returns the api key by id.

func (*Client)APIKeyByName

func (c *Client) APIKeyByName(ctxcontext.Context, userIDstring, namestring) (*APIKey,error)

APIKeyByName returns the api key by name.

func (*Client)AddLicense

func (c *Client) AddLicense(ctxcontext.Context, rAddLicenseRequest) (License,error)

func (*Client)AppHost

func (c *Client) AppHost(ctxcontext.Context) (AppHostResponse,error)

AppHost returns the site-wide application wildcard hostnamee.g. "*--apps.coder.com". Apps are accessible at:"<app-name>--<agent-name>--<workspace-name>--<username><app-host>", e.g."my-app--agent--workspace--username--apps.coder.com".

If the app host is not set, the response will contain an empty string.

func (*Client)Appearance

func (c *Client) Appearance(ctxcontext.Context) (AppearanceConfig,error)

Appearance returns the configuration that modifies the visualdisplay of the dashboard.

func (*Client)ArchiveTemplateVersionsadded inv2.3.0

func (c *Client) ArchiveTemplateVersions(ctxcontext.Context, templateuuid.UUID, allbool) (ArchiveTemplateVersionsResponse,error)

func (*Client)AuditLogs

AuditLogs retrieves audit logs from the given page.

func (*Client)AuthCheck

AuthCheck allows the authenticated user to check if they have the given permissionsto a set of resources.

func (*Client)AuthMethods

func (c *Client) AuthMethods(ctxcontext.Context) (AuthMethods,error)

AuthMethods returns types of authentication available to the user.

func (*Client)BuildInfo

func (c *Client) BuildInfo(ctxcontext.Context) (BuildInfoResponse,error)

BuildInfo returns build information for this instance of Coder.

func (*Client)CancelTemplateVersion

func (c *Client) CancelTemplateVersion(ctxcontext.Context, versionuuid.UUID)error

CancelTemplateVersion marks a template version job as canceled.

func (*Client)CancelTemplateVersionDryRun

func (c *Client) CancelTemplateVersionDryRun(ctxcontext.Context, version, jobuuid.UUID)error

CancelTemplateVersionDryRun marks a template version dry-run job as canceled.

func (*Client)CancelWorkspaceBuild

func (c *Client) CancelWorkspaceBuild(ctxcontext.Context, iduuid.UUID)error

CancelWorkspaceBuild marks a workspace build job as canceled.

func (*Client)ChangePasswordWithOneTimePasscodeadded inv2.17.0

func (c *Client) ChangePasswordWithOneTimePasscode(ctxcontext.Context, reqChangePasswordWithOneTimePasscodeRequest)error

func (*Client)Chatadded inv2.23.0

func (c *Client) Chat(ctxcontext.Context, iduuid.UUID) (Chat,error)

Chat returns a chat by ID.

func (*Client)ChatMessagesadded inv2.23.0

func (c *Client) ChatMessages(ctxcontext.Context, iduuid.UUID) ([]ChatMessage,error)

ChatMessages returns the messages of a chat.

func (*Client)ConvertLoginType

ConvertLoginType will send a request to convert the user from passwordbased authentication to oauth based. The response has the oauth state codeto use in the oauth flow.

func (*Client)ConvertUserLoginTypeadded inv2.23.0

func (c *Client) ConvertUserLoginType(ctxcontext.Context, userstring, reqConvertLoginRequest) (OAuthConversionResponse,error)

ConvertUserLoginType will send a request to convert the user from passwordbased authentication to oauth based. The response has the oauth state codeto use in the oauth flow.

func (*Client)CreateAPIKey

func (c *Client) CreateAPIKey(ctxcontext.Context, userstring) (GenerateAPIKeyResponse,error)

CreateAPIKey generates an API key for the user ID provided.CreateToken should be used over CreateAPIKey. CreateToken allows bettertracking of the token's usage and allows for custom expiration.Only use CreateAPIKey if you want to emulate the session created fora browser like login.

func (*Client)CreateChatadded inv2.23.0

func (c *Client) CreateChat(ctxcontext.Context) (Chat,error)

CreateChat creates a new chat.

func (*Client)CreateChatMessageadded inv2.23.0

func (c *Client) CreateChatMessage(ctxcontext.Context, iduuid.UUID, reqCreateChatMessageRequest) (<-chan aisdk.DataStreamPart,error)

CreateChatMessage creates a new chat message and streams the response.If the provided message has a conflicting ID with an existing message,it will be overwritten.

func (*Client)CreateFirstUser

CreateFirstUser attempts to create the first user on a Coder deployment.This initial user has superadmin privileges. If >0 users exist, this request will fail.

func (*Client)CreateGroup

func (c *Client) CreateGroup(ctxcontext.Context, orgIDuuid.UUID, reqCreateGroupRequest) (Group,error)

func (*Client)CreateOrganization

func (c *Client) CreateOrganization(ctxcontext.Context, reqCreateOrganizationRequest) (Organization,error)

CreateOrganization creates an organization and adds the user making the request as an owner.

func (*Client)CreateOrganizationRoleadded inv2.15.0

func (c *Client) CreateOrganizationRole(ctxcontext.Context, roleRole) (Role,error)

CreateOrganizationRole will create a custom organization role

func (*Client)CreateProvisionerKeyadded inv2.14.0

func (c *Client) CreateProvisionerKey(ctxcontext.Context, organizationIDuuid.UUID, reqCreateProvisionerKeyRequest) (CreateProvisionerKeyResponse,error)

CreateProvisionerKey creates a new provisioner key for an organization.

func (*Client)CreateTemplate

func (c *Client) CreateTemplate(ctxcontext.Context, organizationIDuuid.UUID, requestCreateTemplateRequest) (Template,error)

CreateTemplate creates a new template inside an organization.

func (*Client)CreateTemplateVersion

func (c *Client) CreateTemplateVersion(ctxcontext.Context, organizationIDuuid.UUID, reqCreateTemplateVersionRequest) (TemplateVersion,error)

CreateTemplateVersion processes source-code and optionally associates the version with a template.Executing without a template is useful for validating source-code.

func (*Client)CreateTemplateVersionDryRun

func (c *Client) CreateTemplateVersionDryRun(ctxcontext.Context, versionuuid.UUID, reqCreateTemplateVersionDryRunRequest) (ProvisionerJob,error)

CreateTemplateVersionDryRun begins a dry-run provisioner job against thegiven template version with the given parameter values.

func (*Client)CreateTestAuditLog

func (c *Client) CreateTestAuditLog(ctxcontext.Context, reqCreateTestAuditLogRequest)error

CreateTestAuditLog creates a fake audit log. Only owners of the organizationcan perform this action. It's used for testing purposes.

func (*Client)CreateToken

CreateToken generates an API key for the user ID provided withcustom expiration. These tokens can be used for long-lived access,like for use with CI.

func (*Client)CreateUser

func (c *Client) CreateUser(ctxcontext.Context, reqCreateUserRequest) (User,error)

CreateUserDeprecated: Use CreateUserWithOrgs instead. This will be removed.TODO: When removing, we should rename CreateUserWithOrgs -> CreateUserwith an alias of CreateUserWithOrgs.

func (*Client)CreateUserWithOrgsadded inv2.15.0

func (c *Client) CreateUserWithOrgs(ctxcontext.Context, reqCreateUserRequestWithOrgs) (User,error)

CreateUserWithOrgs creates a new user.

func (*Client)CreateUserWorkspaceadded inv2.14.0

func (c *Client) CreateUserWorkspace(ctxcontext.Context, userstring, requestCreateWorkspaceRequest) (Workspace,error)

CreateUserWorkspace creates a new workspace for the template specified.

func (*Client)CreateWorkspacedeprecated

func (c *Client) CreateWorkspace(ctxcontext.Context, _uuid.UUID, userstring, requestCreateWorkspaceRequest) (Workspace,error)

CreateWorkspace creates a new workspace for the template specified.

Deprecated: Use CreateUserWorkspace instead.

func (*Client)CreateWorkspaceBuild

func (c *Client) CreateWorkspaceBuild(ctxcontext.Context, workspaceuuid.UUID, requestCreateWorkspaceBuildRequest) (WorkspaceBuild,error)

CreateWorkspaceBuild queues a new build to occur for a workspace.

func (*Client)DeleteAPIKey

func (c *Client) DeleteAPIKey(ctxcontext.Context, userIDstring, idstring)error

DeleteAPIKey deletes API key by id.

func (*Client)DeleteChatadded inv2.23.0

func (c *Client) DeleteChat(ctxcontext.Context, iduuid.UUID)error

func (*Client)DeleteGroup

func (c *Client) DeleteGroup(ctxcontext.Context, groupuuid.UUID)error

func (*Client)DeleteLicense

func (c *Client) DeleteLicense(ctxcontext.Context, idint32)error

func (*Client)DeleteOAuth2ProviderAppadded inv2.6.0

func (c *Client) DeleteOAuth2ProviderApp(ctxcontext.Context, iduuid.UUID)error

DeleteOAuth2ProviderApp deletes an application, also invalidating any tokensthat were generated from it.

func (*Client)DeleteOAuth2ProviderAppSecretadded inv2.6.0

func (c *Client) DeleteOAuth2ProviderAppSecret(ctxcontext.Context, appIDuuid.UUID, secretIDuuid.UUID)error

DeleteOAuth2ProviderAppSecret deletes a secret from an OAuth2 application,also invalidating any tokens that generated from it.

func (*Client)DeleteOrganizationadded inv2.12.0

func (c *Client) DeleteOrganization(ctxcontext.Context, orgIDstring)error

DeleteOrganization will remove the corresponding organization from the deployment, based onthe UUID/name provided as `orgID`.

func (*Client)DeleteOrganizationMemberadded inv2.13.0

func (c *Client) DeleteOrganizationMember(ctxcontext.Context, organizationIDuuid.UUID, userstring)error

DeleteOrganizationMember removes a user from an organization

func (*Client)DeleteOrganizationRoleadded inv2.15.0

func (c *Client) DeleteOrganizationRole(ctxcontext.Context, organizationIDuuid.UUID, roleNamestring)error

DeleteOrganizationRole will delete a custom organization role

func (*Client)DeleteProvisionerKeyadded inv2.14.0

func (c *Client) DeleteProvisionerKey(ctxcontext.Context, organizationIDuuid.UUID, namestring)error

DeleteProvisionerKey deletes a provisioner key.

func (*Client)DeleteTemplate

func (c *Client) DeleteTemplate(ctxcontext.Context, templateuuid.UUID)error

func (*Client)DeleteUser

func (c *Client) DeleteUser(ctxcontext.Context, iduuid.UUID)error

DeleteUser deletes a user.

func (*Client)DeleteWebpushSubscriptionadded inv2.21.0

func (c *Client) DeleteWebpushSubscription(ctxcontext.Context, userstring, reqDeleteWebpushSubscription)error

DeleteWebpushSubscription deletes a push notification subscription for a given user.Think of this as an unsubscribe, but for a specific push notification subscription.

func (*Client)DeleteWorkspaceAgentPortShareadded inv2.9.0

func (c *Client) DeleteWorkspaceAgentPortShare(ctxcontext.Context, workspaceIDuuid.UUID, reqDeleteWorkspaceAgentPortShareRequest)error

func (*Client)DeleteWorkspaceProxyByID

func (c *Client) DeleteWorkspaceProxyByID(ctxcontext.Context, iduuid.UUID)error

func (*Client)DeleteWorkspaceProxyByName

func (c *Client) DeleteWorkspaceProxyByName(ctxcontext.Context, namestring)error

func (*Client)DeletedWorkspace

func (c *Client) DeletedWorkspace(ctxcontext.Context, iduuid.UUID) (Workspace,error)

DeletedWorkspace returns a single workspace that was deleted.

func (*Client)DeploymentConfig

func (c *Client) DeploymentConfig(ctxcontext.Context) (*DeploymentConfig,error)

DeploymentConfig returns the deployment config for the coder server.

func (*Client)DeploymentDAUs

func (c *Client) DeploymentDAUs(ctxcontext.Context, tzOffsetint) (*DAUsResponse,error)

DeploymentDAUs requires a tzOffset in hours. Use 0 for UTC, and TimezoneOffsetHour(time.Local) for thelocal timezone.

func (*Client)DeploymentDAUsLocalTZ

func (c *Client) DeploymentDAUsLocalTZ(ctxcontext.Context) (*DAUsResponse,error)

func (*Client)DeploymentStats

func (c *Client) DeploymentStats(ctxcontext.Context) (DeploymentStats,error)

func (*Client)Dialadded inv2.22.0

func (*Client)Download

func (c *Client) Download(ctxcontext.Context, iduuid.UUID) ([]byte,string,error)

Download fetches a file by uploaded hash.

func (*Client)DownloadWithFormatadded inv2.8.0

func (c *Client) DownloadWithFormat(ctxcontext.Context, iduuid.UUID, formatstring) ([]byte,string,error)

Download fetches a file by uploaded hash, but it forces format conversion.

func (*Client)Entitlements

func (c *Client) Entitlements(ctxcontext.Context) (Entitlements,error)

func (*Client)Experiments

func (c *Client) Experiments(ctxcontext.Context) (Experiments,error)

func (*Client)ExternalAuthByIDadded inv2.2.1

func (c *Client) ExternalAuthByID(ctxcontext.Context, providerstring) (ExternalAuth,error)

ExternalAuthByID returns the external auth for the given provider by ID.

func (*Client)ExternalAuthDeviceByIDadded inv2.2.1

func (c *Client) ExternalAuthDeviceByID(ctxcontext.Context, providerstring) (ExternalAuthDevice,error)

func (*Client)ExternalAuthDeviceExchangeadded inv2.2.1

func (c *Client) ExternalAuthDeviceExchange(ctxcontext.Context, providerstring, reqExternalAuthDeviceExchange)error

ExchangeGitAuth exchanges a device code for an external auth token.

func (*Client)FavoriteWorkspaceadded inv2.8.0

func (c *Client) FavoriteWorkspace(ctxcontext.Context, workspaceIDuuid.UUID)error

func (*Client)GetAvailableIDPSyncFieldsadded inv2.18.0

func (c *Client) GetAvailableIDPSyncFields(ctxcontext.Context) ([]string,error)

func (*Client)GetIDPSyncFieldValuesadded inv2.19.0

func (c *Client) GetIDPSyncFieldValues(ctxcontext.Context, claimFieldstring) ([]string,error)

func (*Client)GetNotificationDispatchMethodsadded inv2.15.0

func (c *Client) GetNotificationDispatchMethods(ctxcontext.Context) (NotificationMethodsResponse,error)

GetNotificationDispatchMethods the available and default notification dispatch methods.

func (*Client)GetNotificationsSettingsadded inv2.14.0

func (c *Client) GetNotificationsSettings(ctxcontext.Context) (NotificationsSettings,error)

GetNotificationsSettings retrieves the notifications settings, which currently just describes whether allnotifications are paused from sending.

func (*Client)GetOrganizationAvailableIDPSyncFieldsadded inv2.18.0

func (c *Client) GetOrganizationAvailableIDPSyncFields(ctxcontext.Context, orgIDstring) ([]string,error)

func (*Client)GetOrganizationIDPSyncFieldValuesadded inv2.19.0

func (c *Client) GetOrganizationIDPSyncFieldValues(ctxcontext.Context, orgIDstring, claimFieldstring) ([]string,error)

func (*Client)GetProvisionerKeyadded inv2.18.0

func (c *Client) GetProvisionerKey(ctxcontext.Context, pkstring) (ProvisionerKey,error)

GetProvisionerKey returns the provisioner key.

func (*Client)GetSystemNotificationTemplatesadded inv2.15.0

func (c *Client) GetSystemNotificationTemplates(ctxcontext.Context) ([]NotificationTemplate,error)

GetSystemNotificationTemplates retrieves all notification templates pertaining to internal system events.

func (*Client)GetTokenConfig

func (c *Client) GetTokenConfig(ctxcontext.Context, userIDstring) (TokenConfig,error)

GetTokenConfig returns deployment options related to token management

func (*Client)GetUserAppearanceSettingsadded inv2.22.0

func (c *Client) GetUserAppearanceSettings(ctxcontext.Context, userstring) (UserAppearanceSettings,error)

GetUserAppearanceSettings fetches the appearance settings for a user.

func (*Client)GetUserNotificationPreferencesadded inv2.15.0

func (c *Client) GetUserNotificationPreferences(ctxcontext.Context, userIDuuid.UUID) ([]NotificationPreference,error)

GetUserNotificationPreferences retrieves notification preferences for a given user.

func (*Client)GetUserStatusCountsadded inv2.19.0

func (*Client)GetWorkspaceAgentPortSharesadded inv2.9.0

func (c *Client) GetWorkspaceAgentPortShares(ctxcontext.Context, workspaceIDuuid.UUID) (WorkspaceAgentPortShares,error)

func (*Client)GitSSHKey

func (c *Client) GitSSHKey(ctxcontext.Context, userstring) (GitSSHKey,error)

GitSSHKey returns the user's git SSH public key.

func (*Client)Group

func (c *Client) Group(ctxcontext.Context, groupuuid.UUID) (Group,error)

func (*Client)GroupByOrgAndName

func (c *Client) GroupByOrgAndName(ctxcontext.Context, orgIDuuid.UUID, namestring) (Group,error)

func (*Client)GroupIDPSyncSettingsadded inv2.16.0

func (c *Client) GroupIDPSyncSettings(ctxcontext.Context, orgIDstring) (GroupSyncSettings,error)

func (*Client)Groupsadded inv2.15.0

func (c *Client) Groups(ctxcontext.Context, argsGroupArguments) ([]Group,error)

func (*Client)GroupsByOrganization

func (c *Client) GroupsByOrganization(ctxcontext.Context, orgIDuuid.UUID) ([]Group,error)

GroupsByOrganizationDeprecated: use Groups with GroupArguments instead.

func (*Client)HasFirstUser

func (c *Client) HasFirstUser(ctxcontext.Context) (bool,error)

HasFirstUser returns whether the first user has been created.

func (*Client)LanguageModelConfigadded inv2.23.0

func (c *Client) LanguageModelConfig(ctxcontext.Context) (LanguageModelConfig,error)

func (*Client)Licenses

func (c *Client) Licenses(ctxcontext.Context) ([]License,error)

func (*Client)ListChatsadded inv2.23.0

func (c *Client) ListChats(ctxcontext.Context) ([]Chat,error)

ListChats lists all chats.

func (*Client)ListExternalAuthsadded inv2.5.0

func (c *Client) ListExternalAuths(ctxcontext.Context) (ListUserExternalAuthResponse,error)

ListExternalAuths returns the available external auth providers and the user'sauthenticated links if they exist.

func (*Client)ListInboxNotificationsadded inv2.21.0

func (*Client)ListOrganizationRoles

func (c *Client) ListOrganizationRoles(ctxcontext.Context, orguuid.UUID) ([]AssignableRoles,error)

ListOrganizationRoles lists all assignable roles for a given organization.

func (*Client)ListProvisionerKeyDaemonsadded inv2.16.0

func (c *Client) ListProvisionerKeyDaemons(ctxcontext.Context, organizationIDuuid.UUID) ([]ProvisionerKeyDaemons,error)

ListProvisionerKeyDaemons lists all provisioner keys with their associated daemons for an organization.

func (*Client)ListProvisionerKeysadded inv2.14.0

func (c *Client) ListProvisionerKeys(ctxcontext.Context, organizationIDuuid.UUID) ([]ProvisionerKey,error)

ListProvisionerKeys lists all provisioner keys for an organization.

func (*Client)ListSiteRoles

func (c *Client) ListSiteRoles(ctxcontext.Context) ([]AssignableRoles,error)

ListSiteRoles lists all assignable site wide roles.

func (*Client)LogBodies

func (c *Client) LogBodies()bool

LogBodies returns whether requests and response bodies are logged.

func (*Client)Logger

func (c *Client) Logger()slog.Logger

Logger returns the logger for the client.

func (*Client)LoginWithPassword

LoginWithPassword creates a session token authenticating with an email and password.Call `SetSessionToken()` to apply the newly acquired token to the client.

func (*Client)Logout

func (c *Client) Logout(ctxcontext.Context)error

Logout calls the /logout APICall `ClearSessionToken()` to clear the session token of the client.

func (*Client)MarkAllInboxNotificationsAsReadadded inv2.21.0

func (c *Client) MarkAllInboxNotificationsAsRead(ctxcontext.Context)error

func (*Client)OAuth2ProviderAppadded inv2.6.0

func (c *Client) OAuth2ProviderApp(ctxcontext.Context, iduuid.UUID) (OAuth2ProviderApp,error)

OAuth2ProviderApp returns an application configured to authenticate usingCoder as an OAuth2 provider.

func (*Client)OAuth2ProviderAppSecretsadded inv2.6.0

func (c *Client) OAuth2ProviderAppSecrets(ctxcontext.Context, appIDuuid.UUID) ([]OAuth2ProviderAppSecret,error)

OAuth2ProviderAppSecrets returns the truncated secrets for an OAuth2application.

func (*Client)OAuth2ProviderAppsadded inv2.6.0

func (c *Client) OAuth2ProviderApps(ctxcontext.Context, filterOAuth2ProviderAppFilter) ([]OAuth2ProviderApp,error)

OAuth2ProviderApps returns the applications configured to authenticate usingCoder as an OAuth2 provider.

func (*Client)Organization

func (c *Client) Organization(ctxcontext.Context, iduuid.UUID) (Organization,error)

func (*Client)OrganizationByName

func (c *Client) OrganizationByName(ctxcontext.Context, namestring) (Organization,error)

func (*Client)OrganizationByUserAndNameadded inv2.9.0

func (c *Client) OrganizationByUserAndName(ctxcontext.Context, userstring, namestring) (Organization,error)

func (*Client)OrganizationIDPSyncSettingsadded inv2.18.0

func (c *Client) OrganizationIDPSyncSettings(ctxcontext.Context) (OrganizationSyncSettings,error)

func (*Client)OrganizationMembersadded inv2.13.0

func (c *Client) OrganizationMembers(ctxcontext.Context, organizationIDuuid.UUID) ([]OrganizationMemberWithUserData,error)

OrganizationMembers lists all members in an organization

func (*Client)OrganizationProvisionerDaemonsadded inv2.14.0

func (c *Client) OrganizationProvisionerDaemons(ctxcontext.Context, organizationIDuuid.UUID, opts *OrganizationProvisionerDaemonsOptions) ([]ProvisionerDaemon,error)

func (*Client)OrganizationProvisionerJobadded inv2.19.0

func (c *Client) OrganizationProvisionerJob(ctxcontext.Context, organizationID, jobIDuuid.UUID) (jobProvisionerJob, errerror)

func (*Client)OrganizationProvisionerJobsadded inv2.19.0

func (c *Client) OrganizationProvisionerJobs(ctxcontext.Context, organizationIDuuid.UUID, opts *OrganizationProvisionerJobsOptions) ([]ProvisionerJob,error)

func (*Client)Organizationsadded inv2.14.0

func (c *Client) Organizations(ctxcontext.Context) ([]Organization,error)

func (*Client)OrganizationsByUser

func (c *Client) OrganizationsByUser(ctxcontext.Context, userstring) ([]Organization,error)

OrganizationsByUser returns all organizations the user is a member of.

func (*Client)PatchGroup

func (c *Client) PatchGroup(ctxcontext.Context, groupuuid.UUID, reqPatchGroupRequest) (Group,error)

func (*Client)PatchGroupIDPSyncConfigadded inv2.19.0

func (c *Client) PatchGroupIDPSyncConfig(ctxcontext.Context, orgIDstring, reqPatchGroupIDPSyncConfigRequest) (GroupSyncSettings,error)

func (*Client)PatchGroupIDPSyncMappingadded inv2.19.0

func (c *Client) PatchGroupIDPSyncMapping(ctxcontext.Context, orgIDstring, reqPatchGroupIDPSyncMappingRequest) (GroupSyncSettings,error)

func (*Client)PatchGroupIDPSyncSettingsadded inv2.16.0

func (c *Client) PatchGroupIDPSyncSettings(ctxcontext.Context, orgIDstring, reqGroupSyncSettings) (GroupSyncSettings,error)

func (*Client)PatchOrganizationIDPSyncConfigadded inv2.19.0

func (*Client)PatchOrganizationIDPSyncMappingadded inv2.19.0

func (*Client)PatchOrganizationIDPSyncSettingsadded inv2.18.0

func (c *Client) PatchOrganizationIDPSyncSettings(ctxcontext.Context, reqOrganizationSyncSettings) (OrganizationSyncSettings,error)

func (*Client)PatchRoleIDPSyncConfigadded inv2.19.0

func (c *Client) PatchRoleIDPSyncConfig(ctxcontext.Context, orgIDstring, reqPatchRoleIDPSyncConfigRequest) (RoleSyncSettings,error)

func (*Client)PatchRoleIDPSyncMappingadded inv2.19.0

func (c *Client) PatchRoleIDPSyncMapping(ctxcontext.Context, orgIDstring, reqPatchRoleIDPSyncMappingRequest) (RoleSyncSettings,error)

func (*Client)PatchRoleIDPSyncSettingsadded inv2.16.0

func (c *Client) PatchRoleIDPSyncSettings(ctxcontext.Context, orgIDstring, reqRoleSyncSettings) (RoleSyncSettings,error)

func (*Client)PostOAuth2ProviderAppadded inv2.6.0

func (c *Client) PostOAuth2ProviderApp(ctxcontext.Context, appPostOAuth2ProviderAppRequest) (OAuth2ProviderApp,error)

PostOAuth2ProviderApp adds an application that can authenticate using Coderas an OAuth2 provider.

func (*Client)PostOAuth2ProviderAppSecretadded inv2.6.0

func (c *Client) PostOAuth2ProviderAppSecret(ctxcontext.Context, appIDuuid.UUID) (OAuth2ProviderAppSecretFull,error)

PostOAuth2ProviderAppSecret creates a new secret for an OAuth2 application.This is the only time the full secret will be revealed.

func (*Client)PostOrganizationMemberadded inv2.13.0

func (c *Client) PostOrganizationMember(ctxcontext.Context, organizationIDuuid.UUID, userstring) (OrganizationMember,error)

PostOrganizationMember adds a user to an organization

func (*Client)PostTestNotificationadded inv2.20.0

func (c *Client) PostTestNotification(ctxcontext.Context)error

func (*Client)PostTestWebpushMessageadded inv2.21.0

func (c *Client) PostTestWebpushMessage(ctxcontext.Context)error

func (*Client)PostWebpushSubscriptionadded inv2.21.0

func (c *Client) PostWebpushSubscription(ctxcontext.Context, userstring, reqWebpushSubscription)error

PostWebpushSubscription creates a push notification subscription for a given user.

func (*Client)PostWorkspaceUsageadded inv2.10.0

func (c *Client) PostWorkspaceUsage(ctxcontext.Context, iduuid.UUID)error

PostWorkspaceUsage marks the workspace as having been used recently.Deprecated: use PostWorkspaceUsageWithBody instead

func (*Client)PostWorkspaceUsageWithBodyadded inv2.13.0

func (c *Client) PostWorkspaceUsageWithBody(ctxcontext.Context, iduuid.UUID, reqPostWorkspaceUsageRequest)error

PostWorkspaceUsage marks the workspace as having been used recently and records an app stat.

func (*Client)PreviousTemplateVersion

func (c *Client) PreviousTemplateVersion(ctxcontext.Context, organizationuuid.UUID, templateName, versionNamestring) (TemplateVersion,error)

func (*Client)ProvisionerDaemons

func (c *Client) ProvisionerDaemons(ctxcontext.Context) ([]ProvisionerDaemon,error)

ProvisionerDaemons returns provisioner daemons available.

func (*Client)PutExtendWorkspace

func (c *Client) PutExtendWorkspace(ctxcontext.Context, iduuid.UUID, reqPutExtendWorkspaceRequest)error

PutExtendWorkspace updates the deadline for resources of the latest workspace build.

func (*Client)PutNotificationsSettingsadded inv2.14.0

func (c *Client) PutNotificationsSettings(ctxcontext.Context, settingsNotificationsSettings)error

PutNotificationsSettings modifies the notifications settings, which currently just controls whether allnotifications are paused from sending.

func (*Client)PutOAuth2ProviderAppadded inv2.6.0

PutOAuth2ProviderApp updates an application that can authenticate using Coderas an OAuth2 provider.

func (*Client)RegenerateGitSSHKey

func (c *Client) RegenerateGitSSHKey(ctxcontext.Context, userstring) (GitSSHKey,error)

RegenerateGitSSHKey will create a new SSH key pair for the user and return it.

func (*Client)Regions

func (c *Client) Regions(ctxcontext.Context) ([]Region,error)

func (*Client)Replicas

func (c *Client) Replicas(ctxcontext.Context) ([]Replica,error)

Replicas fetches the list of replicas.

func (*Client)Request

func (c *Client) Request(ctxcontext.Context, method, pathstring, body interface{}, opts ...RequestOption) (*http.Response,error)

Request performs a HTTP request with the body provided. The caller isresponsible for closing the response body.

func (*Client)RequestOneTimePasscodeadded inv2.17.0

func (c *Client) RequestOneTimePasscode(ctxcontext.Context, reqRequestOneTimePasscodeRequest)error

func (*Client)ResolveAutostartadded inv2.4.0

func (c *Client) ResolveAutostart(ctxcontext.Context, workspaceIDstring) (ResolveAutostartResponse,error)

func (*Client)RevokeOAuth2ProviderAppadded inv2.9.0

func (c *Client) RevokeOAuth2ProviderApp(ctxcontext.Context, appIDuuid.UUID)error

RevokeOAuth2ProviderApp completely revokes an app's access for theauthenticated user.

func (*Client)RoleIDPSyncSettingsadded inv2.16.0

func (c *Client) RoleIDPSyncSettings(ctxcontext.Context, orgIDstring) (RoleSyncSettings,error)

func (*Client)SSHConfiguration

func (c *Client) SSHConfiguration(ctxcontext.Context) (SSHConfigResponse,error)

SSHConfiguration returns information about the SSH configuration for theCoder instance.

func (*Client)SafeExperimentsadded inv2.3.1

func (c *Client) SafeExperiments(ctxcontext.Context) (AvailableExperiments,error)

func (*Client)ServeProvisionerDaemon

ServeProvisionerDaemon returns the gRPC service for a provisioner daemonimplementation. The context is during dial, not during the lifetime of theclient. Client should be closed after use.

func (*Client)SessionToken

func (c *Client) SessionToken()string

SessionToken returns the currently set token for the client.

func (*Client)SetArchiveTemplateVersionadded inv2.3.0

func (c *Client) SetArchiveTemplateVersion(ctxcontext.Context, templateVersionuuid.UUID, archivebool)error

func (*Client)SetLogBodies

func (c *Client) SetLogBodies(logBodiesbool)

SetLogBodies sets whether to log request and response bodies.

func (*Client)SetLogger

func (c *Client) SetLogger(loggerslog.Logger)

SetLogger sets the logger for the client.

func (*Client)SetSessionToken

func (c *Client) SetSessionToken(tokenstring)

SetSessionToken returns the currently set token for the client.

func (*Client)StarterTemplatesadded inv2.15.0

func (c *Client) StarterTemplates(ctxcontext.Context) ([]TemplateExample,error)

StarterTemplates lists example templates available in Coder.

func (*Client)Template

func (c *Client) Template(ctxcontext.Context, templateuuid.UUID) (Template,error)

Template returns a single template.

func (*Client)TemplateACL

func (c *Client) TemplateACL(ctxcontext.Context, templateIDuuid.UUID) (TemplateACL,error)

func (*Client)TemplateACLAvailable

func (c *Client) TemplateACLAvailable(ctxcontext.Context, templateIDuuid.UUID) (ACLAvailable,error)

TemplateACLAvailable returns available users + groups that can be assigned template perms

func (*Client)TemplateByName

func (c *Client) TemplateByName(ctxcontext.Context, organizationIDuuid.UUID, namestring) (Template,error)

TemplateByName finds a template inside the organization provided with a case-insensitive name.

func (*Client)TemplateDAUs

func (c *Client) TemplateDAUs(ctxcontext.Context, templateIDuuid.UUID, tzOffsetint) (*DAUsResponse,error)

TemplateDAUs requires a tzOffset in hours. Use 0 for UTC, and TimezoneOffsetHour(time.Local) for thelocal timezone.

func (*Client)TemplateDAUsLocalTZ

func (c *Client) TemplateDAUsLocalTZ(ctxcontext.Context, templateIDuuid.UUID) (*DAUsResponse,error)

func (*Client)TemplateExamplesdeprecated

func (c *Client) TemplateExamples(ctxcontext.Context, _uuid.UUID) ([]TemplateExample,error)

TemplateExamples lists example templates available in Coder.

Deprecated: Use StarterTemplates instead.

func (*Client)TemplateVersion

func (c *Client) TemplateVersion(ctxcontext.Context, iduuid.UUID) (TemplateVersion,error)

TemplateVersion returns a template version by ID.

func (*Client)TemplateVersionByName

func (c *Client) TemplateVersionByName(ctxcontext.Context, templateuuid.UUID, namestring) (TemplateVersion,error)

TemplateVersionByName returns a template version by it's friendly name.This is used for path-based routing. Like: /templates/example/versions/helloworld

func (*Client)TemplateVersionByOrganizationAndName

func (c *Client) TemplateVersionByOrganizationAndName(ctxcontext.Context, organizationIDuuid.UUID, templateName, versionNamestring) (TemplateVersion,error)

func (*Client)TemplateVersionDryRun

func (c *Client) TemplateVersionDryRun(ctxcontext.Context, version, jobuuid.UUID) (ProvisionerJob,error)

TemplateVersionDryRun returns the current state of a template version dry-runjob.

func (*Client)TemplateVersionDryRunLogsAfter

func (c *Client) TemplateVersionDryRunLogsAfter(ctxcontext.Context, version, jobuuid.UUID, afterint64) (<-chanProvisionerJobLog,io.Closer,error)

TemplateVersionDryRunLogsAfter streams logs for a template version dry-runthat occurred after a specific log ID.

func (*Client)TemplateVersionDryRunMatchedProvisionersadded inv2.18.1

func (c *Client) TemplateVersionDryRunMatchedProvisioners(ctxcontext.Context, version, jobuuid.UUID) (MatchedProvisioners,error)

TemplateVersionDryRunMatchedProvisioners returns the matched provisioners for atemplate version dry-run job.

func (*Client)TemplateVersionDryRunResources

func (c *Client) TemplateVersionDryRunResources(ctxcontext.Context, version, jobuuid.UUID) ([]WorkspaceResource,error)

TemplateVersionDryRunResources returns the resources of a finished templateversion dry-run job.

func (*Client)TemplateVersionDynamicParametersadded inv2.22.0

func (c *Client) TemplateVersionDynamicParameters(ctxcontext.Context, versionuuid.UUID) (*wsjson.Stream[DynamicParametersResponse,DynamicParametersRequest],error)

func (*Client)TemplateVersionExternalAuthadded inv2.2.1

func (c *Client) TemplateVersionExternalAuth(ctxcontext.Context, versionuuid.UUID) ([]TemplateVersionExternalAuth,error)

TemplateVersionExternalAuth returns authentication providers for the requested template version.

func (*Client)TemplateVersionLogsAfter

func (c *Client) TemplateVersionLogsAfter(ctxcontext.Context, versionuuid.UUID, afterint64) (<-chanProvisionerJobLog,io.Closer,error)

TemplateVersionLogsAfter streams logs for a template version that occurred after a specific log ID.

func (*Client)TemplateVersionPresetsadded inv2.20.0

func (c *Client) TemplateVersionPresets(ctxcontext.Context, templateVersionIDuuid.UUID) ([]Preset,error)

TemplateVersionPresets returns the presets associated with a template version.

func (*Client)TemplateVersionResources

func (c *Client) TemplateVersionResources(ctxcontext.Context, versionuuid.UUID) ([]WorkspaceResource,error)

TemplateVersionResources returns resources a template version declares.

func (*Client)TemplateVersionRichParameters

func (c *Client) TemplateVersionRichParameters(ctxcontext.Context, versionuuid.UUID) ([]TemplateVersionParameter,error)

TemplateVersionParameters returns parameters a template version exposes.

func (*Client)TemplateVersionVariables

func (c *Client) TemplateVersionVariables(ctxcontext.Context, versionuuid.UUID) ([]TemplateVersionVariable,error)

TemplateVersionVariables returns resources a template version variables.

func (*Client)TemplateVersionsByTemplate

func (c *Client) TemplateVersionsByTemplate(ctxcontext.Context, reqTemplateVersionsByTemplateRequest) ([]TemplateVersion,error)

TemplateVersionsByTemplate lists versions associated with a template.

func (*Client)Templatesadded inv2.13.0

func (c *Client) Templates(ctxcontext.Context, filterTemplateFilter) ([]Template,error)

Templates lists all viewable templates

func (*Client)TemplatesByOrganization

func (c *Client) TemplatesByOrganization(ctxcontext.Context, organizationIDuuid.UUID) ([]Template,error)

TemplatesByOrganization lists all templates inside of an organization.

func (*Client)Tokens

func (c *Client) Tokens(ctxcontext.Context, userIDstring, filterTokensFilter) ([]APIKeyWithOwner,error)

Tokens list machine API keys.

func (*Client)UnfavoriteWorkspaceadded inv2.8.0

func (c *Client) UnfavoriteWorkspace(ctxcontext.Context, workspaceIDuuid.UUID)error

func (*Client)UnlinkExternalAuthByIDadded inv2.5.0

func (c *Client) UnlinkExternalAuthByID(ctxcontext.Context, providerstring)error

UnlinkExternalAuthByID deletes the external auth for the given provider by IDfor the user. This does not revoke the token from the IDP.

func (*Client)UpdateActiveTemplateVersion

func (c *Client) UpdateActiveTemplateVersion(ctxcontext.Context, templateuuid.UUID, reqUpdateActiveTemplateVersion)error

UpdateActiveTemplateVersion updates the active template version to the ID provided.The template version must be attached to the template.

func (*Client)UpdateAppearance

func (c *Client) UpdateAppearance(ctxcontext.Context, appearanceUpdateAppearanceConfig)error

func (*Client)UpdateCheck

func (c *Client) UpdateCheck(ctxcontext.Context) (UpdateCheckResponse,error)

UpdateCheck returns information about the latest release version ofCoder and whether or not the server is running the latest release.

func (*Client)UpdateNotificationTemplateMethodadded inv2.15.0

func (c *Client) UpdateNotificationTemplateMethod(ctxcontext.Context, notificationTemplateIDuuid.UUID, methodstring)error

UpdateNotificationTemplateMethod modifies a notification template to use a specific notification method, overridingthe method set in the deployment configuration.

func (*Client)UpdateOrganizationadded inv2.12.0

func (c *Client) UpdateOrganization(ctxcontext.Context, orgIDstring, reqUpdateOrganizationRequest) (Organization,error)

UpdateOrganization will update information about the corresponding organization, based onthe UUID/name provided as `orgID`.

func (*Client)UpdateOrganizationMemberRoles

func (c *Client) UpdateOrganizationMemberRoles(ctxcontext.Context, organizationIDuuid.UUID, userstring, reqUpdateRoles) (OrganizationMember,error)

UpdateOrganizationMemberRoles grants the userID the specified roles in an org.Include ALL roles the user has.

func (*Client)UpdateOrganizationRoleadded inv2.15.0

func (c *Client) UpdateOrganizationRole(ctxcontext.Context, roleRole) (Role,error)

UpdateOrganizationRole will update an existing custom organization role

func (*Client)UpdateTemplateACL

func (c *Client) UpdateTemplateACL(ctxcontext.Context, templateIDuuid.UUID, reqUpdateTemplateACL)error

func (*Client)UpdateTemplateMeta

func (c *Client) UpdateTemplateMeta(ctxcontext.Context, templateIDuuid.UUID, reqUpdateTemplateMeta) (Template,error)

func (*Client)UpdateTemplateVersion

func (c *Client) UpdateTemplateVersion(ctxcontext.Context, versionIDuuid.UUID, reqPatchTemplateVersionRequest) (TemplateVersion,error)

func (*Client)UpdateUserAppearanceSettingsadded inv2.5.1

func (c *Client) UpdateUserAppearanceSettings(ctxcontext.Context, userstring, reqUpdateUserAppearanceSettingsRequest) (UserAppearanceSettings,error)

UpdateUserAppearanceSettings updates the appearance settings for a user.

func (*Client)UpdateUserNotificationPreferencesadded inv2.15.0

func (c *Client) UpdateUserNotificationPreferences(ctxcontext.Context, userIDuuid.UUID, reqUpdateUserNotificationPreferences) ([]NotificationPreference,error)

UpdateUserNotificationPreferences updates notification preferences for a given user.

func (*Client)UpdateUserPassword

func (c *Client) UpdateUserPassword(ctxcontext.Context, userstring, reqUpdateUserPasswordRequest)error

UpdateUserPassword updates a user password.It calls PUT /users/{user}/password

func (*Client)UpdateUserProfile

func (c *Client) UpdateUserProfile(ctxcontext.Context, userstring, reqUpdateUserProfileRequest) (User,error)

UpdateUserProfile updates the username of a user.

func (*Client)UpdateUserQuietHoursSchedule

func (c *Client) UpdateUserQuietHoursSchedule(ctxcontext.Context, userIdentstring, reqUpdateUserQuietHoursScheduleRequest) (UserQuietHoursScheduleResponse,error)

UpdateUserQuietHoursSchedule updates the quiet hours settings for the user.This endpoint only exists in enterprise editions.

func (*Client)UpdateUserRoles

func (c *Client) UpdateUserRoles(ctxcontext.Context, userstring, reqUpdateRoles) (User,error)

UpdateUserRoles grants the userID the specified roles.Include ALL roles the user has.

func (*Client)UpdateUserStatus

func (c *Client) UpdateUserStatus(ctxcontext.Context, userstring, statusUserStatus) (User,error)

UpdateUserStatus sets the user status to the given status

func (*Client)UpdateWorkspace

func (c *Client) UpdateWorkspace(ctxcontext.Context, iduuid.UUID, reqUpdateWorkspaceRequest)error

func (*Client)UpdateWorkspaceAutomaticUpdatesadded inv2.3.0

func (c *Client) UpdateWorkspaceAutomaticUpdates(ctxcontext.Context, iduuid.UUID, reqUpdateWorkspaceAutomaticUpdatesRequest)error

UpdateWorkspaceAutomaticUpdates sets the automatic updates setting for workspace by id.

func (*Client)UpdateWorkspaceAutostart

func (c *Client) UpdateWorkspaceAutostart(ctxcontext.Context, iduuid.UUID, reqUpdateWorkspaceAutostartRequest)error

UpdateWorkspaceAutostart sets the autostart schedule for workspace by id.If the provided schedule is empty, autostart is disabled for the workspace.

func (*Client)UpdateWorkspaceDormancyadded inv2.1.4

func (c *Client) UpdateWorkspaceDormancy(ctxcontext.Context, iduuid.UUID, reqUpdateWorkspaceDormancy)error

UpdateWorkspaceDormancy sets a workspace as dormant if dormant=true and activates a dormant workspaceif dormant=false.

func (*Client)UpdateWorkspaceTTL

func (c *Client) UpdateWorkspaceTTL(ctxcontext.Context, iduuid.UUID, reqUpdateWorkspaceTTLRequest)error

UpdateWorkspaceTTL sets the ttl for workspace by id.If the provided duration is nil, autostop is disabled for the workspace.

func (*Client)UpdateWorkspaceUsageContextadded inv2.10.0

func (c *Client) UpdateWorkspaceUsageContext(ctxcontext.Context, workspaceIDuuid.UUID) func()

UpdateWorkspaceUsageContext periodically posts workspace usage for the workspacewith the given id in the background.The caller is responsible for calling the returned function to stop the backgroundprocess.Deprecated: use UpdateWorkspaceUsageContextWithBody instead

func (*Client)UpdateWorkspaceUsageWithBodyContextadded inv2.13.0

func (c *Client) UpdateWorkspaceUsageWithBodyContext(ctxcontext.Context, workspaceIDuuid.UUID, reqPostWorkspaceUsageRequest) func()

UpdateWorkspaceUsageWithBodyContext periodically posts workspace usage for the workspacewith the given id and app name in the background.The caller is responsible for calling the returned function to stop the backgroundprocess.

func (*Client)Upload

func (c *Client) Upload(ctxcontext.Context, contentTypestring, rdio.Reader) (UploadResponse,error)

Upload uploads an arbitrary file with the content type provided.This is used to upload a source-code archive.

func (*Client)UpsertWorkspaceAgentPortShareadded inv2.9.0

func (c *Client) UpsertWorkspaceAgentPortShare(ctxcontext.Context, workspaceIDuuid.UUID, reqUpsertWorkspaceAgentPortShareRequest) (WorkspaceAgentPortShare,error)

func (*Client)User

func (c *Client) User(ctxcontext.Context, userIdentstring) (User,error)

User returns a user for the ID/username provided.

func (*Client)UserActivityInsightsadded inv2.2.0

func (*Client)UserAutofillParametersadded inv2.8.0

func (c *Client) UserAutofillParameters(ctxcontext.Context, userstring, templateIDuuid.UUID) ([]UserParameter,error)

UserAutofillParameters returns all recently used parameters for the given user.

func (*Client)UserQuietHoursSchedule

func (c *Client) UserQuietHoursSchedule(ctxcontext.Context, userIdentstring) (UserQuietHoursScheduleResponse,error)

UserQuietHoursSchedule returns the quiet hours settings for the user. Thisendpoint only exists in enterprise editions.

func (*Client)UserRoles

func (c *Client) UserRoles(ctxcontext.Context, userstring) (UserRoles,error)

UserRoles returns all roles the user has

func (*Client)Users

Users returns all users according to the request parameters. If no parameters are set,the default behavior is to return all users in a single page.

func (*Client)ValidateUserPasswordadded inv2.18.0

ValidateUserPassword validates the complexity of a user password and that it is secured enough.

func (*Client)WatchWorkspace

func (c *Client) WatchWorkspace(ctxcontext.Context, iduuid.UUID) (<-chanWorkspace,error)

func (*Client)WatchWorkspaceAgentMetadata

func (c *Client) WatchWorkspaceAgentMetadata(ctxcontext.Context, iduuid.UUID) (<-chan []WorkspaceAgentMetadata, <-chanerror)

WatchWorkspaceAgentMetadata watches the metadata of a workspace agent.The returned channel will be closed when the context is canceled. Exactlyone error will be sent on the error channel. The metadata channel is never closed.

func (*Client)Workspace

func (c *Client) Workspace(ctxcontext.Context, iduuid.UUID) (Workspace,error)

Workspace returns a single workspace.

func (*Client)WorkspaceAgent

func (c *Client) WorkspaceAgent(ctxcontext.Context, iduuid.UUID) (WorkspaceAgent,error)

WorkspaceAgent returns an agent by ID.

func (*Client)WorkspaceAgentListContainersadded inv2.20.0

func (c *Client) WorkspaceAgentListContainers(ctxcontext.Context, agentIDuuid.UUID, labels map[string]string) (WorkspaceAgentListContainersResponse,error)

WorkspaceAgentListContainers returns a list of containers that are currentlyrunning on a Docker daemon accessible to the workspace agent.

func (*Client)WorkspaceAgentListeningPorts

func (c *Client) WorkspaceAgentListeningPorts(ctxcontext.Context, agentIDuuid.UUID) (WorkspaceAgentListeningPortsResponse,error)

WorkspaceAgentListeningPorts returns a list of ports that are currently beinglistened on inside the workspace agent's network namespace.

func (*Client)WorkspaceAgentLogsAfter

func (c *Client) WorkspaceAgentLogsAfter(ctxcontext.Context, agentIDuuid.UUID, afterint64, followbool) (<-chan []WorkspaceAgentLog,io.Closer,error)

func (*Client)WorkspaceAgentRecreateDevcontaineradded inv2.23.0

func (c *Client) WorkspaceAgentRecreateDevcontainer(ctxcontext.Context, agentIDuuid.UUID, containerIDOrNamestring) (Response,error)

WorkspaceAgentRecreateDevcontainer recreates the devcontainer with the given ID.

func (*Client)WorkspaceBuild

func (c *Client) WorkspaceBuild(ctxcontext.Context, iduuid.UUID) (WorkspaceBuild,error)

WorkspaceBuild returns a single workspace build for a workspace.If history is "", the latest version is returned.

func (*Client)WorkspaceBuildByUsernameAndWorkspaceNameAndBuildNumber

func (c *Client) WorkspaceBuildByUsernameAndWorkspaceNameAndBuildNumber(ctxcontext.Context, usernamestring, workspaceNamestring, buildNumberstring) (WorkspaceBuild,error)

func (*Client)WorkspaceBuildLogsAfter

func (c *Client) WorkspaceBuildLogsAfter(ctxcontext.Context, builduuid.UUID, afterint64) (<-chanProvisionerJobLog,io.Closer,error)

WorkspaceBuildLogsAfter streams logs for a workspace build that occurred after a specific log ID.

func (*Client)WorkspaceBuildParameters

func (c *Client) WorkspaceBuildParameters(ctxcontext.Context, builduuid.UUID) ([]WorkspaceBuildParameter,error)

func (*Client)WorkspaceBuildState

func (c *Client) WorkspaceBuildState(ctxcontext.Context, builduuid.UUID) ([]byte,error)

WorkspaceBuildState returns the provisioner state of the build.

func (*Client)WorkspaceBuildTimingsadded inv2.17.0

func (c *Client) WorkspaceBuildTimings(ctxcontext.Context, builduuid.UUID) (WorkspaceBuildTimings,error)

func (*Client)WorkspaceBuilds

func (c *Client) WorkspaceBuilds(ctxcontext.Context, reqWorkspaceBuildsRequest) ([]WorkspaceBuild,error)

func (*Client)WorkspaceByOwnerAndName

func (c *Client) WorkspaceByOwnerAndName(ctxcontext.Context, ownerstring, namestring, paramsWorkspaceOptions) (Workspace,error)

WorkspaceByOwnerAndName returns a workspace by the owner's UUID and the workspace's name.

func (*Client)WorkspaceProxies

func (c *Client) WorkspaceProxies(ctxcontext.Context) (RegionsResponse[WorkspaceProxy],error)

func (*Client)WorkspaceProxyByID

func (c *Client) WorkspaceProxyByID(ctxcontext.Context, iduuid.UUID) (WorkspaceProxy,error)

func (*Client)WorkspaceProxyByName

func (c *Client) WorkspaceProxyByName(ctxcontext.Context, namestring) (WorkspaceProxy,error)

func (*Client)WorkspaceQuota

func (c *Client) WorkspaceQuota(ctxcontext.Context, organizationIDstring, userIDstring) (WorkspaceQuota,error)

func (*Client)WorkspaceTimingsadded inv2.16.0

func (c *Client) WorkspaceTimings(ctxcontext.Context, iduuid.UUID) (WorkspaceBuildTimings,error)

func (*Client)Workspaces

func (c *Client) Workspaces(ctxcontext.Context, filterWorkspaceFilter) (WorkspacesResponse,error)

Workspaces returns all workspaces the authenticated user has access to.

typeCoderDesktopTelemetryadded inv2.21.0

type CoderDesktopTelemetry struct {DeviceIDstring `json:"device_id"`DeviceOSstring `json:"device_os"`CoderDesktopVersionstring `json:"coder_desktop_version"`}

CoderDesktopTelemetry represents the telemetry data sent from Coder Desktop clients.@typescript-ignore CoderDesktopTelemetry

func (*CoderDesktopTelemetry)FromHeaderadded inv2.21.0

func (t *CoderDesktopTelemetry) FromHeader(headerValuestring)error

FromHeader parses the desktop telemetry from the provided header value.Returns nil if the header is empty or if parsing fails.

func (*CoderDesktopTelemetry)IsEmptyadded inv2.21.0

func (t *CoderDesktopTelemetry) IsEmpty()bool

IsEmpty returns true if all fields in the telemetry data are empty.

typeConnectionLatency

type ConnectionLatency struct {P50float64 `json:"p50" example:"31.312"`P95float64 `json:"p95" example:"119.832"`}

ConnectionLatency shows the latency for a connection.

typeConvertLoginRequest

type ConvertLoginRequest struct {// ToType is the login type to convert to.ToTypeLoginType `json:"to_type" validate:"required"`Passwordstring    `json:"password" validate:"required"`}

typeCountryadded inv2.18.0

type Country struct {Namestring `json:"name"`Flagstring `json:"flag"`}

@typescript-ignore Country

typeCreateChatMessageRequestadded inv2.23.0

type CreateChatMessageRequest struct {Modelstring      `json:"model"`MessageChatMessage `json:"message"`Thinkingbool        `json:"thinking"`}

typeCreateFirstUserRequest

type CreateFirstUserRequest struct {Emailstring                   `json:"email" validate:"required,email"`Usernamestring                   `json:"username" validate:"required,username"`Namestring                   `json:"name" validate:"user_real_name"`Passwordstring                   `json:"password" validate:"required"`Trialbool                     `json:"trial"`TrialInfoCreateFirstUserTrialInfo `json:"trial_info"`}

typeCreateFirstUserResponse

type CreateFirstUserResponse struct {UserIDuuid.UUID `json:"user_id" format:"uuid"`OrganizationIDuuid.UUID `json:"organization_id" format:"uuid"`}

CreateFirstUserResponse contains IDs for newly created user info.

typeCreateFirstUserTrialInfoadded inv2.7.0

type CreateFirstUserTrialInfo struct {FirstNamestring `json:"first_name"`LastNamestring `json:"last_name"`PhoneNumberstring `json:"phone_number"`JobTitlestring `json:"job_title"`CompanyNamestring `json:"company_name"`Countrystring `json:"country"`Developersstring `json:"developers"`}

typeCreateGroupRequest

type CreateGroupRequest struct {Namestring `json:"name" validate:"required,group_name"`DisplayNamestring `json:"display_name" validate:"omitempty,group_display_name"`AvatarURLstring `json:"avatar_url"`QuotaAllowanceint    `json:"quota_allowance"`}

typeCreateOrganizationRequest

type CreateOrganizationRequest struct {Namestring `json:"name" validate:"required,organization_name"`// DisplayName will default to the same value as `Name` if not provided.DisplayNamestring `json:"display_name,omitempty" validate:"omitempty,organization_display_name"`Descriptionstring `json:"description,omitempty"`Iconstring `json:"icon,omitempty"`}

typeCreateProvisionerKeyRequestadded inv2.14.0

type CreateProvisionerKeyRequest struct {Namestring            `json:"name"`Tags map[string]string `json:"tags"`}

typeCreateProvisionerKeyResponseadded inv2.14.0

type CreateProvisionerKeyResponse struct {Keystring `json:"key"`}

typeCreateTemplateRequest

type CreateTemplateRequest struct {// Name is the name of the template.Namestring `json:"name" validate:"template_name,required"`// DisplayName is the displayed name of the template.DisplayNamestring `json:"display_name,omitempty" validate:"template_display_name"`// Description is a description of what the template contains. It must be// less than 128 bytes.Descriptionstring `json:"description,omitempty" validate:"lt=128"`// Icon is a relative path or external URL that specifies// an icon to be displayed in the dashboard.Iconstring `json:"icon,omitempty"`// VersionID is an in-progress or completed job to use as an initial version// of the template.//// This is required on creation to enable a user-flow of validating a// template works. There is no reason the data-model cannot support empty// templates, but it doesn't make sense for users.VersionIDuuid.UUID `json:"template_version_id" validate:"required" format:"uuid"`// DefaultTTLMillis allows optionally specifying the default TTL// for all workspaces created from this template.DefaultTTLMillis *int64 `json:"default_ttl_ms,omitempty"`// ActivityBumpMillis allows optionally specifying the activity bump// duration for all workspaces created from this template. Defaults to 1h// but can be set to 0 to disable activity bumping.ActivityBumpMillis *int64 `json:"activity_bump_ms,omitempty"`// AutostopRequirement allows optionally specifying the autostop requirement// for workspaces created from this template. This is an enterprise feature.AutostopRequirement *TemplateAutostopRequirement `json:"autostop_requirement,omitempty"`// AutostartRequirement allows optionally specifying the autostart allowed days// for workspaces created from this template. This is an enterprise feature.AutostartRequirement *TemplateAutostartRequirement `json:"autostart_requirement,omitempty"`// Allow users to cancel in-progress workspace jobs.// *bool as the default value is "true".AllowUserCancelWorkspaceJobs *bool `json:"allow_user_cancel_workspace_jobs"`// AllowUserAutostart allows users to set a schedule for autostarting their// workspace. By default this is true. This can only be disabled when using// an enterprise license.AllowUserAutostart *bool `json:"allow_user_autostart,omitempty"`// AllowUserAutostop allows users to set a custom workspace TTL to use in// place of the template's DefaultTTL field. By default this is true. If// false, the DefaultTTL will always be used. This can only be disabled when// using an enterprise license.AllowUserAutostop *bool `json:"allow_user_autostop,omitempty"`// FailureTTLMillis allows optionally specifying the max lifetime before Coder// stops all resources for failed workspaces created from this template.FailureTTLMillis *int64 `json:"failure_ttl_ms,omitempty"`// TimeTilDormantMillis allows optionally specifying the max lifetime before Coder// locks inactive workspaces created from this template.TimeTilDormantMillis *int64 `json:"dormant_ttl_ms,omitempty"`// TimeTilDormantAutoDeleteMillis allows optionally specifying the max lifetime before Coder// permanently deletes dormant workspaces created from this template.TimeTilDormantAutoDeleteMillis *int64 `json:"delete_ttl_ms,omitempty"`// DisableEveryoneGroupAccess allows optionally disabling the default// behavior of granting the 'everyone' group access to use the template.// If this is set to true, the template will not be available to all users,// and must be explicitly granted to users or groups in the permissions settings// of the template.DisableEveryoneGroupAccessbool `json:"disable_everyone_group_access"`// RequireActiveVersion mandates that workspaces are built with the active// template version.RequireActiveVersionbool `json:"require_active_version"`// MaxPortShareLevel allows optionally specifying the maximum port share level// for workspaces created from the template.MaxPortShareLevel *WorkspaceAgentPortShareLevel `json:"max_port_share_level"`}

CreateTemplateRequest provides options when creating a template.

typeCreateTemplateVersionDryRunRequest

type CreateTemplateVersionDryRunRequest struct {WorkspaceNamestring                    `json:"workspace_name"`RichParameterValues []WorkspaceBuildParameter `json:"rich_parameter_values"`UserVariableValues  []VariableValue           `json:"user_variable_values,omitempty"`}

CreateTemplateVersionDryRunRequest defines the request parameters forCreateTemplateVersionDryRun.

typeCreateTemplateVersionRequest

type CreateTemplateVersionRequest struct {Namestring `json:"name,omitempty" validate:"omitempty,template_version_name"`Messagestring `json:"message,omitempty" validate:"lt=1048577"`// TemplateID optionally associates a version with a template.TemplateIDuuid.UUID                `json:"template_id,omitempty" format:"uuid"`StorageMethodProvisionerStorageMethod `json:"storage_method" validate:"oneof=file,required" enums:"file"`FileIDuuid.UUID                `json:"file_id,omitempty" validate:"required_without=ExampleID" format:"uuid"`ExampleIDstring                   `json:"example_id,omitempty" validate:"required_without=FileID"`ProvisionerProvisionerType          `json:"provisioner" validate:"oneof=terraform echo,required"`ProvisionerTags map[string]string        `json:"tags"`UserVariableValues []VariableValue `json:"user_variable_values,omitempty"`}

CreateTemplateVersionRequest enables callers to create a new Template Version.

typeCreateTestAuditLogRequest

type CreateTestAuditLogRequest struct {ActionAuditAction     `json:"action,omitempty" enums:"create,write,delete,start,stop"`ResourceTypeResourceType    `json:"resource_type,omitempty" enums:"template,template_version,user,workspace,workspace_build,git_ssh_key,auditable_group"`ResourceIDuuid.UUID       `json:"resource_id,omitempty" format:"uuid"`AdditionalFieldsjson.RawMessage `json:"additional_fields,omitempty"`Timetime.Time       `json:"time,omitempty" format:"date-time"`BuildReasonBuildReason     `json:"build_reason,omitempty" enums:"autostart,autostop,initiator"`OrganizationIDuuid.UUID       `json:"organization_id,omitempty" format:"uuid"`RequestIDuuid.UUID       `json:"request_id,omitempty" format:"uuid"`}

typeCreateTokenRequest

type CreateTokenRequest struct {Lifetimetime.Duration `json:"lifetime"`ScopeAPIKeyScope   `json:"scope" enums:"all,application_connect"`TokenNamestring        `json:"token_name"`}

typeCreateUserRequest

type CreateUserRequest struct {Emailstring `json:"email" validate:"required,email" format:"email"`Usernamestring `json:"username" validate:"required,username"`Namestring `json:"name" validate:"user_real_name"`Passwordstring `json:"password"`// UserLoginType defaults to LoginTypePassword.UserLoginTypeLoginType `json:"login_type"`// DisableLogin sets the user's login type to 'none'. This prevents the user// from being able to use a password or any other authentication method to login.// Deprecated: Set UserLoginType=LoginTypeDisabled instead.DisableLoginbool      `json:"disable_login"`OrganizationIDuuid.UUID `json:"organization_id" validate:"" format:"uuid"`}

CreateUserRequestDeprecated: Use CreateUserRequestWithOrgs instead. This will be removed.TODO: When removing, we should rename CreateUserRequestWithOrgs -> CreateUserRequestThen alias CreateUserRequestWithOrgs to CreateUserRequest.@typescript-ignore CreateUserRequest

typeCreateUserRequestWithOrgsadded inv2.15.0

type CreateUserRequestWithOrgs struct {Emailstring `json:"email" validate:"required,email" format:"email"`Usernamestring `json:"username" validate:"required,username"`Namestring `json:"name" validate:"user_real_name"`Passwordstring `json:"password"`// UserLoginType defaults to LoginTypePassword.UserLoginTypeLoginType `json:"login_type"`// UserStatus defaults to UserStatusDormant.UserStatus *UserStatus `json:"user_status"`// OrganizationIDs is a list of organization IDs that the user should be a member of.OrganizationIDs []uuid.UUID `json:"organization_ids" validate:"" format:"uuid"`}

func (*CreateUserRequestWithOrgs)UnmarshalJSONadded inv2.15.0

func (r *CreateUserRequestWithOrgs) UnmarshalJSON(data []byte)error

UnmarshalJSON implements the unmarshal for the legacy param "organization_id".To accommodate multiple organizations, the field has been switched to a slice.The previous field will just be appended to the slice.Note in the previous behavior, omitting the field would result in thedefault org being applied, but that is no longer the case.TODO: Remove this method in it's entirety after some period of time.This will be released in v1.16.0, and is associated with the multiple orgsfeature.

typeCreateWorkspaceBuildRequest

type CreateWorkspaceBuildRequest struct {TemplateVersionIDuuid.UUID           `json:"template_version_id,omitempty" format:"uuid"`TransitionWorkspaceTransition `json:"transition" validate:"oneof=start stop delete,required"`DryRunbool                `json:"dry_run,omitempty"`ProvisionerState  []byte              `json:"state,omitempty"`// Orphan may be set for the Destroy transition.Orphanbool `json:"orphan,omitempty"`// ParameterValues are optional. It will write params to the 'workspace' scope.// This will overwrite any existing parameters with the same name.// This will not delete old params not included in this list.RichParameterValues []WorkspaceBuildParameter `json:"rich_parameter_values,omitempty"`// Log level changes the default logging verbosity of a provider ("info" if empty).LogLevelProvisionerLogLevel `json:"log_level,omitempty" validate:"omitempty,oneof=debug"`// TemplateVersionPresetID is the ID of the template version preset to use for the build.TemplateVersionPresetIDuuid.UUID `json:"template_version_preset_id,omitempty" format:"uuid"`// EnableDynamicParameters skips some of the static parameter checking.// It will default to whatever the template has marked as the default experience.// Requires the "dynamic-experiment" to be used.EnableDynamicParameters *bool `json:"enable_dynamic_parameters,omitempty"`}

CreateWorkspaceBuildRequest provides options to update the latest workspace build.

typeCreateWorkspaceProxyRequest

type CreateWorkspaceProxyRequest struct {Namestring `json:"name" validate:"required"`DisplayNamestring `json:"display_name"`Iconstring `json:"icon"`}

typeCreateWorkspaceRequest

type CreateWorkspaceRequest struct {// TemplateID specifies which template should be used for creating the workspace.TemplateIDuuid.UUID `json:"template_id,omitempty" validate:"required_without=TemplateVersionID,excluded_with=TemplateVersionID" format:"uuid"`// TemplateVersionID can be used to specify a specific version of a template for creating the workspace.TemplateVersionIDuuid.UUID `json:"template_version_id,omitempty" validate:"required_without=TemplateID,excluded_with=TemplateID" format:"uuid"`Namestring    `json:"name" validate:"workspace_name,required"`AutostartSchedule *string   `json:"autostart_schedule,omitempty"`TTLMillis         *int64    `json:"ttl_ms,omitempty"`// RichParameterValues allows for additional parameters to be provided// during the initial provision.RichParameterValues     []WorkspaceBuildParameter `json:"rich_parameter_values,omitempty"`AutomaticUpdatesAutomaticUpdates          `json:"automatic_updates,omitempty"`TemplateVersionPresetIDuuid.UUID                 `json:"template_version_preset_id,omitempty" format:"uuid"`EnableDynamicParametersbool                      `json:"enable_dynamic_parameters,omitempty"`}

CreateWorkspaceRequest provides options for creating a new workspace.Either TemplateID or TemplateVersionID must be specified. They cannot both be present.@Description CreateWorkspaceRequest provides options for creating a new workspace.@Description Only one of TemplateID or TemplateVersionID can be specified, not both.@Description If TemplateID is specified, the active version of the template will be used.@Description Workspace names:@Description - Must start with a letter or number@Description - Can only contain letters, numbers, and hyphens@Description - Cannot contain spaces or special characters@Description - Cannot be named `new` or `create`@Description - Must be unique within your workspaces@Description - Maximum length of 32 characters

typeCryptoKeyadded inv2.17.0

type CryptoKey struct {FeatureCryptoKeyFeature `json:"feature"`Secretstring           `json:"secret"`DeletesAttime.Time        `json:"deletes_at" format:"date-time"`Sequenceint32            `json:"sequence"`StartsAttime.Time        `json:"starts_at" format:"date-time"`}

func (CryptoKey)CanSignadded inv2.17.0

func (cCryptoKey) CanSign(nowtime.Time)bool

func (CryptoKey)CanVerifyadded inv2.17.0

func (cCryptoKey) CanVerify(nowtime.Time)bool

typeCryptoKeyFeatureadded inv2.17.0

type CryptoKeyFeaturestring
const (CryptoKeyFeatureWorkspaceAppsAPIKeyCryptoKeyFeature = "workspace_apps_api_key"//nolint:gosec // This denotes a type of key, not a literal.CryptoKeyFeatureWorkspaceAppsTokenCryptoKeyFeature = "workspace_apps_token"CryptoKeyFeatureOIDCConvertCryptoKeyFeature = "oidc_convert"CryptoKeyFeatureTailnetResumeCryptoKeyFeature = "tailnet_resume")

typeCustomRoleRequestadded inv2.15.0

type CustomRoleRequest struct {Namestring       `json:"name" table:"name,default_sort" validate:"username"`DisplayNamestring       `json:"display_name" table:"display name"`SitePermissions []Permission `json:"site_permissions" table:"site permissions"`// OrganizationPermissions are specific to the organization the role belongs to.OrganizationPermissions []Permission `json:"organization_permissions" table:"organization permissions"`UserPermissions         []Permission `json:"user_permissions" table:"user permissions"`}

CustomRoleRequest is used to edit custom roles.

typeDAUEntry

type DAUEntry struct {// Date is a string formatted as 2024-01-31.// Timezone and time information is not included.Datestring `json:"date"`Amountint    `json:"amount"`}

typeDAURequest

type DAURequest struct {TZHourOffsetint}

typeDAUsResponse

type DAUsResponse struct {Entries      []DAUEntry `json:"entries"`TZHourOffsetint        `json:"tz_hour_offset"`}

typeDERP

type DERP struct {ServerDERPServerConfig `json:"server" typescript:",notnull"`ConfigDERPConfig       `json:"config" typescript:",notnull"`}

typeDERPConfig

type DERPConfig struct {BlockDirectserpent.Bool   `json:"block_direct" typescript:",notnull"`ForceWebSocketsserpent.Bool   `json:"force_websockets" typescript:",notnull"`URLserpent.String `json:"url" typescript:",notnull"`Pathserpent.String `json:"path" typescript:",notnull"`}

typeDERPRegion

type DERPRegion struct {Preferredbool    `json:"preferred"`LatencyMillisecondsfloat64 `json:"latency_ms"`}

typeDERPServerConfig

type DERPServerConfig struct {Enableserpent.Bool        `json:"enable" typescript:",notnull"`RegionIDserpent.Int64       `json:"region_id" typescript:",notnull"`RegionCodeserpent.String      `json:"region_code" typescript:",notnull"`RegionNameserpent.String      `json:"region_name" typescript:",notnull"`STUNAddressesserpent.StringArray `json:"stun_addresses" typescript:",notnull"`RelayURLserpent.URL         `json:"relay_url" typescript:",notnull"`}

typeDangerousConfig

type DangerousConfig struct {AllowPathAppSharingserpent.Bool `json:"allow_path_app_sharing" typescript:",notnull"`AllowPathAppSiteOwnerAccessserpent.Bool `json:"allow_path_app_site_owner_access" typescript:",notnull"`AllowAllCorsserpent.Bool `json:"allow_all_cors" typescript:",notnull"`}

typeDeleteWebpushSubscriptionadded inv2.21.0

type DeleteWebpushSubscription struct {Endpointstring `json:"endpoint"`}

typeDeleteWorkspaceAgentPortShareRequestadded inv2.9.0

type DeleteWorkspaceAgentPortShareRequest struct {AgentNamestring `json:"agent_name"`Portint32  `json:"port"`}

typeDeploymentConfig

type DeploymentConfig struct {Values  *DeploymentValues `json:"config,omitempty"`Optionsserpent.OptionSet `json:"options,omitempty"`}

DeploymentConfig contains both the deployment values and how they're set.

typeDeploymentStats

type DeploymentStats struct {// AggregatedFrom is the time in which stats are aggregated from.// This might be back in time a specific duration or interval.AggregatedFromtime.Time `json:"aggregated_from" format:"date-time"`// CollectedAt is the time in which stats are collected at.CollectedAttime.Time `json:"collected_at" format:"date-time"`// NextUpdateAt is the time when the next batch of stats will// be updated.NextUpdateAttime.Time `json:"next_update_at" format:"date-time"`WorkspacesWorkspaceDeploymentStats    `json:"workspaces"`SessionCountSessionCountDeploymentStats `json:"session_count"`}

typeDeploymentValues

type DeploymentValues struct {Verboseserpent.Bool   `json:"verbose,omitempty"`AccessURLserpent.URL    `json:"access_url,omitempty"`WildcardAccessURLserpent.String `json:"wildcard_access_url,omitempty"`DocsURLserpent.URL    `json:"docs_url,omitempty"`RedirectToAccessURLserpent.Bool   `json:"redirect_to_access_url,omitempty"`// HTTPAddress is a string because it may be set to zero to disable.HTTPAddressserpent.String                       `json:"http_address,omitempty" typescript:",notnull"`AutobuildPollIntervalserpent.Duration                     `json:"autobuild_poll_interval,omitempty"`JobReaperDetectorIntervalserpent.Duration                     `json:"job_hang_detector_interval,omitempty"`DERPDERP                                 `json:"derp,omitempty" typescript:",notnull"`PrometheusPrometheusConfig                     `json:"prometheus,omitempty" typescript:",notnull"`PprofPprofConfig                          `json:"pprof,omitempty" typescript:",notnull"`ProxyTrustedHeadersserpent.StringArray                  `json:"proxy_trusted_headers,omitempty" typescript:",notnull"`ProxyTrustedOriginsserpent.StringArray                  `json:"proxy_trusted_origins,omitempty" typescript:",notnull"`CacheDirserpent.String                       `json:"cache_directory,omitempty" typescript:",notnull"`InMemoryDatabaseserpent.Bool                         `json:"in_memory_database,omitempty" typescript:",notnull"`EphemeralDeploymentserpent.Bool                         `json:"ephemeral_deployment,omitempty" typescript:",notnull"`PostgresURLserpent.String                       `json:"pg_connection_url,omitempty" typescript:",notnull"`PostgresAuthstring                               `json:"pg_auth,omitempty" typescript:",notnull"`OAuth2OAuth2Config                         `json:"oauth2,omitempty" typescript:",notnull"`OIDCOIDCConfig                           `json:"oidc,omitempty" typescript:",notnull"`TelemetryTelemetryConfig                      `json:"telemetry,omitempty" typescript:",notnull"`TLSTLSConfig                            `json:"tls,omitempty" typescript:",notnull"`TraceTraceConfig                          `json:"trace,omitempty" typescript:",notnull"`HTTPCookiesHTTPCookieConfig                     `json:"http_cookies,omitempty" typescript:",notnull"`StrictTransportSecurityserpent.Int64                        `json:"strict_transport_security,omitempty" typescript:",notnull"`StrictTransportSecurityOptionsserpent.StringArray                  `json:"strict_transport_security_options,omitempty" typescript:",notnull"`SSHKeygenAlgorithmserpent.String                       `json:"ssh_keygen_algorithm,omitempty" typescript:",notnull"`MetricsCacheRefreshIntervalserpent.Duration                     `json:"metrics_cache_refresh_interval,omitempty" typescript:",notnull"`AgentStatRefreshIntervalserpent.Duration                     `json:"agent_stat_refresh_interval,omitempty" typescript:",notnull"`AgentFallbackTroubleshootingURLserpent.URL                          `json:"agent_fallback_troubleshooting_url,omitempty" typescript:",notnull"`BrowserOnlyserpent.Bool                         `json:"browser_only,omitempty" typescript:",notnull"`SCIMAPIKeyserpent.String                       `json:"scim_api_key,omitempty" typescript:",notnull"`ExternalTokenEncryptionKeysserpent.StringArray                  `json:"external_token_encryption_keys,omitempty" typescript:",notnull"`ProvisionerProvisionerConfig                    `json:"provisioner,omitempty" typescript:",notnull"`RateLimitRateLimitConfig                      `json:"rate_limit,omitempty" typescript:",notnull"`Experimentsserpent.StringArray                  `json:"experiments,omitempty" typescript:",notnull"`UpdateCheckserpent.Bool                         `json:"update_check,omitempty" typescript:",notnull"`SwaggerSwaggerConfig                        `json:"swagger,omitempty" typescript:",notnull"`LoggingLoggingConfig                        `json:"logging,omitempty" typescript:",notnull"`DangerousDangerousConfig                      `json:"dangerous,omitempty" typescript:",notnull"`DisablePathAppsserpent.Bool                         `json:"disable_path_apps,omitempty" typescript:",notnull"`SessionsSessionLifetime                      `json:"session_lifetime,omitempty" typescript:",notnull"`DisablePasswordAuthserpent.Bool                         `json:"disable_password_auth,omitempty" typescript:",notnull"`SupportSupportConfig                        `json:"support,omitempty" typescript:",notnull"`ExternalAuthConfigsserpent.Struct[[]ExternalAuthConfig] `json:"external_auth,omitempty" typescript:",notnull"`AIserpent.Struct[AIConfig]             `json:"ai,omitempty" typescript:",notnull"`SSHConfigSSHConfig                            `json:"config_ssh,omitempty" typescript:",notnull"`WgtunnelHostserpent.String                       `json:"wgtunnel_host,omitempty" typescript:",notnull"`DisableOwnerWorkspaceExecserpent.Bool                         `json:"disable_owner_workspace_exec,omitempty" typescript:",notnull"`ProxyHealthStatusIntervalserpent.Duration                     `json:"proxy_health_status_interval,omitempty" typescript:",notnull"`EnableTerraformDebugModeserpent.Bool                         `json:"enable_terraform_debug_mode,omitempty" typescript:",notnull"`UserQuietHoursScheduleUserQuietHoursScheduleConfig         `json:"user_quiet_hours_schedule,omitempty" typescript:",notnull"`WebTerminalRendererserpent.String                       `json:"web_terminal_renderer,omitempty" typescript:",notnull"`AllowWorkspaceRenamesserpent.Bool                         `json:"allow_workspace_renames,omitempty" typescript:",notnull"`HealthcheckHealthcheckConfig                    `json:"healthcheck,omitempty" typescript:",notnull"`CLIUpgradeMessageserpent.String                       `json:"cli_upgrade_message,omitempty" typescript:",notnull"`TermsOfServiceURLserpent.String                       `json:"terms_of_service_url,omitempty" typescript:",notnull"`NotificationsNotificationsConfig                  `json:"notifications,omitempty" typescript:",notnull"`AdditionalCSPPolicyserpent.StringArray                  `json:"additional_csp_policy,omitempty" typescript:",notnull"`WorkspaceHostnameSuffixserpent.String                       `json:"workspace_hostname_suffix,omitempty" typescript:",notnull"`PrebuildsPrebuildsConfig                      `json:"workspace_prebuilds,omitempty" typescript:",notnull"`Configserpent.YAMLConfigPath `json:"config,omitempty" typescript:",notnull"`WriteConfigserpent.Bool           `json:"write_config,omitempty" typescript:",notnull"`// Deprecated: Use HTTPAddress or TLS.Address instead.Addressserpent.HostPort `json:"address,omitempty" typescript:",notnull"`}

DeploymentValues is the central configuration values the coder server.

func (*DeploymentValues)Options

func (*DeploymentValues)WithoutSecrets

func (c *DeploymentValues) WithoutSecrets() (*DeploymentValues,error)

WithoutSecrets returns a copy of the config without secret values.

typeDiagnosticExtraadded inv2.23.0

type DiagnosticExtra struct {Codestring `json:"code"`}

typeDiagnosticSeverityStringadded inv2.23.0

type DiagnosticSeverityStringstring
const (DiagnosticSeverityErrorDiagnosticSeverityString = "error"DiagnosticSeverityWarningDiagnosticSeverityString = "warning")

typeDisplayAppadded inv2.1.5

type DisplayAppstring
const (DisplayAppVSCodeDesktopDisplayApp = "vscode"DisplayAppVSCodeInsidersDisplayApp = "vscode_insiders"DisplayAppWebTerminalDisplayApp = "web_terminal"DisplayAppPortForwardDisplayApp = "port_forwarding_helper"DisplayAppSSHDisplayApp = "ssh_helper")

typeDynamicParametersRequestadded inv2.22.0

type DynamicParametersRequest struct {// ID identifies the request. The response contains the same// ID so that the client can match it to the request.IDint               `json:"id"`Inputs map[string]string `json:"inputs"`// OwnerID if uuid.Nil, it defaults to `codersdk.Me`OwnerIDuuid.UUID `json:"owner_id,omitempty" format:"uuid"`}

typeDynamicParametersResponseadded inv2.22.0

type DynamicParametersResponse struct {IDint                  `json:"id"`Diagnostics []FriendlyDiagnostic `json:"diagnostics"`Parameters  []PreviewParameter   `json:"parameters"`}

typeEnhancedExternalAuthProvideradded inv2.2.1

type EnhancedExternalAuthProviderstring

EnhancedExternalAuthProvider is a constant that represents enhancedsupport for a type of external authentication. All of the Git providersare examples of enhanced, because they support intercepting "git clone".

const (EnhancedExternalAuthProviderAzureDevopsEnhancedExternalAuthProvider = "azure-devops"// Authenticate to ADO using an app registration in Entra IDEnhancedExternalAuthProviderAzureDevopsEntraEnhancedExternalAuthProvider = "azure-devops-entra"EnhancedExternalAuthProviderGitHubEnhancedExternalAuthProvider = "github"EnhancedExternalAuthProviderGitLabEnhancedExternalAuthProvider = "gitlab"// EnhancedExternalAuthProviderBitBucketCloud is the Bitbucket Cloud provider.// Not to be confused with the self-hosted 'EnhancedExternalAuthProviderBitBucketServer'EnhancedExternalAuthProviderBitBucketCloudEnhancedExternalAuthProvider = "bitbucket-cloud"EnhancedExternalAuthProviderBitBucketServerEnhancedExternalAuthProvider = "bitbucket-server"EnhancedExternalAuthProviderSlackEnhancedExternalAuthProvider = "slack"EnhancedExternalAuthProviderJFrogEnhancedExternalAuthProvider = "jfrog"EnhancedExternalAuthProviderGiteaEnhancedExternalAuthProvider = "gitea")

func (EnhancedExternalAuthProvider)Gitadded inv2.2.1

Git returns whether the provider is a Git provider.

func (EnhancedExternalAuthProvider)Stringadded inv2.2.1

typeEntitlement

type Entitlementstring

Entitlement represents whether a feature is licensed.

const (EntitlementEntitledEntitlement = "entitled"EntitlementGracePeriodEntitlement = "grace_period"EntitlementNotEntitledEntitlement = "not_entitled")

func (Entitlement)Entitledadded inv2.15.0

func (eEntitlement) Entitled()bool

Entitled returns if the entitlement can be used. So this is true if itis entitled or still in it's grace period.

func (Entitlement)Weightadded inv2.14.0

func (eEntitlement) Weight()int

Weight converts the enum types to a numerical value for easiercomparisons. Easier than sets of if statements.

typeEntitlements

type Entitlements struct {Features         map[FeatureName]Feature `json:"features"`Warnings         []string                `json:"warnings"`Errors           []string                `json:"errors"`HasLicensebool                    `json:"has_license"`Trialbool                    `json:"trial"`RequireTelemetrybool                    `json:"require_telemetry"`RefreshedAttime.Time               `json:"refreshed_at" format:"date-time"`}

func (*Entitlements)AddFeatureadded inv2.14.0

func (e *Entitlements) AddFeature(nameFeatureName, addFeature)

AddFeature will add the feature to the entitlements iff it expandsthe set of features granted by the entitlements. If it does not, it willbe ignored and the existing feature with the same name will remain.

All features should be added as atomic items, and not merged in any way.Merging entitlements could lead to unexpected behavior, like a larger userlimit in grace period merging with a smaller one in an "entitled" state. Thiscould lead to the larger limit being extended as "entitled", which is not correct.

typeError

type Error struct {ResponseHelperstring// contains filtered or unexported fields}

Error represents an unaccepted or invalid request to the API.@typescript-ignore Error

funcAsError

func AsError(errerror) (*Error,bool)

func (*Error)Error

func (e *Error) Error()string

func (*Error)Friendly

func (e *Error) Friendly()string

func (*Error)Methodadded inv2.2.1

func (e *Error) Method()string

func (*Error)StatusCode

func (e *Error) StatusCode()int

func (*Error)URLadded inv2.2.1

func (e *Error) URL()string

typeExperiment

type Experimentstring
const (// Add new experiments here!ExperimentExampleExperiment = "example"// This isn't used for anything.ExperimentAutoFillParametersExperiment = "auto-fill-parameters"// This should not be taken out of experiments until we have redesigned the feature.ExperimentNotificationsExperiment = "notifications"// Sends notifications via SMTP and webhooks following certain events.ExperimentWorkspaceUsageExperiment = "workspace-usage"// Enables the new workspace usage tracking.ExperimentWebPushExperiment = "web-push"// Enables web push notifications through the browser.ExperimentDynamicParametersExperiment = "dynamic-parameters"// Enables dynamic parameters when creating a workspace.ExperimentWorkspacePrebuildsExperiment = "workspace-prebuilds"// Enables the new workspace prebuilds feature.ExperimentAgenticChatExperiment = "agentic-chat"// Enables the new agentic AI chat feature.ExperimentAITasksExperiment = "ai-tasks"// Enables the new AI tasks feature.)

typeExperiments

type Experiments []Experiment

Experiments is a list of experiments.Multiple experiments may be enabled at the same time.Experiments are not safe for production use, and are not guaranteed tobe backwards compatible. They may be removed or renamed at any time.

func (Experiments)Enabled

func (eExperiments) Enabled(exExperiment)bool

Returns a list of experiments that are enabled for the deployment.

typeExternalAuthadded inv2.2.1

type ExternalAuth struct {Authenticatedbool   `json:"authenticated"`Devicebool   `json:"device"`DisplayNamestring `json:"display_name"`// User is the user that authenticated with the provider.User *ExternalAuthUser `json:"user"`// AppInstallable is true if the request for app installs was successful.AppInstallablebool `json:"app_installable"`// AppInstallations are the installations that the user has access to.AppInstallations []ExternalAuthAppInstallation `json:"installations"`// AppInstallURL is the URL to install the app.AppInstallURLstring `json:"app_install_url"`}

typeExternalAuthAppInstallationadded inv2.2.1

type ExternalAuthAppInstallation struct {IDint              `json:"id"`AccountExternalAuthUser `json:"account"`ConfigureURLstring           `json:"configure_url"`}

typeExternalAuthConfigadded inv2.2.1

type ExternalAuthConfig struct {// Type is the type of external auth config.Typestring `json:"type" yaml:"type"`ClientIDstring `json:"client_id" yaml:"client_id"`ClientSecretstring `json:"-" yaml:"client_secret"`// ID is a unique identifier for the auth config.// It defaults to `type` when not provided.IDstring   `json:"id" yaml:"id"`AuthURLstring   `json:"auth_url" yaml:"auth_url"`TokenURLstring   `json:"token_url" yaml:"token_url"`ValidateURLstring   `json:"validate_url" yaml:"validate_url"`AppInstallURLstring   `json:"app_install_url" yaml:"app_install_url"`AppInstallationsURLstring   `json:"app_installations_url" yaml:"app_installations_url"`NoRefreshbool     `json:"no_refresh" yaml:"no_refresh"`Scopes              []string `json:"scopes" yaml:"scopes"`ExtraTokenKeys      []string `json:"-" yaml:"extra_token_keys"`DeviceFlowbool     `json:"device_flow" yaml:"device_flow"`DeviceCodeURLstring   `json:"device_code_url" yaml:"device_code_url"`// Regex allows API requesters to match an auth config by// a string (e.g. coder.com) instead of by it's type.//// Git clone makes use of this by parsing the URL from:// 'Username for "https://github.com":'// And sending it to the Coder server to match against the Regex.Regexstring `json:"regex" yaml:"regex"`// DisplayName is shown in the UI to identify the auth config.DisplayNamestring `json:"display_name" yaml:"display_name"`// DisplayIcon is a URL to an icon to display in the UI.DisplayIconstring `json:"display_icon" yaml:"display_icon"`}

typeExternalAuthDeviceadded inv2.2.1

type ExternalAuthDevice struct {DeviceCodestring `json:"device_code"`UserCodestring `json:"user_code"`VerificationURIstring `json:"verification_uri"`ExpiresInint    `json:"expires_in"`Intervalint    `json:"interval"`}

ExternalAuthDevice is the response from the device authorization endpoint.See:https://tools.ietf.org/html/rfc8628#section-3.2

typeExternalAuthDeviceExchangeadded inv2.2.1

type ExternalAuthDeviceExchange struct {DeviceCodestring `json:"device_code"`}

typeExternalAuthLinkadded inv2.5.0

type ExternalAuthLink struct {ProviderIDstring    `json:"provider_id"`CreatedAttime.Time `json:"created_at" format:"date-time"`UpdatedAttime.Time `json:"updated_at" format:"date-time"`HasRefreshTokenbool      `json:"has_refresh_token"`Expirestime.Time `json:"expires" format:"date-time"`Authenticatedbool      `json:"authenticated"`ValidateErrorstring    `json:"validate_error"`}

ExternalAuthLink is a link between a user and an external auth provider.It excludes information that requires a token to access, so can be staticallybuilt from the database and configs.

typeExternalAuthLinkProvideradded inv2.5.0

type ExternalAuthLinkProvider struct {IDstring `json:"id"`Typestring `json:"type"`Devicebool   `json:"device"`DisplayNamestring `json:"display_name"`DisplayIconstring `json:"display_icon"`AllowRefreshbool   `json:"allow_refresh"`AllowValidatebool   `json:"allow_validate"`}

ExternalAuthLinkProvider are the static details of a provider.

typeExternalAuthUseradded inv2.2.1

type ExternalAuthUser struct {IDint64  `json:"id"`Loginstring `json:"login"`AvatarURLstring `json:"avatar_url"`ProfileURLstring `json:"profile_url"`Namestring `json:"name"`}

typeFeature

type Feature struct {EntitlementEntitlement `json:"entitlement"`Enabledbool        `json:"enabled"`Limit       *int64      `json:"limit,omitempty"`Actual      *int64      `json:"actual,omitempty"`}

func (Feature)Capableadded inv2.14.0

func (fFeature) Capable()bool

Capable is a helper function that returns if a given feature has a limitthat is greater than or equal to the actual.If this condition is not true, then the feature is not capable of being usedsince the limit is not high enough.

func (Feature)Compareadded inv2.14.0

func (fFeature) Compare(bFeature)int

Compare compares two features and returns an integer representingif the first feature (f) is greater than, equal to, or less than the secondfeature (b). "Greater than" means the first feature has more functionalitythan the second feature. It is assumed the features are for the same FeatureName.

A feature is considered greater than another feature if:1. Graceful & capable > Entitled & not capable2. The entitlement is greater3. The limit is greater4. Enabled is greater than disabled5. The actual is greater

typeFeatureName

type FeatureNamestring

FeatureName represents the internal name of a feature.To add a new feature, add it to this set of enums as well as the FeatureNamesarray below.

const (FeatureUserLimitFeatureName = "user_limit"FeatureAuditLogFeatureName = "audit_log"FeatureBrowserOnlyFeatureName = "browser_only"FeatureSCIMFeatureName = "scim"FeatureTemplateRBACFeatureName = "template_rbac"FeatureUserRoleManagementFeatureName = "user_role_management"FeatureHighAvailabilityFeatureName = "high_availability"FeatureMultipleExternalAuthFeatureName = "multiple_external_auth"FeatureExternalProvisionerDaemonsFeatureName = "external_provisioner_daemons"FeatureAppearanceFeatureName = "appearance"FeatureAdvancedTemplateSchedulingFeatureName = "advanced_template_scheduling"FeatureWorkspaceProxyFeatureName = "workspace_proxy"FeatureExternalTokenEncryptionFeatureName = "external_token_encryption"FeatureWorkspaceBatchActionsFeatureName = "workspace_batch_actions"FeatureAccessControlFeatureName = "access_control"FeatureControlSharedPortsFeatureName = "control_shared_ports"FeatureCustomRolesFeatureName = "custom_roles"FeatureMultipleOrganizationsFeatureName = "multiple_organizations"FeatureWorkspacePrebuildsFeatureName = "workspace_prebuilds")

func (FeatureName)AlwaysEnable

func (nFeatureName) AlwaysEnable()bool

AlwaysEnable returns if the feature is always enabled if entitled.This is required because some features are only enabled if they are entitledand not required.E.g: "multiple-organizations" is disabled by default in AGPL and enterprisedeployments. This feature should only be enabled for premium deploymentswhen it is entitled.

func (FeatureName)Enterpriseadded inv2.15.0

func (nFeatureName) Enterprise()bool

Enterprise returns true if the feature is an enterprise feature.

func (FeatureName)Humanize

func (nFeatureName) Humanize()string

Humanize returns the feature name in a human-readable format.

typeFeatureSetadded inv2.14.0

type FeatureSetstring

FeatureSet represents a grouping of features. Rather than manuallyassigning features al-la-carte when making a license, a set can be specified.Sets are dynamic in the sense a feature can be added to a set, granting thefeature to existing licenses out in the wild.If features were granted al-la-carte, we would need to reissue the existingold licenses to include the new feature.

const (FeatureSetNoneFeatureSet = ""FeatureSetEnterpriseFeatureSet = "enterprise"FeatureSetPremiumFeatureSet = "premium")

func (FeatureSet)Featuresadded inv2.14.0

func (setFeatureSet) Features() []FeatureName

typeFriendlyDiagnosticadded inv2.22.0

type FriendlyDiagnostic struct {SeverityDiagnosticSeverityString `json:"severity"`Summarystring                   `json:"summary"`Detailstring                   `json:"detail"`ExtraDiagnosticExtra `json:"extra"`}

FriendlyDiagnostic == previewtypes.FriendlyDiagnosticCopied to avoid import deps

typeGenerateAPIKeyResponse

type GenerateAPIKeyResponse struct {Keystring `json:"key"`}

GenerateAPIKeyResponse contains an API key for a user.

typeGetInboxNotificationResponseadded inv2.21.0

type GetInboxNotificationResponse struct {NotificationInboxNotification `json:"notification"`UnreadCountint               `json:"unread_count"`}

typeGetUserStatusCountsRequestadded inv2.19.0

type GetUserStatusCountsRequest struct {Offsettime.Time `json:"offset" format:"date-time"`}

typeGetUserStatusCountsResponseadded inv2.19.0

type GetUserStatusCountsResponse struct {StatusCounts map[UserStatus][]UserStatusChangeCount `json:"status_counts"`}

typeGetUsersResponse

type GetUsersResponse struct {Users []User `json:"users"`Countint    `json:"count"`}

typeGitSSHKey

type GitSSHKey struct {UserIDuuid.UUID `json:"user_id" format:"uuid"`CreatedAttime.Time `json:"created_at" format:"date-time"`UpdatedAttime.Time `json:"updated_at" format:"date-time"`// PublicKey is the SSH public key in OpenSSH format.// Example: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID3OmYJvT7q1cF1azbybYy0OZ9yrXfA+M6Lr4vzX5zlp\n"// Note: The key includes a trailing newline (\n).PublicKeystring `json:"public_key"`}

typeGithubAuthMethodadded inv2.20.0

type GithubAuthMethod struct {Enabledbool `json:"enabled"`DefaultProviderConfiguredbool `json:"default_provider_configured"`}

typeGroup

type Group struct {IDuuid.UUID     `json:"id" format:"uuid"`Namestring        `json:"name"`DisplayNamestring        `json:"display_name"`OrganizationIDuuid.UUID     `json:"organization_id" format:"uuid"`Members        []ReducedUser `json:"members"`// How many members are in this group. Shows the total count,// even if the user is not authorized to read group member details.// May be greater than `len(Group.Members)`.TotalMemberCountint         `json:"total_member_count"`AvatarURLstring      `json:"avatar_url"`QuotaAllowanceint         `json:"quota_allowance"`SourceGroupSource `json:"source"`OrganizationNamestring      `json:"organization_name"`OrganizationDisplayNamestring      `json:"organization_display_name"`}

func (Group)IsEveryone

func (gGroup) IsEveryone()bool

typeGroupArgumentsadded inv2.15.0

type GroupArguments struct {// Organization can be an org UUID or nameOrganizationstring// HasMember can be a user uuid or usernameHasMemberstring// GroupIDs is a list of group UUIDs to filter by.// If not set, all groups will be returned.GroupIDs []uuid.UUID}

typeGroupSource

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

typeGroupSyncSettingsadded inv2.16.0

type GroupSyncSettings struct {// Field is the name of the claim field that specifies what groups a user// should be in. If empty, no groups will be synced.Fieldstring `json:"field"`// Mapping is a map from OIDC groups to Coder group IDsMapping map[string][]uuid.UUID `json:"mapping"`// RegexFilter is a regular expression that filters the groups returned by// the OIDC provider. Any group not matched by this regex will be ignored.// If the group filter is nil, then no group filtering will occur.RegexFilter *regexp.Regexp `json:"regex_filter"`// AutoCreateMissing controls whether groups returned by the OIDC provider// are automatically created in Coder if they are missing.AutoCreateMissingbool `json:"auto_create_missing_groups"`// LegacyNameMapping is deprecated. It remaps an IDP group name to// a Coder group name. Since configuration is now done at runtime,// group IDs are used to account for group renames.// For legacy configurations, this config option has to remain.// Deprecated: Use Mapping instead.LegacyNameMapping map[string]string `json:"legacy_group_name_mapping,omitempty"`}

typeHTTPCookieConfigadded inv2.22.0

type HTTPCookieConfig struct {Secureserpent.Bool `json:"secure_auth_cookie,omitempty" typescript:",notnull"`SameSitestring       `json:"same_site,omitempty" typescript:",notnull"`}

func (*HTTPCookieConfig)Applyadded inv2.22.0

func (cfg *HTTPCookieConfig) Apply(c *http.Cookie) *http.Cookie

func (HTTPCookieConfig)HTTPSameSiteadded inv2.22.0

func (cfgHTTPCookieConfig) HTTPSameSite()http.SameSite

typeHeaderTransportadded inv2.5.0

type HeaderTransport struct {Transporthttp.RoundTripperHeaderhttp.Header}

HeaderTransport is a http.RoundTripper that adds some headers to all requests.@typescript-ignore HeaderTransport

func (*HeaderTransport)CloseIdleConnectionsadded inv2.5.0

func (h *HeaderTransport) CloseIdleConnections()

func (*HeaderTransport)RoundTripadded inv2.5.0

func (h *HeaderTransport) RoundTrip(req *http.Request) (*http.Response,error)

typeHealthcheck

type Healthcheck struct {// URL specifies the endpoint to check for the app health.URLstring `json:"url"`// Interval specifies the seconds between each health check.Intervalint32 `json:"interval"`// Threshold specifies the number of consecutive failed health checks before returning "unhealthy".Thresholdint32 `json:"threshold"`}

typeHealthcheckConfigadded inv2.4.0

type HealthcheckConfig struct {Refreshserpent.Duration `json:"refresh" typescript:",notnull"`ThresholdDatabaseserpent.Duration `json:"threshold_database" typescript:",notnull"`}

HealthcheckConfig contains configuration for healthchecks.

typeIDPSyncMappingadded inv2.19.0

type IDPSyncMapping[ResourceIdTypeuuid.UUID |string] struct {// The IdP claim the user hasGivenstring// The ID of the Coder resource the user should be added toGets ResourceIdType}

typeInboxNotificationadded inv2.21.0

type InboxNotification struct {IDuuid.UUID                 `json:"id" format:"uuid"`UserIDuuid.UUID                 `json:"user_id" format:"uuid"`TemplateIDuuid.UUID                 `json:"template_id" format:"uuid"`Targets    []uuid.UUID               `json:"targets" format:"uuid"`Titlestring                    `json:"title"`Contentstring                    `json:"content"`Iconstring                    `json:"icon"`Actions    []InboxNotificationAction `json:"actions"`ReadAt     *time.Time                `json:"read_at"`CreatedAttime.Time                 `json:"created_at" format:"date-time"`}

typeInboxNotificationActionadded inv2.21.0

type InboxNotificationAction struct {Labelstring `json:"label"`URLstring `json:"url"`}

typeInsightsReportInterval

type InsightsReportIntervalstring

InsightsReportInterval is the interval of time over which to generate asmaller insights report within a time range.

const (InsightsReportIntervalDayInsightsReportInterval = "day"InsightsReportIntervalWeekInsightsReportInterval = "week")

InsightsReportInterval enums.

func (InsightsReportInterval)Daysadded inv2.2.0

func (intervalInsightsReportInterval) Days()int32

Days returns the duration of the interval in days.

typeIssueReconnectingPTYSignedTokenRequest

type IssueReconnectingPTYSignedTokenRequest struct {// URL is the URL of the reconnecting-pty endpoint you are connecting to.URLstring    `json:"url" validate:"required"`AgentIDuuid.UUID `json:"agentID" format:"uuid" validate:"required"`}

typeIssueReconnectingPTYSignedTokenResponse

type IssueReconnectingPTYSignedTokenResponse struct {SignedTokenstring `json:"signed_token"`}

typeJobErrorCode

type JobErrorCodestring

JobErrorCode defines the error code returned by job runner.

const (RequiredTemplateVariablesJobErrorCode = "REQUIRED_TEMPLATE_VARIABLES")

typeLanguageModeladded inv2.23.0

type LanguageModel struct {// ID is used by the provider to identify the LLM.IDstring `json:"id"`DisplayNamestring `json:"display_name"`// Provider is the provider of the LLM. e.g. openai, anthropic, etc.Providerstring `json:"provider"`}

LanguageModel is a language model that can be used for chat.

typeLanguageModelConfigadded inv2.23.0

type LanguageModelConfig struct {Models []LanguageModel `json:"models"`}

typeLicense

type License struct {IDint32     `json:"id"`UUIDuuid.UUID `json:"uuid" format:"uuid"`UploadedAttime.Time `json:"uploaded_at" format:"date-time"`// Claims are the JWT claims asserted by the license.  Here we use// a generic string map to ensure that all data from the server is// parsed verbatim, not just the fields this version of Coder// understands.Claims map[string]interface{} `json:"claims" table:"claims"`}

func (*License)AllFeaturesClaim

func (l *License) AllFeaturesClaim()bool

func (*License)ExpiresAt

func (l *License) ExpiresAt() (time.Time,error)

ExpiresAt returns the expiration time of the license.If the claim is missing or has an unexpected type, an error is returned.

func (*License)FeaturesClaims

func (l *License) FeaturesClaims() (map[FeatureName]int64,error)

FeaturesClaims provides the feature claims in license.This only returns the explicit claims. If checking for actual usage,also check `AllFeaturesClaim`.

func (*License)Trial

func (l *License) Trial()bool

typeLicensorTrialRequestadded inv2.7.0

type LicensorTrialRequest struct {DeploymentIDstring `json:"deployment_id"`Emailstring `json:"email"`Sourcestring `json:"source"`// Personal details.FirstNamestring `json:"first_name"`LastNamestring `json:"last_name"`PhoneNumberstring `json:"phone_number"`JobTitlestring `json:"job_title"`CompanyNamestring `json:"company_name"`Countrystring `json:"country"`Developersstring `json:"developers"`}

@typescript-ignore LicensorTrialRequest

typeLinkConfig

type LinkConfig struct {Namestring `json:"name" yaml:"name"`Targetstring `json:"target" yaml:"target"`Iconstring `json:"icon" yaml:"icon" enums:"bug,chat,docs"`}

funcDefaultSupportLinksadded inv2.16.0

func DefaultSupportLinks(docsURLstring) []LinkConfig

typeListInboxNotificationsRequestadded inv2.21.0

type ListInboxNotificationsRequest struct {Targetsstring `json:"targets,omitempty"`Templatesstring `json:"templates,omitempty"`ReadStatusstring `json:"read_status,omitempty"`StartingBeforestring `json:"starting_before,omitempty"`}

typeListInboxNotificationsResponseadded inv2.21.0

type ListInboxNotificationsResponse struct {Notifications []InboxNotification `json:"notifications"`UnreadCountint                 `json:"unread_count"`}

typeListUserExternalAuthResponseadded inv2.5.0

type ListUserExternalAuthResponse struct {Providers []ExternalAuthLinkProvider `json:"providers"`// Links are all the authenticated links for the user.// If a link has a provider ID that does not exist, then that provider// is no longer configured, rendering it unusable. It is still valuable// to include these links so that the user can unlink them.Links []ExternalAuthLink `json:"links"`}

typeLogLevel

type LogLevelstring

typeLogSource

type LogSourcestring

typeLoggingConfig

type LoggingConfig struct {Filterserpent.StringArray `json:"log_filter" typescript:",notnull"`Humanserpent.String      `json:"human" typescript:",notnull"`JSONserpent.String      `json:"json" typescript:",notnull"`Stackdriverserpent.String      `json:"stackdriver" typescript:",notnull"`}

typeLoginType

type LoginTypestring

LoginType is the type of login used to create the API key.

const (LoginTypeUnknownLoginType = ""LoginTypePasswordLoginType = "password"LoginTypeGithubLoginType = "github"LoginTypeOIDCLoginType = "oidc"LoginTypeTokenLoginType = "token"// LoginTypeNone is used if no login method is available for this user.// If this is set, the user has no method of logging in.// API keys can still be created by an owner and used by the user.// These keys would use the `LoginTypeToken` type.LoginTypeNoneLoginType = "none")

typeLoginWithPasswordRequest

type LoginWithPasswordRequest struct {Emailstring `json:"email" validate:"required,email" format:"email"`Passwordstring `json:"password" validate:"required"`}

LoginWithPasswordRequest enables callers to authenticate with email and password.

typeLoginWithPasswordResponse

type LoginWithPasswordResponse struct {SessionTokenstring `json:"session_token" validate:"required"`}

LoginWithPasswordResponse contains a session token for the newly authenticated user.

typeMatchedProvisionersadded inv2.18.0

type MatchedProvisioners struct {// Count is the number of provisioner daemons that matched the given// tags. If the count is 0, it means no provisioner daemons matched the// requested tags.Countint `json:"count"`// Available is the number of provisioner daemons that are available to// take jobs. This may be less than the count if some provisioners are// busy or have been stopped.Availableint `json:"available"`// MostRecentlySeen is the most recently seen time of the set of matched// provisioners. If no provisioners matched, this field will be null.MostRecentlySeenNullTime `json:"most_recently_seen,omitempty" format:"date-time"`}

MatchedProvisioners represents the number of provisioner daemonsavailable to take a job at a specific point in time.Introduced in Coder version 2.18.0.

typeMinimalOrganizationadded inv2.14.0

type MinimalOrganization struct {IDuuid.UUID `table:"id" json:"id" validate:"required" format:"uuid"`Namestring    `table:"name,default_sort" json:"name"`DisplayNamestring    `table:"display name" json:"display_name"`Iconstring    `table:"icon" json:"icon"`}

typeMinimalUser

type MinimalUser struct {IDuuid.UUID `json:"id" validate:"required" table:"id" format:"uuid"`Usernamestring    `json:"username" validate:"required" table:"username,default_sort"`AvatarURLstring    `json:"avatar_url,omitempty" format:"uri"`}

MinimalUser is the minimal information needed to identify a user and showthem on the UI.

typeNotificationMethodsResponseadded inv2.15.0

type NotificationMethodsResponse struct {AvailableNotificationMethods []string `json:"available"`DefaultNotificationMethodstring   `json:"default"`}

typeNotificationPreferenceadded inv2.15.0

type NotificationPreference struct {NotificationTemplateIDuuid.UUID `json:"id" format:"uuid"`Disabledbool      `json:"disabled"`UpdatedAttime.Time `json:"updated_at" format:"date-time"`}

typeNotificationTemplateadded inv2.15.0

type NotificationTemplate struct {IDuuid.UUID `json:"id" format:"uuid"`Namestring    `json:"name"`TitleTemplatestring    `json:"title_template"`BodyTemplatestring    `json:"body_template"`Actionsstring    `json:"actions" format:""`Groupstring    `json:"group"`Methodstring    `json:"method"`Kindstring    `json:"kind"`EnabledByDefaultbool      `json:"enabled_by_default"`}

typeNotificationsConfigadded inv2.14.0

type NotificationsConfig struct {// The upper limit of attempts to send a notification.MaxSendAttemptsserpent.Int64 `json:"max_send_attempts" typescript:",notnull"`// The minimum time between retries.RetryIntervalserpent.Duration `json:"retry_interval" typescript:",notnull"`// The notifications system buffers message updates in memory to ease pressure on the database.// This option controls how often it synchronizes its state with the database. The shorter this value the// lower the change of state inconsistency in a non-graceful shutdown - but it also increases load on the// database. It is recommended to keep this option at its default value.StoreSyncIntervalserpent.Duration `json:"sync_interval" typescript:",notnull"`// The notifications system buffers message updates in memory to ease pressure on the database.// This option controls how many updates are kept in memory. The lower this value the// lower the change of state inconsistency in a non-graceful shutdown - but it also increases load on the// database. It is recommended to keep this option at its default value.StoreSyncBufferSizeserpent.Int64 `json:"sync_buffer_size" typescript:",notnull"`// How long a notifier should lease a message. This is effectively how long a notification is 'owned'// by a notifier, and once this period expires it will be available for lease by another notifier. Leasing// is important in order for multiple running notifiers to not pick the same messages to deliver concurrently.// This lease period will only expire if a notifier shuts down ungracefully; a dispatch of the notification// releases the lease.LeasePeriodserpent.Duration `json:"lease_period"`// How many notifications a notifier should lease per fetch interval.LeaseCountserpent.Int64 `json:"lease_count"`// How often to query the database for queued notifications.FetchIntervalserpent.Duration `json:"fetch_interval"`// Which delivery method to use (available options: 'smtp', 'webhook').Methodserpent.String `json:"method"`// How long to wait while a notification is being sent before giving up.DispatchTimeoutserpent.Duration `json:"dispatch_timeout"`// SMTP settings.SMTPNotificationsEmailConfig `json:"email" typescript:",notnull"`// Webhook settings.WebhookNotificationsWebhookConfig `json:"webhook" typescript:",notnull"`// Inbox settings.InboxNotificationsInboxConfig `json:"inbox" typescript:",notnull"`}

func (*NotificationsConfig)Enabledadded inv2.18.0

func (n *NotificationsConfig) Enabled()bool

Are either of the notification methods enabled?

typeNotificationsEmailAuthConfigadded inv2.14.0

type NotificationsEmailAuthConfig struct {// Identity for PLAIN auth.Identityserpent.String `json:"identity" typescript:",notnull"`// Username for LOGIN/PLAIN auth.Usernameserpent.String `json:"username" typescript:",notnull"`// Password for LOGIN/PLAIN auth.Passwordserpent.String `json:"password" typescript:",notnull"`// File from which to load the password for LOGIN/PLAIN auth.PasswordFileserpent.String `json:"password_file" typescript:",notnull"`}

func (*NotificationsEmailAuthConfig)Emptyadded inv2.14.0

typeNotificationsEmailConfigadded inv2.14.0

type NotificationsEmailConfig struct {// The sender's address.Fromserpent.String `json:"from" typescript:",notnull"`// The intermediary SMTP host through which emails are sent (host:port).Smarthostserpent.String `json:"smarthost" typescript:",notnull"`// The hostname identifying the SMTP server.Helloserpent.String `json:"hello" typescript:",notnull"`// Authentication details.AuthNotificationsEmailAuthConfig `json:"auth" typescript:",notnull"`// TLS details.TLSNotificationsEmailTLSConfig `json:"tls" typescript:",notnull"`// ForceTLS causes a TLS connection to be attempted.ForceTLSserpent.Bool `json:"force_tls" typescript:",notnull"`}

typeNotificationsEmailTLSConfigadded inv2.14.0

type NotificationsEmailTLSConfig struct {// StartTLS attempts to upgrade plain connections to TLS.StartTLSserpent.Bool `json:"start_tls" typescript:",notnull"`// ServerName to verify the hostname for the targets.ServerNameserpent.String `json:"server_name" typescript:",notnull"`// InsecureSkipVerify skips target certificate validation.InsecureSkipVerifyserpent.Bool `json:"insecure_skip_verify" typescript:",notnull"`// CAFile specifies the location of the CA certificate to use.CAFileserpent.String `json:"ca_file" typescript:",notnull"`// CertFile specifies the location of the certificate to use.CertFileserpent.String `json:"cert_file" typescript:",notnull"`// KeyFile specifies the location of the key to use.KeyFileserpent.String `json:"key_file" typescript:",notnull"`}

func (*NotificationsEmailTLSConfig)Emptyadded inv2.14.0

typeNotificationsInboxConfigadded inv2.21.0

type NotificationsInboxConfig struct {Enabledserpent.Bool `json:"enabled" typescript:",notnull"`}

typeNotificationsSettingsadded inv2.14.0

type NotificationsSettings struct {NotifierPausedbool `json:"notifier_paused"`}

typeNotificationsWebhookConfigadded inv2.14.0

type NotificationsWebhookConfig struct {// The URL to which the payload will be sent with an HTTP POST request.Endpointserpent.URL `json:"endpoint" typescript:",notnull"`}

typeNullHCLStringadded inv2.22.0

type NullHCLString struct {Valuestring `json:"value"`Validbool   `json:"valid"`}

NullHCLString == `previewtypes.NullHCLString`.

typeNullTime

type NullTime struct {sql.NullTime}

NullTime represents a nullable time.Time.@typescript-ignore NullTime

funcNewNullTime

func NewNullTime(ttime.Time, validbool)NullTime

NewNullTime returns a new NullTime with the given time.Time.

func (NullTime)IsZero

func (tNullTime) IsZero()bool

IsZero return true if the time is null or zero.

func (NullTime)MarshalJSON

func (tNullTime) MarshalJSON() ([]byte,error)

MarshalJSON implements json.Marshaler.

func (*NullTime)UnmarshalJSON

func (t *NullTime) UnmarshalJSON(data []byte)error

UnmarshalJSON implements json.Unmarshaler.

typeOAuth2AppEndpointsadded inv2.8.0

type OAuth2AppEndpoints struct {Authorizationstring `json:"authorization"`Tokenstring `json:"token"`// DeviceAuth is optional.DeviceAuthstring `json:"device_authorization"`}

typeOAuth2Config

type OAuth2Config struct {GithubOAuth2GithubConfig `json:"github" typescript:",notnull"`}

typeOAuth2DeviceFlowCallbackResponseadded inv2.20.0

type OAuth2DeviceFlowCallbackResponse struct {RedirectURLstring `json:"redirect_url"`}

typeOAuth2GithubConfig

type OAuth2GithubConfig struct {ClientIDserpent.String      `json:"client_id" typescript:",notnull"`ClientSecretserpent.String      `json:"client_secret" typescript:",notnull"`DeviceFlowserpent.Bool        `json:"device_flow" typescript:",notnull"`DefaultProviderEnableserpent.Bool        `json:"default_provider_enable" typescript:",notnull"`AllowedOrgsserpent.StringArray `json:"allowed_orgs" typescript:",notnull"`AllowedTeamsserpent.StringArray `json:"allowed_teams" typescript:",notnull"`AllowSignupsserpent.Bool        `json:"allow_signups" typescript:",notnull"`AllowEveryoneserpent.Bool        `json:"allow_everyone" typescript:",notnull"`EnterpriseBaseURLserpent.String      `json:"enterprise_base_url" typescript:",notnull"`}

typeOAuth2ProviderAppadded inv2.6.0

type OAuth2ProviderApp struct {IDuuid.UUID `json:"id" format:"uuid"`Namestring    `json:"name"`CallbackURLstring    `json:"callback_url"`Iconstring    `json:"icon"`// Endpoints are included in the app response for easier discovery. The OAuth2// spec does not have a defined place to find these (for comparison, OIDC has// a '/.well-known/openid-configuration' endpoint).EndpointsOAuth2AppEndpoints `json:"endpoints"`}

typeOAuth2ProviderAppFilteradded inv2.9.0

type OAuth2ProviderAppFilter struct {UserIDuuid.UUID `json:"user_id,omitempty" format:"uuid"`}

typeOAuth2ProviderAppSecretadded inv2.6.0

type OAuth2ProviderAppSecret struct {IDuuid.UUID `json:"id" format:"uuid"`LastUsedAtNullTime  `json:"last_used_at"`ClientSecretTruncatedstring    `json:"client_secret_truncated"`}

typeOAuth2ProviderAppSecretFulladded inv2.6.0

type OAuth2ProviderAppSecretFull struct {IDuuid.UUID `json:"id" format:"uuid"`ClientSecretFullstring    `json:"client_secret_full"`}

typeOAuth2ProviderGrantTypeadded inv2.9.0

type OAuth2ProviderGrantTypestring
const (OAuth2ProviderGrantTypeAuthorizationCodeOAuth2ProviderGrantType = "authorization_code"OAuth2ProviderGrantTypeRefreshTokenOAuth2ProviderGrantType = "refresh_token")

func (OAuth2ProviderGrantType)Validadded inv2.9.0

typeOAuth2ProviderResponseTypeadded inv2.9.0

type OAuth2ProviderResponseTypestring
const (OAuth2ProviderResponseTypeCodeOAuth2ProviderResponseType = "code")

func (OAuth2ProviderResponseType)Validadded inv2.9.0

typeOAuthConversionResponse

type OAuthConversionResponse struct {StateStringstring    `json:"state_string"`ExpiresAttime.Time `json:"expires_at" format:"date-time"`ToTypeLoginType `json:"to_type"`UserIDuuid.UUID `json:"user_id" format:"uuid"`}

typeOIDCAuthMethod

type OIDCAuthMethod struct {AuthMethodSignInTextstring `json:"signInText"`IconURLstring `json:"iconUrl"`}

typeOIDCConfig

type OIDCConfig struct {AllowSignupsserpent.Bool   `json:"allow_signups" typescript:",notnull"`ClientIDserpent.String `json:"client_id" typescript:",notnull"`ClientSecretserpent.String `json:"client_secret" typescript:",notnull"`// ClientKeyFile & ClientCertFile are used in place of ClientSecret for PKI auth.ClientKeyFileserpent.String                    `json:"client_key_file" typescript:",notnull"`ClientCertFileserpent.String                    `json:"client_cert_file" typescript:",notnull"`EmailDomainserpent.StringArray               `json:"email_domain" typescript:",notnull"`IssuerURLserpent.String                    `json:"issuer_url" typescript:",notnull"`Scopesserpent.StringArray               `json:"scopes" typescript:",notnull"`IgnoreEmailVerifiedserpent.Bool                      `json:"ignore_email_verified" typescript:",notnull"`UsernameFieldserpent.String                    `json:"username_field" typescript:",notnull"`NameFieldserpent.String                    `json:"name_field" typescript:",notnull"`EmailFieldserpent.String                    `json:"email_field" typescript:",notnull"`AuthURLParamsserpent.Struct[map[string]string] `json:"auth_url_params" typescript:",notnull"`// IgnoreUserInfo & UserInfoFromAccessToken are mutually exclusive. Only 1// can be set to true. Ideally this would be an enum with 3 states, ['none',// 'userinfo', 'access_token']. However, for backward compatibility,// `ignore_user_info` must remain. And `access_token` is a niche, non-spec// compliant edge case. So it's use is rare, and should not be advised.IgnoreUserInfoserpent.Bool `json:"ignore_user_info" typescript:",notnull"`// UserInfoFromAccessToken as mentioned above is an edge case. This allows// sourcing the user_info from the access token itself instead of a user_info// endpoint. This assumes the access token is a valid JWT with a set of claims to// be merged with the id_token.UserInfoFromAccessTokenserpent.Bool                           `json:"source_user_info_from_access_token" typescript:",notnull"`OrganizationFieldserpent.String                         `json:"organization_field" typescript:",notnull"`OrganizationMappingserpent.Struct[map[string][]uuid.UUID] `json:"organization_mapping" typescript:",notnull"`OrganizationAssignDefaultserpent.Bool                           `json:"organization_assign_default" typescript:",notnull"`GroupAutoCreateserpent.Bool                           `json:"group_auto_create" typescript:",notnull"`GroupRegexFilterserpent.Regexp                         `json:"group_regex_filter" typescript:",notnull"`GroupAllowListserpent.StringArray                    `json:"group_allow_list" typescript:",notnull"`GroupFieldserpent.String                         `json:"groups_field" typescript:",notnull"`GroupMappingserpent.Struct[map[string]string]      `json:"group_mapping" typescript:",notnull"`UserRoleFieldserpent.String                         `json:"user_role_field" typescript:",notnull"`UserRoleMappingserpent.Struct[map[string][]string]    `json:"user_role_mapping" typescript:",notnull"`UserRolesDefaultserpent.StringArray                    `json:"user_roles_default" typescript:",notnull"`SignInTextserpent.String                         `json:"sign_in_text" typescript:",notnull"`IconURLserpent.URL                            `json:"icon_url" typescript:",notnull"`SignupsDisabledTextserpent.String                         `json:"signups_disabled_text" typescript:",notnull"`SkipIssuerChecksserpent.Bool                           `json:"skip_issuer_checks" typescript:",notnull"`}

typeOptionTypeadded inv2.23.0

type OptionTypestring
const (OptionTypeStringOptionType = "string"OptionTypeNumberOptionType = "number"OptionTypeBooleanOptionType = "bool"OptionTypeListStringOptionType = "list(string)")

typeOrganization

type Organization struct {MinimalOrganization `table:"m,recursive_inline"`Descriptionstring    `table:"description" json:"description"`CreatedAttime.Time `table:"created at" json:"created_at" validate:"required" format:"date-time"`UpdatedAttime.Time `table:"updated at" json:"updated_at" validate:"required" format:"date-time"`IsDefaultbool      `table:"default" json:"is_default" validate:"required"`}

Organization is the JSON representation of a Coder organization.

func (Organization)HumanNameadded inv2.13.0

func (oOrganization) HumanName()string

typeOrganizationMember

type OrganizationMember struct {UserIDuuid.UUID  `table:"user id" json:"user_id" format:"uuid"`OrganizationIDuuid.UUID  `table:"organization id" json:"organization_id" format:"uuid"`CreatedAttime.Time  `table:"created at" json:"created_at" format:"date-time"`UpdatedAttime.Time  `table:"updated at" json:"updated_at" format:"date-time"`Roles          []SlimRole `table:"organization roles" json:"roles"`}

typeOrganizationMemberWithUserDataadded inv2.14.0

type OrganizationMemberWithUserData struct {Usernamestring     `table:"username,default_sort" json:"username"`Namestring     `table:"name" json:"name,omitempty"`AvatarURLstring     `json:"avatar_url,omitempty"`Emailstring     `json:"email"`GlobalRoles        []SlimRole `json:"global_roles"`OrganizationMember `table:"m,recursive_inline"`}

typeOrganizationProvisionerDaemonsOptionsadded inv2.20.0

type OrganizationProvisionerDaemonsOptions struct {LimitintIDs   []uuid.UUIDTags  map[string]string}

typeOrganizationProvisionerJobsOptionsadded inv2.19.0

type OrganizationProvisionerJobsOptions struct {LimitintIDs    []uuid.UUIDStatus []ProvisionerJobStatusTags   map[string]string}

typeOrganizationSyncSettingsadded inv2.18.0

type OrganizationSyncSettings struct {// Field selects the claim field to be used as the created user's// organizations. If the field is the empty string, then no organization// updates will ever come from the OIDC provider.Fieldstring `json:"field"`// Mapping maps from an OIDC claim --> Coder organization uuidMapping map[string][]uuid.UUID `json:"mapping"`// AssignDefault will ensure the default org is always included// for every user, regardless of their claims. This preserves legacy behavior.AssignDefaultbool `json:"organization_assign_default"`}

typePaginatedMembersRequestadded inv2.21.0

type PaginatedMembersRequest struct {Limitint `json:"limit,omitempty"`Offsetint `json:"offset,omitempty"`}

typePaginatedMembersResponseadded inv2.21.0

type PaginatedMembersResponse struct {Members []OrganizationMemberWithUserData `json:"members"`Countint                              `json:"count"`}

typePagination

type Pagination struct {// AfterID returns all or up to Limit results after the given// UUID. This option can be used with or as an alternative to// Offset for better performance. To use it as an alternative,// set AfterID to the last UUID returned by the previous// request.AfterIDuuid.UUID `json:"after_id,omitempty" format:"uuid"`// Limit sets the maximum number of users to be returned// in a single page. If the limit is <= 0, there is no limit// and all users are returned.Limitint `json:"limit,omitempty"`// Offset is used to indicate which page to return. An offset of 0// returns the first 'limit' number of users.// To get the next page, use offset=<limit>*<page_number>.// Offset is 0 indexed, so the first record sits at offset 0.Offsetint `json:"offset,omitempty"`}

Pagination sets pagination options for the endpoints that support it.

typeParameterFormTypeadded inv2.23.0

type ParameterFormTypestring
const (ParameterFormTypeDefaultParameterFormType = ""ParameterFormTypeRadioParameterFormType = "radio"ParameterFormTypeSliderParameterFormType = "slider"ParameterFormTypeInputParameterFormType = "input"ParameterFormTypeDropdownParameterFormType = "dropdown"ParameterFormTypeCheckboxParameterFormType = "checkbox"ParameterFormTypeSwitchParameterFormType = "switch"ParameterFormTypeMultiSelectParameterFormType = "multi-select"ParameterFormTypeTagSelectParameterFormType = "tag-select"ParameterFormTypeTextAreaParameterFormType = "textarea"ParameterFormTypeErrorParameterFormType = "error")

typeParameterResolver

type ParameterResolver struct {Rich []WorkspaceBuildParameter}

ParameterResolver should be populated with legacy workload and rich parameter values from the previous build. It thensupports queries against a current TemplateVersionParameter to determine whether a new value is required, or a valuecorrectly validates.@typescript-ignore ParameterResolver

func (*ParameterResolver)Resolveadded inv2.22.0

Resolve returns the value of the parameter. It does not do any validation,and is meant for use with the new dynamic parameters code path.

func (*ParameterResolver)ValidateResolve

ValidateResolve checks the provided value, v, against the parameter, p, and the previous build. If v is nil, it alsoresolves the correct value. It returns the value of the parameter, if valid, and an error if invalid.

typePatchGroupIDPSyncConfigRequestadded inv2.19.0

type PatchGroupIDPSyncConfigRequest struct {Fieldstring         `json:"field"`RegexFilter       *regexp.Regexp `json:"regex_filter"`AutoCreateMissingbool           `json:"auto_create_missing_groups"`}

typePatchGroupIDPSyncMappingRequestadded inv2.19.0

type PatchGroupIDPSyncMappingRequest struct {Add    []IDPSyncMapping[uuid.UUID]Remove []IDPSyncMapping[uuid.UUID]}

If the same mapping is present in both Add and Remove, Remove will take presidence.

typePatchGroupRequest

type PatchGroupRequest struct {AddUsers       []string `json:"add_users"`RemoveUsers    []string `json:"remove_users"`Namestring   `json:"name" validate:"omitempty,group_name"`DisplayName    *string  `json:"display_name" validate:"omitempty,group_display_name"`AvatarURL      *string  `json:"avatar_url"`QuotaAllowance *int     `json:"quota_allowance"`}

typePatchOrganizationIDPSyncConfigRequestadded inv2.19.0

type PatchOrganizationIDPSyncConfigRequest struct {Fieldstring `json:"field"`AssignDefaultbool   `json:"assign_default"`}

typePatchOrganizationIDPSyncMappingRequestadded inv2.19.0

type PatchOrganizationIDPSyncMappingRequest struct {Add    []IDPSyncMapping[uuid.UUID]Remove []IDPSyncMapping[uuid.UUID]}

If the same mapping is present in both Add and Remove, Remove will take presidence.

typePatchRoleIDPSyncConfigRequestadded inv2.19.0

type PatchRoleIDPSyncConfigRequest struct {Fieldstring `json:"field"`}

typePatchRoleIDPSyncMappingRequestadded inv2.19.0

type PatchRoleIDPSyncMappingRequest struct {Add    []IDPSyncMapping[string]Remove []IDPSyncMapping[string]}

If the same mapping is present in both Add and Remove, Remove will take presidence.

typePatchTemplateVersionRequest

type PatchTemplateVersionRequest struct {Namestring  `json:"name" validate:"omitempty,template_version_name"`Message *string `json:"message,omitempty" validate:"omitempty,lt=1048577"`}

typePatchWorkspaceProxy

type PatchWorkspaceProxy struct {IDuuid.UUID `json:"id" format:"uuid" validate:"required"`Namestring    `json:"name" validate:"required"`DisplayNamestring    `json:"display_name" validate:"required"`Iconstring    `json:"icon" validate:"required"`RegenerateTokenbool      `json:"regenerate_token"`}

typePermissionadded inv2.12.0

type Permission struct {// Negate makes this a negative permissionNegatebool         `json:"negate"`ResourceTypeRBACResource `json:"resource_type"`ActionRBACAction   `json:"action"`}

Permission is the format passed into the rego.

funcCreatePermissionsadded inv2.12.0

func CreatePermissions(mapping map[RBACResource][]RBACAction) []Permission

CreatePermissions is a helper function to quickly build permissions.

typePostOAuth2ProviderAppRequestadded inv2.6.0

type PostOAuth2ProviderAppRequest struct {Namestring `json:"name" validate:"required,oauth2_app_name"`CallbackURLstring `json:"callback_url" validate:"required,http_url"`Iconstring `json:"icon" validate:"omitempty"`}

typePostWorkspaceUsageRequestadded inv2.13.0

type PostWorkspaceUsageRequest struct {AgentIDuuid.UUID    `json:"agent_id" format:"uuid"`AppNameUsageAppName `json:"app_name"`}

typePostgresAuthadded inv2.10.0

type PostgresAuthstring
const (PostgresAuthPasswordPostgresAuth = "password"PostgresAuthAWSIAMRDSPostgresAuth = "awsiamrds")

typePprofConfig

type PprofConfig struct {Enableserpent.Bool     `json:"enable" typescript:",notnull"`Addressserpent.HostPort `json:"address" typescript:",notnull"`}

typePrebuildsConfigadded inv2.22.0

type PrebuildsConfig struct {// ReconciliationInterval defines how often the workspace prebuilds state should be reconciled.ReconciliationIntervalserpent.Duration `json:"reconciliation_interval" typescript:",notnull"`// ReconciliationBackoffInterval specifies the amount of time to increase the backoff interval// when errors occur during reconciliation.ReconciliationBackoffIntervalserpent.Duration `json:"reconciliation_backoff_interval" typescript:",notnull"`// ReconciliationBackoffLookback determines the time window to look back when calculating// the number of failed prebuilds, which influences the backoff strategy.ReconciliationBackoffLookbackserpent.Duration `json:"reconciliation_backoff_lookback" typescript:",notnull"`// FailureHardLimit defines the maximum number of consecutive failed prebuild attempts allowed// before a preset is considered to be in a hard limit state. When a preset hits this limit,// no new prebuilds will be created until the limit is reset.// FailureHardLimit is disabled when set to zero.FailureHardLimitserpent.Int64 `json:"failure_hard_limit" typescript:"failure_hard_limit"`}

typePresetadded inv2.20.0

type Preset struct {IDuuid.UUIDNamestringParameters []PresetParameter}

typePresetParameteradded inv2.20.0

type PresetParameter struct {NamestringValuestring}

typePreviewParameteradded inv2.23.0

type PreviewParameter struct {PreviewParameterDataValueNullHCLString        `json:"value"`Diagnostics []FriendlyDiagnostic `json:"diagnostics"`}

typePreviewParameterDataadded inv2.23.0

type PreviewParameterData struct {Namestring                       `json:"name"`DisplayNamestring                       `json:"display_name"`Descriptionstring                       `json:"description"`TypeOptionType                   `json:"type"`FormTypeParameterFormType            `json:"form_type"`StylingPreviewParameterStyling      `json:"styling"`Mutablebool                         `json:"mutable"`DefaultValueNullHCLString                `json:"default_value"`Iconstring                       `json:"icon"`Options      []PreviewParameterOption     `json:"options"`Validations  []PreviewParameterValidation `json:"validations"`Requiredbool                         `json:"required"`// legacy_variable_name was removed (= 14)Orderint64 `json:"order"`Ephemeralbool  `json:"ephemeral"`}

typePreviewParameterOptionadded inv2.23.0

type PreviewParameterOption struct {Namestring        `json:"name"`Descriptionstring        `json:"description"`ValueNullHCLString `json:"value"`Iconstring        `json:"icon"`}

typePreviewParameterStylingadded inv2.23.0

type PreviewParameterStyling struct {Placeholder *string `json:"placeholder,omitempty"`Disabled    *bool   `json:"disabled,omitempty"`Label       *string `json:"label,omitempty"`}

typePreviewParameterValidationadded inv2.23.0

type PreviewParameterValidation struct {Errorstring `json:"validation_error"`// All validation attributes are optional.Regex     *string `json:"validation_regex"`Min       *int64  `json:"validation_min"`Max       *int64  `json:"validation_max"`Monotonic *string `json:"validation_monotonic"`}

typePrometheusConfig

type PrometheusConfig struct {Enableserpent.Bool        `json:"enable" typescript:",notnull"`Addressserpent.HostPort    `json:"address" typescript:",notnull"`CollectAgentStatsserpent.Bool        `json:"collect_agent_stats" typescript:",notnull"`CollectDBMetricsserpent.Bool        `json:"collect_db_metrics" typescript:",notnull"`AggregateAgentStatsByserpent.StringArray `json:"aggregate_agent_stats_by" typescript:",notnull"`}

typeProvisionerConfig

type ProvisionerConfig struct {// Daemons is the number of built-in terraform provisioners.Daemonsserpent.Int64       `json:"daemons" typescript:",notnull"`DaemonTypesserpent.StringArray `json:"daemon_types" typescript:",notnull"`DaemonPollIntervalserpent.Duration    `json:"daemon_poll_interval" typescript:",notnull"`DaemonPollJitterserpent.Duration    `json:"daemon_poll_jitter" typescript:",notnull"`ForceCancelIntervalserpent.Duration    `json:"force_cancel_interval" typescript:",notnull"`DaemonPSKserpent.String      `json:"daemon_psk" typescript:",notnull"`}

typeProvisionerDaemon

type ProvisionerDaemon struct {IDuuid.UUID         `json:"id" format:"uuid" table:"id"`OrganizationIDuuid.UUID         `json:"organization_id" format:"uuid" table:"organization id"`KeyIDuuid.UUID         `json:"key_id" format:"uuid" table:"-"`CreatedAttime.Time         `json:"created_at" format:"date-time" table:"created at"`LastSeenAtNullTime          `json:"last_seen_at,omitempty" format:"date-time" table:"last seen at"`Namestring            `json:"name" table:"name,default_sort"`Versionstring            `json:"version" table:"version"`APIVersionstring            `json:"api_version" table:"api version"`Provisioners   []ProvisionerType `json:"provisioners" table:"-"`Tags           map[string]string `json:"tags" table:"tags"`// Optional fields.KeyName     *string                  `json:"key_name" table:"key name"`Status      *ProvisionerDaemonStatus `json:"status" enums:"offline,idle,busy" table:"status"`CurrentJob  *ProvisionerDaemonJob    `json:"current_job" table:"current job,recursive"`PreviousJob *ProvisionerDaemonJob    `json:"previous_job" table:"previous job,recursive"`}

typeProvisionerDaemonJobadded inv2.19.0

type ProvisionerDaemonJob struct {IDuuid.UUID            `json:"id" format:"uuid" table:"id"`StatusProvisionerJobStatus `json:"status" enums:"pending,running,succeeded,canceling,canceled,failed" table:"status"`TemplateNamestring               `json:"template_name" table:"template name"`TemplateIconstring               `json:"template_icon" table:"template icon"`TemplateDisplayNamestring               `json:"template_display_name" table:"template display name"`}

typeProvisionerDaemonStatusadded inv2.19.0

type ProvisionerDaemonStatusstring

ProvisionerDaemonStatus represents the status of a provisioner daemon.

const (ProvisionerDaemonOfflineProvisionerDaemonStatus = "offline"ProvisionerDaemonIdleProvisionerDaemonStatus = "idle"ProvisionerDaemonBusyProvisionerDaemonStatus = "busy")

ProvisionerDaemonStatus enums.

typeProvisionerJob

type ProvisionerJob struct {IDuuid.UUID              `json:"id" format:"uuid" table:"id"`CreatedAttime.Time              `json:"created_at" format:"date-time" table:"created at"`StartedAt        *time.Time             `json:"started_at,omitempty" format:"date-time" table:"started at"`CompletedAt      *time.Time             `json:"completed_at,omitempty" format:"date-time" table:"completed at"`CanceledAt       *time.Time             `json:"canceled_at,omitempty" format:"date-time" table:"canceled at"`Errorstring                 `json:"error,omitempty" table:"error"`ErrorCodeJobErrorCode           `json:"error_code,omitempty" enums:"REQUIRED_TEMPLATE_VARIABLES" table:"error code"`StatusProvisionerJobStatus   `json:"status" enums:"pending,running,succeeded,canceling,canceled,failed" table:"status"`WorkerID         *uuid.UUID             `json:"worker_id,omitempty" format:"uuid" table:"worker id"`WorkerNamestring                 `json:"worker_name,omitempty" table:"worker name"`FileIDuuid.UUID              `json:"file_id" format:"uuid" table:"file id"`Tags             map[string]string      `json:"tags" table:"tags"`QueuePositionint                    `json:"queue_position" table:"queue position"`QueueSizeint                    `json:"queue_size" table:"queue size"`OrganizationIDuuid.UUID              `json:"organization_id" format:"uuid" table:"organization id"`InputProvisionerJobInput    `json:"input" table:"input,recursive_inline"`TypeProvisionerJobType     `json:"type" table:"type"`AvailableWorkers []uuid.UUID            `json:"available_workers,omitempty" format:"uuid" table:"available workers"`MetadataProvisionerJobMetadata `json:"metadata" table:"metadata,recursive_inline"`}

ProvisionerJob describes the job executed by the provisioning daemon.

typeProvisionerJobInputadded inv2.19.0

type ProvisionerJobInput struct {TemplateVersionID *uuid.UUID `json:"template_version_id,omitempty" format:"uuid" table:"template version id"`WorkspaceBuildID  *uuid.UUID `json:"workspace_build_id,omitempty" format:"uuid" table:"workspace build id"`Errorstring     `json:"error,omitempty" table:"-"`}

ProvisionerJobInput represents the input for the job.

typeProvisionerJobLog

type ProvisionerJobLog struct {IDint64     `json:"id"`CreatedAttime.Time `json:"created_at" format:"date-time"`SourceLogSource `json:"log_source"`LevelLogLevel  `json:"log_level" enums:"trace,debug,info,warn,error"`Stagestring    `json:"stage"`Outputstring    `json:"output"`}

ProvisionerJobLog represents the provisioner log entry annotated with source and level.

typeProvisionerJobMetadataadded inv2.20.0

type ProvisionerJobMetadata struct {TemplateVersionNamestring     `json:"template_version_name" table:"template version name"`TemplateIDuuid.UUID  `json:"template_id" format:"uuid" table:"template id"`TemplateNamestring     `json:"template_name" table:"template name"`TemplateDisplayNamestring     `json:"template_display_name" table:"template display name"`TemplateIconstring     `json:"template_icon" table:"template icon"`WorkspaceID         *uuid.UUID `json:"workspace_id,omitempty" format:"uuid" table:"workspace id"`WorkspaceNamestring     `json:"workspace_name,omitempty" table:"workspace name"`}

ProvisionerJobMetadata contains metadata for the job.

typeProvisionerJobStatus

type ProvisionerJobStatusstring

ProvisionerJobStatus represents the at-time state of a job.

const (ProvisionerJobPendingProvisionerJobStatus = "pending"ProvisionerJobRunningProvisionerJobStatus = "running"ProvisionerJobSucceededProvisionerJobStatus = "succeeded"ProvisionerJobCancelingProvisionerJobStatus = "canceling"ProvisionerJobCanceledProvisionerJobStatus = "canceled"ProvisionerJobFailedProvisionerJobStatus = "failed"ProvisionerJobUnknownProvisionerJobStatus = "unknown")

funcProvisionerJobStatusEnumsadded inv2.19.0

func ProvisionerJobStatusEnums() []ProvisionerJobStatus

func (ProvisionerJobStatus)Active

func (pProvisionerJobStatus) Active()bool

Active returns whether the job is still active or not.It returns true if canceling as well, since the job isn'tin an entirely inactive state yet.

typeProvisionerJobTypeadded inv2.19.0

type ProvisionerJobTypestring

ProvisionerJobType represents the type of job.

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

typeProvisionerKeyadded inv2.14.0

type ProvisionerKey struct {IDuuid.UUID          `json:"id" table:"-" format:"uuid"`CreatedAttime.Time          `json:"created_at" table:"created at" format:"date-time"`OrganizationIDuuid.UUID          `json:"organization" table:"-" format:"uuid"`Namestring             `json:"name" table:"name,default_sort"`TagsProvisionerKeyTags `json:"tags" table:"tags"`}

typeProvisionerKeyDaemonsadded inv2.16.0

type ProvisionerKeyDaemons struct {KeyProvisionerKey      `json:"key"`Daemons []ProvisionerDaemon `json:"daemons"`}

typeProvisionerKeyTagsadded inv2.16.0

type ProvisionerKeyTags map[string]string

func (ProvisionerKeyTags)Stringadded inv2.16.0

func (pProvisionerKeyTags) String()string

typeProvisionerLogLevel

type ProvisionerLogLevelstring
const (ProvisionerLogLevelDebugProvisionerLogLevel = "debug")

typeProvisionerStorageMethod

type ProvisionerStorageMethodstring
const (ProvisionerStorageMethodFileProvisionerStorageMethod = "file")

typeProvisionerTimingadded inv2.16.0

type ProvisionerTiming struct {JobIDuuid.UUID   `json:"job_id" format:"uuid"`StartedAttime.Time   `json:"started_at" format:"date-time"`EndedAttime.Time   `json:"ended_at" format:"date-time"`StageTimingStage `json:"stage"`Sourcestring      `json:"source"`Actionstring      `json:"action"`Resourcestring      `json:"resource"`}

typeProvisionerType

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

typeProxyHealthReport

type ProxyHealthReport struct {// Errors are problems that prevent the workspace proxy from being healthyErrors []string `json:"errors"`// Warnings do not prevent the workspace proxy from being healthy, but// should be addressed.Warnings []string `json:"warnings"`}

ProxyHealthReport is a report of the health of the workspace proxy.A healthy report will have no errors. Warnings are not fatal.

typeProxyHealthStatus

type ProxyHealthStatusstring
const (// ProxyHealthy means the proxy access url is reachable and returns a healthy// status code.ProxyHealthyProxyHealthStatus = "ok"// ProxyUnreachable means the proxy access url is not responding.ProxyUnreachableProxyHealthStatus = "unreachable"// ProxyUnhealthy means the proxy access url is responding, but there is some// problem with the proxy. This problem may or may not be preventing functionality.ProxyUnhealthyProxyHealthStatus = "unhealthy"// ProxyUnregistered means the proxy has not registered a url yet. This means// the proxy was created with the cli, but has not yet been started.ProxyUnregisteredProxyHealthStatus = "unregistered")

typePutExtendWorkspaceRequest

type PutExtendWorkspaceRequest struct {Deadlinetime.Time `json:"deadline" validate:"required" format:"date-time"`}

PutExtendWorkspaceRequest is a request to extend the deadline ofthe active workspace build.

typePutOAuth2ProviderAppRequestadded inv2.6.0

type PutOAuth2ProviderAppRequest struct {Namestring `json:"name" validate:"required,oauth2_app_name"`CallbackURLstring `json:"callback_url" validate:"required,http_url"`Iconstring `json:"icon" validate:"omitempty"`}

typeRBACActionadded inv2.12.0

type RBACActionstring
const (ActionApplicationConnectRBACAction = "application_connect"ActionAssignRBACAction = "assign"ActionCreateRBACAction = "create"ActionCreateAgentRBACAction = "create_agent"ActionDeleteRBACAction = "delete"ActionDeleteAgentRBACAction = "delete_agent"ActionReadRBACAction = "read"ActionReadPersonalRBACAction = "read_personal"ActionSSHRBACAction = "ssh"ActionUnassignRBACAction = "unassign"ActionUpdateRBACAction = "update"ActionUpdatePersonalRBACAction = "update_personal"ActionUseRBACAction = "use"ActionViewInsightsRBACAction = "view_insights"ActionWorkspaceStartRBACAction = "start"ActionWorkspaceStopRBACAction = "stop")

typeRBACResource

type RBACResourcestring
const (ResourceWildcardRBACResource = "*"ResourceApiKeyRBACResource = "api_key"ResourceAssignOrgRoleRBACResource = "assign_org_role"ResourceAssignRoleRBACResource = "assign_role"ResourceAuditLogRBACResource = "audit_log"ResourceChatRBACResource = "chat"ResourceCryptoKeyRBACResource = "crypto_key"ResourceDebugInfoRBACResource = "debug_info"ResourceDeploymentConfigRBACResource = "deployment_config"ResourceDeploymentStatsRBACResource = "deployment_stats"ResourceFileRBACResource = "file"ResourceGroupRBACResource = "group"ResourceGroupMemberRBACResource = "group_member"ResourceIdpsyncSettingsRBACResource = "idpsync_settings"ResourceInboxNotificationRBACResource = "inbox_notification"ResourceLicenseRBACResource = "license"ResourceNotificationMessageRBACResource = "notification_message"ResourceNotificationPreferenceRBACResource = "notification_preference"ResourceNotificationTemplateRBACResource = "notification_template"ResourceOauth2AppRBACResource = "oauth2_app"ResourceOauth2AppCodeTokenRBACResource = "oauth2_app_code_token"ResourceOauth2AppSecretRBACResource = "oauth2_app_secret"ResourceOrganizationRBACResource = "organization"ResourceOrganizationMemberRBACResource = "organization_member"ResourceProvisionerDaemonRBACResource = "provisioner_daemon"ResourceProvisionerJobsRBACResource = "provisioner_jobs"ResourceReplicasRBACResource = "replicas"ResourceSystemRBACResource = "system"ResourceTailnetCoordinatorRBACResource = "tailnet_coordinator"ResourceTemplateRBACResource = "template"ResourceUserRBACResource = "user"ResourceWebpushSubscriptionRBACResource = "webpush_subscription"ResourceWorkspaceRBACResource = "workspace"ResourceWorkspaceAgentDevcontainersRBACResource = "workspace_agent_devcontainers"ResourceWorkspaceAgentResourceMonitorRBACResource = "workspace_agent_resource_monitor"ResourceWorkspaceDormantRBACResource = "workspace_dormant"ResourceWorkspaceProxyRBACResource = "workspace_proxy")

typeRateLimitConfig

type RateLimitConfig struct {DisableAllserpent.Bool  `json:"disable_all" typescript:",notnull"`APIserpent.Int64 `json:"api" typescript:",notnull"`}

typeReducedUseradded inv2.9.0

type ReducedUser struct {MinimalUser `table:"m,recursive_inline"`Namestring    `json:"name,omitempty"`Emailstring    `json:"email" validate:"required" table:"email" format:"email"`CreatedAttime.Time `json:"created_at" validate:"required" table:"created at" format:"date-time"`UpdatedAttime.Time `json:"updated_at" table:"updated at" format:"date-time"`LastSeenAttime.Time `json:"last_seen_at,omitempty" format:"date-time"`StatusUserStatus `json:"status" table:"status" enums:"active,suspended"`LoginTypeLoginType  `json:"login_type"`// Deprecated: this value should be retrieved from// `codersdk.UserPreferenceSettings` instead.ThemePreferencestring `json:"theme_preference,omitempty"`}

ReducedUser omits role and organization information. Roles are deduced fromthe user's site and organization roles. This requires fetching the user'sorganizational memberships. Fetching that is more expensive, and not usuallyrequired by the frontend.

typeRegion

type Region struct {IDuuid.UUID `json:"id" format:"uuid" table:"id"`Namestring    `json:"name" table:"name,default_sort"`DisplayNamestring    `json:"display_name" table:"display name"`IconURLstring    `json:"icon_url" table:"icon url"`Healthybool      `json:"healthy" table:"healthy"`// PathAppURL is the URL to the base path for path apps. Optional// unless wildcard_hostname is set.// E.g.https://us.example.comPathAppURLstring `json:"path_app_url" table:"url"`// WildcardHostname is the wildcard hostname for subdomain apps.// E.g. *.us.example.com// E.g. *--suffix.au.example.com// Optional. Does not need to be on the same domain as PathAppURL.WildcardHostnamestring `json:"wildcard_hostname" table:"wildcard hostname"`}

typeRegionTypes

type RegionTypes interface {Region |WorkspaceProxy}

typeRegionsResponse

type RegionsResponse[RRegionTypes] struct {Regions []R `json:"regions"`}

typeReplica

type Replica struct {// ID is the unique identifier for the replica.IDuuid.UUID `json:"id" format:"uuid"`// Hostname is the hostname of the replica.Hostnamestring `json:"hostname"`// CreatedAt is the timestamp when the replica was first seen.CreatedAttime.Time `json:"created_at" format:"date-time"`// RelayAddress is the accessible address to relay DERP connections.RelayAddressstring `json:"relay_address"`// RegionID is the region of the replica.RegionIDint32 `json:"region_id"`// Error is the replica error.Errorstring `json:"error"`// DatabaseLatency is the latency in microseconds to the database.DatabaseLatencyint32 `json:"database_latency"`}

typeRequestOneTimePasscodeRequestadded inv2.17.0

type RequestOneTimePasscodeRequest struct {Emailstring `json:"email" validate:"required,email" format:"email"`}

RequestOneTimePasscodeRequest enables callers to request a one-time-passcode to change their password.

typeRequestOption

type RequestOption func(*http.Request)

RequestOption is a function that can be used to modify an http.Request.

funcListInboxNotificationsRequestToQueryParamsadded inv2.21.0

func ListInboxNotificationsRequestToQueryParams(reqListInboxNotificationsRequest) []RequestOption

funcWithQueryParam

func WithQueryParam(key, valuestring)RequestOption

WithQueryParam adds a query parameter to the request.

typeResolveAutostartResponseadded inv2.4.0

type ResolveAutostartResponse struct {ParameterMismatchbool `json:"parameter_mismatch"`}

typeResourceType

type ResourceTypestring
const (ResourceTypeTemplateResourceType = "template"ResourceTypeTemplateVersionResourceType = "template_version"ResourceTypeUserResourceType = "user"ResourceTypeWorkspaceResourceType = "workspace"ResourceTypeWorkspaceBuildResourceType = "workspace_build"ResourceTypeGitSSHKeyResourceType = "git_ssh_key"ResourceTypeAPIKeyResourceType = "api_key"ResourceTypeGroupResourceType = "group"ResourceTypeLicenseResourceType = "license"ResourceTypeConvertLoginResourceType = "convert_login"ResourceTypeHealthSettingsResourceType = "health_settings"ResourceTypeNotificationsSettingsResourceType = "notifications_settings"ResourceTypeWorkspaceProxyResourceType = "workspace_proxy"ResourceTypeOrganizationResourceType = "organization"ResourceTypeOAuth2ProviderAppResourceType = "oauth2_provider_app"// nolint:gosec // This is not a secret.ResourceTypeOAuth2ProviderAppSecretResourceType = "oauth2_provider_app_secret"ResourceTypeCustomRoleResourceType = "custom_role"ResourceTypeOrganizationMemberResourceType = "organization_member"ResourceTypeNotificationTemplateResourceType = "notification_template"ResourceTypeIdpSyncSettingsOrganizationResourceType = "idp_sync_settings_organization"ResourceTypeIdpSyncSettingsGroupResourceType = "idp_sync_settings_group"ResourceTypeIdpSyncSettingsRoleResourceType = "idp_sync_settings_role"ResourceTypeWorkspaceAgentResourceType = "workspace_agent"ResourceTypeWorkspaceAppResourceType = "workspace_app")

func (ResourceType)FriendlyString

func (rResourceType) FriendlyString()string

typeResponse

type Response struct {// Message is an actionable message that depicts actions the request took.// These messages should be fully formed sentences with proper punctuation.// Examples:// - "A user has been created."// - "Failed to create a user."Messagestring `json:"message"`// Detail is a debug message that provides further insight into why the// action failed. This information can be technical and a regular golang// err.Error() text.// - "database: too many open connections"// - "stat: too many open files"Detailstring `json:"detail,omitempty"`// Validations are form field-specific friendly error messages. They will be// shown on a form field in the UI. These can also be used to add additional// context if there is a set of errors in the primary 'Message'.Validations []ValidationError `json:"validations,omitempty"`}

Response represents a generic HTTP response.

typeRole

type Role struct {Namestring       `json:"name" table:"name,default_sort" validate:"username"`OrganizationIDstring       `json:"organization_id,omitempty" table:"organization id" format:"uuid"`DisplayNamestring       `json:"display_name" table:"display name"`SitePermissions []Permission `json:"site_permissions" table:"site permissions"`// OrganizationPermissions are specific for the organization in the field 'OrganizationID' above.OrganizationPermissions []Permission `json:"organization_permissions" table:"organization permissions"`UserPermissions         []Permission `json:"user_permissions" table:"user permissions"`}

Role is a longer form of SlimRole that includes permissions details.

func (Role)FullNameadded inv2.12.0

func (rRole) FullName()string

FullName returns the role name scoped to the organization ID. This is useful ifprinting a set of roles from different scopes, as duplicated names across multiplescopes will become unique.In practice, this is primarily used in testing.

typeRoleSyncSettingsadded inv2.16.0

type RoleSyncSettings struct {// Field is the name of the claim field that specifies what organization roles// a user should be given. If empty, no roles will be synced.Fieldstring `json:"field"`// Mapping is a map from OIDC groups to Coder organization roles.Mapping map[string][]string `json:"mapping"`}

typeSSHConfig

type SSHConfig struct {// DeploymentName is the config-ssh Hostname prefixDeploymentNameserpent.String// SSHConfigOptions are additional options to add to the ssh config file.// This will override defaults.SSHConfigOptionsserpent.StringArray}

SSHConfig is configuration the cli & vscode extension use for configuringssh connections.

func (SSHConfig)ParseOptions

func (cSSHConfig) ParseOptions() (map[string]string,error)

typeSSHConfigResponse

type SSHConfigResponse struct {// HostnamePrefix is the prefix we append to workspace names for SSH hostnames.// Deprecated: use HostnameSuffix instead.HostnamePrefixstring `json:"hostname_prefix"`// HostnameSuffix is the suffix to append to workspace names for SSH hostnames.HostnameSuffixstring            `json:"hostname_suffix"`SSHConfigOptions map[string]string `json:"ssh_config_options"`}

typeServeProvisionerDaemonRequest

type ServeProvisionerDaemonRequest struct {// ID is a unique ID for a provisioner daemon.// Deprecated: this field has always been ignored.IDuuid.UUID `json:"id" format:"uuid"`// Name is the human-readable unique identifier for the daemon.Namestring `json:"name" example:"my-cool-provisioner-daemon"`// Organization is the organization for the URL. If no orgID is provided,// then it is assumed to use the default organization.Organizationuuid.UUID `json:"organization" format:"uuid"`// Provisioners is a list of provisioner types hosted by the provisioner daemonProvisioners []ProvisionerType `json:"provisioners"`// Tags is a map of key-value pairs that tag the jobs this provisioner daemon can handleTags map[string]string `json:"tags"`// PreSharedKey is an authentication key to use on the API instead of the normal session token from the client.PreSharedKeystring `json:"pre_shared_key"`// ProvisionerKey is an authentication key to use on the API instead of the normal session token from the client.ProvisionerKeystring `json:"provisioner_key"`}

ServeProvisionerDaemonRequest are the parameters to call ServeProvisionerDaemon with@typescript-ignore ServeProvisionerDaemonRequest

typeServerSentEvent

type ServerSentEvent struct {TypeServerSentEventType `json:"type"`Data interface{}         `json:"data"`}

typeServerSentEventType

type ServerSentEventTypestring
const (ServerSentEventTypePingServerSentEventType = "ping"ServerSentEventTypeDataServerSentEventType = "data"ServerSentEventTypeErrorServerSentEventType = "error")

typeServiceBannerConfigdeprecated

type ServiceBannerConfig =BannerConfig

Deprecated: ServiceBannerConfig has been renamed to BannerConfig.

typeSessionCountDeploymentStats

type SessionCountDeploymentStats struct {VSCodeint64 `json:"vscode"`SSHint64 `json:"ssh"`JetBrainsint64 `json:"jetbrains"`ReconnectingPTYint64 `json:"reconnecting_pty"`}

typeSessionLifetimeadded inv2.11.0

type SessionLifetime struct {// DisableExpiryRefresh will disable automatically refreshing api// keys when they are used from the api. This means the api key lifetime at// creation is the lifetime of the api key.DisableExpiryRefreshserpent.Bool `json:"disable_expiry_refresh,omitempty" typescript:",notnull"`// DefaultDuration is only for browser, workspace app and oauth sessions.DefaultDurationserpent.Duration `json:"default_duration" typescript:",notnull"`DefaultTokenDurationserpent.Duration `json:"default_token_lifetime,omitempty" typescript:",notnull"`MaximumTokenDurationserpent.Duration `json:"max_token_lifetime,omitempty" typescript:",notnull"`}

SessionLifetime refers to "sessions" authenticating into Coderd. Coder hasmultiple different session types: api keys, tokens, workspace app tokens,agent tokens, etc. This configuration struct should be used to group allsettings referring to any of these session lifetime controls.TODO: These config options were created back when coder only had api keys.Today, the config is ambigously used for all of them. For example:- cli based api keys ignore all settings- login uses the default lifetime, not the MaximumTokenDuration- Tokens use the Default & MaximumTokenDuration- ... etc ...The rational behind each decision is undocumented. The naming behind theseconfig options is also confusing without any clear documentation.'CreateAPIKey' is used to make all sessions, and it's parameters are just'LifetimeSeconds' and 'DefaultLifetime'. Which does not directly correlate tothe config options here.

typeSlimRoleadded inv2.12.0

type SlimRole struct {Namestring `json:"name"`DisplayNamestring `json:"display_name"`OrganizationIDstring `json:"organization_id,omitempty"`}

SlimRole omits permission information from a role.At present, this is because our apis do not return permission information,and it would require extra db calls to fetch this information. The UI doesnot need it, so most api calls will use this structure that omits information.

func (SlimRole)Stringadded inv2.13.0

func (sSlimRole) String()string

func (SlimRole)UniqueNameadded inv2.13.0

func (sSlimRole) UniqueName()string

UniqueName concatenates the organization ID to create a globally uniquestring name for the role.

typeSupportConfig

type SupportConfig struct {Linksserpent.Struct[[]LinkConfig] `json:"links" typescript:",notnull"`}

typeSwaggerConfig

type SwaggerConfig struct {Enableserpent.Bool `json:"enable" typescript:",notnull"`}

typeTLSConfig

type TLSConfig struct {Enableserpent.Bool        `json:"enable" typescript:",notnull"`Addressserpent.HostPort    `json:"address" typescript:",notnull"`RedirectHTTPserpent.Bool        `json:"redirect_http" typescript:",notnull"`CertFilesserpent.StringArray `json:"cert_file" typescript:",notnull"`ClientAuthserpent.String      `json:"client_auth" typescript:",notnull"`ClientCAFileserpent.String      `json:"client_ca_file" typescript:",notnull"`KeyFilesserpent.StringArray `json:"key_file" typescript:",notnull"`MinVersionserpent.String      `json:"min_version" typescript:",notnull"`ClientCertFileserpent.String      `json:"client_cert_file" typescript:",notnull"`ClientKeyFileserpent.String      `json:"client_key_file" typescript:",notnull"`SupportedCiphersserpent.StringArray `json:"supported_ciphers" typescript:",notnull"`AllowInsecureCiphersserpent.Bool        `json:"allow_insecure_ciphers" typescript:",notnull"`}

typeTelemetryConfig

type TelemetryConfig struct {Enableserpent.Bool `json:"enable" typescript:",notnull"`Traceserpent.Bool `json:"trace" typescript:",notnull"`URLserpent.URL  `json:"url" typescript:",notnull"`}

typeTemplate

type Template struct {IDuuid.UUID       `json:"id" format:"uuid"`CreatedAttime.Time       `json:"created_at" format:"date-time"`UpdatedAttime.Time       `json:"updated_at" format:"date-time"`OrganizationIDuuid.UUID       `json:"organization_id" format:"uuid"`OrganizationNamestring          `json:"organization_name" format:"url"`OrganizationDisplayNamestring          `json:"organization_display_name"`OrganizationIconstring          `json:"organization_icon"`Namestring          `json:"name"`DisplayNamestring          `json:"display_name"`ProvisionerProvisionerType `json:"provisioner" enums:"terraform"`ActiveVersionIDuuid.UUID       `json:"active_version_id" format:"uuid"`// ActiveUserCount is set to -1 when loading.ActiveUserCountint                    `json:"active_user_count"`BuildTimeStatsTemplateBuildTimeStats `json:"build_time_stats"`Descriptionstring                 `json:"description"`Deprecatedbool                   `json:"deprecated"`DeprecationMessagestring                 `json:"deprecation_message"`Iconstring                 `json:"icon"`DefaultTTLMillisint64                  `json:"default_ttl_ms"`ActivityBumpMillisint64                  `json:"activity_bump_ms"`// AutostopRequirement and AutostartRequirement are enterprise features. Its// value is only used if your license is entitled to use the advanced template// scheduling feature.AutostopRequirementTemplateAutostopRequirement  `json:"autostop_requirement"`AutostartRequirementTemplateAutostartRequirement `json:"autostart_requirement"`CreatedByIDuuid.UUID                    `json:"created_by_id" format:"uuid"`CreatedByNamestring                       `json:"created_by_name"`// AllowUserAutostart and AllowUserAutostop are enterprise-only. Their// values are only used if your license is entitled to use the advanced// template scheduling feature.AllowUserAutostartbool `json:"allow_user_autostart"`AllowUserAutostopbool `json:"allow_user_autostop"`AllowUserCancelWorkspaceJobsbool `json:"allow_user_cancel_workspace_jobs"`// FailureTTLMillis, TimeTilDormantMillis, and TimeTilDormantAutoDeleteMillis are enterprise-only. Their// values are used if your license is entitled to use the advanced// template scheduling feature.FailureTTLMillisint64 `json:"failure_ttl_ms"`TimeTilDormantMillisint64 `json:"time_til_dormant_ms"`TimeTilDormantAutoDeleteMillisint64 `json:"time_til_dormant_autodelete_ms"`// RequireActiveVersion mandates that workspaces are built with the active// template version.RequireActiveVersionbool                         `json:"require_active_version"`MaxPortShareLevelWorkspaceAgentPortShareLevel `json:"max_port_share_level"`UseClassicParameterFlowbool `json:"use_classic_parameter_flow"`}

Template is the JSON representation of a Coder template. This type matches thedatabase object for now, but is abstracted for ease of change later on.

typeTemplateACL

type TemplateACL struct {Users  []TemplateUser  `json:"users"`Groups []TemplateGroup `json:"group"`}

typeTemplateAppUsage

type TemplateAppUsage struct {TemplateIDs []uuid.UUID      `json:"template_ids" format:"uuid"`TypeTemplateAppsType `json:"type" example:"builtin"`DisplayNamestring           `json:"display_name" example:"Visual Studio Code"`Slugstring           `json:"slug" example:"vscode"`Iconstring           `json:"icon"`Secondsint64            `json:"seconds" example:"80500"`TimesUsedint64            `json:"times_used" example:"2"`}

TemplateAppUsage shows the usage of an app for one or more templates.

typeTemplateAppsType

type TemplateAppsTypestring

TemplateAppsType defines the type of app reported.

const (TemplateAppsTypeBuiltinTemplateAppsType = "builtin"TemplateAppsTypeAppTemplateAppsType = "app")

TemplateAppsType enums.

typeTemplateAutostartRequirementadded inv2.3.1

type TemplateAutostartRequirement struct {// DaysOfWeek is a list of days of the week in which autostart is allowed// to happen. If no days are specified, autostart is not allowed.DaysOfWeek []string `json:"days_of_week" enums:"monday,tuesday,wednesday,thursday,friday,saturday,sunday"`}

typeTemplateAutostopRequirementadded inv2.1.5

type TemplateAutostopRequirement struct {// DaysOfWeek is a list of days of the week on which restarts are required.// Restarts happen within the user's quiet hours (in their configured// timezone). If no days are specified, restarts are not required. Weekdays// cannot be specified twice.//// Restarts will only happen on weekdays in this list on weeks which line up// with Weeks.DaysOfWeek []string `json:"days_of_week" enums:"monday,tuesday,wednesday,thursday,friday,saturday,sunday"`// Weeks is the number of weeks between required restarts. Weeks are synced// across all workspaces (and Coder deployments) using modulo math on a// hardcoded epoch week of January 2nd, 2023 (the first Monday of 2023).// Values of 0 or 1 indicate weekly restarts. Values of 2 indicate// fortnightly restarts, etc.Weeksint64 `json:"weeks"`}

typeTemplateExample

type TemplateExample struct {IDstring   `json:"id" format:"uuid"`URLstring   `json:"url"`Namestring   `json:"name"`Descriptionstring   `json:"description"`Iconstring   `json:"icon"`Tags        []string `json:"tags"`Markdownstring   `json:"markdown"`}

typeTemplateFilteradded inv2.14.0

type TemplateFilter struct {OrganizationIDuuid.UUID `typescript:"-"`ExactNamestring    `typescript:"-"`FuzzyNamestring    `typescript:"-"`SearchQuerystring    `json:"q,omitempty"`}

typeTemplateGroup

type TemplateGroup struct {GroupRoleTemplateRole `json:"role" enums:"admin,use"`}

typeTemplateInsightsIntervalReport

type TemplateInsightsIntervalReport struct {StartTimetime.Time              `json:"start_time" format:"date-time"`EndTimetime.Time              `json:"end_time" format:"date-time"`TemplateIDs []uuid.UUID            `json:"template_ids" format:"uuid"`IntervalInsightsReportInterval `json:"interval" example:"week"`ActiveUsersint64                  `json:"active_users" example:"14"`}

TemplateInsightsIntervalReport is the report from the template insightsendpoint for a specific interval.

typeTemplateInsightsReport

type TemplateInsightsReport struct {StartTimetime.Time                `json:"start_time" format:"date-time"`EndTimetime.Time                `json:"end_time" format:"date-time"`TemplateIDs     []uuid.UUID              `json:"template_ids" format:"uuid"`ActiveUsersint64                    `json:"active_users" example:"22"`AppsUsage       []TemplateAppUsage       `json:"apps_usage"`ParametersUsage []TemplateParameterUsage `json:"parameters_usage"`}

TemplateInsightsReport is the report from the template insights endpoint.

typeTemplateInsightsRequest

type TemplateInsightsRequest struct {StartTimetime.Time                 `json:"start_time" format:"date-time"`EndTimetime.Time                 `json:"end_time" format:"date-time"`TemplateIDs []uuid.UUID               `json:"template_ids" format:"uuid"`IntervalInsightsReportInterval    `json:"interval" example:"day"`Sections    []TemplateInsightsSection `json:"sections" example:"report"`}

typeTemplateInsightsResponse

type TemplateInsightsResponse struct {Report          *TemplateInsightsReport          `json:"report,omitempty"`IntervalReports []TemplateInsightsIntervalReport `json:"interval_reports,omitempty"`}

TemplateInsightsResponse is the response from the template insights endpoint.

typeTemplateInsightsSectionadded inv2.2.1

type TemplateInsightsSectionstring

TemplateInsightsSection defines the section to be included in the template insights response.

const (TemplateInsightsSectionIntervalReportsTemplateInsightsSection = "interval_reports"TemplateInsightsSectionReportTemplateInsightsSection = "report")

TemplateInsightsSection enums.

typeTemplateParameterUsage

type TemplateParameterUsage struct {TemplateIDs []uuid.UUID                      `json:"template_ids" format:"uuid"`DisplayNamestring                           `json:"display_name"`Namestring                           `json:"name"`Typestring                           `json:"type"`Descriptionstring                           `json:"description"`Options     []TemplateVersionParameterOption `json:"options,omitempty"`Values      []TemplateParameterValue         `json:"values"`}

TemplateParameterUsage shows the usage of a parameter for one or moretemplates.

typeTemplateParameterValue

type TemplateParameterValue struct {Valuestring `json:"value"`Countint64  `json:"count"`}

TemplateParameterValue shows the usage of a parameter value for one or moretemplates.

typeTemplateRole

type TemplateRolestring
const (TemplateRoleAdminTemplateRole = "admin"TemplateRoleUseTemplateRole = "use"TemplateRoleDeletedTemplateRole = "")

typeTemplateUser

type TemplateUser struct {UserRoleTemplateRole `json:"role" enums:"admin,use"`}

typeTemplateVersion

type TemplateVersion struct {IDuuid.UUID      `json:"id" format:"uuid"`TemplateID     *uuid.UUID     `json:"template_id,omitempty" format:"uuid"`OrganizationIDuuid.UUID      `json:"organization_id,omitempty" format:"uuid"`CreatedAttime.Time      `json:"created_at" format:"date-time"`UpdatedAttime.Time      `json:"updated_at" format:"date-time"`Namestring         `json:"name"`Messagestring         `json:"message"`JobProvisionerJob `json:"job"`Readmestring         `json:"readme"`CreatedByMinimalUser    `json:"created_by"`Archivedbool           `json:"archived"`Warnings            []TemplateVersionWarning `json:"warnings,omitempty" enums:"DEPRECATED_PARAMETERS"`MatchedProvisioners *MatchedProvisioners     `json:"matched_provisioners,omitempty"`}

TemplateVersion represents a single version of a template.

typeTemplateVersionExternalAuthadded inv2.2.1

type TemplateVersionExternalAuth struct {IDstring `json:"id"`Typestring `json:"type"`DisplayNamestring `json:"display_name"`DisplayIconstring `json:"display_icon"`AuthenticateURLstring `json:"authenticate_url"`Authenticatedbool   `json:"authenticated"`Optionalbool   `json:"optional,omitempty"`}

typeTemplateVersionParameter

type TemplateVersionParameter struct {Namestring                           `json:"name"`DisplayNamestring                           `json:"display_name,omitempty"`Descriptionstring                           `json:"description"`DescriptionPlaintextstring                           `json:"description_plaintext"`Typestring                           `json:"type" enums:"string,number,bool,list(string)"`Mutablebool                             `json:"mutable"`DefaultValuestring                           `json:"default_value"`Iconstring                           `json:"icon"`Options              []TemplateVersionParameterOption `json:"options"`ValidationErrorstring                           `json:"validation_error,omitempty"`ValidationRegexstring                           `json:"validation_regex,omitempty"`ValidationMin        *int32                           `json:"validation_min,omitempty"`ValidationMax        *int32                           `json:"validation_max,omitempty"`ValidationMonotonicValidationMonotonicOrder         `json:"validation_monotonic,omitempty" enums:"increasing,decreasing"`Requiredbool                             `json:"required"`Ephemeralbool                             `json:"ephemeral"`}

TemplateVersionParameter represents a parameter for a template version.

typeTemplateVersionParameterOption

type TemplateVersionParameterOption struct {Namestring `json:"name"`Descriptionstring `json:"description"`Valuestring `json:"value"`Iconstring `json:"icon"`}

TemplateVersionParameterOption represents a selectable option for a template parameter.

typeTemplateVersionVariable

type TemplateVersionVariable struct {Namestring `json:"name"`Descriptionstring `json:"description"`Typestring `json:"type" enums:"string,number,bool"`Valuestring `json:"value"`DefaultValuestring `json:"default_value"`Requiredbool   `json:"required"`Sensitivebool   `json:"sensitive"`}

TemplateVersionVariable represents a managed template variable.

typeTemplateVersionWarning

type TemplateVersionWarningstring
const (TemplateVersionWarningUnsupportedWorkspacesTemplateVersionWarning = "UNSUPPORTED_WORKSPACES")

typeTemplateVersionsByTemplateRequest

type TemplateVersionsByTemplateRequest struct {TemplateIDuuid.UUID `json:"template_id" validate:"required" format:"uuid"`IncludeArchivedbool      `json:"include_archived"`Pagination}

TemplateVersionsByTemplateRequest defines the request parameters forTemplateVersionsByTemplate.

typeTerminalFontNameadded inv2.22.0

type TerminalFontNamestring

TerminalFontName is the name of supported terminal font

const (TerminalFontUnknownTerminalFontName = ""TerminalFontIBMPlexMonoTerminalFontName = "ibm-plex-mono"TerminalFontFiraCodeTerminalFontName = "fira-code"TerminalFontSourceCodeProTerminalFontName = "source-code-pro"TerminalFontJetBrainsMonoTerminalFontName = "jetbrains-mono")

typeTimingStageadded inv2.18.0

type TimingStagestring
const (// Based on ProvisionerJobTimingStageTimingStageInitTimingStage = "init"TimingStagePlanTimingStage = "plan"TimingStageGraphTimingStage = "graph"TimingStageApplyTimingStage = "apply"// Based on  WorkspaceAgentScriptTimingStageTimingStageStartTimingStage = "start"TimingStageStopTimingStage = "stop"TimingStageCronTimingStage = "cron"// Custom timing stage to represent the time taken to connect to an agentTimingStageConnectTimingStage = "connect")

typeTokenConfig

type TokenConfig struct {MaxTokenLifetimetime.Duration `json:"max_token_lifetime"`}

typeTokensFilter

type TokensFilter struct {IncludeAllbool `json:"include_all"`}

typeTraceConfig

type TraceConfig struct {Enableserpent.Bool   `json:"enable" typescript:",notnull"`HoneycombAPIKeyserpent.String `json:"honeycomb_api_key" typescript:",notnull"`CaptureLogsserpent.Bool   `json:"capture_logs" typescript:",notnull"`DataDogserpent.Bool   `json:"data_dog" typescript:",notnull"`}

typeTransitionStats

type TransitionStats struct {P50 *int64 `example:"123"`P95 *int64 `example:"146"`}

typeUpdateActiveTemplateVersion

type UpdateActiveTemplateVersion struct {IDuuid.UUID `json:"id" validate:"required" format:"uuid"`}

typeUpdateAppearanceConfig

type UpdateAppearanceConfig struct {ApplicationNamestring `json:"application_name"`LogoURLstring `json:"logo_url"`// Deprecated: ServiceBanner has been replaced by AnnouncementBanners.ServiceBannerBannerConfig   `json:"service_banner"`AnnouncementBanners []BannerConfig `json:"announcement_banners"`}

typeUpdateCheckResponse

type UpdateCheckResponse struct {// Current indicates whether the server version is the same as the latest.Currentbool `json:"current"`// Version is the semantic version for the latest release of Coder.Versionstring `json:"version"`// URL to download the latest release of Coder.URLstring `json:"url"`}

UpdateCheckResponse contains information on the latest release of Coder.

typeUpdateInboxNotificationReadStatusRequestadded inv2.21.0

type UpdateInboxNotificationReadStatusRequest struct {IsReadbool `json:"is_read"`}

typeUpdateInboxNotificationReadStatusResponseadded inv2.21.0

type UpdateInboxNotificationReadStatusResponse struct {NotificationInboxNotification `json:"notification"`UnreadCountint               `json:"unread_count"`}

typeUpdateNotificationTemplateMethodadded inv2.15.0

type UpdateNotificationTemplateMethod struct {Methodstring `json:"method,omitempty" example:"webhook"`}

typeUpdateOrganizationRequestadded inv2.12.0

type UpdateOrganizationRequest struct {Namestring  `json:"name,omitempty" validate:"omitempty,organization_name"`DisplayNamestring  `json:"display_name,omitempty" validate:"omitempty,organization_display_name"`Description *string `json:"description,omitempty"`Icon        *string `json:"icon,omitempty"`}

typeUpdateRoles

type UpdateRoles struct {Roles []string `json:"roles" validate:""`}

typeUpdateTemplateACL

type UpdateTemplateACL struct {// UserPerms should be a mapping of user id to role. The user id must be the// uuid of the user, not a username or email address.UserPerms map[string]TemplateRole `json:"user_perms,omitempty" example:"<group_id>:admin,4df59e74-c027-470b-ab4d-cbba8963a5e9:use"`// GroupPerms should be a mapping of group id to role.GroupPerms map[string]TemplateRole `json:"group_perms,omitempty" example:"<user_id>>:admin,8bd26b20-f3e8-48be-a903-46bb920cf671:use"`}

typeUpdateTemplateMeta

type UpdateTemplateMeta struct {Namestring `json:"name,omitempty" validate:"omitempty,template_name"`DisplayNamestring `json:"display_name,omitempty" validate:"omitempty,template_display_name"`Descriptionstring `json:"description,omitempty"`Iconstring `json:"icon,omitempty"`DefaultTTLMillisint64  `json:"default_ttl_ms,omitempty"`// ActivityBumpMillis allows optionally specifying the activity bump// duration for all workspaces created from this template. Defaults to 1h// but can be set to 0 to disable activity bumping.ActivityBumpMillisint64 `json:"activity_bump_ms,omitempty"`// AutostopRequirement and AutostartRequirement can only be set if your license// includes the advanced template scheduling feature. If you attempt to set this// value while unlicensed, it will be ignored.AutostopRequirement            *TemplateAutostopRequirement  `json:"autostop_requirement,omitempty"`AutostartRequirement           *TemplateAutostartRequirement `json:"autostart_requirement,omitempty"`AllowUserAutostartbool                          `json:"allow_user_autostart,omitempty"`AllowUserAutostopbool                          `json:"allow_user_autostop,omitempty"`AllowUserCancelWorkspaceJobsbool                          `json:"allow_user_cancel_workspace_jobs,omitempty"`FailureTTLMillisint64                         `json:"failure_ttl_ms,omitempty"`TimeTilDormantMillisint64                         `json:"time_til_dormant_ms,omitempty"`TimeTilDormantAutoDeleteMillisint64                         `json:"time_til_dormant_autodelete_ms,omitempty"`// UpdateWorkspaceLastUsedAt updates the last_used_at field of workspaces// spawned from the template. This is useful for preventing workspaces being// immediately locked when updating the inactivity_ttl field to a new, shorter// value.UpdateWorkspaceLastUsedAtbool `json:"update_workspace_last_used_at"`// UpdateWorkspaceDormant updates the dormant_at field of workspaces spawned// from the template. This is useful for preventing dormant workspaces being immediately// deleted when updating the dormant_ttl field to a new, shorter value.UpdateWorkspaceDormantAtbool `json:"update_workspace_dormant_at"`// RequireActiveVersion mandates workspaces built using this template// use the active version of the template. This option has no// effect on template admins.RequireActiveVersionbool `json:"require_active_version,omitempty"`// DeprecationMessage if set, will mark the template as deprecated and block// any new workspaces from using this template.// If passed an empty string, will remove the deprecated message, making// the template usable for new workspaces again.DeprecationMessage *string `json:"deprecation_message,omitempty"`// DisableEveryoneGroupAccess allows optionally disabling the default// behavior of granting the 'everyone' group access to use the template.// If this is set to true, the template will not be available to all users,// and must be explicitly granted to users or groups in the permissions settings// of the template.DisableEveryoneGroupAccessbool                          `json:"disable_everyone_group_access"`MaxPortShareLevel          *WorkspaceAgentPortShareLevel `json:"max_port_share_level,omitempty"`// UseClassicParameterFlow is a flag that switches the default behavior to use the classic// parameter flow when creating a workspace. This only affects deployments with the experiment// "dynamic-parameters" enabled. This setting will live for a period after the experiment is// made the default.// An "opt-out" is present in case the new feature breaks some existing templates.UseClassicParameterFlow *bool `json:"use_classic_parameter_flow,omitempty"`}

typeUpdateUserAppearanceSettingsRequestadded inv2.5.1

type UpdateUserAppearanceSettingsRequest struct {ThemePreferencestring           `json:"theme_preference" validate:"required"`TerminalFontTerminalFontName `json:"terminal_font" validate:"required"`}

typeUpdateUserNotificationPreferencesadded inv2.15.0

type UpdateUserNotificationPreferences struct {TemplateDisabledMap map[string]bool `json:"template_disabled_map"`}

typeUpdateUserPasswordRequest

type UpdateUserPasswordRequest struct {OldPasswordstring `json:"old_password" validate:""`Passwordstring `json:"password" validate:"required"`}

typeUpdateUserProfileRequest

type UpdateUserProfileRequest struct {Usernamestring `json:"username" validate:"required,username"`Namestring `json:"name" validate:"user_real_name"`}

typeUpdateUserQuietHoursScheduleRequest

type UpdateUserQuietHoursScheduleRequest struct {// Schedule is a cron expression that defines when the user's quiet hours// window is. Schedule must not be empty. For new users, the schedule is set// to 2am in their browser or computer's timezone. The schedule denotes the// beginning of a 4 hour window where the workspace is allowed to// automatically stop or restart due to maintenance or template schedule.//// The schedule must be daily with a single time, and should have a timezone// specified via a CRON_TZ prefix (otherwise UTC will be used).//// If the schedule is empty, the user will be updated to use the default// schedule.Schedulestring `json:"schedule" validate:"required"`}

typeUpdateWorkspaceAutomaticUpdatesRequestadded inv2.3.0

type UpdateWorkspaceAutomaticUpdatesRequest struct {AutomaticUpdatesAutomaticUpdates `json:"automatic_updates"`}

UpdateWorkspaceAutomaticUpdatesRequest is a request to updates a workspace's automatic updates setting.

typeUpdateWorkspaceAutostartRequest

type UpdateWorkspaceAutostartRequest struct {// Schedule is expected to be of the form `CRON_TZ=<IANA Timezone> <min> <hour> * * <dow>`// Example: `CRON_TZ=US/Central 30 9 * * 1-5` represents 0930 in the timezone US/Central// on weekdays (Mon-Fri). `CRON_TZ` defaults to UTC if not present.Schedule *string `json:"schedule,omitempty"`}

UpdateWorkspaceAutostartRequest is a request to update a workspace's autostart schedule.

typeUpdateWorkspaceDormancyadded inv2.1.4

type UpdateWorkspaceDormancy struct {Dormantbool `json:"dormant"`}

UpdateWorkspaceDormancy is a request to activate or make a workspace dormant.A value of false will activate a dormant workspace.

typeUpdateWorkspaceProxyResponse

type UpdateWorkspaceProxyResponse struct {ProxyWorkspaceProxy `json:"proxy" table:"p,recursive_inline"`ProxyTokenstring         `json:"proxy_token" table:"proxy token"`}

typeUpdateWorkspaceRequest

type UpdateWorkspaceRequest struct {Namestring `json:"name,omitempty" validate:"username"`}

typeUpdateWorkspaceTTLRequest

type UpdateWorkspaceTTLRequest struct {TTLMillis *int64 `json:"ttl_ms"`}

UpdateWorkspaceTTLRequest is a request to update a workspace's TTL.

typeUploadResponse

type UploadResponse struct {IDuuid.UUID `json:"hash" format:"uuid"`}

UploadResponse contains the hash to reference the uploaded file.

typeUpsertWorkspaceAgentPortShareRequestadded inv2.9.0

type UpsertWorkspaceAgentPortShareRequest struct {AgentNamestring                          `json:"agent_name"`Portint32                           `json:"port"`ShareLevelWorkspaceAgentPortShareLevel    `json:"share_level" enums:"owner,authenticated,public"`ProtocolWorkspaceAgentPortShareProtocol `json:"protocol" enums:"http,https"`}

typeUsageAppNameadded inv2.13.0

type UsageAppNamestring
const (UsageAppNameVscodeUsageAppName = "vscode"UsageAppNameJetbrainsUsageAppName = "jetbrains"UsageAppNameReconnectingPtyUsageAppName = "reconnecting-pty"UsageAppNameSSHUsageAppName = "ssh")

typeUser

type User struct {ReducedUser `table:"r,recursive_inline"`OrganizationIDs []uuid.UUID `json:"organization_ids" format:"uuid"`Roles           []SlimRole  `json:"roles"`}

User represents a user in Coder.

typeUserActivityadded inv2.2.0

type UserActivity struct {TemplateIDs []uuid.UUID `json:"template_ids" format:"uuid"`UserIDuuid.UUID   `json:"user_id" format:"uuid"`Usernamestring      `json:"username"`AvatarURLstring      `json:"avatar_url" format:"uri"`Secondsint64       `json:"seconds" example:"80500"`}

UserActivity shows the session time for a user.

typeUserActivityInsightsReportadded inv2.2.0

type UserActivityInsightsReport struct {StartTimetime.Time      `json:"start_time" format:"date-time"`EndTimetime.Time      `json:"end_time" format:"date-time"`TemplateIDs []uuid.UUID    `json:"template_ids" format:"uuid"`Users       []UserActivity `json:"users"`}

UserActivityInsightsReport is the report from the user activity insightsendpoint.

typeUserActivityInsightsRequestadded inv2.2.0

type UserActivityInsightsRequest struct {StartTimetime.Time   `json:"start_time" format:"date-time"`EndTimetime.Time   `json:"end_time" format:"date-time"`TemplateIDs []uuid.UUID `json:"template_ids" format:"uuid"`}

typeUserActivityInsightsResponseadded inv2.2.0

type UserActivityInsightsResponse struct {ReportUserActivityInsightsReport `json:"report"`}

UserActivityInsightsResponse is the response from the user activity insightsendpoint.

typeUserAppearanceSettingsadded inv2.21.0

type UserAppearanceSettings struct {ThemePreferencestring           `json:"theme_preference"`TerminalFontTerminalFontName `json:"terminal_font"`}

typeUserLatency

type UserLatency struct {TemplateIDs []uuid.UUID       `json:"template_ids" format:"uuid"`UserIDuuid.UUID         `json:"user_id" format:"uuid"`Usernamestring            `json:"username"`AvatarURLstring            `json:"avatar_url" format:"uri"`LatencyMSConnectionLatency `json:"latency_ms"`}

UserLatency shows the connection latency for a user.

typeUserLatencyInsightsReport

type UserLatencyInsightsReport struct {StartTimetime.Time     `json:"start_time" format:"date-time"`EndTimetime.Time     `json:"end_time" format:"date-time"`TemplateIDs []uuid.UUID   `json:"template_ids" format:"uuid"`Users       []UserLatency `json:"users"`}

UserLatencyInsightsReport is the report from the user latency insightsendpoint.

typeUserLatencyInsightsRequest

type UserLatencyInsightsRequest struct {StartTimetime.Time   `json:"start_time" format:"date-time"`EndTimetime.Time   `json:"end_time" format:"date-time"`TemplateIDs []uuid.UUID `json:"template_ids" format:"uuid"`}

typeUserLatencyInsightsResponse

type UserLatencyInsightsResponse struct {ReportUserLatencyInsightsReport `json:"report"`}

UserLatencyInsightsResponse is the response from the user latency insightsendpoint.

typeUserLoginType

type UserLoginType struct {LoginTypeLoginType `json:"login_type"`}

typeUserParameteradded inv2.8.0

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

typeUserQuietHoursScheduleConfig

type UserQuietHoursScheduleConfig struct {DefaultScheduleserpent.String `json:"default_schedule" typescript:",notnull"`AllowUserCustomserpent.Bool   `json:"allow_user_custom" typescript:",notnull"`}

typeUserQuietHoursScheduleResponse

type UserQuietHoursScheduleResponse struct {RawSchedulestring `json:"raw_schedule"`// UserSet is true if the user has set their own quiet hours schedule. If// false, the user is using the default schedule.UserSetbool `json:"user_set"`// UserCanSet is true if the user is allowed to set their own quiet hours// schedule. If false, the user cannot set a custom schedule and the default// schedule will always be used.UserCanSetbool `json:"user_can_set"`// Time is the time of day that the quiet hours window starts in the given// Timezone each day.Timestring `json:"time"`// HH:mm (24-hour)Timezonestring `json:"timezone"`// raw format from the cron expression, UTC if unspecified// Next is the next time that the quiet hours window will start.Nexttime.Time `json:"next" format:"date-time"`}

typeUserRoles

type UserRoles struct {Roles             []string               `json:"roles"`OrganizationRoles map[uuid.UUID][]string `json:"organization_roles"`}

typeUserStatus

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

typeUserStatusChangeCountadded inv2.19.0

type UserStatusChangeCount struct {Datetime.Time `json:"date" format:"date-time"`Countint64     `json:"count" example:"10"`}

typeUsersRequest

type UsersRequest struct {Searchstring `json:"search,omitempty" typescript:"-"`// Filter users by status.StatusUserStatus `json:"status,omitempty" typescript:"-"`// Filter users that have the given role.Rolestring      `json:"role,omitempty" typescript:"-"`LoginType []LoginType `json:"login_type,omitempty" typescript:"-"`SearchQuerystring `json:"q,omitempty"`Pagination}

typeValidateUserPasswordRequestadded inv2.18.0

type ValidateUserPasswordRequest struct {Passwordstring `json:"password" validate:"required"`}

typeValidateUserPasswordResponseadded inv2.18.0

type ValidateUserPasswordResponse struct {Validbool   `json:"valid"`Detailsstring `json:"details"`}

typeValidationError

type ValidationError struct {Fieldstring `json:"field" validate:"required"`Detailstring `json:"detail" validate:"required"`}

ValidationError represents a scoped error to a user input.

func (ValidationError)Error

func (eValidationError) Error()string

typeValidationMonotonicOrder

type ValidationMonotonicOrderstring
const (MonotonicOrderIncreasingValidationMonotonicOrder = "increasing"MonotonicOrderDecreasingValidationMonotonicOrder = "decreasing")

typeVariableValue

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

funcParseUserVariableValuesadded inv2.14.0

func ParseUserVariableValues(varsFiles []string, variablesFilestring, commandLineVariables []string) ([]VariableValue,error)

typeWebpushMessageadded inv2.21.0

type WebpushMessage struct {Iconstring                 `json:"icon"`Titlestring                 `json:"title"`Bodystring                 `json:"body"`Actions []WebpushMessageAction `json:"actions"`}

typeWebpushMessageActionadded inv2.21.0

type WebpushMessageAction struct {Labelstring `json:"label"`URLstring `json:"url"`}

typeWebpushSubscriptionadded inv2.21.0

type WebpushSubscription struct {Endpointstring `json:"endpoint"`AuthKeystring `json:"auth_key"`P256DHKeystring `json:"p256dh_key"`}

typeWorkspace

type Workspace struct {IDuuid.UUID           `json:"id" format:"uuid"`CreatedAttime.Time           `json:"created_at" format:"date-time"`UpdatedAttime.Time           `json:"updated_at" format:"date-time"`OwnerIDuuid.UUID           `json:"owner_id" format:"uuid"`OwnerNamestring              `json:"owner_name"`OwnerAvatarURLstring              `json:"owner_avatar_url"`OrganizationIDuuid.UUID           `json:"organization_id" format:"uuid"`OrganizationNamestring              `json:"organization_name"`TemplateIDuuid.UUID           `json:"template_id" format:"uuid"`TemplateNamestring              `json:"template_name"`TemplateDisplayNamestring              `json:"template_display_name"`TemplateIconstring              `json:"template_icon"`TemplateAllowUserCancelWorkspaceJobsbool                `json:"template_allow_user_cancel_workspace_jobs"`TemplateActiveVersionIDuuid.UUID           `json:"template_active_version_id" format:"uuid"`TemplateRequireActiveVersionbool                `json:"template_require_active_version"`TemplateUseClassicParameterFlowbool                `json:"template_use_classic_parameter_flow"`LatestBuildWorkspaceBuild      `json:"latest_build"`LatestAppStatus                      *WorkspaceAppStatus `json:"latest_app_status"`Outdatedbool                `json:"outdated"`Namestring              `json:"name"`AutostartSchedule                    *string             `json:"autostart_schedule,omitempty"`TTLMillis                            *int64              `json:"ttl_ms,omitempty"`LastUsedAttime.Time           `json:"last_used_at" format:"date-time"`// DeletingAt indicates the time at which the workspace will be permanently deleted.// A workspace is eligible for deletion if it is dormant (a non-nil dormant_at value)// and a value has been specified for time_til_dormant_autodelete on its template.DeletingAt *time.Time `json:"deleting_at" format:"date-time"`// DormantAt being non-nil indicates a workspace that is dormant.// A dormant workspace is no longer accessible must be activated.// It is subject to deletion if it breaches// the duration of the time_til_ field on its template.DormantAt *time.Time `json:"dormant_at" format:"date-time"`// Health shows the health of the workspace and information about// what is causing an unhealthy status.HealthWorkspaceHealth  `json:"health"`AutomaticUpdatesAutomaticUpdates `json:"automatic_updates" enums:"always,never"`AllowRenamesbool             `json:"allow_renames"`Favoritebool             `json:"favorite"`NextStartAt      *time.Time       `json:"next_start_at" format:"date-time"`}

Workspace is a deployment of a template. It references a specificversion and can be updated.

func (Workspace)FullName

func (wWorkspace) FullName()string

typeWorkspaceAgent

type WorkspaceAgent struct {IDuuid.UUID               `json:"id" format:"uuid"`ParentIDuuid.NullUUID           `json:"parent_id" format:"uuid"`CreatedAttime.Time               `json:"created_at" format:"date-time"`UpdatedAttime.Time               `json:"updated_at" format:"date-time"`FirstConnectedAt     *time.Time              `json:"first_connected_at,omitempty" format:"date-time"`LastConnectedAt      *time.Time              `json:"last_connected_at,omitempty" format:"date-time"`DisconnectedAt       *time.Time              `json:"disconnected_at,omitempty" format:"date-time"`StartedAt            *time.Time              `json:"started_at,omitempty" format:"date-time"`ReadyAt              *time.Time              `json:"ready_at,omitempty" format:"date-time"`StatusWorkspaceAgentStatus    `json:"status"`LifecycleStateWorkspaceAgentLifecycle `json:"lifecycle_state"`Namestring                  `json:"name"`ResourceIDuuid.UUID               `json:"resource_id" format:"uuid"`InstanceIDstring                  `json:"instance_id,omitempty"`Architecturestring                  `json:"architecture"`EnvironmentVariables map[string]string       `json:"environment_variables"`OperatingSystemstring                  `json:"operating_system"`LogsLengthint32                   `json:"logs_length"`LogsOverflowedbool                    `json:"logs_overflowed"`Directorystring                  `json:"directory,omitempty"`ExpandedDirectorystring                  `json:"expanded_directory,omitempty"`Versionstring                  `json:"version"`APIVersionstring                  `json:"api_version"`Apps                 []WorkspaceApp          `json:"apps"`// DERPLatency is mapped by region name (e.g. "New York City", "Seattle").DERPLatency              map[string]DERPRegion     `json:"latency,omitempty"`ConnectionTimeoutSecondsint32                     `json:"connection_timeout_seconds"`TroubleshootingURLstring                    `json:"troubleshooting_url"`Subsystems               []AgentSubsystem          `json:"subsystems"`HealthWorkspaceAgentHealth      `json:"health"`// Health reports the health of the agent.DisplayApps              []DisplayApp              `json:"display_apps"`LogSources               []WorkspaceAgentLogSource `json:"log_sources"`Scripts                  []WorkspaceAgentScript    `json:"scripts"`// StartupScriptBehavior is a legacy field that is deprecated in favor// of the `coder_script` resource. It's only referenced by old clients.// Deprecated: Remove in the future!StartupScriptBehaviorWorkspaceAgentStartupScriptBehavior `json:"startup_script_behavior"`}

typeWorkspaceAgentContaineradded inv2.21.0

type WorkspaceAgentContainer struct {// CreatedAt is the time the container was created.CreatedAttime.Time `json:"created_at" format:"date-time"`// ID is the unique identifier of the container.IDstring `json:"id"`// FriendlyName is the human-readable name of the container.FriendlyNamestring `json:"name"`// Image is the name of the container image.Imagestring `json:"image"`// Labels is a map of key-value pairs of container labels.Labels map[string]string `json:"labels"`// Running is true if the container is currently running.Runningbool `json:"running"`// Ports includes ports exposed by the container.Ports []WorkspaceAgentContainerPort `json:"ports"`// Status is the current status of the container. This is somewhat// implementation-dependent, but should generally be a human-readable// string.Statusstring `json:"status"`// Volumes is a map of "things" mounted into the container. Again, this// is somewhat implementation-dependent.Volumes map[string]string `json:"volumes"`// DevcontainerStatus is the status of the devcontainer, if this// container is a devcontainer. This is used to determine if the// devcontainer is running, stopped, starting, or in an error state.DevcontainerStatusWorkspaceAgentDevcontainerStatus `json:"devcontainer_status,omitempty"`// DevcontainerDirty is true if the devcontainer configuration has changed// since the container was created. This is used to determine if the// container needs to be rebuilt.DevcontainerDirtybool `json:"devcontainer_dirty"`}

WorkspaceAgentContainer describes a devcontainer of some sortthat is visible to the workspace agent. This struct is an abstractionof potentially multiple implementations, and the fields will besomewhat implementation-dependent.

func (*WorkspaceAgentContainer)Matchadded inv2.22.0

func (c *WorkspaceAgentContainer) Match(idOrNamestring)bool

typeWorkspaceAgentContainerPortadded inv2.21.0

type WorkspaceAgentContainerPort struct {// Port is the port number *inside* the container.Portuint16 `json:"port"`// Network is the network protocol used by the port (tcp, udp, etc).Networkstring `json:"network"`// HostIP is the IP address of the host interface to which the port is// bound. Note that this can be an IPv4 or IPv6 address.HostIPstring `json:"host_ip,omitempty"`// HostPort is the port number *outside* the container.HostPortuint16 `json:"host_port,omitempty"`}

WorkspaceAgentContainerPort describes a port as exposed by a container.

typeWorkspaceAgentDevcontaineradded inv2.20.0

type WorkspaceAgentDevcontainer struct {IDuuid.UUID `json:"id" format:"uuid"`Namestring    `json:"name"`WorkspaceFolderstring    `json:"workspace_folder"`ConfigPathstring    `json:"config_path,omitempty"`// Additional runtime fields.StatusWorkspaceAgentDevcontainerStatus `json:"status"`Dirtybool                             `json:"dirty"`Container *WorkspaceAgentContainer         `json:"container,omitempty"`}

WorkspaceAgentDevcontainer defines the location of a devcontainerconfiguration in a workspace that is visible to the workspace agent.

typeWorkspaceAgentDevcontainerStatusadded inv2.23.0

type WorkspaceAgentDevcontainerStatusstring

WorkspaceAgentDevcontainerStatus is the status of a devcontainer.

const (WorkspaceAgentDevcontainerStatusRunningWorkspaceAgentDevcontainerStatus = "running"WorkspaceAgentDevcontainerStatusStoppedWorkspaceAgentDevcontainerStatus = "stopped"WorkspaceAgentDevcontainerStatusStartingWorkspaceAgentDevcontainerStatus = "starting"WorkspaceAgentDevcontainerStatusErrorWorkspaceAgentDevcontainerStatus = "error")

WorkspaceAgentDevcontainerStatus enums.

typeWorkspaceAgentDevcontainersResponseadded inv2.22.0

type WorkspaceAgentDevcontainersResponse struct {Devcontainers []WorkspaceAgentDevcontainer `json:"devcontainers"`}

WorkspaceAgentDevcontainersResponse is the response to the devcontainersrequest.

typeWorkspaceAgentHealth

type WorkspaceAgentHealth struct {Healthybool   `json:"healthy" example:"false"`// Healthy is true if the agent is healthy.Reasonstring `json:"reason,omitempty" example:"agent has lost connection"`// Reason is a human-readable explanation of the agent's health. It is empty if Healthy is true.}

typeWorkspaceAgentLifecycle

type WorkspaceAgentLifecyclestring

WorkspaceAgentLifecycle represents the lifecycle state of a workspace agent.

The agent lifecycle starts in the "created" state, and transitions to"starting" when the agent reports it has begun preparing (e.g. startedexecuting the startup script).

const (WorkspaceAgentLifecycleCreatedWorkspaceAgentLifecycle = "created"WorkspaceAgentLifecycleStartingWorkspaceAgentLifecycle = "starting"WorkspaceAgentLifecycleStartTimeoutWorkspaceAgentLifecycle = "start_timeout"WorkspaceAgentLifecycleStartErrorWorkspaceAgentLifecycle = "start_error"WorkspaceAgentLifecycleReadyWorkspaceAgentLifecycle = "ready"WorkspaceAgentLifecycleShuttingDownWorkspaceAgentLifecycle = "shutting_down"WorkspaceAgentLifecycleShutdownTimeoutWorkspaceAgentLifecycle = "shutdown_timeout"WorkspaceAgentLifecycleShutdownErrorWorkspaceAgentLifecycle = "shutdown_error"WorkspaceAgentLifecycleOffWorkspaceAgentLifecycle = "off")

WorkspaceAgentLifecycle enums.

func (WorkspaceAgentLifecycle)ShuttingDown

func (lWorkspaceAgentLifecycle) ShuttingDown()bool

ShuttingDown returns true if the agent is in the process of shuttingdown or has shut down.

func (WorkspaceAgentLifecycle)Starting

func (lWorkspaceAgentLifecycle) Starting()bool

Starting returns true if the agent is in the process of starting.

typeWorkspaceAgentListContainersResponseadded inv2.20.0

type WorkspaceAgentListContainersResponse struct {// Containers is a list of containers visible to the workspace agent.Containers []WorkspaceAgentContainer `json:"containers"`// Warnings is a list of warnings that may have occurred during the// process of listing containers. This should not include fatal errors.Warnings []string `json:"warnings,omitempty"`}

WorkspaceAgentListContainersResponse is the response to the list containersrequest.

typeWorkspaceAgentListeningPort

type WorkspaceAgentListeningPort struct {ProcessNamestring `json:"process_name"`// may be emptyNetworkstring `json:"network"`// only "tcp" at the momentPortuint16 `json:"port"`}

typeWorkspaceAgentListeningPortsResponse

type WorkspaceAgentListeningPortsResponse struct {// If there are no ports in the list, nothing should be displayed in the UI.// There must not be a "no ports available" message or anything similar, as// there will always be no ports displayed on platforms where our port// detection logic is unsupported.Ports []WorkspaceAgentListeningPort `json:"ports"`}

typeWorkspaceAgentLog

type WorkspaceAgentLog struct {IDint64     `json:"id"`CreatedAttime.Time `json:"created_at" format:"date-time"`Outputstring    `json:"output"`LevelLogLevel  `json:"level"`SourceIDuuid.UUID `json:"source_id" format:"uuid"`}

typeWorkspaceAgentLogSource

type WorkspaceAgentLogSource struct {WorkspaceAgentIDuuid.UUID `json:"workspace_agent_id" format:"uuid"`IDuuid.UUID `json:"id" format:"uuid"`CreatedAttime.Time `json:"created_at" format:"date-time"`DisplayNamestring    `json:"display_name"`Iconstring    `json:"icon"`}

typeWorkspaceAgentMetadata

type WorkspaceAgentMetadata struct {ResultWorkspaceAgentMetadataResult      `json:"result"`DescriptionWorkspaceAgentMetadataDescription `json:"description"`}

typeWorkspaceAgentMetadataDescription

type WorkspaceAgentMetadataDescription struct {DisplayNamestring `json:"display_name"`Keystring `json:"key"`Scriptstring `json:"script"`Intervalint64  `json:"interval"`Timeoutint64  `json:"timeout"`}

WorkspaceAgentMetadataDescription is a description of dynamic metadata the agent should reportback to coderd. It is provided via the `metadata` list in the `coder_agent`block.

typeWorkspaceAgentMetadataResult

type WorkspaceAgentMetadataResult struct {CollectedAttime.Time `json:"collected_at" format:"date-time"`// Age is the number of seconds since the metadata was collected.// It is provided in addition to CollectedAt to protect against clock skew.Ageint64  `json:"age"`Valuestring `json:"value"`Errorstring `json:"error"`}

typeWorkspaceAgentPortShareadded inv2.9.0

type WorkspaceAgentPortShare struct {WorkspaceIDuuid.UUID                       `json:"workspace_id" format:"uuid"`AgentNamestring                          `json:"agent_name"`Portint32                           `json:"port"`ShareLevelWorkspaceAgentPortShareLevel    `json:"share_level" enums:"owner,authenticated,public"`ProtocolWorkspaceAgentPortShareProtocol `json:"protocol" enums:"http,https"`}

typeWorkspaceAgentPortShareLeveladded inv2.9.0

type WorkspaceAgentPortShareLevelstring

func (WorkspaceAgentPortShareLevel)ValidMaxLeveladded inv2.9.0

func (lWorkspaceAgentPortShareLevel) ValidMaxLevel()bool

func (WorkspaceAgentPortShareLevel)ValidPortShareLeveladded inv2.9.0

func (lWorkspaceAgentPortShareLevel) ValidPortShareLevel()bool

typeWorkspaceAgentPortShareProtocoladded inv2.9.0

type WorkspaceAgentPortShareProtocolstring

func (WorkspaceAgentPortShareProtocol)ValidPortProtocoladded inv2.9.0

func (pWorkspaceAgentPortShareProtocol) ValidPortProtocol()bool

typeWorkspaceAgentPortSharesadded inv2.9.0

type WorkspaceAgentPortShares struct {Shares []WorkspaceAgentPortShare `json:"shares"`}

typeWorkspaceAgentScriptadded inv2.2.0

type WorkspaceAgentScript struct {IDuuid.UUID     `json:"id" format:"uuid"`LogSourceIDuuid.UUID     `json:"log_source_id" format:"uuid"`LogPathstring        `json:"log_path"`Scriptstring        `json:"script"`Cronstring        `json:"cron"`RunOnStartbool          `json:"run_on_start"`RunOnStopbool          `json:"run_on_stop"`StartBlocksLoginbool          `json:"start_blocks_login"`Timeouttime.Duration `json:"timeout"`DisplayNamestring        `json:"display_name"`}

typeWorkspaceAgentStartupScriptBehavior

type WorkspaceAgentStartupScriptBehaviorstring

WorkspaceAgentStartupScriptBehavior defines whether or not the startup scriptshould be considered blocking or non-blocking. The blocking behavior meansthat the agent will not be considered ready until the startup script hascompleted and, for example, SSH connections will wait for the agent to beready (can be overridden).

Presently, non-blocking is the default, but this may change in the future.Deprecated: `coder_script` allows configuration on a per-script basis.

const (WorkspaceAgentStartupScriptBehaviorBlockingWorkspaceAgentStartupScriptBehavior = "blocking"WorkspaceAgentStartupScriptBehaviorNonBlockingWorkspaceAgentStartupScriptBehavior = "non-blocking")

typeWorkspaceAgentStatus

type WorkspaceAgentStatusstring
const (WorkspaceAgentConnectingWorkspaceAgentStatus = "connecting"WorkspaceAgentConnectedWorkspaceAgentStatus = "connected"WorkspaceAgentDisconnectedWorkspaceAgentStatus = "disconnected"WorkspaceAgentTimeoutWorkspaceAgentStatus = "timeout")

This is also in database/modelmethods.go and should be kept in sync.

typeWorkspaceApp

type WorkspaceApp struct {IDuuid.UUID `json:"id" format:"uuid"`// URL is the address being proxied to inside the workspace.// If external is specified, this will be opened on the client.URLstring `json:"url,omitempty"`// External specifies whether the URL should be opened externally on// the client or not.Externalbool `json:"external"`// Slug is a unique identifier within the agent.Slugstring `json:"slug"`// DisplayName is a friendly name for the app.DisplayNamestring `json:"display_name,omitempty"`Commandstring `json:"command,omitempty"`// Icon is a relative path or external URL that specifies// an icon to be displayed in the dashboard.Iconstring `json:"icon,omitempty"`// Subdomain denotes whether the app should be accessed via a path on the// `coder server` or via a hostname-based dev URL. If this is set to true// and there is no app wildcard configured on the server, the app will not// be accessible in the UI.Subdomainbool `json:"subdomain"`// SubdomainName is the application domain exposed on the `coder server`.SubdomainNamestring                   `json:"subdomain_name,omitempty"`SharingLevelWorkspaceAppSharingLevel `json:"sharing_level" enums:"owner,authenticated,public"`// Healthcheck specifies the configuration for checking app health.HealthcheckHealthcheck        `json:"healthcheck,omitempty"`HealthWorkspaceAppHealth `json:"health"`Groupstring             `json:"group,omitempty"`Hiddenbool               `json:"hidden"`OpenInWorkspaceAppOpenIn `json:"open_in"`// Statuses is a list of statuses for the app.Statuses []WorkspaceAppStatus `json:"statuses"`}

typeWorkspaceAppHealth

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

typeWorkspaceAppOpenInadded inv2.19.0

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

typeWorkspaceAppSharingLevel

type WorkspaceAppSharingLevelstring
const (WorkspaceAppSharingLevelOwnerWorkspaceAppSharingLevel = "owner"WorkspaceAppSharingLevelAuthenticatedWorkspaceAppSharingLevel = "authenticated"WorkspaceAppSharingLevelPublicWorkspaceAppSharingLevel = "public")

typeWorkspaceAppStatusadded inv2.21.0

type WorkspaceAppStatus struct {IDuuid.UUID               `json:"id" format:"uuid"`CreatedAttime.Time               `json:"created_at" format:"date-time"`WorkspaceIDuuid.UUID               `json:"workspace_id" format:"uuid"`AgentIDuuid.UUID               `json:"agent_id" format:"uuid"`AppIDuuid.UUID               `json:"app_id" format:"uuid"`StateWorkspaceAppStatusState `json:"state"`Messagestring                  `json:"message"`// URI is the URI of the resource that the status is for.// e.g.https://github.com/org/repo/pull/123// e.g. file:///path/to/fileURIstring `json:"uri"`// Deprecated: This field is unused and will be removed in a future version.// Icon is an external URL to an icon that will be rendered in the UI.Iconstring `json:"icon"`// Deprecated: This field is unused and will be removed in a future version.// NeedsUserAttention specifies whether the status needs user attention.NeedsUserAttentionbool `json:"needs_user_attention"`}

typeWorkspaceAppStatusStateadded inv2.21.0

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

typeWorkspaceBuild

type WorkspaceBuild struct {IDuuid.UUID            `json:"id" format:"uuid"`CreatedAttime.Time            `json:"created_at" format:"date-time"`UpdatedAttime.Time            `json:"updated_at" format:"date-time"`WorkspaceIDuuid.UUID            `json:"workspace_id" format:"uuid"`WorkspaceNamestring               `json:"workspace_name"`WorkspaceOwnerIDuuid.UUID            `json:"workspace_owner_id" format:"uuid"`WorkspaceOwnerNamestring               `json:"workspace_owner_name,omitempty"`WorkspaceOwnerUsernamestring               `json:"workspace_owner_username"`WorkspaceOwnerAvatarURLstring               `json:"workspace_owner_avatar_url,omitempty"`TemplateVersionIDuuid.UUID            `json:"template_version_id" format:"uuid"`TemplateVersionNamestring               `json:"template_version_name"`BuildNumberint32                `json:"build_number"`TransitionWorkspaceTransition  `json:"transition" enums:"start,stop,delete"`InitiatorIDuuid.UUID            `json:"initiator_id" format:"uuid"`InitiatorUsernamestring               `json:"initiator_name"`JobProvisionerJob       `json:"job"`ReasonBuildReason          `db:"reason" json:"reason" enums:"initiator,autostart,autostop"`Resources               []WorkspaceResource  `json:"resources"`DeadlineNullTime             `json:"deadline,omitempty" format:"date-time"`MaxDeadlineNullTime             `json:"max_deadline,omitempty" format:"date-time"`StatusWorkspaceStatus      `json:"status" enums:"pending,starting,running,stopping,stopped,failed,canceling,canceled,deleting,deleted"`DailyCostint32                `json:"daily_cost"`MatchedProvisioners     *MatchedProvisioners `json:"matched_provisioners,omitempty"`TemplateVersionPresetID *uuid.UUID           `json:"template_version_preset_id" format:"uuid"`}

WorkspaceBuild is an at-point representation of a workspace state.BuildNumbers start at 1 and increase by 1 for each subsequent build

typeWorkspaceBuildParameter

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

WorkspaceBuildParameter represents a parameter specific for a workspace build.

typeWorkspaceBuildTimingsadded inv2.17.0

type WorkspaceBuildTimings struct {ProvisionerTimings []ProvisionerTiming `json:"provisioner_timings"`// TODO: Consolidate agent-related timing metrics into a single struct when// updating the API versionAgentScriptTimings     []AgentScriptTiming     `json:"agent_script_timings"`AgentConnectionTimings []AgentConnectionTiming `json:"agent_connection_timings"`}

typeWorkspaceBuildsRequest

type WorkspaceBuildsRequest struct {WorkspaceIDuuid.UUID `json:"workspace_id" format:"uuid" typescript:"-"`PaginationSincetime.Time `json:"since,omitempty" format:"date-time"`}

typeWorkspaceConnectionLatencyMS

type WorkspaceConnectionLatencyMS struct {P50float64P95float64}

typeWorkspaceDeploymentStats

type WorkspaceDeploymentStats struct {Pendingint64 `json:"pending"`Buildingint64 `json:"building"`Runningint64 `json:"running"`Failedint64 `json:"failed"`Stoppedint64 `json:"stopped"`ConnectionLatencyMSWorkspaceConnectionLatencyMS `json:"connection_latency_ms"`RxBytesint64                        `json:"rx_bytes"`TxBytesint64                        `json:"tx_bytes"`}

typeWorkspaceFilter

type WorkspaceFilter struct {// Owner can be "me" or a usernameOwnerstring `json:"owner,omitempty" typescript:"-"`// Template is a template nameTemplatestring `json:"template,omitempty" typescript:"-"`// Name will return partial matchesNamestring `json:"name,omitempty" typescript:"-"`// Status is a workspace status, which is really the status of the latest buildStatusstring `json:"status,omitempty" typescript:"-"`// Offset is the number of workspaces to skip before returning results.Offsetint `json:"offset,omitempty" typescript:"-"`// Limit is a limit on the number of workspaces returned.Limitint `json:"limit,omitempty" typescript:"-"`// FilterQuery supports a raw filter query stringFilterQuerystring `json:"q,omitempty"`}

typeWorkspaceHealth

type WorkspaceHealth struct {Healthybool        `json:"healthy" example:"false"`// Healthy is true if the workspace is healthy.FailingAgents []uuid.UUID `json:"failing_agents" format:"uuid"`// FailingAgents lists the IDs of the agents that are failing, if any.}

typeWorkspaceOptions

type WorkspaceOptions struct {IncludeDeletedbool `json:"include_deleted,omitempty"`}

typeWorkspaceProxy

type WorkspaceProxy struct {// Extends Region with extra informationRegion      `table:"region,recursive_inline"`DerpEnabledbool `json:"derp_enabled" table:"derp enabled"`DerpOnlybool `json:"derp_only" table:"derp only"`// Status is the latest status check of the proxy. This will be empty for deleted// proxies. This value can be used to determine if a workspace proxy is healthy// and ready to use.StatusWorkspaceProxyStatus `json:"status,omitempty" table:"proxy,recursive"`CreatedAttime.Time `json:"created_at" format:"date-time" table:"created at"`UpdatedAttime.Time `json:"updated_at" format:"date-time" table:"updated at"`Deletedbool      `json:"deleted" table:"deleted"`Versionstring    `json:"version" table:"version"`}

typeWorkspaceProxyBuildInfo

type WorkspaceProxyBuildInfo struct {// TODO: @emyrk what should we include here?WorkspaceProxybool `json:"workspace_proxy"`// DashboardURL is the URL of the coderd this proxy is connected to.DashboardURLstring `json:"dashboard_url"`}

typeWorkspaceProxyStatus

type WorkspaceProxyStatus struct {StatusProxyHealthStatus `json:"status" table:"status,default_sort"`// Report provides more information about the health of the workspace proxy.ReportProxyHealthReport `json:"report,omitempty" table:"report"`CheckedAttime.Time         `json:"checked_at" table:"checked at" format:"date-time"`}

typeWorkspaceQuota

type WorkspaceQuota struct {CreditsConsumedint `json:"credits_consumed"`Budgetint `json:"budget"`}

typeWorkspaceResource

type WorkspaceResource struct {IDuuid.UUID                   `json:"id" format:"uuid"`CreatedAttime.Time                   `json:"created_at" format:"date-time"`JobIDuuid.UUID                   `json:"job_id" format:"uuid"`TransitionWorkspaceTransition         `json:"workspace_transition" enums:"start,stop,delete"`Typestring                      `json:"type"`Namestring                      `json:"name"`Hidebool                        `json:"hide"`Iconstring                      `json:"icon"`Agents     []WorkspaceAgent            `json:"agents,omitempty"`Metadata   []WorkspaceResourceMetadata `json:"metadata,omitempty"`DailyCostint32                       `json:"daily_cost"`}

WorkspaceResource describes resources used to create a workspace, for instance:containers, images, volumes.

typeWorkspaceResourceMetadata

type WorkspaceResourceMetadata struct {Keystring `json:"key"`Valuestring `json:"value"`Sensitivebool   `json:"sensitive"`}

WorkspaceResourceMetadata annotates the workspace resource with custom key-value pairs.

typeWorkspaceStatus

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

funcConvertWorkspaceStatusadded inv2.18.0

func ConvertWorkspaceStatus(jobStatusProvisionerJobStatus, transitionWorkspaceTransition)WorkspaceStatus

typeWorkspaceTransition

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

typeWorkspacesRequest

type WorkspacesRequest struct {SearchQuerystring `json:"q,omitempty"`Pagination}

typeWorkspacesResponse

type WorkspacesResponse struct {Workspaces []Workspace `json:"workspaces"`Countint         `json:"count"`}

Source Files

View all Source files

Directories

PathSynopsis

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