From 9f2d7c019f195e132f45f2c436d168b3f9d0e4d9 Mon Sep 17 00:00:00 2001 From: avallete <8771783+avallete@users.noreply.github.com> Date: Tue, 26 Aug 2025 17:51:36 +0000 Subject: [PATCH] chore: sync API types from infrastructure --- pkg/api/client.gen.go | 139 ++++++++++++++++++++++++++++++++++++++++++ pkg/api/types.gen.go | 35 ++++++++--- 2 files changed, 167 insertions(+), 7 deletions(-) diff --git a/pkg/api/client.gen.go b/pkg/api/client.gen.go index 1ca272ffd1..176e5d9e59 100644 --- a/pkg/api/client.gen.go +++ b/pkg/api/client.gen.go @@ -175,6 +175,9 @@ type ClientInterface interface { // V1GetSecurityAdvisors request V1GetSecurityAdvisors(ctx context.Context, ref string, params *V1GetSecurityAdvisorsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1GetProjectFunctionCombinedStats request + V1GetProjectFunctionCombinedStats(ctx context.Context, ref string, params *V1GetProjectFunctionCombinedStatsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1GetProjectLogs request V1GetProjectLogs(ctx context.Context, ref string, params *V1GetProjectLogsParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -943,6 +946,18 @@ func (c *Client) V1GetSecurityAdvisors(ctx context.Context, ref string, params * return c.Client.Do(req) } +func (c *Client) V1GetProjectFunctionCombinedStats(ctx context.Context, ref string, params *V1GetProjectFunctionCombinedStatsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1GetProjectFunctionCombinedStatsRequest(c.Server, ref, params) + 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) V1GetProjectLogs(ctx context.Context, ref string, params *V1GetProjectLogsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewV1GetProjectLogsRequest(c.Server, ref, params) if err != nil { @@ -3821,6 +3836,70 @@ func NewV1GetSecurityAdvisorsRequest(server string, ref string, params *V1GetSec return req, nil } +// NewV1GetProjectFunctionCombinedStatsRequest generates requests for V1GetProjectFunctionCombinedStats +func NewV1GetProjectFunctionCombinedStatsRequest(server string, ref string, params *V1GetProjectFunctionCombinedStatsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/analytics/endpoints/functions.combined-stats", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "interval", runtime.ParamLocationQuery, params.Interval); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "function_id", runtime.ParamLocationQuery, params.FunctionId); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewV1GetProjectLogsRequest generates requests for V1GetProjectLogs func NewV1GetProjectLogsRequest(server string, ref string, params *V1GetProjectLogsParams) (*http.Request, error) { var err error @@ -8904,6 +8983,9 @@ type ClientWithResponsesInterface interface { // V1GetSecurityAdvisorsWithResponse request V1GetSecurityAdvisorsWithResponse(ctx context.Context, ref string, params *V1GetSecurityAdvisorsParams, reqEditors ...RequestEditorFn) (*V1GetSecurityAdvisorsResponse, error) + // V1GetProjectFunctionCombinedStatsWithResponse request + V1GetProjectFunctionCombinedStatsWithResponse(ctx context.Context, ref string, params *V1GetProjectFunctionCombinedStatsParams, reqEditors ...RequestEditorFn) (*V1GetProjectFunctionCombinedStatsResponse, error) + // V1GetProjectLogsWithResponse request V1GetProjectLogsWithResponse(ctx context.Context, ref string, params *V1GetProjectLogsParams, reqEditors ...RequestEditorFn) (*V1GetProjectLogsResponse, error) @@ -9801,6 +9883,28 @@ func (r V1GetSecurityAdvisorsResponse) StatusCode() int { return 0 } +type V1GetProjectFunctionCombinedStatsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *AnalyticsResponse +} + +// Status returns HTTPResponse.Status +func (r V1GetProjectFunctionCombinedStatsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1GetProjectFunctionCombinedStatsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type V1GetProjectLogsResponse struct { Body []byte HTTPResponse *http.Response @@ -12402,6 +12506,15 @@ func (c *ClientWithResponses) V1GetSecurityAdvisorsWithResponse(ctx context.Cont return ParseV1GetSecurityAdvisorsResponse(rsp) } +// V1GetProjectFunctionCombinedStatsWithResponse request returning *V1GetProjectFunctionCombinedStatsResponse +func (c *ClientWithResponses) V1GetProjectFunctionCombinedStatsWithResponse(ctx context.Context, ref string, params *V1GetProjectFunctionCombinedStatsParams, reqEditors ...RequestEditorFn) (*V1GetProjectFunctionCombinedStatsResponse, error) { + rsp, err := c.V1GetProjectFunctionCombinedStats(ctx, ref, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1GetProjectFunctionCombinedStatsResponse(rsp) +} + // V1GetProjectLogsWithResponse request returning *V1GetProjectLogsResponse func (c *ClientWithResponses) V1GetProjectLogsWithResponse(ctx context.Context, ref string, params *V1GetProjectLogsParams, reqEditors ...RequestEditorFn) (*V1GetProjectLogsResponse, error) { rsp, err := c.V1GetProjectLogs(ctx, ref, params, reqEditors...) @@ -14203,6 +14316,32 @@ func ParseV1GetSecurityAdvisorsResponse(rsp *http.Response) (*V1GetSecurityAdvis return response, nil } +// ParseV1GetProjectFunctionCombinedStatsResponse parses an HTTP response from a V1GetProjectFunctionCombinedStatsWithResponse call +func ParseV1GetProjectFunctionCombinedStatsResponse(rsp *http.Response) (*V1GetProjectFunctionCombinedStatsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1GetProjectFunctionCombinedStatsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest AnalyticsResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + // ParseV1GetProjectLogsResponse parses an HTTP response from a V1GetProjectLogsWithResponse call func ParseV1GetProjectLogsResponse(rsp *http.Response) (*V1GetProjectLogsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index 105856d48a..f4e02f28d8 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -999,15 +999,23 @@ const ( Sql V1GetSecurityAdvisorsParamsLintType = "sql" ) +// Defines values for V1GetProjectFunctionCombinedStatsParamsInterval. +const ( + V1GetProjectFunctionCombinedStatsParamsIntervalN15min V1GetProjectFunctionCombinedStatsParamsInterval = "15min" + V1GetProjectFunctionCombinedStatsParamsIntervalN1day V1GetProjectFunctionCombinedStatsParamsInterval = "1day" + V1GetProjectFunctionCombinedStatsParamsIntervalN1hr V1GetProjectFunctionCombinedStatsParamsInterval = "1hr" + V1GetProjectFunctionCombinedStatsParamsIntervalN3hr V1GetProjectFunctionCombinedStatsParamsInterval = "3hr" +) + // Defines values for V1GetProjectUsageApiCountParamsInterval. const ( - N15min V1GetProjectUsageApiCountParamsInterval = "15min" - N1day V1GetProjectUsageApiCountParamsInterval = "1day" - N1hr V1GetProjectUsageApiCountParamsInterval = "1hr" - N30min V1GetProjectUsageApiCountParamsInterval = "30min" - N3day V1GetProjectUsageApiCountParamsInterval = "3day" - N3hr V1GetProjectUsageApiCountParamsInterval = "3hr" - N7day V1GetProjectUsageApiCountParamsInterval = "7day" + V1GetProjectUsageApiCountParamsIntervalN15min V1GetProjectUsageApiCountParamsInterval = "15min" + V1GetProjectUsageApiCountParamsIntervalN1day V1GetProjectUsageApiCountParamsInterval = "1day" + V1GetProjectUsageApiCountParamsIntervalN1hr V1GetProjectUsageApiCountParamsInterval = "1hr" + V1GetProjectUsageApiCountParamsIntervalN30min V1GetProjectUsageApiCountParamsInterval = "30min" + V1GetProjectUsageApiCountParamsIntervalN3day V1GetProjectUsageApiCountParamsInterval = "3day" + V1GetProjectUsageApiCountParamsIntervalN3hr V1GetProjectUsageApiCountParamsInterval = "3hr" + V1GetProjectUsageApiCountParamsIntervalN7day V1GetProjectUsageApiCountParamsInterval = "7day" ) // Defines values for V1RemoveProjectAddonParamsAddonVariant0. @@ -1272,6 +1280,8 @@ type AuthConfigResponse struct { MfaTotpVerifyEnabled nullable.Nullable[bool] `json:"mfa_totp_verify_enabled"` MfaWebAuthnEnrollEnabled nullable.Nullable[bool] `json:"mfa_web_authn_enroll_enabled"` MfaWebAuthnVerifyEnabled nullable.Nullable[bool] `json:"mfa_web_authn_verify_enabled"` + NimbusOauthClientId nullable.Nullable[string] `json:"nimbus_oauth_client_id"` + NimbusOauthClientSecret nullable.Nullable[string] `json:"nimbus_oauth_client_secret"` PasswordHibpEnabled nullable.Nullable[bool] `json:"password_hibp_enabled"` PasswordMinLength nullable.Nullable[int] `json:"password_min_length"` PasswordRequiredCharacters nullable.Nullable[AuthConfigResponsePasswordRequiredCharacters] `json:"password_required_characters"` @@ -2529,6 +2539,8 @@ type UpdateAuthConfigBody struct { MfaTotpVerifyEnabled nullable.Nullable[bool] `json:"mfa_totp_verify_enabled,omitempty"` MfaWebAuthnEnrollEnabled nullable.Nullable[bool] `json:"mfa_web_authn_enroll_enabled,omitempty"` MfaWebAuthnVerifyEnabled nullable.Nullable[bool] `json:"mfa_web_authn_verify_enabled,omitempty"` + NimbusOauthClientId nullable.Nullable[string] `json:"nimbus_oauth_client_id,omitempty"` + NimbusOauthClientSecret nullable.Nullable[string] `json:"nimbus_oauth_client_secret,omitempty"` PasswordHibpEnabled nullable.Nullable[bool] `json:"password_hibp_enabled,omitempty"` PasswordMinLength nullable.Nullable[int] `json:"password_min_length,omitempty"` PasswordRequiredCharacters nullable.Nullable[UpdateAuthConfigBodyPasswordRequiredCharacters] `json:"password_required_characters,omitempty"` @@ -3259,6 +3271,15 @@ type V1GetSecurityAdvisorsParams struct { // V1GetSecurityAdvisorsParamsLintType defines parameters for V1GetSecurityAdvisors. type V1GetSecurityAdvisorsParamsLintType string +// V1GetProjectFunctionCombinedStatsParams defines parameters for V1GetProjectFunctionCombinedStats. +type V1GetProjectFunctionCombinedStatsParams struct { + Interval V1GetProjectFunctionCombinedStatsParamsInterval `form:"interval" json:"interval"` + FunctionId string `form:"function_id" json:"function_id"` +} + +// V1GetProjectFunctionCombinedStatsParamsInterval defines parameters for V1GetProjectFunctionCombinedStats. +type V1GetProjectFunctionCombinedStatsParamsInterval string + // V1GetProjectLogsParams defines parameters for V1GetProjectLogs. type V1GetProjectLogsParams struct { Sql *string `form:"sql,omitempty" json:"sql,omitempty"`