From aa0a8d8213f5785ad3b1badf5cd8568065c26294 Mon Sep 17 00:00:00 2001 From: "cloudquery-ci[bot]" <271027272+cloudquery-ci[bot]@users.noreply.github.com> Date: Tue, 8 Sep 2026 16:03:31 +0000 Subject: [PATCH] fix: Generate CloudQuery Go API Client from `spec.json` --- client.gen.go | 4 ++-- models.gen.go | 34 +++++++++++++++++++++++++++++++--- spec.json | 36 +++++++++++++++++++++++++++++++++--- 3 files changed, 66 insertions(+), 8 deletions(-) diff --git a/client.gen.go b/client.gen.go index 3f4f78b..9658394 100644 --- a/client.gen.go +++ b/client.gen.go @@ -11712,7 +11712,7 @@ func (r DeleteTeamMembershipResponse) StatusCode() int { type GetTeamPlatformTenantResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *CreatePlatformSignup201Response + JSON200 *GetTeamPlatformTenant200Response JSON401 *RequiresAuthentication JSON403 *Forbidden JSON404 *NotFound @@ -18616,7 +18616,7 @@ func ParseGetTeamPlatformTenantResponse(rsp *http.Response) (*GetTeamPlatformTen switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CreatePlatformSignup201Response + var dest GetTeamPlatformTenant200Response if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } diff --git a/models.gen.go b/models.gen.go index f451109..ec12e0e 100644 --- a/models.gen.go +++ b/models.gen.go @@ -83,10 +83,18 @@ const ( ManagedDatabaseStatusReady ManagedDatabaseStatus = "ready" ) +// Defines values for PlatformTenantFailureReason. +const ( + PlatformTenantFailureReasonEmailExists PlatformTenantFailureReason = "email_exists" + PlatformTenantFailureReasonHostInUse PlatformTenantFailureReason = "host_in_use" + PlatformTenantFailureReasonInvalidRequest PlatformTenantFailureReason = "invalid_request" +) + // Defines values for PlatformTenantStatus. const ( PlatformTenantStatusActive PlatformTenantStatus = "active" PlatformTenantStatusCreated PlatformTenantStatus = "created" + PlatformTenantStatusFailed PlatformTenantStatus = "failed" PlatformTenantStatusPending PlatformTenantStatus = "pending" ) @@ -684,7 +692,7 @@ type CreatePlatformSignup201Response struct { // MagicLoginEnabled Whether magic-link sign-in is available for this tenant. MagicLoginEnabled *bool `json:"magic_login_enabled,omitempty"` - // Status Provisioning status of a platform tenant. + // Status Provisioning status of a platform tenant. `failed` is terminal for a self-serve signup; `failure_reason` says why. Status PlatformTenantStatus `json:"status"` Subdomain string `json:"subdomain"` @@ -893,6 +901,23 @@ type GetTeamMemberships200Response struct { Metadata ListMetadata `json:"metadata"` } +// GetTeamPlatformTenant200Response defines model for GetTeamPlatformTenant_200_response. +type GetTeamPlatformTenant200Response struct { + // FailureReason 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). + FailureReason *PlatformTenantFailureReason `json:"failure_reason,omitempty"` + + // MagicLoginEnabled Whether magic-link sign-in is available for this tenant. + MagicLoginEnabled *bool `json:"magic_login_enabled,omitempty"` + + // Status Provisioning status of a platform tenant. `failed` is terminal for a self-serve signup; `failure_reason` says why. + Status PlatformTenantStatus `json:"status"` + Subdomain string `json:"subdomain"` + + // TeamName The unique name for the team. + TeamName TeamName `json:"team_name"` + TenantId openapi_types.UUID `json:"tenant_id"` +} + // ImageURL defines model for ImageURL. type ImageURL struct { DownloadUrl string `json:"download_url"` @@ -1216,7 +1241,10 @@ type MembershipWithUser struct { User User `json:"user"` } -// PlatformTenantStatus Provisioning status of a platform tenant. +// PlatformTenantFailureReason 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). +type PlatformTenantFailureReason string + +// PlatformTenantStatus Provisioning status of a platform tenant. `failed` is terminal for a self-serve signup; `failure_reason` says why. type PlatformTenantStatus string // PlatformTenantSummary Summary view of a Platform tenant returned by the self-serve list / status endpoints. Same shape as `POST /platform-signup` and `GET /teams/{team_name}/platform/tenant/{tenant_id}` responses. @@ -1227,7 +1255,7 @@ type PlatformTenantSummary struct { // MagicLoginEnabled Whether magic-link sign-in is available for this tenant. MagicLoginEnabled *bool `json:"magic_login_enabled,omitempty"` - // Status Provisioning status of a platform tenant. + // Status Provisioning status of a platform tenant. `failed` is terminal for a self-serve signup; `failure_reason` says why. Status PlatformTenantStatus `json:"status"` Subdomain string `json:"subdomain"` diff --git a/spec.json b/spec.json index 9ae2fc1..62ba387 100644 --- a/spec.json +++ b/spec.json @@ -4374,7 +4374,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/CreatePlatformSignup_201_response" + "$ref" : "#/components/schemas/GetTeamPlatformTenant_200_response" } } }, @@ -7571,8 +7571,8 @@ "required" : [ "tenant_url" ] }, "PlatformTenantStatus" : { - "description" : "Provisioning status of a platform tenant.", - "enum" : [ "pending", "created", "active" ], + "description" : "Provisioning status of a platform tenant. `failed` is terminal for a self-serve signup; `failure_reason` says why.", + "enum" : [ "pending", "created", "active", "failed" ], "type" : "string" }, "EnvZeroConflictError" : { @@ -7593,6 +7593,11 @@ }, "required" : [ "code", "message", "status" ] }, + "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" ], + "type" : "string" + }, "PlatformTenantSummary" : { "description" : "Summary view of a Platform tenant returned by the self-serve list / status endpoints. Same shape as `POST /platform-signup` and `GET /teams/{team_name}/platform/tenant/{tenant_id}` responses.\n", "properties" : { @@ -8776,6 +8781,31 @@ }, "required" : [ "expires_at", "handoff_id", "signup_url" ] }, + "GetTeamPlatformTenant_200_response" : { + "properties" : { + "tenant_id" : { + "format" : "uuid", + "type" : "string" + }, + "subdomain" : { + "type" : "string" + }, + "status" : { + "$ref" : "#/components/schemas/PlatformTenantStatus" + }, + "team_name" : { + "$ref" : "#/components/schemas/TeamName" + }, + "magic_login_enabled" : { + "description" : "Whether magic-link sign-in is available for this tenant.", + "type" : "boolean" + }, + "failure_reason" : { + "$ref" : "#/components/schemas/PlatformTenantFailureReason" + } + }, + "required" : [ "status", "subdomain", "team_name", "tenant_id" ] + }, "RequestPlatformTenantMagicLink_201_response" : { "properties" : { "magic_url" : {