mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
AGPL Entitlements API (#3523)
* AGPL Entitlements API Signed-off-by: Spike Curtis <spike@coder.com> * Generate typesGenerated.ts Signed-off-by: Spike Curtis <spike@coder.com> * AllFeatures -> FeatureNames Signed-off-by: Spike Curtis <spike@coder.com> Signed-off-by: Spike Curtis <spike@coder.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package codersdk
|
||||
|
||||
type Entitlement string
|
||||
|
||||
const (
|
||||
EntitlementEntitled Entitlement = "entitled"
|
||||
EntitlementGracePeriod Entitlement = "grace_period"
|
||||
EntitlementNotEntitled Entitlement = "not_entitled"
|
||||
)
|
||||
|
||||
const (
|
||||
FeatureUserLimit = "user_limit"
|
||||
FeatureAuditLog = "audit_log"
|
||||
)
|
||||
|
||||
var FeatureNames = []string{FeatureUserLimit, FeatureAuditLog}
|
||||
|
||||
type Feature struct {
|
||||
Entitlement Entitlement `json:"entitlement"`
|
||||
Enabled bool `json:"enabled"`
|
||||
Limit *int64 `json:"limit"`
|
||||
Actual *int64 `json:"actual"`
|
||||
}
|
||||
|
||||
type Entitlements struct {
|
||||
Features map[string]Feature `json:"features"`
|
||||
Warnings []string `json:"warnings"`
|
||||
HasLicense bool `json:"has_license"`
|
||||
}
|
||||
Reference in New Issue
Block a user