From 5c9478dc4a89da8473ea7fb6cc2668aa94698430 Mon Sep 17 00:00:00 2001 From: cq-bot Date: Tue, 31 Oct 2023 11:36:54 +0000 Subject: [PATCH] fix: Generate CloudQuery Go API Client from `spec.json` --- models.gen.go | 51 +++++++++++++++++++++++++++++++++++++++++---------- spec.json | 34 ++++++++++++++++++++++++++++------ 2 files changed, 69 insertions(+), 16 deletions(-) diff --git a/models.gen.go b/models.gen.go index b4b9899..0248caf 100644 --- a/models.gen.go +++ b/models.gen.go @@ -59,6 +59,12 @@ const ( Source PluginKind = "source" ) +// Defines values for PluginReleaseStage. +const ( + Ga PluginReleaseStage = "ga" + Preview PluginReleaseStage = "preview" +) + // Defines values for PluginTier. const ( PluginTierFree PluginTier = "free" @@ -453,9 +459,14 @@ type ListPlugin struct { Official bool `json:"official"` // Public Whether the plugin is listed in the CloudQuery Hub. If false, the plugin will not be shown in the CloudQuery Hub and will only be visible to members of the plugin's team. - Public *bool `json:"public,omitempty"` - Repository *string `json:"repository,omitempty"` - ShortDescription string `json:"short_description"` + Public *bool `json:"public,omitempty"` + + // ReleaseStage Official plugins go through two release stages: Preview, and GA. + // Both Preview and GA plugins follow semantic versioning. The main differences between the two stages are: + // Preview plugins are still experimental and may have frequent breaking changes. Preview plugins might get deprecated due to lack of usage. Long Term Support with community Discord and bug fixes is only guaranteed for GA plugins. Premium plugins are often discounted or free during the Preview stage. + ReleaseStage *PluginReleaseStage `json:"release_stage,omitempty"` + Repository *string `json:"repository,omitempty"` + ShortDescription string `json:"short_description"` // TeamName The unique name for the team. TeamName TeamName `json:"team_name"` @@ -549,9 +560,14 @@ type Plugin struct { Official bool `json:"official"` // Public Whether the plugin is listed in the CloudQuery Hub. If false, the plugin will not be shown in the CloudQuery Hub and will only be visible to members of the plugin's team. - Public *bool `json:"public,omitempty"` - Repository *string `json:"repository,omitempty"` - ShortDescription string `json:"short_description"` + Public *bool `json:"public,omitempty"` + + // ReleaseStage Official plugins go through two release stages: Preview, and GA. + // Both Preview and GA plugins follow semantic versioning. The main differences between the two stages are: + // Preview plugins are still experimental and may have frequent breaking changes. Preview plugins might get deprecated due to lack of usage. Long Term Support with community Discord and bug fixes is only guaranteed for GA plugins. Premium plugins are often discounted or free during the Preview stage. + ReleaseStage *PluginReleaseStage `json:"release_stage,omitempty"` + Repository *string `json:"repository,omitempty"` + ShortDescription string `json:"short_description"` // TeamName The unique name for the team. TeamName TeamName `json:"team_name"` @@ -588,8 +604,13 @@ type PluginCreate struct { Name PluginName `json:"name"` // Public Whether the plugin is listed in the CloudQuery Hub. If false, the plugin will not be shown in the CloudQuery Hub and will only be visible to members of the team. - Public bool `json:"public"` - Repository *string `json:"repository,omitempty"` + Public bool `json:"public"` + + // ReleaseStage Official plugins go through two release stages: Preview, and GA. + // Both Preview and GA plugins follow semantic versioning. The main differences between the two stages are: + // Preview plugins are still experimental and may have frequent breaking changes. Preview plugins might get deprecated due to lack of usage. Long Term Support with community Discord and bug fixes is only guaranteed for GA plugins. Premium plugins are often discounted or free during the Preview stage. + ReleaseStage *PluginReleaseStage `json:"release_stage,omitempty"` + Repository *string `json:"repository,omitempty"` // ShortDescription Short description of the plugin. This will be shown in the CloudQuery Hub. ShortDescription string `json:"short_description"` @@ -634,6 +655,11 @@ type PluginName = string // PluginProtocols The CloudQuery protocols supported by this plugin version (only protocol 3 is supported by new plugins). type PluginProtocols = []int +// PluginReleaseStage Official plugins go through two release stages: Preview, and GA. +// Both Preview and GA plugins follow semantic versioning. The main differences between the two stages are: +// Preview plugins are still experimental and may have frequent breaking changes. Preview plugins might get deprecated due to lack of usage. Long Term Support with community Discord and bug fixes is only guaranteed for GA plugins. Premium plugins are often discounted or free during the Preview stage. +type PluginReleaseStage string + // PluginTable CloudQuery Plugin Table type PluginTable struct { // Description Description of the table @@ -748,8 +774,13 @@ type PluginUpdate struct { Logo *string `json:"logo,omitempty"` // Public If plugin is not public, it won't be visible to other teams in the CloudQuery Hub. - Public *bool `json:"public,omitempty"` - Repository *string `json:"repository,omitempty"` + Public *bool `json:"public,omitempty"` + + // ReleaseStage Official plugins go through two release stages: Preview, and GA. + // Both Preview and GA plugins follow semantic versioning. The main differences between the two stages are: + // Preview plugins are still experimental and may have frequent breaking changes. Preview plugins might get deprecated due to lack of usage. Long Term Support with community Discord and bug fixes is only guaranteed for GA plugins. Premium plugins are often discounted or free during the Preview stage. + ReleaseStage *PluginReleaseStage `json:"release_stage,omitempty"` + Repository *string `json:"repository,omitempty"` // ShortDescription Short description of the plugin. This will be shown in the CloudQuery Hub. ShortDescription *string `json:"short_description,omitempty"` diff --git a/spec.json b/spec.json index c4d064c..5501cc3 100644 --- a/spec.json +++ b/spec.json @@ -307,6 +307,7 @@ "delete": { "description": "Delete plugin by team and plugin name", "operationId": "DeletePluginByTeamAndPluginName", + "x-internal": true, "parameters": [ { "$ref": "#/components/parameters/team_name" @@ -1402,6 +1403,7 @@ "delete": { "description": "Delete addon by team and addon name", "operationId": "DeleteAddonByTeamAndName", + "x-internal": true, "parameters": [ { "$ref": "#/components/parameters/team_name" @@ -2098,6 +2100,7 @@ "delete": { "description": "Delete plugins by team", "operationId": "DeletePluginsByTeam", + "x-internal": true, "parameters": [ { "$ref": "#/components/parameters/team_name" @@ -2210,6 +2213,7 @@ "delete": { "description": "Delete addons by team", "operationId": "DeleteAddonsByTeam", + "x-internal": true, "parameters": [ { "$ref": "#/components/parameters/team_name" @@ -3420,6 +3424,15 @@ "other" ] }, + "PluginReleaseStage": { + "description": "Official plugins go through two release stages: Preview, and GA.\nBoth Preview and GA plugins follow semantic versioning. The main differences between the two stages are:\nPreview plugins are still experimental and may have frequent breaking changes. Preview plugins might get deprecated due to lack of usage. Long Term Support with community Discord and bug fixes is only guaranteed for GA plugins. Premium plugins are often discounted or free during the Preview stage.", + "type": "string", + "enum": [ + "preview", + "ga" + ], + "default": "preview" + }, "PluginTier": { "description": "Supported tiers for plugins", "type": "string", @@ -3468,6 +3481,9 @@ "description": "True if the plugin is maintained by CloudQuery, false otherwise", "type": "boolean" }, + "release_stage": { + "$ref": "#/components/schemas/PluginReleaseStage" + }, "repository": { "type": "string", "example": "https://github.com/cloudquery/cloudquery" @@ -3593,15 +3609,18 @@ "type": "string", "example": "https://cloudquery.io" }, - "repository": { - "type": "string", - "example": "https://github.com/cloudquery/cloudquery" - }, "public": { "type": "boolean", "description": "Whether the plugin is listed in the CloudQuery Hub. If false, the plugin will not be shown in the CloudQuery Hub and will only be visible to members of the team.", "example": true }, + "repository": { + "type": "string", + "example": "https://github.com/cloudquery/cloudquery" + }, + "release_stage": { + "$ref": "#/components/schemas/PluginReleaseStage" + }, "logo": { "type": "string", "description": "URL to the plugin's logo. This will be shown in the CloudQuery Hub. This must point to https://images.cloudquery.io/...", @@ -3611,14 +3630,14 @@ "type": "string", "pattern": "^\\d+(?:\\.\\d{1,10})?$", "description": "The price per row in USD. This is used to calculate the price of a sync.", - "example": "0.0001", + "example": "0.00001", "x-go-name": "USDPerRow" }, "free_rows_per_month": { "type": "integer", "format": "int64", "description": "The number of rows that can be synced for free each month.", - "example": 1000 + "example": 10000 } } }, @@ -3686,6 +3705,9 @@ "type": "boolean", "description": "If plugin is not public, it won't be visible to other teams in the CloudQuery Hub." }, + "release_stage": { + "$ref": "#/components/schemas/PluginReleaseStage" + }, "usd_per_row": { "type": "string", "pattern": "^\\d+(?:\\.\\d{1,10})?$",