diff --git a/pkg/api/client.gen.go b/pkg/api/client.gen.go index 46557d73f..bf73deb2a 100644 --- a/pkg/api/client.gen.go +++ b/pkg/api/client.gen.go @@ -178,6 +178,11 @@ type ClientInterface interface { // V1GetProject request V1GetProject(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1UpdateAProjectWithBody request with any body + V1UpdateAProjectWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + V1UpdateAProject(ctx context.Context, ref string, body V1UpdateAProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1ListActionRuns request V1ListActionRuns(ctx context.Context, ref string, params *V1ListActionRunsParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -459,6 +464,11 @@ type ClientInterface interface { V1PatchAMigration(ctx context.Context, ref string, version string, body V1PatchAMigrationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1UpdateDatabasePasswordWithBody request with any body + V1UpdateDatabasePasswordWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + V1UpdateDatabasePassword(ctx context.Context, ref string, body V1UpdateDatabasePasswordJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1RunAQueryWithBody request with any body V1RunAQueryWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -1018,6 +1028,30 @@ func (c *Client) V1GetProject(ctx context.Context, ref string, reqEditors ...Req return c.Client.Do(req) } +func (c *Client) V1UpdateAProjectWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1UpdateAProjectRequestWithBody(c.Server, ref, 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) V1UpdateAProject(ctx context.Context, ref string, body V1UpdateAProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1UpdateAProjectRequest(c.Server, ref, 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) V1ListActionRuns(ctx context.Context, ref string, params *V1ListActionRunsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewV1ListActionRunsRequest(c.Server, ref, params) if err != nil { @@ -2232,6 +2266,30 @@ func (c *Client) V1PatchAMigration(ctx context.Context, ref string, version stri return c.Client.Do(req) } +func (c *Client) V1UpdateDatabasePasswordWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1UpdateDatabasePasswordRequestWithBody(c.Server, ref, 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) V1UpdateDatabasePassword(ctx context.Context, ref string, body V1UpdateDatabasePasswordJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1UpdateDatabasePasswordRequest(c.Server, ref, 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) V1RunAQueryWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewV1RunAQueryRequestWithBody(c.Server, ref, contentType, body) if err != nil { @@ -4323,6 +4381,53 @@ func NewV1GetProjectRequest(server string, ref string) (*http.Request, error) { return req, nil } +// NewV1UpdateAProjectRequest calls the generic V1UpdateAProject builder with application/json body +func NewV1UpdateAProjectRequest(server string, ref string, body V1UpdateAProjectJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewV1UpdateAProjectRequestWithBody(server, ref, "application/json", bodyReader) +} + +// NewV1UpdateAProjectRequestWithBody generates requests for V1UpdateAProject with any type of body +func NewV1UpdateAProjectRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PATCH", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + // NewV1ListActionRunsRequest generates requests for V1ListActionRuns func NewV1ListActionRunsRequest(server string, ref string, params *V1ListActionRunsParams) (*http.Request, error) { var err error @@ -7784,6 +7889,53 @@ func NewV1PatchAMigrationRequestWithBody(server string, ref string, version stri return req, nil } +// NewV1UpdateDatabasePasswordRequest calls the generic V1UpdateDatabasePassword builder with application/json body +func NewV1UpdateDatabasePasswordRequest(server string, ref string, body V1UpdateDatabasePasswordJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewV1UpdateDatabasePasswordRequestWithBody(server, ref, "application/json", bodyReader) +} + +// NewV1UpdateDatabasePasswordRequestWithBody generates requests for V1UpdateDatabasePassword with any type of body +func NewV1UpdateDatabasePasswordRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/database/password", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PATCH", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + // NewV1RunAQueryRequest calls the generic V1RunAQuery builder with application/json body func NewV1RunAQueryRequest(server string, ref string, body V1RunAQueryJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader @@ -10174,6 +10326,11 @@ type ClientWithResponsesInterface interface { // V1GetProjectWithResponse request V1GetProjectWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetProjectResponse, error) + // V1UpdateAProjectWithBodyWithResponse request with any body + V1UpdateAProjectWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpdateAProjectResponse, error) + + V1UpdateAProjectWithResponse(ctx context.Context, ref string, body V1UpdateAProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdateAProjectResponse, error) + // V1ListActionRunsWithResponse request V1ListActionRunsWithResponse(ctx context.Context, ref string, params *V1ListActionRunsParams, reqEditors ...RequestEditorFn) (*V1ListActionRunsResponse, error) @@ -10455,6 +10612,11 @@ type ClientWithResponsesInterface interface { V1PatchAMigrationWithResponse(ctx context.Context, ref string, version string, body V1PatchAMigrationJSONRequestBody, reqEditors ...RequestEditorFn) (*V1PatchAMigrationResponse, error) + // V1UpdateDatabasePasswordWithBodyWithResponse request with any body + V1UpdateDatabasePasswordWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpdateDatabasePasswordResponse, error) + + V1UpdateDatabasePasswordWithResponse(ctx context.Context, ref string, body V1UpdateDatabasePasswordJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdateDatabasePasswordResponse, error) + // V1RunAQueryWithBodyWithResponse request with any body V1RunAQueryWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1RunAQueryResponse, error) @@ -11153,6 +11315,28 @@ func (r V1GetProjectResponse) StatusCode() int { return 0 } +type V1UpdateAProjectResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *V1ProjectRefResponse +} + +// Status returns HTTPResponse.Status +func (r V1UpdateAProjectResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1UpdateAProjectResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type V1ListActionRunsResponse struct { Body []byte HTTPResponse *http.Response @@ -12832,6 +13016,28 @@ func (r V1PatchAMigrationResponse) StatusCode() int { return 0 } +type V1UpdateDatabasePasswordResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *V1UpdatePasswordResponse +} + +// Status returns HTTPResponse.Status +func (r V1UpdateDatabasePasswordResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1UpdateDatabasePasswordResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type V1RunAQueryResponse struct { Body []byte HTTPResponse *http.Response @@ -14110,6 +14316,23 @@ func (c *ClientWithResponses) V1GetProjectWithResponse(ctx context.Context, ref return ParseV1GetProjectResponse(rsp) } +// V1UpdateAProjectWithBodyWithResponse request with arbitrary body returning *V1UpdateAProjectResponse +func (c *ClientWithResponses) V1UpdateAProjectWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpdateAProjectResponse, error) { + rsp, err := c.V1UpdateAProjectWithBody(ctx, ref, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1UpdateAProjectResponse(rsp) +} + +func (c *ClientWithResponses) V1UpdateAProjectWithResponse(ctx context.Context, ref string, body V1UpdateAProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdateAProjectResponse, error) { + rsp, err := c.V1UpdateAProject(ctx, ref, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1UpdateAProjectResponse(rsp) +} + // V1ListActionRunsWithResponse request returning *V1ListActionRunsResponse func (c *ClientWithResponses) V1ListActionRunsWithResponse(ctx context.Context, ref string, params *V1ListActionRunsParams, reqEditors ...RequestEditorFn) (*V1ListActionRunsResponse, error) { rsp, err := c.V1ListActionRuns(ctx, ref, params, reqEditors...) @@ -14997,6 +15220,23 @@ func (c *ClientWithResponses) V1PatchAMigrationWithResponse(ctx context.Context, return ParseV1PatchAMigrationResponse(rsp) } +// V1UpdateDatabasePasswordWithBodyWithResponse request with arbitrary body returning *V1UpdateDatabasePasswordResponse +func (c *ClientWithResponses) V1UpdateDatabasePasswordWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpdateDatabasePasswordResponse, error) { + rsp, err := c.V1UpdateDatabasePasswordWithBody(ctx, ref, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1UpdateDatabasePasswordResponse(rsp) +} + +func (c *ClientWithResponses) V1UpdateDatabasePasswordWithResponse(ctx context.Context, ref string, body V1UpdateDatabasePasswordJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdateDatabasePasswordResponse, error) { + rsp, err := c.V1UpdateDatabasePassword(ctx, ref, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1UpdateDatabasePasswordResponse(rsp) +} + // V1RunAQueryWithBodyWithResponse request with arbitrary body returning *V1RunAQueryResponse func (c *ClientWithResponses) V1RunAQueryWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1RunAQueryResponse, error) { rsp, err := c.V1RunAQueryWithBody(ctx, ref, contentType, body, reqEditors...) @@ -16129,6 +16369,32 @@ func ParseV1GetProjectResponse(rsp *http.Response) (*V1GetProjectResponse, error return response, nil } +// ParseV1UpdateAProjectResponse parses an HTTP response from a V1UpdateAProjectWithResponse call +func ParseV1UpdateAProjectResponse(rsp *http.Response) (*V1UpdateAProjectResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1UpdateAProjectResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest V1ProjectRefResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + // ParseV1ListActionRunsResponse parses an HTTP response from a V1ListActionRunsWithResponse call func ParseV1ListActionRunsResponse(rsp *http.Response) (*V1ListActionRunsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) @@ -17981,6 +18247,32 @@ func ParseV1PatchAMigrationResponse(rsp *http.Response) (*V1PatchAMigrationRespo return response, nil } +// ParseV1UpdateDatabasePasswordResponse parses an HTTP response from a V1UpdateDatabasePasswordWithResponse call +func ParseV1UpdateDatabasePasswordResponse(rsp *http.Response) (*V1UpdateDatabasePasswordResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1UpdateDatabasePasswordResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest V1UpdatePasswordResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + // ParseV1RunAQueryResponse parses an HTTP response from a V1RunAQueryWithResponse call func ParseV1RunAQueryResponse(rsp *http.Response) (*V1RunAQueryResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index 807a266ce..27402ad64 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -4318,6 +4318,16 @@ type V1UpdateFunctionBody struct { VerifyJwt *bool `json:"verify_jwt,omitempty"` } +// V1UpdatePasswordBody defines model for V1UpdatePasswordBody. +type V1UpdatePasswordBody struct { + Password string `json:"password"` +} + +// V1UpdatePasswordResponse defines model for V1UpdatePasswordResponse. +type V1UpdatePasswordResponse struct { + Message string `json:"message"` +} + // V1UpdatePostgrestConfigBody defines model for V1UpdatePostgrestConfigBody. type V1UpdatePostgrestConfigBody struct { DbExtraSearchPath *string `json:"db_extra_search_path,omitempty"` @@ -4326,6 +4336,11 @@ type V1UpdatePostgrestConfigBody struct { MaxRows *int `json:"max_rows,omitempty"` } +// V1UpdateProjectBody defines model for V1UpdateProjectBody. +type V1UpdateProjectBody struct { + Name string `json:"name"` +} + // V1UpsertMigrationBody defines model for V1UpsertMigrationBody. type V1UpsertMigrationBody struct { Name *string `json:"name,omitempty"` @@ -4653,6 +4668,9 @@ type V1CreateAnOrganizationJSONRequestBody = CreateOrganizationV1 // V1CreateAProjectJSONRequestBody defines body for V1CreateAProject for application/json ContentType. type V1CreateAProjectJSONRequestBody = V1CreateProjectBody +// V1UpdateAProjectJSONRequestBody defines body for V1UpdateAProject for application/json ContentType. +type V1UpdateAProjectJSONRequestBody = V1UpdateProjectBody + // V1UpdateActionRunStatusJSONRequestBody defines body for V1UpdateActionRunStatus for application/json ContentType. type V1UpdateActionRunStatusJSONRequestBody = UpdateRunStatusBody @@ -4725,6 +4743,9 @@ type V1UpsertAMigrationJSONRequestBody = V1UpsertMigrationBody // V1PatchAMigrationJSONRequestBody defines body for V1PatchAMigration for application/json ContentType. type V1PatchAMigrationJSONRequestBody = V1PatchMigrationBody +// V1UpdateDatabasePasswordJSONRequestBody defines body for V1UpdateDatabasePassword for application/json ContentType. +type V1UpdateDatabasePasswordJSONRequestBody = V1UpdatePasswordBody + // V1RunAQueryJSONRequestBody defines body for V1RunAQuery for application/json ContentType. type V1RunAQueryJSONRequestBody = V1RunQueryBody