codersdk
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Code generated by typegen/main.go. DO NOT EDIT.
Index¶
- Constants
- Variables
- func BitmapToWeekdays(bitmap uint8) []string
- func DefaultCacheDir() string
- func DefaultDocsURL() string
- func DeploymentOptionsWithoutSecrets(set serpent.OptionSet) serpent.OptionSet
- func DiscoverVarsFiles(workDir string) ([]string, error)
- func DisplayNameValid(str string) error
- func ExpectJSONMime(res *http.Response) error
- func GroupNameValid(str string) error
- func IsConnectionError(err error) bool
- func IsSecretDeploymentOption(opt serpent.Option) bool
- func IsWorkspaceProxies(opt serpent.Option) bool
- func JobIsMissingParameterErrorCode(code JobErrorCode) bool
- func NameValid(str string) error
- func NormalizeRealUsername(str string) string
- func ParseSSHConfigOption(opt string) (key string, value string, err error)
- func ProvisionerTypeValid[T ProvisionerType | string](pt T) error
- func ReadBodyAsError(res *http.Response) error
- func ReservedProvisionerKeyNames() []string
- func ServerSentEventReader(ctx context.Context, rc io.ReadCloser) func() (*ServerSentEvent, error)
- func TemplateVersionNameValid(str string) error
- func TimezoneOffsetHour(loc *time.Location) int
- func TimezoneOffsetHourWithTime(now time.Time, loc *time.Location) int
- func UserRealNameValid(str string) error
- func UsernameFrom(str string) string
- func ValidateNewWorkspaceParameters(richParameters []TemplateVersionParameter, ...) error
- func ValidateWorkspaceBuildParameter(richParameter TemplateVersionParameter, ...) error
- func ValidateWorkspaceBuildParameters(richParameters []TemplateVersionParameter, ...) error
- func WebsocketNetConn(ctx context.Context, conn *websocket.Conn, msgType websocket.MessageType) (context.Context, net.Conn)
- func WeekdaysToBitmap(days []string) (uint8, error)
- func WorkspaceDisplayStatus(jobStatus ProvisionerJobStatus, transition WorkspaceTransition) string
- type ACLAvailable
- type AIConfig
- type AIProviderConfig
- type APIKey
- type APIKeyScope
- type APIKeyWithOwner
- type AddLicenseRequest
- type AgentConnectionTiming
- type AgentScriptTiming
- type AgentStatsReportRequest
- type AgentStatsReportResponse
- type AgentSubsystem
- type AppHostResponse
- type AppearanceConfig
- type ArchiveTemplateVersionsRequest
- type ArchiveTemplateVersionsResponse
- type AssignableRoles
- type AuditAction
- type AuditDiff
- type AuditDiffField
- type AuditLog
- type AuditLogResponse
- type AuditLogsRequest
- type AuthMethod
- type AuthMethods
- type AuthorizationCheck
- type AuthorizationObject
- type AuthorizationRequest
- type AuthorizationResponse
- type AutomaticUpdates
- type AvailableExperiments
- type BannerConfig
- type BuildInfoResponse
- type BuildReason
- type ChangePasswordWithOneTimePasscodeRequest
- type Chat
- type ChatMessage
- type Client
- func (c *Client) APIKeyByID(ctx context.Context, userID string, id string) (*APIKey, error)
- func (c *Client) APIKeyByName(ctx context.Context, userID string, name string) (*APIKey, error)
- func (c *Client) AddLicense(ctx context.Context, r AddLicenseRequest) (License, error)
- func (c *Client) AppHost(ctx context.Context) (AppHostResponse, error)
- func (c *Client) Appearance(ctx context.Context) (AppearanceConfig, error)
- func (c *Client) ArchiveTemplateVersions(ctx context.Context, template uuid.UUID, all bool) (ArchiveTemplateVersionsResponse, error)
- func (c *Client) AuditLogs(ctx context.Context, req AuditLogsRequest) (AuditLogResponse, error)
- func (c *Client) AuthCheck(ctx context.Context, req AuthorizationRequest) (AuthorizationResponse, error)
- func (c *Client) AuthMethods(ctx context.Context) (AuthMethods, error)
- func (c *Client) BuildInfo(ctx context.Context) (BuildInfoResponse, error)
- func (c *Client) CancelTemplateVersion(ctx context.Context, version uuid.UUID) error
- func (c *Client) CancelTemplateVersionDryRun(ctx context.Context, version, job uuid.UUID) error
- func (c *Client) CancelWorkspaceBuild(ctx context.Context, id uuid.UUID) error
- func (c *Client) ChangePasswordWithOneTimePasscode(ctx context.Context, req ChangePasswordWithOneTimePasscodeRequest) error
- func (c *Client) Chat(ctx context.Context, id uuid.UUID) (Chat, error)
- func (c *Client) ChatMessages(ctx context.Context, id uuid.UUID) ([]ChatMessage, error)
- func (c *Client) ConvertLoginType(ctx context.Context, req ConvertLoginRequest) (OAuthConversionResponse, error)
- func (c *Client) ConvertUserLoginType(ctx context.Context, user string, req ConvertLoginRequest) (OAuthConversionResponse, error)
- func (c *Client) CreateAPIKey(ctx context.Context, user string) (GenerateAPIKeyResponse, error)
- func (c *Client) CreateChat(ctx context.Context) (Chat, error)
- func (c *Client) CreateChatMessage(ctx context.Context, id uuid.UUID, req CreateChatMessageRequest) (<-chan aisdk.DataStreamPart, error)
- func (c *Client) CreateFirstUser(ctx context.Context, req CreateFirstUserRequest) (CreateFirstUserResponse, error)
- func (c *Client) CreateGroup(ctx context.Context, orgID uuid.UUID, req CreateGroupRequest) (Group, error)
- func (c *Client) CreateOrganization(ctx context.Context, req CreateOrganizationRequest) (Organization, error)
- func (c *Client) CreateOrganizationRole(ctx context.Context, role Role) (Role, error)
- func (c *Client) CreateProvisionerKey(ctx context.Context, organizationID uuid.UUID, req CreateProvisionerKeyRequest) (CreateProvisionerKeyResponse, error)
- func (c *Client) CreateTemplate(ctx context.Context, organizationID uuid.UUID, request CreateTemplateRequest) (Template, error)
- func (c *Client) CreateTemplateVersion(ctx context.Context, organizationID uuid.UUID, ...) (TemplateVersion, error)
- func (c *Client) CreateTemplateVersionDryRun(ctx context.Context, version uuid.UUID, req CreateTemplateVersionDryRunRequest) (ProvisionerJob, error)
- func (c *Client) CreateTestAuditLog(ctx context.Context, req CreateTestAuditLogRequest) error
- func (c *Client) CreateToken(ctx context.Context, userID string, req CreateTokenRequest) (GenerateAPIKeyResponse, error)
- func (c *Client) CreateUser(ctx context.Context, req CreateUserRequest) (User, error)
- func (c *Client) CreateUserWithOrgs(ctx context.Context, req CreateUserRequestWithOrgs) (User, error)
- func (c *Client) CreateUserWorkspace(ctx context.Context, user string, request CreateWorkspaceRequest) (Workspace, error)
- func (c *Client) CreateWorkspace(ctx context.Context, _ uuid.UUID, user string, request CreateWorkspaceRequest) (Workspace, error)deprecated
- func (c *Client) CreateWorkspaceBuild(ctx context.Context, workspace uuid.UUID, request CreateWorkspaceBuildRequest) (WorkspaceBuild, error)
- func (c *Client) CreateWorkspaceProxy(ctx context.Context, req CreateWorkspaceProxyRequest) (UpdateWorkspaceProxyResponse, error)
- func (c *Client) DeleteAPIKey(ctx context.Context, userID string, id string) error
- func (c *Client) DeleteChat(ctx context.Context, id uuid.UUID) error
- func (c *Client) DeleteGroup(ctx context.Context, group uuid.UUID) error
- func (c *Client) DeleteLicense(ctx context.Context, id int32) error
- func (c *Client) DeleteOAuth2ProviderApp(ctx context.Context, id uuid.UUID) error
- func (c *Client) DeleteOAuth2ProviderAppSecret(ctx context.Context, appID uuid.UUID, secretID uuid.UUID) error
- func (c *Client) DeleteOrganization(ctx context.Context, orgID string) error
- func (c *Client) DeleteOrganizationMember(ctx context.Context, organizationID uuid.UUID, user string) error
- func (c *Client) DeleteOrganizationRole(ctx context.Context, organizationID uuid.UUID, roleName string) error
- func (c *Client) DeleteProvisionerKey(ctx context.Context, organizationID uuid.UUID, name string) error
- func (c *Client) DeleteTemplate(ctx context.Context, template uuid.UUID) error
- func (c *Client) DeleteUser(ctx context.Context, id uuid.UUID) error
- func (c *Client) DeleteWebpushSubscription(ctx context.Context, user string, req DeleteWebpushSubscription) error
- func (c *Client) DeleteWorkspaceAgentPortShare(ctx context.Context, workspaceID uuid.UUID, ...) error
- func (c *Client) DeleteWorkspaceProxyByID(ctx context.Context, id uuid.UUID) error
- func (c *Client) DeleteWorkspaceProxyByName(ctx context.Context, name string) error
- func (c *Client) DeletedWorkspace(ctx context.Context, id uuid.UUID) (Workspace, error)
- func (c *Client) DeploymentConfig(ctx context.Context) (*DeploymentConfig, error)
- func (c *Client) DeploymentDAUs(ctx context.Context, tzOffset int) (*DAUsResponse, error)
- func (c *Client) DeploymentDAUsLocalTZ(ctx context.Context) (*DAUsResponse, error)
- func (c *Client) DeploymentStats(ctx context.Context) (DeploymentStats, error)
- func (c *Client) Dial(ctx context.Context, path string, opts *websocket.DialOptions) (*websocket.Conn, error)
- func (c *Client) Download(ctx context.Context, id uuid.UUID) ([]byte, string, error)
- func (c *Client) DownloadWithFormat(ctx context.Context, id uuid.UUID, format string) ([]byte, string, error)
- func (c *Client) Entitlements(ctx context.Context) (Entitlements, error)
- func (c *Client) Experiments(ctx context.Context) (Experiments, error)
- func (c *Client) ExternalAuthByID(ctx context.Context, provider string) (ExternalAuth, error)
- func (c *Client) ExternalAuthDeviceByID(ctx context.Context, provider string) (ExternalAuthDevice, error)
- func (c *Client) ExternalAuthDeviceExchange(ctx context.Context, provider string, req ExternalAuthDeviceExchange) error
- func (c *Client) FavoriteWorkspace(ctx context.Context, workspaceID uuid.UUID) error
- func (c *Client) GetAvailableIDPSyncFields(ctx context.Context) ([]string, error)
- func (c *Client) GetIDPSyncFieldValues(ctx context.Context, claimField string) ([]string, error)
- func (c *Client) GetNotificationDispatchMethods(ctx context.Context) (NotificationMethodsResponse, error)
- func (c *Client) GetNotificationsSettings(ctx context.Context) (NotificationsSettings, error)
- func (c *Client) GetOrganizationAvailableIDPSyncFields(ctx context.Context, orgID string) ([]string, error)
- func (c *Client) GetOrganizationIDPSyncFieldValues(ctx context.Context, orgID string, claimField string) ([]string, error)
- func (c *Client) GetProvisionerKey(ctx context.Context, pk string) (ProvisionerKey, error)
- func (c *Client) GetSystemNotificationTemplates(ctx context.Context) ([]NotificationTemplate, error)
- func (c *Client) GetTokenConfig(ctx context.Context, userID string) (TokenConfig, error)
- func (c *Client) GetUserAppearanceSettings(ctx context.Context, user string) (UserAppearanceSettings, error)
- func (c *Client) GetUserNotificationPreferences(ctx context.Context, userID uuid.UUID) ([]NotificationPreference, error)
- func (c *Client) GetUserStatusCounts(ctx context.Context, req GetUserStatusCountsRequest) (GetUserStatusCountsResponse, error)
- func (c *Client) GetWorkspaceAgentPortShares(ctx context.Context, workspaceID uuid.UUID) (WorkspaceAgentPortShares, error)
- func (c *Client) GitSSHKey(ctx context.Context, user string) (GitSSHKey, error)
- func (c *Client) Group(ctx context.Context, group uuid.UUID) (Group, error)
- func (c *Client) GroupByOrgAndName(ctx context.Context, orgID uuid.UUID, name string) (Group, error)
- func (c *Client) GroupIDPSyncSettings(ctx context.Context, orgID string) (GroupSyncSettings, error)
- func (c *Client) Groups(ctx context.Context, args GroupArguments) ([]Group, error)
- func (c *Client) GroupsByOrganization(ctx context.Context, orgID uuid.UUID) ([]Group, error)
- func (c *Client) HasFirstUser(ctx context.Context) (bool, error)
- func (c *Client) IssueReconnectingPTYSignedToken(ctx context.Context, req IssueReconnectingPTYSignedTokenRequest) (IssueReconnectingPTYSignedTokenResponse, error)
- func (c *Client) LanguageModelConfig(ctx context.Context) (LanguageModelConfig, error)
- func (c *Client) Licenses(ctx context.Context) ([]License, error)
- func (c *Client) ListChats(ctx context.Context) ([]Chat, error)
- func (c *Client) ListExternalAuths(ctx context.Context) (ListUserExternalAuthResponse, error)
- func (c *Client) ListInboxNotifications(ctx context.Context, req ListInboxNotificationsRequest) (ListInboxNotificationsResponse, error)
- func (c *Client) ListOrganizationRoles(ctx context.Context, org uuid.UUID) ([]AssignableRoles, error)
- func (c *Client) ListProvisionerKeyDaemons(ctx context.Context, organizationID uuid.UUID) ([]ProvisionerKeyDaemons, error)
- func (c *Client) ListProvisionerKeys(ctx context.Context, organizationID uuid.UUID) ([]ProvisionerKey, error)
- func (c *Client) ListSiteRoles(ctx context.Context) ([]AssignableRoles, error)
- func (c *Client) LogBodies() bool
- func (c *Client) Logger() slog.Logger
- func (c *Client) LoginWithPassword(ctx context.Context, req LoginWithPasswordRequest) (LoginWithPasswordResponse, error)
- func (c *Client) Logout(ctx context.Context) error
- func (c *Client) MarkAllInboxNotificationsAsRead(ctx context.Context) error
- func (c *Client) OAuth2ProviderApp(ctx context.Context, id uuid.UUID) (OAuth2ProviderApp, error)
- func (c *Client) OAuth2ProviderAppSecrets(ctx context.Context, appID uuid.UUID) ([]OAuth2ProviderAppSecret, error)
- func (c *Client) OAuth2ProviderApps(ctx context.Context, filter OAuth2ProviderAppFilter) ([]OAuth2ProviderApp, error)
- func (c *Client) Organization(ctx context.Context, id uuid.UUID) (Organization, error)
- func (c *Client) OrganizationByName(ctx context.Context, name string) (Organization, error)
- func (c *Client) OrganizationByUserAndName(ctx context.Context, user string, name string) (Organization, error)
- func (c *Client) OrganizationIDPSyncSettings(ctx context.Context) (OrganizationSyncSettings, error)
- func (c *Client) OrganizationMembers(ctx context.Context, organizationID uuid.UUID) ([]OrganizationMemberWithUserData, error)
- func (c *Client) OrganizationProvisionerDaemons(ctx context.Context, organizationID uuid.UUID, ...) ([]ProvisionerDaemon, error)
- func (c *Client) OrganizationProvisionerJob(ctx context.Context, organizationID, jobID uuid.UUID) (job ProvisionerJob, err error)
- func (c *Client) OrganizationProvisionerJobs(ctx context.Context, organizationID uuid.UUID, ...) ([]ProvisionerJob, error)
- func (c *Client) Organizations(ctx context.Context) ([]Organization, error)
- func (c *Client) OrganizationsByUser(ctx context.Context, user string) ([]Organization, error)
- func (c *Client) PatchGroup(ctx context.Context, group uuid.UUID, req PatchGroupRequest) (Group, error)
- func (c *Client) PatchGroupIDPSyncConfig(ctx context.Context, orgID string, req PatchGroupIDPSyncConfigRequest) (GroupSyncSettings, error)
- func (c *Client) PatchGroupIDPSyncMapping(ctx context.Context, orgID string, req PatchGroupIDPSyncMappingRequest) (GroupSyncSettings, error)
- func (c *Client) PatchGroupIDPSyncSettings(ctx context.Context, orgID string, req GroupSyncSettings) (GroupSyncSettings, error)
- func (c *Client) PatchOrganizationIDPSyncConfig(ctx context.Context, req PatchOrganizationIDPSyncConfigRequest) (OrganizationSyncSettings, error)
- func (c *Client) PatchOrganizationIDPSyncMapping(ctx context.Context, req PatchOrganizationIDPSyncMappingRequest) (OrganizationSyncSettings, error)
- func (c *Client) PatchOrganizationIDPSyncSettings(ctx context.Context, req OrganizationSyncSettings) (OrganizationSyncSettings, error)
- func (c *Client) PatchRoleIDPSyncConfig(ctx context.Context, orgID string, req PatchRoleIDPSyncConfigRequest) (RoleSyncSettings, error)
- func (c *Client) PatchRoleIDPSyncMapping(ctx context.Context, orgID string, req PatchRoleIDPSyncMappingRequest) (RoleSyncSettings, error)
- func (c *Client) PatchRoleIDPSyncSettings(ctx context.Context, orgID string, req RoleSyncSettings) (RoleSyncSettings, error)
- func (c *Client) PatchWorkspaceProxy(ctx context.Context, req PatchWorkspaceProxy) (UpdateWorkspaceProxyResponse, error)
- func (c *Client) PostOAuth2ProviderApp(ctx context.Context, app PostOAuth2ProviderAppRequest) (OAuth2ProviderApp, error)
- func (c *Client) PostOAuth2ProviderAppSecret(ctx context.Context, appID uuid.UUID) (OAuth2ProviderAppSecretFull, error)
- func (c *Client) PostOrganizationMember(ctx context.Context, organizationID uuid.UUID, user string) (OrganizationMember, error)
- func (c *Client) PostTestNotification(ctx context.Context) error
- func (c *Client) PostTestWebpushMessage(ctx context.Context) error
- func (c *Client) PostWebpushSubscription(ctx context.Context, user string, req WebpushSubscription) error
- func (c *Client) PostWorkspaceUsage(ctx context.Context, id uuid.UUID) error
- func (c *Client) PostWorkspaceUsageWithBody(ctx context.Context, id uuid.UUID, req PostWorkspaceUsageRequest) error
- func (c *Client) PreviousTemplateVersion(ctx context.Context, organization uuid.UUID, templateName, versionName string) (TemplateVersion, error)
- func (c *Client) ProvisionerDaemons(ctx context.Context) ([]ProvisionerDaemon, error)
- func (c *Client) PutExtendWorkspace(ctx context.Context, id uuid.UUID, req PutExtendWorkspaceRequest) error
- func (c *Client) PutNotificationsSettings(ctx context.Context, settings NotificationsSettings) error
- func (c *Client) PutOAuth2ProviderApp(ctx context.Context, id uuid.UUID, app PutOAuth2ProviderAppRequest) (OAuth2ProviderApp, error)
- func (c *Client) RegenerateGitSSHKey(ctx context.Context, user string) (GitSSHKey, error)
- func (c *Client) Regions(ctx context.Context) ([]Region, error)
- func (c *Client) Replicas(ctx context.Context) ([]Replica, error)
- func (c *Client) Request(ctx context.Context, method, path string, body interface{}, ...) (*http.Response, error)
- func (c *Client) RequestOneTimePasscode(ctx context.Context, req RequestOneTimePasscodeRequest) error
- func (c *Client) ResolveAutostart(ctx context.Context, workspaceID string) (ResolveAutostartResponse, error)
- func (c *Client) RevokeOAuth2ProviderApp(ctx context.Context, appID uuid.UUID) error
- func (c *Client) RoleIDPSyncSettings(ctx context.Context, orgID string) (RoleSyncSettings, error)
- func (c *Client) SSHConfiguration(ctx context.Context) (SSHConfigResponse, error)
- func (c *Client) SafeExperiments(ctx context.Context) (AvailableExperiments, error)
- func (c *Client) ServeProvisionerDaemon(ctx context.Context, req ServeProvisionerDaemonRequest) (proto.DRPCProvisionerDaemonClient, error)
- func (c *Client) SessionToken() string
- func (c *Client) SetArchiveTemplateVersion(ctx context.Context, templateVersion uuid.UUID, archive bool) error
- func (c *Client) SetLogBodies(logBodies bool)
- func (c *Client) SetLogger(logger slog.Logger)
- func (c *Client) SetSessionToken(token string)
- func (c *Client) StarterTemplates(ctx context.Context) ([]TemplateExample, error)
- func (c *Client) Template(ctx context.Context, template uuid.UUID) (Template, error)
- func (c *Client) TemplateACL(ctx context.Context, templateID uuid.UUID) (TemplateACL, error)
- func (c *Client) TemplateACLAvailable(ctx context.Context, templateID uuid.UUID) (ACLAvailable, error)
- func (c *Client) TemplateByName(ctx context.Context, organizationID uuid.UUID, name string) (Template, error)
- func (c *Client) TemplateDAUs(ctx context.Context, templateID uuid.UUID, tzOffset int) (*DAUsResponse, error)
- func (c *Client) TemplateDAUsLocalTZ(ctx context.Context, templateID uuid.UUID) (*DAUsResponse, error)
- func (c *Client) TemplateExamples(ctx context.Context, _ uuid.UUID) ([]TemplateExample, error)deprecated
- func (c *Client) TemplateInsights(ctx context.Context, req TemplateInsightsRequest) (TemplateInsightsResponse, error)
- func (c *Client) TemplateVersion(ctx context.Context, id uuid.UUID) (TemplateVersion, error)
- func (c *Client) TemplateVersionByName(ctx context.Context, template uuid.UUID, name string) (TemplateVersion, error)
- func (c *Client) TemplateVersionByOrganizationAndName(ctx context.Context, organizationID uuid.UUID, ...) (TemplateVersion, error)
- func (c *Client) TemplateVersionDryRun(ctx context.Context, version, job uuid.UUID) (ProvisionerJob, error)
- func (c *Client) TemplateVersionDryRunLogsAfter(ctx context.Context, version, job uuid.UUID, after int64) (<-chan ProvisionerJobLog, io.Closer, error)
- func (c *Client) TemplateVersionDryRunMatchedProvisioners(ctx context.Context, version, job uuid.UUID) (MatchedProvisioners, error)
- func (c *Client) TemplateVersionDryRunResources(ctx context.Context, version, job uuid.UUID) ([]WorkspaceResource, error)
- func (c *Client) TemplateVersionDynamicParameters(ctx context.Context, version uuid.UUID) (*wsjson.Stream[DynamicParametersResponse, DynamicParametersRequest], error)
- func (c *Client) TemplateVersionExternalAuth(ctx context.Context, version uuid.UUID) ([]TemplateVersionExternalAuth, error)
- func (c *Client) TemplateVersionLogsAfter(ctx context.Context, version uuid.UUID, after int64) (<-chan ProvisionerJobLog, io.Closer, error)
- func (c *Client) TemplateVersionPresets(ctx context.Context, templateVersionID uuid.UUID) ([]Preset, error)
- func (c *Client) TemplateVersionResources(ctx context.Context, version uuid.UUID) ([]WorkspaceResource, error)
- func (c *Client) TemplateVersionRichParameters(ctx context.Context, version uuid.UUID) ([]TemplateVersionParameter, error)
- func (c *Client) TemplateVersionVariables(ctx context.Context, version uuid.UUID) ([]TemplateVersionVariable, error)
- func (c *Client) TemplateVersionsByTemplate(ctx context.Context, req TemplateVersionsByTemplateRequest) ([]TemplateVersion, error)
- func (c *Client) Templates(ctx context.Context, filter TemplateFilter) ([]Template, error)
- func (c *Client) TemplatesByOrganization(ctx context.Context, organizationID uuid.UUID) ([]Template, error)
- func (c *Client) Tokens(ctx context.Context, userID string, filter TokensFilter) ([]APIKeyWithOwner, error)
- func (c *Client) UnfavoriteWorkspace(ctx context.Context, workspaceID uuid.UUID) error
- func (c *Client) UnlinkExternalAuthByID(ctx context.Context, provider string) error
- func (c *Client) UpdateActiveTemplateVersion(ctx context.Context, template uuid.UUID, req UpdateActiveTemplateVersion) error
- func (c *Client) UpdateAppearance(ctx context.Context, appearance UpdateAppearanceConfig) error
- func (c *Client) UpdateCheck(ctx context.Context) (UpdateCheckResponse, error)
- func (c *Client) UpdateInboxNotificationReadStatus(ctx context.Context, notifID string, ...) (UpdateInboxNotificationReadStatusResponse, error)
- func (c *Client) UpdateNotificationTemplateMethod(ctx context.Context, notificationTemplateID uuid.UUID, method string) error
- func (c *Client) UpdateOrganization(ctx context.Context, orgID string, req UpdateOrganizationRequest) (Organization, error)
- func (c *Client) UpdateOrganizationMemberRoles(ctx context.Context, organizationID uuid.UUID, user string, req UpdateRoles) (OrganizationMember, error)
- func (c *Client) UpdateOrganizationRole(ctx context.Context, role Role) (Role, error)
- func (c *Client) UpdateTemplateACL(ctx context.Context, templateID uuid.UUID, req UpdateTemplateACL) error
- func (c *Client) UpdateTemplateMeta(ctx context.Context, templateID uuid.UUID, req UpdateTemplateMeta) (Template, error)
- func (c *Client) UpdateTemplateVersion(ctx context.Context, versionID uuid.UUID, req PatchTemplateVersionRequest) (TemplateVersion, error)
- func (c *Client) UpdateUserAppearanceSettings(ctx context.Context, user string, req UpdateUserAppearanceSettingsRequest) (UserAppearanceSettings, error)
- func (c *Client) UpdateUserNotificationPreferences(ctx context.Context, userID uuid.UUID, req UpdateUserNotificationPreferences) ([]NotificationPreference, error)
- func (c *Client) UpdateUserPassword(ctx context.Context, user string, req UpdateUserPasswordRequest) error
- func (c *Client) UpdateUserProfile(ctx context.Context, user string, req UpdateUserProfileRequest) (User, error)
- func (c *Client) UpdateUserQuietHoursSchedule(ctx context.Context, userIdent string, req UpdateUserQuietHoursScheduleRequest) (UserQuietHoursScheduleResponse, error)
- func (c *Client) UpdateUserRoles(ctx context.Context, user string, req UpdateRoles) (User, error)
- func (c *Client) UpdateUserStatus(ctx context.Context, user string, status UserStatus) (User, error)
- func (c *Client) UpdateWorkspace(ctx context.Context, id uuid.UUID, req UpdateWorkspaceRequest) error
- func (c *Client) UpdateWorkspaceAutomaticUpdates(ctx context.Context, id uuid.UUID, req UpdateWorkspaceAutomaticUpdatesRequest) error
- func (c *Client) UpdateWorkspaceAutostart(ctx context.Context, id uuid.UUID, req UpdateWorkspaceAutostartRequest) error
- func (c *Client) UpdateWorkspaceDormancy(ctx context.Context, id uuid.UUID, req UpdateWorkspaceDormancy) error
- func (c *Client) UpdateWorkspaceTTL(ctx context.Context, id uuid.UUID, req UpdateWorkspaceTTLRequest) error
- func (c *Client) UpdateWorkspaceUsageContext(ctx context.Context, workspaceID uuid.UUID) func()
- func (c *Client) UpdateWorkspaceUsageWithBodyContext(ctx context.Context, workspaceID uuid.UUID, req PostWorkspaceUsageRequest) func()
- func (c *Client) Upload(ctx context.Context, contentType string, rd io.Reader) (UploadResponse, error)
- func (c *Client) UpsertWorkspaceAgentPortShare(ctx context.Context, workspaceID uuid.UUID, ...) (WorkspaceAgentPortShare, error)
- func (c *Client) User(ctx context.Context, userIdent string) (User, error)
- func (c *Client) UserActivityInsights(ctx context.Context, req UserActivityInsightsRequest) (UserActivityInsightsResponse, error)
- func (c *Client) UserAutofillParameters(ctx context.Context, user string, templateID uuid.UUID) ([]UserParameter, error)
- func (c *Client) UserLatencyInsights(ctx context.Context, req UserLatencyInsightsRequest) (UserLatencyInsightsResponse, error)
- func (c *Client) UserQuietHoursSchedule(ctx context.Context, userIdent string) (UserQuietHoursScheduleResponse, error)
- func (c *Client) UserRoles(ctx context.Context, user string) (UserRoles, error)
- func (c *Client) Users(ctx context.Context, req UsersRequest) (GetUsersResponse, error)
- func (c *Client) ValidateUserPassword(ctx context.Context, req ValidateUserPasswordRequest) (ValidateUserPasswordResponse, error)
- func (c *Client) WatchWorkspace(ctx context.Context, id uuid.UUID) (<-chan Workspace, error)
- func (c *Client) WatchWorkspaceAgentMetadata(ctx context.Context, id uuid.UUID) (<-chan []WorkspaceAgentMetadata, <-chan error)
- func (c *Client) Workspace(ctx context.Context, id uuid.UUID) (Workspace, error)
- func (c *Client) WorkspaceAgent(ctx context.Context, id uuid.UUID) (WorkspaceAgent, error)
- func (c *Client) WorkspaceAgentListContainers(ctx context.Context, agentID uuid.UUID, labels map[string]string) (WorkspaceAgentListContainersResponse, error)
- func (c *Client) WorkspaceAgentListeningPorts(ctx context.Context, agentID uuid.UUID) (WorkspaceAgentListeningPortsResponse, error)
- func (c *Client) WorkspaceAgentLogsAfter(ctx context.Context, agentID uuid.UUID, after int64, follow bool) (<-chan []WorkspaceAgentLog, io.Closer, error)
- func (c *Client) WorkspaceAgentRecreateDevcontainer(ctx context.Context, agentID uuid.UUID, containerIDOrName string) (Response, error)
- func (c *Client) WorkspaceBuild(ctx context.Context, id uuid.UUID) (WorkspaceBuild, error)
- func (c *Client) WorkspaceBuildByUsernameAndWorkspaceNameAndBuildNumber(ctx context.Context, username string, workspaceName string, buildNumber string) (WorkspaceBuild, error)
- func (c *Client) WorkspaceBuildLogsAfter(ctx context.Context, build uuid.UUID, after int64) (<-chan ProvisionerJobLog, io.Closer, error)
- func (c *Client) WorkspaceBuildParameters(ctx context.Context, build uuid.UUID) ([]WorkspaceBuildParameter, error)
- func (c *Client) WorkspaceBuildState(ctx context.Context, build uuid.UUID) ([]byte, error)
- func (c *Client) WorkspaceBuildTimings(ctx context.Context, build uuid.UUID) (WorkspaceBuildTimings, error)
- func (c *Client) WorkspaceBuilds(ctx context.Context, req WorkspaceBuildsRequest) ([]WorkspaceBuild, error)
- func (c *Client) WorkspaceByOwnerAndName(ctx context.Context, owner string, name string, params WorkspaceOptions) (Workspace, error)
- func (c *Client) WorkspaceProxies(ctx context.Context) (RegionsResponse[WorkspaceProxy], error)
- func (c *Client) WorkspaceProxyByID(ctx context.Context, id uuid.UUID) (WorkspaceProxy, error)
- func (c *Client) WorkspaceProxyByName(ctx context.Context, name string) (WorkspaceProxy, error)
- func (c *Client) WorkspaceQuota(ctx context.Context, organizationID string, userID string) (WorkspaceQuota, error)
- func (c *Client) WorkspaceTimings(ctx context.Context, id uuid.UUID) (WorkspaceBuildTimings, error)
- func (c *Client) Workspaces(ctx context.Context, filter WorkspaceFilter) (WorkspacesResponse, error)
- type CoderDesktopTelemetry
- type ConnectionLatency
- type ConvertLoginRequest
- type Country
- type CreateChatMessageRequest
- type CreateFirstUserRequest
- type CreateFirstUserResponse
- type CreateFirstUserTrialInfo
- type CreateGroupRequest
- type CreateOrganizationRequest
- type CreateProvisionerKeyRequest
- type CreateProvisionerKeyResponse
- type CreateTemplateRequest
- type CreateTemplateVersionDryRunRequest
- type CreateTemplateVersionRequest
- type CreateTestAuditLogRequest
- type CreateTokenRequest
- type CreateUserRequest
- type CreateUserRequestWithOrgs
- type CreateWorkspaceBuildRequest
- type CreateWorkspaceProxyRequest
- type CreateWorkspaceRequest
- type CryptoKey
- type CryptoKeyFeature
- type CustomRoleRequest
- type DAUEntry
- type DAURequest
- type DAUsResponse
- type DERP
- type DERPConfig
- type DERPRegion
- type DERPServerConfig
- type DangerousConfig
- type DeleteWebpushSubscription
- type DeleteWorkspaceAgentPortShareRequest
- type DeploymentConfig
- type DeploymentStats
- type DeploymentValues
- type DiagnosticExtra
- type DiagnosticSeverityString
- type DisplayApp
- type DynamicParametersRequest
- type DynamicParametersResponse
- type EnhancedExternalAuthProvider
- type Entitlement
- type Entitlements
- type Error
- type Experiment
- type Experiments
- type ExternalAuth
- type ExternalAuthAppInstallation
- type ExternalAuthConfig
- type ExternalAuthDevice
- type ExternalAuthDeviceExchange
- type ExternalAuthLink
- type ExternalAuthLinkProvider
- type ExternalAuthUser
- type Feature
- type FeatureName
- type FeatureSet
- type FriendlyDiagnostic
- type GenerateAPIKeyResponse
- type GetInboxNotificationResponse
- type GetUserStatusCountsRequest
- type GetUserStatusCountsResponse
- type GetUsersResponse
- type GitSSHKey
- type GithubAuthMethod
- type Group
- type GroupArguments
- type GroupSource
- type GroupSyncSettings
- type HTTPCookieConfig
- type HeaderTransport
- type Healthcheck
- type HealthcheckConfig
- type IDPSyncMapping
- type InboxNotification
- type InboxNotificationAction
- type InsightsReportInterval
- type IssueReconnectingPTYSignedTokenRequest
- type IssueReconnectingPTYSignedTokenResponse
- type JobErrorCode
- type LanguageModel
- type LanguageModelConfig
- type License
- type LicensorTrialRequest
- type LinkConfig
- type ListInboxNotificationsRequest
- type ListInboxNotificationsResponse
- type ListUserExternalAuthResponse
- type LogLevel
- type LogSource
- type LoggingConfig
- type LoginType
- type LoginWithPasswordRequest
- type LoginWithPasswordResponse
- type MatchedProvisioners
- type MinimalOrganization
- type MinimalUser
- type NotificationMethodsResponse
- type NotificationPreference
- type NotificationTemplate
- type NotificationsConfig
- type NotificationsEmailAuthConfig
- type NotificationsEmailConfig
- type NotificationsEmailTLSConfig
- type NotificationsInboxConfig
- type NotificationsSettings
- type NotificationsWebhookConfig
- type NullHCLString
- type NullTime
- type OAuth2AppEndpoints
- type OAuth2Config
- type OAuth2DeviceFlowCallbackResponse
- type OAuth2GithubConfig
- type OAuth2ProviderApp
- type OAuth2ProviderAppFilter
- type OAuth2ProviderAppSecret
- type OAuth2ProviderAppSecretFull
- type OAuth2ProviderGrantType
- type OAuth2ProviderResponseType
- type OAuthConversionResponse
- type OIDCAuthMethod
- type OIDCConfig
- type OptionType
- type Organization
- type OrganizationMember
- type OrganizationMemberWithUserData
- type OrganizationProvisionerDaemonsOptions
- type OrganizationProvisionerJobsOptions
- type OrganizationSyncSettings
- type PaginatedMembersRequest
- type PaginatedMembersResponse
- type Pagination
- type ParameterFormType
- type ParameterResolver
- type PatchGroupIDPSyncConfigRequest
- type PatchGroupIDPSyncMappingRequest
- type PatchGroupRequest
- type PatchOrganizationIDPSyncConfigRequest
- type PatchOrganizationIDPSyncMappingRequest
- type PatchRoleIDPSyncConfigRequest
- type PatchRoleIDPSyncMappingRequest
- type PatchTemplateVersionRequest
- type PatchWorkspaceProxy
- type Permission
- type PostOAuth2ProviderAppRequest
- type PostWorkspaceUsageRequest
- type PostgresAuth
- type PprofConfig
- type PrebuildsConfig
- type Preset
- type PresetParameter
- type PreviewParameter
- type PreviewParameterData
- type PreviewParameterOption
- type PreviewParameterStyling
- type PreviewParameterValidation
- type PrometheusConfig
- type ProvisionerConfig
- type ProvisionerDaemon
- type ProvisionerDaemonJob
- type ProvisionerDaemonStatus
- type ProvisionerJob
- type ProvisionerJobInput
- type ProvisionerJobLog
- type ProvisionerJobMetadata
- type ProvisionerJobStatus
- type ProvisionerJobType
- type ProvisionerKey
- type ProvisionerKeyDaemons
- type ProvisionerKeyTags
- type ProvisionerLogLevel
- type ProvisionerStorageMethod
- type ProvisionerTiming
- type ProvisionerType
- type ProxyHealthReport
- type ProxyHealthStatus
- type PutExtendWorkspaceRequest
- type PutOAuth2ProviderAppRequest
- type RBACAction
- type RBACResource
- type RateLimitConfig
- type ReducedUser
- type Region
- type RegionTypes
- type RegionsResponse
- type Replica
- type RequestOneTimePasscodeRequest
- type RequestOption
- type ResolveAutostartResponse
- type ResourceType
- type Response
- type Role
- type RoleSyncSettings
- type SSHConfig
- type SSHConfigResponse
- type ServeProvisionerDaemonRequest
- type ServerSentEvent
- type ServerSentEventType
- type ServiceBannerConfigdeprecated
- type SessionCountDeploymentStats
- type SessionLifetime
- type SlimRole
- type SupportConfig
- type SwaggerConfig
- type TLSConfig
- type TelemetryConfig
- type Template
- type TemplateACL
- type TemplateAppUsage
- type TemplateAppsType
- type TemplateAutostartRequirement
- type TemplateAutostopRequirement
- type TemplateBuildTimeStats
- type TemplateExample
- type TemplateFilter
- type TemplateGroup
- type TemplateInsightsIntervalReport
- type TemplateInsightsReport
- type TemplateInsightsRequest
- type TemplateInsightsResponse
- type TemplateInsightsSection
- type TemplateParameterUsage
- type TemplateParameterValue
- type TemplateRole
- type TemplateUser
- type TemplateVersion
- type TemplateVersionExternalAuth
- type TemplateVersionParameter
- type TemplateVersionParameterOption
- type TemplateVersionVariable
- type TemplateVersionWarning
- type TemplateVersionsByTemplateRequest
- type TerminalFontName
- type TimingStage
- type TokenConfig
- type TokensFilter
- type TraceConfig
- type TransitionStats
- type UpdateActiveTemplateVersion
- type UpdateAppearanceConfig
- type UpdateCheckResponse
- type UpdateInboxNotificationReadStatusRequest
- type UpdateInboxNotificationReadStatusResponse
- type UpdateNotificationTemplateMethod
- type UpdateOrganizationRequest
- type UpdateRoles
- type UpdateTemplateACL
- type UpdateTemplateMeta
- type UpdateUserAppearanceSettingsRequest
- type UpdateUserNotificationPreferences
- type UpdateUserPasswordRequest
- type UpdateUserProfileRequest
- type UpdateUserQuietHoursScheduleRequest
- type UpdateWorkspaceAutomaticUpdatesRequest
- type UpdateWorkspaceAutostartRequest
- type UpdateWorkspaceDormancy
- type UpdateWorkspaceProxyResponse
- type UpdateWorkspaceRequest
- type UpdateWorkspaceTTLRequest
- type UploadResponse
- type UpsertWorkspaceAgentPortShareRequest
- type UsageAppName
- type User
- type UserActivity
- type UserActivityInsightsReport
- type UserActivityInsightsRequest
- type UserActivityInsightsResponse
- type UserAppearanceSettings
- type UserLatency
- type UserLatencyInsightsReport
- type UserLatencyInsightsRequest
- type UserLatencyInsightsResponse
- type UserLoginType
- type UserParameter
- type UserQuietHoursScheduleConfig
- type UserQuietHoursScheduleResponse
- type UserRoles
- type UserStatus
- type UserStatusChangeCount
- type UsersRequest
- type ValidateUserPasswordRequest
- type ValidateUserPasswordResponse
- type ValidationError
- type ValidationMonotonicOrder
- type VariableValue
- type WebpushMessage
- type WebpushMessageAction
- type WebpushSubscription
- type Workspace
- type WorkspaceAgent
- type WorkspaceAgentContainer
- type WorkspaceAgentContainerPort
- type WorkspaceAgentDevcontainer
- type WorkspaceAgentDevcontainerStatus
- type WorkspaceAgentDevcontainersResponse
- type WorkspaceAgentHealth
- type WorkspaceAgentLifecycle
- type WorkspaceAgentListContainersResponse
- type WorkspaceAgentListeningPort
- type WorkspaceAgentListeningPortsResponse
- type WorkspaceAgentLog
- type WorkspaceAgentLogSource
- type WorkspaceAgentMetadata
- type WorkspaceAgentMetadataDescription
- type WorkspaceAgentMetadataResult
- type WorkspaceAgentPortShare
- type WorkspaceAgentPortShareLevel
- type WorkspaceAgentPortShareProtocol
- type WorkspaceAgentPortShares
- type WorkspaceAgentScript
- type WorkspaceAgentStartupScriptBehavior
- type WorkspaceAgentStatus
- type WorkspaceApp
- type WorkspaceAppHealth
- type WorkspaceAppOpenIn
- type WorkspaceAppSharingLevel
- type WorkspaceAppStatus
- type WorkspaceAppStatusState
- type WorkspaceBuild
- type WorkspaceBuildParameter
- type WorkspaceBuildTimings
- type WorkspaceBuildsRequest
- type WorkspaceConnectionLatencyMS
- type WorkspaceDeploymentStats
- type WorkspaceFilter
- type WorkspaceHealth
- type WorkspaceOptions
- type WorkspaceProxy
- type WorkspaceProxyBuildInfo
- type WorkspaceProxyStatus
- type WorkspaceQuota
- type WorkspaceResource
- type WorkspaceResourceMetadata
- type WorkspaceStatus
- type WorkspaceTransition
- type WorkspacesRequest
- type WorkspacesResponse
Constants¶
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!
const (ContentTypeTar = "application/x-tar"ContentTypeZip = "application/zip"FormatZip = "zip")
const (InboxNotificationFallbackIconWorkspace = "DEFAULT_ICON_WORKSPACE"InboxNotificationFallbackIconAccount = "DEFAULT_ICON_ACCOUNT"InboxNotificationFallbackIconTemplate = "DEFAULT_ICON_TEMPLATE"InboxNotificationFallbackIconOther = "DEFAULT_ICON_OTHER")
const (TemplateBuiltinAppDisplayNameVSCodestring = "Visual Studio Code"TemplateBuiltinAppDisplayNameJetBrainsstring = "JetBrains"TemplateBuiltinAppDisplayNameWebTerminalstring = "Web Terminal"TemplateBuiltinAppDisplayNameSSHstring = "SSH"TemplateBuiltinAppDisplayNameSFTPstring = "SFTP")
Enums define the display name of the builtin app reported.
const (LicenseExpiryClaim = "license_expires"LicenseTelemetryRequiredErrorText = "License requires telemetry but telemetry is disabled")
const (LogSourceProvisionerDaemonLogSource = "provisioner_daemon"LogSourceProvisionerLogSource = "provisioner"LogLevelTraceLogLevel = "trace"LogLevelDebugLogLevel = "debug"LogLevelInfoLogLevel = "info"LogLevelWarnLogLevel = "warn"LogLevelErrorLogLevel = "error")
const (ProvisionerKeyIDBuiltIn = "00000000-0000-0000-0000-000000000001"ProvisionerKeyIDUserAuth = "00000000-0000-0000-0000-000000000002"ProvisionerKeyIDPSK = "00000000-0000-0000-0000-000000000003")
const (ProvisionerKeyNameBuiltIn = "built-in"ProvisionerKeyNameUserAuth = "user-auth"ProvisionerKeyNamePSK = "psk")
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.
const (WorkspaceAgentPortShareLevelOwnerWorkspaceAgentPortShareLevel = "owner"WorkspaceAgentPortShareLevelAuthenticatedWorkspaceAgentPortShareLevel = "authenticated"WorkspaceAgentPortShareLevelPublicWorkspaceAgentPortShareLevel = "public"WorkspaceAgentPortShareProtocolHTTPWorkspaceAgentPortShareProtocol = "http"WorkspaceAgentPortShareProtocolHTTPSWorkspaceAgentPortShareProtocol = "https")
const DatabaseNotReachable = "database not reachable"
Variables¶
var (ProvisionerKeyUUIDBuiltIn =uuid.MustParse(ProvisionerKeyIDBuiltIn)ProvisionerKeyUUIDUserAuth =uuid.MustParse(ProvisionerKeyIDUserAuth)ProvisionerKeyUUIDPSK =uuid.MustParse(ProvisionerKeyIDPSK))
var AllDaysOfWeek = []string{"monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"}
var AllowedAppNames = []UsageAppName{UsageAppNameVscode,UsageAppNameJetbrains,UsageAppNameReconnectingPty,UsageAppNameSSH,}
var Countries = []Country{}/* 249 elements not displayed */
var DefaultOrganization = "default"
DefaultOrganization is used as a replacement for the default organization.
var ErrDatabaseNotReachable =xerrors.New(DatabaseNotReachable)
var ExperimentsSafe =Experiments{ExperimentWorkspacePrebuilds,}
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.
var FeatureNames = []FeatureName{FeatureUserLimit,FeatureAuditLog,FeatureBrowserOnly,FeatureSCIM,FeatureTemplateRBAC,FeatureHighAvailability,FeatureMultipleExternalAuth,FeatureExternalProvisionerDaemons,FeatureAppearance,FeatureAdvancedTemplateScheduling,FeatureWorkspaceProxy,FeatureUserRoleManagement,FeatureExternalTokenEncryption,FeatureWorkspaceBatchActions,FeatureAccessControl,FeatureControlSharedPorts,FeatureCustomRoles,FeatureMultipleOrganizations,FeatureWorkspacePrebuilds,}
FeatureNames must be kept in-sync with the Feature enum above.
var MapWorkspaceAppHealths = map[WorkspaceAppHealth]struct{}{WorkspaceAppHealthDisabled: {},WorkspaceAppHealthInitializing: {},WorkspaceAppHealthHealthy: {},WorkspaceAppHealthUnhealthy: {},}
var MapWorkspaceAppOpenIns = map[WorkspaceAppOpenIn]struct{}{WorkspaceAppOpenInSlimWindow: {},WorkspaceAppOpenInTab: {},}
var MapWorkspaceAppSharingLevels = map[WorkspaceAppSharingLevel]struct{}{WorkspaceAppSharingLevelOwner: {},WorkspaceAppSharingLevelAuthenticated: {},WorkspaceAppSharingLevelPublic: {},}
var Me = "me"
Me is used as a replacement for your own ID.
var PostgresAuthDrivers = []string{string(PostgresAuthPassword),string(PostgresAuthAWSIAMRDS),}
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.
var TerminalFontNames = []TerminalFontName{TerminalFontUnknown,TerminalFontIBMPlexMono,TerminalFontFiraCode,TerminalFontSourceCodePro,TerminalFontJetBrainsMono,}
var (UsernameValidRegex =regexp.MustCompile("^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$"))
var WorkspaceAgentLifecycleOrder = []WorkspaceAgentLifecycle{WorkspaceAgentLifecycleCreated,WorkspaceAgentLifecycleStarting,WorkspaceAgentLifecycleStartTimeout,WorkspaceAgentLifecycleStartError,WorkspaceAgentLifecycleReady,WorkspaceAgentLifecycleShuttingDown,WorkspaceAgentLifecycleShutdownTimeout,WorkspaceAgentLifecycleShutdownError,WorkspaceAgentLifecycleOff,}
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¶
BitmapToWeekdays converts a bitmap to a list of weekdays in accordance withthe schedule package's rules (see above).
funcDefaultCacheDir¶
func DefaultCacheDir()string
funcDefaultDocsURL¶added inv2.16.0
func DefaultDocsURL()string
funcDeploymentOptionsWithoutSecrets¶added inv2.2.1
DeploymentOptionsWithoutSecrets returns a copy of the OptionSet with secret values omitted.
funcDiscoverVarsFiles¶added inv2.14.0
*
- DiscoverVarsFiles function loads vars files in a predefined order:
- 1. terraform.tfvars
- 2. terraform.tfvars.json
- 3. *.auto.tfvars
- 4. *.auto.tfvars.json
funcDisplayNameValid¶added inv2.16.0
DisplayNameValid returns whether the input string is a valid template display name.
funcExpectJSONMime¶added inv2.7.0
ExpectJSONMime is a helper function that will assert the content typeof the response is application/json.
funcGroupNameValid¶added inv2.16.0
GroupNameValid returns whether the input string is a valid group name.
funcIsConnectionError¶
IsConnectionError is a convenience function for checking if the source of anerror is due to a 'connection refused', 'no such host', etc.
funcIsWorkspaceProxies¶
IsWorkspaceProxies returns true if the cli option is used by workspace proxies.
funcJobIsMissingParameterErrorCode¶added 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.
funcNameValid¶added inv2.16.0
NameValid returns whether the input string is a valid name.It is a generic validator for any name (user, workspace, template, role name, etc.).
funcNormalizeRealUsername¶added inv2.16.0
NormalizeUserRealName normalizes a user name such that it will passvalidation by UserRealNameValid. This is done to avoid blockinglittle Bobby Whitespace from using Coder.
funcParseSSHConfigOption¶
ParseSSHConfigOption parses a single ssh config option into it's key/value pair.
funcProvisionerTypeValid¶added 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¶
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
funcReservedProvisionerKeyNames¶added inv2.16.0
func ReservedProvisionerKeyNames() []string
funcServerSentEventReader¶
func ServerSentEventReader(ctxcontext.Context, rcio.ReadCloser) func() (*ServerSentEvent,error)
funcTemplateVersionNameValid¶added inv2.16.0
TemplateVersionNameValid returns whether the input string is a valid template version name.
funcTimezoneOffsetHourWithTime¶added inv2.8.0
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()'
funcUserRealNameValid¶added inv2.16.0
UserRealNameValid returns whether the input string is a valid real user name.
funcUsernameFrom¶added inv2.16.0
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
funcWebsocketNetConn¶added 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¶
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.
typeAIConfig¶added inv2.23.0
type AIConfig struct {Providers []AIProviderConfig `json:"providers,omitempty" yaml:"providers,omitempty"`}
typeAIProviderConfig¶added 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¶
typeAddLicenseRequest¶
type AddLicenseRequest struct {Licensestring `json:"license" validate:"required"`}
typeAgentConnectionTiming¶added inv2.18.0
typeAgentScriptTiming¶added 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"`}
typeArchiveTemplateVersionsRequest¶added 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"`}
typeArchiveTemplateVersionsResponse¶added inv2.3.0
typeAssignableRoles¶
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¶
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"`}
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.
typeAutomaticUpdates¶added inv2.3.0
type AutomaticUpdatesstring
const (AutomaticUpdatesAlwaysAutomaticUpdates = "always"AutomaticUpdatesNeverAutomaticUpdates = "never")
typeAvailableExperiments¶added 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.
typeBannerConfig¶added inv2.12.0
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")
typeChangePasswordWithOneTimePasscodeRequest¶added 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.
typeChatMessage¶added 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
func (*Client)APIKeyByID¶
APIKeyByID returns the api key by id.
func (*Client)APIKeyByName¶
APIKeyByName returns the api key by name.
func (*Client)AddLicense¶
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)ArchiveTemplateVersions¶added inv2.3.0
func (*Client)AuditLogs¶
func (c *Client) AuditLogs(ctxcontext.Context, reqAuditLogsRequest) (AuditLogResponse,error)
AuditLogs retrieves audit logs from the given page.
func (*Client)AuthCheck¶
func (c *Client) AuthCheck(ctxcontext.Context, reqAuthorizationRequest) (AuthorizationResponse,error)
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¶
CancelTemplateVersion marks a template version job as canceled.
func (*Client)CancelTemplateVersionDryRun¶
CancelTemplateVersionDryRun marks a template version dry-run job as canceled.
func (*Client)CancelWorkspaceBuild¶
CancelWorkspaceBuild marks a workspace build job as canceled.
func (*Client)ChangePasswordWithOneTimePasscode¶added inv2.17.0
func (c *Client) ChangePasswordWithOneTimePasscode(ctxcontext.Context, reqChangePasswordWithOneTimePasscodeRequest)error
func (*Client)ChatMessages¶added inv2.23.0
ChatMessages returns the messages of a chat.
func (*Client)ConvertLoginType¶
func (c *Client) ConvertLoginType(ctxcontext.Context, reqConvertLoginRequest) (OAuthConversionResponse,error)
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)ConvertUserLoginType¶added 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¶
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)CreateChat¶added inv2.23.0
CreateChat creates a new chat.
func (*Client)CreateChatMessage¶added 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¶
func (c *Client) CreateFirstUser(ctxcontext.Context, reqCreateFirstUserRequest) (CreateFirstUserResponse,error)
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 (*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)CreateOrganizationRole¶added inv2.15.0
CreateOrganizationRole will create a custom organization role
func (*Client)CreateProvisionerKey¶added 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¶
func (c *Client) CreateToken(ctxcontext.Context, userIDstring, reqCreateTokenRequest) (GenerateAPIKeyResponse,error)
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¶
CreateUserDeprecated: Use CreateUserWithOrgs instead. This will be removed.TODO: When removing, we should rename CreateUserWithOrgs -> CreateUserwith an alias of CreateUserWithOrgs.
func (*Client)CreateUserWithOrgs¶added inv2.15.0
CreateUserWithOrgs creates a new user.
func (*Client)CreateUserWorkspace¶added 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 (*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)CreateWorkspaceProxy¶
func (c *Client) CreateWorkspaceProxy(ctxcontext.Context, reqCreateWorkspaceProxyRequest) (UpdateWorkspaceProxyResponse,error)
func (*Client)DeleteAPIKey¶
DeleteAPIKey deletes API key by id.
func (*Client)DeleteChat¶added inv2.23.0
func (*Client)DeleteOAuth2ProviderApp¶added inv2.6.0
DeleteOAuth2ProviderApp deletes an application, also invalidating any tokensthat were generated from it.
func (*Client)DeleteOAuth2ProviderAppSecret¶added 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)DeleteOrganization¶added inv2.12.0
DeleteOrganization will remove the corresponding organization from the deployment, based onthe UUID/name provided as `orgID`.
func (*Client)DeleteOrganizationMember¶added inv2.13.0
func (c *Client) DeleteOrganizationMember(ctxcontext.Context, organizationIDuuid.UUID, userstring)error
DeleteOrganizationMember removes a user from an organization
func (*Client)DeleteOrganizationRole¶added inv2.15.0
func (c *Client) DeleteOrganizationRole(ctxcontext.Context, organizationIDuuid.UUID, roleNamestring)error
DeleteOrganizationRole will delete a custom organization role
func (*Client)DeleteProvisionerKey¶added inv2.14.0
DeleteProvisionerKey deletes a provisioner key.
func (*Client)DeleteTemplate¶
func (*Client)DeleteUser¶
DeleteUser deletes a user.
func (*Client)DeleteWebpushSubscription¶added 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)DeleteWorkspaceAgentPortShare¶added inv2.9.0
func (*Client)DeleteWorkspaceProxyByID¶
func (*Client)DeleteWorkspaceProxyByName¶
func (*Client)DeletedWorkspace¶
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¶
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)DownloadWithFormat¶added 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)ExternalAuthByID¶added inv2.2.1
ExternalAuthByID returns the external auth for the given provider by ID.
func (*Client)ExternalAuthDeviceByID¶added inv2.2.1
func (*Client)ExternalAuthDeviceExchange¶added inv2.2.1
func (c *Client) ExternalAuthDeviceExchange(ctxcontext.Context, providerstring, reqExternalAuthDeviceExchange)error
ExchangeGitAuth exchanges a device code for an external auth token.
func (*Client)FavoriteWorkspace¶added inv2.8.0
func (*Client)GetAvailableIDPSyncFields¶added inv2.18.0
func (*Client)GetIDPSyncFieldValues¶added inv2.19.0
func (*Client)GetNotificationDispatchMethods¶added inv2.15.0
func (c *Client) GetNotificationDispatchMethods(ctxcontext.Context) (NotificationMethodsResponse,error)
GetNotificationDispatchMethods the available and default notification dispatch methods.
func (*Client)GetNotificationsSettings¶added 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)GetOrganizationAvailableIDPSyncFields¶added inv2.18.0
func (*Client)GetOrganizationIDPSyncFieldValues¶added inv2.19.0
func (*Client)GetProvisionerKey¶added inv2.18.0
GetProvisionerKey returns the provisioner key.
func (*Client)GetSystemNotificationTemplates¶added inv2.15.0
func (c *Client) GetSystemNotificationTemplates(ctxcontext.Context) ([]NotificationTemplate,error)
GetSystemNotificationTemplates retrieves all notification templates pertaining to internal system events.
func (*Client)GetTokenConfig¶
GetTokenConfig returns deployment options related to token management
func (*Client)GetUserAppearanceSettings¶added inv2.22.0
func (c *Client) GetUserAppearanceSettings(ctxcontext.Context, userstring) (UserAppearanceSettings,error)
GetUserAppearanceSettings fetches the appearance settings for a user.
func (*Client)GetUserNotificationPreferences¶added inv2.15.0
func (c *Client) GetUserNotificationPreferences(ctxcontext.Context, userIDuuid.UUID) ([]NotificationPreference,error)
GetUserNotificationPreferences retrieves notification preferences for a given user.
func (*Client)GetUserStatusCounts¶added inv2.19.0
func (c *Client) GetUserStatusCounts(ctxcontext.Context, reqGetUserStatusCountsRequest) (GetUserStatusCountsResponse,error)
func (*Client)GetWorkspaceAgentPortShares¶added inv2.9.0
func (*Client)GroupByOrgAndName¶
func (*Client)GroupIDPSyncSettings¶added inv2.16.0
func (*Client)GroupsByOrganization¶
GroupsByOrganizationDeprecated: use Groups with GroupArguments instead.
func (*Client)HasFirstUser¶
HasFirstUser returns whether the first user has been created.
func (*Client)IssueReconnectingPTYSignedToken¶
func (c *Client) IssueReconnectingPTYSignedToken(ctxcontext.Context, reqIssueReconnectingPTYSignedTokenRequest) (IssueReconnectingPTYSignedTokenResponse,error)
func (*Client)LanguageModelConfig¶added inv2.23.0
func (c *Client) LanguageModelConfig(ctxcontext.Context) (LanguageModelConfig,error)
func (*Client)ListExternalAuths¶added 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)ListInboxNotifications¶added inv2.21.0
func (c *Client) ListInboxNotifications(ctxcontext.Context, reqListInboxNotificationsRequest) (ListInboxNotificationsResponse,error)
func (*Client)ListOrganizationRoles¶
ListOrganizationRoles lists all assignable roles for a given organization.
func (*Client)ListProvisionerKeyDaemons¶added 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)ListProvisionerKeys¶added 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)LoginWithPassword¶
func (c *Client) LoginWithPassword(ctxcontext.Context, reqLoginWithPasswordRequest) (LoginWithPasswordResponse,error)
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¶
Logout calls the /logout APICall `ClearSessionToken()` to clear the session token of the client.
func (*Client)MarkAllInboxNotificationsAsRead¶added inv2.21.0
func (*Client)OAuth2ProviderApp¶added inv2.6.0
OAuth2ProviderApp returns an application configured to authenticate usingCoder as an OAuth2 provider.
func (*Client)OAuth2ProviderAppSecrets¶added inv2.6.0
func (c *Client) OAuth2ProviderAppSecrets(ctxcontext.Context, appIDuuid.UUID) ([]OAuth2ProviderAppSecret,error)
OAuth2ProviderAppSecrets returns the truncated secrets for an OAuth2application.
func (*Client)OAuth2ProviderApps¶added 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 (*Client)OrganizationByName¶
func (*Client)OrganizationByUserAndName¶added inv2.9.0
func (*Client)OrganizationIDPSyncSettings¶added inv2.18.0
func (c *Client) OrganizationIDPSyncSettings(ctxcontext.Context) (OrganizationSyncSettings,error)
func (*Client)OrganizationMembers¶added inv2.13.0
func (c *Client) OrganizationMembers(ctxcontext.Context, organizationIDuuid.UUID) ([]OrganizationMemberWithUserData,error)
OrganizationMembers lists all members in an organization
func (*Client)OrganizationProvisionerDaemons¶added inv2.14.0
func (c *Client) OrganizationProvisionerDaemons(ctxcontext.Context, organizationIDuuid.UUID, opts *OrganizationProvisionerDaemonsOptions) ([]ProvisionerDaemon,error)
func (*Client)OrganizationProvisionerJob¶added inv2.19.0
func (*Client)OrganizationProvisionerJobs¶added inv2.19.0
func (c *Client) OrganizationProvisionerJobs(ctxcontext.Context, organizationIDuuid.UUID, opts *OrganizationProvisionerJobsOptions) ([]ProvisionerJob,error)
func (*Client)Organizations¶added inv2.14.0
func (c *Client) Organizations(ctxcontext.Context) ([]Organization,error)
func (*Client)OrganizationsByUser¶
OrganizationsByUser returns all organizations the user is a member of.
func (*Client)PatchGroup¶
func (*Client)PatchGroupIDPSyncConfig¶added inv2.19.0
func (c *Client) PatchGroupIDPSyncConfig(ctxcontext.Context, orgIDstring, reqPatchGroupIDPSyncConfigRequest) (GroupSyncSettings,error)
func (*Client)PatchGroupIDPSyncMapping¶added inv2.19.0
func (c *Client) PatchGroupIDPSyncMapping(ctxcontext.Context, orgIDstring, reqPatchGroupIDPSyncMappingRequest) (GroupSyncSettings,error)
func (*Client)PatchGroupIDPSyncSettings¶added inv2.16.0
func (c *Client) PatchGroupIDPSyncSettings(ctxcontext.Context, orgIDstring, reqGroupSyncSettings) (GroupSyncSettings,error)
func (*Client)PatchOrganizationIDPSyncConfig¶added inv2.19.0
func (c *Client) PatchOrganizationIDPSyncConfig(ctxcontext.Context, reqPatchOrganizationIDPSyncConfigRequest) (OrganizationSyncSettings,error)
func (*Client)PatchOrganizationIDPSyncMapping¶added inv2.19.0
func (c *Client) PatchOrganizationIDPSyncMapping(ctxcontext.Context, reqPatchOrganizationIDPSyncMappingRequest) (OrganizationSyncSettings,error)
func (*Client)PatchOrganizationIDPSyncSettings¶added inv2.18.0
func (c *Client) PatchOrganizationIDPSyncSettings(ctxcontext.Context, reqOrganizationSyncSettings) (OrganizationSyncSettings,error)
func (*Client)PatchRoleIDPSyncConfig¶added inv2.19.0
func (c *Client) PatchRoleIDPSyncConfig(ctxcontext.Context, orgIDstring, reqPatchRoleIDPSyncConfigRequest) (RoleSyncSettings,error)
func (*Client)PatchRoleIDPSyncMapping¶added inv2.19.0
func (c *Client) PatchRoleIDPSyncMapping(ctxcontext.Context, orgIDstring, reqPatchRoleIDPSyncMappingRequest) (RoleSyncSettings,error)
func (*Client)PatchRoleIDPSyncSettings¶added inv2.16.0
func (c *Client) PatchRoleIDPSyncSettings(ctxcontext.Context, orgIDstring, reqRoleSyncSettings) (RoleSyncSettings,error)
func (*Client)PatchWorkspaceProxy¶
func (c *Client) PatchWorkspaceProxy(ctxcontext.Context, reqPatchWorkspaceProxy) (UpdateWorkspaceProxyResponse,error)
func (*Client)PostOAuth2ProviderApp¶added 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)PostOAuth2ProviderAppSecret¶added 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)PostOrganizationMember¶added inv2.13.0
func (c *Client) PostOrganizationMember(ctxcontext.Context, organizationIDuuid.UUID, userstring) (OrganizationMember,error)
PostOrganizationMember adds a user to an organization
func (*Client)PostTestNotification¶added inv2.20.0
func (*Client)PostTestWebpushMessage¶added inv2.21.0
func (*Client)PostWebpushSubscription¶added inv2.21.0
func (c *Client) PostWebpushSubscription(ctxcontext.Context, userstring, reqWebpushSubscription)error
PostWebpushSubscription creates a push notification subscription for a given user.
func (*Client)PostWorkspaceUsage¶added inv2.10.0
PostWorkspaceUsage marks the workspace as having been used recently.Deprecated: use PostWorkspaceUsageWithBody instead
func (*Client)PostWorkspaceUsageWithBody¶added 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 (*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)PutNotificationsSettings¶added 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)PutOAuth2ProviderApp¶added inv2.6.0
func (c *Client) PutOAuth2ProviderApp(ctxcontext.Context, iduuid.UUID, appPutOAuth2ProviderAppRequest) (OAuth2ProviderApp,error)
PutOAuth2ProviderApp updates an application that can authenticate using Coderas an OAuth2 provider.
func (*Client)RegenerateGitSSHKey¶
RegenerateGitSSHKey will create a new SSH key pair for the user and return it.
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)RequestOneTimePasscode¶added inv2.17.0
func (c *Client) RequestOneTimePasscode(ctxcontext.Context, reqRequestOneTimePasscodeRequest)error
func (*Client)ResolveAutostart¶added inv2.4.0
func (*Client)RevokeOAuth2ProviderApp¶added inv2.9.0
RevokeOAuth2ProviderApp completely revokes an app's access for theauthenticated user.
func (*Client)RoleIDPSyncSettings¶added inv2.16.0
func (*Client)SSHConfiguration¶
func (c *Client) SSHConfiguration(ctxcontext.Context) (SSHConfigResponse,error)
SSHConfiguration returns information about the SSH configuration for theCoder instance.
func (*Client)SafeExperiments¶added inv2.3.1
func (c *Client) SafeExperiments(ctxcontext.Context) (AvailableExperiments,error)
func (*Client)ServeProvisionerDaemon¶
func (c *Client) ServeProvisionerDaemon(ctxcontext.Context, reqServeProvisionerDaemonRequest) (proto.DRPCProvisionerDaemonClient,error)
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¶
SessionToken returns the currently set token for the client.
func (*Client)SetArchiveTemplateVersion¶added inv2.3.0
func (*Client)SetLogBodies¶
SetLogBodies sets whether to log request and response bodies.
func (*Client)SetSessionToken¶
SetSessionToken returns the currently set token for the client.
func (*Client)StarterTemplates¶added inv2.15.0
func (c *Client) StarterTemplates(ctxcontext.Context) ([]TemplateExample,error)
StarterTemplates lists example templates available in Coder.
func (*Client)TemplateACL¶
func (*Client)TemplateACLAvailable¶
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 (*Client)TemplateExamplesdeprecated
func (*Client)TemplateInsights¶
func (c *Client) TemplateInsights(ctxcontext.Context, reqTemplateInsightsRequest) (TemplateInsightsResponse,error)
func (*Client)TemplateVersion¶
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 (*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)TemplateVersionDryRunMatchedProvisioners¶added 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)TemplateVersionDynamicParameters¶added inv2.22.0
func (c *Client) TemplateVersionDynamicParameters(ctxcontext.Context, versionuuid.UUID) (*wsjson.Stream[DynamicParametersResponse,DynamicParametersRequest],error)
func (*Client)TemplateVersionExternalAuth¶added 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)TemplateVersionPresets¶added 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)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)UnfavoriteWorkspace¶added inv2.8.0
func (*Client)UnlinkExternalAuthByID¶added inv2.5.0
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)UpdateInboxNotificationReadStatus¶added inv2.21.0
func (c *Client) UpdateInboxNotificationReadStatus(ctxcontext.Context, notifIDstring, reqUpdateInboxNotificationReadStatusRequest) (UpdateInboxNotificationReadStatusResponse,error)
func (*Client)UpdateNotificationTemplateMethod¶added 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)UpdateOrganization¶added 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)UpdateOrganizationRole¶added inv2.15.0
UpdateOrganizationRole will update an existing custom organization role
func (*Client)UpdateTemplateACL¶
func (*Client)UpdateTemplateMeta¶
func (*Client)UpdateTemplateVersion¶
func (c *Client) UpdateTemplateVersion(ctxcontext.Context, versionIDuuid.UUID, reqPatchTemplateVersionRequest) (TemplateVersion,error)
func (*Client)UpdateUserAppearanceSettings¶added inv2.5.1
func (c *Client) UpdateUserAppearanceSettings(ctxcontext.Context, userstring, reqUpdateUserAppearanceSettingsRequest) (UserAppearanceSettings,error)
UpdateUserAppearanceSettings updates the appearance settings for a user.
func (*Client)UpdateUserNotificationPreferences¶added 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¶
UpdateUserRoles grants the userID the specified roles.Include ALL roles the user has.
func (*Client)UpdateUserStatus¶
UpdateUserStatus sets the user status to the given status
func (*Client)UpdateWorkspace¶
func (*Client)UpdateWorkspaceAutomaticUpdates¶added 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)UpdateWorkspaceDormancy¶added 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)UpdateWorkspaceUsageContext¶added inv2.10.0
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)UpdateWorkspaceUsageWithBodyContext¶added 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¶
Upload uploads an arbitrary file with the content type provided.This is used to upload a source-code archive.
func (*Client)UpsertWorkspaceAgentPortShare¶added inv2.9.0
func (c *Client) UpsertWorkspaceAgentPortShare(ctxcontext.Context, workspaceIDuuid.UUID, reqUpsertWorkspaceAgentPortShareRequest) (WorkspaceAgentPortShare,error)
func (*Client)UserActivityInsights¶added inv2.2.0
func (c *Client) UserActivityInsights(ctxcontext.Context, reqUserActivityInsightsRequest) (UserActivityInsightsResponse,error)
func (*Client)UserAutofillParameters¶added 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)UserLatencyInsights¶
func (c *Client) UserLatencyInsights(ctxcontext.Context, reqUserLatencyInsightsRequest) (UserLatencyInsightsResponse,error)
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)Users¶
func (c *Client) Users(ctxcontext.Context, reqUsersRequest) (GetUsersResponse,error)
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)ValidateUserPassword¶added inv2.18.0
func (c *Client) ValidateUserPassword(ctxcontext.Context, reqValidateUserPasswordRequest) (ValidateUserPasswordResponse,error)
ValidateUserPassword validates the complexity of a user password and that it is secured enough.
func (*Client)WatchWorkspace¶
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)WorkspaceAgent¶
WorkspaceAgent returns an agent by ID.
func (*Client)WorkspaceAgentListContainers¶added 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 (*Client)WorkspaceAgentRecreateDevcontainer¶added 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¶
WorkspaceBuild returns a single workspace build for a workspace.If history is "", the latest version is returned.
func (*Client)WorkspaceBuildByUsernameAndWorkspaceNameAndBuildNumber¶
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 (*Client)WorkspaceBuildState¶
WorkspaceBuildState returns the provisioner state of the build.
func (*Client)WorkspaceBuildTimings¶added inv2.17.0
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 (*Client)WorkspaceProxyByName¶
func (*Client)WorkspaceQuota¶
func (*Client)WorkspaceTimings¶added inv2.16.0
func (*Client)Workspaces¶
func (c *Client) Workspaces(ctxcontext.Context, filterWorkspaceFilter) (WorkspacesResponse,error)
Workspaces returns all workspaces the authenticated user has access to.
typeCoderDesktopTelemetry¶added 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)FromHeader¶added 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)IsEmpty¶added 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.
typeCreateChatMessageRequest¶added 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.
typeCreateFirstUserTrialInfo¶added inv2.7.0
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"`}
typeCreateProvisionerKeyRequest¶added inv2.14.0
typeCreateProvisionerKeyResponse¶added 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
typeCreateUserRequestWithOrgs¶added 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)UnmarshalJSON¶added 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.
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
typeCryptoKey¶added inv2.17.0
typeCryptoKeyFeature¶added 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")
typeCustomRoleRequest¶added 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.
typeDAURequest¶
type DAURequest struct {TZHourOffsetint}
typeDAUsResponse¶
typeDERP¶
type DERP struct {ServerDERPServerConfig `json:"server" typescript:",notnull"`ConfigDERPConfig `json:"config" typescript:",notnull"`}
typeDERPConfig¶
typeDERPRegion¶
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¶
typeDeleteWebpushSubscription¶added inv2.21.0
type DeleteWebpushSubscription struct {Endpointstring `json:"endpoint"`}
typeDeleteWorkspaceAgentPortShareRequest¶added inv2.9.0
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 (c *DeploymentValues) Options()serpent.OptionSet
func (*DeploymentValues)WithoutSecrets¶
func (c *DeploymentValues) WithoutSecrets() (*DeploymentValues,error)
WithoutSecrets returns a copy of the config without secret values.
typeDiagnosticExtra¶added inv2.23.0
type DiagnosticExtra struct {Codestring `json:"code"`}
typeDiagnosticSeverityString¶added inv2.23.0
type DiagnosticSeverityStringstring
const (DiagnosticSeverityErrorDiagnosticSeverityString = "error"DiagnosticSeverityWarningDiagnosticSeverityString = "warning")
typeDisplayApp¶added inv2.1.5
type DisplayAppstring
const (DisplayAppVSCodeDesktopDisplayApp = "vscode"DisplayAppVSCodeInsidersDisplayApp = "vscode_insiders"DisplayAppWebTerminalDisplayApp = "web_terminal"DisplayAppPortForwardDisplayApp = "port_forwarding_helper"DisplayAppSSHDisplayApp = "ssh_helper")
typeDynamicParametersRequest¶added 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"`}
typeDynamicParametersResponse¶added inv2.22.0
type DynamicParametersResponse struct {IDint `json:"id"`Diagnostics []FriendlyDiagnostic `json:"diagnostics"`Parameters []PreviewParameter `json:"parameters"`}
typeEnhancedExternalAuthProvider¶added 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)Git¶added inv2.2.1
func (eEnhancedExternalAuthProvider) Git()bool
Git returns whether the provider is a Git provider.
func (EnhancedExternalAuthProvider)String¶added inv2.2.1
func (eEnhancedExternalAuthProvider) String()string
typeEntitlement¶
type Entitlementstring
Entitlement represents whether a feature is licensed.
const (EntitlementEntitledEntitlement = "entitled"EntitlementGracePeriodEntitlement = "grace_period"EntitlementNotEntitledEntitlement = "not_entitled")
func (Entitlement)Entitled¶added 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)Weight¶added 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)AddFeature¶added 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¶
Error represents an unaccepted or invalid request to the API.@typescript-ignore Error
func (*Error)StatusCode¶
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.
typeExternalAuth¶added 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"`}
typeExternalAuthAppInstallation¶added inv2.2.1
type ExternalAuthAppInstallation struct {IDint `json:"id"`AccountExternalAuthUser `json:"account"`ConfigureURLstring `json:"configure_url"`}
typeExternalAuthConfig¶added 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"`}
typeExternalAuthDevice¶added 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
typeExternalAuthDeviceExchange¶added inv2.2.1
type ExternalAuthDeviceExchange struct {DeviceCodestring `json:"device_code"`}
typeExternalAuthLink¶added 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.
typeExternalAuthLinkProvider¶added 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.
typeExternalAuthUser¶added inv2.2.1
typeFeature¶
type Feature struct {EntitlementEntitlement `json:"entitlement"`Enabledbool `json:"enabled"`Limit *int64 `json:"limit,omitempty"`Actual *int64 `json:"actual,omitempty"`}
func (Feature)Capable¶added inv2.14.0
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)Compare¶added inv2.14.0
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)Enterprise¶added 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.
typeFeatureSet¶added 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)Features¶added inv2.14.0
func (setFeatureSet) Features() []FeatureName
typeFriendlyDiagnostic¶added 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.
typeGetInboxNotificationResponse¶added inv2.21.0
type GetInboxNotificationResponse struct {NotificationInboxNotification `json:"notification"`UnreadCountint `json:"unread_count"`}
typeGetUserStatusCountsRequest¶added inv2.19.0
typeGetUserStatusCountsResponse¶added inv2.19.0
type GetUserStatusCountsResponse struct {StatusCounts map[UserStatus][]UserStatusChangeCount `json:"status_counts"`}
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"`}
typeGithubAuthMethod¶added inv2.20.0
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¶
typeGroupArguments¶added inv2.15.0
typeGroupSource¶
type GroupSourcestring
const (GroupSourceUserGroupSource = "user"GroupSourceOIDCGroupSource = "oidc")
typeGroupSyncSettings¶added 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"`}
typeHTTPCookieConfig¶added inv2.22.0
type HTTPCookieConfig struct {Secureserpent.Bool `json:"secure_auth_cookie,omitempty" typescript:",notnull"`SameSitestring `json:"same_site,omitempty" typescript:",notnull"`}
func (*HTTPCookieConfig)Apply¶added inv2.22.0
func (cfg *HTTPCookieConfig) Apply(c *http.Cookie) *http.Cookie
func (HTTPCookieConfig)HTTPSameSite¶added inv2.22.0
func (cfgHTTPCookieConfig) HTTPSameSite()http.SameSite
typeHeaderTransport¶added 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)CloseIdleConnections¶added inv2.5.0
func (h *HeaderTransport) CloseIdleConnections()
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"`}
typeHealthcheckConfig¶added inv2.4.0
type HealthcheckConfig struct {Refreshserpent.Duration `json:"refresh" typescript:",notnull"`ThresholdDatabaseserpent.Duration `json:"threshold_database" typescript:",notnull"`}
HealthcheckConfig contains configuration for healthchecks.
typeIDPSyncMapping¶added inv2.19.0
typeInboxNotification¶added 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"`}
typeInboxNotificationAction¶added inv2.21.0
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)Days¶added inv2.2.0
func (intervalInsightsReportInterval) Days()int32
Days returns the duration of the interval in days.
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")
typeLanguageModel¶added 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.
typeLanguageModelConfig¶added 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 (*License)ExpiresAt¶
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`.
typeLicensorTrialRequest¶added 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"`}
funcDefaultSupportLinks¶added inv2.16.0
func DefaultSupportLinks(docsURLstring) []LinkConfig
typeListInboxNotificationsRequest¶added inv2.21.0
typeListInboxNotificationsResponse¶added inv2.21.0
type ListInboxNotificationsResponse struct {Notifications []InboxNotification `json:"notifications"`UnreadCountint `json:"unread_count"`}
typeListUserExternalAuthResponse¶added 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"`}
typeLoggingConfig¶
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.
typeMatchedProvisioners¶added 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.
typeMinimalOrganization¶added inv2.14.0
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.
typeNotificationMethodsResponse¶added inv2.15.0
typeNotificationPreference¶added inv2.15.0
typeNotificationTemplate¶added 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"`}
typeNotificationsConfig¶added 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)Enabled¶added inv2.18.0
func (n *NotificationsConfig) Enabled()bool
Are either of the notification methods enabled?
typeNotificationsEmailAuthConfig¶added 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)Empty¶added inv2.14.0
func (c *NotificationsEmailAuthConfig) Empty()bool
typeNotificationsEmailConfig¶added 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"`}
typeNotificationsEmailTLSConfig¶added 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)Empty¶added inv2.14.0
func (c *NotificationsEmailTLSConfig) Empty()bool
typeNotificationsInboxConfig¶added inv2.21.0
typeNotificationsSettings¶added inv2.14.0
type NotificationsSettings struct {NotifierPausedbool `json:"notifier_paused"`}
typeNotificationsWebhookConfig¶added inv2.14.0
typeNullHCLString¶added inv2.22.0
NullHCLString == `previewtypes.NullHCLString`.
typeNullTime¶
NullTime represents a nullable time.Time.@typescript-ignore NullTime
funcNewNullTime¶
NewNullTime returns a new NullTime with the given time.Time.
func (NullTime)MarshalJSON¶
MarshalJSON implements json.Marshaler.
func (*NullTime)UnmarshalJSON¶
UnmarshalJSON implements json.Unmarshaler.
typeOAuth2AppEndpoints¶added inv2.8.0
typeOAuth2Config¶
type OAuth2Config struct {GithubOAuth2GithubConfig `json:"github" typescript:",notnull"`}
typeOAuth2DeviceFlowCallbackResponse¶added 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"`}
typeOAuth2ProviderApp¶added 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"`}
typeOAuth2ProviderAppFilter¶added inv2.9.0
typeOAuth2ProviderAppSecret¶added inv2.6.0
typeOAuth2ProviderAppSecretFull¶added inv2.6.0
typeOAuth2ProviderGrantType¶added inv2.9.0
type OAuth2ProviderGrantTypestring
const (OAuth2ProviderGrantTypeAuthorizationCodeOAuth2ProviderGrantType = "authorization_code"OAuth2ProviderGrantTypeRefreshTokenOAuth2ProviderGrantType = "refresh_token")
func (OAuth2ProviderGrantType)Valid¶added inv2.9.0
func (eOAuth2ProviderGrantType) Valid()bool
typeOAuth2ProviderResponseType¶added inv2.9.0
type OAuth2ProviderResponseTypestring
const (OAuth2ProviderResponseTypeCodeOAuth2ProviderResponseType = "code")
func (OAuth2ProviderResponseType)Valid¶added inv2.9.0
func (eOAuth2ProviderResponseType) Valid()bool
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"`}
typeOptionType¶added 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)HumanName¶added 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"`}
typeOrganizationMemberWithUserData¶added 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"`}
typeOrganizationProvisionerDaemonsOptions¶added inv2.20.0
typeOrganizationProvisionerJobsOptions¶added inv2.19.0
typeOrganizationSyncSettings¶added 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"`}
typePaginatedMembersRequest¶added inv2.21.0
typePaginatedMembersResponse¶added 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.
typeParameterFormType¶added 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)Resolve¶added inv2.22.0
func (r *ParameterResolver) Resolve(pTemplateVersionParameter, v *WorkspaceBuildParameter)string
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¶
func (r *ParameterResolver) ValidateResolve(pTemplateVersionParameter, v *WorkspaceBuildParameter) (valuestring, errerror)
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.
typePatchGroupIDPSyncConfigRequest¶added inv2.19.0
typePatchGroupIDPSyncMappingRequest¶added 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"`}
typePatchOrganizationIDPSyncConfigRequest¶added inv2.19.0
typePatchOrganizationIDPSyncMappingRequest¶added 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.
typePatchRoleIDPSyncConfigRequest¶added inv2.19.0
type PatchRoleIDPSyncConfigRequest struct {Fieldstring `json:"field"`}
typePatchRoleIDPSyncMappingRequest¶added 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.
typePermission¶added 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.
funcCreatePermissions¶added inv2.12.0
func CreatePermissions(mapping map[RBACResource][]RBACAction) []Permission
CreatePermissions is a helper function to quickly build permissions.
typePostOAuth2ProviderAppRequest¶added inv2.6.0
typePostWorkspaceUsageRequest¶added inv2.13.0
type PostWorkspaceUsageRequest struct {AgentIDuuid.UUID `json:"agent_id" format:"uuid"`AppNameUsageAppName `json:"app_name"`}
typePostgresAuth¶added inv2.10.0
type PostgresAuthstring
const (PostgresAuthPasswordPostgresAuth = "password"PostgresAuthAWSIAMRDSPostgresAuth = "awsiamrds")
typePprofConfig¶
typePrebuildsConfig¶added 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"`}
typePresetParameter¶added inv2.20.0
typePreviewParameter¶added inv2.23.0
type PreviewParameter struct {PreviewParameterDataValueNullHCLString `json:"value"`Diagnostics []FriendlyDiagnostic `json:"diagnostics"`}
typePreviewParameterData¶added 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"`}
typePreviewParameterOption¶added inv2.23.0
type PreviewParameterOption struct {Namestring `json:"name"`Descriptionstring `json:"description"`ValueNullHCLString `json:"value"`Iconstring `json:"icon"`}
typePreviewParameterStyling¶added inv2.23.0
typePreviewParameterValidation¶added inv2.23.0
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"`}
typeProvisionerDaemonJob¶added 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"`}
typeProvisionerDaemonStatus¶added 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.
typeProvisionerJobInput¶added 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.
typeProvisionerJobMetadata¶added 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")
funcProvisionerJobStatusEnums¶added 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.
typeProvisionerJobType¶added inv2.19.0
type ProvisionerJobTypestring
ProvisionerJobType represents the type of job.
const (ProvisionerJobTypeTemplateVersionImportProvisionerJobType = "template_version_import"ProvisionerJobTypeWorkspaceBuildProvisionerJobType = "workspace_build"ProvisionerJobTypeTemplateVersionDryRunProvisionerJobType = "template_version_dry_run")
typeProvisionerKey¶added 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"`}
typeProvisionerKeyDaemons¶added inv2.16.0
type ProvisionerKeyDaemons struct {KeyProvisionerKey `json:"key"`Daemons []ProvisionerDaemon `json:"daemons"`}
typeProvisionerKeyTags¶added inv2.16.0
func (ProvisionerKeyTags)String¶added inv2.16.0
func (pProvisionerKeyTags) String()string
typeProvisionerLogLevel¶
type ProvisionerLogLevelstring
const (ProvisionerLogLevelDebugProvisionerLogLevel = "debug")
typeProvisionerStorageMethod¶
type ProvisionerStorageMethodstring
const (ProvisionerStorageMethodFileProvisionerStorageMethod = "file")
typeProvisionerTiming¶added 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.
typePutOAuth2ProviderAppRequest¶added inv2.6.0
typeRBACAction¶added 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¶
typeReducedUser¶added 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"`}
typeRequestOneTimePasscodeRequest¶added 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¶
RequestOption is a function that can be used to modify an http.Request.
funcListInboxNotificationsRequestToQueryParams¶added inv2.21.0
func ListInboxNotificationsRequestToQueryParams(reqListInboxNotificationsRequest) []RequestOption
funcWithQueryParam¶
func WithQueryParam(key, valuestring)RequestOption
WithQueryParam adds a query parameter to the request.
typeResolveAutostartResponse¶added 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.
typeRoleSyncSettings¶added 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.
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.
typeSessionLifetime¶added 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.
typeSlimRole¶added 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)UniqueName¶added inv2.13.0
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¶
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¶
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.
typeTemplateAutostartRequirement¶added 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"`}
typeTemplateAutostopRequirement¶added 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"`}
typeTemplateBuildTimeStats¶
type TemplateBuildTimeStats map[WorkspaceTransition]TransitionStats
typeTemplateExample¶
typeTemplateFilter¶added inv2.14.0
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.
typeTemplateInsightsSection¶added 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¶
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.
typeTemplateVersionExternalAuth¶added inv2.2.1
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.
typeTerminalFontName¶added 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")
typeTimingStage¶added 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¶
typeTokensFilter¶
type TokensFilter struct {IncludeAllbool `json:"include_all"`}
typeTraceConfig¶
typeTransitionStats¶
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.
typeUpdateInboxNotificationReadStatusRequest¶added inv2.21.0
type UpdateInboxNotificationReadStatusRequest struct {IsReadbool `json:"is_read"`}
typeUpdateInboxNotificationReadStatusResponse¶added inv2.21.0
type UpdateInboxNotificationReadStatusResponse struct {NotificationInboxNotification `json:"notification"`UnreadCountint `json:"unread_count"`}
typeUpdateNotificationTemplateMethod¶added inv2.15.0
type UpdateNotificationTemplateMethod struct {Methodstring `json:"method,omitempty" example:"webhook"`}
typeUpdateOrganizationRequest¶added inv2.12.0
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"`}
typeUpdateUserAppearanceSettingsRequest¶added inv2.5.1
type UpdateUserAppearanceSettingsRequest struct {ThemePreferencestring `json:"theme_preference" validate:"required"`TerminalFontTerminalFontName `json:"terminal_font" validate:"required"`}
typeUpdateUserNotificationPreferences¶added inv2.15.0
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"`}
typeUpdateWorkspaceAutomaticUpdatesRequest¶added 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.
typeUpdateWorkspaceDormancy¶added 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¶
UploadResponse contains the hash to reference the uploaded file.
typeUpsertWorkspaceAgentPortShareRequest¶added 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"`}
typeUsageAppName¶added 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.
typeUserActivity¶added 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.
typeUserActivityInsightsReport¶added 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.
typeUserActivityInsightsRequest¶added inv2.2.0
typeUserActivityInsightsResponse¶added inv2.2.0
type UserActivityInsightsResponse struct {ReportUserActivityInsightsReport `json:"report"`}
UserActivityInsightsResponse is the response from the user activity insightsendpoint.
typeUserAppearanceSettings¶added 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.
typeUserLatencyInsightsResponse¶
type UserLatencyInsightsResponse struct {ReportUserLatencyInsightsReport `json:"report"`}
UserLatencyInsightsResponse is the response from the user latency insightsendpoint.
typeUserLoginType¶
type UserLoginType struct {LoginTypeLoginType `json:"login_type"`}
typeUserParameter¶added inv2.8.0
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"`}
typeUserStatus¶
type UserStatusstring
const (UserStatusActiveUserStatus = "active"UserStatusDormantUserStatus = "dormant"UserStatusSuspendedUserStatus = "suspended")
typeUserStatusChangeCount¶added inv2.19.0
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}
typeValidateUserPasswordRequest¶added inv2.18.0
type ValidateUserPasswordRequest struct {Passwordstring `json:"password" validate:"required"`}
typeValidateUserPasswordResponse¶added inv2.18.0
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¶
funcParseUserVariableValues¶added inv2.14.0
func ParseUserVariableValues(varsFiles []string, variablesFilestring, commandLineVariables []string) ([]VariableValue,error)
typeWebpushMessage¶added inv2.21.0
type WebpushMessage struct {Iconstring `json:"icon"`Titlestring `json:"title"`Bodystring `json:"body"`Actions []WebpushMessageAction `json:"actions"`}
typeWebpushMessageAction¶added inv2.21.0
typeWebpushSubscription¶added inv2.21.0
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.
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"`}
typeWorkspaceAgentContainer¶added 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)Match¶added inv2.22.0
func (c *WorkspaceAgentContainer) Match(idOrNamestring)bool
typeWorkspaceAgentContainerPort¶added 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.
typeWorkspaceAgentDevcontainer¶added 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.
typeWorkspaceAgentDevcontainerStatus¶added inv2.23.0
type WorkspaceAgentDevcontainerStatusstring
WorkspaceAgentDevcontainerStatus is the status of a devcontainer.
const (WorkspaceAgentDevcontainerStatusRunningWorkspaceAgentDevcontainerStatus = "running"WorkspaceAgentDevcontainerStatusStoppedWorkspaceAgentDevcontainerStatus = "stopped"WorkspaceAgentDevcontainerStatusStartingWorkspaceAgentDevcontainerStatus = "starting"WorkspaceAgentDevcontainerStatusErrorWorkspaceAgentDevcontainerStatus = "error")
WorkspaceAgentDevcontainerStatus enums.
typeWorkspaceAgentDevcontainersResponse¶added inv2.22.0
type WorkspaceAgentDevcontainersResponse struct {Devcontainers []WorkspaceAgentDevcontainer `json:"devcontainers"`}
WorkspaceAgentDevcontainersResponse is the response to the devcontainersrequest.
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.
typeWorkspaceAgentListContainersResponse¶added 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.
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"`}
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"`}
typeWorkspaceAgentPortShare¶added 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"`}
typeWorkspaceAgentPortShareLevel¶added inv2.9.0
type WorkspaceAgentPortShareLevelstring
func (WorkspaceAgentPortShareLevel)ValidMaxLevel¶added inv2.9.0
func (lWorkspaceAgentPortShareLevel) ValidMaxLevel()bool
func (WorkspaceAgentPortShareLevel)ValidPortShareLevel¶added inv2.9.0
func (lWorkspaceAgentPortShareLevel) ValidPortShareLevel()bool
typeWorkspaceAgentPortShareProtocol¶added inv2.9.0
type WorkspaceAgentPortShareProtocolstring
func (WorkspaceAgentPortShareProtocol)ValidPortProtocol¶added inv2.9.0
func (pWorkspaceAgentPortShareProtocol) ValidPortProtocol()bool
typeWorkspaceAgentPortShares¶added inv2.9.0
type WorkspaceAgentPortShares struct {Shares []WorkspaceAgentPortShare `json:"shares"`}
typeWorkspaceAgentScript¶added 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")
typeWorkspaceAppOpenIn¶added inv2.19.0
type WorkspaceAppOpenInstring
const (WorkspaceAppOpenInSlimWindowWorkspaceAppOpenIn = "slim-window"WorkspaceAppOpenInTabWorkspaceAppOpenIn = "tab")
typeWorkspaceAppSharingLevel¶
type WorkspaceAppSharingLevelstring
const (WorkspaceAppSharingLevelOwnerWorkspaceAppSharingLevel = "owner"WorkspaceAppSharingLevelAuthenticatedWorkspaceAppSharingLevel = "authenticated"WorkspaceAppSharingLevelPublicWorkspaceAppSharingLevel = "public")
typeWorkspaceAppStatus¶added 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"`}
typeWorkspaceAppStatusState¶added 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¶
WorkspaceBuildParameter represents a parameter specific for a workspace build.
typeWorkspaceBuildTimings¶added 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"`}
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¶
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"`}
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¶
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")
funcConvertWorkspaceStatus¶added 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}
Source Files¶
- apikey.go
- audit.go
- authorization.go
- chat.go
- client.go
- countries.go
- database.go
- deployment.go
- externalauth.go
- files.go
- gitsshkey.go
- groups.go
- idpsync.go
- inboxnotification.go
- insights.go
- licenses.go
- name.go
- notifications.go
- oauth2.go
- organizations.go
- pagination.go
- parameters.go
- presets.go
- provisionerdaemons.go
- rbacresources_gen.go
- rbacroles.go
- replicas.go
- richparameters.go
- roles.go
- serversentevents.go
- templates.go
- templatevariables.go
- templateversions.go
- time.go
- updatecheck.go
- users.go
- websocket.go
- workspaceagentportshare.go
- workspaceagents.go
- workspaceapps.go
- workspacebuilds.go
- workspacedisplaystatus.go
- workspaceproxy.go
- workspaces.go