Mm 47422 signup token (#21662)
* When service setting flag is on, self hosted workspaces can initiate process for self-serve sign up * Add hosted_customer api.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
2455de99ff
Коммит
4f3f6e6496
@@ -326,6 +326,10 @@ func (c *Client4) cloudRoute() string {
|
||||
return "/cloud"
|
||||
}
|
||||
|
||||
func (c *Client4) hostedCustomerRoute() string {
|
||||
return "/hosted_customer"
|
||||
}
|
||||
|
||||
func (c *Client4) testEmailRoute() string {
|
||||
return "/email/test"
|
||||
}
|
||||
@@ -8220,6 +8224,23 @@ func (c *Client4) UpdateCloudCustomerAddress(address *Address) (*CloudCustomer,
|
||||
return customer, BuildResponse(r), nil
|
||||
}
|
||||
|
||||
func (c *Client4) BootstrapSelfHostedSignup(req BootstrapSelfHostedSignupRequest) (*BootstrapSelfHostedSignupResponse, *Response, error) {
|
||||
reqBytes, err := json.Marshal(req)
|
||||
if err != nil {
|
||||
return nil, nil, NewAppError("BootstrapSelfHostedSignup", "api.marshal_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
||||
}
|
||||
r, err := c.DoAPIPostBytes(c.hostedCustomerRoute()+"/bootstrap", reqBytes)
|
||||
if err != nil {
|
||||
return nil, BuildResponse(r), err
|
||||
}
|
||||
defer closeBody(r)
|
||||
|
||||
var res *BootstrapSelfHostedSignupResponse
|
||||
json.NewDecoder(r.Body).Decode(&res)
|
||||
|
||||
return res, BuildResponse(r), nil
|
||||
}
|
||||
|
||||
func (c *Client4) ListImports() ([]string, *Response, error) {
|
||||
r, err := c.DoAPIGet(c.importsRoute(), "")
|
||||
if err != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user