From b68800f58be3ed6d819e6eedeee08d3404642004 Mon Sep 17 00:00:00 2001 From: CloudQuery Bot <102256036+cq-bot@users.noreply.github.com> Date: Wed, 10 Sep 2025 09:33:00 +0100 Subject: [PATCH 1/3] fix: Generate CloudQuery Go API Client from `spec.json` (#319) This PR was created by a scheduled workflow to generate the CloudQuery Go API Client from `spec.json` --- spec.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec.json b/spec.json index 09e1c26..cbc3747 100644 --- a/spec.json +++ b/spec.json @@ -9663,8 +9663,9 @@ "example" : "Human Readable Name", "maxLength" : 255, "minLength" : 1, - "pattern" : "^[a-zA-Z\\p{L}\\p{N}_][a-zA-Z\\p{L}\\p{N}_ \\-']*$", - "type" : "string" + "pattern" : "^[a-zA-Z\\p{L}\\p{N}_][a-zA-Z\\p{L}\\p{N}_ \\-'\\(\\)\\[\\]]*$", + "type" : "string", + "x-pattern-message" : "can contain only letters, numbers, spaces, hyphens, underscores, brackets and apostrophes" }, "PromoteSyncSourceTestConnection" : { "description" : "Sync Source Definition", From 88f276fde79752059ffaee10e95524f831b8c8ff Mon Sep 17 00:00:00 2001 From: CloudQuery Bot <102256036+cq-bot@users.noreply.github.com> Date: Mon, 15 Sep 2025 13:34:05 +0100 Subject: [PATCH 2/3] fix: Generate CloudQuery Go API Client from `spec.json` (#321) This PR was created by a scheduled workflow to generate the CloudQuery Go API Client from `spec.json` --- client.gen.go | 388 ++++++++++++++++++++++++++++++++++++++++++++ models.gen.go | 441 ++++++++++++++++++++++++++++++++++++++++++++++++++ spec.json | 192 ++++++++++++++++++++++ 3 files changed, 1021 insertions(+) diff --git a/client.gen.go b/client.gen.go index 26e8a05..73626f9 100644 --- a/client.gen.go +++ b/client.gen.go @@ -313,6 +313,16 @@ type ClientInterface interface { // DownloadAddonAssetByTeam request DownloadAddonAssetByTeam(ctx context.Context, teamName TeamName, addonTeam AddonTeam, addonType AddonType, addonName AddonName, versionName VersionName, params *DownloadAddonAssetByTeamParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // AIOnboardingChatWithBody request with any body + AIOnboardingChatWithBody(ctx context.Context, teamName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + AIOnboardingChat(ctx context.Context, teamName string, body AIOnboardingChatJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // AIOnboardingNewConversationWithBody request with any body + AIOnboardingNewConversationWithBody(ctx context.Context, teamName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + AIOnboardingNewConversation(ctx context.Context, teamName string, body AIOnboardingNewConversationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListTeamAPIKeys request ListTeamAPIKeys(ctx context.Context, teamName TeamName, params *ListTeamAPIKeysParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -1675,6 +1685,54 @@ func (c *Client) DownloadAddonAssetByTeam(ctx context.Context, teamName TeamName return c.Client.Do(req) } +func (c *Client) AIOnboardingChatWithBody(ctx context.Context, teamName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewAIOnboardingChatRequestWithBody(c.Server, teamName, 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) AIOnboardingChat(ctx context.Context, teamName string, body AIOnboardingChatJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewAIOnboardingChatRequest(c.Server, teamName, 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) AIOnboardingNewConversationWithBody(ctx context.Context, teamName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewAIOnboardingNewConversationRequestWithBody(c.Server, teamName, 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) AIOnboardingNewConversation(ctx context.Context, teamName string, body AIOnboardingNewConversationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewAIOnboardingNewConversationRequest(c.Server, teamName, 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) ListTeamAPIKeys(ctx context.Context, teamName TeamName, params *ListTeamAPIKeysParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListTeamAPIKeysRequest(c.Server, teamName, params) if err != nil { @@ -6933,6 +6991,100 @@ func NewDownloadAddonAssetByTeamRequest(server string, teamName TeamName, addonT return req, nil } +// NewAIOnboardingChatRequest calls the generic AIOnboardingChat builder with application/json body +func NewAIOnboardingChatRequest(server string, teamName string, body AIOnboardingChatJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewAIOnboardingChatRequestWithBody(server, teamName, "application/json", bodyReader) +} + +// NewAIOnboardingChatRequestWithBody generates requests for AIOnboardingChat with any type of body +func NewAIOnboardingChatRequestWithBody(server string, teamName string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "team_name", runtime.ParamLocationPath, teamName) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/teams/%s/ai-onboarding/chat", 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 +} + +// NewAIOnboardingNewConversationRequest calls the generic AIOnboardingNewConversation builder with application/json body +func NewAIOnboardingNewConversationRequest(server string, teamName string, body AIOnboardingNewConversationJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewAIOnboardingNewConversationRequestWithBody(server, teamName, "application/json", bodyReader) +} + +// NewAIOnboardingNewConversationRequestWithBody generates requests for AIOnboardingNewConversation with any type of body +func NewAIOnboardingNewConversationRequestWithBody(server string, teamName string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "team_name", runtime.ParamLocationPath, teamName) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/teams/%s/ai-onboarding/conversations", 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 +} + // NewListTeamAPIKeysRequest generates requests for ListTeamAPIKeys func NewListTeamAPIKeysRequest(server string, teamName TeamName, params *ListTeamAPIKeysParams) (*http.Request, error) { var err error @@ -12536,6 +12688,16 @@ type ClientWithResponsesInterface interface { // DownloadAddonAssetByTeamWithResponse request DownloadAddonAssetByTeamWithResponse(ctx context.Context, teamName TeamName, addonTeam AddonTeam, addonType AddonType, addonName AddonName, versionName VersionName, params *DownloadAddonAssetByTeamParams, reqEditors ...RequestEditorFn) (*DownloadAddonAssetByTeamResponse, error) + // AIOnboardingChatWithBodyWithResponse request with any body + AIOnboardingChatWithBodyWithResponse(ctx context.Context, teamName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AIOnboardingChatResponse, error) + + AIOnboardingChatWithResponse(ctx context.Context, teamName string, body AIOnboardingChatJSONRequestBody, reqEditors ...RequestEditorFn) (*AIOnboardingChatResponse, error) + + // AIOnboardingNewConversationWithBodyWithResponse request with any body + AIOnboardingNewConversationWithBodyWithResponse(ctx context.Context, teamName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AIOnboardingNewConversationResponse, error) + + AIOnboardingNewConversationWithResponse(ctx context.Context, teamName string, body AIOnboardingNewConversationJSONRequestBody, reqEditors ...RequestEditorFn) (*AIOnboardingNewConversationResponse, error) + // ListTeamAPIKeysWithResponse request ListTeamAPIKeysWithResponse(ctx context.Context, teamName TeamName, params *ListTeamAPIKeysParams, reqEditors ...RequestEditorFn) (*ListTeamAPIKeysResponse, error) @@ -14429,6 +14591,62 @@ func (r DownloadAddonAssetByTeamResponse) StatusCode() int { return 0 } +type AIOnboardingChatResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *AIOnboardingChat200Response + JSON400 *BadRequest + JSON401 *RequiresAuthentication + JSON403 *Forbidden + JSON404 *NotFound + JSON405 *MethodNotAllowed + JSON500 *InternalError +} + +// Status returns HTTPResponse.Status +func (r AIOnboardingChatResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r AIOnboardingChatResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type AIOnboardingNewConversationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *AIOnboardingNewConversation200Response + JSON400 *BadRequest + JSON401 *RequiresAuthentication + JSON403 *Forbidden + JSON404 *NotFound + JSON405 *MethodNotAllowed + JSON500 *InternalError +} + +// Status returns HTTPResponse.Status +func (r AIOnboardingNewConversationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r AIOnboardingNewConversationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type ListTeamAPIKeysResponse struct { Body []byte HTTPResponse *http.Response @@ -17838,6 +18056,40 @@ func (c *ClientWithResponses) DownloadAddonAssetByTeamWithResponse(ctx context.C return ParseDownloadAddonAssetByTeamResponse(rsp) } +// AIOnboardingChatWithBodyWithResponse request with arbitrary body returning *AIOnboardingChatResponse +func (c *ClientWithResponses) AIOnboardingChatWithBodyWithResponse(ctx context.Context, teamName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AIOnboardingChatResponse, error) { + rsp, err := c.AIOnboardingChatWithBody(ctx, teamName, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseAIOnboardingChatResponse(rsp) +} + +func (c *ClientWithResponses) AIOnboardingChatWithResponse(ctx context.Context, teamName string, body AIOnboardingChatJSONRequestBody, reqEditors ...RequestEditorFn) (*AIOnboardingChatResponse, error) { + rsp, err := c.AIOnboardingChat(ctx, teamName, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseAIOnboardingChatResponse(rsp) +} + +// AIOnboardingNewConversationWithBodyWithResponse request with arbitrary body returning *AIOnboardingNewConversationResponse +func (c *ClientWithResponses) AIOnboardingNewConversationWithBodyWithResponse(ctx context.Context, teamName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AIOnboardingNewConversationResponse, error) { + rsp, err := c.AIOnboardingNewConversationWithBody(ctx, teamName, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseAIOnboardingNewConversationResponse(rsp) +} + +func (c *ClientWithResponses) AIOnboardingNewConversationWithResponse(ctx context.Context, teamName string, body AIOnboardingNewConversationJSONRequestBody, reqEditors ...RequestEditorFn) (*AIOnboardingNewConversationResponse, error) { + rsp, err := c.AIOnboardingNewConversation(ctx, teamName, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseAIOnboardingNewConversationResponse(rsp) +} + // ListTeamAPIKeysWithResponse request returning *ListTeamAPIKeysResponse func (c *ClientWithResponses) ListTeamAPIKeysWithResponse(ctx context.Context, teamName TeamName, params *ListTeamAPIKeysParams, reqEditors ...RequestEditorFn) (*ListTeamAPIKeysResponse, error) { rsp, err := c.ListTeamAPIKeys(ctx, teamName, params, reqEditors...) @@ -22179,6 +22431,142 @@ func ParseDownloadAddonAssetByTeamResponse(rsp *http.Response) (*DownloadAddonAs return response, nil } +// ParseAIOnboardingChatResponse parses an HTTP response from a AIOnboardingChatWithResponse call +func ParseAIOnboardingChatResponse(rsp *http.Response) (*AIOnboardingChatResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &AIOnboardingChatResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest AIOnboardingChat200Response + 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 == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &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 == 405: + var dest MethodNotAllowed + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON405 = &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 +} + +// ParseAIOnboardingNewConversationResponse parses an HTTP response from a AIOnboardingNewConversationWithResponse call +func ParseAIOnboardingNewConversationResponse(rsp *http.Response) (*AIOnboardingNewConversationResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &AIOnboardingNewConversationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest AIOnboardingNewConversation200Response + 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 == 403: + var dest Forbidden + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &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 == 405: + var dest MethodNotAllowed + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON405 = &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 +} + // ParseListTeamAPIKeysResponse parses an HTTP response from a ListTeamAPIKeysWithResponse call func ParseListTeamAPIKeysResponse(rsp *http.Response) (*ListTeamAPIKeysResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) diff --git a/models.gen.go b/models.gen.go index 1e24032..c2ffe17 100644 --- a/models.gen.go +++ b/models.gen.go @@ -313,6 +313,42 @@ const ( GetGroupedTeamUsageSummaryParamsGroupBySyncId GetGroupedTeamUsageSummaryParamsGroupBy = "sync_id" ) +// AIOnboardingChat200Response defines model for AIOnboardingChat_200_response. +type AIOnboardingChat200Response struct { + // FunctionCall The name of the function being called (if any) + FunctionCall *interface{} `json:"function_call,omitempty"` + + // FunctionCallArguments Arguments for the function call (if any) + FunctionCallArguments *interface{} `json:"function_call_arguments,omitempty"` + + // FunctionCallID ID of the function call (if any) + FunctionCallID *interface{} `json:"function_call_id,omitempty"` + + // Message The AI assistant's response message + Message interface{} `json:"message"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// AIOnboardingChatRequest defines model for AIOnboardingChat_request. +type AIOnboardingChatRequest struct { + // ConversationID Optional conversation ID to continue an existing conversation + ConversationID *interface{} `json:"conversation_id,omitempty"` + + // FunctionCallOutputs Function call outputs from previous interactions + FunctionCallOutputs *interface{} `json:"function_call_outputs,omitempty"` + + // Message The user's message to send to the AI assistant + Message *interface{} `json:"message,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// AIOnboardingNewConversation200Response defines model for AIOnboardingNewConversation_200_response. +type AIOnboardingNewConversation200Response struct { + // ConversationID The ID of the new conversation + ConversationID interface{} `json:"conversation_id"` + AdditionalProperties map[string]interface{} `json:"-"` +} + // APIKey API Key to interact with CloudQuery Cloud under specific team type APIKey struct { CreatedAt *time.Time `json:"created_at,omitempty"` @@ -1006,6 +1042,22 @@ type FinalizePluginUIAssetUploadRequest struct { UIID string `json:"ui_id"` } +// FunctionCallOutput defines model for FunctionCallOutput. +type FunctionCallOutput struct { + // Arguments The arguments passed to the function + Arguments interface{} `json:"arguments"` + + // CallID The unique identifier for this function call + CallID interface{} `json:"call_id"` + + // Name The name of the function that was called + Name interface{} `json:"name"` + + // Output The output/result from the function call + Output interface{} `json:"output"` + AdditionalProperties map[string]interface{} `json:"-"` +} + // GetConnectorAuthStatusAWS200Response defines model for GetConnectorAuthStatusAWS_200_response. type GetConnectorAuthStatusAWS200Response struct { // ExternalID External ID used for the role @@ -3328,6 +3380,9 @@ type DownloadAddonAssetByTeamParams struct { Accept *string `json:"Accept,omitempty"` } +// AIOnboardingNewConversationJSONBody defines parameters for AIOnboardingNewConversation. +type AIOnboardingNewConversationJSONBody map[string]interface{} + // ListTeamAPIKeysParams defines parameters for ListTeamAPIKeys. type ListTeamAPIKeysParams struct { // PerPage The number of results per page (max 1000). @@ -3632,6 +3687,12 @@ type UpdateTeamJSONRequestBody = UpdateTeamRequest // CreateAddonOrderForTeamJSONRequestBody defines body for CreateAddonOrderForTeam for application/json ContentType. type CreateAddonOrderForTeamJSONRequestBody = AddonOrderCreate +// AIOnboardingChatJSONRequestBody defines body for AIOnboardingChat for application/json ContentType. +type AIOnboardingChatJSONRequestBody = AIOnboardingChatRequest + +// AIOnboardingNewConversationJSONRequestBody defines body for AIOnboardingNewConversation for application/json ContentType. +type AIOnboardingNewConversationJSONRequestBody AIOnboardingNewConversationJSONBody + // CreateTeamAPIKeyJSONRequestBody defines body for CreateTeamAPIKey for application/json ContentType. type CreateTeamAPIKeyJSONRequestBody = CreateTeamAPIKeyRequest @@ -3752,6 +3813,281 @@ type UserTOTPVerifyJSONRequestBody = UserTOTPVerifyRequest // VerifyUserEmailJSONRequestBody defines body for VerifyUserEmail for application/json ContentType. type VerifyUserEmailJSONRequestBody = VerifyUserEmailRequest +// Getter for additional properties for AIOnboardingChat200Response. Returns the specified +// element and whether it was found +func (a AIOnboardingChat200Response) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for AIOnboardingChat200Response +func (a *AIOnboardingChat200Response) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for AIOnboardingChat200Response to handle AdditionalProperties +func (a *AIOnboardingChat200Response) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["function_call"]; found { + err = json.Unmarshal(raw, &a.FunctionCall) + if err != nil { + return fmt.Errorf("error reading 'function_call': %w", err) + } + delete(object, "function_call") + } + + if raw, found := object["function_call_arguments"]; found { + err = json.Unmarshal(raw, &a.FunctionCallArguments) + if err != nil { + return fmt.Errorf("error reading 'function_call_arguments': %w", err) + } + delete(object, "function_call_arguments") + } + + if raw, found := object["function_call_id"]; found { + err = json.Unmarshal(raw, &a.FunctionCallID) + if err != nil { + return fmt.Errorf("error reading 'function_call_id': %w", err) + } + delete(object, "function_call_id") + } + + if raw, found := object["message"]; found { + err = json.Unmarshal(raw, &a.Message) + if err != nil { + return fmt.Errorf("error reading 'message': %w", err) + } + delete(object, "message") + } + + 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 AIOnboardingChat200Response to handle AdditionalProperties +func (a AIOnboardingChat200Response) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.FunctionCall != nil { + object["function_call"], err = json.Marshal(a.FunctionCall) + if err != nil { + return nil, fmt.Errorf("error marshaling 'function_call': %w", err) + } + } + + if a.FunctionCallArguments != nil { + object["function_call_arguments"], err = json.Marshal(a.FunctionCallArguments) + if err != nil { + return nil, fmt.Errorf("error marshaling 'function_call_arguments': %w", err) + } + } + + if a.FunctionCallID != nil { + object["function_call_id"], err = json.Marshal(a.FunctionCallID) + if err != nil { + return nil, fmt.Errorf("error marshaling 'function_call_id': %w", err) + } + } + + object["message"], err = json.Marshal(a.Message) + if err != nil { + return nil, fmt.Errorf("error marshaling 'message': %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 AIOnboardingChatRequest. Returns the specified +// element and whether it was found +func (a AIOnboardingChatRequest) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for AIOnboardingChatRequest +func (a *AIOnboardingChatRequest) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for AIOnboardingChatRequest to handle AdditionalProperties +func (a *AIOnboardingChatRequest) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["conversation_id"]; found { + err = json.Unmarshal(raw, &a.ConversationID) + if err != nil { + return fmt.Errorf("error reading 'conversation_id': %w", err) + } + delete(object, "conversation_id") + } + + if raw, found := object["function_call_outputs"]; found { + err = json.Unmarshal(raw, &a.FunctionCallOutputs) + if err != nil { + return fmt.Errorf("error reading 'function_call_outputs': %w", err) + } + delete(object, "function_call_outputs") + } + + if raw, found := object["message"]; found { + err = json.Unmarshal(raw, &a.Message) + if err != nil { + return fmt.Errorf("error reading 'message': %w", err) + } + delete(object, "message") + } + + 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 AIOnboardingChatRequest to handle AdditionalProperties +func (a AIOnboardingChatRequest) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.ConversationID != nil { + object["conversation_id"], err = json.Marshal(a.ConversationID) + if err != nil { + return nil, fmt.Errorf("error marshaling 'conversation_id': %w", err) + } + } + + if a.FunctionCallOutputs != nil { + object["function_call_outputs"], err = json.Marshal(a.FunctionCallOutputs) + if err != nil { + return nil, fmt.Errorf("error marshaling 'function_call_outputs': %w", err) + } + } + + if a.Message != nil { + object["message"], err = json.Marshal(a.Message) + if err != nil { + return nil, fmt.Errorf("error marshaling 'message': %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 AIOnboardingNewConversation200Response. Returns the specified +// element and whether it was found +func (a AIOnboardingNewConversation200Response) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for AIOnboardingNewConversation200Response +func (a *AIOnboardingNewConversation200Response) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for AIOnboardingNewConversation200Response to handle AdditionalProperties +func (a *AIOnboardingNewConversation200Response) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["conversation_id"]; found { + err = json.Unmarshal(raw, &a.ConversationID) + if err != nil { + return fmt.Errorf("error reading 'conversation_id': %w", err) + } + delete(object, "conversation_id") + } + + 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 AIOnboardingNewConversation200Response to handle AdditionalProperties +func (a AIOnboardingNewConversation200Response) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + object["conversation_id"], err = json.Marshal(a.ConversationID) + if err != nil { + return nil, fmt.Errorf("error marshaling 'conversation_id': %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 ActivatePlatform200Response. Returns the specified // element and whether it was found func (a ActivatePlatform200Response) Get(fieldName string) (value interface{}, found bool) { @@ -4599,6 +4935,111 @@ func (a CreateTeamRequest) MarshalJSON() ([]byte, error) { return json.Marshal(object) } +// Getter for additional properties for FunctionCallOutput. Returns the specified +// element and whether it was found +func (a FunctionCallOutput) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for FunctionCallOutput +func (a *FunctionCallOutput) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for FunctionCallOutput to handle AdditionalProperties +func (a *FunctionCallOutput) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["arguments"]; found { + err = json.Unmarshal(raw, &a.Arguments) + if err != nil { + return fmt.Errorf("error reading 'arguments': %w", err) + } + delete(object, "arguments") + } + + if raw, found := object["call_id"]; found { + err = json.Unmarshal(raw, &a.CallID) + if err != nil { + return fmt.Errorf("error reading 'call_id': %w", err) + } + delete(object, "call_id") + } + + if raw, found := object["name"]; found { + err = json.Unmarshal(raw, &a.Name) + if err != nil { + return fmt.Errorf("error reading 'name': %w", err) + } + delete(object, "name") + } + + if raw, found := object["output"]; found { + err = json.Unmarshal(raw, &a.Output) + if err != nil { + return fmt.Errorf("error reading 'output': %w", err) + } + delete(object, "output") + } + + 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 FunctionCallOutput to handle AdditionalProperties +func (a FunctionCallOutput) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + object["arguments"], err = json.Marshal(a.Arguments) + if err != nil { + return nil, fmt.Errorf("error marshaling 'arguments': %w", err) + } + + object["call_id"], err = json.Marshal(a.CallID) + if err != nil { + return nil, fmt.Errorf("error marshaling 'call_id': %w", err) + } + + object["name"], err = json.Marshal(a.Name) + if err != nil { + return nil, fmt.Errorf("error marshaling 'name': %w", err) + } + + object["output"], err = json.Marshal(a.Output) + if err != nil { + return nil, fmt.Errorf("error marshaling 'output': %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 cbc3747..4e6c596 100644 --- a/spec.json +++ b/spec.json @@ -46,6 +46,8 @@ "name" : "analytics" }, { "name" : "platform" + }, { + "name" : "ai-onboarding" } ], "paths" : { "/" : { @@ -6861,6 +6863,121 @@ "tags" : [ "platform" ], "x-internal" : true } + }, + "/teams/{team_name}/ai-onboarding/chat" : { + "post" : { + "description" : "Send a chat message to the AI onboarding assistant", + "operationId" : "AIOnboardingChat", + "parameters" : [ { + "explode" : false, + "in" : "path", + "name" : "team_name", + "required" : true, + "schema" : { + "type" : "string" + }, + "style" : "simple", + "x-go-name" : "TeamName" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AIOnboardingChat_request" + } + } + } + }, + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AIOnboardingChat_200_response" + } + } + }, + "description" : "Chat response from the AI assistant" + }, + "400" : { + "$ref" : "#/components/responses/BadRequest" + }, + "401" : { + "$ref" : "#/components/responses/RequiresAuthentication" + }, + "403" : { + "$ref" : "#/components/responses/Forbidden" + }, + "404" : { + "$ref" : "#/components/responses/NotFound" + }, + "405" : { + "$ref" : "#/components/responses/MethodNotAllowed" + }, + "500" : { + "$ref" : "#/components/responses/InternalError" + } + }, + "tags" : [ "ai-onboarding" ] + } + }, + "/teams/{team_name}/ai-onboarding/conversations" : { + "post" : { + "description" : "Start a new conversation with the AI onboarding assistant", + "operationId" : "AIOnboardingNewConversation", + "parameters" : [ { + "explode" : false, + "in" : "path", + "name" : "team_name", + "required" : true, + "schema" : { + "type" : "string" + }, + "style" : "simple", + "x-go-name" : "TeamName" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "additionalProperties" : { }, + "properties" : { } + } + } + } + }, + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AIOnboardingNewConversation_200_response" + } + } + }, + "description" : "New conversation started successfully" + }, + "400" : { + "$ref" : "#/components/responses/BadRequest" + }, + "401" : { + "$ref" : "#/components/responses/RequiresAuthentication" + }, + "403" : { + "$ref" : "#/components/responses/Forbidden" + }, + "404" : { + "$ref" : "#/components/responses/NotFound" + }, + "405" : { + "$ref" : "#/components/responses/MethodNotAllowed" + }, + "500" : { + "$ref" : "#/components/responses/InternalError" + } + }, + "tags" : [ "ai-onboarding" ] + } } }, "components" : { @@ -10774,6 +10891,29 @@ }, "required" : [ "base_url", "return_url" ] }, + "FunctionCallOutput" : { + "additionalProperties" : { }, + "properties" : { + "name" : { + "description" : "The name of the function that was called", + "x-go-name" : "Name" + }, + "arguments" : { + "additionalProperties" : false, + "description" : "The arguments passed to the function", + "x-go-name" : "Arguments" + }, + "call_id" : { + "description" : "The unique identifier for this function call", + "x-go-name" : "CallID" + }, + "output" : { + "description" : "The output/result from the function call", + "x-go-name" : "Output" + } + }, + "required" : [ "arguments", "call_id", "name", "output" ] + }, "UploadImage_request" : { "properties" : { "content_type" : { @@ -11897,6 +12037,58 @@ }, "required" : [ "installation_id" ] }, + "AIOnboardingChat_request" : { + "additionalProperties" : { }, + "properties" : { + "message" : { + "description" : "The user's message to send to the AI assistant", + "x-go-name" : "Message" + }, + "function_call_outputs" : { + "description" : "Function call outputs from previous interactions", + "items" : { + "$ref" : "#/components/schemas/FunctionCallOutput" + }, + "x-go-name" : "FunctionCallOutputs" + }, + "conversation_id" : { + "description" : "Optional conversation ID to continue an existing conversation", + "x-go-name" : "ConversationID" + } + } + }, + "AIOnboardingChat_200_response" : { + "additionalProperties" : { }, + "properties" : { + "message" : { + "description" : "The AI assistant's response message", + "x-go-name" : "Message" + }, + "function_call" : { + "description" : "The name of the function being called (if any)", + "x-go-name" : "FunctionCall" + }, + "function_call_arguments" : { + "description" : "Arguments for the function call (if any)", + "x-go-name" : "FunctionCallArguments" + }, + "function_call_id" : { + "description" : "ID of the function call (if any)", + "x-go-name" : "FunctionCallID" + } + }, + "required" : [ "message" ] + }, + "AIOnboardingNewConversation_200_response" : { + "additionalProperties" : { }, + "properties" : { + "conversation_id" : { + "description" : "The ID of the new conversation", + "x-go-name" : "ConversationID" + } + }, + "required" : [ "conversation_id" ] + }, "UsageIncrease_tables_inner" : { "properties" : { "name" : { From 1984765c59e9d98fb372efd4674ab606182355c6 Mon Sep 17 00:00:00 2001 From: CloudQuery Bot <102256036+cq-bot@users.noreply.github.com> Date: Mon, 15 Sep 2025 13:37:02 +0100 Subject: [PATCH 3/3] chore(main): Release v1.14.3 (#320) :robot: I have created a release *beep* *boop* --- ## [1.14.3](https://github.com/cloudquery/cloudquery-api-go/compare/v1.14.2...v1.14.3) (2025-09-15) ### Bug Fixes * Generate CloudQuery Go API Client from `spec.json` ([#319](https://github.com/cloudquery/cloudquery-api-go/issues/319)) ([b68800f](https://github.com/cloudquery/cloudquery-api-go/commit/b68800f58be3ed6d819e6eedeee08d3404642004)) * Generate CloudQuery Go API Client from `spec.json` ([#321](https://github.com/cloudquery/cloudquery-api-go/issues/321)) ([88f276f](https://github.com/cloudquery/cloudquery-api-go/commit/88f276fde79752059ffaee10e95524f831b8c8ff)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 3086963..47a15d7 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.14.2" + ".": "1.14.3" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 454b689..77c2b1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [1.14.3](https://github.com/cloudquery/cloudquery-api-go/compare/v1.14.2...v1.14.3) (2025-09-15) + + +### Bug Fixes + +* Generate CloudQuery Go API Client from `spec.json` ([#319](https://github.com/cloudquery/cloudquery-api-go/issues/319)) ([b68800f](https://github.com/cloudquery/cloudquery-api-go/commit/b68800f58be3ed6d819e6eedeee08d3404642004)) +* Generate CloudQuery Go API Client from `spec.json` ([#321](https://github.com/cloudquery/cloudquery-api-go/issues/321)) ([88f276f](https://github.com/cloudquery/cloudquery-api-go/commit/88f276fde79752059ffaee10e95524f831b8c8ff)) + ## [1.14.2](https://github.com/cloudquery/cloudquery-api-go/compare/v1.14.1...v1.14.2) (2025-09-01)