From 09080e2a92d830500994d08fefe2156e5ade2f85 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Fri, 17 Jan 2025 08:24:03 +0000 Subject: [PATCH 1/4] Generate mongodbflex --- services/mongodbflex/api_default.go | 127 ----------------------- services/mongodbflex/api_default_test.go | 46 -------- 2 files changed, 173 deletions(-) diff --git a/services/mongodbflex/api_default.go b/services/mongodbflex/api_default.go index 955bcd3c2..92a3934f8 100644 --- a/services/mongodbflex/api_default.go +++ b/services/mongodbflex/api_default.go @@ -803,133 +803,6 @@ func (a *APIClient) DeleteUserExecute(ctx context.Context, projectId string, ins return r.Execute() } -type ApiDisableServiceRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string -} - -func (r ApiDisableServiceRequest) Execute() error { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DisableService") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"*/*"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 409 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - } - return newErr - } - - return nil -} - -/* -DisableService: Delete project - -removes all instances inside project - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId project id - @return ApiDisableServiceRequest -*/ -func (a *APIClient) DisableService(ctx context.Context, projectId string) ApiDisableServiceRequest { - return ApiDisableServiceRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) DisableServiceExecute(ctx context.Context, projectId string) error { - r := ApiDisableServiceRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - type ApiGetBackupRequest struct { ctx context.Context apiService *DefaultApiService diff --git a/services/mongodbflex/api_default_test.go b/services/mongodbflex/api_default_test.go index 86e33b101..f84630f35 100644 --- a/services/mongodbflex/api_default_test.go +++ b/services/mongodbflex/api_default_test.go @@ -289,52 +289,6 @@ func Test_mongodbflex_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService DisableService", func(t *testing.T) { - path := "/v1/projects/{projectId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for mongodbflex_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := "projectId" - - reqErr := apiClient.DisableService(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - t.Run("Test DefaultApiService GetBackup", func(t *testing.T) { path := "/v1/projects/{projectId}/instances/{instanceId}/backups/{backupId}" projectIdValue := "projectId" From f657b46a7178b5509ec01c2a7f152b64d34bae6c Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Fri, 17 Jan 2025 08:24:13 +0000 Subject: [PATCH 2/4] Generate postgresflex --- services/postgresflex/api_default.go | 127 ---------------------- services/postgresflex/api_default_test.go | 46 -------- 2 files changed, 173 deletions(-) diff --git a/services/postgresflex/api_default.go b/services/postgresflex/api_default.go index 8b01ca2e8..64a30e22f 100644 --- a/services/postgresflex/api_default.go +++ b/services/postgresflex/api_default.go @@ -1003,133 +1003,6 @@ func (a *APIClient) DeleteUserExecute(ctx context.Context, projectId string, ins return r.Execute() } -type ApiDisableServiceRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string -} - -func (r ApiDisableServiceRequest) Execute() error { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DisableService") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - } - return newErr - } - - return nil -} - -/* -DisableService: Terminate the Project - -Termination is the deletion of a whole project which causes the deletion of all instances for this project. Only System with permission system.databases-project.remove is able to call this resource - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @return ApiDisableServiceRequest -*/ -func (a *APIClient) DisableService(ctx context.Context, projectId string) ApiDisableServiceRequest { - return ApiDisableServiceRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) DisableServiceExecute(ctx context.Context, projectId string) error { - r := ApiDisableServiceRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - type ApiForceDeleteInstanceRequest struct { ctx context.Context apiService *DefaultApiService diff --git a/services/postgresflex/api_default_test.go b/services/postgresflex/api_default_test.go index 6a24ae70f..583368d17 100644 --- a/services/postgresflex/api_default_test.go +++ b/services/postgresflex/api_default_test.go @@ -397,52 +397,6 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService DisableService", func(t *testing.T) { - path := "/v1/projects/{projectId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for postgresflex_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := "projectId" - - reqErr := apiClient.DisableService(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - t.Run("Test DefaultApiService ForceDeleteInstance", func(t *testing.T) { path := "/v1/projects/{projectId}/instances/{instanceId}/force" projectIdValue := "projectId" From 75e4889fc9e70348de3c7d59b070a034cc5410c1 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Thu, 16 Jan 2025 16:00:25 +0000 Subject: [PATCH 3/4] Generate sqlserverflex --- services/sqlserverflex/api_default.go | 116 --------------------- services/sqlserverflex/api_default_test.go | 46 -------- 2 files changed, 162 deletions(-) diff --git a/services/sqlserverflex/api_default.go b/services/sqlserverflex/api_default.go index 7a2cdb381..a7c6cd604 100644 --- a/services/sqlserverflex/api_default.go +++ b/services/sqlserverflex/api_default.go @@ -3209,122 +3209,6 @@ func (a *APIClient) ResetUserExecute(ctx context.Context, projectId string, inst return r.Execute() } -type ApiTerminateProjectRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string -} - -func (r ApiTerminateProjectRequest) Execute() error { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.TerminateProject") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 500 { - var v InstanceError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - } - return newErr - } - - return nil -} - -/* -TerminateProject: Terminate the Project - -Termination is the deletion of a whole project which causes the deletion of all instances for this project. Only System with permission system.databases-project.remove is able to call this resource - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @return ApiTerminateProjectRequest -*/ -func (a *APIClient) TerminateProject(ctx context.Context, projectId string) ApiTerminateProjectRequest { - return ApiTerminateProjectRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) TerminateProjectExecute(ctx context.Context, projectId string) error { - r := ApiTerminateProjectRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - type ApiTriggerDatabaseBackupRequest struct { ctx context.Context apiService *DefaultApiService diff --git a/services/sqlserverflex/api_default_test.go b/services/sqlserverflex/api_default_test.go index 13dbec41e..61cdb096d 100644 --- a/services/sqlserverflex/api_default_test.go +++ b/services/sqlserverflex/api_default_test.go @@ -1280,52 +1280,6 @@ func Test_sqlserverflex_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService TerminateProject", func(t *testing.T) { - path := "/v1/projects/{projectId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for sqlserverflex_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := "projectId" - - reqErr := apiClient.TerminateProject(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - t.Run("Test DefaultApiService TriggerDatabaseBackup", func(t *testing.T) { path := "/v1/projects/{projectId}/instances/{instanceId}/backups/databases/{databaseName}" projectIdValue := "projectId" From 6a152352404415b9bbb3f10ac0c1ca246a7b647a Mon Sep 17 00:00:00 2001 From: Alexander Dahmen Date: Mon, 20 Jan 2025 09:38:54 +0100 Subject: [PATCH 4/4] Adjust changelog Signed-off-by: Alexander Dahmen --- CHANGELOG.md | 6 ++++++ services/mongodbflex/CHANGELOG.md | 4 ++++ services/postgresflex/CHANGELOG.md | 3 +++ services/sqlserverflex/CHANGELOG.md | 4 ++++ 4 files changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e3a1d5a0..24cc399bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ ## Release (2025-XX-XX) +- `sqlserverflex`: [v0.9.0](services/sqlserverflex/CHANGELOG.md#v090-2025-01-20) + - **Breaking change**: Delete endpoint made private. +- `postgresflex`: [0.17.0](services/postgresflex/CHANGELOG.md#v0170-2025-01-20) + - **Breaking change**: Delete endpoint made private. +- `mongodbflex`: [v0.17.0](services/mongodbflex/CHANGELOG.md#v0170-2025-01-20) + - **Breaking change**: Delete endpoint made private. - `logme`: [v0.20.2](services/logme/CHANGELOG.md#v0202-2025-01-20) - **Bugfix:** Remove mistakenly implemented `syslog-use-udp`. Does not exist. - `authorization`: [v0.5.1](services/authorization/CHANGELOG.md#v051-2025-01-17) diff --git a/services/mongodbflex/CHANGELOG.md b/services/mongodbflex/CHANGELOG.md index 74d290023..2e3df80bb 100644 --- a/services/mongodbflex/CHANGELOG.md +++ b/services/mongodbflex/CHANGELOG.md @@ -1,3 +1,7 @@ +## v0.17.0 (2025-01-20) + +- **Breaking change**: Delete endpoint made private. + ## v0.16.1 (2024-12-17) - **Bugfix:** Correctly handle nullable attributes in model types diff --git a/services/postgresflex/CHANGELOG.md b/services/postgresflex/CHANGELOG.md index 43667b564..46942544b 100644 --- a/services/postgresflex/CHANGELOG.md +++ b/services/postgresflex/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.17.0 (2025-01-20) +- **Breaking change**: Delete endpoint made private. + ## v0.16.1 (2025-xx-yy) - **Bugfix:** Correctly handle nullable attributes in model types diff --git a/services/sqlserverflex/CHANGELOG.md b/services/sqlserverflex/CHANGELOG.md index 7d6dfbe84..4b2edeca4 100644 --- a/services/sqlserverflex/CHANGELOG.md +++ b/services/sqlserverflex/CHANGELOG.md @@ -1,3 +1,7 @@ +## v0.9.0 (2025-01-20) + +- **Breaking change**: Delete endpoint made private. + ## v0.8.1 (2024-12-17) - **Bugfix:** Correctly handle nullable attributes in model types