From 656dc9b048a017fb9fc418ec843bbfccffc0d3ad Mon Sep 17 00:00:00 2001 From: "cloudquery-ci[bot]" <271027272+cloudquery-ci[bot]@users.noreply.github.com> Date: Wed, 23 Sep 2026 14:22:49 +0000 Subject: [PATCH] fix: Generate CloudQuery Go API Client from `spec.json` --- client.gen.go | 1179 ++++++++++++++++++++++++++++++++++++++++++++----- models.gen.go | 406 +++++++++++++++++ spec.json | 550 +++++++++++++++++++++++ 3 files changed, 2027 insertions(+), 108 deletions(-) diff --git a/client.gen.go b/client.gen.go index 983b5f9..c94b662 100644 --- a/client.gen.go +++ b/client.gen.go @@ -143,6 +143,31 @@ type ClientInterface interface { CreateEnvZeroHandoff(ctx context.Context, body CreateEnvZeroHandoffJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // CreateEnvZeroSetupWithBody request with any body + CreateEnvZeroSetupWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateEnvZeroSetup(ctx context.Context, body CreateEnvZeroSetupJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CancelEnvZeroSetupWithBody request with any body + CancelEnvZeroSetupWithBody(ctx context.Context, operation EnvzeroSetupOperation, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CancelEnvZeroSetup(ctx context.Context, operation EnvzeroSetupOperation, body CancelEnvZeroSetupJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // LoginEnvZeroSetupWithBody request with any body + LoginEnvZeroSetupWithBody(ctx context.Context, operation EnvzeroSetupOperation, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + LoginEnvZeroSetup(ctx context.Context, operation EnvzeroSetupOperation, body LoginEnvZeroSetupJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // SetEnvZeroSetupPasswordWithBody request with any body + SetEnvZeroSetupPasswordWithBody(ctx context.Context, operation EnvzeroSetupOperation, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + SetEnvZeroSetupPassword(ctx context.Context, operation EnvzeroSetupOperation, body SetEnvZeroSetupPasswordJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetEnvZeroSetupStatusWithBody request with any body + GetEnvZeroSetupStatusWithBody(ctx context.Context, operation EnvzeroSetupOperation, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + GetEnvZeroSetupStatus(ctx context.Context, operation EnvzeroSetupOperation, body GetEnvZeroSetupStatusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // CQHealthCheck request CQHealthCheck(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -767,6 +792,126 @@ func (c *Client) CreateEnvZeroHandoff(ctx context.Context, body CreateEnvZeroHan return c.Client.Do(req) } +func (c *Client) CreateEnvZeroSetupWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateEnvZeroSetupRequestWithBody(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) CreateEnvZeroSetup(ctx context.Context, body CreateEnvZeroSetupJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateEnvZeroSetupRequest(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) CancelEnvZeroSetupWithBody(ctx context.Context, operation EnvzeroSetupOperation, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCancelEnvZeroSetupRequestWithBody(c.Server, operation, 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) CancelEnvZeroSetup(ctx context.Context, operation EnvzeroSetupOperation, body CancelEnvZeroSetupJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCancelEnvZeroSetupRequest(c.Server, operation, 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) LoginEnvZeroSetupWithBody(ctx context.Context, operation EnvzeroSetupOperation, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewLoginEnvZeroSetupRequestWithBody(c.Server, operation, 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) LoginEnvZeroSetup(ctx context.Context, operation EnvzeroSetupOperation, body LoginEnvZeroSetupJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewLoginEnvZeroSetupRequest(c.Server, operation, 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) SetEnvZeroSetupPasswordWithBody(ctx context.Context, operation EnvzeroSetupOperation, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSetEnvZeroSetupPasswordRequestWithBody(c.Server, operation, 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) SetEnvZeroSetupPassword(ctx context.Context, operation EnvzeroSetupOperation, body SetEnvZeroSetupPasswordJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSetEnvZeroSetupPasswordRequest(c.Server, operation, 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) GetEnvZeroSetupStatusWithBody(ctx context.Context, operation EnvzeroSetupOperation, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetEnvZeroSetupStatusRequestWithBody(c.Server, operation, 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) GetEnvZeroSetupStatus(ctx context.Context, operation EnvzeroSetupOperation, body GetEnvZeroSetupStatusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetEnvZeroSetupStatusRequest(c.Server, operation, 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) CQHealthCheck(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCQHealthCheckRequest(c.Server) if err != nil { @@ -3346,8 +3491,19 @@ func NewCreateEnvZeroHandoffRequestWithBody(server string, contentType string, b return req, nil } -// NewCQHealthCheckRequest generates requests for CQHealthCheck -func NewCQHealthCheckRequest(server string) (*http.Request, error) { +// NewCreateEnvZeroSetupRequest calls the generic CreateEnvZeroSetup builder with application/json body +func NewCreateEnvZeroSetupRequest(server string, body CreateEnvZeroSetupJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateEnvZeroSetupRequestWithBody(server, "application/json", bodyReader) +} + +// NewCreateEnvZeroSetupRequestWithBody generates requests for CreateEnvZeroSetup with any type of body +func NewCreateEnvZeroSetupRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -3355,7 +3511,7 @@ func NewCQHealthCheckRequest(server string) (*http.Request, error) { return nil, err } - operationPath := fmt.Sprintf("/cq-healthcheck") + operationPath := fmt.Sprintf("/api/envzero/setup") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3365,24 +3521,44 @@ func NewCQHealthCheckRequest(server string) (*http.Request, error) { return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewGetOpenAPIJSONRequest generates requests for GetOpenAPIJSON -func NewGetOpenAPIJSONRequest(server string) (*http.Request, error) { +// NewCancelEnvZeroSetupRequest calls the generic CancelEnvZeroSetup builder with application/json body +func NewCancelEnvZeroSetupRequest(server string, operation EnvzeroSetupOperation, body CancelEnvZeroSetupJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCancelEnvZeroSetupRequestWithBody(server, operation, "application/json", bodyReader) +} + +// NewCancelEnvZeroSetupRequestWithBody generates requests for CancelEnvZeroSetup with any type of body +func NewCancelEnvZeroSetupRequestWithBody(server string, operation EnvzeroSetupOperation, contentType string, body io.Reader) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "operation", runtime.ParamLocationPath, operation) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/openapi.json") + operationPath := fmt.Sprintf("/api/envzero/setup/%s/cancel", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3392,35 +3568,44 @@ func NewGetOpenAPIJSONRequest(server string) (*http.Request, error) { return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewUpsertPlatformDestinationSecretRequest calls the generic UpsertPlatformDestinationSecret builder with application/json body -func NewUpsertPlatformDestinationSecretRequest(server string, body UpsertPlatformDestinationSecretJSONRequestBody) (*http.Request, error) { +// NewLoginEnvZeroSetupRequest calls the generic LoginEnvZeroSetup builder with application/json body +func NewLoginEnvZeroSetupRequest(server string, operation EnvzeroSetupOperation, body LoginEnvZeroSetupJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewUpsertPlatformDestinationSecretRequestWithBody(server, "application/json", bodyReader) + return NewLoginEnvZeroSetupRequestWithBody(server, operation, "application/json", bodyReader) } -// NewUpsertPlatformDestinationSecretRequestWithBody generates requests for UpsertPlatformDestinationSecret with any type of body -func NewUpsertPlatformDestinationSecretRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewLoginEnvZeroSetupRequestWithBody generates requests for LoginEnvZeroSetup with any type of body +func NewLoginEnvZeroSetupRequestWithBody(server string, operation EnvzeroSetupOperation, contentType string, body io.Reader) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "operation", runtime.ParamLocationPath, operation) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/platform-destination/secret") + operationPath := fmt.Sprintf("/api/envzero/setup/%s/login", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3440,27 +3625,34 @@ func NewUpsertPlatformDestinationSecretRequestWithBody(server string, contentTyp return req, nil } -// NewCreatePlatformDestinationSessionRequest calls the generic CreatePlatformDestinationSession builder with application/json body -func NewCreatePlatformDestinationSessionRequest(server string, body CreatePlatformDestinationSessionJSONRequestBody) (*http.Request, error) { +// NewSetEnvZeroSetupPasswordRequest calls the generic SetEnvZeroSetupPassword builder with application/json body +func NewSetEnvZeroSetupPasswordRequest(server string, operation EnvzeroSetupOperation, body SetEnvZeroSetupPasswordJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreatePlatformDestinationSessionRequestWithBody(server, "application/json", bodyReader) + return NewSetEnvZeroSetupPasswordRequestWithBody(server, operation, "application/json", bodyReader) } -// NewCreatePlatformDestinationSessionRequestWithBody generates requests for CreatePlatformDestinationSession with any type of body -func NewCreatePlatformDestinationSessionRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewSetEnvZeroSetupPasswordRequestWithBody generates requests for SetEnvZeroSetupPassword with any type of body +func NewSetEnvZeroSetupPasswordRequestWithBody(server string, operation EnvzeroSetupOperation, contentType string, body io.Reader) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "operation", runtime.ParamLocationPath, operation) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/platform-destination/session") + operationPath := fmt.Sprintf("/api/envzero/setup/%s/password", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3480,27 +3672,34 @@ func NewCreatePlatformDestinationSessionRequestWithBody(server string, contentTy return req, nil } -// NewCreatePlatformSignupRequest calls the generic CreatePlatformSignup builder with application/json body -func NewCreatePlatformSignupRequest(server string, body CreatePlatformSignupJSONRequestBody) (*http.Request, error) { +// NewGetEnvZeroSetupStatusRequest calls the generic GetEnvZeroSetupStatus builder with application/json body +func NewGetEnvZeroSetupStatusRequest(server string, operation EnvzeroSetupOperation, body GetEnvZeroSetupStatusJSONRequestBody) (*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) + return NewGetEnvZeroSetupStatusRequestWithBody(server, operation, "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) { +// NewGetEnvZeroSetupStatusRequestWithBody generates requests for GetEnvZeroSetupStatus with any type of body +func NewGetEnvZeroSetupStatusRequestWithBody(server string, operation EnvzeroSetupOperation, contentType string, body io.Reader) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "operation", runtime.ParamLocationPath, operation) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/platform-signup") + operationPath := fmt.Sprintf("/api/envzero/setup/%s/status", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3520,34 +3719,43 @@ func NewCreatePlatformSignupRequestWithBody(server string, contentType string, b return req, nil } -// NewConsumePlatformTenantMagicLinkRequest calls the generic ConsumePlatformTenantMagicLink builder with application/json body -func NewConsumePlatformTenantMagicLinkRequest(server string, tenantID openapi_types.UUID, body ConsumePlatformTenantMagicLinkJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) +// NewCQHealthCheckRequest generates requests for CQHealthCheck +func NewCQHealthCheckRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewConsumePlatformTenantMagicLinkRequestWithBody(server, tenantID, "application/json", bodyReader) -} -// NewConsumePlatformTenantMagicLinkRequestWithBody generates requests for ConsumePlatformTenantMagicLink with any type of body -func NewConsumePlatformTenantMagicLinkRequestWithBody(server string, tenantID openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { - var err error + operationPath := fmt.Sprintf("/cq-healthcheck") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - var pathParam0 string + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "tenant_id", runtime.ParamLocationPath, tenantID) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } + return req, nil +} + +// NewGetOpenAPIJSONRequest generates requests for GetOpenAPIJSON +func NewGetOpenAPIJSONRequest(server string) (*http.Request, error) { + var err error + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/platform/%s/magic-link/consume", pathParam0) + operationPath := fmt.Sprintf("/openapi.json") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3557,44 +3765,35 @@ func NewConsumePlatformTenantMagicLinkRequestWithBody(server string, tenantID op return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewReportTenantPlatformDataRequest calls the generic ReportTenantPlatformData builder with application/json body -func NewReportTenantPlatformDataRequest(server string, tenantID openapi_types.UUID, body ReportTenantPlatformDataJSONRequestBody) (*http.Request, error) { +// NewUpsertPlatformDestinationSecretRequest calls the generic UpsertPlatformDestinationSecret builder with application/json body +func NewUpsertPlatformDestinationSecretRequest(server string, body UpsertPlatformDestinationSecretJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewReportTenantPlatformDataRequestWithBody(server, tenantID, "application/json", bodyReader) + return NewUpsertPlatformDestinationSecretRequestWithBody(server, "application/json", bodyReader) } -// NewReportTenantPlatformDataRequestWithBody generates requests for ReportTenantPlatformData with any type of body -func NewReportTenantPlatformDataRequestWithBody(server string, tenantID openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { +// NewUpsertPlatformDestinationSecretRequestWithBody generates requests for UpsertPlatformDestinationSecret with any type of body +func NewUpsertPlatformDestinationSecretRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error - var pathParam0 string - - pathParam0, 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("/platform/%s/report", pathParam0) + operationPath := fmt.Sprintf("/platform-destination/secret") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3614,8 +3813,19 @@ func NewReportTenantPlatformDataRequestWithBody(server string, tenantID openapi_ return req, nil } -// NewListPluginNotificationRequestsRequest generates requests for ListPluginNotificationRequests -func NewListPluginNotificationRequestsRequest(server string, params *ListPluginNotificationRequestsParams) (*http.Request, error) { +// NewCreatePlatformDestinationSessionRequest calls the generic CreatePlatformDestinationSession builder with application/json body +func NewCreatePlatformDestinationSessionRequest(server string, body CreatePlatformDestinationSessionJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreatePlatformDestinationSessionRequestWithBody(server, "application/json", bodyReader) +} + +// NewCreatePlatformDestinationSessionRequestWithBody generates requests for CreatePlatformDestinationSession with any type of body +func NewCreatePlatformDestinationSessionRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -3623,7 +3833,170 @@ func NewListPluginNotificationRequestsRequest(server string, params *ListPluginN return nil, err } - operationPath := fmt.Sprintf("/plugin-notification-requests") + operationPath := fmt.Sprintf("/platform-destination/session") + 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 +} + +// 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 +} + +// NewConsumePlatformTenantMagicLinkRequest calls the generic ConsumePlatformTenantMagicLink builder with application/json body +func NewConsumePlatformTenantMagicLinkRequest(server string, tenantID openapi_types.UUID, body ConsumePlatformTenantMagicLinkJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewConsumePlatformTenantMagicLinkRequestWithBody(server, tenantID, "application/json", bodyReader) +} + +// NewConsumePlatformTenantMagicLinkRequestWithBody generates requests for ConsumePlatformTenantMagicLink with any type of body +func NewConsumePlatformTenantMagicLinkRequestWithBody(server string, tenantID openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, 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("/platform/%s/magic-link/consume", pathParam0) + 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 +} + +// NewReportTenantPlatformDataRequest calls the generic ReportTenantPlatformData builder with application/json body +func NewReportTenantPlatformDataRequest(server string, tenantID openapi_types.UUID, body ReportTenantPlatformDataJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewReportTenantPlatformDataRequestWithBody(server, tenantID, "application/json", bodyReader) +} + +// NewReportTenantPlatformDataRequestWithBody generates requests for ReportTenantPlatformData with any type of body +func NewReportTenantPlatformDataRequestWithBody(server string, tenantID openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, 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("/platform/%s/report", pathParam0) + 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 +} + +// NewListPluginNotificationRequestsRequest generates requests for ListPluginNotificationRequests +func NewListPluginNotificationRequestsRequest(server string, params *ListPluginNotificationRequestsParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/plugin-notification-requests") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -9237,6 +9610,31 @@ type ClientWithResponsesInterface interface { CreateEnvZeroHandoffWithResponse(ctx context.Context, body CreateEnvZeroHandoffJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEnvZeroHandoffResponse, error) + // CreateEnvZeroSetupWithBodyWithResponse request with any body + CreateEnvZeroSetupWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEnvZeroSetupResponse, error) + + CreateEnvZeroSetupWithResponse(ctx context.Context, body CreateEnvZeroSetupJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEnvZeroSetupResponse, error) + + // CancelEnvZeroSetupWithBodyWithResponse request with any body + CancelEnvZeroSetupWithBodyWithResponse(ctx context.Context, operation EnvzeroSetupOperation, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CancelEnvZeroSetupResponse, error) + + CancelEnvZeroSetupWithResponse(ctx context.Context, operation EnvzeroSetupOperation, body CancelEnvZeroSetupJSONRequestBody, reqEditors ...RequestEditorFn) (*CancelEnvZeroSetupResponse, error) + + // LoginEnvZeroSetupWithBodyWithResponse request with any body + LoginEnvZeroSetupWithBodyWithResponse(ctx context.Context, operation EnvzeroSetupOperation, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*LoginEnvZeroSetupResponse, error) + + LoginEnvZeroSetupWithResponse(ctx context.Context, operation EnvzeroSetupOperation, body LoginEnvZeroSetupJSONRequestBody, reqEditors ...RequestEditorFn) (*LoginEnvZeroSetupResponse, error) + + // SetEnvZeroSetupPasswordWithBodyWithResponse request with any body + SetEnvZeroSetupPasswordWithBodyWithResponse(ctx context.Context, operation EnvzeroSetupOperation, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetEnvZeroSetupPasswordResponse, error) + + SetEnvZeroSetupPasswordWithResponse(ctx context.Context, operation EnvzeroSetupOperation, body SetEnvZeroSetupPasswordJSONRequestBody, reqEditors ...RequestEditorFn) (*SetEnvZeroSetupPasswordResponse, error) + + // GetEnvZeroSetupStatusWithBodyWithResponse request with any body + GetEnvZeroSetupStatusWithBodyWithResponse(ctx context.Context, operation EnvzeroSetupOperation, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GetEnvZeroSetupStatusResponse, error) + + GetEnvZeroSetupStatusWithResponse(ctx context.Context, operation EnvzeroSetupOperation, body GetEnvZeroSetupStatusJSONRequestBody, reqEditors ...RequestEditorFn) (*GetEnvZeroSetupStatusResponse, error) + // CQHealthCheckWithResponse request CQHealthCheckWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*CQHealthCheckResponse, error) @@ -9980,14 +10378,22 @@ func (r CreateEnvZeroHandoffResponse) StatusCode() int { return 0 } -type CQHealthCheckResponse struct { +type CreateEnvZeroSetupResponse struct { Body []byte HTTPResponse *http.Response + JSON200 *EnvZeroSetupCreated + JSON201 *EnvZeroSetupCreated + JSON400 *BadRequest + JSON401 *RequiresAuthentication + JSON409 *EnvZeroSetupConflictError + JSON410 *EnvZeroSetupGone + JSON422 *UnprocessableEntity + JSON429 *TooManyRequests JSON500 *InternalError } // Status returns HTTPResponse.Status -func (r CQHealthCheckResponse) Status() string { +func (r CreateEnvZeroSetupResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9995,21 +10401,24 @@ func (r CQHealthCheckResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CQHealthCheckResponse) StatusCode() int { +func (r CreateEnvZeroSetupResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetOpenAPIJSONResponse struct { +type CancelEnvZeroSetupResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *map[string]interface{} + JSON400 *BadRequest + JSON401 *RequiresAuthentication + JSON409 *EnvZeroSetupConflictError + JSON500 *InternalError } // Status returns HTTPResponse.Status -func (r GetOpenAPIJSONResponse) Status() string { +func (r CancelEnvZeroSetupResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -10017,25 +10426,28 @@ func (r GetOpenAPIJSONResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetOpenAPIJSONResponse) StatusCode() int { +func (r CancelEnvZeroSetupResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpsertPlatformDestinationSecretResponse struct { +type LoginEnvZeroSetupResponse struct { Body []byte HTTPResponse *http.Response + JSON201 *LoginEnvZeroSetup201Response JSON400 *BadRequest JSON401 *RequiresAuthentication JSON404 *NotFound - JSON429 *TooManyRequests + JSON409 *EnvZeroSetupConflictError + JSON410 *EnvZeroSetupGone JSON500 *InternalError + JSON503 *ServiceUnavailable } // Status returns HTTPResponse.Status -func (r UpsertPlatformDestinationSecretResponse) Status() string { +func (r LoginEnvZeroSetupResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -10043,27 +10455,28 @@ func (r UpsertPlatformDestinationSecretResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpsertPlatformDestinationSecretResponse) StatusCode() int { +func (r LoginEnvZeroSetupResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreatePlatformDestinationSessionResponse struct { +type SetEnvZeroSetupPasswordResponse struct { Body []byte HTTPResponse *http.Response - JSON201 *CreatePlatformDestinationSession201Response JSON400 *BadRequest JSON401 *RequiresAuthentication JSON404 *NotFound + JSON409 *EnvZeroSetupConflictError + JSON410 *EnvZeroSetupGone JSON422 *UnprocessableEntity - JSON429 *TooManyRequests JSON500 *InternalError + JSON502 *BasicError } // Status returns HTTPResponse.Status -func (r CreatePlatformDestinationSessionResponse) Status() string { +func (r SetEnvZeroSetupPasswordResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -10071,27 +10484,26 @@ func (r CreatePlatformDestinationSessionResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreatePlatformDestinationSessionResponse) StatusCode() int { +func (r SetEnvZeroSetupPasswordResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreatePlatformSignupResponse struct { +type GetEnvZeroSetupStatusResponse struct { Body []byte HTTPResponse *http.Response - JSON201 *CreatePlatformSignup201Response + JSON200 *EnvZeroSetupRecord JSON400 *BadRequest JSON401 *RequiresAuthentication JSON404 *NotFound - JSON422 *UnprocessableEntity - JSON429 *TooManyRequests + JSON410 *EnvZeroSetupGone JSON500 *InternalError } // Status returns HTTPResponse.Status -func (r CreatePlatformSignupResponse) Status() string { +func (r GetEnvZeroSetupStatusResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -10099,26 +10511,21 @@ func (r CreatePlatformSignupResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreatePlatformSignupResponse) StatusCode() int { +func (r GetEnvZeroSetupStatusResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ConsumePlatformTenantMagicLinkResponse struct { +type CQHealthCheckResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *RemoveTeamMembershipRequest - JSON400 *BadRequest - JSON403 *Forbidden - JSON404 *NotFound - JSON429 *TooManyRequests JSON500 *InternalError } // Status returns HTTPResponse.Status -func (r ConsumePlatformTenantMagicLinkResponse) Status() string { +func (r CQHealthCheckResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -10126,25 +10533,21 @@ func (r ConsumePlatformTenantMagicLinkResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ConsumePlatformTenantMagicLinkResponse) StatusCode() int { +func (r CQHealthCheckResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ReportTenantPlatformDataResponse struct { +type GetOpenAPIJSONResponse struct { Body []byte HTTPResponse *http.Response - JSON400 *BadRequest - JSON403 *Forbidden - JSON404 *NotFound - JSON429 *TooManyRequests - JSON500 *InternalError + JSON200 *map[string]interface{} } // Status returns HTTPResponse.Status -func (r ReportTenantPlatformDataResponse) Status() string { +func (r GetOpenAPIJSONResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -10152,23 +10555,25 @@ func (r ReportTenantPlatformDataResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ReportTenantPlatformDataResponse) StatusCode() int { +func (r GetOpenAPIJSONResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ListPluginNotificationRequestsResponse struct { +type UpsertPlatformDestinationSecretResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ListPluginNotificationRequests200Response + JSON400 *BadRequest JSON401 *RequiresAuthentication + JSON404 *NotFound + JSON429 *TooManyRequests JSON500 *InternalError } // Status returns HTTPResponse.Status -func (r ListPluginNotificationRequestsResponse) Status() string { +func (r UpsertPlatformDestinationSecretResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -10176,27 +10581,27 @@ func (r ListPluginNotificationRequestsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListPluginNotificationRequestsResponse) StatusCode() int { +func (r UpsertPlatformDestinationSecretResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreatePluginNotificationRequestResponse struct { +type CreatePlatformDestinationSessionResponse struct { Body []byte HTTPResponse *http.Response - JSON201 *PluginNotificationRequest + JSON201 *CreatePlatformDestinationSession201Response JSON400 *BadRequest JSON401 *RequiresAuthentication - JSON403 *Forbidden JSON404 *NotFound JSON422 *UnprocessableEntity + JSON429 *TooManyRequests JSON500 *InternalError } // Status returns HTTPResponse.Status -func (r CreatePluginNotificationRequestResponse) Status() string { +func (r CreatePlatformDestinationSessionResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -10204,23 +10609,27 @@ func (r CreatePluginNotificationRequestResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreatePluginNotificationRequestResponse) StatusCode() int { +func (r CreatePlatformDestinationSessionResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeletePluginNotificationRequestResponse struct { +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 DeletePluginNotificationRequestResponse) Status() string { +func (r CreatePlatformSignupResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -10228,7 +10637,136 @@ func (r DeletePluginNotificationRequestResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeletePluginNotificationRequestResponse) StatusCode() int { +func (r CreatePlatformSignupResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ConsumePlatformTenantMagicLinkResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *RemoveTeamMembershipRequest + JSON400 *BadRequest + JSON403 *Forbidden + JSON404 *NotFound + JSON429 *TooManyRequests + JSON500 *InternalError +} + +// Status returns HTTPResponse.Status +func (r ConsumePlatformTenantMagicLinkResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ConsumePlatformTenantMagicLinkResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ReportTenantPlatformDataResponse struct { + Body []byte + HTTPResponse *http.Response + JSON400 *BadRequest + JSON403 *Forbidden + JSON404 *NotFound + JSON429 *TooManyRequests + JSON500 *InternalError +} + +// Status returns HTTPResponse.Status +func (r ReportTenantPlatformDataResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ReportTenantPlatformDataResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListPluginNotificationRequestsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ListPluginNotificationRequests200Response + JSON401 *RequiresAuthentication + JSON500 *InternalError +} + +// Status returns HTTPResponse.Status +func (r ListPluginNotificationRequestsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListPluginNotificationRequestsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreatePluginNotificationRequestResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *PluginNotificationRequest + JSON400 *BadRequest + JSON401 *RequiresAuthentication + JSON403 *Forbidden + JSON404 *NotFound + JSON422 *UnprocessableEntity + JSON500 *InternalError +} + +// Status returns HTTPResponse.Status +func (r CreatePluginNotificationRequestResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreatePluginNotificationRequestResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeletePluginNotificationRequestResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *RequiresAuthentication + JSON404 *NotFound + JSON500 *InternalError +} + +// Status returns HTTPResponse.Status +func (r DeletePluginNotificationRequestResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeletePluginNotificationRequestResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -12940,6 +13478,91 @@ func (c *ClientWithResponses) CreateEnvZeroHandoffWithResponse(ctx context.Conte return ParseCreateEnvZeroHandoffResponse(rsp) } +// CreateEnvZeroSetupWithBodyWithResponse request with arbitrary body returning *CreateEnvZeroSetupResponse +func (c *ClientWithResponses) CreateEnvZeroSetupWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEnvZeroSetupResponse, error) { + rsp, err := c.CreateEnvZeroSetupWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateEnvZeroSetupResponse(rsp) +} + +func (c *ClientWithResponses) CreateEnvZeroSetupWithResponse(ctx context.Context, body CreateEnvZeroSetupJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEnvZeroSetupResponse, error) { + rsp, err := c.CreateEnvZeroSetup(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateEnvZeroSetupResponse(rsp) +} + +// CancelEnvZeroSetupWithBodyWithResponse request with arbitrary body returning *CancelEnvZeroSetupResponse +func (c *ClientWithResponses) CancelEnvZeroSetupWithBodyWithResponse(ctx context.Context, operation EnvzeroSetupOperation, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CancelEnvZeroSetupResponse, error) { + rsp, err := c.CancelEnvZeroSetupWithBody(ctx, operation, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCancelEnvZeroSetupResponse(rsp) +} + +func (c *ClientWithResponses) CancelEnvZeroSetupWithResponse(ctx context.Context, operation EnvzeroSetupOperation, body CancelEnvZeroSetupJSONRequestBody, reqEditors ...RequestEditorFn) (*CancelEnvZeroSetupResponse, error) { + rsp, err := c.CancelEnvZeroSetup(ctx, operation, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCancelEnvZeroSetupResponse(rsp) +} + +// LoginEnvZeroSetupWithBodyWithResponse request with arbitrary body returning *LoginEnvZeroSetupResponse +func (c *ClientWithResponses) LoginEnvZeroSetupWithBodyWithResponse(ctx context.Context, operation EnvzeroSetupOperation, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*LoginEnvZeroSetupResponse, error) { + rsp, err := c.LoginEnvZeroSetupWithBody(ctx, operation, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseLoginEnvZeroSetupResponse(rsp) +} + +func (c *ClientWithResponses) LoginEnvZeroSetupWithResponse(ctx context.Context, operation EnvzeroSetupOperation, body LoginEnvZeroSetupJSONRequestBody, reqEditors ...RequestEditorFn) (*LoginEnvZeroSetupResponse, error) { + rsp, err := c.LoginEnvZeroSetup(ctx, operation, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseLoginEnvZeroSetupResponse(rsp) +} + +// SetEnvZeroSetupPasswordWithBodyWithResponse request with arbitrary body returning *SetEnvZeroSetupPasswordResponse +func (c *ClientWithResponses) SetEnvZeroSetupPasswordWithBodyWithResponse(ctx context.Context, operation EnvzeroSetupOperation, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetEnvZeroSetupPasswordResponse, error) { + rsp, err := c.SetEnvZeroSetupPasswordWithBody(ctx, operation, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSetEnvZeroSetupPasswordResponse(rsp) +} + +func (c *ClientWithResponses) SetEnvZeroSetupPasswordWithResponse(ctx context.Context, operation EnvzeroSetupOperation, body SetEnvZeroSetupPasswordJSONRequestBody, reqEditors ...RequestEditorFn) (*SetEnvZeroSetupPasswordResponse, error) { + rsp, err := c.SetEnvZeroSetupPassword(ctx, operation, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSetEnvZeroSetupPasswordResponse(rsp) +} + +// GetEnvZeroSetupStatusWithBodyWithResponse request with arbitrary body returning *GetEnvZeroSetupStatusResponse +func (c *ClientWithResponses) GetEnvZeroSetupStatusWithBodyWithResponse(ctx context.Context, operation EnvzeroSetupOperation, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GetEnvZeroSetupStatusResponse, error) { + rsp, err := c.GetEnvZeroSetupStatusWithBody(ctx, operation, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetEnvZeroSetupStatusResponse(rsp) +} + +func (c *ClientWithResponses) GetEnvZeroSetupStatusWithResponse(ctx context.Context, operation EnvzeroSetupOperation, body GetEnvZeroSetupStatusJSONRequestBody, reqEditors ...RequestEditorFn) (*GetEnvZeroSetupStatusResponse, error) { + rsp, err := c.GetEnvZeroSetupStatus(ctx, operation, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetEnvZeroSetupStatusResponse(rsp) +} + // CQHealthCheckWithResponse request returning *CQHealthCheckResponse func (c *ClientWithResponses) CQHealthCheckWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*CQHealthCheckResponse, error) { rsp, err := c.CQHealthCheck(ctx, reqEditors...) @@ -14925,6 +15548,346 @@ func ParseCreateEnvZeroHandoffResponse(rsp *http.Response) (*CreateEnvZeroHandof return response, nil } +// ParseCreateEnvZeroSetupResponse parses an HTTP response from a CreateEnvZeroSetupWithResponse call +func ParseCreateEnvZeroSetupResponse(rsp *http.Response) (*CreateEnvZeroSetupResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &CreateEnvZeroSetupResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest EnvZeroSetupCreated + 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 == 201: + var dest EnvZeroSetupCreated + 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 == 409: + var dest EnvZeroSetupConflictError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 410: + var dest EnvZeroSetupGone + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON410 = &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 +} + +// ParseCancelEnvZeroSetupResponse parses an HTTP response from a CancelEnvZeroSetupWithResponse call +func ParseCancelEnvZeroSetupResponse(rsp *http.Response) (*CancelEnvZeroSetupResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &CancelEnvZeroSetupResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + 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 == 409: + var dest EnvZeroSetupConflictError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &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 +} + +// ParseLoginEnvZeroSetupResponse parses an HTTP response from a LoginEnvZeroSetupWithResponse call +func ParseLoginEnvZeroSetupResponse(rsp *http.Response) (*LoginEnvZeroSetupResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &LoginEnvZeroSetupResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest LoginEnvZeroSetup201Response + 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 == 409: + var dest EnvZeroSetupConflictError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 410: + var dest EnvZeroSetupGone + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON410 = &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 + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ServiceUnavailable + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + + } + + return response, nil +} + +// ParseSetEnvZeroSetupPasswordResponse parses an HTTP response from a SetEnvZeroSetupPasswordWithResponse call +func ParseSetEnvZeroSetupPasswordResponse(rsp *http.Response) (*SetEnvZeroSetupPasswordResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &SetEnvZeroSetupPasswordResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + 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 == 409: + var dest EnvZeroSetupConflictError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 410: + var dest EnvZeroSetupGone + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON410 = &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 == 500: + var dest InternalError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502: + var dest BasicError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON502 = &dest + + } + + return response, nil +} + +// ParseGetEnvZeroSetupStatusResponse parses an HTTP response from a GetEnvZeroSetupStatusWithResponse call +func ParseGetEnvZeroSetupStatusResponse(rsp *http.Response) (*GetEnvZeroSetupStatusResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetEnvZeroSetupStatusResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest EnvZeroSetupRecord + 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 == 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 == 410: + var dest EnvZeroSetupGone + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON410 = &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 +} + // ParseCQHealthCheckResponse parses an HTTP response from a CQHealthCheckWithResponse call func ParseCQHealthCheckResponse(rsp *http.Response) (*CQHealthCheckResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) diff --git a/models.gen.go b/models.gen.go index 5499ad7..e8ff348 100644 --- a/models.gen.go +++ b/models.gen.go @@ -64,6 +64,11 @@ const ( ContentTypeImagewebp ContentType = "image/webp" ) +// Defines values for CreateEnvZeroSetupRequestSource. +const ( + CreateEnvZeroSetupRequestSourceEnvzero CreateEnvZeroSetupRequestSource = "envzero" +) + // Defines values for EmailTeamInvitationRequestRole. const ( EmailTeamInvitationRequestRoleAdmin EmailTeamInvitationRequestRole = "admin" @@ -75,6 +80,104 @@ const ( EnvZeroConflictErrorCodeEmailExists EnvZeroConflictErrorCode = "email_exists" ) +// Defines values for EnvZeroSetupConflictErrorCode. +const ( + EnvZeroSetupConflictErrorCodeEmailExists EnvZeroSetupConflictErrorCode = "email_exists" + EnvZeroSetupConflictErrorCodeLoginUnavailable EnvZeroSetupConflictErrorCode = "login_unavailable" + EnvZeroSetupConflictErrorCodeNotReady EnvZeroSetupConflictErrorCode = "not_ready" + EnvZeroSetupConflictErrorCodeSetupInProgress EnvZeroSetupConflictErrorCode = "setup_in_progress" +) + +// Defines values for EnvZeroSetupConflictErrorDelivery. +const ( + EnvZeroSetupConflictErrorDeliveryDelivered EnvZeroSetupConflictErrorDelivery = "delivered" + EnvZeroSetupConflictErrorDeliveryFailed EnvZeroSetupConflictErrorDelivery = "failed" + EnvZeroSetupConflictErrorDeliveryPending EnvZeroSetupConflictErrorDelivery = "pending" + EnvZeroSetupConflictErrorDeliveryUndeliverable EnvZeroSetupConflictErrorDelivery = "undeliverable" +) + +// Defines values for EnvZeroSetupConflictErrorLogin. +const ( + EnvZeroSetupConflictErrorLoginPending EnvZeroSetupConflictErrorLogin = "pending" + EnvZeroSetupConflictErrorLoginReady EnvZeroSetupConflictErrorLogin = "ready" + EnvZeroSetupConflictErrorLoginUnavailable EnvZeroSetupConflictErrorLogin = "unavailable" +) + +// Defines values for EnvZeroSetupConflictErrorPassword. +const ( + EnvZeroSetupConflictErrorPasswordSet EnvZeroSetupConflictErrorPassword = "set" + EnvZeroSetupConflictErrorPasswordUnset EnvZeroSetupConflictErrorPassword = "unset" +) + +// Defines values for EnvZeroSetupConflictErrorProvisioning. +const ( + EnvZeroSetupConflictErrorProvisioningBlocked EnvZeroSetupConflictErrorProvisioning = "blocked" + EnvZeroSetupConflictErrorProvisioningCreated EnvZeroSetupConflictErrorProvisioning = "created" + EnvZeroSetupConflictErrorProvisioningFailed EnvZeroSetupConflictErrorProvisioning = "failed" + EnvZeroSetupConflictErrorProvisioningPending EnvZeroSetupConflictErrorProvisioning = "pending" + EnvZeroSetupConflictErrorProvisioningStuck EnvZeroSetupConflictErrorProvisioning = "stuck" +) + +// Defines values for EnvZeroSetupRecordDelivery. +const ( + EnvZeroSetupRecordDeliveryDelivered EnvZeroSetupRecordDelivery = "delivered" + EnvZeroSetupRecordDeliveryFailed EnvZeroSetupRecordDelivery = "failed" + EnvZeroSetupRecordDeliveryPending EnvZeroSetupRecordDelivery = "pending" + EnvZeroSetupRecordDeliveryUndeliverable EnvZeroSetupRecordDelivery = "undeliverable" +) + +// Defines values for EnvZeroSetupRecordLogin. +const ( + EnvZeroSetupRecordLoginPending EnvZeroSetupRecordLogin = "pending" + EnvZeroSetupRecordLoginReady EnvZeroSetupRecordLogin = "ready" + EnvZeroSetupRecordLoginUnavailable EnvZeroSetupRecordLogin = "unavailable" +) + +// Defines values for EnvZeroSetupRecordPassword. +const ( + EnvZeroSetupRecordPasswordSet EnvZeroSetupRecordPassword = "set" + EnvZeroSetupRecordPasswordUnset EnvZeroSetupRecordPassword = "unset" +) + +// Defines values for EnvZeroSetupRecordProvisioning. +const ( + EnvZeroSetupRecordProvisioningBlocked EnvZeroSetupRecordProvisioning = "blocked" + EnvZeroSetupRecordProvisioningCreated EnvZeroSetupRecordProvisioning = "created" + EnvZeroSetupRecordProvisioningFailed EnvZeroSetupRecordProvisioning = "failed" + EnvZeroSetupRecordProvisioningPending EnvZeroSetupRecordProvisioning = "pending" + EnvZeroSetupRecordProvisioningStuck EnvZeroSetupRecordProvisioning = "stuck" +) + +// Defines values for EnvZeroSetupRecordFieldsDelivery. +const ( + EnvZeroSetupRecordFieldsDeliveryDelivered EnvZeroSetupRecordFieldsDelivery = "delivered" + EnvZeroSetupRecordFieldsDeliveryFailed EnvZeroSetupRecordFieldsDelivery = "failed" + EnvZeroSetupRecordFieldsDeliveryPending EnvZeroSetupRecordFieldsDelivery = "pending" + EnvZeroSetupRecordFieldsDeliveryUndeliverable EnvZeroSetupRecordFieldsDelivery = "undeliverable" +) + +// Defines values for EnvZeroSetupRecordFieldsLogin. +const ( + EnvZeroSetupRecordFieldsLoginPending EnvZeroSetupRecordFieldsLogin = "pending" + EnvZeroSetupRecordFieldsLoginReady EnvZeroSetupRecordFieldsLogin = "ready" + EnvZeroSetupRecordFieldsLoginUnavailable EnvZeroSetupRecordFieldsLogin = "unavailable" +) + +// Defines values for EnvZeroSetupRecordFieldsPassword. +const ( + EnvZeroSetupRecordFieldsPasswordSet EnvZeroSetupRecordFieldsPassword = "set" + EnvZeroSetupRecordFieldsPasswordUnset EnvZeroSetupRecordFieldsPassword = "unset" +) + +// Defines values for EnvZeroSetupRecordFieldsProvisioning. +const ( + EnvZeroSetupRecordFieldsProvisioningBlocked EnvZeroSetupRecordFieldsProvisioning = "blocked" + EnvZeroSetupRecordFieldsProvisioningCreated EnvZeroSetupRecordFieldsProvisioning = "created" + EnvZeroSetupRecordFieldsProvisioningFailed EnvZeroSetupRecordFieldsProvisioning = "failed" + EnvZeroSetupRecordFieldsProvisioningPending EnvZeroSetupRecordFieldsProvisioning = "pending" + EnvZeroSetupRecordFieldsProvisioningStuck EnvZeroSetupRecordFieldsProvisioning = "stuck" +) + // Defines values for ManagedDatabaseStatus. const ( ManagedDatabaseStatusExpired ManagedDatabaseStatus = "expired" @@ -602,6 +705,22 @@ type BasicError struct { Status int `json:"status"` } +// CancelEnvZeroSetupRequest defines model for CancelEnvZeroSetup_request. +type CancelEnvZeroSetupRequest struct { + // Email The admin's email, lowercased. + Email openapi_types.Email `json:"email"` + + // Environment env0 environment (`STAGE`) the operation belongs to. + Environment string `json:"environment"` + + // EnvzeroOrgId env0 organization id. + EnvzeroOrgId string `json:"envzero_org_id"` + + // EnvzeroUserId env0 user id (Auth0 `sub`) of the admin driving the setup. + EnvzeroUserId string `json:"envzero_user_id"` + Staging *bool `json:"staging,omitempty"` +} + // CheckUserAuthStatus200Response defines model for CheckUserAuthStatus_200_response. type CheckUserAuthStatus200Response struct { // Authenticated Whether the user is authenticated @@ -666,6 +785,36 @@ type CreateEnvZeroHandoffRequest struct { AdditionalProperties map[string]interface{} `json:"-"` } +// CreateEnvZeroSetupRequest defines model for CreateEnvZeroSetup_request. +type CreateEnvZeroSetupRequest struct { + DisplayName *string `json:"display_name,omitempty"` + + // Email The admin's email, lowercased. + Email openapi_types.Email `json:"email"` + + // Environment env0 environment (`STAGE`) the operation belongs to. + Environment string `json:"environment"` + EnvzeroApiKeyId string `json:"envzero_api_key_id"` + EnvzeroApiKeySecret string `json:"envzero_api_key_secret"` + + // EnvzeroOrgId env0 organization id. + EnvzeroOrgId string `json:"envzero_org_id"` + + // EnvzeroUserId env0 user id (Auth0 `sub`) of the admin driving the setup. + EnvzeroUserId string `json:"envzero_user_id"` + + // Operation env0's id for this attempt; also the callback handoff_id. + Operation openapi_types.UUID `json:"operation"` + Source CreateEnvZeroSetupRequestSource `json:"source"` + Staging *bool `json:"staging,omitempty"` + + // TermsAcceptedAt When the admin accepted the CloudQuery terms. Must not be in the future. + TermsAcceptedAt time.Time `json:"terms_accepted_at"` +} + +// CreateEnvZeroSetupRequestSource defines model for CreateEnvZeroSetupRequest.Source. +type CreateEnvZeroSetupRequestSource string + // CreatePlatformDestinationSession201Response defines model for CreatePlatformDestinationSession_201_response. type CreatePlatformDestinationSession201Response struct { // ApiUrl Base URL of the tenant's platform API (e.g. https://acme.us.platform.cloudquery.io). The CLI uses it to reach /external-syncs/* directly — no CQ_PLATFORM_API_URL configuration needed. @@ -853,6 +1002,122 @@ type EnvZeroConflictError struct { // EnvZeroConflictErrorCode Machine-readable conflict reason. `email_exists` means the email already runs a CloudQuery Platform tenant (or another org's live handoff holds it), so env0 should fall back to its manual connect flow instead of retrying. A Cloud-only account never triggers this — its owner signs in on the signup page and continues the handoff. type EnvZeroConflictErrorCode string +// EnvZeroSetupBindings The identity bindings fixed when the operation was reserved. Every setup call carries them and they must equal the assertion's claims. +type EnvZeroSetupBindings struct { + // Email The admin's email, lowercased. + Email openapi_types.Email `json:"email"` + + // Environment env0 environment (`STAGE`) the operation belongs to. + Environment string `json:"environment"` + + // EnvzeroOrgId env0 organization id. + EnvzeroOrgId string `json:"envzero_org_id"` + + // EnvzeroUserId env0 user id (Auth0 `sub`) of the admin driving the setup. + EnvzeroUserId string `json:"envzero_user_id"` +} + +// EnvZeroSetupConflictError defines model for EnvZeroSetupConflictError. +type EnvZeroSetupConflictError struct { + // Code Machine-readable conflict reason. `email_exists`: the email already runs a CloudQuery Platform tenant or another org's live record holds it; env0 falls back to its manual connect flow. `setup_in_progress`: another operation holds this org's reservation; its record is carried flat in this body so env0 can adopt it. `not_ready`: the tenant or its first user does not exist yet. `login_unavailable`: the first user exists but cannot use magic-link login. + Code EnvZeroSetupConflictErrorCode `json:"code"` + Delivery *EnvZeroSetupConflictErrorDelivery `json:"delivery,omitempty"` + Email *string `json:"email,omitempty"` + Environment *string `json:"environment,omitempty"` + EnvzeroUserId *string `json:"envzero_user_id,omitempty"` + Failure *EnvZeroSetupRecordFieldsFailure `json:"failure,omitempty"` + Login *EnvZeroSetupConflictErrorLogin `json:"login,omitempty"` + Message string `json:"message"` + Operation *openapi_types.UUID `json:"operation,omitempty"` + Password *EnvZeroSetupConflictErrorPassword `json:"password,omitempty"` + Provisioning *EnvZeroSetupConflictErrorProvisioning `json:"provisioning,omitempty"` + Status int `json:"status"` + TenantId *openapi_types.UUID `json:"tenant_id,omitempty"` + TenantUrl *string `json:"tenant_url,omitempty"` +} + +// EnvZeroSetupConflictErrorCode Machine-readable conflict reason. `email_exists`: the email already runs a CloudQuery Platform tenant or another org's live record holds it; env0 falls back to its manual connect flow. `setup_in_progress`: another operation holds this org's reservation; its record is carried flat in this body so env0 can adopt it. `not_ready`: the tenant or its first user does not exist yet. `login_unavailable`: the first user exists but cannot use magic-link login. +type EnvZeroSetupConflictErrorCode string + +// EnvZeroSetupConflictErrorDelivery defines model for EnvZeroSetupConflictError.Delivery. +type EnvZeroSetupConflictErrorDelivery string + +// EnvZeroSetupConflictErrorLogin defines model for EnvZeroSetupConflictError.Login. +type EnvZeroSetupConflictErrorLogin string + +// EnvZeroSetupConflictErrorPassword defines model for EnvZeroSetupConflictError.Password. +type EnvZeroSetupConflictErrorPassword string + +// EnvZeroSetupConflictErrorProvisioning defines model for EnvZeroSetupConflictError.Provisioning. +type EnvZeroSetupConflictErrorProvisioning string + +// EnvZeroSetupCreated defines model for EnvZeroSetupCreated. +type EnvZeroSetupCreated struct { + Operation openapi_types.UUID `json:"operation"` + TenantId openapi_types.UUID `json:"tenant_id"` + TenantUrl string `json:"tenant_url"` +} + +// EnvZeroSetupRecord defines model for EnvZeroSetupRecord. +type EnvZeroSetupRecord struct { + Delivery EnvZeroSetupRecordDelivery `json:"delivery"` + Email string `json:"email"` + Environment string `json:"environment"` + EnvzeroUserId string `json:"envzero_user_id"` + Failure *EnvZeroSetupRecordFieldsFailure `json:"failure,omitempty"` + Login EnvZeroSetupRecordLogin `json:"login"` + Operation openapi_types.UUID `json:"operation"` + Password EnvZeroSetupRecordPassword `json:"password"` + Provisioning EnvZeroSetupRecordProvisioning `json:"provisioning"` + TenantId *openapi_types.UUID `json:"tenant_id,omitempty"` + TenantUrl *string `json:"tenant_url,omitempty"` +} + +// EnvZeroSetupRecordDelivery defines model for EnvZeroSetupRecord.Delivery. +type EnvZeroSetupRecordDelivery string + +// EnvZeroSetupRecordLogin defines model for EnvZeroSetupRecord.Login. +type EnvZeroSetupRecordLogin string + +// EnvZeroSetupRecordPassword defines model for EnvZeroSetupRecord.Password. +type EnvZeroSetupRecordPassword string + +// EnvZeroSetupRecordProvisioning defines model for EnvZeroSetupRecord.Provisioning. +type EnvZeroSetupRecordProvisioning string + +// EnvZeroSetupRecordFields The fields of a setup operation's state (ATL-468 contract section 4.1), none required. `EnvZeroSetupRecord` requires the identity and state axes; `EnvZeroSetupConflictError` carries them flat beside `code` only for `setup_in_progress`. +type EnvZeroSetupRecordFields struct { + Delivery *EnvZeroSetupRecordFieldsDelivery `json:"delivery,omitempty"` + Email *string `json:"email,omitempty"` + Environment *string `json:"environment,omitempty"` + EnvzeroUserId *string `json:"envzero_user_id,omitempty"` + Failure *EnvZeroSetupRecordFieldsFailure `json:"failure,omitempty"` + Login *EnvZeroSetupRecordFieldsLogin `json:"login,omitempty"` + Operation *openapi_types.UUID `json:"operation,omitempty"` + Password *EnvZeroSetupRecordFieldsPassword `json:"password,omitempty"` + Provisioning *EnvZeroSetupRecordFieldsProvisioning `json:"provisioning,omitempty"` + TenantId *openapi_types.UUID `json:"tenant_id,omitempty"` + TenantUrl *string `json:"tenant_url,omitempty"` +} + +// EnvZeroSetupRecordFieldsDelivery defines model for EnvZeroSetupRecordFields.Delivery. +type EnvZeroSetupRecordFieldsDelivery string + +// EnvZeroSetupRecordFieldsLogin defines model for EnvZeroSetupRecordFields.Login. +type EnvZeroSetupRecordFieldsLogin string + +// EnvZeroSetupRecordFieldsPassword defines model for EnvZeroSetupRecordFields.Password. +type EnvZeroSetupRecordFieldsPassword string + +// EnvZeroSetupRecordFieldsProvisioning defines model for EnvZeroSetupRecordFields.Provisioning. +type EnvZeroSetupRecordFieldsProvisioning string + +// EnvZeroSetupRecordFieldsFailure defines model for EnvZeroSetupRecordFields_failure. +type EnvZeroSetupRecordFieldsFailure struct { + Code string `json:"code"` + Detail *string `json:"detail,omitempty"` +} + // FieldError defines model for FieldError. type FieldError struct { Errors *[]string `json:"errors,omitempty"` @@ -1198,6 +1463,30 @@ type ListUsersByTeam200Response struct { Metadata ListMetadata `json:"metadata"` } +// LoginEnvZeroSetup201Response defines model for LoginEnvZeroSetup_201_response. +type LoginEnvZeroSetup201Response struct { + ExpiresInSeconds interface{} `json:"expires_in_seconds"` + MagicUrl string `json:"magic_url"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// LoginEnvZeroSetupRequest defines model for LoginEnvZeroSetup_request. +type LoginEnvZeroSetupRequest struct { + // Email The admin's email, lowercased. + Email openapi_types.Email `json:"email"` + + // Environment env0 environment (`STAGE`) the operation belongs to. + Environment string `json:"environment"` + + // EnvzeroOrgId env0 organization id. + EnvzeroOrgId string `json:"envzero_org_id"` + + // EnvzeroUserId env0 user id (Auth0 `sub`) of the admin driving the setup. + EnvzeroUserId string `json:"envzero_user_id"` + Staging *bool `json:"staging,omitempty"` + TenantId openapi_types.UUID `json:"tenant_id"` +} + // LoginUserRequest defines model for LoginUser_request. type LoginUserRequest struct { IDToken interface{} `json:"id_token"` @@ -1943,6 +2232,23 @@ type SendUserEventRequest struct { AdditionalProperties map[string]interface{} `json:"-"` } +// SetEnvZeroSetupPasswordRequest defines model for SetEnvZeroSetupPassword_request. +type SetEnvZeroSetupPasswordRequest struct { + // Email The admin's email, lowercased. + Email openapi_types.Email `json:"email"` + + // Environment env0 environment (`STAGE`) the operation belongs to. + Environment string `json:"environment"` + + // EnvzeroOrgId env0 organization id. + EnvzeroOrgId string `json:"envzero_org_id"` + + // EnvzeroUserId env0 user id (Auth0 `sub`) of the admin driving the setup. + EnvzeroUserId string `json:"envzero_user_id"` + Password string `json:"password"` + Staging *bool `json:"staging,omitempty"` +} + // Settings Platform settings definition type Settings struct { // EnforceMfa Whether or not to require MFA for all users @@ -2310,6 +2616,9 @@ type AddonTeam = TeamName // EmailBasic defines model for email_basic. type EmailBasic = string +// EnvzeroSetupOperation defines model for envzero_setup_operation. +type EnvzeroSetupOperation = openapi_types.UUID + // IncludeDrafts defines model for include_drafts. type IncludeDrafts = bool @@ -2352,6 +2661,9 @@ type BadRequest = FieldError // Conflict Basic Error type Conflict = BasicError +// EnvZeroSetupGone Basic Error +type EnvZeroSetupGone = BasicError + // Forbidden defines model for Forbidden. type Forbidden = FieldError @@ -2712,6 +3024,21 @@ type CreateAddonVersionJSONRequestBody = CreateAddonVersionRequest // CreateEnvZeroHandoffJSONRequestBody defines body for CreateEnvZeroHandoff for application/json ContentType. type CreateEnvZeroHandoffJSONRequestBody = CreateEnvZeroHandoffRequest +// CreateEnvZeroSetupJSONRequestBody defines body for CreateEnvZeroSetup for application/json ContentType. +type CreateEnvZeroSetupJSONRequestBody = CreateEnvZeroSetupRequest + +// CancelEnvZeroSetupJSONRequestBody defines body for CancelEnvZeroSetup for application/json ContentType. +type CancelEnvZeroSetupJSONRequestBody = CancelEnvZeroSetupRequest + +// LoginEnvZeroSetupJSONRequestBody defines body for LoginEnvZeroSetup for application/json ContentType. +type LoginEnvZeroSetupJSONRequestBody = LoginEnvZeroSetupRequest + +// SetEnvZeroSetupPasswordJSONRequestBody defines body for SetEnvZeroSetupPassword for application/json ContentType. +type SetEnvZeroSetupPasswordJSONRequestBody = SetEnvZeroSetupPasswordRequest + +// GetEnvZeroSetupStatusJSONRequestBody defines body for GetEnvZeroSetupStatus for application/json ContentType. +type GetEnvZeroSetupStatusJSONRequestBody = CancelEnvZeroSetupRequest + // UpsertPlatformDestinationSecretJSONRequestBody defines body for UpsertPlatformDestinationSecret for application/json ContentType. type UpsertPlatformDestinationSecretJSONRequestBody = UpsertPlatformDestinationSecretRequest @@ -3838,6 +4165,85 @@ func (a GetTeamAnalyticsSalt200Response) MarshalJSON() ([]byte, error) { return json.Marshal(object) } +// Getter for additional properties for LoginEnvZeroSetup201Response. Returns the specified +// element and whether it was found +func (a LoginEnvZeroSetup201Response) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for LoginEnvZeroSetup201Response +func (a *LoginEnvZeroSetup201Response) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for LoginEnvZeroSetup201Response to handle AdditionalProperties +func (a *LoginEnvZeroSetup201Response) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["expires_in_seconds"]; found { + err = json.Unmarshal(raw, &a.ExpiresInSeconds) + if err != nil { + return fmt.Errorf("error reading 'expires_in_seconds': %w", err) + } + delete(object, "expires_in_seconds") + } + + if raw, found := object["magic_url"]; found { + err = json.Unmarshal(raw, &a.MagicUrl) + if err != nil { + return fmt.Errorf("error reading 'magic_url': %w", err) + } + delete(object, "magic_url") + } + + 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 LoginEnvZeroSetup201Response to handle AdditionalProperties +func (a LoginEnvZeroSetup201Response) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + object["expires_in_seconds"], err = json.Marshal(a.ExpiresInSeconds) + if err != nil { + return nil, fmt.Errorf("error marshaling 'expires_in_seconds': %w", err) + } + + object["magic_url"], err = json.Marshal(a.MagicUrl) + if err != nil { + return nil, fmt.Errorf("error marshaling 'magic_url': %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 LoginUserRequest. Returns the specified // element and whether it was found func (a LoginUserRequest) Get(fieldName string) (value interface{}, found bool) { diff --git a/spec.json b/spec.json index 973e4e1..aca1a48 100644 --- a/spec.json +++ b/spec.json @@ -4387,6 +4387,307 @@ "x-internal" : true } }, + "/api/envzero/setup" : { + "post" : { + "description" : "Reserve a setup operation and create its tenant rows, server to server (ATL-476). env0's backend calls this from the confirm modal; Cloud writes the setup record, the tenant host, signup and envzero rows, the memberless team and the provision job in one transaction, then the provision job creates the Platform tenant asynchronously. Authenticated with env0's signed `ezhf_` assertion (audience `envzero-setup-create`) whose claims must equal the bindings in the body. A replay of an existing operation with matching bindings answers 200 with the same body and restarts any exhausted job. `staging` must agree with the credential that verified the assertion.", + "operationId" : "CreateEnvZeroSetup", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CreateEnvZeroSetup_request" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/EnvZeroSetupCreated" + } + } + }, + "description" : "The operation already exists with matching bindings (retry)." + }, + "201" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/EnvZeroSetupCreated" + } + } + }, + "description" : "Operation reserved and tenant rows written." + }, + "400" : { + "$ref" : "#/components/responses/BadRequest" + }, + "401" : { + "$ref" : "#/components/responses/RequiresAuthentication" + }, + "409" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/EnvZeroSetupConflictError" + } + } + }, + "description" : "`email_exists`, nothing written; or `setup_in_progress` with the record holding the org reservation." + }, + "410" : { + "$ref" : "#/components/responses/EnvZeroSetupGone" + }, + "422" : { + "$ref" : "#/components/responses/UnprocessableEntity" + }, + "429" : { + "$ref" : "#/components/responses/TooManyRequests" + }, + "500" : { + "$ref" : "#/components/responses/InternalError" + } + }, + "security" : [ { + "envzeroHandoffAuth" : [ ] + } ], + "tags" : [ "platform" ], + "x-internal" : true + } + }, + "/api/envzero/setup/{operation}/cancel" : { + "post" : { + "description" : "Cancel a setup operation (ATL-476). Inserts a `cancelled` row under the operation's primary key when no record exists, so a create racing this call loses and answers 410; an existing `failed` record becomes `cancelled`; a record holding the org reservation answers 409 with the record so env0 can adopt it. Idempotent.", + "operationId" : "CancelEnvZeroSetup", + "parameters" : [ { + "$ref" : "#/components/parameters/envzero_setup_operation" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CancelEnvZeroSetup_request" + } + } + }, + "required" : true + }, + "responses" : { + "204" : { + "description" : "Cancelled, or already cancelled or failed." + }, + "400" : { + "$ref" : "#/components/responses/BadRequest" + }, + "401" : { + "$ref" : "#/components/responses/RequiresAuthentication" + }, + "409" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/EnvZeroSetupConflictError" + } + } + }, + "description" : "The record is live (`setup_in_progress`) and is returned." + }, + "500" : { + "$ref" : "#/components/responses/InternalError" + } + }, + "security" : [ { + "envzeroHandoffAuth" : [ ] + } ], + "tags" : [ "platform" ], + "x-internal" : true + } + }, + "/api/envzero/setup/{operation}/status" : { + "post" : { + "description" : "Report a setup operation's state (ATL-476). Audience `envzero-setup-status`. Side effects: restarts any exhausted or missing job whose completion condition is unmet, and asks Platform whether the first user can log in while `login` is pending and the host is linked.", + "operationId" : "GetEnvZeroSetupStatus", + "parameters" : [ { + "$ref" : "#/components/parameters/envzero_setup_operation" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CancelEnvZeroSetup_request" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/EnvZeroSetupRecord" + } + } + }, + "description" : "The record." + }, + "400" : { + "$ref" : "#/components/responses/BadRequest" + }, + "401" : { + "$ref" : "#/components/responses/RequiresAuthentication" + }, + "404" : { + "$ref" : "#/components/responses/NotFound" + }, + "410" : { + "$ref" : "#/components/responses/EnvZeroSetupGone" + }, + "500" : { + "$ref" : "#/components/responses/InternalError" + } + }, + "security" : [ { + "envzeroHandoffAuth" : [ ] + } ], + "tags" : [ "platform" ], + "x-internal" : true + } + }, + "/api/envzero/setup/{operation}/login" : { + "post" : { + "description" : "Mint a single-use magic-login URL into the operation's tenant (ATL-476). Audience `envzero-setup-login`; the assertion carries `tenant` and its `jti` is burned in the same transaction that stamps `login_issued_at`, before any Redis call. Every mint re-checks Platform: signup not failed, magic login enabled, host linked, first user ready. Repeatable: a later call mints a fresh URL and keeps the first `login_issued_at`.", + "operationId" : "LoginEnvZeroSetup", + "parameters" : [ { + "$ref" : "#/components/parameters/envzero_setup_operation" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/LoginEnvZeroSetup_request" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/LoginEnvZeroSetup_201_response" + } + } + }, + "description" : "Magic URL minted." + }, + "400" : { + "$ref" : "#/components/responses/BadRequest" + }, + "401" : { + "$ref" : "#/components/responses/RequiresAuthentication" + }, + "404" : { + "$ref" : "#/components/responses/NotFound" + }, + "409" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/EnvZeroSetupConflictError" + } + } + }, + "description" : "`not_ready` or `login_unavailable`." + }, + "410" : { + "$ref" : "#/components/responses/EnvZeroSetupGone" + }, + "500" : { + "$ref" : "#/components/responses/InternalError" + }, + "503" : { + "$ref" : "#/components/responses/ServiceUnavailable" + } + }, + "security" : [ { + "envzeroHandoffAuth" : [ ] + } ], + "tags" : [ "platform" ], + "x-internal" : true + } + }, + "/api/envzero/setup/{operation}/password" : { + "post" : { + "description" : "Forward the first user's password to Platform's create-only first-user-password (ATL-476). Audience `envzero-setup-create`. Cloud does not validate, hash, store or log the password. Requires `provisioning: created`, else 409 `not_ready`. Platform 204 and 409 `password_already_set` both mark `password: set` and answer 204; Platform field errors are returned verbatim as 422; anything else is 502.", + "operationId" : "SetEnvZeroSetupPassword", + "parameters" : [ { + "$ref" : "#/components/parameters/envzero_setup_operation" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SetEnvZeroSetupPassword_request" + } + } + }, + "required" : true + }, + "responses" : { + "204" : { + "description" : "Password set at Platform (now or on an earlier submit)." + }, + "400" : { + "$ref" : "#/components/responses/BadRequest" + }, + "401" : { + "$ref" : "#/components/responses/RequiresAuthentication" + }, + "404" : { + "$ref" : "#/components/responses/NotFound" + }, + "409" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/EnvZeroSetupConflictError" + } + } + }, + "description" : "`not_ready`: no tenant exists yet." + }, + "410" : { + "$ref" : "#/components/responses/EnvZeroSetupGone" + }, + "422" : { + "$ref" : "#/components/responses/UnprocessableEntity" + }, + "500" : { + "$ref" : "#/components/responses/InternalError" + }, + "502" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BasicError" + } + } + }, + "description" : "Platform did not answer definitively; env0 offers a retry." + } + }, + "security" : [ { + "envzeroHandoffAuth" : [ ] + } ], + "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", @@ -5496,6 +5797,17 @@ "style" : "simple", "x-go-name" : "TeamSubscriptionOrderID" }, + "envzero_setup_operation" : { + "explode" : false, + "in" : "path", + "name" : "operation", + "required" : true, + "schema" : { + "format" : "uuid", + "type" : "string" + }, + "style" : "simple" + }, "user_id" : { "explode" : false, "in" : "path", @@ -5621,6 +5933,16 @@ }, "description" : "Method not allowed" }, + "EnvZeroSetupGone" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BasicError" + } + } + }, + "description" : "The operation was cancelled." + }, "DockerError" : { "content" : { "application/json" : { @@ -7628,6 +7950,128 @@ }, "required" : [ "code", "message", "status" ] }, + "EnvZeroSetupBindings" : { + "description" : "The identity bindings fixed when the operation was reserved. Every setup call carries them and they must equal the assertion's claims.", + "properties" : { + "envzero_org_id" : { + "description" : "env0 organization id.", + "maxLength" : 250, + "minLength" : 1, + "type" : "string" + }, + "envzero_user_id" : { + "description" : "env0 user id (Auth0 `sub`) of the admin driving the setup.", + "maxLength" : 250, + "minLength" : 1, + "type" : "string" + }, + "email" : { + "description" : "The admin's email, lowercased.", + "format" : "email", + "maxLength" : 250, + "minLength" : 1, + "type" : "string" + }, + "environment" : { + "description" : "env0 environment (`STAGE`) the operation belongs to.", + "maxLength" : 64, + "minLength" : 1, + "type" : "string" + } + }, + "required" : [ "email", "environment", "envzero_org_id", "envzero_user_id" ] + }, + "EnvZeroSetupCreated" : { + "additionalProperties" : false, + "properties" : { + "operation" : { + "format" : "uuid", + "type" : "string" + }, + "tenant_id" : { + "format" : "uuid", + "type" : "string" + }, + "tenant_url" : { + "type" : "string" + } + }, + "required" : [ "operation", "tenant_id", "tenant_url" ] + }, + "EnvZeroSetupRecordFields" : { + "description" : "The fields of a setup operation's state (ATL-468 contract section 4.1), none required. `EnvZeroSetupRecord` requires the identity and state axes; `EnvZeroSetupConflictError` carries them flat beside `code` only for `setup_in_progress`.", + "properties" : { + "operation" : { + "format" : "uuid", + "type" : "string" + }, + "envzero_user_id" : { + "type" : "string" + }, + "email" : { + "type" : "string" + }, + "environment" : { + "type" : "string" + }, + "tenant_id" : { + "format" : "uuid", + "type" : "string" + }, + "tenant_url" : { + "type" : "string" + }, + "provisioning" : { + "enum" : [ "pending", "created", "failed", "blocked", "stuck" ], + "type" : "string" + }, + "login" : { + "enum" : [ "pending", "ready", "unavailable" ], + "type" : "string" + }, + "password" : { + "enum" : [ "unset", "set" ], + "type" : "string" + }, + "delivery" : { + "enum" : [ "pending", "delivered", "failed", "undeliverable" ], + "type" : "string" + }, + "failure" : { + "$ref" : "#/components/schemas/EnvZeroSetupRecordFields_failure" + } + } + }, + "EnvZeroSetupConflictError" : { + "allOf" : [ { + "$ref" : "#/components/schemas/EnvZeroSetupRecordFields" + }, { + "description" : "env0 setup conflict (ATL-468 contract section 5.1). For `setup_in_progress` the record holding the org's reservation is carried flat beside `code`, the same shape for create's and cancel's 409, so env0 can adopt it; the other codes carry only `message`, `status` and `code`.", + "properties" : { + "message" : { + "type" : "string" + }, + "status" : { + "type" : "integer" + }, + "code" : { + "description" : "Machine-readable conflict reason. `email_exists`: the email already runs a CloudQuery Platform tenant or another org's live record holds it; env0 falls back to its manual connect flow. `setup_in_progress`: another operation holds this org's reservation; its record is carried flat in this body so env0 can adopt it. `not_ready`: the tenant or its first user does not exist yet. `login_unavailable`: the first user exists but cannot use magic-link login.", + "enum" : [ "email_exists", "setup_in_progress", "not_ready", "login_unavailable" ], + "type" : "string" + } + }, + "required" : [ "code", "message", "status" ] + } ] + }, + "EnvZeroSetupRecord" : { + "allOf" : [ { + "$ref" : "#/components/schemas/EnvZeroSetupRecordFields" + }, { + "description" : "A setup operation's state (ATL-468 contract section 4.1). `provisioning` is the only axis that gates other operations; `login` and `delivery` are facts reported alongside it. All axes are monotonic.", + "required" : [ "delivery", "email", "environment", "envzero_user_id", "login", "operation", "password", "provisioning" ], + "type" : "object" + } ] + }, "PlatformTenantFailureReason" : { "description" : "Why a self-serve platform signup failed; only present with `status: failed`. `email_exists`: the email already owns a Platform account, so the user should sign in there (or, from env0, connect it manually).", "enum" : [ "email_exists", "host_in_use", "invalid_request" ], @@ -8826,6 +9270,100 @@ }, "required" : [ "expires_at", "handoff_id", "signup_url" ] }, + "CreateEnvZeroSetup_request" : { + "allOf" : [ { + "$ref" : "#/components/schemas/EnvZeroSetupBindings" + }, { + "properties" : { + "operation" : { + "description" : "env0's id for this attempt; also the callback handoff_id.", + "format" : "uuid", + "type" : "string" + }, + "terms_accepted_at" : { + "description" : "When the admin accepted the CloudQuery terms. Must not be in the future.", + "format" : "date-time", + "type" : "string" + }, + "display_name" : { + "maxLength" : 250, + "type" : "string" + }, + "envzero_api_key_id" : { + "maxLength" : 512, + "minLength" : 1, + "type" : "string" + }, + "envzero_api_key_secret" : { + "maxLength" : 4096, + "minLength" : 1, + "type" : "string" + }, + "source" : { + "enum" : [ "envzero" ], + "type" : "string" + }, + "staging" : { + "type" : "boolean" + } + }, + "required" : [ "envzero_api_key_id", "envzero_api_key_secret", "operation", "source", "terms_accepted_at" ] + } ] + }, + "CancelEnvZeroSetup_request" : { + "allOf" : [ { + "$ref" : "#/components/schemas/EnvZeroSetupBindings" + }, { + "properties" : { + "staging" : { + "type" : "boolean" + } + } + } ] + }, + "LoginEnvZeroSetup_request" : { + "allOf" : [ { + "$ref" : "#/components/schemas/EnvZeroSetupBindings" + }, { + "properties" : { + "tenant_id" : { + "format" : "uuid", + "type" : "string" + }, + "staging" : { + "type" : "boolean" + } + }, + "required" : [ "tenant_id" ] + } ] + }, + "LoginEnvZeroSetup_201_response" : { + "additionalProperties" : { }, + "properties" : { + "magic_url" : { + "type" : "string" + }, + "expires_in_seconds" : { } + }, + "required" : [ "expires_in_seconds", "magic_url" ] + }, + "SetEnvZeroSetupPassword_request" : { + "allOf" : [ { + "$ref" : "#/components/schemas/EnvZeroSetupBindings" + }, { + "properties" : { + "password" : { + "maxLength" : 1024, + "minLength" : 1, + "type" : "string" + }, + "staging" : { + "type" : "boolean" + } + }, + "required" : [ "password" ] + } ] + }, "GetTeamPlatformTenant_200_response" : { "properties" : { "tenant_id" : { @@ -9065,6 +9603,18 @@ } }, "required" : [ "aggregation_period", "end", "metrics", "start" ] + }, + "EnvZeroSetupRecordFields_failure" : { + "additionalProperties" : false, + "properties" : { + "code" : { + "type" : "string" + }, + "detail" : { + "type" : "string" + } + }, + "required" : [ "code" ] } }, "securitySchemes" : {