2020-09-28 12:18:47 -04:00
|
|
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
|
|
|
// See LICENSE.txt for license information.
|
|
|
|
|
|
|
|
|
|
package einterfaces
|
|
|
|
|
|
|
|
|
|
import (
|
2023-06-11 10:54:35 +05:30
|
|
|
"github.com/mattermost/mattermost/server/public/model"
|
2023-11-03 08:06:16 +01:00
|
|
|
"github.com/mattermost/mattermost/server/public/shared/request"
|
2020-09-28 12:18:47 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type CloudInterface interface {
|
2022-11-29 11:47:51 -05:00
|
|
|
GetCloudProduct(userID string, productID string) (*model.Product, error)
|
2021-10-07 11:48:56 -05:00
|
|
|
GetCloudProducts(userID string, includeLegacyProducts bool) ([]*model.Product, error)
|
2022-11-30 14:26:30 +03:00
|
|
|
GetSelfHostedProducts(userID string) ([]*model.Product, error)
|
2022-04-22 14:23:19 -05:00
|
|
|
GetCloudLimits(userID string) (*model.ProductLimits, error)
|
2020-09-28 12:18:47 -04:00
|
|
|
|
2021-03-05 09:23:39 +01:00
|
|
|
CreateCustomerPayment(userID string) (*model.StripeSetupIntent, error)
|
|
|
|
|
ConfirmCustomerPayment(userID string, confirmRequest *model.ConfirmPaymentMethodRequest) error
|
2020-10-01 13:14:48 -04:00
|
|
|
|
2021-03-05 09:23:39 +01:00
|
|
|
GetCloudCustomer(userID string) (*model.CloudCustomer, error)
|
2023-03-03 18:33:18 +03:00
|
|
|
GetLicenseSelfServeStatus(userID string, token string) (*model.SubscriptionLicenseSelfServeStatusResponse, error)
|
2021-03-05 09:23:39 +01:00
|
|
|
UpdateCloudCustomer(userID string, customerInfo *model.CloudCustomerInfo) (*model.CloudCustomer, error)
|
|
|
|
|
UpdateCloudCustomerAddress(userID string, address *model.Address) (*model.CloudCustomer, error)
|
2020-10-05 08:46:52 -04:00
|
|
|
|
2021-03-05 09:23:39 +01:00
|
|
|
GetSubscription(userID string) (*model.Subscription, error)
|
|
|
|
|
GetInvoicesForSubscription(userID string) ([]*model.Invoice, error)
|
|
|
|
|
GetInvoicePDF(userID, invoiceID string) ([]byte, string, error)
|
2021-05-27 09:12:47 -04:00
|
|
|
|
|
|
|
|
ChangeSubscription(userID, subscriptionID string, subscriptionChange *model.SubscriptionChange) (*model.Subscription, error)
|
2021-12-21 09:46:02 +03:00
|
|
|
|
2022-06-01 23:36:03 +02:00
|
|
|
RequestCloudTrial(userID, subscriptionID, newValidBusinessEmail string) (*model.Subscription, error)
|
|
|
|
|
ValidateBusinessEmail(userID, email string) error
|
2022-05-18 10:19:38 +02:00
|
|
|
|
2022-03-21 10:42:09 -04:00
|
|
|
InvalidateCaches() error
|
2022-11-29 11:47:51 -05:00
|
|
|
|
2022-12-13 13:36:18 -06:00
|
|
|
// hosted customer methods
|
|
|
|
|
SelfHostedSignupAvailable() error
|
2022-11-29 13:32:08 -06:00
|
|
|
BootstrapSelfHostedSignup(req model.BootstrapSelfHostedSignupRequest) (*model.BootstrapSelfHostedSignupResponse, error)
|
2022-12-13 13:36:18 -06:00
|
|
|
CreateCustomerSelfHostedSignup(req model.SelfHostedCustomerForm, requesterEmail string) (*model.SelfHostedSignupCustomerResponse, error)
|
|
|
|
|
ConfirmSelfHostedSignup(req model.SelfHostedConfirmPaymentMethodRequest, requesterEmail string) (*model.SelfHostedSignupConfirmResponse, error)
|
2023-04-12 14:12:28 -04:00
|
|
|
ConfirmSelfHostedExpansion(req model.SelfHostedConfirmPaymentMethodRequest, requesterEmail string) (*model.SelfHostedSignupConfirmResponse, error)
|
2022-12-13 13:36:18 -06:00
|
|
|
ConfirmSelfHostedSignupLicenseApplication() error
|
2023-11-03 08:06:16 +01:00
|
|
|
GetSelfHostedInvoices(rctx request.CTX) ([]*model.Invoice, error)
|
2022-12-13 13:36:18 -06:00
|
|
|
GetSelfHostedInvoicePDF(invoiceID string) ([]byte, string, error)
|
|
|
|
|
|
2022-11-29 11:47:51 -05:00
|
|
|
CreateOrUpdateSubscriptionHistoryEvent(userID string, userCount int) (*model.SubscriptionHistory, error)
|
2022-11-22 13:22:45 -05:00
|
|
|
HandleLicenseChange() error
|
2022-12-29 14:58:05 -05:00
|
|
|
|
2022-12-29 15:07:06 -05:00
|
|
|
CheckCWSConnection(userId string) error
|
2023-02-21 17:36:44 +03:00
|
|
|
|
|
|
|
|
SelfServeDeleteWorkspace(userID string, deletionRequest *model.WorkspaceDeletionRequest) error
|
2023-04-04 13:57:32 +03:00
|
|
|
SubscribeToNewsletter(userID string, req *model.SubscribeNewsletterRequest) error
|
2023-04-11 12:52:54 -04:00
|
|
|
|
|
|
|
|
// Used only for when a customer has telemetry disabled. In this scenario, true up review telemetry will be submitted via CWS.
|
2023-04-11 14:15:56 -04:00
|
|
|
SubmitTrueUpReview(userID string, trueUpReviewProfile map[string]any) error
|
2023-11-14 09:12:04 -05:00
|
|
|
|
|
|
|
|
ApplyIPFilters(userID string, ranges *model.AllowedIPRanges) (*model.AllowedIPRanges, error)
|
|
|
|
|
GetIPFilters(userID string) (*model.AllowedIPRanges, error)
|
2023-11-28 09:09:50 -05:00
|
|
|
GetInstallation(userID string) (*model.Installation, error)
|
2020-09-28 12:18:47 -04:00
|
|
|
}
|