* When service setting flag is on, self hosted workspaces can initiate process for self-serve sign up
* Add hosted_customer api.
Этот коммит содержится в:
Nathaniel Allred
2022-11-29 13:32:08 -06:00
коммит произвёл GitHub
родитель 2455de99ff
Коммит 4f3f6e6496
12 изменённых файлов: 249 добавлений и 1 удалений

Просмотреть файл

@@ -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 {