From 7045185d92d7590880a563cf6c61112216cdbfaf Mon Sep 17 00:00:00 2001 From: CloudQuery Bot <102256036+cq-bot@users.noreply.github.com> Date: Thu, 18 Jul 2024 04:32:05 -0400 Subject: [PATCH 1/4] fix: Generate CloudQuery Go API Client from `spec.json` (#198) This PR was created by a scheduled workflow to generate the CloudQuery Go API Client from `spec.json` --- client.gen.go | 1166 ++++++++++++++++++++++- models.gen.go | 140 +++ spec.json | 2484 ++++++++++++++++++++++++++++++------------------- 3 files changed, 2769 insertions(+), 1021 deletions(-) diff --git a/client.gen.go b/client.gen.go index cc1e5bd..bc2d02b 100644 --- a/client.gen.go +++ b/client.gen.go @@ -438,6 +438,19 @@ type ClientInterface interface { // GetSubscriptionOrderByTeam request GetSubscriptionOrderByTeam(ctx context.Context, teamName TeamName, teamSubscriptionOrderID TeamSubscriptionOrderID, reqEditors ...RequestEditorFn) (*http.Response, error) + // CreateSyncDestinationTestConnectionWithBody request with any body + CreateSyncDestinationTestConnectionWithBody(ctx context.Context, teamName TeamName, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateSyncDestinationTestConnection(ctx context.Context, teamName TeamName, body CreateSyncDestinationTestConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetSyncDestinationTestConnection request + GetSyncDestinationTestConnection(ctx context.Context, teamName TeamName, syncDestinationTestConnectionID SyncDestinationTestConnectionID, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PromoteSyncDestinationTestConnectionWithBody request with any body + PromoteSyncDestinationTestConnectionWithBody(ctx context.Context, teamName TeamName, syncDestinationTestConnectionID SyncDestinationTestConnectionID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PromoteSyncDestinationTestConnection(ctx context.Context, teamName TeamName, syncDestinationTestConnectionID SyncDestinationTestConnectionID, body PromoteSyncDestinationTestConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListSyncDestinations request ListSyncDestinations(ctx context.Context, teamName TeamName, params *ListSyncDestinationsParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -473,6 +486,19 @@ type ClientInterface interface { // PromoteTestConnectionForSyncDestination request PromoteTestConnectionForSyncDestination(ctx context.Context, teamName TeamName, syncDestinationName SyncDestinationName, syncTestConnectionId SyncTestConnectionId, reqEditors ...RequestEditorFn) (*http.Response, error) + // CreateSyncSourceTestConnectionWithBody request with any body + CreateSyncSourceTestConnectionWithBody(ctx context.Context, teamName TeamName, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateSyncSourceTestConnection(ctx context.Context, teamName TeamName, body CreateSyncSourceTestConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetSyncSourceTestConnection request + GetSyncSourceTestConnection(ctx context.Context, teamName TeamName, syncSourceTestConnectionID SyncSourceTestConnectionID, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PromoteSyncSourceTestConnectionWithBody request with any body + PromoteSyncSourceTestConnectionWithBody(ctx context.Context, teamName TeamName, syncSourceTestConnectionID SyncSourceTestConnectionID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PromoteSyncSourceTestConnection(ctx context.Context, teamName TeamName, syncSourceTestConnectionID SyncSourceTestConnectionID, body PromoteSyncSourceTestConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListSyncSources request ListSyncSources(ctx context.Context, teamName TeamName, params *ListSyncSourcesParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -2154,6 +2180,66 @@ func (c *Client) GetSubscriptionOrderByTeam(ctx context.Context, teamName TeamNa return c.Client.Do(req) } +func (c *Client) CreateSyncDestinationTestConnectionWithBody(ctx context.Context, teamName TeamName, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateSyncDestinationTestConnectionRequestWithBody(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) CreateSyncDestinationTestConnection(ctx context.Context, teamName TeamName, body CreateSyncDestinationTestConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateSyncDestinationTestConnectionRequest(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) GetSyncDestinationTestConnection(ctx context.Context, teamName TeamName, syncDestinationTestConnectionID SyncDestinationTestConnectionID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSyncDestinationTestConnectionRequest(c.Server, teamName, syncDestinationTestConnectionID) + 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) PromoteSyncDestinationTestConnectionWithBody(ctx context.Context, teamName TeamName, syncDestinationTestConnectionID SyncDestinationTestConnectionID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPromoteSyncDestinationTestConnectionRequestWithBody(c.Server, teamName, syncDestinationTestConnectionID, 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) PromoteSyncDestinationTestConnection(ctx context.Context, teamName TeamName, syncDestinationTestConnectionID SyncDestinationTestConnectionID, body PromoteSyncDestinationTestConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPromoteSyncDestinationTestConnectionRequest(c.Server, teamName, syncDestinationTestConnectionID, 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) ListSyncDestinations(ctx context.Context, teamName TeamName, params *ListSyncDestinationsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListSyncDestinationsRequest(c.Server, teamName, params) if err != nil { @@ -2310,6 +2396,66 @@ func (c *Client) PromoteTestConnectionForSyncDestination(ctx context.Context, te return c.Client.Do(req) } +func (c *Client) CreateSyncSourceTestConnectionWithBody(ctx context.Context, teamName TeamName, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateSyncSourceTestConnectionRequestWithBody(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) CreateSyncSourceTestConnection(ctx context.Context, teamName TeamName, body CreateSyncSourceTestConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateSyncSourceTestConnectionRequest(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) GetSyncSourceTestConnection(ctx context.Context, teamName TeamName, syncSourceTestConnectionID SyncSourceTestConnectionID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSyncSourceTestConnectionRequest(c.Server, teamName, syncSourceTestConnectionID) + 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) PromoteSyncSourceTestConnectionWithBody(ctx context.Context, teamName TeamName, syncSourceTestConnectionID SyncSourceTestConnectionID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPromoteSyncSourceTestConnectionRequestWithBody(c.Server, teamName, syncSourceTestConnectionID, 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) PromoteSyncSourceTestConnection(ctx context.Context, teamName TeamName, syncSourceTestConnectionID SyncSourceTestConnectionID, body PromoteSyncSourceTestConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPromoteSyncSourceTestConnectionRequest(c.Server, teamName, syncSourceTestConnectionID, 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) ListSyncSources(ctx context.Context, teamName TeamName, params *ListSyncSourcesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListSyncSourcesRequest(c.Server, teamName, params) if err != nil { @@ -8322,6 +8468,148 @@ func NewGetSubscriptionOrderByTeamRequest(server string, teamName TeamName, team return req, nil } +// NewCreateSyncDestinationTestConnectionRequest calls the generic CreateSyncDestinationTestConnection builder with application/json body +func NewCreateSyncDestinationTestConnectionRequest(server string, teamName TeamName, body CreateSyncDestinationTestConnectionJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateSyncDestinationTestConnectionRequestWithBody(server, teamName, "application/json", bodyReader) +} + +// NewCreateSyncDestinationTestConnectionRequestWithBody generates requests for CreateSyncDestinationTestConnection with any type of body +func NewCreateSyncDestinationTestConnectionRequestWithBody(server string, teamName TeamName, 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/sync-destination-test-connections", 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 +} + +// NewGetSyncDestinationTestConnectionRequest generates requests for GetSyncDestinationTestConnection +func NewGetSyncDestinationTestConnectionRequest(server string, teamName TeamName, syncDestinationTestConnectionID SyncDestinationTestConnectionID) (*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, "sync_destination_test_connection_id", runtime.ParamLocationPath, syncDestinationTestConnectionID) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/teams/%s/sync-destination-test-connections/%s", 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 +} + +// NewPromoteSyncDestinationTestConnectionRequest calls the generic PromoteSyncDestinationTestConnection builder with application/json body +func NewPromoteSyncDestinationTestConnectionRequest(server string, teamName TeamName, syncDestinationTestConnectionID SyncDestinationTestConnectionID, body PromoteSyncDestinationTestConnectionJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPromoteSyncDestinationTestConnectionRequestWithBody(server, teamName, syncDestinationTestConnectionID, "application/json", bodyReader) +} + +// NewPromoteSyncDestinationTestConnectionRequestWithBody generates requests for PromoteSyncDestinationTestConnection with any type of body +func NewPromoteSyncDestinationTestConnectionRequestWithBody(server string, teamName TeamName, syncDestinationTestConnectionID SyncDestinationTestConnectionID, 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, "sync_destination_test_connection_id", runtime.ParamLocationPath, syncDestinationTestConnectionID) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/teams/%s/sync-destination-test-connections/%s/promote", 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 +} + // NewListSyncDestinationsRequest generates requests for ListSyncDestinations func NewListSyncDestinationsRequest(server string, teamName TeamName, params *ListSyncDestinationsParams) (*http.Request, error) { var err error @@ -8774,8 +9062,19 @@ func NewPromoteTestConnectionForSyncDestinationRequest(server string, teamName T return req, nil } -// NewListSyncSourcesRequest generates requests for ListSyncSources -func NewListSyncSourcesRequest(server string, teamName TeamName, params *ListSyncSourcesParams) (*http.Request, error) { +// NewCreateSyncSourceTestConnectionRequest calls the generic CreateSyncSourceTestConnection builder with application/json body +func NewCreateSyncSourceTestConnectionRequest(server string, teamName TeamName, body CreateSyncSourceTestConnectionJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateSyncSourceTestConnectionRequestWithBody(server, teamName, "application/json", bodyReader) +} + +// NewCreateSyncSourceTestConnectionRequestWithBody generates requests for CreateSyncSourceTestConnection with any type of body +func NewCreateSyncSourceTestConnectionRequestWithBody(server string, teamName TeamName, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -8790,7 +9089,7 @@ func NewListSyncSourcesRequest(server string, teamName TeamName, params *ListSyn return nil, err } - operationPath := fmt.Sprintf("/teams/%s/sync-sources", pathParam0) + operationPath := fmt.Sprintf("/teams/%s/sync-source-test-connections", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -8800,13 +9099,144 @@ func NewListSyncSourcesRequest(server string, teamName TeamName, params *ListSyn return nil, err } - if params != nil { - queryValues := queryURL.Query() + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } - if params.PerPage != nil { + req.Header.Add("Content-Type", contentType) - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "per_page", runtime.ParamLocationQuery, *params.PerPage); err != nil { - return nil, err + return req, nil +} + +// NewGetSyncSourceTestConnectionRequest generates requests for GetSyncSourceTestConnection +func NewGetSyncSourceTestConnectionRequest(server string, teamName TeamName, syncSourceTestConnectionID SyncSourceTestConnectionID) (*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, "sync_source_test_connection_id", runtime.ParamLocationPath, syncSourceTestConnectionID) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/teams/%s/sync-source-test-connections/%s", 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 +} + +// NewPromoteSyncSourceTestConnectionRequest calls the generic PromoteSyncSourceTestConnection builder with application/json body +func NewPromoteSyncSourceTestConnectionRequest(server string, teamName TeamName, syncSourceTestConnectionID SyncSourceTestConnectionID, body PromoteSyncSourceTestConnectionJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPromoteSyncSourceTestConnectionRequestWithBody(server, teamName, syncSourceTestConnectionID, "application/json", bodyReader) +} + +// NewPromoteSyncSourceTestConnectionRequestWithBody generates requests for PromoteSyncSourceTestConnection with any type of body +func NewPromoteSyncSourceTestConnectionRequestWithBody(server string, teamName TeamName, syncSourceTestConnectionID SyncSourceTestConnectionID, 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, "sync_source_test_connection_id", runtime.ParamLocationPath, syncSourceTestConnectionID) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/teams/%s/sync-source-test-connections/%s/promote", 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 +} + +// NewListSyncSourcesRequest generates requests for ListSyncSources +func NewListSyncSourcesRequest(server string, teamName TeamName, params *ListSyncSourcesParams) (*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/sync-sources", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.PerPage != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "per_page", runtime.ParamLocationQuery, *params.PerPage); err != nil { + return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err } else { @@ -11472,6 +11902,19 @@ type ClientWithResponsesInterface interface { // GetSubscriptionOrderByTeamWithResponse request GetSubscriptionOrderByTeamWithResponse(ctx context.Context, teamName TeamName, teamSubscriptionOrderID TeamSubscriptionOrderID, reqEditors ...RequestEditorFn) (*GetSubscriptionOrderByTeamResponse, error) + // CreateSyncDestinationTestConnectionWithBodyWithResponse request with any body + CreateSyncDestinationTestConnectionWithBodyWithResponse(ctx context.Context, teamName TeamName, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSyncDestinationTestConnectionResponse, error) + + CreateSyncDestinationTestConnectionWithResponse(ctx context.Context, teamName TeamName, body CreateSyncDestinationTestConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSyncDestinationTestConnectionResponse, error) + + // GetSyncDestinationTestConnectionWithResponse request + GetSyncDestinationTestConnectionWithResponse(ctx context.Context, teamName TeamName, syncDestinationTestConnectionID SyncDestinationTestConnectionID, reqEditors ...RequestEditorFn) (*GetSyncDestinationTestConnectionResponse, error) + + // PromoteSyncDestinationTestConnectionWithBodyWithResponse request with any body + PromoteSyncDestinationTestConnectionWithBodyWithResponse(ctx context.Context, teamName TeamName, syncDestinationTestConnectionID SyncDestinationTestConnectionID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PromoteSyncDestinationTestConnectionResponse, error) + + PromoteSyncDestinationTestConnectionWithResponse(ctx context.Context, teamName TeamName, syncDestinationTestConnectionID SyncDestinationTestConnectionID, body PromoteSyncDestinationTestConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*PromoteSyncDestinationTestConnectionResponse, error) + // ListSyncDestinationsWithResponse request ListSyncDestinationsWithResponse(ctx context.Context, teamName TeamName, params *ListSyncDestinationsParams, reqEditors ...RequestEditorFn) (*ListSyncDestinationsResponse, error) @@ -11507,6 +11950,19 @@ type ClientWithResponsesInterface interface { // PromoteTestConnectionForSyncDestinationWithResponse request PromoteTestConnectionForSyncDestinationWithResponse(ctx context.Context, teamName TeamName, syncDestinationName SyncDestinationName, syncTestConnectionId SyncTestConnectionId, reqEditors ...RequestEditorFn) (*PromoteTestConnectionForSyncDestinationResponse, error) + // CreateSyncSourceTestConnectionWithBodyWithResponse request with any body + CreateSyncSourceTestConnectionWithBodyWithResponse(ctx context.Context, teamName TeamName, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSyncSourceTestConnectionResponse, error) + + CreateSyncSourceTestConnectionWithResponse(ctx context.Context, teamName TeamName, body CreateSyncSourceTestConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSyncSourceTestConnectionResponse, error) + + // GetSyncSourceTestConnectionWithResponse request + GetSyncSourceTestConnectionWithResponse(ctx context.Context, teamName TeamName, syncSourceTestConnectionID SyncSourceTestConnectionID, reqEditors ...RequestEditorFn) (*GetSyncSourceTestConnectionResponse, error) + + // PromoteSyncSourceTestConnectionWithBodyWithResponse request with any body + PromoteSyncSourceTestConnectionWithBodyWithResponse(ctx context.Context, teamName TeamName, syncSourceTestConnectionID SyncSourceTestConnectionID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PromoteSyncSourceTestConnectionResponse, error) + + PromoteSyncSourceTestConnectionWithResponse(ctx context.Context, teamName TeamName, syncSourceTestConnectionID SyncSourceTestConnectionID, body PromoteSyncSourceTestConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*PromoteSyncSourceTestConnectionResponse, error) + // ListSyncSourcesWithResponse request ListSyncSourcesWithResponse(ctx context.Context, teamName TeamName, params *ListSyncSourcesParams, reqEditors ...RequestEditorFn) (*ListSyncSourcesResponse, error) @@ -14031,6 +14487,88 @@ func (r GetSubscriptionOrderByTeamResponse) StatusCode() int { return 0 } +type CreateSyncDestinationTestConnectionResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *SyncDestinationTestConnection + JSON400 *BadRequest + JSON401 *RequiresAuthentication + JSON404 *NotFound + JSON422 *UnprocessableEntity + JSON429 *TooManyRequests + JSON500 *InternalError +} + +// Status returns HTTPResponse.Status +func (r CreateSyncDestinationTestConnectionResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateSyncDestinationTestConnectionResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetSyncDestinationTestConnectionResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *SyncDestinationTestConnection + JSON401 *RequiresAuthentication + JSON403 *Forbidden + JSON404 *NotFound + JSON500 *InternalError +} + +// Status returns HTTPResponse.Status +func (r GetSyncDestinationTestConnectionResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetSyncDestinationTestConnectionResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PromoteSyncDestinationTestConnectionResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *SyncDestination + JSON201 *SyncDestination + JSON400 *BadRequest + JSON401 *RequiresAuthentication + JSON404 *NotFound + JSON422 *UnprocessableEntity + JSON500 *InternalError +} + +// Status returns HTTPResponse.Status +func (r PromoteSyncDestinationTestConnectionResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PromoteSyncDestinationTestConnectionResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type ListSyncDestinationsResponse struct { Body []byte HTTPResponse *http.Response @@ -14270,17 +14808,20 @@ func (r PromoteTestConnectionForSyncDestinationResponse) StatusCode() int { return 0 } -type ListSyncSourcesResponse struct { +type CreateSyncSourceTestConnectionResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ListSyncSources200Response + JSON201 *SyncSourceTestConnection + JSON400 *BadRequest JSON401 *RequiresAuthentication JSON404 *NotFound + JSON422 *UnprocessableEntity + JSON429 *TooManyRequests JSON500 *InternalError } // Status returns HTTPResponse.Status -func (r ListSyncSourcesResponse) Status() string { +func (r CreateSyncSourceTestConnectionResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -14288,26 +14829,25 @@ func (r ListSyncSourcesResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListSyncSourcesResponse) StatusCode() int { +func (r CreateSyncSourceTestConnectionResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreateSyncSourceResponse struct { +type GetSyncSourceTestConnectionResponse struct { Body []byte HTTPResponse *http.Response - JSON201 *SyncSource - JSON400 *BadRequest + JSON200 *SyncSourceTestConnection JSON401 *RequiresAuthentication + JSON403 *Forbidden JSON404 *NotFound - JSON422 *UnprocessableEntity JSON500 *InternalError } // Status returns HTTPResponse.Status -func (r CreateSyncSourceResponse) Status() string { +func (r GetSyncSourceTestConnectionResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -14315,27 +14855,27 @@ func (r CreateSyncSourceResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateSyncSourceResponse) StatusCode() int { +func (r GetSyncSourceTestConnectionResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type TestSyncSourceResponse struct { +type PromoteSyncSourceTestConnectionResponse struct { Body []byte HTTPResponse *http.Response - JSON201 *SyncTestConnection + JSON200 *SyncSource + JSON201 *SyncSource JSON400 *BadRequest JSON401 *RequiresAuthentication JSON404 *NotFound JSON422 *UnprocessableEntity - JSON429 *TooManyRequests JSON500 *InternalError } // Status returns HTTPResponse.Status -func (r TestSyncSourceResponse) Status() string { +func (r PromoteSyncSourceTestConnectionResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -14343,24 +14883,24 @@ func (r TestSyncSourceResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r TestSyncSourceResponse) StatusCode() int { +func (r PromoteSyncSourceTestConnectionResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeleteSyncSourceResponse struct { +type ListSyncSourcesResponse struct { Body []byte HTTPResponse *http.Response + JSON200 *ListSyncSources200Response JSON401 *RequiresAuthentication JSON404 *NotFound - JSON422 *UnprocessableEntity JSON500 *InternalError } // Status returns HTTPResponse.Status -func (r DeleteSyncSourceResponse) Status() string { +func (r ListSyncSourcesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -14368,24 +14908,26 @@ func (r DeleteSyncSourceResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteSyncSourceResponse) StatusCode() int { +func (r ListSyncSourcesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetSyncSourceResponse struct { +type CreateSyncSourceResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *SyncSource + JSON201 *SyncSource + JSON400 *BadRequest JSON401 *RequiresAuthentication JSON404 *NotFound + JSON422 *UnprocessableEntity JSON500 *InternalError } // Status returns HTTPResponse.Status -func (r GetSyncSourceResponse) Status() string { +func (r CreateSyncSourceResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -14393,26 +14935,27 @@ func (r GetSyncSourceResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetSyncSourceResponse) StatusCode() int { +func (r CreateSyncSourceResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpdateSyncSourceResponse struct { +type TestSyncSourceResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *SyncSource + JSON201 *SyncTestConnection JSON400 *BadRequest JSON401 *RequiresAuthentication JSON404 *NotFound JSON422 *UnprocessableEntity + JSON429 *TooManyRequests JSON500 *InternalError } // Status returns HTTPResponse.Status -func (r UpdateSyncSourceResponse) Status() string { +func (r TestSyncSourceResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -14420,27 +14963,104 @@ func (r UpdateSyncSourceResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateSyncSourceResponse) StatusCode() int { +func (r TestSyncSourceResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreateTestConnectionForSyncSourceResponse struct { +type DeleteSyncSourceResponse struct { Body []byte HTTPResponse *http.Response - JSON201 *SyncTestConnection - JSON400 *BadRequest JSON401 *RequiresAuthentication JSON404 *NotFound JSON422 *UnprocessableEntity - JSON429 *TooManyRequests JSON500 *InternalError } // Status returns HTTPResponse.Status -func (r CreateTestConnectionForSyncSourceResponse) Status() string { +func (r DeleteSyncSourceResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteSyncSourceResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetSyncSourceResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *SyncSource + JSON401 *RequiresAuthentication + JSON404 *NotFound + JSON500 *InternalError +} + +// Status returns HTTPResponse.Status +func (r GetSyncSourceResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetSyncSourceResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateSyncSourceResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *SyncSource + JSON400 *BadRequest + JSON401 *RequiresAuthentication + JSON404 *NotFound + JSON422 *UnprocessableEntity + JSON500 *InternalError +} + +// Status returns HTTPResponse.Status +func (r UpdateSyncSourceResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateSyncSourceResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateTestConnectionForSyncSourceResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *SyncTestConnection + JSON400 *BadRequest + JSON401 *RequiresAuthentication + JSON404 *NotFound + JSON422 *UnprocessableEntity + JSON429 *TooManyRequests + JSON500 *InternalError +} + +// Status returns HTTPResponse.Status +func (r CreateTestConnectionForSyncSourceResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -16481,6 +17101,49 @@ func (c *ClientWithResponses) GetSubscriptionOrderByTeamWithResponse(ctx context return ParseGetSubscriptionOrderByTeamResponse(rsp) } +// CreateSyncDestinationTestConnectionWithBodyWithResponse request with arbitrary body returning *CreateSyncDestinationTestConnectionResponse +func (c *ClientWithResponses) CreateSyncDestinationTestConnectionWithBodyWithResponse(ctx context.Context, teamName TeamName, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSyncDestinationTestConnectionResponse, error) { + rsp, err := c.CreateSyncDestinationTestConnectionWithBody(ctx, teamName, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateSyncDestinationTestConnectionResponse(rsp) +} + +func (c *ClientWithResponses) CreateSyncDestinationTestConnectionWithResponse(ctx context.Context, teamName TeamName, body CreateSyncDestinationTestConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSyncDestinationTestConnectionResponse, error) { + rsp, err := c.CreateSyncDestinationTestConnection(ctx, teamName, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateSyncDestinationTestConnectionResponse(rsp) +} + +// GetSyncDestinationTestConnectionWithResponse request returning *GetSyncDestinationTestConnectionResponse +func (c *ClientWithResponses) GetSyncDestinationTestConnectionWithResponse(ctx context.Context, teamName TeamName, syncDestinationTestConnectionID SyncDestinationTestConnectionID, reqEditors ...RequestEditorFn) (*GetSyncDestinationTestConnectionResponse, error) { + rsp, err := c.GetSyncDestinationTestConnection(ctx, teamName, syncDestinationTestConnectionID, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetSyncDestinationTestConnectionResponse(rsp) +} + +// PromoteSyncDestinationTestConnectionWithBodyWithResponse request with arbitrary body returning *PromoteSyncDestinationTestConnectionResponse +func (c *ClientWithResponses) PromoteSyncDestinationTestConnectionWithBodyWithResponse(ctx context.Context, teamName TeamName, syncDestinationTestConnectionID SyncDestinationTestConnectionID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PromoteSyncDestinationTestConnectionResponse, error) { + rsp, err := c.PromoteSyncDestinationTestConnectionWithBody(ctx, teamName, syncDestinationTestConnectionID, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePromoteSyncDestinationTestConnectionResponse(rsp) +} + +func (c *ClientWithResponses) PromoteSyncDestinationTestConnectionWithResponse(ctx context.Context, teamName TeamName, syncDestinationTestConnectionID SyncDestinationTestConnectionID, body PromoteSyncDestinationTestConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*PromoteSyncDestinationTestConnectionResponse, error) { + rsp, err := c.PromoteSyncDestinationTestConnection(ctx, teamName, syncDestinationTestConnectionID, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePromoteSyncDestinationTestConnectionResponse(rsp) +} + // ListSyncDestinationsWithResponse request returning *ListSyncDestinationsResponse func (c *ClientWithResponses) ListSyncDestinationsWithResponse(ctx context.Context, teamName TeamName, params *ListSyncDestinationsParams, reqEditors ...RequestEditorFn) (*ListSyncDestinationsResponse, error) { rsp, err := c.ListSyncDestinations(ctx, teamName, params, reqEditors...) @@ -16594,6 +17257,49 @@ func (c *ClientWithResponses) PromoteTestConnectionForSyncDestinationWithRespons return ParsePromoteTestConnectionForSyncDestinationResponse(rsp) } +// CreateSyncSourceTestConnectionWithBodyWithResponse request with arbitrary body returning *CreateSyncSourceTestConnectionResponse +func (c *ClientWithResponses) CreateSyncSourceTestConnectionWithBodyWithResponse(ctx context.Context, teamName TeamName, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSyncSourceTestConnectionResponse, error) { + rsp, err := c.CreateSyncSourceTestConnectionWithBody(ctx, teamName, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateSyncSourceTestConnectionResponse(rsp) +} + +func (c *ClientWithResponses) CreateSyncSourceTestConnectionWithResponse(ctx context.Context, teamName TeamName, body CreateSyncSourceTestConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSyncSourceTestConnectionResponse, error) { + rsp, err := c.CreateSyncSourceTestConnection(ctx, teamName, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateSyncSourceTestConnectionResponse(rsp) +} + +// GetSyncSourceTestConnectionWithResponse request returning *GetSyncSourceTestConnectionResponse +func (c *ClientWithResponses) GetSyncSourceTestConnectionWithResponse(ctx context.Context, teamName TeamName, syncSourceTestConnectionID SyncSourceTestConnectionID, reqEditors ...RequestEditorFn) (*GetSyncSourceTestConnectionResponse, error) { + rsp, err := c.GetSyncSourceTestConnection(ctx, teamName, syncSourceTestConnectionID, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetSyncSourceTestConnectionResponse(rsp) +} + +// PromoteSyncSourceTestConnectionWithBodyWithResponse request with arbitrary body returning *PromoteSyncSourceTestConnectionResponse +func (c *ClientWithResponses) PromoteSyncSourceTestConnectionWithBodyWithResponse(ctx context.Context, teamName TeamName, syncSourceTestConnectionID SyncSourceTestConnectionID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PromoteSyncSourceTestConnectionResponse, error) { + rsp, err := c.PromoteSyncSourceTestConnectionWithBody(ctx, teamName, syncSourceTestConnectionID, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePromoteSyncSourceTestConnectionResponse(rsp) +} + +func (c *ClientWithResponses) PromoteSyncSourceTestConnectionWithResponse(ctx context.Context, teamName TeamName, syncSourceTestConnectionID SyncSourceTestConnectionID, body PromoteSyncSourceTestConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*PromoteSyncSourceTestConnectionResponse, error) { + rsp, err := c.PromoteSyncSourceTestConnection(ctx, teamName, syncSourceTestConnectionID, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePromoteSyncSourceTestConnectionResponse(rsp) +} + // ListSyncSourcesWithResponse request returning *ListSyncSourcesResponse func (c *ClientWithResponses) ListSyncSourcesWithResponse(ctx context.Context, teamName TeamName, params *ListSyncSourcesParams, reqEditors ...RequestEditorFn) (*ListSyncSourcesResponse, error) { rsp, err := c.ListSyncSources(ctx, teamName, params, reqEditors...) @@ -22007,6 +22713,196 @@ func ParseGetSubscriptionOrderByTeamResponse(rsp *http.Response) (*GetSubscripti return response, nil } +// ParseCreateSyncDestinationTestConnectionResponse parses an HTTP response from a CreateSyncDestinationTestConnectionWithResponse call +func ParseCreateSyncDestinationTestConnectionResponse(rsp *http.Response) (*CreateSyncDestinationTestConnectionResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &CreateSyncDestinationTestConnectionResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest SyncDestinationTestConnection + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &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 == 429: + var dest TooManyRequests + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &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 +} + +// ParseGetSyncDestinationTestConnectionResponse parses an HTTP response from a GetSyncDestinationTestConnectionWithResponse call +func ParseGetSyncDestinationTestConnectionResponse(rsp *http.Response) (*GetSyncDestinationTestConnectionResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetSyncDestinationTestConnectionResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SyncDestinationTestConnection + 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 == 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 == 500: + var dest InternalError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParsePromoteSyncDestinationTestConnectionResponse parses an HTTP response from a PromoteSyncDestinationTestConnectionWithResponse call +func ParsePromoteSyncDestinationTestConnectionResponse(rsp *http.Response) (*PromoteSyncDestinationTestConnectionResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PromoteSyncDestinationTestConnectionResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SyncDestination + 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 == 201: + var dest SyncDestination + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &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 +} + // ParseListSyncDestinationsResponse parses an HTTP response from a ListSyncDestinationsWithResponse call func ParseListSyncDestinationsResponse(rsp *http.Response) (*ListSyncDestinationsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) @@ -22528,6 +23424,196 @@ func ParsePromoteTestConnectionForSyncDestinationResponse(rsp *http.Response) (* return response, nil } +// ParseCreateSyncSourceTestConnectionResponse parses an HTTP response from a CreateSyncSourceTestConnectionWithResponse call +func ParseCreateSyncSourceTestConnectionResponse(rsp *http.Response) (*CreateSyncSourceTestConnectionResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &CreateSyncSourceTestConnectionResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest SyncSourceTestConnection + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &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 == 429: + var dest TooManyRequests + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &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 +} + +// ParseGetSyncSourceTestConnectionResponse parses an HTTP response from a GetSyncSourceTestConnectionWithResponse call +func ParseGetSyncSourceTestConnectionResponse(rsp *http.Response) (*GetSyncSourceTestConnectionResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetSyncSourceTestConnectionResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SyncSourceTestConnection + 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 == 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 == 500: + var dest InternalError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParsePromoteSyncSourceTestConnectionResponse parses an HTTP response from a PromoteSyncSourceTestConnectionWithResponse call +func ParsePromoteSyncSourceTestConnectionResponse(rsp *http.Response) (*PromoteSyncSourceTestConnectionResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PromoteSyncSourceTestConnectionResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SyncSource + 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 == 201: + var dest SyncSource + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &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 +} + // ParseListSyncSourcesResponse parses an HTTP response from a ListSyncSourcesWithResponse call func ParseListSyncSourcesResponse(rsp *http.Response) (*ListSyncSourcesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) diff --git a/models.gen.go b/models.gen.go index 1b32db1..e14346a 100644 --- a/models.gen.go +++ b/models.gen.go @@ -1813,6 +1813,30 @@ type PriceCategorySpend struct { Total string `json:"total"` } +// PromoteSyncDestinationTestConnection Sync Destination Definition +type PromoteSyncDestinationTestConnection struct { + // MigrateMode Migrate mode for the destination + MigrateMode *SyncDestinationMigrateMode `json:"migrate_mode,omitempty"` + + // Name Descriptive, unique name for the destination. The name can only contain ASCII letters, digits, - and _. + Name string `json:"name"` + + // WriteMode Write mode for the destination + WriteMode *SyncDestinationWriteMode `json:"write_mode,omitempty"` +} + +// PromoteSyncSourceTestConnection Sync Source Definition +type PromoteSyncSourceTestConnection struct { + // Name Descriptive, unique name for the source. The name can only contain ASCII letters, digits, - and _. + Name string `json:"name"` + + // SkipTables Tables matched by `tables` that should be skipped. Wildcards are supported. + SkipTables *[]string `json:"skip_tables,omitempty"` + + // Tables Tables to sync. Wildcards are supported. Note that child tables are excluded by default, and need to be explicitly specified. + Tables []string `json:"tables"` +} + // RegistryAuthToken JWT token for the image registry type RegistryAuthToken struct { AccessToken string `json:"access_token"` @@ -2018,6 +2042,61 @@ type SyncDestinationCreateFromTestConnection struct { // SyncDestinationMigrateMode Migrate mode for the destination type SyncDestinationMigrateMode string +// SyncDestinationTestConnection defines model for SyncDestinationTestConnection. +type SyncDestinationTestConnection struct { + // CompletedAt Time the test connection was completed + CompletedAt *time.Time `json:"completed_at,omitempty"` + + // CreatedAt Time the test connection was created + CreatedAt time.Time `json:"created_at"` + + // FailureCode Code for failure + FailureCode *string `json:"failure_code,omitempty"` + + // FailureReason Reason for failure + FailureReason *string `json:"failure_reason,omitempty"` + + // ID unique ID of the test connection + ID ID `json:"id"` + + // PluginPath Plugin path in CloudQuery registry + PluginPath *SyncPluginPath `json:"plugin_path,omitempty"` + + // PluginVersion The version in semantic version format. + PluginVersion *VersionName `json:"plugin_version,omitempty"` + + // Status The status of the sync run + Status SyncTestConnectionStatus `json:"status"` +} + +// SyncDestinationTestConnectionCreate defines model for SyncDestinationTestConnectionCreate. +type SyncDestinationTestConnectionCreate struct { + // ConnectorID ID of the Connector + ConnectorID *ConnectorID `json:"connector_id,omitempty"` + + // DestinationName Name of an existing destination + DestinationName *string `json:"destination_name,omitempty"` + + // Env Environment variables for the plugin. All environment variables will be stored as secrets. + Env *[]SyncEnvCreate `json:"env,omitempty"` + + // MigrateMode Migrate mode for the destination + MigrateMode *SyncDestinationMigrateMode `json:"migrate_mode,omitempty"` + + // Path Plugin path in CloudQuery registry + Path SyncPluginPath `json:"path"` + Spec *map[string]interface{} `json:"spec,omitempty"` + + // Version Version of the plugin + Version string `json:"version"` + + // WriteMode Write mode for the destination + WriteMode *SyncDestinationWriteMode `json:"write_mode,omitempty"` +} + +// SyncDestinationTestConnectionID ID of the Sync Destination Test Connection +type SyncDestinationTestConnectionID = openapi_types.UUID + // SyncDestinationUpdate Sync Destination Update Definition type SyncDestinationUpdate struct { // ConnectorID ID of the Connector @@ -2237,6 +2316,55 @@ type SyncSourceCreateFromTestConnection struct { Tables []string `json:"tables"` } +// SyncSourceTestConnection defines model for SyncSourceTestConnection. +type SyncSourceTestConnection struct { + // CompletedAt Time the test connection was completed + CompletedAt *time.Time `json:"completed_at,omitempty"` + + // CreatedAt Time the test connection was created + CreatedAt time.Time `json:"created_at"` + + // FailureCode Code for failure + FailureCode *string `json:"failure_code,omitempty"` + + // FailureReason Reason for failure + FailureReason *string `json:"failure_reason,omitempty"` + + // ID unique ID of the test connection + ID ID `json:"id"` + + // PluginPath Plugin path in CloudQuery registry + PluginPath *SyncPluginPath `json:"plugin_path,omitempty"` + + // PluginVersion The version in semantic version format. + PluginVersion *VersionName `json:"plugin_version,omitempty"` + + // Status The status of the sync run + Status SyncTestConnectionStatus `json:"status"` +} + +// SyncSourceTestConnectionCreate defines model for SyncSourceTestConnectionCreate. +type SyncSourceTestConnectionCreate struct { + // ConnectorID ID of the Connector + ConnectorID *ConnectorID `json:"connector_id,omitempty"` + + // Env Environment variables for the plugin. All environment variables will be stored as secrets. + Env *[]SyncEnvCreate `json:"env,omitempty"` + + // Path Plugin path in CloudQuery registry + Path SyncPluginPath `json:"path"` + + // SourceName Name of an existing source + SourceName *string `json:"source_name,omitempty"` + Spec *map[string]interface{} `json:"spec,omitempty"` + + // Version Version of the plugin + Version string `json:"version"` +} + +// SyncSourceTestConnectionID ID of the Sync Source Test Connection +type SyncSourceTestConnectionID = openapi_types.UUID + // SyncSourceUpdate Sync Source Update Definition type SyncSourceUpdate struct { // ConnectorID ID of the Connector @@ -3174,6 +3302,12 @@ type UpdateSpendingLimitJSONRequestBody = SpendingLimitUpdate // CreateSubscriptionOrderForTeamJSONRequestBody defines body for CreateSubscriptionOrderForTeam for application/json ContentType. type CreateSubscriptionOrderForTeamJSONRequestBody = TeamSubscriptionOrderCreate +// CreateSyncDestinationTestConnectionJSONRequestBody defines body for CreateSyncDestinationTestConnection for application/json ContentType. +type CreateSyncDestinationTestConnectionJSONRequestBody = SyncDestinationTestConnectionCreate + +// PromoteSyncDestinationTestConnectionJSONRequestBody defines body for PromoteSyncDestinationTestConnection for application/json ContentType. +type PromoteSyncDestinationTestConnectionJSONRequestBody = PromoteSyncDestinationTestConnection + // CreateSyncDestinationJSONRequestBody defines body for CreateSyncDestination for application/json ContentType. type CreateSyncDestinationJSONRequestBody = SyncDestinationCreate @@ -3186,6 +3320,12 @@ type UpdateSyncDestinationJSONRequestBody = SyncDestinationUpdate // CreateTestConnectionForSyncDestinationJSONRequestBody defines body for CreateTestConnectionForSyncDestination for application/json ContentType. type CreateTestConnectionForSyncDestinationJSONRequestBody = SyncTestConnectionCreate +// CreateSyncSourceTestConnectionJSONRequestBody defines body for CreateSyncSourceTestConnection for application/json ContentType. +type CreateSyncSourceTestConnectionJSONRequestBody = SyncSourceTestConnectionCreate + +// PromoteSyncSourceTestConnectionJSONRequestBody defines body for PromoteSyncSourceTestConnection for application/json ContentType. +type PromoteSyncSourceTestConnectionJSONRequestBody = PromoteSyncSourceTestConnection + // CreateSyncSourceJSONRequestBody defines body for CreateSyncSource for application/json ContentType. type CreateSyncSourceJSONRequestBody = SyncSourceCreate diff --git a/spec.json b/spec.json index 1ef5d9c..2725fe4 100644 --- a/spec.json +++ b/spec.json @@ -3857,91 +3857,10 @@ "tags" : [ "registry" ] } }, - "/teams/{team_name}/sync-sources" : { - "get" : { - "description" : "List all sync source definitions.", - "operationId" : "ListSyncSources", - "parameters" : [ { - "$ref" : "#/components/parameters/team_name" - }, { - "$ref" : "#/components/parameters/per_page" - }, { - "$ref" : "#/components/parameters/page" - } ], - "responses" : { - "200" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ListSyncSources_200_response" - } - } - }, - "description" : "Response" - }, - "401" : { - "$ref" : "#/components/responses/RequiresAuthentication" - }, - "404" : { - "$ref" : "#/components/responses/NotFound" - }, - "500" : { - "$ref" : "#/components/responses/InternalError" - } - }, - "tags" : [ "syncs" ] - }, - "post" : { - "description" : "Create new draft Sync Source definition.", - "operationId" : "CreateSyncSource", - "parameters" : [ { - "$ref" : "#/components/parameters/team_name" - } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/SyncSourceCreate" - } - } - }, - "required" : true - }, - "responses" : { - "201" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/SyncSource" - } - } - }, - "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}/sync-sources/test" : { + "/teams/{team_name}/sync-source-test-connections" : { "post" : { - "deprecated" : true, - "description" : "DEPRECATED. Test a Sync Source definition. Use CreateTestConnectionForSyncSource instead.", - "operationId" : "TestSyncSource", + "description" : "Create a test source connection.", + "operationId" : "CreateSyncSourceTestConnection", "parameters" : [ { "$ref" : "#/components/parameters/team_name" } ], @@ -3949,7 +3868,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/SyncSourceCreate" + "$ref" : "#/components/schemas/SyncSourceTestConnectionCreate" } } }, @@ -3960,7 +3879,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/SyncTestConnection" + "$ref" : "#/components/schemas/SyncSourceTestConnection" } } }, @@ -3988,48 +3907,21 @@ "tags" : [ "syncs" ] } }, - "/teams/{team_name}/sync-sources/{sync_source_name}" : { - "delete" : { - "description" : "Delete a Sync Source definition. Any syncs relying on this source must be deleted first.", - "operationId" : "DeleteSyncSource", - "parameters" : [ { - "$ref" : "#/components/parameters/team_name" - }, { - "$ref" : "#/components/parameters/sync_source_name" - } ], - "responses" : { - "204" : { - "description" : "Deleted" - }, - "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}/sync-source-test-connections/{sync_source_test_connection_id}" : { "get" : { - "description" : "Get a single sync source definition.", - "operationId" : "GetSyncSource", + "description" : "Get a sync source test connection.", + "operationId" : "GetSyncSourceTestConnection", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/sync_source_name" + "$ref" : "#/components/parameters/sync_source_test_connection_id" } ], "responses" : { "200" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/SyncSource" + "$ref" : "#/components/schemas/SyncSourceTestConnection" } } }, @@ -4038,6 +3930,9 @@ "401" : { "$ref" : "#/components/responses/RequiresAuthentication" }, + "403" : { + "$ref" : "#/components/responses/Forbidden" + }, "404" : { "$ref" : "#/components/responses/NotFound" }, @@ -4046,20 +3941,22 @@ } }, "tags" : [ "syncs" ] - }, - "patch" : { - "description" : "Update a Sync Source definition.", - "operationId" : "UpdateSyncSource", + } + }, + "/teams/{team_name}/sync-source-test-connections/{sync_source_test_connection_id}/promote" : { + "post" : { + "description" : "Promote a sync source test connection to a sync source.", + "operationId" : "PromoteSyncSourceTestConnection", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/sync_source_name" + "$ref" : "#/components/parameters/sync_source_test_connection_id" } ], "requestBody" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/SyncSourceUpdate" + "$ref" : "#/components/schemas/PromoteSyncSourceTestConnection" } } }, @@ -4074,7 +3971,17 @@ } } }, - "description" : "Response" + "description" : "Successful response indicating that an existing sync source was replaced." + }, + "201" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SyncSource" + } + } + }, + "description" : "Successful response indicating that a new sync source was created." }, "400" : { "$ref" : "#/components/responses/BadRequest" @@ -4095,20 +4002,18 @@ "tags" : [ "syncs" ] } }, - "/teams/{team_name}/sync-sources/{sync_source_name}/test-connections" : { + "/teams/{team_name}/sync-destination-test-connections" : { "post" : { - "description" : "Create a test connection for sync source.", - "operationId" : "CreateTestConnectionForSyncSource", + "description" : "Create a test destination connection.", + "operationId" : "CreateSyncDestinationTestConnection", "parameters" : [ { "$ref" : "#/components/parameters/team_name" - }, { - "$ref" : "#/components/parameters/sync_source_name" } ], "requestBody" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/SyncTestConnectionCreate" + "$ref" : "#/components/schemas/SyncDestinationTestConnectionCreate" } } }, @@ -4119,7 +4024,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/SyncTestConnection" + "$ref" : "#/components/schemas/SyncDestinationTestConnection" } } }, @@ -4147,34 +4052,32 @@ "tags" : [ "syncs" ] } }, - "/teams/{team_name}/sync-sources/{sync_source_name}/test-connections/{sync_test_connection_id}" : { + "/teams/{team_name}/sync-destination-test-connections/{sync_destination_test_connection_id}" : { "get" : { - "description" : "Get test connection details for sync source.", - "operationId" : "GetTestConnectionForSyncSource", + "description" : "Get a sync destination test connection.", + "operationId" : "GetSyncDestinationTestConnection", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/sync_source_name" - }, { - "$ref" : "#/components/parameters/sync_test_connection_id" + "$ref" : "#/components/parameters/sync_destination_test_connection_id" } ], "responses" : { "200" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/SyncTestConnection" + "$ref" : "#/components/schemas/SyncDestinationTestConnection" } } }, "description" : "Response" }, - "400" : { - "$ref" : "#/components/responses/BadRequest" - }, "401" : { "$ref" : "#/components/responses/RequiresAuthentication" }, + "403" : { + "$ref" : "#/components/responses/Forbidden" + }, "404" : { "$ref" : "#/components/responses/NotFound" }, @@ -4185,23 +4088,41 @@ "tags" : [ "syncs" ] } }, - "/teams/{team_name}/sync-sources/{sync_source_name}/test-connections/{sync_test_connection_id}/promote" : { + "/teams/{team_name}/sync-destination-test-connections/{sync_destination_test_connection_id}/promote" : { "post" : { - "description" : "Promote a test connection for sync source.", - "operationId" : "PromoteTestConnectionForSyncSource", + "description" : "Promote a sync destination test connection to a sync destination.", + "operationId" : "PromoteSyncDestinationTestConnection", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/sync_source_name" - }, { - "$ref" : "#/components/parameters/sync_test_connection_id" + "$ref" : "#/components/parameters/sync_destination_test_connection_id" } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PromoteSyncDestinationTestConnection" + } + } + }, + "required" : true + }, "responses" : { "200" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/SyncSource" + "$ref" : "#/components/schemas/SyncDestination" + } + } + }, + "description" : "Successful response indicating that an existing sync destination was replaced." + }, + "201" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SyncDestination" } } }, @@ -4219,9 +4140,6 @@ "422" : { "$ref" : "#/components/responses/UnprocessableEntity" }, - "429" : { - "$ref" : "#/components/responses/TooManyRequests" - }, "500" : { "$ref" : "#/components/responses/InternalError" } @@ -4229,10 +4147,10 @@ "tags" : [ "syncs" ] } }, - "/teams/{team_name}/sync-destinations" : { + "/teams/{team_name}/sync-sources" : { "get" : { - "description" : "List all sync destination definitions.", - "operationId" : "ListSyncDestinations", + "description" : "List all sync source definitions.", + "operationId" : "ListSyncSources", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { @@ -4245,7 +4163,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ListSyncDestinations_200_response" + "$ref" : "#/components/schemas/ListSyncSources_200_response" } } }, @@ -4264,8 +4182,8 @@ "tags" : [ "syncs" ] }, "post" : { - "description" : "Create new draft Sync Destination definition.", - "operationId" : "CreateSyncDestination", + "description" : "Create new draft Sync Source definition.", + "operationId" : "CreateSyncSource", "parameters" : [ { "$ref" : "#/components/parameters/team_name" } ], @@ -4273,7 +4191,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/SyncDestinationCreate" + "$ref" : "#/components/schemas/SyncSourceCreate" } } }, @@ -4284,7 +4202,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/SyncDestination" + "$ref" : "#/components/schemas/SyncSource" } } }, @@ -4309,11 +4227,11 @@ "tags" : [ "syncs" ] } }, - "/teams/{team_name}/sync-destinations/test" : { + "/teams/{team_name}/sync-sources/test" : { "post" : { "deprecated" : true, - "description" : "DEPRECATED. Test a Sync Destination definition. Use CreateTestConnectionForSyncDestination instead.", - "operationId" : "TestSyncDestination", + "description" : "DEPRECATED. Test a Sync Source definition. Use CreateTestConnectionForSyncSource instead.", + "operationId" : "TestSyncSource", "parameters" : [ { "$ref" : "#/components/parameters/team_name" } ], @@ -4321,7 +4239,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/SyncDestinationCreate" + "$ref" : "#/components/schemas/SyncSourceCreate" } } }, @@ -4360,14 +4278,14 @@ "tags" : [ "syncs" ] } }, - "/teams/{team_name}/sync-destinations/{sync_destination_name}" : { + "/teams/{team_name}/sync-sources/{sync_source_name}" : { "delete" : { - "description" : "Delete a Sync Destination definition. Any syncs relying on this destination must be deleted first.", - "operationId" : "DeleteSyncDestination", + "description" : "Delete a Sync Source definition. Any syncs relying on this source must be deleted first.", + "operationId" : "DeleteSyncSource", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/sync_destination_name" + "$ref" : "#/components/parameters/sync_source_name" } ], "responses" : { "204" : { @@ -4389,19 +4307,19 @@ "tags" : [ "syncs" ] }, "get" : { - "description" : "Get a single sync destination definition.", - "operationId" : "GetSyncDestination", + "description" : "Get a single sync source definition.", + "operationId" : "GetSyncSource", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/sync_destination_name" + "$ref" : "#/components/parameters/sync_source_name" } ], "responses" : { "200" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/SyncDestination" + "$ref" : "#/components/schemas/SyncSource" } } }, @@ -4420,18 +4338,18 @@ "tags" : [ "syncs" ] }, "patch" : { - "description" : "Update a Sync Destination definition.", - "operationId" : "UpdateSyncDestination", + "description" : "Update a Sync Source definition.", + "operationId" : "UpdateSyncSource", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/sync_destination_name" + "$ref" : "#/components/parameters/sync_source_name" } ], "requestBody" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/SyncDestinationUpdate" + "$ref" : "#/components/schemas/SyncSourceUpdate" } } }, @@ -4442,7 +4360,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/SyncDestination" + "$ref" : "#/components/schemas/SyncSource" } } }, @@ -4467,14 +4385,14 @@ "tags" : [ "syncs" ] } }, - "/teams/{team_name}/sync-destinations/{sync_destination_name}/test-connections" : { + "/teams/{team_name}/sync-sources/{sync_source_name}/test-connections" : { "post" : { - "description" : "Create a test connection for sync destination.", - "operationId" : "CreateTestConnectionForSyncDestination", + "description" : "Create a test connection for sync source.", + "operationId" : "CreateTestConnectionForSyncSource", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/sync_destination_name" + "$ref" : "#/components/parameters/sync_source_name" } ], "requestBody" : { "content" : { @@ -4519,14 +4437,14 @@ "tags" : [ "syncs" ] } }, - "/teams/{team_name}/sync-destinations/{sync_destination_name}/test-connections/{sync_test_connection_id}" : { + "/teams/{team_name}/sync-sources/{sync_source_name}/test-connections/{sync_test_connection_id}" : { "get" : { - "description" : "Get test connection details for sync destination.", - "operationId" : "GetTestConnectionForSyncDestination", + "description" : "Get test connection details for sync source.", + "operationId" : "GetTestConnectionForSyncSource", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/sync_destination_name" + "$ref" : "#/components/parameters/sync_source_name" }, { "$ref" : "#/components/parameters/sync_test_connection_id" } ], @@ -4557,14 +4475,14 @@ "tags" : [ "syncs" ] } }, - "/teams/{team_name}/sync-destinations/{sync_destination_name}/test-connections/{sync_test_connection_id}/promote" : { + "/teams/{team_name}/sync-sources/{sync_source_name}/test-connections/{sync_test_connection_id}/promote" : { "post" : { - "description" : "Promote a test connection for sync destination.", - "operationId" : "PromoteTestConnectionForSyncDestination", + "description" : "Promote a test connection for sync source.", + "operationId" : "PromoteTestConnectionForSyncSource", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/sync_destination_name" + "$ref" : "#/components/parameters/sync_source_name" }, { "$ref" : "#/components/parameters/sync_test_connection_id" } ], @@ -4573,7 +4491,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/SyncDestination" + "$ref" : "#/components/schemas/SyncSource" } } }, @@ -4601,10 +4519,10 @@ "tags" : [ "syncs" ] } }, - "/teams/{team_name}/syncs" : { + "/teams/{team_name}/sync-destinations" : { "get" : { - "description" : "List all Syncs.", - "operationId" : "ListSyncs", + "description" : "List all sync destination definitions.", + "operationId" : "ListSyncDestinations", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { @@ -4617,7 +4535,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ListSyncs_200_response" + "$ref" : "#/components/schemas/ListSyncDestinations_200_response" } } }, @@ -4636,8 +4554,8 @@ "tags" : [ "syncs" ] }, "post" : { - "description" : "Create new Sync definition. Sync runs can be scheduled automatically, or triggered manually after sync is created.", - "operationId" : "CreateSync", + "description" : "Create new draft Sync Destination definition.", + "operationId" : "CreateSyncDestination", "parameters" : [ { "$ref" : "#/components/parameters/team_name" } ], @@ -4645,7 +4563,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/SyncCreate" + "$ref" : "#/components/schemas/SyncDestinationCreate" } } }, @@ -4656,7 +4574,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/Sync" + "$ref" : "#/components/schemas/SyncDestination" } } }, @@ -4668,6 +4586,9 @@ "401" : { "$ref" : "#/components/responses/RequiresAuthentication" }, + "404" : { + "$ref" : "#/components/responses/NotFound" + }, "422" : { "$ref" : "#/components/responses/UnprocessableEntity" }, @@ -4678,28 +4599,79 @@ "tags" : [ "syncs" ] } }, - "/teams/{team_name}/syncs/{sync_name}" : { + "/teams/{team_name}/sync-destinations/test" : { + "post" : { + "deprecated" : true, + "description" : "DEPRECATED. Test a Sync Destination definition. Use CreateTestConnectionForSyncDestination instead.", + "operationId" : "TestSyncDestination", + "parameters" : [ { + "$ref" : "#/components/parameters/team_name" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SyncDestinationCreate" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SyncTestConnection" + } + } + }, + "description" : "Response" + }, + "400" : { + "$ref" : "#/components/responses/BadRequest" + }, + "401" : { + "$ref" : "#/components/responses/RequiresAuthentication" + }, + "404" : { + "$ref" : "#/components/responses/NotFound" + }, + "422" : { + "$ref" : "#/components/responses/UnprocessableEntity" + }, + "429" : { + "$ref" : "#/components/responses/TooManyRequests" + }, + "500" : { + "$ref" : "#/components/responses/InternalError" + } + }, + "tags" : [ "syncs" ] + } + }, + "/teams/{team_name}/sync-destinations/{sync_destination_name}" : { "delete" : { - "description" : "Delete Sync. This will delete Sync configuration and all associated sync runs, but will not delete the associated source and destination(s). These will need to be deleted separately.", - "operationId" : "DeleteSync", + "description" : "Delete a Sync Destination definition. Any syncs relying on this destination must be deleted first.", + "operationId" : "DeleteSyncDestination", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/sync_name" + "$ref" : "#/components/parameters/sync_destination_name" } ], "responses" : { "204" : { "description" : "Deleted" }, - "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" } @@ -4707,27 +4679,24 @@ "tags" : [ "syncs" ] }, "get" : { - "description" : "Get a Sync", - "operationId" : "GetSync", + "description" : "Get a single sync destination definition.", + "operationId" : "GetSyncDestination", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/sync_name" + "$ref" : "#/components/parameters/sync_destination_name" } ], "responses" : { "200" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/Sync" + "$ref" : "#/components/schemas/SyncDestination" } } }, "description" : "Response" }, - "400" : { - "$ref" : "#/components/responses/BadRequest" - }, "401" : { "$ref" : "#/components/responses/RequiresAuthentication" }, @@ -4741,38 +4710,39 @@ "tags" : [ "syncs" ] }, "patch" : { - "description" : "Update a Sync", - "operationId" : "UpdateSync", + "description" : "Update a Sync Destination definition.", + "operationId" : "UpdateSyncDestination", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/sync_name" + "$ref" : "#/components/parameters/sync_destination_name" } ], "requestBody" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/SyncUpdate" + "$ref" : "#/components/schemas/SyncDestinationUpdate" } } - } + }, + "required" : true }, "responses" : { "200" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/Sync" + "$ref" : "#/components/schemas/SyncDestination" } } }, - "description" : "Updated" + "description" : "Response" }, "400" : { "$ref" : "#/components/responses/BadRequest" }, - "403" : { - "$ref" : "#/components/responses/Forbidden" + "401" : { + "$ref" : "#/components/responses/RequiresAuthentication" }, "404" : { "$ref" : "#/components/responses/NotFound" @@ -4787,30 +4757,83 @@ "tags" : [ "syncs" ] } }, - "/teams/{team_name}/syncs/{sync_name}/runs" : { - "get" : { - "description" : "List all Sync Runs.", - "operationId" : "ListSyncRuns", + "/teams/{team_name}/sync-destinations/{sync_destination_name}/test-connections" : { + "post" : { + "description" : "Create a test connection for sync destination.", + "operationId" : "CreateTestConnectionForSyncDestination", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/sync_name" + "$ref" : "#/components/parameters/sync_destination_name" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SyncTestConnectionCreate" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SyncTestConnection" + } + } + }, + "description" : "Response" + }, + "400" : { + "$ref" : "#/components/responses/BadRequest" + }, + "401" : { + "$ref" : "#/components/responses/RequiresAuthentication" + }, + "404" : { + "$ref" : "#/components/responses/NotFound" + }, + "422" : { + "$ref" : "#/components/responses/UnprocessableEntity" + }, + "429" : { + "$ref" : "#/components/responses/TooManyRequests" + }, + "500" : { + "$ref" : "#/components/responses/InternalError" + } + }, + "tags" : [ "syncs" ] + } + }, + "/teams/{team_name}/sync-destinations/{sync_destination_name}/test-connections/{sync_test_connection_id}" : { + "get" : { + "description" : "Get test connection details for sync destination.", + "operationId" : "GetTestConnectionForSyncDestination", + "parameters" : [ { + "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/per_page" + "$ref" : "#/components/parameters/sync_destination_name" }, { - "$ref" : "#/components/parameters/page" + "$ref" : "#/components/parameters/sync_test_connection_id" } ], "responses" : { "200" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ListSyncRuns_200_response" + "$ref" : "#/components/schemas/SyncTestConnection" } } }, "description" : "Response" }, + "400" : { + "$ref" : "#/components/responses/BadRequest" + }, "401" : { "$ref" : "#/components/responses/RequiresAuthentication" }, @@ -4822,21 +4845,25 @@ } }, "tags" : [ "syncs" ] - }, + } + }, + "/teams/{team_name}/sync-destinations/{sync_destination_name}/test-connections/{sync_test_connection_id}/promote" : { "post" : { - "description" : "Create new SyncRun. This will trigger a manual job run.", - "operationId" : "CreateSyncRun", + "description" : "Promote a test connection for sync destination.", + "operationId" : "PromoteTestConnectionForSyncDestination", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/sync_name" + "$ref" : "#/components/parameters/sync_destination_name" + }, { + "$ref" : "#/components/parameters/sync_test_connection_id" } ], "responses" : { - "201" : { + "200" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/SyncRun" + "$ref" : "#/components/schemas/SyncDestination" } } }, @@ -4848,9 +4875,15 @@ "401" : { "$ref" : "#/components/responses/RequiresAuthentication" }, + "404" : { + "$ref" : "#/components/responses/NotFound" + }, "422" : { "$ref" : "#/components/responses/UnprocessableEntity" }, + "429" : { + "$ref" : "#/components/responses/TooManyRequests" + }, "500" : { "$ref" : "#/components/responses/InternalError" } @@ -4858,23 +4891,23 @@ "tags" : [ "syncs" ] } }, - "/teams/{team_name}/syncs/{sync_name}/runs/{sync_run_id}" : { + "/teams/{team_name}/syncs" : { "get" : { - "description" : "Get a Sync Run.", - "operationId" : "GetSyncRun", + "description" : "List all Syncs.", + "operationId" : "ListSyncs", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/sync_name" + "$ref" : "#/components/parameters/per_page" }, { - "$ref" : "#/components/parameters/sync_run_id" + "$ref" : "#/components/parameters/page" } ], "responses" : { "200" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/SyncRunDetails" + "$ref" : "#/components/schemas/ListSyncs_200_response" } } }, @@ -4892,44 +4925,38 @@ }, "tags" : [ "syncs" ] }, - "patch" : { - "description" : "Update a SyncRun", - "operationId" : "UpdateSyncRun", + "post" : { + "description" : "Create new Sync definition. Sync runs can be scheduled automatically, or triggered manually after sync is created.", + "operationId" : "CreateSync", "parameters" : [ { "$ref" : "#/components/parameters/team_name" - }, { - "$ref" : "#/components/parameters/sync_name" - }, { - "$ref" : "#/components/parameters/sync_run_id" } ], "requestBody" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/UpdateSyncRun_request" + "$ref" : "#/components/schemas/SyncCreate" } } - } + }, + "required" : true }, "responses" : { - "200" : { + "201" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/SyncRun" + "$ref" : "#/components/schemas/Sync" } } }, - "description" : "Updated" + "description" : "Response" }, "400" : { "$ref" : "#/components/responses/BadRequest" }, - "403" : { - "$ref" : "#/components/responses/Forbidden" - }, - "404" : { - "$ref" : "#/components/responses/NotFound" + "401" : { + "$ref" : "#/components/responses/RequiresAuthentication" }, "422" : { "$ref" : "#/components/responses/UnprocessableEntity" @@ -4941,30 +4968,18 @@ "tags" : [ "syncs" ] } }, - "/teams/{team_name}/syncs/{sync_name}/runs/{sync_run_id}/progress" : { - "post" : { - "description" : "Create a new sync run progress update.", - "operationId" : "CreateSyncRunProgress", + "/teams/{team_name}/syncs/{sync_name}" : { + "delete" : { + "description" : "Delete Sync. This will delete Sync configuration and all associated sync runs, but will not delete the associated source and destination(s). These will need to be deleted separately.", + "operationId" : "DeleteSync", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { "$ref" : "#/components/parameters/sync_name" - }, { - "$ref" : "#/components/parameters/sync_run_id" } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/CreateSyncRunProgress_request" - } - } - }, - "required" : true - }, "responses" : { "204" : { - "description" : "Progress was reported successfully" + "description" : "Deleted" }, "400" : { "$ref" : "#/components/responses/BadRequest" @@ -4975,75 +4990,79 @@ "404" : { "$ref" : "#/components/responses/NotFound" }, - "422" : { - "$ref" : "#/components/responses/UnprocessableEntity" - }, "500" : { "$ref" : "#/components/responses/InternalError" } }, - "tags" : [ "syncs" ], - "x-internal" : true - } - }, - "/teams/{team_name}/syncs/{sync_name}/runs/{sync_run_id}/logs" : { + "tags" : [ "syncs" ] + }, "get" : { - "description" : "Get logs for a sync run.", - "operationId" : "GetSyncRunLogs", + "description" : "Get a Sync", + "operationId" : "GetSync", "parameters" : [ { - "explode" : false, - "in" : "header", - "name" : "Accept", - "required" : false, - "schema" : { - "type" : "string" - }, - "style" : "simple" - }, { "$ref" : "#/components/parameters/team_name" }, { "$ref" : "#/components/parameters/sync_name" - }, { - "$ref" : "#/components/parameters/sync_run_id" } ], "responses" : { "200" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/Sync_Run_Logs" - } - }, - "text/plain" : { - "schema" : { - "description" : "Chunked response logs for a sync run that is in progress.", - "type" : "string" + "$ref" : "#/components/schemas/Sync" } } }, "description" : "Response" }, - "204" : { - "description" : "No logs available for a sync run that has not started." + "400" : { + "$ref" : "#/components/responses/BadRequest" }, - "302" : { - "description" : "Redirect to the logs download URL for a sync run that has completed.", - "headers" : { - "Location" : { - "explode" : false, - "schema" : { - "description" : "URL to download logs", - "type" : "string" - }, - "style" : "simple" + "401" : { + "$ref" : "#/components/responses/RequiresAuthentication" + }, + "404" : { + "$ref" : "#/components/responses/NotFound" + }, + "500" : { + "$ref" : "#/components/responses/InternalError" + } + }, + "tags" : [ "syncs" ] + }, + "patch" : { + "description" : "Update a Sync", + "operationId" : "UpdateSync", + "parameters" : [ { + "$ref" : "#/components/parameters/team_name" + }, { + "$ref" : "#/components/parameters/sync_name" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SyncUpdate" } } + } + }, + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Sync" + } + } + }, + "description" : "Updated" }, "400" : { "$ref" : "#/components/responses/BadRequest" }, - "401" : { - "$ref" : "#/components/responses/RequiresAuthentication" + "403" : { + "$ref" : "#/components/responses/Forbidden" }, "404" : { "$ref" : "#/components/responses/NotFound" @@ -5058,69 +5077,56 @@ "tags" : [ "syncs" ] } }, - "/teams/{team_name}/syncs/{sync_name}/runs/{sync_run_id}/connector/{connector_id}/identity" : { + "/teams/{team_name}/syncs/{sync_name}/runs" : { "get" : { - "description" : "Get connector identity for a sync run.", - "operationId" : "GetSyncRunConnectorIdentity", + "description" : "List all Sync Runs.", + "operationId" : "ListSyncRuns", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { "$ref" : "#/components/parameters/sync_name" }, { - "$ref" : "#/components/parameters/sync_run_id" + "$ref" : "#/components/parameters/per_page" }, { - "$ref" : "#/components/parameters/connector_id" + "$ref" : "#/components/parameters/page" } ], "responses" : { "200" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/GetSyncRunConnectorIdentity_200_response" + "$ref" : "#/components/schemas/ListSyncRuns_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" ], - "x-internal" : true - } - }, - "/teams/{team_name}/syncs/{sync_name}/runs/{sync_run_id}/connector/{connector_id}/credentials" : { - "get" : { - "description" : "Get connector credentials for a sync run.", - "operationId" : "GetSyncRunConnectorCredentials", + "tags" : [ "syncs" ] + }, + "post" : { + "description" : "Create new SyncRun. This will trigger a manual job run.", + "operationId" : "CreateSyncRun", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { "$ref" : "#/components/parameters/sync_name" - }, { - "$ref" : "#/components/parameters/sync_run_id" - }, { - "$ref" : "#/components/parameters/connector_id" } ], "responses" : { - "200" : { + "201" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/GetSyncRunConnectorCredentials_200_response" + "$ref" : "#/components/schemas/SyncRun" } } }, @@ -5132,9 +5138,6 @@ "401" : { "$ref" : "#/components/responses/RequiresAuthentication" }, - "404" : { - "$ref" : "#/components/responses/NotFound" - }, "422" : { "$ref" : "#/components/responses/UnprocessableEntity" }, @@ -5142,26 +5145,26 @@ "$ref" : "#/components/responses/InternalError" } }, - "tags" : [ "syncs" ], - "x-internal" : true + "tags" : [ "syncs" ] } }, - "/teams/{team_name}/syncs/test-connections/{sync_test_connection_id}" : { + "/teams/{team_name}/syncs/{sync_name}/runs/{sync_run_id}" : { "get" : { - "deprecated" : true, - "description" : "DEPRECATED. Get a Sync Test Connection. Use GetTestConnectionForSyncSource or GetTestConnectionForSyncDestination instead.", - "operationId" : "GetSyncTestConnection", + "description" : "Get a Sync Run.", + "operationId" : "GetSyncRun", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/sync_test_connection_id" + "$ref" : "#/components/parameters/sync_name" + }, { + "$ref" : "#/components/parameters/sync_run_id" } ], "responses" : { "200" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/SyncTestConnection" + "$ref" : "#/components/schemas/SyncRunDetails" } } }, @@ -5180,18 +5183,20 @@ "tags" : [ "syncs" ] }, "patch" : { - "description" : "Update a Sync Test Connection", - "operationId" : "UpdateSyncTestConnection", + "description" : "Update a SyncRun", + "operationId" : "UpdateSyncRun", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/sync_test_connection_id" + "$ref" : "#/components/parameters/sync_name" + }, { + "$ref" : "#/components/parameters/sync_run_id" } ], "requestBody" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/UpdateSyncTestConnection_request" + "$ref" : "#/components/schemas/UpdateSyncRun_request" } } } @@ -5201,7 +5206,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/SyncTestConnection" + "$ref" : "#/components/schemas/SyncRun" } } }, @@ -5226,36 +5231,30 @@ "tags" : [ "syncs" ] } }, - "/teams/{team_name}/syncs/test-connections/{sync_test_connection_id}/new-source" : { + "/teams/{team_name}/syncs/{sync_name}/runs/{sync_run_id}/progress" : { "post" : { - "deprecated" : true, - "description" : "DEPRECATED. Create new Sync Source definition from a test connection. Use PromoteTestConnectionForSyncSource instead.", - "operationId" : "CreateSyncSourceFromTestConnection", + "description" : "Create a new sync run progress update.", + "operationId" : "CreateSyncRunProgress", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/sync_test_connection_id" + "$ref" : "#/components/parameters/sync_name" + }, { + "$ref" : "#/components/parameters/sync_run_id" } ], "requestBody" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/SyncSourceCreateFromTestConnection" + "$ref" : "#/components/schemas/CreateSyncRunProgress_request" } } }, "required" : true }, "responses" : { - "201" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/SyncSource" - } - } - }, - "description" : "Response" + "204" : { + "description" : "Progress was reported successfully" }, "400" : { "$ref" : "#/components/responses/BadRequest" @@ -5273,91 +5272,62 @@ "$ref" : "#/components/responses/InternalError" } }, - "tags" : [ "syncs" ] + "tags" : [ "syncs" ], + "x-internal" : true } }, - "/teams/{team_name}/syncs/test-connections/{sync_test_connection_id}/new-destination" : { - "post" : { - "deprecated" : true, - "description" : "DEPRECATED. Create new Sync Destination definition from a test connection. Use PromoteTestConnectionForSyncDestination instead.", - "operationId" : "CreateSyncDestinationFromTestConnection", + "/teams/{team_name}/syncs/{sync_name}/runs/{sync_run_id}/logs" : { + "get" : { + "description" : "Get logs for a sync run.", + "operationId" : "GetSyncRunLogs", "parameters" : [ { + "explode" : false, + "in" : "header", + "name" : "Accept", + "required" : false, + "schema" : { + "type" : "string" + }, + "style" : "simple" + }, { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/sync_test_connection_id" + "$ref" : "#/components/parameters/sync_name" + }, { + "$ref" : "#/components/parameters/sync_run_id" } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/SyncDestinationCreateFromTestConnection" - } - } - }, - "required" : true - }, "responses" : { - "201" : { + "200" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/SyncDestination" + "$ref" : "#/components/schemas/Sync_Run_Logs" + } + }, + "text/plain" : { + "schema" : { + "description" : "Chunked response logs for a sync run that is in progress.", + "type" : "string" } } }, "description" : "Response" }, - "400" : { - "$ref" : "#/components/responses/BadRequest" - }, - "401" : { - "$ref" : "#/components/responses/RequiresAuthentication" + "204" : { + "description" : "No logs available for a sync run that has not started." }, - "404" : { - "$ref" : "#/components/responses/NotFound" - }, - "422" : { - "$ref" : "#/components/responses/UnprocessableEntity" - }, - "500" : { - "$ref" : "#/components/responses/InternalError" - } - }, - "tags" : [ "syncs" ] - } - }, - "/teams/{team_name}/syncs/test-connections/{sync_test_connection_id}/update-source/{sync_source_name}" : { - "patch" : { - "deprecated" : true, - "description" : "DEPRECATED. Update Sync Source definition from a test connection. Use PromoteTestConnectionForSyncSource and/or UpdateSyncSource instead.", - "operationId" : "UpdateSyncSourceFromTestConnection", - "parameters" : [ { - "$ref" : "#/components/parameters/team_name" - }, { - "$ref" : "#/components/parameters/sync_test_connection_id" - }, { - "$ref" : "#/components/parameters/sync_source_name" - } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/SyncSourceUpdateFromTestConnection" - } - } - }, - "required" : true - }, - "responses" : { - "200" : { - "content" : { - "application/json" : { + "302" : { + "description" : "Redirect to the logs download URL for a sync run that has completed.", + "headers" : { + "Location" : { + "explode" : false, "schema" : { - "$ref" : "#/components/schemas/SyncSource" - } + "description" : "URL to download logs", + "type" : "string" + }, + "style" : "simple" } - }, - "description" : "Response" + } }, "400" : { "$ref" : "#/components/responses/BadRequest" @@ -5378,34 +5348,25 @@ "tags" : [ "syncs" ] } }, - "/teams/{team_name}/syncs/test-connections/{sync_test_connection_id}/update-destination/{sync_destination_name}" : { - "patch" : { - "deprecated" : true, - "description" : "DEPRECATED. Update Sync Destination definition from a test connection. Use PromoteTestConnectionForSyncDestination and/or UpdateSyncDestination instead.", - "operationId" : "UpdateSyncDestinationFromTestConnection", + "/teams/{team_name}/syncs/{sync_name}/runs/{sync_run_id}/connector/{connector_id}/identity" : { + "get" : { + "description" : "Get connector identity for a sync run.", + "operationId" : "GetSyncRunConnectorIdentity", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/sync_test_connection_id" + "$ref" : "#/components/parameters/sync_name" }, { - "$ref" : "#/components/parameters/sync_destination_name" + "$ref" : "#/components/parameters/sync_run_id" + }, { + "$ref" : "#/components/parameters/connector_id" } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/SyncDestinationUpdateFromTestConnection" - } - } - }, - "required" : true - }, "responses" : { "200" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/SyncDestination" + "$ref" : "#/components/schemas/GetSyncRunConnectorIdentity_200_response" } } }, @@ -5427,17 +5388,20 @@ "$ref" : "#/components/responses/InternalError" } }, - "tags" : [ "syncs" ] + "tags" : [ "syncs" ], + "x-internal" : true } }, - "/teams/{team_name}/syncs/test-connections/{sync_test_connection_id}/connector/{connector_id}/identity" : { + "/teams/{team_name}/syncs/{sync_name}/runs/{sync_run_id}/connector/{connector_id}/credentials" : { "get" : { - "description" : "Get connector identity for a test connection.", - "operationId" : "GetTestConnectionConnectorIdentity", + "description" : "Get connector credentials for a sync run.", + "operationId" : "GetSyncRunConnectorCredentials", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/sync_test_connection_id" + "$ref" : "#/components/parameters/sync_name" + }, { + "$ref" : "#/components/parameters/sync_run_id" }, { "$ref" : "#/components/parameters/connector_id" } ], @@ -5446,7 +5410,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/GetSyncRunConnectorIdentity_200_response" + "$ref" : "#/components/schemas/GetSyncRunConnectorCredentials_200_response" } } }, @@ -5472,100 +5436,101 @@ "x-internal" : true } }, - "/teams/{team_name}/syncs/test-connections/{sync_test_connection_id}/connector/{connector_id}/credentials" : { + "/teams/{team_name}/syncs/test-connections/{sync_test_connection_id}" : { "get" : { - "description" : "Get connector credentials for a test connection", - "operationId" : "GetTestConnectionConnectorCredentials", + "deprecated" : true, + "description" : "DEPRECATED. Get a Sync Test Connection. Use GetTestConnectionForSyncSource or GetTestConnectionForSyncDestination instead.", + "operationId" : "GetSyncTestConnection", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { "$ref" : "#/components/parameters/sync_test_connection_id" - }, { - "$ref" : "#/components/parameters/connector_id" } ], "responses" : { "200" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/GetSyncRunConnectorCredentials_200_response" + "$ref" : "#/components/schemas/SyncTestConnection" } } }, "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" ], - "x-internal" : true - } - }, - "/teams/{team_name}/managed-databases" : { - "get" : { - "description" : "Get a paginated list of managed databases", - "operationId" : "GetManagedDatabases", + "tags" : [ "syncs" ] + }, + "patch" : { + "description" : "Update a Sync Test Connection", + "operationId" : "UpdateSyncTestConnection", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/page" - }, { - "$ref" : "#/components/parameters/per_page" + "$ref" : "#/components/parameters/sync_test_connection_id" } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/UpdateSyncTestConnection_request" + } + } + } + }, "responses" : { "200" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/GetManagedDatabases_200_response" + "$ref" : "#/components/schemas/SyncTestConnection" } } }, - "description" : "Response" + "description" : "Updated" }, "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" : [ "managed-databases" ], - "x-internal" : true - }, + "tags" : [ "syncs" ] + } + }, + "/teams/{team_name}/syncs/test-connections/{sync_test_connection_id}/new-source" : { "post" : { - "description" : "Create a new managed database", - "operationId" : "CreateManagedDatabase", + "deprecated" : true, + "description" : "DEPRECATED. Create new Sync Source definition from a test connection. Use PromoteTestConnectionForSyncSource instead.", + "operationId" : "CreateSyncSourceFromTestConnection", "parameters" : [ { "$ref" : "#/components/parameters/team_name" + }, { + "$ref" : "#/components/parameters/sync_test_connection_id" } ], "requestBody" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ManagedDatabaseCreate" + "$ref" : "#/components/schemas/SyncSourceCreateFromTestConnection" } } }, @@ -5576,7 +5541,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ManagedDatabase" + "$ref" : "#/components/schemas/SyncSource" } } }, @@ -5588,15 +5553,9 @@ "401" : { "$ref" : "#/components/responses/RequiresAuthentication" }, - "403" : { - "$ref" : "#/components/responses/Forbidden" - }, "404" : { "$ref" : "#/components/responses/NotFound" }, - "409" : { - "$ref" : "#/components/responses/Conflict" - }, "422" : { "$ref" : "#/components/responses/UnprocessableEntity" }, @@ -5604,22 +5563,42 @@ "$ref" : "#/components/responses/InternalError" } }, - "tags" : [ "managed-databases" ], - "x-internal" : true + "tags" : [ "syncs" ] } }, - "/teams/{team_name}/managed-databases/{managed_database_id}" : { - "delete" : { - "description" : "Delete this managed database. Any syncs relying on this database must be deleted first.", - "operationId" : "DeleteManagedDatabase", + "/teams/{team_name}/syncs/test-connections/{sync_test_connection_id}/new-destination" : { + "post" : { + "deprecated" : true, + "description" : "DEPRECATED. Create new Sync Destination definition from a test connection. Use PromoteTestConnectionForSyncDestination instead.", + "operationId" : "CreateSyncDestinationFromTestConnection", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/managed_database_id" + "$ref" : "#/components/parameters/sync_test_connection_id" } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SyncDestinationCreateFromTestConnection" + } + } + }, + "required" : true + }, "responses" : { - "204" : { - "description" : "Deleted" + "201" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SyncDestination" + } + } + }, + "description" : "Response" + }, + "400" : { + "$ref" : "#/components/responses/BadRequest" }, "401" : { "$ref" : "#/components/responses/RequiresAuthentication" @@ -5634,122 +5613,89 @@ "$ref" : "#/components/responses/InternalError" } }, - "tags" : [ "managed-databases" ], - "x-internal" : true - }, - "get" : { - "description" : "Get a single managed database.", - "operationId" : "GetManagedDatabase", + "tags" : [ "syncs" ] + } + }, + "/teams/{team_name}/syncs/test-connections/{sync_test_connection_id}/update-source/{sync_source_name}" : { + "patch" : { + "deprecated" : true, + "description" : "DEPRECATED. Update Sync Source definition from a test connection. Use PromoteTestConnectionForSyncSource and/or UpdateSyncSource instead.", + "operationId" : "UpdateSyncSourceFromTestConnection", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/managed_database_id" + "$ref" : "#/components/parameters/sync_test_connection_id" + }, { + "$ref" : "#/components/parameters/sync_source_name" } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SyncSourceUpdateFromTestConnection" + } + } + }, + "required" : true + }, "responses" : { "200" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ManagedDatabase" + "$ref" : "#/components/schemas/SyncSource" } } }, "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" : [ "managed-databases" ], - "x-internal" : true + "tags" : [ "syncs" ] } }, - "/teams/{team_name}/connectors" : { - "get" : { - "description" : "List all configured connectors", - "operationId" : "ListConnectors", + "/teams/{team_name}/syncs/test-connections/{sync_test_connection_id}/update-destination/{sync_destination_name}" : { + "patch" : { + "deprecated" : true, + "description" : "DEPRECATED. Update Sync Destination definition from a test connection. Use PromoteTestConnectionForSyncDestination and/or UpdateSyncDestination instead.", + "operationId" : "UpdateSyncDestinationFromTestConnection", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/per_page" - }, { - "$ref" : "#/components/parameters/page" - }, { - "description" : "Filter connectors by a given type.", - "explode" : true, - "in" : "query", - "name" : "filter_type", - "required" : false, - "schema" : { - "type" : "string" - }, - "style" : "form" + "$ref" : "#/components/parameters/sync_test_connection_id" }, { - "description" : "Filter connectors by a given plugin reference. Mutually exclusive with `type`.", - "example" : "cloudquery/source/googleanalytics", - "explode" : true, - "in" : "query", - "name" : "filter_plugin", - "required" : false, - "schema" : { - "type" : "string" - }, - "style" : "form" - } ], - "responses" : { - "200" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ListConnectors_200_response" - } - } - }, - "description" : "Response" - }, - "400" : { - "$ref" : "#/components/responses/BadRequest" - }, - "401" : { - "$ref" : "#/components/responses/RequiresAuthentication" - }, - "404" : { - "$ref" : "#/components/responses/NotFound" - }, - "500" : { - "$ref" : "#/components/responses/InternalError" - } - }, - "tags" : [ "syncs" ] - }, - "post" : { - "description" : "Create new connector", - "operationId" : "CreateConnector", - "parameters" : [ { - "$ref" : "#/components/parameters/team_name" + "$ref" : "#/components/parameters/sync_destination_name" } ], "requestBody" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ConnectorCreate" + "$ref" : "#/components/schemas/SyncDestinationUpdateFromTestConnection" } } }, "required" : true }, "responses" : { - "201" : { + "200" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/Connector" + "$ref" : "#/components/schemas/SyncDestination" } } }, @@ -5761,6 +5707,9 @@ "401" : { "$ref" : "#/components/responses/RequiresAuthentication" }, + "404" : { + "$ref" : "#/components/responses/NotFound" + }, "422" : { "$ref" : "#/components/responses/UnprocessableEntity" }, @@ -5771,12 +5720,14 @@ "tags" : [ "syncs" ] } }, - "/teams/{team_name}/connectors/{connector_id}" : { + "/teams/{team_name}/syncs/test-connections/{sync_test_connection_id}/connector/{connector_id}/identity" : { "get" : { - "description" : "Get a configured connector", - "operationId" : "GetConnector", + "description" : "Get connector identity for a test connection.", + "operationId" : "GetTestConnectionConnectorIdentity", "parameters" : [ { "$ref" : "#/components/parameters/team_name" + }, { + "$ref" : "#/components/parameters/sync_test_connection_id" }, { "$ref" : "#/components/parameters/connector_id" } ], @@ -5785,51 +5736,53 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/Connector" + "$ref" : "#/components/schemas/GetSyncRunConnectorIdentity_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" ] - }, - "patch" : { - "description" : "Update a connector", - "operationId" : "UpdateConnector", + "tags" : [ "syncs" ], + "x-internal" : true + } + }, + "/teams/{team_name}/syncs/test-connections/{sync_test_connection_id}/connector/{connector_id}/credentials" : { + "get" : { + "description" : "Get connector credentials for a test connection", + "operationId" : "GetTestConnectionConnectorCredentials", "parameters" : [ { "$ref" : "#/components/parameters/team_name" + }, { + "$ref" : "#/components/parameters/sync_test_connection_id" }, { "$ref" : "#/components/parameters/connector_id" } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ConnectorUpdate" - } - } - } - }, "responses" : { "200" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/Connector" + "$ref" : "#/components/schemas/GetSyncRunConnectorCredentials_200_response" } } }, - "description" : "Update response" + "description" : "Response" }, "400" : { "$ref" : "#/components/responses/BadRequest" @@ -5840,32 +5793,6 @@ "404" : { "$ref" : "#/components/responses/NotFound" }, - "500" : { - "$ref" : "#/components/responses/InternalError" - } - }, - "tags" : [ "syncs" ] - } - }, - "/teams/{team_name}/connectors/{connector_id}/authenticate" : { - "delete" : { - "description" : "Revoke authentication for a given connector. Any syncs relying on this connector will stop running until the connector is reauthenticated or sync references are updated.", - "operationId" : "RevokeConnector", - "parameters" : [ { - "$ref" : "#/components/parameters/team_name" - }, { - "$ref" : "#/components/parameters/connector_id" - } ], - "responses" : { - "204" : { - "description" : "Deleted" - }, - "401" : { - "$ref" : "#/components/responses/RequiresAuthentication" - }, - "404" : { - "$ref" : "#/components/responses/NotFound" - }, "422" : { "$ref" : "#/components/responses/UnprocessableEntity" }, @@ -5873,31 +5800,31 @@ "$ref" : "#/components/responses/InternalError" } }, - "tags" : [ "syncs" ] + "tags" : [ "syncs" ], + "x-internal" : true } }, - "/teams/{team_name}/connectors/{connector_id}/authenticate/aws" : { - "patch" : { - "description" : "Complete authentication for the given AWS connector", - "operationId" : "AuthenticateConnectorFinishAWS", + "/teams/{team_name}/managed-databases" : { + "get" : { + "description" : "Get a paginated list of managed databases", + "operationId" : "GetManagedDatabases", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/connector_id" + "$ref" : "#/components/parameters/page" + }, { + "$ref" : "#/components/parameters/per_page" } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ConnectorAuthFinishRequestAWS" - } - } - }, - "required" : true - }, "responses" : { - "204" : { - "description" : "Authentication is complete." + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/GetManagedDatabases_200_response" + } + } + }, + "description" : "Response" }, "400" : { "$ref" : "#/components/responses/BadRequest" @@ -5911,39 +5838,35 @@ "404" : { "$ref" : "#/components/responses/NotFound" }, - "422" : { - "$ref" : "#/components/responses/UnprocessableEntity" - }, "500" : { "$ref" : "#/components/responses/InternalError" } }, - "tags" : [ "syncs" ] + "tags" : [ "managed-databases" ], + "x-internal" : true }, "post" : { - "description" : "Authenticate or reauthenticate the given AWS connector", - "operationId" : "AuthenticateConnectorAWS", + "description" : "Create a new managed database", + "operationId" : "CreateManagedDatabase", "parameters" : [ { "$ref" : "#/components/parameters/team_name" - }, { - "$ref" : "#/components/parameters/connector_id" } ], "requestBody" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ConnectorAuthRequestAWS" + "$ref" : "#/components/schemas/ManagedDatabaseCreate" } } }, "required" : true }, "responses" : { - "200" : { + "201" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ConnectorAuthResponseAWS" + "$ref" : "#/components/schemas/ManagedDatabase" } } }, @@ -5955,9 +5878,15 @@ "401" : { "$ref" : "#/components/responses/RequiresAuthentication" }, + "403" : { + "$ref" : "#/components/responses/Forbidden" + }, "404" : { "$ref" : "#/components/responses/NotFound" }, + "409" : { + "$ref" : "#/components/responses/Conflict" + }, "422" : { "$ref" : "#/components/responses/UnprocessableEntity" }, @@ -5965,41 +5894,26 @@ "$ref" : "#/components/responses/InternalError" } }, - "tags" : [ "syncs" ] + "tags" : [ "managed-databases" ], + "x-internal" : true } }, - "/teams/{team_name}/connectors/{connector_id}/authenticate/oauth" : { - "patch" : { - "description" : "Complete authentication for the given OAuth connector", - "operationId" : "AuthenticateConnectorFinishOAuth", + "/teams/{team_name}/managed-databases/{managed_database_id}" : { + "delete" : { + "description" : "Delete this managed database. Any syncs relying on this database must be deleted first.", + "operationId" : "DeleteManagedDatabase", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/connector_id" + "$ref" : "#/components/parameters/managed_database_id" } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ConnectorAuthFinishRequestOAuth" - } - } - }, - "required" : true - }, "responses" : { "204" : { - "description" : "Authentication is complete." - }, - "400" : { - "$ref" : "#/components/responses/BadRequest" + "description" : "Deleted" }, "401" : { "$ref" : "#/components/responses/RequiresAuthentication" }, - "403" : { - "$ref" : "#/components/responses/Forbidden" - }, "404" : { "$ref" : "#/components/responses/NotFound" }, @@ -6010,49 +5924,425 @@ "$ref" : "#/components/responses/InternalError" } }, - "tags" : [ "syncs" ] + "tags" : [ "managed-databases" ], + "x-internal" : true }, - "post" : { - "description" : "Authenticate or reauthenticate the given OAuth connector", - "operationId" : "AuthenticateConnectorOAuth", + "get" : { + "description" : "Get a single managed database.", + "operationId" : "GetManagedDatabase", "parameters" : [ { "$ref" : "#/components/parameters/team_name" }, { - "$ref" : "#/components/parameters/connector_id" + "$ref" : "#/components/parameters/managed_database_id" } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ConnectorAuthRequestOAuth" - } - } - }, - "required" : true - }, "responses" : { "200" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ConnectorAuthResponseOAuth" + "$ref" : "#/components/schemas/ManagedDatabase" } } }, "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" : [ "managed-databases" ], + "x-internal" : true + } + }, + "/teams/{team_name}/connectors" : { + "get" : { + "description" : "List all configured connectors", + "operationId" : "ListConnectors", + "parameters" : [ { + "$ref" : "#/components/parameters/team_name" + }, { + "$ref" : "#/components/parameters/per_page" + }, { + "$ref" : "#/components/parameters/page" + }, { + "description" : "Filter connectors by a given type.", + "explode" : true, + "in" : "query", + "name" : "filter_type", + "required" : false, + "schema" : { + "type" : "string" + }, + "style" : "form" + }, { + "description" : "Filter connectors by a given plugin reference. Mutually exclusive with `type`.", + "example" : "cloudquery/source/googleanalytics", + "explode" : true, + "in" : "query", + "name" : "filter_plugin", + "required" : false, + "schema" : { + "type" : "string" + }, + "style" : "form" + } ], + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ListConnectors_200_response" + } + } + }, + "description" : "Response" + }, + "400" : { + "$ref" : "#/components/responses/BadRequest" + }, + "401" : { + "$ref" : "#/components/responses/RequiresAuthentication" + }, + "404" : { + "$ref" : "#/components/responses/NotFound" + }, + "500" : { + "$ref" : "#/components/responses/InternalError" + } + }, + "tags" : [ "syncs" ] + }, + "post" : { + "description" : "Create new connector", + "operationId" : "CreateConnector", + "parameters" : [ { + "$ref" : "#/components/parameters/team_name" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ConnectorCreate" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Connector" + } + } + }, + "description" : "Response" + }, + "400" : { + "$ref" : "#/components/responses/BadRequest" + }, + "401" : { + "$ref" : "#/components/responses/RequiresAuthentication" + }, + "422" : { + "$ref" : "#/components/responses/UnprocessableEntity" + }, + "500" : { + "$ref" : "#/components/responses/InternalError" + } + }, + "tags" : [ "syncs" ] + } + }, + "/teams/{team_name}/connectors/{connector_id}" : { + "get" : { + "description" : "Get a configured connector", + "operationId" : "GetConnector", + "parameters" : [ { + "$ref" : "#/components/parameters/team_name" + }, { + "$ref" : "#/components/parameters/connector_id" + } ], + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Connector" + } + } + }, + "description" : "Response" + }, + "401" : { + "$ref" : "#/components/responses/RequiresAuthentication" + }, + "404" : { + "$ref" : "#/components/responses/NotFound" + }, + "500" : { + "$ref" : "#/components/responses/InternalError" + } + }, + "tags" : [ "syncs" ] + }, + "patch" : { + "description" : "Update a connector", + "operationId" : "UpdateConnector", + "parameters" : [ { + "$ref" : "#/components/parameters/team_name" + }, { + "$ref" : "#/components/parameters/connector_id" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ConnectorUpdate" + } + } + } + }, + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Connector" + } + } + }, + "description" : "Update response" + }, + "400" : { + "$ref" : "#/components/responses/BadRequest" + }, + "401" : { + "$ref" : "#/components/responses/RequiresAuthentication" + }, + "404" : { + "$ref" : "#/components/responses/NotFound" + }, + "500" : { + "$ref" : "#/components/responses/InternalError" + } + }, + "tags" : [ "syncs" ] + } + }, + "/teams/{team_name}/connectors/{connector_id}/authenticate" : { + "delete" : { + "description" : "Revoke authentication for a given connector. Any syncs relying on this connector will stop running until the connector is reauthenticated or sync references are updated.", + "operationId" : "RevokeConnector", + "parameters" : [ { + "$ref" : "#/components/parameters/team_name" + }, { + "$ref" : "#/components/parameters/connector_id" + } ], + "responses" : { + "204" : { + "description" : "Deleted" + }, + "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/aws" : { + "patch" : { + "description" : "Complete authentication for the given AWS connector", + "operationId" : "AuthenticateConnectorFinishAWS", + "parameters" : [ { + "$ref" : "#/components/parameters/team_name" + }, { + "$ref" : "#/components/parameters/connector_id" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ConnectorAuthFinishRequestAWS" + } + } + }, + "required" : true + }, + "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" ] + }, + "post" : { + "description" : "Authenticate or reauthenticate the given AWS connector", + "operationId" : "AuthenticateConnectorAWS", + "parameters" : [ { + "$ref" : "#/components/parameters/team_name" + }, { + "$ref" : "#/components/parameters/connector_id" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ConnectorAuthRequestAWS" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ConnectorAuthResponseAWS" + } + } + }, + "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/oauth" : { + "patch" : { + "description" : "Complete authentication for the given OAuth connector", + "operationId" : "AuthenticateConnectorFinishOAuth", + "parameters" : [ { + "$ref" : "#/components/parameters/team_name" + }, { + "$ref" : "#/components/parameters/connector_id" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ConnectorAuthFinishRequestOAuth" + } + } + }, + "required" : true + }, + "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" ] + }, + "post" : { + "description" : "Authenticate or reauthenticate the given OAuth connector", + "operationId" : "AuthenticateConnectorOAuth", + "parameters" : [ { + "$ref" : "#/components/parameters/team_name" + }, { + "$ref" : "#/components/parameters/connector_id" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ConnectorAuthRequestOAuth" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ConnectorAuthResponseOAuth" + } + } + }, + "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" } @@ -6306,6 +6596,28 @@ "style" : "simple", "x-go-name" : "APIKeyID" }, + "sync_source_test_connection_id" : { + "explode" : false, + "in" : "path", + "name" : "sync_source_test_connection_id", + "required" : true, + "schema" : { + "$ref" : "#/components/schemas/SyncSourceTestConnectionID" + }, + "style" : "simple", + "x-go-name" : "SyncSourceTestConnectionID" + }, + "sync_destination_test_connection_id" : { + "explode" : false, + "in" : "path", + "name" : "sync_destination_test_connection_id", + "required" : true, + "schema" : { + "$ref" : "#/components/schemas/SyncDestinationTestConnectionID" + }, + "style" : "simple", + "x-go-name" : "SyncDestinationTestConnectionID" + }, "sync_source_name" : { "explode" : false, "in" : "path", @@ -8338,230 +8650,559 @@ "example" : "admin", "type" : "string" }, - "team" : { - "$ref" : "#/components/schemas/Team" + "team" : { + "$ref" : "#/components/schemas/Team" + } + }, + "required" : [ "role" ], + "title" : "CloudQuery Team Membership" + }, + "TeamSubscriptionOrderID" : { + "description" : "ID of the team subscription order", + "example" : "12345678-1234-1234-1234-1234567890ab", + "format" : "uuid", + "type" : "string", + "x-go-name" : "TeamSubscriptionOrderID" + }, + "TeamSubscriptionOrderStatus" : { + "enum" : [ "pending", "completed", "cancelled" ], + "type" : "string" + }, + "TeamSubscriptionOrder" : { + "additionalProperties" : false, + "description" : "Team subscription order", + "properties" : { + "id" : { + "$ref" : "#/components/schemas/TeamSubscriptionOrderID" + }, + "team_name" : { + "$ref" : "#/components/schemas/TeamName" + }, + "plan" : { + "$ref" : "#/components/schemas/TeamPlan" + }, + "status" : { + "$ref" : "#/components/schemas/TeamSubscriptionOrderStatus" + }, + "created_at" : { + "example" : "2017-07-14T16:53:42Z", + "format" : "date-time", + "type" : "string" + }, + "updated_at" : { + "example" : "2017-07-14T16:53:42Z", + "format" : "date-time", + "type" : "string" + }, + "completed_at" : { + "example" : "2017-07-14T16:53:42Z", + "format" : "date-time", + "type" : "string" + }, + "completion_url" : { + "description" : "Stripe URL for completing purchase. Only shown in response to POST request when a paid plan is selected.", + "format" : "uri", + "type" : "string", + "x-go-name" : "CompletionURL" + } + }, + "required" : [ "created_at", "id", "plan", "status", "team_name", "updated_at" ], + "title" : "Team subscription order" + }, + "TeamSubscriptionOrderCreate" : { + "additionalProperties" : false, + "description" : "Create team subscription order", + "properties" : { + "plan" : { + "$ref" : "#/components/schemas/TeamPlan" + }, + "success_url" : { + "description" : "URL to redirect to after successful order completion", + "example" : "https://cloud.cloudquery.io/order-completion", + "type" : "string" + }, + "cancel_url" : { + "description" : "URL to redirect to after order cancellation", + "example" : "https://cloud.cloudquery.io/order-cancelled", + "type" : "string" + } + }, + "required" : [ "cancel_url", "plan", "success_url" ], + "title" : "Create team subscription order" + }, + "InvitationWithToken" : { + "additionalProperties" : false, + "allOf" : [ { + "$ref" : "#/components/schemas/Invitation" + }, { + "properties" : { + "token" : { + "description" : "The token used to accept the invitation", + "format" : "uuid", + "type" : "string" + } + }, + "required" : [ "token" ] + } ] + }, + "UserID" : { + "description" : "ID of the User", + "example" : "12345678-1234-1234-1234-1234567890ab", + "format" : "uuid", + "type" : "string", + "x-go-name" : "UserID" + }, + "APIKeyName" : { + "description" : "Name of the API key", + "example" : "cli-api-key", + "maxLength" : 255, + "minLength" : 1, + "pattern" : "^(?:[a-zA-Z0-9][a-zA-Z0-9- ]*)?[a-zA-Z0-9]$", + "type" : "string" + }, + "APIKeyID" : { + "description" : "ID of the API key", + "example" : "12345678-1234-1234-1234-1234567890ab", + "format" : "uuid", + "type" : "string", + "x-go-name" : "APIKeyID" + }, + "APIKeyScope" : { + "description" : "Scope of permissions for the API key. API keys are used for creating new plugin versions and downloading existing plugins", + "enum" : [ "read-and-write" ], + "type" : "string" + }, + "APIKey" : { + "description" : "API Key to interact with CloudQuery Cloud under specific team", + "properties" : { + "name" : { + "$ref" : "#/components/schemas/APIKeyName" + }, + "created_by" : { + "description" : "email of the user that created the API key", + "example" : "user@example.com", + "type" : "string" + }, + "id" : { + "$ref" : "#/components/schemas/APIKeyID" + }, + "key" : { + "description" : "API key. Will be shown only in the response when creating the key.", + "example" : "1234567890abcdef1234567890abcdef", + "type" : "string" + }, + "created_at" : { + "example" : "2017-07-14T16:53:42Z", + "format" : "date-time", + "type" : "string" + }, + "expires_at" : { + "description" : "Timestamp at which API key will stop working", + "example" : "2017-07-14T16:53:42Z", + "format" : "date-time", + "type" : "string" + }, + "expired" : { + "description" : "Whether the API key has expired or not", + "example" : false, + "type" : "boolean" + }, + "scope" : { + "$ref" : "#/components/schemas/APIKeyScope" + } + }, + "required" : [ "expired", "expires_at", "id", "name", "scope" ] + }, + "RegistryAuthToken" : { + "additionalProperties" : false, + "description" : "JWT token for the image registry", + "properties" : { + "access_token" : { + "type" : "string" + }, + "token" : { + "type" : "string" + } + }, + "required" : [ "access_token", "token" ] + }, + "DockerError" : { + "additionalProperties" : false, + "description" : "Error Returned from the Docker Authorization Handler to the Docker Registry", + "properties" : { + "details" : { + "type" : "string" + } + }, + "required" : [ "details" ], + "title" : "Docker Error" + }, + "SyncPluginPath" : { + "description" : "Plugin path in CloudQuery registry", + "pattern" : "^cloudquery/[^/]+", + "type" : "string" + }, + "SyncEnvCreate" : { + "description" : "Environment variable. Environment variables are assumed to be secret.", + "properties" : { + "name" : { + "description" : "Name of the environment variable", + "type" : "string" + }, + "value" : { + "description" : "Value of the environment variable", + "type" : "string" + } + }, + "required" : [ "name" ] + }, + "ConnectorID" : { + "description" : "ID of the Connector", + "example" : "12345678-1234-1234-1234-1234567890ab", + "format" : "uuid", + "type" : "string", + "x-go-name" : "ConnectorID" + }, + "SyncSourceTestConnectionCreate" : { + "properties" : { + "path" : { + "$ref" : "#/components/schemas/SyncPluginPath" + }, + "source_name" : { + "description" : "Name of an existing source", + "type" : "string" + }, + "version" : { + "description" : "Version of the plugin", + "example" : "v1.2.3", + "type" : "string" + }, + "spec" : { + "additionalProperties" : false, + "format" : "Plugin parameters, specific to each plugin", + "type" : "object" + }, + "env" : { + "description" : "Environment variables for the plugin. All environment variables will be stored as secrets.", + "items" : { + "$ref" : "#/components/schemas/SyncEnvCreate" + }, + "type" : "array" + }, + "connector_id" : { + "$ref" : "#/components/schemas/ConnectorID" } }, - "required" : [ "role" ], - "title" : "CloudQuery Team Membership" + "required" : [ "path", "version" ], + "title" : "Sync Source Test Connection creation definition" }, - "TeamSubscriptionOrderID" : { - "description" : "ID of the team subscription order", + "SyncTestConnectionID" : { + "description" : "unique ID of the test connection", "example" : "12345678-1234-1234-1234-1234567890ab", "format" : "uuid", "type" : "string", - "x-go-name" : "TeamSubscriptionOrderID" + "x-go-name" : "ID" }, - "TeamSubscriptionOrderStatus" : { - "enum" : [ "pending", "completed", "cancelled" ], + "SyncTestConnectionStatus" : { + "description" : "The status of the sync run", + "enum" : [ "completed", "failed", "started", "created" ], "type" : "string" }, - "TeamSubscriptionOrder" : { - "additionalProperties" : false, - "description" : "Team subscription order", + "SyncSourceTestConnection" : { "properties" : { "id" : { - "$ref" : "#/components/schemas/TeamSubscriptionOrderID" + "$ref" : "#/components/schemas/SyncTestConnectionID" }, - "team_name" : { - "$ref" : "#/components/schemas/TeamName" + "status" : { + "$ref" : "#/components/schemas/SyncTestConnectionStatus" }, - "plan" : { - "$ref" : "#/components/schemas/TeamPlan" + "failure_reason" : { + "description" : "Reason for failure", + "example" : "password authentication failed for user \"exampleuser\"", + "type" : "string" }, - "status" : { - "$ref" : "#/components/schemas/TeamSubscriptionOrderStatus" + "failure_code" : { + "description" : "Code for failure", + "example" : "INVALID_CREDENTIALS", + "type" : "string" }, "created_at" : { + "description" : "Time the test connection was created", "example" : "2017-07-14T16:53:42Z", "format" : "date-time", "type" : "string" }, - "updated_at" : { + "completed_at" : { + "description" : "Time the test connection was completed", "example" : "2017-07-14T16:53:42Z", "format" : "date-time", "type" : "string" }, - "completed_at" : { - "example" : "2017-07-14T16:53:42Z", - "format" : "date-time", + "plugin_path" : { + "$ref" : "#/components/schemas/SyncPluginPath" + }, + "plugin_version" : { + "$ref" : "#/components/schemas/VersionName" + } + }, + "required" : [ "created_at", "id", "status" ] + }, + "SyncSourceTestConnectionID" : { + "description" : "ID of the Sync Source Test Connection", + "example" : "12345678-1234-1234-1234-1234567890ab", + "format" : "uuid", + "type" : "string", + "x-go-name" : "SyncSourceTestConnectionID" + }, + "PromoteSyncSourceTestConnection" : { + "description" : "Sync Source Definition", + "properties" : { + "name" : { + "description" : "Descriptive, unique name for the source. The name can only contain ASCII letters, digits, - and _.", + "example" : "my-source-definition", + "pattern" : "^[a-zA-Z0-9_-]+$", "type" : "string" }, - "completion_url" : { - "description" : "Stripe URL for completing purchase. Only shown in response to POST request when a paid plan is selected.", - "format" : "uri", - "type" : "string", - "x-go-name" : "CompletionURL" + "tables" : { + "description" : "Tables to sync. Wildcards are supported. Note that child tables are excluded by default, and need to be explicitly specified.", + "items" : { + "type" : "string" + }, + "type" : "array" + }, + "skip_tables" : { + "description" : "Tables matched by `tables` that should be skipped. Wildcards are supported.", + "items" : { + "type" : "string" + }, + "type" : "array" } }, - "required" : [ "created_at", "id", "plan", "status", "team_name", "updated_at" ], - "title" : "Team subscription order" + "required" : [ "name", "tables" ], + "title" : "Sync Source definition for creating a new source" }, - "TeamSubscriptionOrderCreate" : { - "additionalProperties" : false, - "description" : "Create team subscription order", + "SyncLastUpdateSource" : { + "description" : "How was the source or destination been created or updated last", + "enum" : [ "yaml", "ui" ], + "type" : "string" + }, + "SyncSourceCreate" : { + "description" : "Sync Source Definition", "properties" : { - "plan" : { - "$ref" : "#/components/schemas/TeamPlan" + "name" : { + "description" : "Descriptive, unique name for the source. The name can only contain ASCII letters, digits, - and _.", + "example" : "my-source-definition", + "pattern" : "^[a-zA-Z0-9_-]+$", + "type" : "string" }, - "success_url" : { - "description" : "URL to redirect to after successful order completion", - "example" : "https://cloud.cloudquery.io/order-completion", + "path" : { + "$ref" : "#/components/schemas/SyncPluginPath" + }, + "version" : { + "description" : "Version of the plugin", + "example" : "v1.2.3", "type" : "string" }, - "cancel_url" : { - "description" : "URL to redirect to after order cancellation", - "example" : "https://cloud.cloudquery.io/order-cancelled", + "tables" : { + "description" : "Tables to sync. Wildcards are supported. Note that child tables are excluded by default, and need to be explicitly specified.", + "items" : { + "type" : "string" + }, + "type" : "array" + }, + "skip_tables" : { + "description" : "Tables matched by `tables` that should be skipped. Wildcards are supported.", + "items" : { + "type" : "string" + }, + "type" : "array" + }, + "spec" : { + "additionalProperties" : false, + "format" : "Plugin parameters, specific to each plugin", + "type" : "object" + }, + "env" : { + "description" : "Environment variables for the plugin. All environment variables will be stored as secrets.", + "items" : { + "$ref" : "#/components/schemas/SyncEnvCreate" + }, + "type" : "array" + }, + "last_update_source" : { + "$ref" : "#/components/schemas/SyncLastUpdateSource" + }, + "connector_id" : { + "$ref" : "#/components/schemas/ConnectorID" + } + }, + "required" : [ "name", "path", "tables", "version" ], + "title" : "Sync Source definition for creating a new source" + }, + "SyncEnv" : { + "description" : "Environment variable. Environment variables are assumed to be secret.", + "properties" : { + "name" : { + "description" : "Name of the environment variable", "type" : "string" } }, - "required" : [ "cancel_url", "plan", "success_url" ], - "title" : "Create team subscription order" + "required" : [ "name" ] }, - "InvitationWithToken" : { - "additionalProperties" : false, + "SyncSource" : { "allOf" : [ { - "$ref" : "#/components/schemas/Invitation" + "$ref" : "#/components/schemas/SyncSourceCreate" }, { "properties" : { - "token" : { - "description" : "The token used to accept the invitation", - "format" : "uuid", + "created_at" : { + "description" : "Time when the source was created", + "example" : "2023-07-14T16:53:42Z", + "format" : "date-time", + "type" : "string" + }, + "updated_at" : { + "description" : "Time when the source was last updated", + "example" : "2023-07-14T16:53:42Z", + "format" : "date-time", "type" : "string" + }, + "env" : { + "description" : "Environment variables for the plugin.", + "items" : { + "$ref" : "#/components/schemas/SyncEnv" + }, + "type" : "array" + }, + "draft" : { + "description" : "If a sync source is in draft, it cannot be used in syncs. To get it out of draft, 'promote' it using a successful test connection ID.", + "type" : "boolean" } }, - "required" : [ "token" ] + "required" : [ "created_at", "draft", "env", "updated_at" ] } ] }, - "UserID" : { - "description" : "ID of the User", - "example" : "12345678-1234-1234-1234-1234567890ab", - "format" : "uuid", - "type" : "string", - "x-go-name" : "UserID" - }, - "APIKeyName" : { - "description" : "Name of the API key", - "example" : "cli-api-key", - "maxLength" : 255, - "minLength" : 1, - "pattern" : "^(?:[a-zA-Z0-9][a-zA-Z0-9- ]*)?[a-zA-Z0-9]$", + "SyncDestinationWriteMode" : { + "default" : "overwrite-delete-stale", + "description" : "Write mode for the destination", + "enum" : [ "append", "overwrite", "overwrite-delete-stale" ], "type" : "string" }, - "APIKeyID" : { - "description" : "ID of the API key", - "example" : "12345678-1234-1234-1234-1234567890ab", - "format" : "uuid", - "type" : "string", - "x-go-name" : "APIKeyID" - }, - "APIKeyScope" : { - "description" : "Scope of permissions for the API key. API keys are used for creating new plugin versions and downloading existing plugins", - "enum" : [ "read-and-write" ], + "SyncDestinationMigrateMode" : { + "default" : "safe", + "description" : "Migrate mode for the destination", + "enum" : [ "safe", "forced" ], "type" : "string" }, - "APIKey" : { - "description" : "API Key to interact with CloudQuery Cloud under specific team", + "SyncDestinationTestConnectionCreate" : { + "properties" : { + "path" : { + "$ref" : "#/components/schemas/SyncPluginPath" + }, + "destination_name" : { + "description" : "Name of an existing destination", + "type" : "string" + }, + "version" : { + "description" : "Version of the plugin", + "example" : "v1.2.3", + "type" : "string" + }, + "write_mode" : { + "$ref" : "#/components/schemas/SyncDestinationWriteMode" + }, + "migrate_mode" : { + "$ref" : "#/components/schemas/SyncDestinationMigrateMode" + }, + "spec" : { + "additionalProperties" : false, + "format" : "Plugin parameters, specific to each plugin", + "type" : "object" + }, + "env" : { + "description" : "Environment variables for the plugin. All environment variables will be stored as secrets.", + "items" : { + "$ref" : "#/components/schemas/SyncEnvCreate" + }, + "type" : "array" + }, + "connector_id" : { + "$ref" : "#/components/schemas/ConnectorID" + } + }, + "required" : [ "path", "version" ], + "title" : "Sync Destination Test Connection creation definition" + }, + "SyncDestinationTestConnection" : { "properties" : { - "name" : { - "$ref" : "#/components/schemas/APIKeyName" + "id" : { + "$ref" : "#/components/schemas/SyncTestConnectionID" }, - "created_by" : { - "description" : "email of the user that created the API key", - "example" : "user@example.com", - "type" : "string" + "status" : { + "$ref" : "#/components/schemas/SyncTestConnectionStatus" }, - "id" : { - "$ref" : "#/components/schemas/APIKeyID" + "failure_reason" : { + "description" : "Reason for failure", + "example" : "password authentication failed for user \"exampleuser\"", + "type" : "string" }, - "key" : { - "description" : "API key. Will be shown only in the response when creating the key.", - "example" : "1234567890abcdef1234567890abcdef", + "failure_code" : { + "description" : "Code for failure", + "example" : "INVALID_CREDENTIALS", "type" : "string" }, "created_at" : { + "description" : "Time the test connection was created", "example" : "2017-07-14T16:53:42Z", "format" : "date-time", "type" : "string" }, - "expires_at" : { - "description" : "Timestamp at which API key will stop working", + "completed_at" : { + "description" : "Time the test connection was completed", "example" : "2017-07-14T16:53:42Z", "format" : "date-time", "type" : "string" }, - "expired" : { - "description" : "Whether the API key has expired or not", - "example" : false, - "type" : "boolean" - }, - "scope" : { - "$ref" : "#/components/schemas/APIKeyScope" - } - }, - "required" : [ "expired", "expires_at", "id", "name", "scope" ] - }, - "RegistryAuthToken" : { - "additionalProperties" : false, - "description" : "JWT token for the image registry", - "properties" : { - "access_token" : { - "type" : "string" + "plugin_path" : { + "$ref" : "#/components/schemas/SyncPluginPath" }, - "token" : { - "type" : "string" - } - }, - "required" : [ "access_token", "token" ] - }, - "DockerError" : { - "additionalProperties" : false, - "description" : "Error Returned from the Docker Authorization Handler to the Docker Registry", - "properties" : { - "details" : { - "type" : "string" + "plugin_version" : { + "$ref" : "#/components/schemas/VersionName" } }, - "required" : [ "details" ], - "title" : "Docker Error" + "required" : [ "created_at", "id", "status" ] }, - "SyncPluginPath" : { - "description" : "Plugin path in CloudQuery registry", - "pattern" : "^cloudquery/[^/]+", - "type" : "string" + "SyncDestinationTestConnectionID" : { + "description" : "ID of the Sync Destination Test Connection", + "example" : "12345678-1234-1234-1234-1234567890ab", + "format" : "uuid", + "type" : "string", + "x-go-name" : "SyncDestinationTestConnectionID" }, - "SyncEnvCreate" : { - "description" : "Environment variable. Environment variables are assumed to be secret.", + "PromoteSyncDestinationTestConnection" : { + "description" : "Sync Destination Definition", "properties" : { "name" : { - "description" : "Name of the environment variable", + "description" : "Descriptive, unique name for the destination. The name can only contain ASCII letters, digits, - and _.", + "example" : "my-destination-definition", + "pattern" : "^[a-zA-Z0-9_-]+$", "type" : "string" }, - "value" : { - "description" : "Value of the environment variable", - "type" : "string" + "write_mode" : { + "$ref" : "#/components/schemas/SyncDestinationWriteMode" + }, + "migrate_mode" : { + "$ref" : "#/components/schemas/SyncDestinationMigrateMode" } }, - "required" : [ "name" ] - }, - "SyncLastUpdateSource" : { - "description" : "How was the source or destination been created or updated last", - "enum" : [ "yaml", "ui" ], - "type" : "string" - }, - "ConnectorID" : { - "description" : "ID of the Connector", - "example" : "12345678-1234-1234-1234-1234567890ab", - "format" : "uuid", - "type" : "string", - "x-go-name" : "ConnectorID" + "required" : [ "name" ], + "title" : "Sync Destination definition for creating a new source" }, - "SyncSourceCreate" : { - "description" : "Sync Source Definition", + "SyncDestinationCreate" : { + "description" : "Sync Destination Definition", "properties" : { "name" : { - "description" : "Descriptive, unique name for the source. The name can only contain ASCII letters, digits, - and _.", - "example" : "my-source-definition", + "description" : "Descriptive, unique name for the destination. The name can only contain ASCII letters, digits, - and _.", + "example" : "my-destination-definition", "pattern" : "^[a-zA-Z0-9_-]+$", "type" : "string" }, @@ -8573,19 +9214,11 @@ "example" : "v1.2.3", "type" : "string" }, - "tables" : { - "description" : "Tables to sync. Wildcards are supported. Note that child tables are excluded by default, and need to be explicitly specified.", - "items" : { - "type" : "string" - }, - "type" : "array" + "write_mode" : { + "$ref" : "#/components/schemas/SyncDestinationWriteMode" }, - "skip_tables" : { - "description" : "Tables matched by `tables` that should be skipped. Wildcards are supported.", - "items" : { - "type" : "string" - }, - "type" : "array" + "migrate_mode" : { + "$ref" : "#/components/schemas/SyncDestinationMigrateMode" }, "spec" : { "additionalProperties" : false, @@ -8606,22 +9239,12 @@ "$ref" : "#/components/schemas/ConnectorID" } }, - "required" : [ "name", "path", "tables", "version" ], - "title" : "Sync Source definition for creating a new source" - }, - "SyncEnv" : { - "description" : "Environment variable. Environment variables are assumed to be secret.", - "properties" : { - "name" : { - "description" : "Name of the environment variable", - "type" : "string" - } - }, - "required" : [ "name" ] + "required" : [ "name", "path", "version" ], + "title" : "Sync Destination definition for creating a new destination" }, - "SyncSource" : { + "SyncDestination" : { "allOf" : [ { - "$ref" : "#/components/schemas/SyncSourceCreate" + "$ref" : "#/components/schemas/SyncDestinationCreate" }, { "properties" : { "created_at" : { @@ -8644,25 +9267,13 @@ "type" : "array" }, "draft" : { - "description" : "If a sync source is in draft, it cannot be used in syncs. To get it out of draft, 'promote' it using a successful test connection ID.", + "description" : "If a sync destination is in draft, it cannot be used in syncs. To get it out of draft, 'promote' it using a successful test connection ID.", "type" : "boolean" } }, "required" : [ "created_at", "draft", "env", "updated_at" ] } ] }, - "SyncTestConnectionID" : { - "description" : "unique ID of the test connection", - "example" : "12345678-1234-1234-1234-1234567890ab", - "format" : "uuid", - "type" : "string", - "x-go-name" : "ID" - }, - "SyncTestConnectionStatus" : { - "description" : "The status of the sync run", - "enum" : [ "completed", "failed", "started", "created" ], - "type" : "string" - }, "SyncTestConnection" : { "properties" : { "id" : { @@ -8780,95 +9391,6 @@ "required" : [ "path", "version" ], "title" : "Sync Test Connection creation definition" }, - "SyncDestinationWriteMode" : { - "default" : "overwrite-delete-stale", - "description" : "Write mode for the destination", - "enum" : [ "append", "overwrite", "overwrite-delete-stale" ], - "type" : "string" - }, - "SyncDestinationMigrateMode" : { - "default" : "safe", - "description" : "Migrate mode for the destination", - "enum" : [ "safe", "forced" ], - "type" : "string" - }, - "SyncDestinationCreate" : { - "description" : "Sync Destination Definition", - "properties" : { - "name" : { - "description" : "Descriptive, unique name for the destination. The name can only contain ASCII letters, digits, - and _.", - "example" : "my-destination-definition", - "pattern" : "^[a-zA-Z0-9_-]+$", - "type" : "string" - }, - "path" : { - "$ref" : "#/components/schemas/SyncPluginPath" - }, - "version" : { - "description" : "Version of the plugin", - "example" : "v1.2.3", - "type" : "string" - }, - "write_mode" : { - "$ref" : "#/components/schemas/SyncDestinationWriteMode" - }, - "migrate_mode" : { - "$ref" : "#/components/schemas/SyncDestinationMigrateMode" - }, - "spec" : { - "additionalProperties" : false, - "format" : "Plugin parameters, specific to each plugin", - "type" : "object" - }, - "env" : { - "description" : "Environment variables for the plugin. All environment variables will be stored as secrets.", - "items" : { - "$ref" : "#/components/schemas/SyncEnvCreate" - }, - "type" : "array" - }, - "last_update_source" : { - "$ref" : "#/components/schemas/SyncLastUpdateSource" - }, - "connector_id" : { - "$ref" : "#/components/schemas/ConnectorID" - } - }, - "required" : [ "name", "path", "version" ], - "title" : "Sync Destination definition for creating a new destination" - }, - "SyncDestination" : { - "allOf" : [ { - "$ref" : "#/components/schemas/SyncDestinationCreate" - }, { - "properties" : { - "created_at" : { - "description" : "Time when the source was created", - "example" : "2023-07-14T16:53:42Z", - "format" : "date-time", - "type" : "string" - }, - "updated_at" : { - "description" : "Time when the source was last updated", - "example" : "2023-07-14T16:53:42Z", - "format" : "date-time", - "type" : "string" - }, - "env" : { - "description" : "Environment variables for the plugin.", - "items" : { - "$ref" : "#/components/schemas/SyncEnv" - }, - "type" : "array" - }, - "draft" : { - "description" : "If a sync destination is in draft, it cannot be used in syncs. To get it out of draft, 'promote' it using a successful test connection ID.", - "type" : "boolean" - } - }, - "required" : [ "created_at", "draft", "env", "updated_at" ] - } ] - }, "SyncDestinationUpdate" : { "description" : "Sync Destination Update Definition", "properties" : { From d3077102422d6fb3a837719bc2514e3ea583477b Mon Sep 17 00:00:00 2001 From: CloudQuery Bot <102256036+cq-bot@users.noreply.github.com> Date: Thu, 18 Jul 2024 05:24:34 -0400 Subject: [PATCH 2/4] fix: Generate CloudQuery Go API Client from `spec.json` (#200) This PR was created by a scheduled workflow to generate the CloudQuery Go API Client from `spec.json` --- models.gen.go | 54 +++++++++++++++++---------------------------------- spec.json | 10 ++++------ 2 files changed, 22 insertions(+), 42 deletions(-) diff --git a/models.gen.go b/models.gen.go index e14346a..d608ab8 100644 --- a/models.gen.go +++ b/models.gen.go @@ -590,19 +590,16 @@ type ConnectorAuthFinishRequestAWS struct { // ConnectorAuthFinishRequestOAuth OAuth connector authentication request, filled in after the user has authenticated through OAuth type ConnectorAuthFinishRequestOAuth struct { - // AuthCode Auth code received from the OAuth provider - AuthCode interface{} `json:"auth_code"` - // BaseURL Base of the URL the callback url was constructed from BaseURL interface{} `json:"base_url"` // Env Environment variables used in the spec. - Env *interface{} `json:"env,omitempty"` - Spec *map[string]interface{} `json:"spec,omitempty"` + Env *interface{} `json:"env,omitempty"` - // State State value received from the OAuth provider - State *interface{} `json:"state,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` + // ReturnURL URL the user was redirected to (including new parameter values) after the OAuth flow is complete + ReturnURL interface{} `json:"return_url"` + Spec *map[string]interface{} `json:"spec,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` } // ConnectorAuthRequestAWS AWS connector authentication request to start the authentication process @@ -3396,14 +3393,6 @@ func (a *ConnectorAuthFinishRequestOAuth) UnmarshalJSON(b []byte) error { return err } - if raw, found := object["auth_code"]; found { - err = json.Unmarshal(raw, &a.AuthCode) - if err != nil { - return fmt.Errorf("error reading 'auth_code': %w", err) - } - delete(object, "auth_code") - } - if raw, found := object["base_url"]; found { err = json.Unmarshal(raw, &a.BaseURL) if err != nil { @@ -3420,20 +3409,20 @@ func (a *ConnectorAuthFinishRequestOAuth) UnmarshalJSON(b []byte) error { delete(object, "env") } - if raw, found := object["spec"]; found { - err = json.Unmarshal(raw, &a.Spec) + if raw, found := object["return_url"]; found { + err = json.Unmarshal(raw, &a.ReturnURL) if err != nil { - return fmt.Errorf("error reading 'spec': %w", err) + return fmt.Errorf("error reading 'return_url': %w", err) } - delete(object, "spec") + delete(object, "return_url") } - if raw, found := object["state"]; found { - err = json.Unmarshal(raw, &a.State) + if raw, found := object["spec"]; found { + err = json.Unmarshal(raw, &a.Spec) if err != nil { - return fmt.Errorf("error reading 'state': %w", err) + return fmt.Errorf("error reading 'spec': %w", err) } - delete(object, "state") + delete(object, "spec") } if len(object) != 0 { @@ -3455,11 +3444,6 @@ func (a ConnectorAuthFinishRequestOAuth) MarshalJSON() ([]byte, error) { var err error object := make(map[string]json.RawMessage) - object["auth_code"], err = json.Marshal(a.AuthCode) - if err != nil { - return nil, fmt.Errorf("error marshaling 'auth_code': %w", err) - } - object["base_url"], err = json.Marshal(a.BaseURL) if err != nil { return nil, fmt.Errorf("error marshaling 'base_url': %w", err) @@ -3472,6 +3456,11 @@ func (a ConnectorAuthFinishRequestOAuth) MarshalJSON() ([]byte, error) { } } + object["return_url"], err = json.Marshal(a.ReturnURL) + if err != nil { + return nil, fmt.Errorf("error marshaling 'return_url': %w", err) + } + if a.Spec != nil { object["spec"], err = json.Marshal(a.Spec) if err != nil { @@ -3479,13 +3468,6 @@ func (a ConnectorAuthFinishRequestOAuth) MarshalJSON() ([]byte, error) { } } - if a.State != nil { - object["state"], err = json.Marshal(a.State) - if err != nil { - return nil, fmt.Errorf("error marshaling 'state': %w", err) - } - } - for fieldName, field := range a.AdditionalProperties { object[fieldName], err = json.Marshal(field) if err != nil { diff --git a/spec.json b/spec.json index 2725fe4..aaff1e4 100644 --- a/spec.json +++ b/spec.json @@ -10047,17 +10047,15 @@ "additionalProperties" : { }, "description" : "OAuth connector authentication request, filled in after the user has authenticated through OAuth", "properties" : { - "auth_code" : { - "description" : "Auth code received from the OAuth provider" + "return_url" : { + "description" : "URL the user was redirected to (including new parameter values) after the OAuth flow is complete", + "x-go-name" : "ReturnURL" }, "base_url" : { "description" : "Base of the URL the callback url was constructed from", "example" : "https://cloud.cloudquery.io/oauth", "x-go-name" : "BaseURL" }, - "state" : { - "description" : "State value received from the OAuth provider" - }, "spec" : { "additionalProperties" : false, "format" : "Plugin parameters, specific to each plugin", @@ -10070,7 +10068,7 @@ } } }, - "required" : [ "auth_code", "base_url" ] + "required" : [ "base_url", "return_url" ] }, "ListPluginNotificationRequests_200_response" : { "properties" : { From a2c07e196f223af9336298619195e3d335e6984e Mon Sep 17 00:00:00 2001 From: CloudQuery Bot <102256036+cq-bot@users.noreply.github.com> Date: Fri, 19 Jul 2024 04:34:40 -0400 Subject: [PATCH 3/4] fix: Generate CloudQuery Go API Client from `spec.json` (#201) This PR was created by a scheduled workflow to generate the CloudQuery Go API Client from `spec.json` --- models.gen.go | 28 +--------------------------- spec.json | 46 ---------------------------------------------- 2 files changed, 1 insertion(+), 73 deletions(-) diff --git a/models.gen.go b/models.gen.go index d608ab8..4b57412 100644 --- a/models.gen.go +++ b/models.gen.go @@ -2096,25 +2096,12 @@ type SyncDestinationTestConnectionID = openapi_types.UUID // SyncDestinationUpdate Sync Destination Update Definition type SyncDestinationUpdate struct { - // ConnectorID ID of the Connector - ConnectorID *ConnectorID `json:"connector_id,omitempty"` - - // Env Environment variables for the plugin. All environment variables will be stored as secrets. - Env *[]SyncEnvCreate `json:"env,omitempty"` - // LastUpdateSource How was the source or destination been created or updated last LastUpdateSource *SyncLastUpdateSource `json:"last_update_source,omitempty"` // MigrateMode Migrate mode for the destination MigrateMode *SyncDestinationMigrateMode `json:"migrate_mode,omitempty"` - // Path Plugin path in CloudQuery registry - Path *SyncPluginPath `json:"path,omitempty"` - Spec *map[string]interface{} `json:"spec,omitempty"` - - // Version Version of the plugin - Version *string `json:"version,omitempty"` - // WriteMode Write mode for the destination WriteMode *SyncDestinationWriteMode `json:"write_mode,omitempty"` } @@ -2364,27 +2351,14 @@ type SyncSourceTestConnectionID = openapi_types.UUID // SyncSourceUpdate Sync Source Update Definition type SyncSourceUpdate struct { - // ConnectorID ID of the Connector - ConnectorID *ConnectorID `json:"connector_id,omitempty"` - - // Env Environment variables for the plugin. All environment variables will be stored as secrets. - Env *[]SyncEnvCreate `json:"env,omitempty"` - // LastUpdateSource How was the source or destination been created or updated last LastUpdateSource *SyncLastUpdateSource `json:"last_update_source,omitempty"` - // Path Plugin path in CloudQuery registry - Path *SyncPluginPath `json:"path,omitempty"` - // SkipTables Tables matched by `tables` that should be skipped. Wildcards are supported. - SkipTables *[]string `json:"skip_tables,omitempty"` - Spec *map[string]interface{} `json:"spec,omitempty"` + SkipTables *[]string `json:"skip_tables,omitempty"` // Tables Tables to sync. Wildcards are supported. Note that child tables are excluded by default, and need to be explicitly specified. Tables *[]string `json:"tables,omitempty"` - - // Version Version of the plugin - Version *string `json:"version,omitempty"` } // SyncSourceUpdateFromTestConnection Sync Source Update from Test Connection Definition diff --git a/spec.json b/spec.json index aaff1e4..d2a444c 100644 --- a/spec.json +++ b/spec.json @@ -9319,14 +9319,6 @@ "SyncSourceUpdate" : { "description" : "Sync Source Update Definition", "properties" : { - "path" : { - "$ref" : "#/components/schemas/SyncPluginPath" - }, - "version" : { - "description" : "Version of the plugin", - "example" : "v1.2.3", - "type" : "string" - }, "tables" : { "description" : "Tables to sync. Wildcards are supported. Note that child tables are excluded by default, and need to be explicitly specified.", "items" : { @@ -9341,23 +9333,8 @@ }, "type" : "array" }, - "spec" : { - "additionalProperties" : false, - "format" : "Plugin parameters, specific to each plugin", - "type" : "object" - }, - "env" : { - "description" : "Environment variables for the plugin. All environment variables will be stored as secrets.", - "items" : { - "$ref" : "#/components/schemas/SyncEnvCreate" - }, - "type" : "array" - }, "last_update_source" : { "$ref" : "#/components/schemas/SyncLastUpdateSource" - }, - "connector_id" : { - "$ref" : "#/components/schemas/ConnectorID" } }, "title" : "Sync Source definition for updating a source" @@ -9394,37 +9371,14 @@ "SyncDestinationUpdate" : { "description" : "Sync Destination Update Definition", "properties" : { - "path" : { - "$ref" : "#/components/schemas/SyncPluginPath" - }, - "version" : { - "description" : "Version of the plugin", - "example" : "v1.2.3", - "type" : "string" - }, "write_mode" : { "$ref" : "#/components/schemas/SyncDestinationWriteMode" }, "migrate_mode" : { "$ref" : "#/components/schemas/SyncDestinationMigrateMode" }, - "spec" : { - "additionalProperties" : false, - "format" : "Plugin parameters, specific to each plugin", - "type" : "object" - }, - "env" : { - "description" : "Environment variables for the plugin. All environment variables will be stored as secrets.", - "items" : { - "$ref" : "#/components/schemas/SyncEnvCreate" - }, - "type" : "array" - }, "last_update_source" : { "$ref" : "#/components/schemas/SyncLastUpdateSource" - }, - "connector_id" : { - "$ref" : "#/components/schemas/ConnectorID" } }, "title" : "Sync Destination definition for updating a destination" From 1e442017426ca71e68703d5c4956c836307150ba Mon Sep 17 00:00:00 2001 From: CloudQuery Bot <102256036+cq-bot@users.noreply.github.com> Date: Fri, 19 Jul 2024 05:18:32 -0400 Subject: [PATCH 4/4] chore(main): Release v1.12.3 (#199) --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98c0058..790d678 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [1.12.3](https://github.com/cloudquery/cloudquery-api-go/compare/v1.12.2...v1.12.3) (2024-07-19) + + +### Bug Fixes + +* Generate CloudQuery Go API Client from `spec.json` ([#198](https://github.com/cloudquery/cloudquery-api-go/issues/198)) ([7045185](https://github.com/cloudquery/cloudquery-api-go/commit/7045185d92d7590880a563cf6c61112216cdbfaf)) +* Generate CloudQuery Go API Client from `spec.json` ([#200](https://github.com/cloudquery/cloudquery-api-go/issues/200)) ([d307710](https://github.com/cloudquery/cloudquery-api-go/commit/d3077102422d6fb3a837719bc2514e3ea583477b)) +* Generate CloudQuery Go API Client from `spec.json` ([#201](https://github.com/cloudquery/cloudquery-api-go/issues/201)) ([a2c07e1](https://github.com/cloudquery/cloudquery-api-go/commit/a2c07e196f223af9336298619195e3d335e6984e)) + ## [1.12.2](https://github.com/cloudquery/cloudquery-api-go/compare/v1.12.1...v1.12.2) (2024-07-17)