diff --git a/client.gen.go b/client.gen.go index 9d88852..aa24139 100644 --- a/client.gen.go +++ b/client.gen.go @@ -153,6 +153,9 @@ type ClientInterface interface { RenewPlatformActivation(ctx context.Context, body RenewPlatformActivationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetPlatformFlags request + GetPlatformFlags(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListPluginNotificationRequests request ListPluginNotificationRequests(ctx context.Context, params *ListPluginNotificationRequestsParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -937,6 +940,18 @@ func (c *Client) RenewPlatformActivation(ctx context.Context, body RenewPlatform return c.Client.Do(req) } +func (c *Client) GetPlatformFlags(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetPlatformFlagsRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) ListPluginNotificationRequests(ctx context.Context, params *ListPluginNotificationRequestsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListPluginNotificationRequestsRequest(c.Server, params) if err != nil { @@ -4102,6 +4117,33 @@ func NewRenewPlatformActivationRequestWithBody(server string, contentType string return req, nil } +// NewGetPlatformFlagsRequest generates requests for GetPlatformFlags +func NewGetPlatformFlagsRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/platform/flags") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewListPluginNotificationRequestsRequest generates requests for ListPluginNotificationRequests func NewListPluginNotificationRequestsRequest(server string, params *ListPluginNotificationRequestsParams) (*http.Request, error) { var err error @@ -11862,6 +11904,9 @@ type ClientWithResponsesInterface interface { RenewPlatformActivationWithResponse(ctx context.Context, body RenewPlatformActivationJSONRequestBody, reqEditors ...RequestEditorFn) (*RenewPlatformActivationResponse, error) + // GetPlatformFlagsWithResponse request + GetPlatformFlagsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetPlatformFlagsResponse, error) + // ListPluginNotificationRequestsWithResponse request ListPluginNotificationRequestsWithResponse(ctx context.Context, params *ListPluginNotificationRequestsParams, reqEditors ...RequestEditorFn) (*ListPluginNotificationRequestsResponse, error) @@ -12788,6 +12833,30 @@ func (r RenewPlatformActivationResponse) StatusCode() int { return 0 } +type GetPlatformFlagsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *PlatformFlags + JSON401 *RequiresAuthentication + JSON500 *InternalError +} + +// Status returns HTTPResponse.Status +func (r GetPlatformFlagsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetPlatformFlagsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type ListPluginNotificationRequestsResponse struct { Body []byte HTTPResponse *http.Response @@ -16564,6 +16633,15 @@ func (c *ClientWithResponses) RenewPlatformActivationWithResponse(ctx context.Co return ParseRenewPlatformActivationResponse(rsp) } +// GetPlatformFlagsWithResponse request returning *GetPlatformFlagsResponse +func (c *ClientWithResponses) GetPlatformFlagsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetPlatformFlagsResponse, error) { + rsp, err := c.GetPlatformFlags(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetPlatformFlagsResponse(rsp) +} + // ListPluginNotificationRequestsWithResponse request returning *ListPluginNotificationRequestsResponse func (c *ClientWithResponses) ListPluginNotificationRequestsWithResponse(ctx context.Context, params *ListPluginNotificationRequestsParams, reqEditors ...RequestEditorFn) (*ListPluginNotificationRequestsResponse, error) { rsp, err := c.ListPluginNotificationRequests(ctx, params, reqEditors...) @@ -19020,6 +19098,46 @@ func ParseRenewPlatformActivationResponse(rsp *http.Response) (*RenewPlatformAct return response, nil } +// ParseGetPlatformFlagsResponse parses an HTTP response from a GetPlatformFlagsWithResponse call +func ParseGetPlatformFlagsResponse(rsp *http.Response) (*GetPlatformFlagsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetPlatformFlagsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest PlatformFlags + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest RequiresAuthentication + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest InternalError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + // ParseListPluginNotificationRequestsResponse parses an HTTP response from a ListPluginNotificationRequestsWithResponse call func ParseListPluginNotificationRequestsResponse(rsp *http.Response) (*ListPluginNotificationRequestsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) diff --git a/models.gen.go b/models.gen.go index 9407a60..b522dea 100644 --- a/models.gen.go +++ b/models.gen.go @@ -1375,6 +1375,9 @@ type MembershipWithUser struct { User User `json:"user"` } +// PlatformFlags A map of feature flags for the Platform +type PlatformFlags = map[string]interface{} + // Plugin CloudQuery Plugin type Plugin struct { // Category Supported categories for plugins diff --git a/spec.json b/spec.json index b1c9040..34b26fc 100644 --- a/spec.json +++ b/spec.json @@ -6505,6 +6505,32 @@ "tags" : [ "platform" ], "x-internal" : true } + }, + "/platform/flags" : { + "get" : { + "description" : "Get platform feature flags", + "operationId" : "GetPlatformFlags", + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PlatformFlags" + } + } + }, + "description" : "Response" + }, + "401" : { + "$ref" : "#/components/responses/RequiresAuthentication" + }, + "500" : { + "$ref" : "#/components/responses/InternalError" + } + }, + "security" : [ ], + "tags" : [ "platform" ] + } } }, "components" : { @@ -10298,6 +10324,11 @@ }, "required" : [ "base_url", "return_url" ] }, + "PlatformFlags" : { + "additionalProperties" : false, + "description" : "A map of feature flags for the Platform", + "type" : "object" + }, "UploadImage_request" : { "properties" : { "content_type" : {