{"modulePath":"cdr.dev/coder-cli","version":"v1.39.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package coder\n\nPackage coder provides simple APIs for integrating Go applications with Coder.\n\n## Constants\n\n```go\nconst MarketplaceExtensionPublicURL = \"https://extensions.coder.com/api\"\n```\nMarketplaceExtensionPublicURL is the URL of the coder.com public marketplace that serves open source Code OSS extensions.\n\n```go\nconst Me = \"me\"\n```\nMe is the user ID of the authenticated user.\n\n```go\nconst (\n\t// SkipTemplateOrg allows skipping checks on organizations.\n\tSkipTemplateOrg = \"SKIP_ORG\"\n)\n```\n\n```go\nconst (\n\t// TemplateScopeSite is the scope for a site wide policy template.\n\tTemplateScopeSite = \"site\"\n)\n```\n\n## Variables\n\n```go\nvar ErrAuthentication = xerrors.New(\"invalid authentication\")\n```\nErrAuthentication describes the error case in which the requester has invalid authentication.\n\n```go\nvar ErrNotFound = xerrors.New(\"resource not found\")\n```\nErrNotFound describes an error case in which the requested resource could not be found.\n\n```go\nvar ErrPermissions = xerrors.New(\"insufficient permissions\")\n```\nErrPermissions describes an error case in which the requester has insufficient permissions to access the requested resource.\n\n## Functions\n\n```go\nfunc String(s string) *string\n```\nString gives a string pointer.\n\n## Types\n\n```go\ntype APIError struct {\n\tErr APIErrorMsg `json:\"error\"`\n}\n```\nAPIError is the expected payload format for API errors.\n\n```go\ntype APIErrorMsg struct {\n\tMsg     string          `json:\"msg\"`\n\tCode    string          `json:\"code\"`\n\tDetails json.RawMessage `json:\"details\"`\n}\n```\nAPIErrorMsg contains the rich error information returned by API errors.\n\n```go\ntype APIToken struct {\n\tID          string    `json:\"id\"`\n\tName        string    `json:\"name\"`\n\tApplication bool      `json:\"application\"`\n\tUserID      string    `json:\"user_id\"`\n\tLastUsed    time.Time `json:\"last_used\"`\n}\n```\nAPIToken describes a Coder APIToken resource for use in API requests.\n\n```go\ntype AuthProviderType string\n```\nAuthProviderType is an enum of each valid auth provider.\n\n```go\nconst (\n\tAuthProviderBuiltIn AuthProviderType = \"built-in\"\n\tAuthProviderSAML    AuthProviderType = \"saml\"\n\tAuthProviderOIDC    AuthProviderType = \"oidc\"\n)\n```\nAuthProviderType enum.\n\n```go\ntype BuildLog struct {\n\tID          string `db:\"id\" json:\"id\"`\n\tWorkspaceID string `db:\"workspace_id\" json:\"workspace_id\"`\n\t// BuildID allows the frontend to separate the logs from the old build with the logs from the new.\n\tBuildID string       `db:\"build_id\" json:\"build_id\"`\n\tTime    time.Time    `db:\"time\" json:\"time\"`\n\tType    BuildLogType `db:\"type\" json:\"type\"`\n\tMsg     string       `db:\"msg\" json:\"msg\"`\n}\n```\nBuildLog defines a build log record for a Coder workspace.\n\n```go\ntype BuildLogFollowMsg struct {\n\tBuildLog\n\tErr error\n}\n```\nBuildLogFollowMsg wraps the base BuildLog and adds a field for collecting errors that may occur when follow or parsing.\n\n```go\ntype BuildLogType string\n```\nBuildLogType describes the type of an event.\n\n```go\nconst (\n\t// BuildLogTypeStart signals that a new build log has begun.\n\tBuildLogTypeStart BuildLogType = \"start\"\n\t// BuildLogTypeStage is a stage-level event for a workspace.\n\t// It can be thought of as a major step in the workspace's\n\t// lifecycle.\n\tBuildLogTypeStage BuildLogType = \"stage\"\n\t// BuildLogTypeError describes an error that has occurred.\n\tBuildLogTypeError BuildLogType = \"error\"\n\t// BuildLogTypeSubstage describes a subevent that occurs as\n\t// part of a stage. This can be the output from a user's\n\t// personalization script, or a long running command.\n\tBuildLogTypeSubstage BuildLogType = \"substage\"\n\t// BuildLogTypeDone signals that the build has completed.\n\tBuildLogTypeDone BuildLogType = \"done\"\n)\n```\n\n```go\ntype Client interface {\n\t// PushActivity pushes CLI activity to Coder.\n\tPushActivity(ctx context.Context, source, workspaceID string) error\n\n\t// Me gets the details of the authenticated user.\n\tMe(ctx context.Context) (*User, error)\n\n\t// UserByID get the details of a user by their id.\n\tUserByID(ctx context.Context, id string) (*User, error)\n\n\t// SSHKey gets the current SSH kepair of the authenticated user.\n\tSSHKey(ctx context.Context) (*SSHKey, error)\n\n\t// Users gets the list of user accounts.\n\tUsers(ctx context.Context) ([]User, error)\n\n\t// UserByEmail gets a user by email.\n\tUserByEmail(ctx context.Context, email string) (*User, error)\n\n\t// UpdateUser applyes the partial update to the given user.\n\tUpdateUser(ctx context.Context, userID string, req UpdateUserReq) error\n\n\t// UpdateUXState applies a partial update of the user's UX State.\n\tUpdateUXState(ctx context.Context, userID string, uxsPartial map[string]interface{}) error\n\n\t// CreateUser creates a new user account.\n\tCreateUser(ctx context.Context, req CreateUserReq) error\n\n\t// DeleteUser deletes a user account.\n\tDeleteUser(ctx context.Context, userID string) error\n\n\t// SiteConfigAuth fetches the sitewide authentication configuration.\n\tSiteConfigAuth(ctx context.Context) (*ConfigAuth, error)\n\n\t// PutSiteConfigAuth sets the sitewide authentication configuration.\n\tPutSiteConfigAuth(ctx context.Context, req ConfigAuth) error\n\n\t// SiteConfigOAuth fetches the sitewide git provider OAuth configuration.\n\tSiteConfigOAuth(ctx context.Context) (*ConfigOAuth, error)\n\n\t// PutSiteConfigOAuth sets the sitewide git provider OAuth configuration.\n\tPutSiteConfigOAuth(ctx context.Context, req ConfigOAuth) error\n\n\t// SiteSetupModeEnabled fetches the current setup_mode state of a Coder deployment.\n\tSiteSetupModeEnabled(ctx context.Context) (bool, error)\n\n\t// SiteConfigExtensionMarketplace fetches the extension marketplace configuration.\n\tSiteConfigExtensionMarketplace(ctx context.Context) (*ConfigExtensionMarketplace, error)\n\n\t// PutSiteConfigExtensionMarketplace sets the extension marketplace configuration.\n\tPutSiteConfigExtensionMarketplace(ctx context.Context, req ConfigExtensionMarketplace) error\n\n\t// SiteConfigWorkspaces fetches the workspace configuration.\n\tSiteConfigWorkspaces(ctx context.Context) (*ConfigWorkspaces, error)\n\n\t// DeleteDevURL deletes the specified devurl.\n\tDeleteDevURL(ctx context.Context, workspaceID, urlID string) error\n\n\t// CreateDevURL inserts a new devurl for the authenticated user.\n\tCreateDevURL(ctx context.Context, workspaceID string, req CreateDevURLReq) error\n\n\t// DevURLs fetches the Dev URLs for a given workspace.\n\tDevURLs(ctx context.Context, workspaceID string) ([]DevURL, error)\n\n\t// PutDevURL updates an existing devurl for the authenticated user.\n\tPutDevURL(ctx context.Context, workspaceID, urlID string, req PutDevURLReq) error\n\n\t// CreateWorkspace sends a request to create a workspace.\n\tCreateWorkspace(ctx context.Context, req CreateWorkspaceRequest) (*Workspace, error)\n\n\t// ParseTemplate parses a template config. It support both remote repositories and local files.\n\t// If a local file is specified then all other values in the request are ignored.\n\tParseTemplate(ctx context.Context, req ParseTemplateRequest) (*TemplateVersion, error)\n\n\t// CreateWorkspaceFromRepo sends a request to create a workspace from a repository.\n\tCreateWorkspaceFromRepo(ctx context.Context, orgID string, req TemplateVersion) (*Workspace, error)\n\n\t// Workspaces lists workspaces returned by the given filter.\n\tWorkspaces(ctx context.Context) ([]Workspace, error)\n\n\t// UserWorkspacesByOrganization gets the list of workspaces owned by the given user.\n\tUserWorkspacesByOrganization(ctx context.Context, userID, orgID string) ([]Workspace, error)\n\n\t// DeleteWorkspace deletes the workspace.\n\tDeleteWorkspace(ctx context.Context, workspaceID string) error\n\n\t// StopWorkspace stops the workspace.\n\tStopWorkspace(ctx context.Context, workspaceID string) error\n\n\t// RebuildWorkspace requests that the given workspaceID is rebuilt with no changes to its specification.\n\tRebuildWorkspace(ctx context.Context, workspaceID string) error\n\n\t// EditWorkspace modifies the workspace specification and initiates a rebuild.\n\tEditWorkspace(ctx context.Context, workspaceID string, req UpdateWorkspaceReq) error\n\n\t// DialWsep dials a workspace's command execution interface\n\t// See https://github.com/cdr/wsep for details.\n\tDialWsep(ctx context.Context, baseURL *url.URL, workspaceID string) (*websocket.Conn, error)\n\n\t// DialExecutor gives a remote execution interface for performing commands inside a workspace.\n\tDialExecutor(ctx context.Context, baseURL *url.URL, workspaceID string) (wsep.Execer, error)\n\n\t// DialIDEStatus opens a websocket connection for cpu load metrics on the workspace.\n\tDialIDEStatus(ctx context.Context, baseURL *url.URL, workspaceID string) (*websocket.Conn, error)\n\n\t// DialWorkspaceBuildLog opens a websocket connection for the workspace build log messages.\n\tDialWorkspaceBuildLog(ctx context.Context, workspaceID string) (*websocket.Conn, error)\n\n\t// FollowWorkspaceBuildLog trails the build log of a Coder workspace.\n\tFollowWorkspaceBuildLog(ctx context.Context, workspaceID string) (\u003c-chan BuildLogFollowMsg, error)\n\n\t// DialWorkspaceStats opens a websocket connection for workspace stats.\n\tDialWorkspaceStats(ctx context.Context, workspaceID string) (*websocket.Conn, error)\n\n\t// DialResourceLoad opens a websocket connection for cpu load metrics on the workspace.\n\tDialResourceLoad(ctx context.Context, workspaceID string) (*websocket.Conn, error)\n\n\t// WaitForWorkspaceReady will watch the build log and return when done.\n\tWaitForWorkspaceReady(ctx context.Context, workspaceID string) error\n\n\t// WorkspaceByID get the details of a workspace by its id.\n\tWorkspaceByID(ctx context.Context, id string) (*Workspace, error)\n\n\t// WorkspacesByWorkspaceProvider returns workspaces that belong to a particular workspace provider.\n\tWorkspacesByWorkspaceProvider(ctx context.Context, wpID string) ([]Workspace, error)\n\n\t// ImportImage creates a new image and optionally a new registry.\n\tImportImage(ctx context.Context, req ImportImageReq) (*Image, error)\n\n\t// ImageByID returns an image entity, fetched by its ID.\n\tImageByID(ctx context.Context, id string) (*Image, error)\n\n\t// OrganizationImages returns all of the images imported for orgID.\n\tOrganizationImages(ctx context.Context, orgID string) ([]Image, error)\n\n\t// UpdateImage applies a partial update to an image resource.\n\tUpdateImage(ctx context.Context, imageID string, req UpdateImageReq) error\n\n\t// UpdateImageTags refreshes the latest digests for all tags of the image.\n\tUpdateImageTags(ctx context.Context, imageID string) error\n\n\t// Organizations gets all Organizations.\n\tOrganizations(ctx context.Context) ([]Organization, error)\n\n\t// OrganizationByID get the Organization by its ID.\n\tOrganizationByID(ctx context.Context, orgID string) (*Organization, error)\n\n\t// OrganizationMembers get all members of the given organization.\n\tOrganizationMembers(ctx context.Context, orgID string) ([]OrganizationUser, error)\n\n\t// UpdateOrganization applys a partial update of an Organization resource.\n\tUpdateOrganization(ctx context.Context, orgID string, req UpdateOrganizationReq) error\n\n\t// CreateOrganization creates a new Organization in Coder.\n\tCreateOrganization(ctx context.Context, req CreateOrganizationReq) error\n\n\t// DeleteOrganization deletes an organization.\n\tDeleteOrganization(ctx context.Context, orgID string) error\n\n\t// Registries fetches all registries in an organization.\n\tRegistries(ctx context.Context, orgID string) ([]Registry, error)\n\n\t// RegistryByID fetches a registry resource by its ID.\n\tRegistryByID(ctx context.Context, registryID string) (*Registry, error)\n\n\t// UpdateRegistry applies a partial update to a registry resource.\n\tUpdateRegistry(ctx context.Context, registryID string, req UpdateRegistryReq) error\n\n\t// DeleteRegistry deletes a registry resource by its ID.\n\tDeleteRegistry(ctx context.Context, registryID string) error\n\n\t// CreateImageTag creates a new image tag resource.\n\tCreateImageTag(ctx context.Context, imageID string, req CreateImageTagReq) (*ImageTag, error)\n\n\t// DeleteImageTag deletes an image tag resource.\n\tDeleteImageTag(ctx context.Context, imageID, tag string) error\n\n\t// ImageTags fetch all image tags.\n\tImageTags(ctx context.Context, imageID string) ([]ImageTag, error)\n\n\t// ImageTagByID fetch an image tag by ID.\n\tImageTagByID(ctx context.Context, imageID, tagID string) (*ImageTag, error)\n\n\t// CreateAPIToken creates a new APIToken for making authenticated requests to Coder.\n\tCreateAPIToken(ctx context.Context, userID string, req CreateAPITokenReq) (string, error)\n\n\t// APITokens fetches all APITokens owned by the given user.\n\tAPITokens(ctx context.Context, userID string) ([]APIToken, error)\n\n\t// APITokenByID fetches the metadata for a given APIToken.\n\tAPITokenByID(ctx context.Context, userID, tokenID string) (*APIToken, error)\n\n\t// DeleteAPIToken deletes an APIToken.\n\tDeleteAPIToken(ctx context.Context, userID, tokenID string) error\n\n\t// RegenerateAPIToken regenerates the given APIToken and returns the new value.\n\tRegenerateAPIToken(ctx context.Context, userID, tokenID string) (string, error)\n\n\t// APIVersion parses the coder-version http header from an authenticated request.\n\tAPIVersion(ctx context.Context) (string, error)\n\n\t// WorkspaceProviderByID fetches a workspace provider entity by its unique ID.\n\tWorkspaceProviderByID(ctx context.Context, id string) (*KubernetesProvider, error)\n\n\t// WorkspaceProviders fetches all workspace providers known to the Coder control plane.\n\tWorkspaceProviders(ctx context.Context) (*WorkspaceProviders, error)\n\n\t// CreateWorkspaceProvider creates a new WorkspaceProvider entity.\n\tCreateWorkspaceProvider(ctx context.Context, req CreateWorkspaceProviderReq) (*CreateWorkspaceProviderRes, error)\n\n\t// DeleteWorkspaceProviderByID deletes a workspace provider entity from the Coder control plane.\n\tDeleteWorkspaceProviderByID(ctx context.Context, id string) error\n\n\t// Token returns the API Token used to authenticate.\n\tToken() string\n\n\t// BaseURL returns the BaseURL configured for this Client.\n\tBaseURL() url.URL\n\n\t// CordonWorkspaceProvider prevents the provider from having any more workspaces placed on it.\n\tCordonWorkspaceProvider(ctx context.Context, id, reason string) error\n\n\t// UnCordonWorkspaceProvider changes an existing cordoned providers status to 'Ready';\n\t// allowing it to continue creating new workspaces and provisioning resources for them.\n\tUnCordonWorkspaceProvider(ctx context.Context, id string) error\n\n\t// RenameWorkspaceProvider changes an existing providers name field.\n\tRenameWorkspaceProvider(ctx context.Context, id string, name string) error\n\n\t// SetPolicyTemplate sets the workspace policy template\n\tSetPolicyTemplate(ctx context.Context, templateID string, templateScope TemplateScope, dryRun bool) (*SetPolicyTemplateResponse, error)\n\n\t// Satellites fetches all satellitess known to the Coder control plane.\n\tSatellites(ctx context.Context) ([]Satellite, error)\n\n\t// CreateSatellite creates a new satellite entity.\n\tCreateSatellite(ctx context.Context, req CreateSatelliteReq) (*Satellite, error)\n\n\t// DeleteSatelliteByID deletes a satellite entity from the Coder control plane.\n\tDeleteSatelliteByID(ctx context.Context, id string) error\n\n\t// UpdateLastConnectionAt updates the last connection at attribute of a workspace.\n\tUpdateLastConnectionAt(ctx context.Context, workspaceID string) error\n\n\t// ICEServers fetches the list of ICE servers advertised by the deployment.\n\tICEServers(ctx context.Context) ([]webrtc.ICEServer, error)\n}\n```\nClient wraps the Coder HTTP API. This is an interface to allow for mocking of coder-sdk client usage.\n\n```go\ntype ClientOptions struct {\n\t// BaseURL is the root URL of the Coder installation (required).\n\tBaseURL *url.URL\n\n\t// Client is the http.Client to use for requests (optional).\n\t//\n\t// If omitted, the http.DefaultClient will be used.\n\tHTTPClient *http.Client\n\n\t// Token is the API Token used to authenticate (optional).\n\t//\n\t// If Token is provided, the DefaultClient will use it to authenticate.\n\t// If it is not provided, the client requires another type of\n\t// credential, such as an Email/Password pair.\n\tToken string\n\n\t// Email used to authenticate with Coder.\n\t//\n\t// If you supply an Email and Password pair, NewClient will exchange\n\t// these credentials for a Token during initialization.  This is only\n\t// applicable for the built-in authentication provider. The client will\n\t// not retain these credentials in memory after NewClient returns.\n\tEmail string\n\n\t// Password used to authenticate with Coder.\n\t//\n\t// If you supply an Email and Password pair, NewClient will exchange\n\t// these credentials for a Token during initialization.  This is only\n\t// applicable for the built-in authentication provider. The client will\n\t// not retain these credentials in memory after NewClient returns.\n\tPassword string\n}\n```\nClientOptions contains options for the Coder SDK Client.\n\n```go\ntype ConfigAuth struct {\n\tProviderType *AuthProviderType `json:\"provider_type\"`\n\tOIDC         *ConfigOIDC       `json:\"oidc\"`\n\tSAML         *ConfigSAML       `json:\"saml\"`\n}\n```\nConfigAuth describes the authentication configuration for a Coder deployment.\n\n```go\ntype ConfigDevURLAccess struct {\n\tPrivate bool `json:\"private\"`\n\tOrg     bool `json:\"org\"`\n\tAuthed  bool `json:\"authed\"`\n\tPublic  bool `json:\"public\"`\n}\n```\n\n```go\ntype ConfigDormancy struct {\n\t// UserDormancyThresholdDays is not currently updatable.\n\t// UserDormancyThresholdDays int `json:\"user_dormancy_threshold_days\"`\n\tUserDeletionThresholdDays int `json:\"user_deletion_threshold_days\"`\n}\n```\n\n```go\ntype ConfigExtensionMarketplace struct {\n\tURL  string                   `json:\"url\"`\n\tType ExtensionMarketplaceType `json:\"type\"`\n}\n```\nConfigExtensionMarketplace describes the sitewide extension marketplace configuration.\n\n```go\ntype ConfigOAuth struct {\n\tBitbucketServer ConfigOAuthBitbucketServer `json:\"bitbucket_server\"`\n\tGitHub          ConfigOAuthGitHub          `json:\"github\"`\n\tGitLab          ConfigOAuthGitLab          `json:\"gitlab\"`\n}\n```\nConfigOAuth describes the aggregate git integration configuration for a Coder deployment.\n\n```go\ntype ConfigOAuthBitbucketServer struct {\n\tBaseURL string `json:\"base_url\" diff:\"oauth.bitbucket_server.base_url\"`\n}\n```\nConfigOAuthBitbucketServer describes the Bitbucket integration configuration for a Coder deployment.\n\n```go\ntype ConfigOAuthGitHub struct {\n\tBaseURL      string `json:\"base_url\"`\n\tClientID     string `json:\"client_id\"`\n\tClientSecret string `json:\"client_secret\"`\n}\n```\nConfigOAuthGitHub describes the Github integration configuration for a Coder deployment.\n\n```go\ntype ConfigOAuthGitLab struct {\n\tBaseURL      string `json:\"base_url\"`\n\tClientID     string `json:\"client_id\" `\n\tClientSecret string `json:\"client_secret\"`\n}\n```\nConfigOAuthGitLab describes the GitLab integration configuration for a Coder deployment.\n\n```go\ntype ConfigOIDC struct {\n\tClientID     *string `json:\"client_id\"`\n\tClientSecret *string `json:\"client_secret\"`\n\tIssuer       *string `json:\"issuer\"`\n}\n```\nConfigOIDC describes the OIDC configuration for single-signon support in Coder.\n\n```go\ntype ConfigSAML struct {\n\tIdentityProviderMetadataURL *string `json:\"idp_metadata_url\"`\n\tSignatureAlgorithm          *string `json:\"signature_algorithm\"`\n\tNameIDFormat                *string `json:\"name_id_format\"`\n\tPrivateKey                  *string `json:\"private_key\"`\n\tPublicKeyCertificate        *string `json:\"public_key_certificate\"`\n}\n```\nConfigSAML describes the SAML configuration values.\n\n```go\ntype ConfigSSHSettings struct {\n\tKeygenAlgorithm string `json:\"keygen_algorithm\"`\n}\n```\nConfigSSHSettings is the site configuration for SSH.\n\n```go\ntype ConfigWorkspaces struct {\n\tGPUVendor              string `json:\"gpu_vendor\"`\n\tEnableContainerVMs     bool   `json:\"enable_container_vms\"`\n\tEnableWorkspacesAsCode bool   `json:\"enable_workspaces_as_code\"`\n}\n```\nConfigWorkspaces is the site configuration for workspace attributes.\n\n```go\ntype CordoneWorkspaceProviderReq struct {\n\tReason string `json:\"reason\"`\n}\n```\nCordoneWorkspaceProviderReq defines the request parameters for creating a new workspace provider entity.\n\n```go\ntype CreateAPITokenReq struct {\n\tName string `json:\"name\"`\n}\n```\nCreateAPITokenReq defines the paramemters for creating a new APIToken.\n\n```go\ntype CreateDevURLReq struct {\n\tWorkspaceID string `json:\"workspace_id\"`\n\tPort        int    `json:\"port\"`\n\tAccess      string `json:\"access\"`\n\tName        string `json:\"name\"`\n\tScheme      string `json:\"scheme\"`\n}\n```\nCreateDevURLReq defines the request parameters for creating a new DevURL.\n\n```go\ntype CreateImageTagReq struct {\n\tTag     string `json:\"tag\"`\n\tDefault bool   `json:\"default\"`\n}\n```\nCreateImageTagReq defines the request parameters for creating a new image tag.\n\n```go\ntype CreateOrganizationReq struct {\n\tName                   string   `json:\"name\"`\n\tDescription            string   `json:\"description\"`\n\tDefault                bool     `json:\"default\"`\n\tResourceNamespace      string   `json:\"resource_namespace\"`\n\tAutoOffThreshold       Duration `json:\"auto_off_threshold\"`\n\tCPUProvisioningRate    float32  `json:\"cpu_provisioning_rate\"`\n\tMemoryProvisioningRate float32  `json:\"memory_provisioning_rate\"`\n}\n```\nCreateOrganizationReq describes the request parameters to create a new Organization.\n\n```go\ntype CreateSatelliteReq struct {\n\tName      string `json:\"name\"`\n\tPublicKey string `json:\"public_key\"`\n}\n```\nCreateSatelliteReq defines the request parameters for creating a new satellite entity.\n\n```go\ntype CreateUserReq struct {\n\tName              string    `json:\"name\"`\n\tUsername          string    `json:\"username\"`\n\tEmail             string    `json:\"email\"`\n\tPassword          string    `json:\"password\"`\n\tTemporaryPassword bool      `json:\"temporary_password\"`\n\tLoginType         LoginType `json:\"login_type\"`\n\tOrganizationsIDs  []string  `json:\"organizations\"`\n}\n```\nCreateUserReq defines the request parameters for creating a new user resource.\n\n```go\ntype CreateWorkspaceProviderReq struct {\n\tName           string                `json:\"name\"`\n\tType           WorkspaceProviderType `json:\"type\"`\n\tHostname       string                `json:\"hostname\"`\n\tClusterAddress string                `json:\"cluster_address\"`\n}\n```\nCreateWorkspaceProviderReq defines the request parameters for creating a new workspace provider entity.\n\n```go\ntype CreateWorkspaceProviderRes struct {\n\tID            string                  `json:\"id\" table:\"ID\"`\n\tName          string                  `json:\"name\" table:\"Name\"`\n\tStatus        WorkspaceProviderStatus `json:\"status\" table:\"Status\"`\n\tEnvproxyToken string                  `json:\"envproxy_token\" table:\"Envproxy Token\"`\n}\n```\nCreateWorkspaceProviderRes defines the response from creating a new workspace provider entity.\n\n```go\ntype CreateWorkspaceRequest struct {\n\tName            string  `json:\"name\"`\n\tImageID         string  `json:\"image_id\"`\n\tOrgID           string  `json:\"org_id\"`\n\tImageTag        string  `json:\"image_tag\"`\n\tCPUCores        float32 `json:\"cpu_cores\"`\n\tMemoryGB        float32 `json:\"memory_gb\"`\n\tDiskGB          int     `json:\"disk_gb\"`\n\tGPUs            int     `json:\"gpus\"`\n\tUseContainerVM  bool    `json:\"use_container_vm\"`\n\tResourcePoolID  string  `json:\"resource_pool_id\"`\n\tNamespace       string  `json:\"namespace\"`\n\tEnableAutoStart bool    `json:\"autostart_enabled\"`\n\n\t// ForUserID is an optional param to create a workspace for another user\n\t// other than the requester. This only works for admins and site managers.\n\tForUserID string `json:\"for_user_id,omitempty\"`\n\n\t// TemplateID comes from the parse template route on cemanager.\n\tTemplateID string `json:\"template_id,omitempty\"`\n}\n```\nCreateWorkspaceRequest is used to configure a new workspace.\n\n```go\ntype DefaultClient struct {\n\t// contains filtered or unexported fields\n}\n```\nDefaultClient is the default implementation of the coder.Client interface.\n\nThe empty value is meaningless and the fields are unexported; use NewClient to create an instance.\n\n```go\nfunc NewClient(opts ClientOptions) (*DefaultClient, error)\n```\nNewClient creates a new default Coder SDK client.\n\n```go\nfunc (c *DefaultClient) APITokenByID(ctx context.Context, userID, tokenID string) (*APIToken, error)\n```\nAPITokenByID fetches the metadata for a given APIToken.\n\n```go\nfunc (c *DefaultClient) APITokens(ctx context.Context, userID string) ([]APIToken, error)\n```\nAPITokens fetches all APITokens owned by the given user.\n\n```go\nfunc (c *DefaultClient) APIVersion(ctx context.Context) (string, error)\n```\nAPIVersion parses the coder-version http header from an authenticated request.\n\n```go\nfunc (c *DefaultClient) BaseURL() url.URL\n```\nBaseURL returns the BaseURL configured for this Client.\n\n```go\nfunc (c *DefaultClient) CordonWorkspaceProvider(ctx context.Context, id, reason string) error\n```\nCordonWorkspaceProvider prevents the provider from having any more workspaces placed on it.\n\n```go\nfunc (c *DefaultClient) CreateAPIToken(ctx context.Context, userID string, req CreateAPITokenReq) (token string, _ error)\n```\nCreateAPIToken creates a new APIToken for making authenticated requests to Coder.\n\n```go\nfunc (c *DefaultClient) CreateDevURL(ctx context.Context, workspaceID string, req CreateDevURLReq) error\n```\nCreateDevURL inserts a new dev URL for the authenticated user.\n\n```go\nfunc (c *DefaultClient) CreateImageTag(ctx context.Context, imageID string, req CreateImageTagReq) (*ImageTag, error)\n```\nCreateImageTag creates a new image tag resource.\n\n```go\nfunc (c *DefaultClient) CreateOrganization(ctx context.Context, req CreateOrganizationReq) error\n```\nCreateOrganization creates a new Organization in Coder.\n\n```go\nfunc (c *DefaultClient) CreateSatellite(ctx context.Context, req CreateSatelliteReq) (*Satellite, error)\n```\nCreateSatellite creates a new satellite entity.\n\n```go\nfunc (c *DefaultClient) CreateUser(ctx context.Context, req CreateUserReq) error\n```\nCreateUser creates a new user account.\n\n```go\nfunc (c *DefaultClient) CreateWorkspace(ctx context.Context, req CreateWorkspaceRequest) (*Workspace, error)\n```\nCreateWorkspace sends a request to create a workspace.\n\n```go\nfunc (c *DefaultClient) CreateWorkspaceFromRepo(ctx context.Context, orgID string, req TemplateVersion) (*Workspace, error)\n```\nCreateWorkspaceFromRepo sends a request to create a workspace from a repository.\n\n```go\nfunc (c *DefaultClient) CreateWorkspaceProvider(ctx context.Context, req CreateWorkspaceProviderReq) (*CreateWorkspaceProviderRes, error)\n```\nCreateWorkspaceProvider creates a new WorkspaceProvider entity.\n\n```go\nfunc (c *DefaultClient) DeleteAPIToken(ctx context.Context, userID, tokenID string) error\n```\nDeleteAPIToken deletes an APIToken.\n\n```go\nfunc (c *DefaultClient) DeleteDevURL(ctx context.Context, workspaceID, urlID string) error\n```\nDeleteDevURL deletes the specified devurl.\n\n```go\nfunc (c *DefaultClient) DeleteImageTag(ctx context.Context, imageID, tag string) error\n```\nDeleteImageTag deletes an image tag resource.\n\n```go\nfunc (c *DefaultClient) DeleteOrganization(ctx context.Context, orgID string) error\n```\nDeleteOrganization deletes an organization.\n\n```go\nfunc (c *DefaultClient) DeleteRegistry(ctx context.Context, registryID string) error\n```\nDeleteRegistry deletes a registry resource by its ID.\n\n```go\nfunc (c *DefaultClient) DeleteSatelliteByID(ctx context.Context, id string) error\n```\nDeleteSatelliteByID deletes a satellite entity from the Coder control plane.\n\n```go\nfunc (c *DefaultClient) DeleteUser(ctx context.Context, userID string) error\n```\nDeleteUser deletes a user account.\n\n```go\nfunc (c *DefaultClient) DeleteWorkspace(ctx context.Context, workspaceID string) error\n```\nDeleteWorkspace deletes the workspace.\n\n```go\nfunc (c *DefaultClient) DeleteWorkspaceProviderByID(ctx context.Context, id string) error\n```\nDeleteWorkspaceProviderByID deletes a workspace provider entity from the Coder control plane.\n\n```go\nfunc (c *DefaultClient) DevURLs(ctx context.Context, workspaceID string) ([]DevURL, error)\n```\nDevURLs fetches the Dev URLs for a given workspace.\n\n```go\nfunc (c *DefaultClient) DialExecutor(ctx context.Context, baseURL *url.URL, workspaceID string) (wsep.Execer, error)\n```\nDialExecutor gives a remote execution interface for performing commands inside a workspace.\n\n```go\nfunc (c *DefaultClient) DialIDEStatus(ctx context.Context, baseURL *url.URL, workspaceID string) (*websocket.Conn, error)\n```\nDialIDEStatus opens a websocket connection for cpu load metrics on the workspace.\n\n```go\nfunc (c *DefaultClient) DialResourceLoad(ctx context.Context, workspaceID string) (*websocket.Conn, error)\n```\nDialResourceLoad opens a websocket connection for cpu load metrics on the workspace.\n\n```go\nfunc (c *DefaultClient) DialWorkspaceBuildLog(ctx context.Context, workspaceID string) (*websocket.Conn, error)\n```\nDialWorkspaceBuildLog opens a websocket connection for the workspace build log messages.\n\n```go\nfunc (c *DefaultClient) DialWorkspaceStats(ctx context.Context, workspaceID string) (*websocket.Conn, error)\n```\nDialWorkspaceStats opens a websocket connection for workspace stats.\n\n```go\nfunc (c *DefaultClient) DialWsep(ctx context.Context, baseURL *url.URL, workspaceID string) (*websocket.Conn, error)\n```\nDialWsep dials a workspace's command execution interface See [https://github.com/cdr/wsep](https://github.com/cdr/wsep) for details.\n\n```go\nfunc (c *DefaultClient) EditWorkspace(ctx context.Context, workspaceID string, req UpdateWorkspaceReq) error\n```\nEditWorkspace modifies the workspace specification and initiates a rebuild.\n\n```go\nfunc (c *DefaultClient) FollowWorkspaceBuildLog(ctx context.Context, workspaceID string) (\u003c-chan BuildLogFollowMsg, error)\n```\nFollowWorkspaceBuildLog trails the build log of a Coder workspace.\n\n```go\nfunc (c *DefaultClient) ICEServers(ctx context.Context) ([]webrtc.ICEServer, error)\n```\nICEServers fetches the list of ICE servers advertised by the deployment.\n\n```go\nfunc (c *DefaultClient) ImageByID(ctx context.Context, id string) (*Image, error)\n```\nImageByID returns an image entity, fetched by its ID.\n\n```go\nfunc (c *DefaultClient) ImageTagByID(ctx context.Context, imageID, tagID string) (*ImageTag, error)\n```\nImageTagByID fetch an image tag by ID.\n\n```go\nfunc (c *DefaultClient) ImageTags(ctx context.Context, imageID string) ([]ImageTag, error)\n```\nImageTags fetch all image tags.\n\n```go\nfunc (c *DefaultClient) ImportImage(ctx context.Context, req ImportImageReq) (*Image, error)\n```\nImportImage creates a new image and optionally a new registry.\n\n```go\nfunc (c *DefaultClient) Me(ctx context.Context) (*User, error)\n```\nMe gets the details of the authenticated user.\n\n```go\nfunc (c *DefaultClient) OrganizationByID(ctx context.Context, orgID string) (*Organization, error)\n```\nOrganizationByID get the Organization by its ID.\n\n```go\nfunc (c *DefaultClient) OrganizationImages(ctx context.Context, orgID string) ([]Image, error)\n```\nOrganizationImages returns all of the images imported for orgID.\n\n```go\nfunc (c *DefaultClient) OrganizationMembers(ctx context.Context, orgID string) ([]OrganizationUser, error)\n```\nOrganizationMembers get all members of the given organization.\n\n```go\nfunc (c *DefaultClient) Organizations(ctx context.Context) ([]Organization, error)\n```\nOrganizations gets all Organizations.\n\n```go\nfunc (c *DefaultClient) ParseTemplate(ctx context.Context, req ParseTemplateRequest) (*TemplateVersion, error)\n```\nParseTemplate parses a template config. It support both remote repositories and local files. If a local file is specified then all other values in the request are ignored.\n\n```go\nfunc (c *DefaultClient) PushActivity(ctx context.Context, source, workspaceID string) error\n```\nPushActivity pushes CLI activity to Coder.\n\n```go\nfunc (c *DefaultClient) PutDevURL(ctx context.Context, workspaceID, urlID string, req PutDevURLReq) error\n```\nPutDevURL updates an existing devurl for the authenticated user.\n\n```go\nfunc (c *DefaultClient) PutSiteConfigAuth(ctx context.Context, req ConfigAuth) error\n```\nPutSiteConfigAuth sets the sitewide authentication configuration.\n\n```go\nfunc (c *DefaultClient) PutSiteConfigDevURLAccess(ctx context.Context, req ConfigDevURLAccess) error\n```\nPutSiteConfigDevURLAccess sets the DevURL access configuration.\n\n```go\nfunc (c *DefaultClient) PutSiteConfigDormancy(ctx context.Context, req ConfigDormancy) error\n```\nPutSiteConfigDormancy sets the dormancy configuration.\n\n```go\nfunc (c *DefaultClient) PutSiteConfigExtensionMarketplace(ctx context.Context, req ConfigExtensionMarketplace) error\n```\nPutSiteConfigExtensionMarketplace sets the extension marketplace configuration.\n\n```go\nfunc (c *DefaultClient) PutSiteConfigOAuth(ctx context.Context, req ConfigOAuth) error\n```\nPutSiteConfigOAuth sets the sitewide git provider OAuth configuration.\n\n```go\nfunc (c *DefaultClient) PutSiteConfigSSHSettings(ctx context.Context, req ConfigSSHSettings) error\n```\nPutSiteConfigSSHSettings sets the SSH configuration.\n\n```go\nfunc (c *DefaultClient) PutSiteConfigWorkspaces(ctx context.Context, req ConfigWorkspaces) error\n```\nPutSiteConfigWorkspaces sets the workspace configuration.\n\n```go\nfunc (c *DefaultClient) RebuildWorkspace(ctx context.Context, workspaceID string) error\n```\nRebuildWorkspace requests that the given workspaceID is rebuilt with no changes to its specification.\n\n```go\nfunc (c *DefaultClient) RegenerateAPIToken(ctx context.Context, userID, tokenID string) (token string, _ error)\n```\nRegenerateAPIToken regenerates the given APIToken and returns the new value.\n\n```go\nfunc (c *DefaultClient) Registries(ctx context.Context, orgID string) ([]Registry, error)\n```\nRegistries fetches all registries in an organization.\n\n```go\nfunc (c *DefaultClient) RegistryByID(ctx context.Context, registryID string) (*Registry, error)\n```\nRegistryByID fetches a registry resource by its ID.\n\n```go\nfunc (c *DefaultClient) RenameWorkspaceProvider(ctx context.Context, id string, name string) error\n```\nRenameWorkspaceProvider changes an existing cordoned providers name field.\n\n```go\nfunc (c *DefaultClient) SSHKey(ctx context.Context) (*SSHKey, error)\n```\nSSHKey gets the current SSH kepair of the authenticated user.\n\n```go\nfunc (c *DefaultClient) Satellites(ctx context.Context) ([]Satellite, error)\n```\nSatellites fetches all satellitess known to the Coder control plane.\n\n```go\nfunc (c *DefaultClient) SetPolicyTemplate(ctx context.Context, templateID string, templateScope TemplateScope, dryRun bool) (*SetPolicyTemplateResponse, error)\n```\n\n```go\nfunc (c *DefaultClient) SiteConfigAuth(ctx context.Context) (*ConfigAuth, error)\n```\nSiteConfigAuth fetches the sitewide authentication configuration.\n\n```go\nfunc (c *DefaultClient) SiteConfigDevURLAccess(ctx context.Context) (*ConfigDevURLAccess, error)\n```\nSiteConfigDevURLAccess fetches the DevURL access configuration.\n\n```go\nfunc (c *DefaultClient) SiteConfigDormancy(ctx context.Context) (*ConfigDormancy, error)\n```\nSiteConfigDormancy fetches the dormancy configuration.\n\n```go\nfunc (c *DefaultClient) SiteConfigExtensionMarketplace(ctx context.Context) (*ConfigExtensionMarketplace, error)\n```\nSiteConfigExtensionMarketplace fetches the extension marketplace configuration.\n\n```go\nfunc (c *DefaultClient) SiteConfigOAuth(ctx context.Context) (*ConfigOAuth, error)\n```\nSiteConfigOAuth fetches the sitewide git provider OAuth configuration.\n\n```go\nfunc (c *DefaultClient) SiteConfigSSHSettings(ctx context.Context) (*ConfigSSHSettings, error)\n```\nSiteConfigSSHSettings fetches the SSH configuration.\n\n```go\nfunc (c *DefaultClient) SiteConfigWorkspaces(ctx context.Context) (*ConfigWorkspaces, error)\n```\nSiteConfigWorkspaces fetches the workspace configuration.\n\n```go\nfunc (c *DefaultClient) SiteSetupModeEnabled(ctx context.Context) (bool, error)\n```\nSiteSetupModeEnabled fetches the current setup\\_mode state of a Coder deployment.\n\n```go\nfunc (c *DefaultClient) StopWorkspace(ctx context.Context, workspaceID string) error\n```\nStopWorkspace stops the workspace.\n\n```go\nfunc (c *DefaultClient) Token() string\n```\nToken returns the API Token used to authenticate.\n\n```go\nfunc (c *DefaultClient) UnCordonWorkspaceProvider(ctx context.Context, id string) error\n```\nUnCordonWorkspaceProvider changes an existing cordoned providers status to 'Ready'; allowing it to continue creating new workspaces and provisioning resources for them.\n\n```go\nfunc (c *DefaultClient) UpdateImage(ctx context.Context, imageID string, req UpdateImageReq) error\n```\nUpdateImage applies a partial update to an image resource.\n\n```go\nfunc (c *DefaultClient) UpdateImageTags(ctx context.Context, imageID string) error\n```\nUpdateImageTags refreshes the latest digests for all tags of the image.\n\n```go\nfunc (c *DefaultClient) UpdateLastConnectionAt(ctx context.Context, workspaceID string) error\n```\nUpdateLastConnectionAt updates the last connection at attribute of a workspace.\n\n```go\nfunc (c *DefaultClient) UpdateOrganization(ctx context.Context, orgID string, req UpdateOrganizationReq) error\n```\nUpdateOrganization applys a partial update of an Organization resource.\n\n```go\nfunc (c *DefaultClient) UpdateRegistry(ctx context.Context, registryID string, req UpdateRegistryReq) error\n```\nUpdateRegistry applies a partial update to a registry resource.\n\n```go\nfunc (c *DefaultClient) UpdateUXState(ctx context.Context, userID string, uxsPartial map[string]interface{}) error\n```\nUpdateUXState applies a partial update of the user's UX State.\n\n```go\nfunc (c *DefaultClient) UpdateUser(ctx context.Context, userID string, req UpdateUserReq) error\n```\nUpdateUser applyes the partial update to the given user.\n\n```go\nfunc (c *DefaultClient) UserByEmail(ctx context.Context, email string) (*User, error)\n```\nUserByEmail gets a user by email.\n\n```go\nfunc (c *DefaultClient) UserByID(ctx context.Context, id string) (*User, error)\n```\nUserByID get the details of a user by their id.\n\n```go\nfunc (c *DefaultClient) UserWorkspacesByOrganization(ctx context.Context, userID, orgID string) ([]Workspace, error)\n```\nUserWorkspacesByOrganization gets the list of workspaces owned by the given user.\n\n```go\nfunc (c *DefaultClient) Users(ctx context.Context) ([]User, error)\n```\nUsers gets the list of user accounts.\n\n```go\nfunc (c *DefaultClient) WaitForWorkspaceReady(ctx context.Context, workspaceID string) error\n```\nWaitForWorkspaceReady will watch the build log and return when done.\n\n```go\nfunc (c *DefaultClient) WorkspaceByID(ctx context.Context, id string) (*Workspace, error)\n```\nWorkspaceByID get the details of a workspace by its id.\n\n```go\nfunc (c *DefaultClient) WorkspaceProviderByID(ctx context.Context, id string) (*KubernetesProvider, error)\n```\nWorkspaceProviderByID fetches a workspace provider entity by its unique ID.\n\n```go\nfunc (c *DefaultClient) WorkspaceProviders(ctx context.Context) (*WorkspaceProviders, error)\n```\nWorkspaceProviders fetches all workspace providers known to the Coder control plane.\n\n```go\nfunc (c *DefaultClient) Workspaces(ctx context.Context) ([]Workspace, error)\n```\nWorkspaces lists workspaces returned by the given filter. TODO: add the filter options, explore performance issue.\n\n```go\nfunc (c *DefaultClient) WorkspacesByWorkspaceProvider(ctx context.Context, wpID string) ([]Workspace, error)\n```\nWorkspacesByWorkspaceProvider returns all workspaces that belong to a particular workspace provider.\n\n```go\ntype DevURL struct {\n\tID     string `json:\"id\"     table:\"-\"`\n\tURL    string `json:\"url\"    table:\"URL\"`\n\tPort   int    `json:\"port\"   table:\"Port\"`\n\tAccess string `json:\"access\" table:\"Access\"`\n\tName   string `json:\"name\"   table:\"Name\"`\n\tScheme string `json:\"scheme\" table:\"Scheme\"`\n}\n```\nDevURL is the parsed json response record for a devURL from cemanager.\n\n```go\ntype Duration time.Duration\n```\nDuration is a time.Duration wrapper that marshals to millisecond precision. While it looses precision, most javascript applications expect durations to be in milliseconds.\n\n```go\nfunc (d Duration) MarshalJSON() ([]byte, error)\n```\nMarshalJSON marshals the duration to millisecond precision.\n\n```go\nfunc (d Duration) String() string\n```\n\n```go\nfunc (d *Duration) UnmarshalJSON(b []byte) error\n```\nUnmarshalJSON unmarshals a millisecond-precision integer to a time.Duration.\n\n```go\ntype ExtensionMarketplaceType string\n```\nExtensionMarketplaceType is an enum of the valid extension marketplace configurations.\n\n```go\nconst (\n\tExtensionMarketplaceInternal ExtensionMarketplaceType = \"internal\"\n\tExtensionMarketplaceCustom   ExtensionMarketplaceType = \"custom\"\n\tExtensionMarketplacePublic   ExtensionMarketplaceType = \"public\"\n)\n```\nExtensionMarketplaceType enum.\n\n```go\ntype HTTPError struct {\n\t// contains filtered or unexported fields\n}\n```\nHTTPError represents an error from the Coder API.\n\n```go\nfunc NewHTTPError(resp *http.Response) *HTTPError\n```\nNewHTTPError reads the response body and stores metadata about the response in order to be unpacked into an \\*APIError.\n\n```go\nfunc (e *HTTPError) Error() string\n```\n\n```go\nfunc (e *HTTPError) Payload() (*APIError, error)\n```\nPayload decode the response body into the standard error structure. The \\`details\\` section is stored as a raw json, and type depends on the \\`code\\` field.\n\n```go\nfunc (e *HTTPError) StatusCode() int\n```\n\n```go\ntype Image struct {\n\tID              string    `json:\"id\"                    table:\"-\"`\n\tOrganizationID  string    `json:\"organization_id\"       table:\"-\"`\n\tRepository      string    `json:\"repository\"            table:\"Repository\"`\n\tDescription     string    `json:\"description\"           table:\"-\"`\n\tURL             string    `json:\"url\"                   table:\"-\"` // User-supplied URL for image.\n\tRegistry        *Registry `json:\"registry\"              table:\"-\"`\n\tDefaultTag      *ImageTag `json:\"default_tag\"           table:\"DefaultTag\"`\n\tDefaultCPUCores float32   `json:\"default_cpu_cores\"     table:\"DefaultCPUCores\"`\n\tDefaultMemoryGB float32   `json:\"default_memory_gb\"     table:\"DefaultMemoryGB\"`\n\tDefaultDiskGB   int       `json:\"default_disk_gb\"       table:\"DefaultDiskGB\"`\n\tDeprecated      bool      `json:\"deprecated\"            table:\"-\"`\n\tCreatedAt       time.Time `json:\"created_at\"            table:\"-\"`\n\tUpdatedAt       time.Time `json:\"updated_at\"            table:\"-\"`\n}\n```\nImage describes a Coder Image.\n\n```go\ntype ImageTag struct {\n\tImageID           string       `json:\"image_id\"             table:\"-\"`\n\tTag               string       `json:\"tag\"                  table:\"Tag\"`\n\tLatestHash        string       `json:\"latest_hash\"          table:\"-\"`\n\tHashLastUpdatedAt time.Time    `json:\"hash_last_updated_at\" table:\"-\"`\n\tOSRelease         *OSRelease   `json:\"os_release\"           table:\"OS\"`\n\tWorkspaces        []*Workspace `json:\"workspaces\"         table:\"-\"`\n\tUpdatedAt         time.Time    `json:\"updated_at\"           table:\"UpdatedAt\"`\n\tCreatedAt         time.Time    `json:\"created_at\"           table:\"-\"`\n}\n```\nImageTag is a Docker image tag.\n\n```go\nfunc (i ImageTag) String() string\n```\n\n```go\ntype ImportImageReq struct {\n\tRegistryID      *string             `json:\"registry_id\"`  // Used to import images to existing registries.\n\tNewRegistry     *NewRegistryRequest `json:\"new_registry\"` // Used when adding a new registry.\n\tRepository      string              `json:\"repository\"`   // Refers to the image. Ex: \"codercom/ubuntu\".\n\tOrgID           string              `json:\"org_id\"`\n\tTag             string              `json:\"tag\"`\n\tDefaultCPUCores float32             `json:\"default_cpu_cores\"`\n\tDefaultMemoryGB int                 `json:\"default_memory_gb\"`\n\tDefaultDiskGB   int                 `json:\"default_disk_gb\"`\n\tDescription     string              `json:\"description\"`\n\tURL             string              `json:\"url\"`\n}\n```\nImportImageReq is used to import new images and registries into Coder.\n\n```go\ntype KubeProviderConfig struct {\n\tClusterAddress      string `json:\"cluster_address\" table:\"Cluster Address\"`\n\tDefaultNamespace    string `json:\"default_namespace\" table:\"Namespace\"`\n\tStorageClass        string `json:\"storage_class\" table:\"Storage Class\"`\n\tClusterDomainSuffix string `json:\"cluster_domain_suffix\" table:\"Cluster Domain Suffix\"`\n\tSSHEnabled          bool   `json:\"ssh_enabled\" table:\"SSH Enabled\"`\n}\n```\nKubeProviderConfig defines Kubernetes-specific configuration options.\n\n```go\ntype KubernetesProvider struct {\n\tID                 string                  `json:\"id\"                  table:\"-\"`\n\tName               string                  `json:\"name\"                table:\"Name\"`\n\tStatus             WorkspaceProviderStatus `json:\"status\"              table:\"Status\"`\n\tBuiltIn            bool                    `json:\"built_in\"            table:\"-\"`\n\tEnvproxyAccessURL  string                  `json:\"envproxy_access_url\" table:\"Access URL\" validate:\"required\"`\n\tDevurlHost         string                  `json:\"devurl_host\"         table:\"Devurl Host\"`\n\tOrgWhitelist       []string                `json:\"org_whitelist\"       table:\"-\"`\n\tKubeProviderConfig `json:\"config\" table:\"_\"`\n}\n```\nKubernetesProvider defines an entity capable of deploying and acting as an ingress for Coder workspaces.\n\n```go\ntype LoginRequest struct {\n\tEmail    string `json:\"email\"`\n\tPassword string `json:\"password\"`\n}\n```\nLoginRequest is a request to authenticate using email and password credentials.\n\nThis is provided for use in tests, and we recommend users authenticate using an API Token.\n\n```go\ntype LoginResponse struct {\n\tSessionToken string `json:\"session_token\"`\n}\n```\nLoginResponse contains successful response data for an authentication request, including an API Token to be used for subsequent requests.\n\nThis is provided for use in tests, and we recommend users authenticate using an API Token.\n\n```go\nfunc LoginWithPassword(ctx context.Context, client *http.Client, baseURL *url.URL, req *LoginRequest) (resp *LoginResponse, err error)\n```\nLoginWithPassword exchanges the email/password pair for a Session Token.\n\nIf client is nil, the http.DefaultClient will be used.\n\n```go\ntype LoginType string\n```\nLoginType defines the enum of valid user login types.\n\n```go\nconst (\n\tLoginTypeBuiltIn LoginType = \"built-in\"\n\tLoginTypeSAML    LoginType = \"saml\"\n\tLoginTypeOIDC    LoginType = \"oidc\"\n)\n```\nLoginType enum options.\n\n```go\ntype NewRegistryRequest struct {\n\tFriendlyName string `json:\"friendly_name\"`\n\tRegistry     string `json:\"registry\"`\n\tUsername     string `json:\"username\"`\n\tPassword     string `json:\"password\"`\n}\n```\nNewRegistryRequest describes a docker registry used in importing an image.\n\n```go\ntype OSRelease struct {\n\tID         string `json:\"id\"`\n\tPrettyName string `json:\"pretty_name\"`\n\tHomeURL    string `json:\"home_url\"`\n}\n```\nOSRelease is the marshalled /etc/os-release file.\n\n```go\nfunc (o OSRelease) String() string\n```\n\n```go\ntype Organization struct {\n\tID                     string             `json:\"id\"`\n\tName                   string             `json:\"name\"`\n\tDescription            string             `json:\"description\"`\n\tDefault                bool               `json:\"default\"`\n\tMembers                []OrganizationUser `json:\"members\"`\n\tWorkspaceCount         int                `json:\"workspace_count\"`\n\tResourceNamespace      string             `json:\"resource_namespace\"`\n\tCreatedAt              time.Time          `json:\"created_at\"`\n\tUpdatedAt              time.Time          `json:\"updated_at\"`\n\tAutoOffThreshold       Duration           `json:\"auto_off_threshold\"`\n\tCPUProvisioningRate    float32            `json:\"cpu_provisioning_rate\"`\n\tMemoryProvisioningRate float32            `json:\"memory_provisioning_rate\"`\n}\n```\nOrganization describes an Organization in Coder.\n\n```go\ntype OrganizationUser struct {\n\tUser\n\tOrganizationRoles []Role    `json:\"organization_roles\"`\n\tRolesUpdatedAt    time.Time `json:\"roles_updated_at\"`\n}\n```\nOrganizationUser user wraps the basic User type and adds data specific to the user's membership of an organization.\n\n```go\ntype ParseTemplateRequest struct {\n\tRepoURL  string    `json:\"repo_url\"`\n\tRef      string    `json:\"ref\"`\n\tFilepath string    `json:\"filepath\"`\n\tOrgID    string    `json:\"-\"`\n\tLocal    io.Reader `json:\"-\"`\n}\n```\nParseTemplateRequest parses a template. If Local is a non-nil reader it will obviate any other fields on the request.\n\n```go\ntype PutDevURLReq CreateDevURLReq\n```\nPutDevURLReq defines the request parameters for overwriting a DevURL.\n\n```go\ntype RebuildMessage struct {\n\tText             string   `json:\"text\"`\n\tRequired         bool     `json:\"required\"`\n\tAutoOffThreshold Duration `json:\"auto_off_threshold\"`\n}\n```\nRebuildMessage defines the message shown when a Workspace requires a rebuild for it can be accessed.\n\n```go\ntype Registry struct {\n\tID             string    `json:\"id\"`\n\tOrganizationID string    `json:\"organization_id\"`\n\tFriendlyName   string    `json:\"friendly_name\"`\n\tRegistry       string    `json:\"registry\"`\n\tCreatedAt      time.Time `json:\"created_at\"`\n\tUpdatedAt      time.Time `json:\"updated_at\"`\n}\n```\nRegistry defines an image registry configuration.\n\n```go\ntype RenameWorkspaceProviderReq struct {\n\tName string `json:\"name\"`\n}\n```\nRenameWorkspaceProviderReq defines the request parameters for changing a workspace provider name.\n\n```go\ntype Role string\n```\nRole defines a Coder permissions role group.\n\n```go\nconst (\n\tRoleOrgMember  Role = \"organization-member\"\n\tRoleOrgAdmin   Role = \"organization-admin\"\n\tRoleOrgManager Role = \"organization-manager\"\n)\n```\nOrganization Roles.\n\n```go\nconst (\n\tSiteAdmin   Role = \"site-admin\"\n\tSiteAuditor Role = \"site-auditor\"\n\tSiteManager Role = \"site-manager\"\n\tSiteMember  Role = \"site-member\"\n)\n```\nSite Roles.\n\n```go\ntype SSHKey struct {\n\tPublicKey  string `json:\"public_key\"`\n\tPrivateKey string `json:\"private_key\"`\n}\n```\nSSHKey describes an SSH keypair.\n\n```go\ntype Satellite struct {\n\tID          string `json:\"id\"`\n\tName        string `json:\"name\"`\n\tFingerprint string `json:\"fingerprint\"`\n}\n```\n\n```go\ntype SetPolicyTemplateRequest struct {\n\tTemplateID string `json:\"template_id\"`\n\tType       string `json:\"type\"` // site, org\n}\n```\n\n```go\ntype SetPolicyTemplateResponse struct {\n\tMergeConflicts []*WorkspaceTemplateMergeConflict `json:\"merge_conflicts\"`\n}\n```\n\n```go\ntype TemplateScope string\n```\n\n```go\ntype TemplateVersion struct {\n\tID         string `json:\"id\"`\n\tTemplateID string `json:\"template_id\"`\n\t// FileHash is the sha256 hash of the template's file contents.\n\tFileHash string `json:\"file_hash\"`\n\t// Commit is the git commit from which the template was derived.\n\tCommit        string    `json:\"commit\"`\n\tCommitMessage string    `json:\"commit_message\"`\n\tCreatedAt     time.Time `json:\"created_at\"`\n}\n```\nTemplateVersion is a workspace template. For now, let's not interpret it on the CLI level. We just need to forward this as part of the create workspace request.\n\n```go\ntype TplError struct {\n\t// Msgs are the human facing strings to present to the user. Since there can be multiple\n\t// problems with a template, there might be multiple strings\n\tMsgs []string `json:\"messages\"`\n}\n```\n\n```go\ntype UpdateImageReq struct {\n\tDefaultCPUCores *float32 `json:\"default_cpu_cores\"`\n\tDefaultMemoryGB *float32 `json:\"default_memory_gb\"`\n\tDefaultDiskGB   *int     `json:\"default_disk_gb\"`\n\tDescription     *string  `json:\"description\"`\n\tURL             *string  `json:\"url\"`\n\tDeprecated      *bool    `json:\"deprecated\"`\n\tDefaultTag      *string  `json:\"default_tag\"`\n}\n```\nUpdateImageReq defines the requests parameters for a partial update of an image resource.\n\n```go\ntype UpdateOrganizationReq struct {\n\tName                   *string   `json:\"name\"`\n\tDescription            *string   `json:\"description\"`\n\tDefault                *bool     `json:\"default\"`\n\tAutoOffThreshold       *Duration `json:\"auto_off_threshold\"`\n\tCPUProvisioningRate    *float32  `json:\"cpu_provisioning_rate\"`\n\tMemoryProvisioningRate *float32  `json:\"memory_provisioning_rate\"`\n}\n```\nUpdateOrganizationReq describes the patch request parameters to provide partial updates to an Organization resource.\n\n```go\ntype UpdateRegistryReq struct {\n\tRegistry     *string `json:\"registry\"`\n\tFriendlyName *string `json:\"friendly_name\"`\n\tUsername     *string `json:\"username\"`\n\tPassword     *string `json:\"password\"`\n}\n```\nUpdateRegistryReq defines the requests parameters for a partial update of a registry resource.\n\n```go\ntype UpdateUserReq struct {\n\t*UserPasswordSettings\n\tRevoked        *bool      `json:\"revoked,omitempty\"`\n\tRoles          *[]Role    `json:\"roles,omitempty\"`\n\tLoginType      *LoginType `json:\"login_type,omitempty\"`\n\tName           *string    `json:\"name,omitempty\"`\n\tUsername       *string    `json:\"username,omitempty\"`\n\tEmail          *string    `json:\"email,omitempty\"`\n\tDotfilesGitURL *string    `json:\"dotfiles_git_uri,omitempty\"`\n}\n```\nUpdateUserReq defines a modification to the user, updating the value of all non-nil values.\n\n```go\ntype UpdateWorkspaceReq struct {\n\tImageID    *string  `json:\"image_id\"`\n\tImageTag   *string  `json:\"image_tag\"`\n\tCPUCores   *float32 `json:\"cpu_cores\"`\n\tMemoryGB   *float32 `json:\"memory_gb\"`\n\tDiskGB     *int     `json:\"disk_gb\"`\n\tGPUs       *int     `json:\"gpus\"`\n\tTemplateID *string  `json:\"template_id\"`\n}\n```\nUpdateWorkspaceReq defines the update operation, only setting nil-fields.\n\n```go\ntype User struct {\n\tID                string    `json:\"id\"                 table:\"-\"`\n\tEmail             string    `json:\"email\"              table:\"Email\"`\n\tUsername          string    `json:\"username\"           table:\"Username\"`\n\tName              string    `json:\"name\"               table:\"Name\"`\n\tRoles             []Role    `json:\"roles\"              table:\"-\"`\n\tTemporaryPassword bool      `json:\"temporary_password\" table:\"-\"`\n\tLoginType         string    `json:\"login_type\"         table:\"-\"`\n\tKeyRegeneratedAt  time.Time `json:\"key_regenerated_at\" table:\"-\"`\n\tCreatedAt         time.Time `json:\"created_at\"         table:\"CreatedAt\"`\n\tUpdatedAt         time.Time `json:\"updated_at\"         table:\"-\"`\n}\n```\nUser describes a Coder user account.\n\n```go\ntype UserPasswordSettings struct {\n\t// OldPassword is the account's current password.\n\tOldPassword string `json:\"old_password,omitempty\"`\n\n\t// Password is the new password, which may be a temporary password.\n\tPassword string `json:\"password,omitempty\"`\n\n\t// Temporary indicates that API access should be restricted to the\n\t// password change API and a few other APIs. If set to true, Coder\n\t// will prompt the user to change their password upon their next\n\t// login through the web interface.\n\tTemporary bool `json:\"temporary_password,omitempty\"`\n}\n```\nUserPasswordSettings allows modification of the user's password settings.\n\nThese settings are only applicable to users managed using the built-in authentication provider; users authenticating using OAuth must change their password through the identity provider instead.\n\n```go\ntype Workspace struct {\n\tID               string           `json:\"id\"                 table:\"-\"`\n\tName             string           `json:\"name\"               table:\"Name\"`\n\tImageID          string           `json:\"image_id\"           table:\"-\"`\n\tImageTag         string           `json:\"image_tag\"          table:\"ImageTag\"`\n\tOrganizationID   string           `json:\"organization_id\"    table:\"-\"`\n\tUserID           string           `json:\"user_id\"            table:\"-\"`\n\tLastBuiltAt      time.Time        `json:\"last_built_at\"      table:\"-\"`\n\tCPUCores         float32          `json:\"cpu_cores\"          table:\"CPUCores\"`\n\tMemoryGB         float32          `json:\"memory_gb\"          table:\"MemoryGB\"`\n\tDiskGB           int              `json:\"disk_gb\"            table:\"DiskGB\"`\n\tGPUs             int              `json:\"gpus\"               table:\"-\"`\n\tUpdating         bool             `json:\"updating\"           table:\"-\"`\n\tLatestStat       WorkspaceStat    `json:\"latest_stat\"        table:\"Status\"`\n\tRebuildMessages  []RebuildMessage `json:\"rebuild_messages\"   table:\"-\"`\n\tCreatedAt        time.Time        `json:\"created_at\"         table:\"-\"`\n\tUpdatedAt        time.Time        `json:\"updated_at\"         table:\"-\"`\n\tLastOpenedAt     time.Time        `json:\"last_opened_at\"     table:\"-\"`\n\tLastConnectionAt time.Time        `json:\"last_connection_at\" table:\"-\"`\n\tAutoOffThreshold Duration         `json:\"auto_off_threshold\" table:\"-\"`\n\tUseContainerVM   bool             `json:\"use_container_vm\"   table:\"CVM\"`\n\tResourcePoolID   string           `json:\"resource_pool_id\"   table:\"-\"`\n}\n```\nWorkspace describes a Coder workspace.\n\n```go\ntype WorkspaceProviderStatus string\n```\nWorkspaceProviderStatus represents the configuration state of a workspace provider.\n\n```go\nconst (\n\tWorkspaceProviderPending WorkspaceProviderStatus = \"pending\"\n\tWorkspaceProviderReady   WorkspaceProviderStatus = \"ready\"\n)\n```\nWorkspace Provider statuses.\n\n```go\ntype WorkspaceProviderType string\n```\nWorkspaceProviderType represents the type of workspace provider.\n\n```go\nconst (\n\tWorkspaceProviderKubernetes WorkspaceProviderType = \"kubernetes\"\n)\n```\nWorkspace Provider types.\n\n```go\ntype WorkspaceProviders struct {\n\tKubernetes []KubernetesProvider `json:\"kubernetes\"`\n}\n```\nWorkspaceProviders defines all available Coder workspace provider targets.\n\n```go\ntype WorkspaceStat struct {\n\tTime            time.Time       `json:\"time\"`\n\tLastOnline      time.Time       `json:\"last_online\"`\n\tContainerStatus WorkspaceStatus `json:\"container_status\"`\n\tStatError       string          `json:\"stat_error\"`\n\tCPUUsage        float32         `json:\"cpu_usage\"`\n\tMemoryTotal     int64           `json:\"memory_total\"`\n\tMemoryUsage     float32         `json:\"memory_usage\"`\n\tDiskTotal       int64           `json:\"disk_total\"`\n\tDiskUsed        int64           `json:\"disk_used\"`\n}\n```\nWorkspaceStat represents the state of a workspace.\n\n```go\nfunc (e WorkspaceStat) String() string\n```\n\n```go\ntype WorkspaceStatus string\n```\nWorkspaceStatus refers to the states of a workspace.\n\n```go\nconst (\n\tWorkspaceCreating WorkspaceStatus = \"CREATING\"\n\tWorkspaceOff      WorkspaceStatus = \"OFF\"\n\tWorkspaceOn       WorkspaceStatus = \"ON\"\n\tWorkspaceFailed   WorkspaceStatus = \"FAILED\"\n\tWorkspaceUnknown  WorkspaceStatus = \"UNKNOWN\"\n)\n```\nThe following represent the possible workspace container states.\n\n```go\ntype WorkspaceTemplateMergeConflict struct {\n\tWorkspaceID             string    `json:\"workspace_id\"`\n\tCurrentTemplateWarnings []string  `json:\"current_template_warnings\"`\n\tCurrentTemplateError    *TplError `json:\"current_template_errors\"`\n\tLatestTemplateWarnings  []string  `json:\"latest_template_warnings\"`\n\tLatestTemplateError     *TplError `json:\"latest_template_errors\"`\n\tCurrentTemplateIsLatest bool      `json:\"current_template_is_latest\"`\n\tMessage                 string    `json:\"message\"`\n}\n```\n\n```go\nfunc (mc WorkspaceTemplateMergeConflict) String() string\n```\n\n```go\ntype WorkspaceTemplateMergeConflicts []*WorkspaceTemplateMergeConflict\n```\n\n```go\nfunc (mcs WorkspaceTemplateMergeConflicts) Summary() string\n```\n\n","path":"cdr.dev/coder-cli/coder-sdk","name":"coder","synopsis":"Package coder provides simple APIs for integrating Go applications with Coder.","isRedistributable":true}
