diff --git a/client.gen.go b/client.gen.go index f4c350f..d3fba9a 100644 --- a/client.gen.go +++ b/client.gen.go @@ -338,6 +338,17 @@ type ClientInterface interface { AuthenticateConnectorAWS(ctx context.Context, teamName TeamName, connectorID ConnectorID, body AuthenticateConnectorAWSJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetConnectorAuthStatusGCP request + GetConnectorAuthStatusGCP(ctx context.Context, teamName TeamName, connectorID ConnectorID, reqEditors ...RequestEditorFn) (*http.Response, error) + + // AuthenticateConnectorGCPWithBody request with any body + AuthenticateConnectorGCPWithBody(ctx context.Context, teamName TeamName, connectorID ConnectorID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + AuthenticateConnectorGCP(ctx context.Context, teamName TeamName, connectorID ConnectorID, body AuthenticateConnectorGCPJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // AuthenticateConnectorFinishGCP request + AuthenticateConnectorFinishGCP(ctx context.Context, teamName TeamName, connectorID ConnectorID, reqEditors ...RequestEditorFn) (*http.Response, error) + // AuthenticateConnectorFinishOAuthWithBody request with any body AuthenticateConnectorFinishOAuthWithBody(ctx context.Context, teamName TeamName, connectorID ConnectorID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -1685,6 +1696,54 @@ func (c *Client) AuthenticateConnectorAWS(ctx context.Context, teamName TeamName return c.Client.Do(req) } +func (c *Client) GetConnectorAuthStatusGCP(ctx context.Context, teamName TeamName, connectorID ConnectorID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetConnectorAuthStatusGCPRequest(c.Server, teamName, connectorID) + 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) AuthenticateConnectorGCPWithBody(ctx context.Context, teamName TeamName, connectorID ConnectorID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewAuthenticateConnectorGCPRequestWithBody(c.Server, teamName, connectorID, 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) AuthenticateConnectorGCP(ctx context.Context, teamName TeamName, connectorID ConnectorID, body AuthenticateConnectorGCPJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewAuthenticateConnectorGCPRequest(c.Server, teamName, connectorID, 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) AuthenticateConnectorFinishGCP(ctx context.Context, teamName TeamName, connectorID ConnectorID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewAuthenticateConnectorFinishGCPRequest(c.Server, teamName, connectorID) + 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) AuthenticateConnectorFinishOAuthWithBody(ctx context.Context, teamName TeamName, connectorID ConnectorID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewAuthenticateConnectorFinishOAuthRequestWithBody(c.Server, teamName, connectorID, contentType, body) if err != nil { @@ -6776,6 +6835,142 @@ func NewAuthenticateConnectorAWSRequestWithBody(server string, teamName TeamName return req, nil } +// NewGetConnectorAuthStatusGCPRequest generates requests for GetConnectorAuthStatusGCP +func NewGetConnectorAuthStatusGCPRequest(server string, teamName TeamName, connectorID ConnectorID) (*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 + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "connector_id", runtime.ParamLocationPath, connectorID) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/teams/%s/connectors/%s/authenticate/gcp", pathParam0, pathParam1) + 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 +} + +// NewAuthenticateConnectorGCPRequest calls the generic AuthenticateConnectorGCP builder with application/json body +func NewAuthenticateConnectorGCPRequest(server string, teamName TeamName, connectorID ConnectorID, body AuthenticateConnectorGCPJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewAuthenticateConnectorGCPRequestWithBody(server, teamName, connectorID, "application/json", bodyReader) +} + +// NewAuthenticateConnectorGCPRequestWithBody generates requests for AuthenticateConnectorGCP with any type of body +func NewAuthenticateConnectorGCPRequestWithBody(server string, teamName TeamName, connectorID ConnectorID, 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 + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "connector_id", runtime.ParamLocationPath, connectorID) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/teams/%s/connectors/%s/authenticate/gcp", pathParam0, pathParam1) + 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 +} + +// NewAuthenticateConnectorFinishGCPRequest generates requests for AuthenticateConnectorFinishGCP +func NewAuthenticateConnectorFinishGCPRequest(server string, teamName TeamName, connectorID ConnectorID) (*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 + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "connector_id", runtime.ParamLocationPath, connectorID) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/teams/%s/connectors/%s/authenticate/gcp/finish", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewAuthenticateConnectorFinishOAuthRequest calls the generic AuthenticateConnectorFinishOAuth builder with application/json body func NewAuthenticateConnectorFinishOAuthRequest(server string, teamName TeamName, connectorID ConnectorID, body AuthenticateConnectorFinishOAuthJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader @@ -10943,6 +11138,17 @@ type ClientWithResponsesInterface interface { AuthenticateConnectorAWSWithResponse(ctx context.Context, teamName TeamName, connectorID ConnectorID, body AuthenticateConnectorAWSJSONRequestBody, reqEditors ...RequestEditorFn) (*AuthenticateConnectorAWSResponse, error) + // GetConnectorAuthStatusGCPWithResponse request + GetConnectorAuthStatusGCPWithResponse(ctx context.Context, teamName TeamName, connectorID ConnectorID, reqEditors ...RequestEditorFn) (*GetConnectorAuthStatusGCPResponse, error) + + // AuthenticateConnectorGCPWithBodyWithResponse request with any body + AuthenticateConnectorGCPWithBodyWithResponse(ctx context.Context, teamName TeamName, connectorID ConnectorID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AuthenticateConnectorGCPResponse, error) + + AuthenticateConnectorGCPWithResponse(ctx context.Context, teamName TeamName, connectorID ConnectorID, body AuthenticateConnectorGCPJSONRequestBody, reqEditors ...RequestEditorFn) (*AuthenticateConnectorGCPResponse, error) + + // AuthenticateConnectorFinishGCPWithResponse request + AuthenticateConnectorFinishGCPWithResponse(ctx context.Context, teamName TeamName, connectorID ConnectorID, reqEditors ...RequestEditorFn) (*AuthenticateConnectorFinishGCPResponse, error) + // AuthenticateConnectorFinishOAuthWithBodyWithResponse request with any body AuthenticateConnectorFinishOAuthWithBodyWithResponse(ctx context.Context, teamName TeamName, connectorID ConnectorID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AuthenticateConnectorFinishOAuthResponse, error) @@ -12895,6 +13101,87 @@ func (r AuthenticateConnectorAWSResponse) StatusCode() int { return 0 } +type GetConnectorAuthStatusGCPResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *GetConnectorAuthStatusGCP200Response + JSON400 *BadRequest + JSON401 *RequiresAuthentication + JSON404 *NotFound + JSON422 *UnprocessableEntity + JSON500 *InternalError +} + +// Status returns HTTPResponse.Status +func (r GetConnectorAuthStatusGCPResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetConnectorAuthStatusGCPResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type AuthenticateConnectorGCPResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ConnectorAuthResponseGCP + JSON400 *BadRequest + JSON401 *RequiresAuthentication + JSON404 *NotFound + JSON422 *UnprocessableEntity + JSON500 *InternalError +} + +// Status returns HTTPResponse.Status +func (r AuthenticateConnectorGCPResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r AuthenticateConnectorGCPResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type AuthenticateConnectorFinishGCPResponse struct { + Body []byte + HTTPResponse *http.Response + JSON400 *BadRequest + JSON401 *RequiresAuthentication + JSON403 *Forbidden + JSON404 *NotFound + JSON422 *UnprocessableEntity + JSON500 *InternalError +} + +// Status returns HTTPResponse.Status +func (r AuthenticateConnectorFinishGCPResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r AuthenticateConnectorFinishGCPResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type AuthenticateConnectorFinishOAuthResponse struct { Body []byte HTTPResponse *http.Response @@ -15568,6 +15855,41 @@ func (c *ClientWithResponses) AuthenticateConnectorAWSWithResponse(ctx context.C return ParseAuthenticateConnectorAWSResponse(rsp) } +// GetConnectorAuthStatusGCPWithResponse request returning *GetConnectorAuthStatusGCPResponse +func (c *ClientWithResponses) GetConnectorAuthStatusGCPWithResponse(ctx context.Context, teamName TeamName, connectorID ConnectorID, reqEditors ...RequestEditorFn) (*GetConnectorAuthStatusGCPResponse, error) { + rsp, err := c.GetConnectorAuthStatusGCP(ctx, teamName, connectorID, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetConnectorAuthStatusGCPResponse(rsp) +} + +// AuthenticateConnectorGCPWithBodyWithResponse request with arbitrary body returning *AuthenticateConnectorGCPResponse +func (c *ClientWithResponses) AuthenticateConnectorGCPWithBodyWithResponse(ctx context.Context, teamName TeamName, connectorID ConnectorID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AuthenticateConnectorGCPResponse, error) { + rsp, err := c.AuthenticateConnectorGCPWithBody(ctx, teamName, connectorID, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseAuthenticateConnectorGCPResponse(rsp) +} + +func (c *ClientWithResponses) AuthenticateConnectorGCPWithResponse(ctx context.Context, teamName TeamName, connectorID ConnectorID, body AuthenticateConnectorGCPJSONRequestBody, reqEditors ...RequestEditorFn) (*AuthenticateConnectorGCPResponse, error) { + rsp, err := c.AuthenticateConnectorGCP(ctx, teamName, connectorID, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseAuthenticateConnectorGCPResponse(rsp) +} + +// AuthenticateConnectorFinishGCPWithResponse request returning *AuthenticateConnectorFinishGCPResponse +func (c *ClientWithResponses) AuthenticateConnectorFinishGCPWithResponse(ctx context.Context, teamName TeamName, connectorID ConnectorID, reqEditors ...RequestEditorFn) (*AuthenticateConnectorFinishGCPResponse, error) { + rsp, err := c.AuthenticateConnectorFinishGCP(ctx, teamName, connectorID, reqEditors...) + if err != nil { + return nil, err + } + return ParseAuthenticateConnectorFinishGCPResponse(rsp) +} + // AuthenticateConnectorFinishOAuthWithBodyWithResponse request with arbitrary body returning *AuthenticateConnectorFinishOAuthResponse func (c *ClientWithResponses) AuthenticateConnectorFinishOAuthWithBodyWithResponse(ctx context.Context, teamName TeamName, connectorID ConnectorID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AuthenticateConnectorFinishOAuthResponse, error) { rsp, err := c.AuthenticateConnectorFinishOAuthWithBody(ctx, teamName, connectorID, contentType, body, reqEditors...) @@ -19885,6 +20207,189 @@ func ParseAuthenticateConnectorAWSResponse(rsp *http.Response) (*AuthenticateCon return response, nil } +// ParseGetConnectorAuthStatusGCPResponse parses an HTTP response from a GetConnectorAuthStatusGCPWithResponse call +func ParseGetConnectorAuthStatusGCPResponse(rsp *http.Response) (*GetConnectorAuthStatusGCPResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetConnectorAuthStatusGCPResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest GetConnectorAuthStatusGCP200Response + 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 == 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 == 422: + var dest UnprocessableEntity + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &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 +} + +// ParseAuthenticateConnectorGCPResponse parses an HTTP response from a AuthenticateConnectorGCPWithResponse call +func ParseAuthenticateConnectorGCPResponse(rsp *http.Response) (*AuthenticateConnectorGCPResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &AuthenticateConnectorGCPResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ConnectorAuthResponseGCP + 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 == 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 == 422: + var dest UnprocessableEntity + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &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 +} + +// ParseAuthenticateConnectorFinishGCPResponse parses an HTTP response from a AuthenticateConnectorFinishGCPWithResponse call +func ParseAuthenticateConnectorFinishGCPResponse(rsp *http.Response) (*AuthenticateConnectorFinishGCPResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &AuthenticateConnectorFinishGCPResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + 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 == 422: + var dest UnprocessableEntity + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &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 +} + // ParseAuthenticateConnectorFinishOAuthResponse parses an HTTP response from a AuthenticateConnectorFinishOAuthWithResponse call func ParseAuthenticateConnectorFinishOAuthResponse(rsp *http.Response) (*AuthenticateConnectorFinishOAuthResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) diff --git a/models.gen.go b/models.gen.go index 96fdcc9..3eec8ab 100644 --- a/models.gen.go +++ b/models.gen.go @@ -635,6 +635,18 @@ type ConnectorAuthRequestAWS struct { AdditionalProperties map[string]interface{} `json:"-"` } +// ConnectorAuthRequestGCP GCP connector authentication request to start the authentication process +type ConnectorAuthRequestGCP struct { + // PluginKind Kind of the plugin + PluginKind string `json:"plugin_kind"` + + // PluginName Name of the plugin + PluginName string `json:"plugin_name"` + + // PluginTeam Team that owns the plugin we are authenticating the connector for + PluginTeam string `json:"plugin_team"` +} + // ConnectorAuthRequestOAuth OAuth connector authentication request to start the authentication process type ConnectorAuthRequestOAuth struct { // BaseURL Base of the URL the callback url will be constructed from @@ -682,6 +694,12 @@ type ConnectorAuthResponseAWS struct { SuggestedPolicyARNs []string `json:"suggested_policy_arns"` } +// ConnectorAuthResponseGCP GCP connector authentication response to start the authentication process +type ConnectorAuthResponseGCP struct { + // ServiceAccount CloudQuery GCP Service Account to grant access to + ServiceAccount string `json:"service_account"` +} + // ConnectorAuthResponseOAuth OAuth connector authentication response to start the authentication process type ConnectorAuthResponseOAuth struct { // RedirectURL URL to redirect the user to, to authenticate @@ -896,6 +914,12 @@ type GetConnectorAuthStatusAWS200Response struct { RoleARN *string `json:"role_arn,omitempty"` } +// GetConnectorAuthStatusGCP200Response defines model for GetConnectorAuthStatusGCP_200_response. +type GetConnectorAuthStatusGCP200Response struct { + // ServiceAccount CloudQuery GCP Service Account to grant access to + ServiceAccount *string `json:"service_account,omitempty"` +} + // GetCurrentUserMemberships200Response defines model for GetCurrentUserMemberships_200_response. type GetCurrentUserMemberships200Response struct { Items []MembershipWithTeam `json:"items"` @@ -3275,6 +3299,9 @@ type AuthenticateConnectorFinishAWSJSONRequestBody = ConnectorAuthFinishRequestA // AuthenticateConnectorAWSJSONRequestBody defines body for AuthenticateConnectorAWS for application/json ContentType. type AuthenticateConnectorAWSJSONRequestBody = ConnectorAuthRequestAWS +// AuthenticateConnectorGCPJSONRequestBody defines body for AuthenticateConnectorGCP for application/json ContentType. +type AuthenticateConnectorGCPJSONRequestBody = ConnectorAuthRequestGCP + // AuthenticateConnectorFinishOAuthJSONRequestBody defines body for AuthenticateConnectorFinishOAuth for application/json ContentType. type AuthenticateConnectorFinishOAuthJSONRequestBody = ConnectorAuthFinishRequestOAuth diff --git a/spec.json b/spec.json index dced90c..e221819 100644 --- a/spec.json +++ b/spec.json @@ -5719,6 +5719,127 @@ "tags" : [ "syncs" ] } }, + "/teams/{team_name}/connectors/{connector_id}/authenticate/gcp" : { + "get" : { + "description" : "Get authentication status for the given GCP connector", + "operationId" : "GetConnectorAuthStatusGCP", + "parameters" : [ { + "$ref" : "#/components/parameters/team_name" + }, { + "$ref" : "#/components/parameters/connector_id" + } ], + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/GetConnectorAuthStatusGCP_200_response" + } + } + }, + "description" : "Response" + }, + "400" : { + "$ref" : "#/components/responses/BadRequest" + }, + "401" : { + "$ref" : "#/components/responses/RequiresAuthentication" + }, + "404" : { + "$ref" : "#/components/responses/NotFound" + }, + "422" : { + "$ref" : "#/components/responses/UnprocessableEntity" + }, + "500" : { + "$ref" : "#/components/responses/InternalError" + } + }, + "tags" : [ "syncs" ] + }, + "post" : { + "description" : "Authenticate or reauthenticate the given GCP connector", + "operationId" : "AuthenticateConnectorGCP", + "parameters" : [ { + "$ref" : "#/components/parameters/team_name" + }, { + "$ref" : "#/components/parameters/connector_id" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ConnectorAuthRequestGCP" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ConnectorAuthResponseGCP" + } + } + }, + "description" : "Response" + }, + "400" : { + "$ref" : "#/components/responses/BadRequest" + }, + "401" : { + "$ref" : "#/components/responses/RequiresAuthentication" + }, + "404" : { + "$ref" : "#/components/responses/NotFound" + }, + "422" : { + "$ref" : "#/components/responses/UnprocessableEntity" + }, + "500" : { + "$ref" : "#/components/responses/InternalError" + } + }, + "tags" : [ "syncs" ] + } + }, + "/teams/{team_name}/connectors/{connector_id}/authenticate/gcp/finish" : { + "post" : { + "description" : "Complete authentication for the given GCP connector", + "operationId" : "AuthenticateConnectorFinishGCP", + "parameters" : [ { + "$ref" : "#/components/parameters/team_name" + }, { + "$ref" : "#/components/parameters/connector_id" + } ], + "responses" : { + "204" : { + "description" : "Authentication is complete." + }, + "400" : { + "$ref" : "#/components/responses/BadRequest" + }, + "401" : { + "$ref" : "#/components/responses/RequiresAuthentication" + }, + "403" : { + "$ref" : "#/components/responses/Forbidden" + }, + "404" : { + "$ref" : "#/components/responses/NotFound" + }, + "422" : { + "$ref" : "#/components/responses/UnprocessableEntity" + }, + "500" : { + "$ref" : "#/components/responses/InternalError" + } + }, + "tags" : [ "syncs" ] + } + }, "/teams/{team_name}/connectors/{connector_id}/authenticate/oauth" : { "patch" : { "description" : "Complete authentication for the given OAuth connector", @@ -9400,6 +9521,39 @@ }, "required" : [ "role_arn" ] }, + "ConnectorAuthRequestGCP" : { + "additionalProperties" : false, + "description" : "GCP connector authentication request to start the authentication process", + "properties" : { + "plugin_team" : { + "description" : "Team that owns the plugin we are authenticating the connector for", + "example" : "cloudquery", + "type" : "string" + }, + "plugin_kind" : { + "description" : "Kind of the plugin", + "example" : "source", + "type" : "string" + }, + "plugin_name" : { + "description" : "Name of the plugin", + "example" : "aws", + "type" : "string" + } + }, + "required" : [ "plugin_kind", "plugin_name", "plugin_team" ] + }, + "ConnectorAuthResponseGCP" : { + "additionalProperties" : false, + "description" : "GCP connector authentication response to start the authentication process", + "properties" : { + "service_account" : { + "description" : "CloudQuery GCP Service Account to grant access to", + "type" : "string" + } + }, + "required" : [ "service_account" ] + }, "ConnectorAuthRequestOAuth" : { "additionalProperties" : { }, "description" : "OAuth connector authentication request to start the authentication process", @@ -10330,6 +10484,14 @@ } } }, + "GetConnectorAuthStatusGCP_200_response" : { + "properties" : { + "service_account" : { + "description" : "CloudQuery GCP Service Account to grant access to", + "type" : "string" + } + } + }, "UsageIncrease_tables_inner" : { "properties" : { "name" : {