diff --git a/client.gen.go b/client.gen.go index 3fe9b8e..cf7bb1c 100644 --- a/client.gen.go +++ b/client.gen.go @@ -144,6 +144,11 @@ type ClientInterface interface { // GetOpenAPIJSON request GetOpenAPIJSON(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + // CreatePlatformSignupWithBody request with any body + CreatePlatformSignupWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreatePlatformSignup(ctx context.Context, body CreatePlatformSignupJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // ActivatePlatformWithBody request with any body ActivatePlatformWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -397,6 +402,12 @@ type ClientInterface interface { // DeleteTeamMembership request DeleteTeamMembership(ctx context.Context, teamName TeamName, email EmailBasic, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetTeamPlatformTenant request + GetTeamPlatformTenant(ctx context.Context, teamName TeamName, tenantId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) + + // FinalizeTeamPlatformTenant request + FinalizeTeamPlatformTenant(ctx context.Context, teamName TeamName, tenantId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) + // DeletePluginsByTeam request DeletePluginsByTeam(ctx context.Context, teamName TeamName, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -490,6 +501,9 @@ type ClientInterface interface { // GetCurrentUserMemberships request GetCurrentUserMemberships(ctx context.Context, params *GetCurrentUserMembershipsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListUserPlatformTenants request + ListUserPlatformTenants(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + // RegisterUserWithBody request with any body RegisterUserWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -742,6 +756,30 @@ func (c *Client) GetOpenAPIJSON(ctx context.Context, reqEditors ...RequestEditor return c.Client.Do(req) } +func (c *Client) CreatePlatformSignupWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreatePlatformSignupRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreatePlatformSignup(ctx context.Context, body CreatePlatformSignupJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreatePlatformSignupRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) ActivatePlatformWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewActivatePlatformRequestWithBody(c.Server, contentType, body) if err != nil { @@ -1870,6 +1908,30 @@ func (c *Client) DeleteTeamMembership(ctx context.Context, teamName TeamName, em return c.Client.Do(req) } +func (c *Client) GetTeamPlatformTenant(ctx context.Context, teamName TeamName, tenantId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetTeamPlatformTenantRequest(c.Server, teamName, tenantId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) FinalizeTeamPlatformTenant(ctx context.Context, teamName TeamName, tenantId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewFinalizeTeamPlatformTenantRequest(c.Server, teamName, tenantId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) DeletePluginsByTeam(ctx context.Context, teamName TeamName, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeletePluginsByTeamRequest(c.Server, teamName) if err != nil { @@ -2278,6 +2340,18 @@ func (c *Client) GetCurrentUserMemberships(ctx context.Context, params *GetCurre return c.Client.Do(req) } +func (c *Client) ListUserPlatformTenants(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListUserPlatformTenantsRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) RegisterUserWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewRegisterUserRequestWithBody(c.Server, contentType, body) if err != nil { @@ -3227,6 +3301,46 @@ func NewGetOpenAPIJSONRequest(server string) (*http.Request, error) { return req, nil } +// NewCreatePlatformSignupRequest calls the generic CreatePlatformSignup builder with application/json body +func NewCreatePlatformSignupRequest(server string, body CreatePlatformSignupJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreatePlatformSignupRequestWithBody(server, "application/json", bodyReader) +} + +// NewCreatePlatformSignupRequestWithBody generates requests for CreatePlatformSignup with any type of body +func NewCreatePlatformSignupRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/platform-signup") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + // NewActivatePlatformRequest calls the generic ActivatePlatform builder with application/json body func NewActivatePlatformRequest(server string, body ActivatePlatformJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader @@ -7045,6 +7159,88 @@ func NewDeleteTeamMembershipRequest(server string, teamName TeamName, email Emai return req, nil } +// NewGetTeamPlatformTenantRequest generates requests for GetTeamPlatformTenant +func NewGetTeamPlatformTenantRequest(server string, teamName TeamName, tenantId openapi_types.UUID) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "team_name", runtime.ParamLocationPath, teamName) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "tenant_id", runtime.ParamLocationPath, tenantId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/teams/%s/platform/tenant/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewFinalizeTeamPlatformTenantRequest generates requests for FinalizeTeamPlatformTenant +func NewFinalizeTeamPlatformTenantRequest(server string, teamName TeamName, tenantId openapi_types.UUID) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "team_name", runtime.ParamLocationPath, teamName) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "tenant_id", runtime.ParamLocationPath, tenantId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/teams/%s/platform/tenant/%s/finalize", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewDeletePluginsByTeamRequest generates requests for DeletePluginsByTeam func NewDeletePluginsByTeamRequest(server string, teamName TeamName) (*http.Request, error) { var err error @@ -8404,6 +8600,33 @@ func NewGetCurrentUserMembershipsRequest(server string, params *GetCurrentUserMe return req, nil } +// NewListUserPlatformTenantsRequest generates requests for ListUserPlatformTenants +func NewListUserPlatformTenantsRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/user/platform/tenants") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewRegisterUserRequest calls the generic RegisterUser builder with application/json body func NewRegisterUserRequest(server string, body RegisterUserJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader @@ -8834,6 +9057,11 @@ type ClientWithResponsesInterface interface { // GetOpenAPIJSONWithResponse request GetOpenAPIJSONWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetOpenAPIJSONResponse, error) + // CreatePlatformSignupWithBodyWithResponse request with any body + CreatePlatformSignupWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePlatformSignupResponse, error) + + CreatePlatformSignupWithResponse(ctx context.Context, body CreatePlatformSignupJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePlatformSignupResponse, error) + // ActivatePlatformWithBodyWithResponse request with any body ActivatePlatformWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ActivatePlatformResponse, error) @@ -9087,6 +9315,12 @@ type ClientWithResponsesInterface interface { // DeleteTeamMembershipWithResponse request DeleteTeamMembershipWithResponse(ctx context.Context, teamName TeamName, email EmailBasic, reqEditors ...RequestEditorFn) (*DeleteTeamMembershipResponse, error) + // GetTeamPlatformTenantWithResponse request + GetTeamPlatformTenantWithResponse(ctx context.Context, teamName TeamName, tenantId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetTeamPlatformTenantResponse, error) + + // FinalizeTeamPlatformTenantWithResponse request + FinalizeTeamPlatformTenantWithResponse(ctx context.Context, teamName TeamName, tenantId openapi_types.UUID, reqEditors ...RequestEditorFn) (*FinalizeTeamPlatformTenantResponse, error) + // DeletePluginsByTeamWithResponse request DeletePluginsByTeamWithResponse(ctx context.Context, teamName TeamName, reqEditors ...RequestEditorFn) (*DeletePluginsByTeamResponse, error) @@ -9180,6 +9414,9 @@ type ClientWithResponsesInterface interface { // GetCurrentUserMembershipsWithResponse request GetCurrentUserMembershipsWithResponse(ctx context.Context, params *GetCurrentUserMembershipsParams, reqEditors ...RequestEditorFn) (*GetCurrentUserMembershipsResponse, error) + // ListUserPlatformTenantsWithResponse request + ListUserPlatformTenantsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListUserPlatformTenantsResponse, error) + // RegisterUserWithBodyWithResponse request with any body RegisterUserWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RegisterUserResponse, error) @@ -9568,6 +9805,34 @@ func (r GetOpenAPIJSONResponse) StatusCode() int { return 0 } +type CreatePlatformSignupResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *CreatePlatformSignup201Response + JSON400 *BadRequest + JSON401 *RequiresAuthentication + JSON404 *NotFound + JSON422 *UnprocessableEntity + JSON429 *TooManyRequests + JSON500 *InternalError +} + +// Status returns HTTPResponse.Status +func (r CreatePlatformSignupResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreatePlatformSignupResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type ActivatePlatformResponse struct { Body []byte HTTPResponse *http.Response @@ -11275,18 +11540,19 @@ func (r DeleteTeamMembershipResponse) StatusCode() int { return 0 } -type DeletePluginsByTeamResponse struct { +type GetTeamPlatformTenantResponse struct { Body []byte HTTPResponse *http.Response - JSON400 *BadRequest + JSON200 *CreatePlatformSignup201Response JSON401 *RequiresAuthentication JSON403 *Forbidden JSON404 *NotFound + JSON429 *TooManyRequests JSON500 *InternalError } // Status returns HTTPResponse.Status -func (r DeletePluginsByTeamResponse) Status() string { +func (r GetTeamPlatformTenantResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -11294,25 +11560,26 @@ func (r DeletePluginsByTeamResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeletePluginsByTeamResponse) StatusCode() int { +func (r GetTeamPlatformTenantResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ListPluginsByTeamResponse struct { +type FinalizeTeamPlatformTenantResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ListPluginsByTeam200Response + JSON200 *CreatePlatformSignup201Response JSON401 *RequiresAuthentication JSON403 *Forbidden JSON404 *NotFound + JSON429 *TooManyRequests JSON500 *InternalError } // Status returns HTTPResponse.Status -func (r ListPluginsByTeamResponse) Status() string { +func (r FinalizeTeamPlatformTenantResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -11320,25 +11587,25 @@ func (r ListPluginsByTeamResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListPluginsByTeamResponse) StatusCode() int { +func (r FinalizeTeamPlatformTenantResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DownloadPluginAssetByTeamResponse struct { +type DeletePluginsByTeamResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *PluginAsset + JSON400 *BadRequest JSON401 *RequiresAuthentication + JSON403 *Forbidden JSON404 *NotFound - JSON429 *TooManyRequests JSON500 *InternalError } // Status returns HTTPResponse.Status -func (r DownloadPluginAssetByTeamResponse) Status() string { +func (r DeletePluginsByTeamResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -11346,26 +11613,25 @@ func (r DownloadPluginAssetByTeamResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DownloadPluginAssetByTeamResponse) StatusCode() int { +func (r DeletePluginsByTeamResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetSettingsResponse struct { +type ListPluginsByTeamResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Settings + JSON200 *ListPluginsByTeam200Response JSON401 *RequiresAuthentication JSON403 *Forbidden JSON404 *NotFound - JSON422 *UnprocessableEntity JSON500 *InternalError } // Status returns HTTPResponse.Status -func (r GetSettingsResponse) Status() string { +func (r ListPluginsByTeamResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -11373,26 +11639,25 @@ func (r GetSettingsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetSettingsResponse) StatusCode() int { +func (r ListPluginsByTeamResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpdateSettingsResponse struct { +type DownloadPluginAssetByTeamResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Settings + JSON200 *PluginAsset JSON401 *RequiresAuthentication - JSON403 *Forbidden JSON404 *NotFound - JSON422 *UnprocessableEntity + JSON429 *TooManyRequests JSON500 *InternalError } // Status returns HTTPResponse.Status -func (r UpdateSettingsResponse) Status() string { +func (r DownloadPluginAssetByTeamResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -11400,7 +11665,61 @@ func (r UpdateSettingsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateSettingsResponse) StatusCode() int { +func (r DownloadPluginAssetByTeamResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetSettingsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Settings + JSON401 *RequiresAuthentication + JSON403 *Forbidden + JSON404 *NotFound + JSON422 *UnprocessableEntity + JSON500 *InternalError +} + +// Status returns HTTPResponse.Status +func (r GetSettingsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetSettingsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateSettingsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Settings + JSON401 *RequiresAuthentication + JSON403 *Forbidden + JSON404 *NotFound + JSON422 *UnprocessableEntity + JSON500 *InternalError +} + +// Status returns HTTPResponse.Status +func (r UpdateSettingsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateSettingsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -11924,6 +12243,31 @@ func (r GetCurrentUserMembershipsResponse) StatusCode() int { return 0 } +type ListUserPlatformTenantsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ListUserPlatformTenants200Response + JSON401 *RequiresAuthentication + JSON429 *TooManyRequests + JSON500 *InternalError +} + +// Status returns HTTPResponse.Status +func (r ListUserPlatformTenantsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListUserPlatformTenantsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type RegisterUserResponse struct { Body []byte HTTPResponse *http.Response @@ -12322,6 +12666,23 @@ func (c *ClientWithResponses) GetOpenAPIJSONWithResponse(ctx context.Context, re return ParseGetOpenAPIJSONResponse(rsp) } +// CreatePlatformSignupWithBodyWithResponse request with arbitrary body returning *CreatePlatformSignupResponse +func (c *ClientWithResponses) CreatePlatformSignupWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePlatformSignupResponse, error) { + rsp, err := c.CreatePlatformSignupWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreatePlatformSignupResponse(rsp) +} + +func (c *ClientWithResponses) CreatePlatformSignupWithResponse(ctx context.Context, body CreatePlatformSignupJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePlatformSignupResponse, error) { + rsp, err := c.CreatePlatformSignup(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreatePlatformSignupResponse(rsp) +} + // ActivatePlatformWithBodyWithResponse request with arbitrary body returning *ActivatePlatformResponse func (c *ClientWithResponses) ActivatePlatformWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ActivatePlatformResponse, error) { rsp, err := c.ActivatePlatformWithBody(ctx, contentType, body, reqEditors...) @@ -13139,6 +13500,24 @@ func (c *ClientWithResponses) DeleteTeamMembershipWithResponse(ctx context.Conte return ParseDeleteTeamMembershipResponse(rsp) } +// GetTeamPlatformTenantWithResponse request returning *GetTeamPlatformTenantResponse +func (c *ClientWithResponses) GetTeamPlatformTenantWithResponse(ctx context.Context, teamName TeamName, tenantId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetTeamPlatformTenantResponse, error) { + rsp, err := c.GetTeamPlatformTenant(ctx, teamName, tenantId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetTeamPlatformTenantResponse(rsp) +} + +// FinalizeTeamPlatformTenantWithResponse request returning *FinalizeTeamPlatformTenantResponse +func (c *ClientWithResponses) FinalizeTeamPlatformTenantWithResponse(ctx context.Context, teamName TeamName, tenantId openapi_types.UUID, reqEditors ...RequestEditorFn) (*FinalizeTeamPlatformTenantResponse, error) { + rsp, err := c.FinalizeTeamPlatformTenant(ctx, teamName, tenantId, reqEditors...) + if err != nil { + return nil, err + } + return ParseFinalizeTeamPlatformTenantResponse(rsp) +} + // DeletePluginsByTeamWithResponse request returning *DeletePluginsByTeamResponse func (c *ClientWithResponses) DeletePluginsByTeamWithResponse(ctx context.Context, teamName TeamName, reqEditors ...RequestEditorFn) (*DeletePluginsByTeamResponse, error) { rsp, err := c.DeletePluginsByTeam(ctx, teamName, reqEditors...) @@ -13436,6 +13815,15 @@ func (c *ClientWithResponses) GetCurrentUserMembershipsWithResponse(ctx context. return ParseGetCurrentUserMembershipsResponse(rsp) } +// ListUserPlatformTenantsWithResponse request returning *ListUserPlatformTenantsResponse +func (c *ClientWithResponses) ListUserPlatformTenantsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListUserPlatformTenantsResponse, error) { + rsp, err := c.ListUserPlatformTenants(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseListUserPlatformTenantsResponse(rsp) +} + // RegisterUserWithBodyWithResponse request with arbitrary body returning *RegisterUserResponse func (c *ClientWithResponses) RegisterUserWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RegisterUserResponse, error) { rsp, err := c.RegisterUserWithBody(ctx, contentType, body, reqEditors...) @@ -14218,6 +14606,74 @@ func ParseGetOpenAPIJSONResponse(rsp *http.Response) (*GetOpenAPIJSONResponse, e return response, nil } +// ParseCreatePlatformSignupResponse parses an HTTP response from a CreatePlatformSignupWithResponse call +func ParseCreatePlatformSignupResponse(rsp *http.Response) (*CreatePlatformSignupResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &CreatePlatformSignupResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest CreatePlatformSignup201Response + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest RequiresAuthentication + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest NotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest UnprocessableEntity + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest TooManyRequests + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest InternalError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + // ParseActivatePlatformResponse parses an HTTP response from a ActivatePlatformWithResponse call func ParseActivatePlatformResponse(rsp *http.Response) (*ActivatePlatformResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) @@ -17847,6 +18303,128 @@ func ParseDeleteTeamMembershipResponse(rsp *http.Response) (*DeleteTeamMembershi return response, nil } +// ParseGetTeamPlatformTenantResponse parses an HTTP response from a GetTeamPlatformTenantWithResponse call +func ParseGetTeamPlatformTenantResponse(rsp *http.Response) (*GetTeamPlatformTenantResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetTeamPlatformTenantResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest CreatePlatformSignup201Response + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest RequiresAuthentication + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest NotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest TooManyRequests + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest InternalError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseFinalizeTeamPlatformTenantResponse parses an HTTP response from a FinalizeTeamPlatformTenantWithResponse call +func ParseFinalizeTeamPlatformTenantResponse(rsp *http.Response) (*FinalizeTeamPlatformTenantResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &FinalizeTeamPlatformTenantResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest CreatePlatformSignup201Response + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest RequiresAuthentication + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest NotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest TooManyRequests + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest InternalError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + // ParseDeletePluginsByTeamResponse parses an HTTP response from a DeletePluginsByTeamWithResponse call func ParseDeletePluginsByTeamResponse(rsp *http.Response) (*DeletePluginsByTeamResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) @@ -19190,6 +19768,53 @@ func ParseGetCurrentUserMembershipsResponse(rsp *http.Response) (*GetCurrentUser return response, nil } +// ParseListUserPlatformTenantsResponse parses an HTTP response from a ListUserPlatformTenantsWithResponse call +func ParseListUserPlatformTenantsResponse(rsp *http.Response) (*ListUserPlatformTenantsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListUserPlatformTenantsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ListUserPlatformTenants200Response + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest RequiresAuthentication + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest TooManyRequests + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest InternalError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + // ParseRegisterUserResponse parses an HTTP response from a RegisterUserWithResponse call func ParseRegisterUserResponse(rsp *http.Response) (*RegisterUserResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) diff --git a/models.gen.go b/models.gen.go index 68ff4f8..5a8ad09 100644 --- a/models.gen.go +++ b/models.gen.go @@ -77,6 +77,13 @@ const ( ManagedDatabaseStatusReady ManagedDatabaseStatus = "ready" ) +// Defines values for PlatformTenantStatus. +const ( + PlatformTenantStatusActive PlatformTenantStatus = "active" + PlatformTenantStatusCreated PlatformTenantStatus = "created" + PlatformTenantStatusPending PlatformTenantStatus = "pending" +) + // Defines values for PluginCategory. const ( PluginCategoryCloudFinops PluginCategory = "cloud-finops" @@ -646,6 +653,33 @@ type CreateAddonVersionRequest struct { PluginDeps *[]string `json:"plugin_deps,omitempty"` } +// CreatePlatformSignup201Response defines model for CreatePlatformSignup_201_response. +type CreatePlatformSignup201Response struct { + // Status Provisioning status of a platform tenant. + Status PlatformTenantStatus `json:"status"` + Subdomain string `json:"subdomain"` + + // TeamName The unique name for the team. + TeamName TeamName `json:"team_name"` + TenantId openapi_types.UUID `json:"tenant_id"` +} + +// CreatePlatformSignupRequest defines model for CreatePlatformSignup_request. +type CreatePlatformSignupRequest struct { + // Company Company name (free text). Captured for analytics. On the auto-create-team path it is also used as the new Cloud team's `display_name` (the team `name` slug stays the auto-generated subdomain). + Company interface{} `json:"company"` + + // JobTitle User's job title (free text, e.g. "Engineering Manager"). Captured for analytics. Distinct from the Cloud team membership role (admin/member). + JobTitle interface{} `json:"job_title"` + + // Name Full name of the user + Name interface{} `json:"name"` + + // TeamName Optional. When set the new tenant is attached to this existing Cloud team and no team is auto-created; the caller must be an ADMIN of the team or the request 404s (same response shape as an unknown team, so membership existence is not leaked). When unset, a new Cloud team is auto-created with `name = subdomain` and the signing-up user as its sole admin. + TeamName *TeamName `json:"team_name,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + // CreatePluginVersionDocs201Response defines model for CreatePluginVersionDocs_201_response. type CreatePluginVersionDocs201Response struct { Names *[]PluginDocsPageName `json:"names,omitempty"` @@ -1079,6 +1113,11 @@ type ListTeams200Response struct { Metadata ListMetadata `json:"metadata"` } +// ListUserPlatformTenants200Response defines model for ListUserPlatformTenants_200_response. +type ListUserPlatformTenants200Response struct { + Items []PlatformTenantSummary `json:"items"` +} + // ListUsersByTeam200Response defines model for ListUsersByTeam_200_response. type ListUsersByTeam200Response struct { Items []User `json:"items"` @@ -1134,6 +1173,20 @@ type MembershipWithUser struct { User User `json:"user"` } +// PlatformTenantStatus Provisioning status of a platform tenant. +type PlatformTenantStatus string + +// PlatformTenantSummary Summary view of a Platform tenant returned by the self-serve list / status endpoints. Same shape as `POST /platform-signup` and `GET /teams/{team_name}/platform/tenant/{tenant_id}` responses. +type PlatformTenantSummary struct { + // Status Provisioning status of a platform tenant. + Status PlatformTenantStatus `json:"status"` + Subdomain string `json:"subdomain"` + + // TeamName The unique name for the team. + TeamName TeamName `json:"team_name"` + TenantId openapi_types.UUID `json:"tenant_id"` +} + // Plugin CloudQuery Plugin type Plugin struct { // Category Supported categories for plugins @@ -2147,6 +2200,9 @@ type VerifyUserEmailRequest struct { // Email Email address to verify Email interface{} `json:"email"` + // RequireBusiness When `true`, also reject the request with 400 if the email is on a public domain. + RequireBusiness *interface{} `json:"require_business,omitempty"` + // ReturnTo Return to this URL after verification ReturnTo *interface{} `json:"return_to,omitempty"` @@ -2569,6 +2625,9 @@ type UpdateAddonVersionJSONRequestBody = AddonVersionUpdate // CreateAddonVersionJSONRequestBody defines body for CreateAddonVersion for application/json ContentType. type CreateAddonVersionJSONRequestBody = CreateAddonVersionRequest +// CreatePlatformSignupJSONRequestBody defines body for CreatePlatformSignup for application/json ContentType. +type CreatePlatformSignupJSONRequestBody = CreatePlatformSignupRequest + // ActivatePlatformJSONRequestBody defines body for ActivatePlatform for application/json ContentType. type ActivatePlatformJSONRequestBody = ActivatePlatformRequest @@ -3388,6 +3447,113 @@ func (a ActivatePlatformRequest) MarshalJSON() ([]byte, error) { return json.Marshal(object) } +// Getter for additional properties for CreatePlatformSignupRequest. Returns the specified +// element and whether it was found +func (a CreatePlatformSignupRequest) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for CreatePlatformSignupRequest +func (a *CreatePlatformSignupRequest) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for CreatePlatformSignupRequest to handle AdditionalProperties +func (a *CreatePlatformSignupRequest) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["company"]; found { + err = json.Unmarshal(raw, &a.Company) + if err != nil { + return fmt.Errorf("error reading 'company': %w", err) + } + delete(object, "company") + } + + if raw, found := object["job_title"]; found { + err = json.Unmarshal(raw, &a.JobTitle) + if err != nil { + return fmt.Errorf("error reading 'job_title': %w", err) + } + delete(object, "job_title") + } + + if raw, found := object["name"]; found { + err = json.Unmarshal(raw, &a.Name) + if err != nil { + return fmt.Errorf("error reading 'name': %w", err) + } + delete(object, "name") + } + + if raw, found := object["team_name"]; found { + err = json.Unmarshal(raw, &a.TeamName) + if err != nil { + return fmt.Errorf("error reading 'team_name': %w", err) + } + delete(object, "team_name") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for CreatePlatformSignupRequest to handle AdditionalProperties +func (a CreatePlatformSignupRequest) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + object["company"], err = json.Marshal(a.Company) + if err != nil { + return nil, fmt.Errorf("error marshaling 'company': %w", err) + } + + object["job_title"], err = json.Marshal(a.JobTitle) + if err != nil { + return nil, fmt.Errorf("error marshaling 'job_title': %w", err) + } + + object["name"], err = json.Marshal(a.Name) + if err != nil { + return nil, fmt.Errorf("error marshaling 'name': %w", err) + } + + if a.TeamName != nil { + object["team_name"], err = json.Marshal(a.TeamName) + if err != nil { + return nil, fmt.Errorf("error marshaling 'team_name': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + // Getter for additional properties for CreateTeamRequest. Returns the specified // element and whether it was found func (a CreateTeamRequest) Get(fieldName string) (value interface{}, found bool) { @@ -4791,6 +4957,14 @@ func (a *VerifyUserEmailRequest) UnmarshalJSON(b []byte) error { delete(object, "email") } + if raw, found := object["require_business"]; found { + err = json.Unmarshal(raw, &a.RequireBusiness) + if err != nil { + return fmt.Errorf("error reading 'require_business': %w", err) + } + delete(object, "require_business") + } + if raw, found := object["return_to"]; found { err = json.Unmarshal(raw, &a.ReturnTo) if err != nil { @@ -4831,6 +5005,13 @@ func (a VerifyUserEmailRequest) MarshalJSON() ([]byte, error) { return nil, fmt.Errorf("error marshaling 'email': %w", err) } + if a.RequireBusiness != nil { + object["require_business"], err = json.Marshal(a.RequireBusiness) + if err != nil { + return nil, fmt.Errorf("error marshaling 'require_business': %w", err) + } + } + if a.ReturnTo != nil { object["return_to"], err = json.Marshal(a.ReturnTo) if err != nil { diff --git a/spec.json b/spec.json index f5863e1..4086c51 100644 --- a/spec.json +++ b/spec.json @@ -4164,6 +4164,178 @@ "x-internal" : true } }, + "/platform-signup" : { + "post" : { + "description" : "Self-serve entry point for a new Platform trial. The wizard collects `name`, `job_title`, `company` and, optionally, an existing `team_name` the caller wants to attach the new tenant to. Server side: re-runs UserCheck on the caller's email (personal / disposable / blocklisted / non-deliverable addresses are rejected with 400), auto-generates a subdomain, creates the owning Cloud team (or uses the supplied one), generates a per-tenant API key + password, and inserts the `platform_tenants` row in `pending` status.\nLifetime gate: a caller may successfully sign up at most once — match is on `platform_tenants.email == user.Email`. Subsequent calls return 422. Admin override is operational only (support deletes the blocking row in the DB).\nThe Firebase `email_verified` claim may be `false` — this is the only operation in the API surface that intentionally accepts unverified callers, because the wizard captures form data before the user clicks the Mandrill verification link. The wizard's \"continuing\" screen follows up with `POST /teams/{team_name}/platform/tenant/{tenant_id}/finalize` (which DOES require a verified email) once the user verifies. The returned `team_name` and `tenant_id` are the values the wizard passes back into `/finalize`.\n", + "operationId" : "CreatePlatformSignup", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CreatePlatformSignup_request" + } + } + } + }, + "responses" : { + "201" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CreatePlatformSignup_201_response" + } + } + }, + "description" : "Signup accepted; tenant provisioning has been queued." + }, + "400" : { + "$ref" : "#/components/responses/BadRequest" + }, + "401" : { + "$ref" : "#/components/responses/RequiresAuthentication" + }, + "404" : { + "$ref" : "#/components/responses/NotFound" + }, + "422" : { + "$ref" : "#/components/responses/UnprocessableEntity" + }, + "429" : { + "$ref" : "#/components/responses/TooManyRequests" + }, + "500" : { + "$ref" : "#/components/responses/InternalError" + } + }, + "tags" : [ "platform" ], + "x-internal" : true + } + }, + "/teams/{team_name}/platform/tenant/{tenant_id}" : { + "get" : { + "description" : "Read provisioning status of a Platform tenant owned by the given Cloud team. The authenticated user must be a member of `team_name`. Used by the signup wizard to poll until `status` becomes `active`.\n", + "operationId" : "GetTeamPlatformTenant", + "parameters" : [ { + "$ref" : "#/components/parameters/team_name" + }, { + "explode" : false, + "in" : "path", + "name" : "tenant_id", + "required" : true, + "schema" : { + "format" : "uuid", + "type" : "string" + }, + "style" : "simple" + } ], + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CreatePlatformSignup_201_response" + } + } + }, + "description" : "Tenant state" + }, + "401" : { + "$ref" : "#/components/responses/RequiresAuthentication" + }, + "403" : { + "$ref" : "#/components/responses/Forbidden" + }, + "404" : { + "$ref" : "#/components/responses/NotFound" + }, + "429" : { + "$ref" : "#/components/responses/TooManyRequests" + }, + "500" : { + "$ref" : "#/components/responses/InternalError" + } + }, + "tags" : [ "platform", "teams" ], + "x-internal" : true + } + }, + "/teams/{team_name}/platform/tenant/{tenant_id}/finalize" : { + "post" : { + "description" : "Trigger Platform tenant provisioning for a tenant that was created in `pending` state via `POST /platform-signup`. Requires the caller's Firebase `email_verified` claim to be `true` — opposite of the create endpoint, which intentionally accepts unverified-email callers so the wizard can capture form data eagerly. Idempotent: a second call after the tenant has advanced past `pending` is a no-op that returns the current state. The wizard's \"continuing\" screen calls this after the user clicks the verification email link and the client refreshes its Firebase ID token.\n", + "operationId" : "FinalizeTeamPlatformTenant", + "parameters" : [ { + "$ref" : "#/components/parameters/team_name" + }, { + "explode" : false, + "in" : "path", + "name" : "tenant_id", + "required" : true, + "schema" : { + "format" : "uuid", + "type" : "string" + }, + "style" : "simple" + } ], + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CreatePlatformSignup_201_response" + } + } + }, + "description" : "Finalization triggered (or no-op if already finalized)." + }, + "401" : { + "$ref" : "#/components/responses/RequiresAuthentication" + }, + "403" : { + "$ref" : "#/components/responses/Forbidden" + }, + "404" : { + "$ref" : "#/components/responses/NotFound" + }, + "429" : { + "$ref" : "#/components/responses/TooManyRequests" + }, + "500" : { + "$ref" : "#/components/responses/InternalError" + } + }, + "tags" : [ "platform", "teams" ], + "x-internal" : true + } + }, + "/user/platform/tenants" : { + "get" : { + "description" : "List Platform tenants the authenticated user can access via Cloud team membership. Used by the signup wizard to decide whether to show the tenant-creation form (empty list) or route the user to an existing tenant. Returns tenants in any status (pending/created/active).\n", + "operationId" : "ListUserPlatformTenants", + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ListUserPlatformTenants_200_response" + } + } + }, + "description" : "Tenant list" + }, + "401" : { + "$ref" : "#/components/responses/RequiresAuthentication" + }, + "429" : { + "$ref" : "#/components/responses/TooManyRequests" + }, + "500" : { + "$ref" : "#/components/responses/InternalError" + } + }, + "tags" : [ "platform", "users" ], + "x-internal" : true + } + }, "/users/{user_id}" : { "delete" : { "description" : "Delete user", @@ -7281,6 +7453,30 @@ }, "required" : [ "tenant_url" ] }, + "PlatformTenantStatus" : { + "description" : "Provisioning status of a platform tenant.", + "enum" : [ "pending", "created", "active" ], + "type" : "string" + }, + "PlatformTenantSummary" : { + "description" : "Summary view of a Platform tenant returned by the self-serve list / status endpoints. Same shape as `POST /platform-signup` and `GET /teams/{team_name}/platform/tenant/{tenant_id}` responses.\n", + "properties" : { + "tenant_id" : { + "format" : "uuid", + "type" : "string" + }, + "subdomain" : { + "type" : "string" + }, + "status" : { + "$ref" : "#/components/schemas/PlatformTenantStatus" + }, + "team_name" : { + "$ref" : "#/components/schemas/TeamName" + } + }, + "required" : [ "status", "subdomain", "team_name", "tenant_id" ] + }, "UserID" : { "description" : "ID of the User", "example" : "12345678-1234-1234-1234-1234567890ab", @@ -8165,6 +8361,10 @@ "subdomain" : { "description" : "Subdomain to use in the URL", "pattern" : "^[a-zA-Z0-9-]+$" + }, + "require_business" : { + "default" : false, + "description" : "When `true`, also reject the request with 400 if the email is on a public domain.\n" } }, "required" : [ "email" ] @@ -8277,6 +8477,63 @@ }, "required" : [ "has_cloud_account" ] }, + "CreatePlatformSignup_request" : { + "additionalProperties" : { }, + "properties" : { + "name" : { + "description" : "Full name of the user", + "maxLength" : 255, + "minLength" : 1 + }, + "job_title" : { + "description" : "User's job title (free text, e.g. \"Engineering Manager\"). Captured for analytics. Distinct from the Cloud team membership role (admin/member).\n", + "maxLength" : 255, + "minLength" : 1 + }, + "company" : { + "description" : "Company name (free text). Captured for analytics. On the auto-create-team path it is also used as the new Cloud team's `display_name` (the team `name` slug stays the auto-generated subdomain).\n", + "maxLength" : 255, + "minLength" : 1 + }, + "team_name" : { + "allOf" : [ { + "$ref" : "#/components/schemas/TeamName" + } ], + "description" : "Optional. When set the new tenant is attached to this existing Cloud team and no team is auto-created; the caller must be an ADMIN of the team or the request 404s (same response shape as an unknown team, so membership existence is not leaked). When unset, a new Cloud team is auto-created with `name = subdomain` and the signing-up user as its sole admin.\n" + } + }, + "required" : [ "company", "job_title", "name" ] + }, + "CreatePlatformSignup_201_response" : { + "properties" : { + "tenant_id" : { + "format" : "uuid", + "type" : "string" + }, + "subdomain" : { + "type" : "string" + }, + "status" : { + "$ref" : "#/components/schemas/PlatformTenantStatus" + }, + "team_name" : { + "$ref" : "#/components/schemas/TeamName" + } + }, + "required" : [ "status", "subdomain", "team_name", "tenant_id" ] + }, + "ListUserPlatformTenants_200_response" : { + "properties" : { + "items" : { + "items" : { + "$ref" : "#/components/schemas/PlatformTenantSummary" + }, + "type" : "array", + "x-go-type-skip-optional-pointer" : true + } + }, + "required" : [ "items" ] + }, "ListTeamAPIKeys_200_response" : { "properties" : { "items" : {