Mm 43084 add cloud workspace limits endpoint (#20041)
* add cloud workspace limits endpoint
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
f460401cf2
Коммит
d4db43c95e
@@ -7707,6 +7707,19 @@ func (c *Client4) GetCloudProducts() ([]*Product, *Response, error) {
|
||||
return cloudProducts, BuildResponse(r), nil
|
||||
}
|
||||
|
||||
func (c *Client4) GetProductLimits() (*ProductLimits, *Response, error) {
|
||||
r, err := c.DoAPIGet(c.cloudRoute()+"/limits", "")
|
||||
if err != nil {
|
||||
return nil, BuildResponse(r), err
|
||||
}
|
||||
defer closeBody(r)
|
||||
|
||||
var productLimits *ProductLimits
|
||||
json.NewDecoder(r.Body).Decode(&productLimits)
|
||||
|
||||
return productLimits, BuildResponse(r), nil
|
||||
}
|
||||
|
||||
func (c *Client4) CreateCustomerPayment() (*StripeSetupIntent, *Response, error) {
|
||||
r, err := c.DoAPIPost(c.cloudRoute()+"/payment", "")
|
||||
if err != nil {
|
||||
|
||||
@@ -181,3 +181,32 @@ type CloudWorkspaceOwner struct {
|
||||
type SubscriptionChange struct {
|
||||
ProductID string `json:"product_id"`
|
||||
}
|
||||
|
||||
type BoardsLimits struct {
|
||||
Cards *int `json:"cards"`
|
||||
Views *int `json:"views"`
|
||||
}
|
||||
|
||||
type FilesLimits struct {
|
||||
TotalStorage *int64 `json:"total_storage"`
|
||||
}
|
||||
|
||||
type IntegrationsLimits struct {
|
||||
Enabled *int `json:"enabled"`
|
||||
}
|
||||
|
||||
type MessagesLimits struct {
|
||||
History *int `json:"history"`
|
||||
}
|
||||
|
||||
type TeamsLimits struct {
|
||||
Active *int `json:"active"`
|
||||
}
|
||||
|
||||
type ProductLimits struct {
|
||||
Boards *BoardsLimits `json:"boards,omitempty"`
|
||||
Files *FilesLimits `json:"files,omitempty"`
|
||||
Integrations *IntegrationsLimits `json:"integrations,omitempty"`
|
||||
Messages *MessagesLimits `json:"messages,omitempty"`
|
||||
Teams *TeamsLimits `json:"teams,omitempty"`
|
||||
}
|
||||
|
||||
@@ -64,6 +64,8 @@ type FeatureFlags struct {
|
||||
|
||||
InsightsEnabled bool
|
||||
|
||||
CloudFree bool
|
||||
|
||||
CommandPalette bool
|
||||
}
|
||||
|
||||
@@ -88,6 +90,7 @@ func (f *FeatureFlags) SetDefaults() {
|
||||
f.UseCaseOnboarding = true
|
||||
f.GraphQL = false
|
||||
f.InsightsEnabled = false
|
||||
f.CloudFree = false
|
||||
f.CommandPalette = false
|
||||
}
|
||||
func (f *FeatureFlags) Plugins() map[string]string {
|
||||
|
||||
Ссылка в новой задаче
Block a user