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) 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..4b57412 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 @@ -1813,6 +1810,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,26 +2039,68 @@ type SyncDestinationCreateFromTestConnection struct { // SyncDestinationMigrateMode Migrate mode for the destination type SyncDestinationMigrateMode string -// SyncDestinationUpdate Sync Destination Update Definition -type SyncDestinationUpdate struct { +// 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"` - // 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"` + Path SyncPluginPath `json:"path"` Spec *map[string]interface{} `json:"spec,omitempty"` // Version Version of the plugin - Version *string `json:"version,omitempty"` + 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 { + // 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"` // WriteMode Write mode for the destination WriteMode *SyncDestinationWriteMode `json:"write_mode,omitempty"` @@ -2237,29 +2300,65 @@ type SyncSourceCreateFromTestConnection struct { Tables []string `json:"tables"` } -// SyncSourceUpdate Sync Source Update Definition -type SyncSourceUpdate struct { +// 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 { // 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 @@ -3174,6 +3273,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 +3291,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 @@ -3256,14 +3367,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 { @@ -3280,20 +3383,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 { @@ -3315,11 +3418,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) @@ -3332,6 +3430,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 { @@ -3339,13 +3442,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 1ef5d9c..d2a444c 100644 --- a/spec.json +++ b/spec.json @@ -3857,6 +3857,296 @@ "tags" : [ "registry" ] } }, + "/teams/{team_name}/sync-source-test-connections" : { + "post" : { + "description" : "Create a test source connection.", + "operationId" : "CreateSyncSourceTestConnection", + "parameters" : [ { + "$ref" : "#/components/parameters/team_name" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SyncSourceTestConnectionCreate" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SyncSourceTestConnection" + } + } + }, + "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-source-test-connections/{sync_source_test_connection_id}" : { + "get" : { + "description" : "Get a sync source test connection.", + "operationId" : "GetSyncSourceTestConnection", + "parameters" : [ { + "$ref" : "#/components/parameters/team_name" + }, { + "$ref" : "#/components/parameters/sync_source_test_connection_id" + } ], + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SyncSourceTestConnection" + } + } + }, + "description" : "Response" + }, + "401" : { + "$ref" : "#/components/responses/RequiresAuthentication" + }, + "403" : { + "$ref" : "#/components/responses/Forbidden" + }, + "404" : { + "$ref" : "#/components/responses/NotFound" + }, + "500" : { + "$ref" : "#/components/responses/InternalError" + } + }, + "tags" : [ "syncs" ] + } + }, + "/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_test_connection_id" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PromoteSyncSourceTestConnection" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SyncSource" + } + } + }, + "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" + }, + "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-destination-test-connections" : { + "post" : { + "description" : "Create a test destination connection.", + "operationId" : "CreateSyncDestinationTestConnection", + "parameters" : [ { + "$ref" : "#/components/parameters/team_name" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SyncDestinationTestConnectionCreate" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SyncDestinationTestConnection" + } + } + }, + "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-destination-test-connections/{sync_destination_test_connection_id}" : { + "get" : { + "description" : "Get a sync destination test connection.", + "operationId" : "GetSyncDestinationTestConnection", + "parameters" : [ { + "$ref" : "#/components/parameters/team_name" + }, { + "$ref" : "#/components/parameters/sync_destination_test_connection_id" + } ], + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SyncDestinationTestConnection" + } + } + }, + "description" : "Response" + }, + "401" : { + "$ref" : "#/components/responses/RequiresAuthentication" + }, + "403" : { + "$ref" : "#/components/responses/Forbidden" + }, + "404" : { + "$ref" : "#/components/responses/NotFound" + }, + "500" : { + "$ref" : "#/components/responses/InternalError" + } + }, + "tags" : [ "syncs" ] + } + }, + "/teams/{team_name}/sync-destination-test-connections/{sync_destination_test_connection_id}/promote" : { + "post" : { + "description" : "Promote a sync destination test connection to a sync destination.", + "operationId" : "PromoteSyncDestinationTestConnection", + "parameters" : [ { + "$ref" : "#/components/parameters/team_name" + }, { + "$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/SyncDestination" + } + } + }, + "description" : "Successful response indicating that an existing sync destination was replaced." + }, + "201" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SyncDestination" + } + } + }, + "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" : { "get" : { "description" : "List all sync source definitions.", @@ -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", @@ -8542,20 +8854,138 @@ "type" : "string" } }, - "required" : [ "name" ] + "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" : [ "path", "version" ], + "title" : "Sync Source Test Connection creation definition" + }, + "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" + }, + "SyncSourceTestConnection" : { + "properties" : { + "id" : { + "$ref" : "#/components/schemas/SyncTestConnectionID" + }, + "status" : { + "$ref" : "#/components/schemas/SyncTestConnectionStatus" + }, + "failure_reason" : { + "description" : "Reason for failure", + "example" : "password authentication failed for user \"exampleuser\"", + "type" : "string" + }, + "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" + }, + "completed_at" : { + "description" : "Time the test connection was completed", + "example" : "2017-07-14T16:53:42Z", + "format" : "date-time", + "type" : "string" + }, + "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" + }, + "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" : [ "name", "tables" ], + "title" : "Sync Source definition for creating a new source" }, "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" - }, "SyncSourceCreate" : { "description" : "Sync Source Definition", "properties" : { @@ -8651,19 +9081,58 @@ "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" + "SyncDestinationWriteMode" : { + "default" : "overwrite-delete-stale", + "description" : "Write mode for the destination", + "enum" : [ "append", "overwrite", "overwrite-delete-stale" ], + "type" : "string" }, - "SyncTestConnectionStatus" : { - "description" : "The status of the sync run", - "enum" : [ "completed", "failed", "started", "created" ], + "SyncDestinationMigrateMode" : { + "default" : "safe", + "description" : "Migrate mode for the destination", + "enum" : [ "safe", "forced" ], "type" : "string" }, - "SyncTestConnection" : { + "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" : { "id" : { "$ref" : "#/components/schemas/SyncTestConnectionID" @@ -8698,99 +9167,35 @@ }, "plugin_version" : { "$ref" : "#/components/schemas/VersionName" - }, - "plugin_kind" : { - "$ref" : "#/components/schemas/PluginKind" } }, "required" : [ "created_at", "id", "status" ] }, - "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" : { - "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" - } - }, - "title" : "Sync Source definition for updating a source" + "SyncDestinationTestConnectionID" : { + "description" : "ID of the Sync Destination Test Connection", + "example" : "12345678-1234-1234-1234-1234567890ab", + "format" : "uuid", + "type" : "string", + "x-go-name" : "SyncDestinationTestConnectionID" }, - "SyncTestConnectionCreate" : { + "PromoteSyncDestinationTestConnection" : { + "description" : "Sync Destination Definition", "properties" : { - "path" : { - "$ref" : "#/components/schemas/SyncPluginPath" - }, - "version" : { - "description" : "Version of the plugin", - "example" : "v1.2.3", + "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" }, - "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" + "write_mode" : { + "$ref" : "#/components/schemas/SyncDestinationWriteMode" }, - "connector_id" : { - "$ref" : "#/components/schemas/ConnectorID" + "migrate_mode" : { + "$ref" : "#/components/schemas/SyncDestinationMigrateMode" } }, - "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" + "required" : [ "name" ], + "title" : "Sync Destination definition for creating a new source" }, "SyncDestinationCreate" : { "description" : "Sync Destination Definition", @@ -8869,8 +9274,72 @@ "required" : [ "created_at", "draft", "env", "updated_at" ] } ] }, - "SyncDestinationUpdate" : { - "description" : "Sync Destination Update Definition", + "SyncTestConnection" : { + "properties" : { + "id" : { + "$ref" : "#/components/schemas/SyncTestConnectionID" + }, + "status" : { + "$ref" : "#/components/schemas/SyncTestConnectionStatus" + }, + "failure_reason" : { + "description" : "Reason for failure", + "example" : "password authentication failed for user \"exampleuser\"", + "type" : "string" + }, + "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" + }, + "completed_at" : { + "description" : "Time the test connection was completed", + "example" : "2017-07-14T16:53:42Z", + "format" : "date-time", + "type" : "string" + }, + "plugin_path" : { + "$ref" : "#/components/schemas/SyncPluginPath" + }, + "plugin_version" : { + "$ref" : "#/components/schemas/VersionName" + }, + "plugin_kind" : { + "$ref" : "#/components/schemas/PluginKind" + } + }, + "required" : [ "created_at", "id", "status" ] + }, + "SyncSourceUpdate" : { + "description" : "Sync Source Update Definition", + "properties" : { + "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" + }, + "last_update_source" : { + "$ref" : "#/components/schemas/SyncLastUpdateSource" + } + }, + "title" : "Sync Source definition for updating a source" + }, + "SyncTestConnectionCreate" : { "properties" : { "path" : { "$ref" : "#/components/schemas/SyncPluginPath" @@ -8880,12 +9349,6 @@ "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", @@ -8898,13 +9361,26 @@ }, "type" : "array" }, - "last_update_source" : { - "$ref" : "#/components/schemas/SyncLastUpdateSource" - }, "connector_id" : { "$ref" : "#/components/schemas/ConnectorID" } }, + "required" : [ "path", "version" ], + "title" : "Sync Test Connection creation definition" + }, + "SyncDestinationUpdate" : { + "description" : "Sync Destination Update Definition", + "properties" : { + "write_mode" : { + "$ref" : "#/components/schemas/SyncDestinationWriteMode" + }, + "migrate_mode" : { + "$ref" : "#/components/schemas/SyncDestinationMigrateMode" + }, + "last_update_source" : { + "$ref" : "#/components/schemas/SyncLastUpdateSource" + } + }, "title" : "Sync Destination definition for updating a destination" }, "Sync" : { @@ -9525,17 +10001,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", @@ -9548,7 +10022,7 @@ } } }, - "required" : [ "auth_code", "base_url" ] + "required" : [ "base_url", "return_url" ] }, "ListPluginNotificationRequests_200_response" : { "properties" : {