diff --git a/core/oapierror/oapierror.go b/core/oapierror/oapierror.go index cb0ca71a..c40770f5 100644 --- a/core/oapierror/oapierror.go +++ b/core/oapierror/oapierror.go @@ -1,4 +1,4 @@ -package oapiError +package oapierror import ( "fmt" diff --git a/core/wait/wait.go b/core/wait/wait.go index 57fcde38..5c02e002 100644 --- a/core/wait/wait.go +++ b/core/wait/wait.go @@ -6,7 +6,7 @@ import ( "net/http" "time" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/core/utils" ) @@ -96,7 +96,7 @@ func (w *Handler) WaitWithContext(ctx context.Context) (res interface{}, err err } func (w *Handler) handleError(retryTempErrorCounter int, err error) (int, error) { - oapiErr, ok := err.(*oapiError.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if !ok { return retryTempErrorCounter, fmt.Errorf("could not convert error to GenericOpenApiError, %w", err) } diff --git a/core/wait/wait_test.go b/core/wait/wait_test.go index d6a11c6e..98c0f4d3 100644 --- a/core/wait/wait_test.go +++ b/core/wait/wait_test.go @@ -8,7 +8,7 @@ import ( "time" "github.com/google/go-cmp/cmp" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" ) func TestNew(t *testing.T) { @@ -195,7 +195,7 @@ func TestHandleError(t *testing.T) { }{ { desc: "handle_oapi_error", - reqErr: &oapiError.GenericOpenAPIError{ + reqErr: &oapierror.GenericOpenAPIError{ StatusCode: http.StatusInternalServerError, }, tempErrRetryLimit: 5, @@ -209,7 +209,7 @@ func TestHandleError(t *testing.T) { }, { desc: "bad_gateway_error", - reqErr: &oapiError.GenericOpenAPIError{ + reqErr: &oapierror.GenericOpenAPIError{ StatusCode: http.StatusBadGateway, }, tempErrRetryLimit: 5, @@ -217,7 +217,7 @@ func TestHandleError(t *testing.T) { }, { desc: "gateway_timeout_error", - reqErr: &oapiError.GenericOpenAPIError{ + reqErr: &oapierror.GenericOpenAPIError{ StatusCode: http.StatusBadGateway, }, tempErrRetryLimit: 5, @@ -225,7 +225,7 @@ func TestHandleError(t *testing.T) { }, { desc: "temp_error_retry_limit_reached", - reqErr: &oapiError.GenericOpenAPIError{ + reqErr: &oapierror.GenericOpenAPIError{ StatusCode: http.StatusBadGateway, }, tempErrRetryLimit: 1, diff --git a/services/argus/api_default.go b/services/argus/api_default.go index b531ec80..b92aae8d 100644 --- a/services/argus/api_default.go +++ b/services/argus/api_default.go @@ -19,7 +19,7 @@ import ( "net/url" "strings" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" ) // DefaultApiService DefaultApi service @@ -42,7 +42,7 @@ func (r ApiCreateCredentialRequest) Execute() (*ApiUserProjectCreated, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateCredential") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" @@ -88,7 +88,7 @@ func (r ApiCreateCredentialRequest) Execute() (*ApiUserProjectCreated, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -100,7 +100,7 @@ func (r ApiCreateCredentialRequest) Execute() (*ApiUserProjectCreated, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -108,7 +108,7 @@ func (r ApiCreateCredentialRequest) Execute() (*ApiUserProjectCreated, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -170,7 +170,7 @@ func (r ApiCreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateInstance") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances" @@ -220,7 +220,7 @@ func (r ApiCreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -232,7 +232,7 @@ func (r ApiCreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -243,7 +243,7 @@ func (r ApiCreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -251,7 +251,7 @@ func (r ApiCreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -311,7 +311,7 @@ func (r ApiCreateInstanceAlertConfigReceiverRequest) Execute() (*ReceiversRespon a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateInstanceAlertConfigReceiver") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers" @@ -362,7 +362,7 @@ func (r ApiCreateInstanceAlertConfigReceiverRequest) Execute() (*ReceiversRespon } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -374,7 +374,7 @@ func (r ApiCreateInstanceAlertConfigReceiverRequest) Execute() (*ReceiversRespon newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -385,7 +385,7 @@ func (r ApiCreateInstanceAlertConfigReceiverRequest) Execute() (*ReceiversRespon newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -393,7 +393,7 @@ func (r ApiCreateInstanceAlertConfigReceiverRequest) Execute() (*ReceiversRespon err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -456,7 +456,7 @@ func (r ApiCreateInstanceAlertConfigRouteRequest) Execute() (*RouteResponse, err a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateInstanceAlertConfigRoute") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes" @@ -507,7 +507,7 @@ func (r ApiCreateInstanceAlertConfigRouteRequest) Execute() (*RouteResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -519,7 +519,7 @@ func (r ApiCreateInstanceAlertConfigRouteRequest) Execute() (*RouteResponse, err newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -530,7 +530,7 @@ func (r ApiCreateInstanceAlertConfigRouteRequest) Execute() (*RouteResponse, err newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -538,7 +538,7 @@ func (r ApiCreateInstanceAlertConfigRouteRequest) Execute() (*RouteResponse, err err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -601,7 +601,7 @@ func (r ApiCreateScrapeConfigRequest) Execute() (*ScrapeConfigsResponse, error) a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateScrapeConfig") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs" @@ -652,7 +652,7 @@ func (r ApiCreateScrapeConfigRequest) Execute() (*ScrapeConfigsResponse, error) } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -664,7 +664,7 @@ func (r ApiCreateScrapeConfigRequest) Execute() (*ScrapeConfigsResponse, error) newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -675,7 +675,7 @@ func (r ApiCreateScrapeConfigRequest) Execute() (*ScrapeConfigsResponse, error) newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -683,7 +683,7 @@ func (r ApiCreateScrapeConfigRequest) Execute() (*ScrapeConfigsResponse, error) err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -741,7 +741,7 @@ func (r ApiDeleteCredentialRequest) Execute() (*Message, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteCredential") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}" @@ -788,7 +788,7 @@ func (r ApiDeleteCredentialRequest) Execute() (*Message, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -800,7 +800,7 @@ func (r ApiDeleteCredentialRequest) Execute() (*Message, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -811,7 +811,7 @@ func (r ApiDeleteCredentialRequest) Execute() (*Message, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -822,7 +822,7 @@ func (r ApiDeleteCredentialRequest) Execute() (*Message, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -830,7 +830,7 @@ func (r ApiDeleteCredentialRequest) Execute() (*Message, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -891,7 +891,7 @@ func (r ApiDeleteCredentialRemoteWriteConfigRequest) Execute() (*CredentialsRemo a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteCredentialRemoteWriteConfig") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}/remote-write-limits" @@ -938,7 +938,7 @@ func (r ApiDeleteCredentialRemoteWriteConfigRequest) Execute() (*CredentialsRemo } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -950,7 +950,7 @@ func (r ApiDeleteCredentialRemoteWriteConfigRequest) Execute() (*CredentialsRemo newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -961,7 +961,7 @@ func (r ApiDeleteCredentialRemoteWriteConfigRequest) Execute() (*CredentialsRemo newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -972,7 +972,7 @@ func (r ApiDeleteCredentialRemoteWriteConfigRequest) Execute() (*CredentialsRemo newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -983,7 +983,7 @@ func (r ApiDeleteCredentialRemoteWriteConfigRequest) Execute() (*CredentialsRemo newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -991,7 +991,7 @@ func (r ApiDeleteCredentialRemoteWriteConfigRequest) Execute() (*CredentialsRemo err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1051,7 +1051,7 @@ func (r ApiDeleteInstanceRequest) Execute() (*ProjectInstancesUpdateResponse, er a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteInstance") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -1097,7 +1097,7 @@ func (r ApiDeleteInstanceRequest) Execute() (*ProjectInstancesUpdateResponse, er } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1109,7 +1109,7 @@ func (r ApiDeleteInstanceRequest) Execute() (*ProjectInstancesUpdateResponse, er newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -1117,7 +1117,7 @@ func (r ApiDeleteInstanceRequest) Execute() (*ProjectInstancesUpdateResponse, er err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1175,7 +1175,7 @@ func (r ApiDeleteInstanceAlertConfigReceiverRequest) Execute() (*ReceiversRespon a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteInstanceAlertConfigReceiver") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers/{receiver}" @@ -1222,7 +1222,7 @@ func (r ApiDeleteInstanceAlertConfigReceiverRequest) Execute() (*ReceiversRespon } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1234,7 +1234,7 @@ func (r ApiDeleteInstanceAlertConfigReceiverRequest) Execute() (*ReceiversRespon newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1245,7 +1245,7 @@ func (r ApiDeleteInstanceAlertConfigReceiverRequest) Execute() (*ReceiversRespon newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -1253,7 +1253,7 @@ func (r ApiDeleteInstanceAlertConfigReceiverRequest) Execute() (*ReceiversRespon err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1314,7 +1314,7 @@ func (r ApiDeleteInstanceAlertConfigRouteReceiverRequest) Execute() (*RouteRespo a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteInstanceAlertConfigRouteReceiver") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes/{receiver}" @@ -1361,7 +1361,7 @@ func (r ApiDeleteInstanceAlertConfigRouteReceiverRequest) Execute() (*RouteRespo } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1373,7 +1373,7 @@ func (r ApiDeleteInstanceAlertConfigRouteReceiverRequest) Execute() (*RouteRespo newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1384,7 +1384,7 @@ func (r ApiDeleteInstanceAlertConfigRouteReceiverRequest) Execute() (*RouteRespo newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -1392,7 +1392,7 @@ func (r ApiDeleteInstanceAlertConfigRouteReceiverRequest) Execute() (*RouteRespo err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1453,7 +1453,7 @@ func (r ApiDeleteScrapeConfigRequest) Execute() (*ScrapeConfigsResponse, error) a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteScrapeConfig") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs/{jobName}" @@ -1500,7 +1500,7 @@ func (r ApiDeleteScrapeConfigRequest) Execute() (*ScrapeConfigsResponse, error) } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1512,7 +1512,7 @@ func (r ApiDeleteScrapeConfigRequest) Execute() (*ScrapeConfigsResponse, error) newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1523,7 +1523,7 @@ func (r ApiDeleteScrapeConfigRequest) Execute() (*ScrapeConfigsResponse, error) newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -1531,7 +1531,7 @@ func (r ApiDeleteScrapeConfigRequest) Execute() (*ScrapeConfigsResponse, error) err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1592,7 +1592,7 @@ func (r ApiGetCredentialRequest) Execute() (*ServiceKeysResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCredential") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}" @@ -1639,7 +1639,7 @@ func (r ApiGetCredentialRequest) Execute() (*ServiceKeysResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1651,7 +1651,7 @@ func (r ApiGetCredentialRequest) Execute() (*ServiceKeysResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1662,7 +1662,7 @@ func (r ApiGetCredentialRequest) Execute() (*ServiceKeysResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -1670,7 +1670,7 @@ func (r ApiGetCredentialRequest) Execute() (*ServiceKeysResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1731,7 +1731,7 @@ func (r ApiGetCredentialRemoteWriteConfigRequest) Execute() (*CredentialsRemoteW a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCredentialRemoteWriteConfig") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}/remote-write-limits" @@ -1778,7 +1778,7 @@ func (r ApiGetCredentialRemoteWriteConfigRequest) Execute() (*CredentialsRemoteW } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1790,7 +1790,7 @@ func (r ApiGetCredentialRemoteWriteConfigRequest) Execute() (*CredentialsRemoteW newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1801,7 +1801,7 @@ func (r ApiGetCredentialRemoteWriteConfigRequest) Execute() (*CredentialsRemoteW newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1812,7 +1812,7 @@ func (r ApiGetCredentialRemoteWriteConfigRequest) Execute() (*CredentialsRemoteW newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -1820,7 +1820,7 @@ func (r ApiGetCredentialRemoteWriteConfigRequest) Execute() (*CredentialsRemoteW err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1880,7 +1880,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsListResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCredentials") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" @@ -1926,7 +1926,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsListResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1938,7 +1938,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsListResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -1946,7 +1946,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsListResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -2003,7 +2003,7 @@ func (r ApiGetInstanceRequest) Execute() (*InstanceResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstance") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -2049,7 +2049,7 @@ func (r ApiGetInstanceRequest) Execute() (*InstanceResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -2061,7 +2061,7 @@ func (r ApiGetInstanceRequest) Execute() (*InstanceResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -2069,7 +2069,7 @@ func (r ApiGetInstanceRequest) Execute() (*InstanceResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -2126,7 +2126,7 @@ func (r ApiGetInstanceAclRequest) Execute() (*AclResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstanceAcl") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/acl" @@ -2172,7 +2172,7 @@ func (r ApiGetInstanceAclRequest) Execute() (*AclResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -2184,7 +2184,7 @@ func (r ApiGetInstanceAclRequest) Execute() (*AclResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -2192,7 +2192,7 @@ func (r ApiGetInstanceAclRequest) Execute() (*AclResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -2250,7 +2250,7 @@ func (r ApiGetInstanceAlertConfigReceiverRequest) Execute() (*ReceiversResponseS a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstanceAlertConfigReceiver") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers/{receiver}" @@ -2297,7 +2297,7 @@ func (r ApiGetInstanceAlertConfigReceiverRequest) Execute() (*ReceiversResponseS } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -2309,7 +2309,7 @@ func (r ApiGetInstanceAlertConfigReceiverRequest) Execute() (*ReceiversResponseS newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -2320,7 +2320,7 @@ func (r ApiGetInstanceAlertConfigReceiverRequest) Execute() (*ReceiversResponseS newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -2328,7 +2328,7 @@ func (r ApiGetInstanceAlertConfigReceiverRequest) Execute() (*ReceiversResponseS err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -2388,7 +2388,7 @@ func (r ApiGetInstanceAlertConfigReceiversRequest) Execute() (*ReceiversResponse a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstanceAlertConfigReceivers") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers" @@ -2434,7 +2434,7 @@ func (r ApiGetInstanceAlertConfigReceiversRequest) Execute() (*ReceiversResponse } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -2446,7 +2446,7 @@ func (r ApiGetInstanceAlertConfigReceiversRequest) Execute() (*ReceiversResponse newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -2454,7 +2454,7 @@ func (r ApiGetInstanceAlertConfigReceiversRequest) Execute() (*ReceiversResponse err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -2512,7 +2512,7 @@ func (r ApiGetInstanceAlertConfigRouteReceiverRequest) Execute() (*RouteResponse a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstanceAlertConfigRouteReceiver") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes/{receiver}" @@ -2559,7 +2559,7 @@ func (r ApiGetInstanceAlertConfigRouteReceiverRequest) Execute() (*RouteResponse } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -2571,7 +2571,7 @@ func (r ApiGetInstanceAlertConfigRouteReceiverRequest) Execute() (*RouteResponse newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -2579,7 +2579,7 @@ func (r ApiGetInstanceAlertConfigRouteReceiverRequest) Execute() (*RouteResponse err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -2639,7 +2639,7 @@ func (r ApiGetInstanceAlertConfigRoutesRequest) Execute() (*RouteResponse, error a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstanceAlertConfigRoutes") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes" @@ -2685,7 +2685,7 @@ func (r ApiGetInstanceAlertConfigRoutesRequest) Execute() (*RouteResponse, error } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -2697,7 +2697,7 @@ func (r ApiGetInstanceAlertConfigRoutesRequest) Execute() (*RouteResponse, error newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -2705,7 +2705,7 @@ func (r ApiGetInstanceAlertConfigRoutesRequest) Execute() (*RouteResponse, error err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -2762,7 +2762,7 @@ func (r ApiGetInstanceAlertConfigsRequest) Execute() (*GetAlert, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstanceAlertConfigs") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs" @@ -2808,7 +2808,7 @@ func (r ApiGetInstanceAlertConfigsRequest) Execute() (*GetAlert, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -2820,7 +2820,7 @@ func (r ApiGetInstanceAlertConfigsRequest) Execute() (*GetAlert, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -2828,7 +2828,7 @@ func (r ApiGetInstanceAlertConfigsRequest) Execute() (*GetAlert, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -2885,7 +2885,7 @@ func (r ApiGetInstanceGrafanaConfigsRequest) Execute() (*GrafanaConfigs, error) a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstanceGrafanaConfigs") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/grafana-configs" @@ -2931,7 +2931,7 @@ func (r ApiGetInstanceGrafanaConfigsRequest) Execute() (*GrafanaConfigs, error) } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -2943,7 +2943,7 @@ func (r ApiGetInstanceGrafanaConfigsRequest) Execute() (*GrafanaConfigs, error) newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -2951,7 +2951,7 @@ func (r ApiGetInstanceGrafanaConfigsRequest) Execute() (*GrafanaConfigs, error) err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -3007,7 +3007,7 @@ func (r ApiGetInstancesRequest) Execute() (*ProjectInstanceFullMany, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstances") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances" @@ -3052,7 +3052,7 @@ func (r ApiGetInstancesRequest) Execute() (*ProjectInstanceFullMany, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -3064,7 +3064,7 @@ func (r ApiGetInstancesRequest) Execute() (*ProjectInstanceFullMany, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -3072,7 +3072,7 @@ func (r ApiGetInstancesRequest) Execute() (*ProjectInstanceFullMany, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -3125,7 +3125,7 @@ func (r ApiGetPlansRequest) Execute() (*PlansResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPlans") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/plans" @@ -3170,7 +3170,7 @@ func (r ApiGetPlansRequest) Execute() (*PlansResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -3182,7 +3182,7 @@ func (r ApiGetPlansRequest) Execute() (*PlansResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -3190,7 +3190,7 @@ func (r ApiGetPlansRequest) Execute() (*PlansResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -3245,7 +3245,7 @@ func (r ApiGetScrapeConfigRequest) Execute() (*ScrapeConfigResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetScrapeConfig") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs/{jobName}" @@ -3292,7 +3292,7 @@ func (r ApiGetScrapeConfigRequest) Execute() (*ScrapeConfigResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -3304,7 +3304,7 @@ func (r ApiGetScrapeConfigRequest) Execute() (*ScrapeConfigResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -3312,7 +3312,7 @@ func (r ApiGetScrapeConfigRequest) Execute() (*ScrapeConfigResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -3372,7 +3372,7 @@ func (r ApiGetScrapeConfigsRequest) Execute() (*ScrapeConfigsResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetScrapeConfigs") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs" @@ -3418,7 +3418,7 @@ func (r ApiGetScrapeConfigsRequest) Execute() (*ScrapeConfigsResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -3430,7 +3430,7 @@ func (r ApiGetScrapeConfigsRequest) Execute() (*ScrapeConfigsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -3438,7 +3438,7 @@ func (r ApiGetScrapeConfigsRequest) Execute() (*ScrapeConfigsResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -3502,7 +3502,7 @@ func (r ApiUpdateCredentialRemoteWriteConfigRequest) Execute() (*CredentialsRemo a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateCredentialRemoteWriteConfig") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}/remote-write-limits" @@ -3554,7 +3554,7 @@ func (r ApiUpdateCredentialRemoteWriteConfigRequest) Execute() (*CredentialsRemo } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -3566,7 +3566,7 @@ func (r ApiUpdateCredentialRemoteWriteConfigRequest) Execute() (*CredentialsRemo newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -3577,7 +3577,7 @@ func (r ApiUpdateCredentialRemoteWriteConfigRequest) Execute() (*CredentialsRemo newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -3588,7 +3588,7 @@ func (r ApiUpdateCredentialRemoteWriteConfigRequest) Execute() (*CredentialsRemo newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -3599,7 +3599,7 @@ func (r ApiUpdateCredentialRemoteWriteConfigRequest) Execute() (*CredentialsRemo newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -3607,7 +3607,7 @@ func (r ApiUpdateCredentialRemoteWriteConfigRequest) Execute() (*CredentialsRemo err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -3673,7 +3673,7 @@ func (r ApiUpdateInstanceRequest) Execute() (*ProjectInstancesUpdateResponse, er a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateInstance") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -3724,7 +3724,7 @@ func (r ApiUpdateInstanceRequest) Execute() (*ProjectInstancesUpdateResponse, er } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -3736,7 +3736,7 @@ func (r ApiUpdateInstanceRequest) Execute() (*ProjectInstancesUpdateResponse, er newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -3747,7 +3747,7 @@ func (r ApiUpdateInstanceRequest) Execute() (*ProjectInstancesUpdateResponse, er newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -3755,7 +3755,7 @@ func (r ApiUpdateInstanceRequest) Execute() (*ProjectInstancesUpdateResponse, er err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -3818,7 +3818,7 @@ func (r ApiUpdateInstanceAclRequest) Execute() (*Message, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateInstanceAcl") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/acl" @@ -3866,7 +3866,7 @@ func (r ApiUpdateInstanceAclRequest) Execute() (*Message, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -3878,7 +3878,7 @@ func (r ApiUpdateInstanceAclRequest) Execute() (*Message, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -3889,7 +3889,7 @@ func (r ApiUpdateInstanceAclRequest) Execute() (*Message, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -3897,7 +3897,7 @@ func (r ApiUpdateInstanceAclRequest) Execute() (*Message, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -3961,7 +3961,7 @@ func (r ApiUpdateInstanceAlertConfigReceiverRequest) Execute() (*ReceiversRespon a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateInstanceAlertConfigReceiver") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers/{receiver}" @@ -4013,7 +4013,7 @@ func (r ApiUpdateInstanceAlertConfigReceiverRequest) Execute() (*ReceiversRespon } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -4025,7 +4025,7 @@ func (r ApiUpdateInstanceAlertConfigReceiverRequest) Execute() (*ReceiversRespon newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -4036,7 +4036,7 @@ func (r ApiUpdateInstanceAlertConfigReceiverRequest) Execute() (*ReceiversRespon newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -4047,7 +4047,7 @@ func (r ApiUpdateInstanceAlertConfigReceiverRequest) Execute() (*ReceiversRespon newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -4055,7 +4055,7 @@ func (r ApiUpdateInstanceAlertConfigReceiverRequest) Execute() (*ReceiversRespon err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -4122,7 +4122,7 @@ func (r ApiUpdateInstanceAlertConfigRouteReceiverRequest) Execute() (*RouteRespo a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateInstanceAlertConfigRouteReceiver") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes/{receiver}" @@ -4174,7 +4174,7 @@ func (r ApiUpdateInstanceAlertConfigRouteReceiverRequest) Execute() (*RouteRespo } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -4186,7 +4186,7 @@ func (r ApiUpdateInstanceAlertConfigRouteReceiverRequest) Execute() (*RouteRespo newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -4197,7 +4197,7 @@ func (r ApiUpdateInstanceAlertConfigRouteReceiverRequest) Execute() (*RouteRespo newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -4208,7 +4208,7 @@ func (r ApiUpdateInstanceAlertConfigRouteReceiverRequest) Execute() (*RouteRespo newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -4216,7 +4216,7 @@ func (r ApiUpdateInstanceAlertConfigRouteReceiverRequest) Execute() (*RouteRespo err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -4282,7 +4282,7 @@ func (r ApiUpdateInstanceAlertConfigsRequest) Execute() (*PutAlert, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateInstanceAlertConfigs") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/alertconfigs" @@ -4333,7 +4333,7 @@ func (r ApiUpdateInstanceAlertConfigsRequest) Execute() (*PutAlert, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -4345,7 +4345,7 @@ func (r ApiUpdateInstanceAlertConfigsRequest) Execute() (*PutAlert, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -4356,7 +4356,7 @@ func (r ApiUpdateInstanceAlertConfigsRequest) Execute() (*PutAlert, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -4364,7 +4364,7 @@ func (r ApiUpdateInstanceAlertConfigsRequest) Execute() (*PutAlert, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -4427,7 +4427,7 @@ func (r ApiUpdateInstanceGrafanaConfigsRequest) Execute() (*Message, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateInstanceGrafanaConfigs") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/grafana-configs" @@ -4478,7 +4478,7 @@ func (r ApiUpdateInstanceGrafanaConfigsRequest) Execute() (*Message, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -4490,7 +4490,7 @@ func (r ApiUpdateInstanceGrafanaConfigsRequest) Execute() (*Message, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -4501,7 +4501,7 @@ func (r ApiUpdateInstanceGrafanaConfigsRequest) Execute() (*Message, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -4509,7 +4509,7 @@ func (r ApiUpdateInstanceGrafanaConfigsRequest) Execute() (*Message, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -4573,7 +4573,7 @@ func (r ApiUpdateScrapeConfigRequest) Execute() (*ScrapeConfigsResponse, error) a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateScrapeConfig") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs/{jobName}" @@ -4625,7 +4625,7 @@ func (r ApiUpdateScrapeConfigRequest) Execute() (*ScrapeConfigsResponse, error) } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -4637,7 +4637,7 @@ func (r ApiUpdateScrapeConfigRequest) Execute() (*ScrapeConfigsResponse, error) newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -4648,7 +4648,7 @@ func (r ApiUpdateScrapeConfigRequest) Execute() (*ScrapeConfigsResponse, error) newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -4659,7 +4659,7 @@ func (r ApiUpdateScrapeConfigRequest) Execute() (*ScrapeConfigsResponse, error) newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -4667,7 +4667,7 @@ func (r ApiUpdateScrapeConfigRequest) Execute() (*ScrapeConfigsResponse, error) err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), diff --git a/services/argus/wait/wait_test.go b/services/argus/wait/wait_test.go index 91e7e837..ee73b437 100644 --- a/services/argus/wait/wait_test.go +++ b/services/argus/wait/wait_test.go @@ -7,7 +7,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/core/utils" "github.com/stackitcloud/stackit-sdk-go/services/argus" ) @@ -20,7 +20,7 @@ type apiClientMocked struct { func (a *apiClientMocked) GetInstanceExecute(_ context.Context, _, _ string) (*argus.InstanceResponse, error) { if a.getFails { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 500, } } @@ -33,7 +33,7 @@ func (a *apiClientMocked) GetInstanceExecute(_ context.Context, _, _ string) (*a func (a *apiClientMocked) GetScrapeConfigsExecute(_ context.Context, _, _ string) (*argus.ScrapeConfigsResponse, error) { if a.getFails { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 500, } } diff --git a/services/dns/api_default.go b/services/dns/api_default.go index 19b4ece0..366e4f84 100644 --- a/services/dns/api_default.go +++ b/services/dns/api_default.go @@ -19,7 +19,7 @@ import ( "net/url" "strings" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" ) // DefaultApiService DefaultApi service @@ -50,7 +50,7 @@ func (r ApiCreateRecordSetRequest) Execute() (*RecordSetResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateRecordSet") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/zones/{zoneId}/rrsets" @@ -101,7 +101,7 @@ func (r ApiCreateRecordSetRequest) Execute() (*RecordSetResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -113,7 +113,7 @@ func (r ApiCreateRecordSetRequest) Execute() (*RecordSetResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -124,7 +124,7 @@ func (r ApiCreateRecordSetRequest) Execute() (*RecordSetResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -135,7 +135,7 @@ func (r ApiCreateRecordSetRequest) Execute() (*RecordSetResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -146,7 +146,7 @@ func (r ApiCreateRecordSetRequest) Execute() (*RecordSetResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -154,7 +154,7 @@ func (r ApiCreateRecordSetRequest) Execute() (*RecordSetResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -218,7 +218,7 @@ func (r ApiCreateZoneRequest) Execute() (*ZoneResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateZone") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/zones" @@ -268,7 +268,7 @@ func (r ApiCreateZoneRequest) Execute() (*ZoneResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -280,7 +280,7 @@ func (r ApiCreateZoneRequest) Execute() (*ZoneResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -291,7 +291,7 @@ func (r ApiCreateZoneRequest) Execute() (*ZoneResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -302,7 +302,7 @@ func (r ApiCreateZoneRequest) Execute() (*ZoneResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -313,7 +313,7 @@ func (r ApiCreateZoneRequest) Execute() (*ZoneResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -321,7 +321,7 @@ func (r ApiCreateZoneRequest) Execute() (*ZoneResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -376,7 +376,7 @@ func (r ApiDeleteRecordSetRequest) Execute() (*Message, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteRecordSet") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/zones/{zoneId}/rrsets/{rrSetId}" @@ -423,7 +423,7 @@ func (r ApiDeleteRecordSetRequest) Execute() (*Message, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -435,7 +435,7 @@ func (r ApiDeleteRecordSetRequest) Execute() (*Message, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -446,7 +446,7 @@ func (r ApiDeleteRecordSetRequest) Execute() (*Message, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -457,7 +457,7 @@ func (r ApiDeleteRecordSetRequest) Execute() (*Message, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -465,7 +465,7 @@ func (r ApiDeleteRecordSetRequest) Execute() (*Message, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -525,7 +525,7 @@ func (r ApiDeleteZoneRequest) Execute() (*Message, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteZone") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/zones/{zoneId}" @@ -571,7 +571,7 @@ func (r ApiDeleteZoneRequest) Execute() (*Message, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -583,7 +583,7 @@ func (r ApiDeleteZoneRequest) Execute() (*Message, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -594,7 +594,7 @@ func (r ApiDeleteZoneRequest) Execute() (*Message, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -605,7 +605,7 @@ func (r ApiDeleteZoneRequest) Execute() (*Message, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -613,7 +613,7 @@ func (r ApiDeleteZoneRequest) Execute() (*Message, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -671,7 +671,7 @@ func (r ApiGetRecordSetRequest) Execute() (*RecordSetResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetRecordSet") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/zones/{zoneId}/rrsets/{rrSetId}" @@ -718,7 +718,7 @@ func (r ApiGetRecordSetRequest) Execute() (*RecordSetResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -730,7 +730,7 @@ func (r ApiGetRecordSetRequest) Execute() (*RecordSetResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -741,7 +741,7 @@ func (r ApiGetRecordSetRequest) Execute() (*RecordSetResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -749,7 +749,7 @@ func (r ApiGetRecordSetRequest) Execute() (*RecordSetResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1065,7 +1065,7 @@ func (r ApiGetRecordSetsRequest) Execute() (*RecordSetsResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetRecordSets") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/zones/{zoneId}/rrsets" @@ -1207,7 +1207,7 @@ func (r ApiGetRecordSetsRequest) Execute() (*RecordSetsResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1219,7 +1219,7 @@ func (r ApiGetRecordSetsRequest) Execute() (*RecordSetsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1230,7 +1230,7 @@ func (r ApiGetRecordSetsRequest) Execute() (*RecordSetsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -1238,7 +1238,7 @@ func (r ApiGetRecordSetsRequest) Execute() (*RecordSetsResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1295,7 +1295,7 @@ func (r ApiGetZoneRequest) Execute() (*ZoneResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetZone") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/zones/{zoneId}" @@ -1341,7 +1341,7 @@ func (r ApiGetZoneRequest) Execute() (*ZoneResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1353,7 +1353,7 @@ func (r ApiGetZoneRequest) Execute() (*ZoneResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1364,7 +1364,7 @@ func (r ApiGetZoneRequest) Execute() (*ZoneResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -1372,7 +1372,7 @@ func (r ApiGetZoneRequest) Execute() (*ZoneResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1764,7 +1764,7 @@ func (r ApiGetZonesRequest) Execute() (*ZonesResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetZones") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/zones" @@ -1935,7 +1935,7 @@ func (r ApiGetZonesRequest) Execute() (*ZonesResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1947,7 +1947,7 @@ func (r ApiGetZonesRequest) Execute() (*ZonesResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1958,7 +1958,7 @@ func (r ApiGetZonesRequest) Execute() (*ZonesResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -1966,7 +1966,7 @@ func (r ApiGetZonesRequest) Execute() (*ZonesResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -2029,7 +2029,7 @@ func (r ApiUpdateRecordRequest) Execute() (*Message, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateRecord") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/zones/{zoneId}/rrsets/{rrSetId}/records" @@ -2081,7 +2081,7 @@ func (r ApiUpdateRecordRequest) Execute() (*Message, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -2093,7 +2093,7 @@ func (r ApiUpdateRecordRequest) Execute() (*Message, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -2104,7 +2104,7 @@ func (r ApiUpdateRecordRequest) Execute() (*Message, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -2115,7 +2115,7 @@ func (r ApiUpdateRecordRequest) Execute() (*Message, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -2123,7 +2123,7 @@ func (r ApiUpdateRecordRequest) Execute() (*Message, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -2192,7 +2192,7 @@ func (r ApiUpdateRecordSetRequest) Execute() (*Message, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateRecordSet") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/zones/{zoneId}/rrsets/{rrSetId}" @@ -2244,7 +2244,7 @@ func (r ApiUpdateRecordSetRequest) Execute() (*Message, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -2256,7 +2256,7 @@ func (r ApiUpdateRecordSetRequest) Execute() (*Message, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -2267,7 +2267,7 @@ func (r ApiUpdateRecordSetRequest) Execute() (*Message, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -2278,7 +2278,7 @@ func (r ApiUpdateRecordSetRequest) Execute() (*Message, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -2286,7 +2286,7 @@ func (r ApiUpdateRecordSetRequest) Execute() (*Message, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -2354,7 +2354,7 @@ func (r ApiUpdateZoneRequest) Execute() (*ZoneResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateZone") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/zones/{zoneId}" @@ -2405,7 +2405,7 @@ func (r ApiUpdateZoneRequest) Execute() (*ZoneResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -2417,7 +2417,7 @@ func (r ApiUpdateZoneRequest) Execute() (*ZoneResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -2428,7 +2428,7 @@ func (r ApiUpdateZoneRequest) Execute() (*ZoneResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -2439,7 +2439,7 @@ func (r ApiUpdateZoneRequest) Execute() (*ZoneResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -2447,7 +2447,7 @@ func (r ApiUpdateZoneRequest) Execute() (*ZoneResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), diff --git a/services/dns/wait/wait_test.go b/services/dns/wait/wait_test.go index 2fe840ca..9d7329ed 100644 --- a/services/dns/wait/wait_test.go +++ b/services/dns/wait/wait_test.go @@ -6,7 +6,7 @@ import ( "time" "github.com/google/go-cmp/cmp" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/core/utils" "github.com/stackitcloud/stackit-sdk-go/services/dns" ) @@ -18,7 +18,7 @@ type apiClientMocked struct { func (a *apiClientMocked) GetZoneExecute(_ context.Context, _, _ string) (*dns.ZoneResponse, error) { if a.getFails { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 500, } } @@ -33,7 +33,7 @@ func (a *apiClientMocked) GetZoneExecute(_ context.Context, _, _ string) (*dns.Z func (a *apiClientMocked) GetRecordSetExecute(_ context.Context, _, _, _ string) (*dns.RecordSetResponse, error) { if a.getFails { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 500, } } diff --git a/services/loadbalancer/api_default.go b/services/loadbalancer/api_default.go index 760563c0..a761b5f3 100644 --- a/services/loadbalancer/api_default.go +++ b/services/loadbalancer/api_default.go @@ -19,7 +19,7 @@ import ( "net/url" "strings" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" ) // DefaultApiService DefaultApi service @@ -53,7 +53,7 @@ func (r ApiCreateLoadBalancerRequest) Execute() (*LoadBalancer, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateLoadBalancer") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1beta/projects/{projectId}/load-balancers" @@ -107,7 +107,7 @@ func (r ApiCreateLoadBalancerRequest) Execute() (*LoadBalancer, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -117,7 +117,7 @@ func (r ApiCreateLoadBalancerRequest) Execute() (*LoadBalancer, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -171,7 +171,7 @@ func (r ApiDeleteLoadBalancerRequest) Execute() (map[string]interface{}, error) a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteLoadBalancer") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1beta/projects/{projectId}/load-balancers/{name}" @@ -217,7 +217,7 @@ func (r ApiDeleteLoadBalancerRequest) Execute() (map[string]interface{}, error) } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -227,7 +227,7 @@ func (r ApiDeleteLoadBalancerRequest) Execute() (map[string]interface{}, error) err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -283,7 +283,7 @@ func (r ApiDisableLoadBalancingRequest) Execute() (map[string]interface{}, error a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DisableLoadBalancing") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1beta/projects/{projectId}" @@ -328,7 +328,7 @@ func (r ApiDisableLoadBalancingRequest) Execute() (map[string]interface{}, error } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -338,7 +338,7 @@ func (r ApiDisableLoadBalancingRequest) Execute() (map[string]interface{}, error err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -397,7 +397,7 @@ func (r ApiEnableLoadBalancingRequest) Execute() (map[string]interface{}, error) a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.EnableLoadBalancing") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1beta/projects/{projectId}" @@ -446,7 +446,7 @@ func (r ApiEnableLoadBalancingRequest) Execute() (map[string]interface{}, error) } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -456,7 +456,7 @@ func (r ApiEnableLoadBalancingRequest) Execute() (map[string]interface{}, error) err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -510,7 +510,7 @@ func (r ApiGetLoadBalancerRequest) Execute() (*LoadBalancer, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetLoadBalancer") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1beta/projects/{projectId}/load-balancers/{name}" @@ -556,7 +556,7 @@ func (r ApiGetLoadBalancerRequest) Execute() (*LoadBalancer, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -566,7 +566,7 @@ func (r ApiGetLoadBalancerRequest) Execute() (*LoadBalancer, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -622,7 +622,7 @@ func (r ApiGetStatusRequest) Execute() (*StatusResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetStatus") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1beta/projects/{projectId}" @@ -667,7 +667,7 @@ func (r ApiGetStatusRequest) Execute() (*StatusResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -677,7 +677,7 @@ func (r ApiGetStatusRequest) Execute() (*StatusResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -730,7 +730,7 @@ func (r ApiListLoadBalancersRequest) Execute() (*ListLoadBalancersResponse, erro a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListLoadBalancers") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1beta/projects/{projectId}/load-balancers" @@ -775,7 +775,7 @@ func (r ApiListLoadBalancersRequest) Execute() (*ListLoadBalancersResponse, erro } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -785,7 +785,7 @@ func (r ApiListLoadBalancersRequest) Execute() (*ListLoadBalancersResponse, erro err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -846,7 +846,7 @@ func (r ApiUpdateTargetPoolRequest) Execute() (*TargetPool, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateTargetPool") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1beta/projects/{projectId}/load-balancers/{name}/target-pools/{targetPoolName}" @@ -898,7 +898,7 @@ func (r ApiUpdateTargetPoolRequest) Execute() (*TargetPool, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -908,7 +908,7 @@ func (r ApiUpdateTargetPoolRequest) Execute() (*TargetPool, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), diff --git a/services/loadbalancer/wait/wait.go b/services/loadbalancer/wait/wait.go index c53b4727..e30b9caf 100644 --- a/services/loadbalancer/wait/wait.go +++ b/services/loadbalancer/wait/wait.go @@ -5,7 +5,7 @@ import ( "fmt" "net/http" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/core/wait" "github.com/stackitcloud/stackit-sdk-go/services/loadbalancer" ) @@ -69,9 +69,9 @@ func DeleteInstanceWaitHandler(ctx context.Context, a APIClientInterface, projec if err == nil { return s, false, nil } - oapiErr, ok := err.(*oapiError.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if !ok { - return nil, false, fmt.Errorf("could not convert error to oapiError.GenericOpenAPIError") + return nil, false, fmt.Errorf("could not convert error to oapierror.GenericOpenAPIError") } if oapiErr.StatusCode != http.StatusNotFound { return nil, false, err diff --git a/services/loadbalancer/wait/wait_test.go b/services/loadbalancer/wait/wait_test.go index 8c6ed274..1b6acd1f 100644 --- a/services/loadbalancer/wait/wait_test.go +++ b/services/loadbalancer/wait/wait_test.go @@ -6,7 +6,7 @@ import ( "time" "github.com/google/go-cmp/cmp" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/services/loadbalancer" ) @@ -22,13 +22,13 @@ type apiClientMocked struct { func (a *apiClientMocked) GetLoadBalancerExecute(_ context.Context, _, _ string) (*loadbalancer.LoadBalancer, error) { if a.instanceGetFails { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 500, } } if a.instanceIsDeleted { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 404, } } @@ -40,7 +40,7 @@ func (a *apiClientMocked) GetLoadBalancerExecute(_ context.Context, _, _ string) } func (a *apiClientMocked) GetStatusExecute(_ context.Context, _ string) (*loadbalancer.StatusResponse, error) { if a.functionalityStatusGetFails { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 500, } } diff --git a/services/logme/api_default.go b/services/logme/api_default.go index e98b4053..7bcac13a 100644 --- a/services/logme/api_default.go +++ b/services/logme/api_default.go @@ -19,7 +19,7 @@ import ( "net/url" "strings" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" ) // DefaultApiService DefaultApi service @@ -42,7 +42,7 @@ func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateCredentials") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" @@ -88,7 +88,7 @@ func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -100,7 +100,7 @@ func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -108,7 +108,7 @@ func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -172,7 +172,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateInstance") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances" @@ -222,7 +222,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -234,7 +234,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -245,7 +245,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -253,7 +253,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -307,7 +307,7 @@ func (r ApiDeleteCredentialsRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteCredentials") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{credentialsId}" @@ -354,7 +354,7 @@ func (r ApiDeleteCredentialsRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -366,7 +366,7 @@ func (r ApiDeleteCredentialsRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return newErr @@ -423,7 +423,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteInstance") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -469,7 +469,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -481,7 +481,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -492,7 +492,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return newErr @@ -548,7 +548,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCredentials") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{credentialsId}" @@ -595,7 +595,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -607,7 +607,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -615,7 +615,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -675,7 +675,7 @@ func (r ApiGetCredentialsIdsRequest) Execute() (*CredentialsIdsResponse, error) a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCredentialsIds") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" @@ -721,7 +721,7 @@ func (r ApiGetCredentialsIdsRequest) Execute() (*CredentialsIdsResponse, error) } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -733,7 +733,7 @@ func (r ApiGetCredentialsIdsRequest) Execute() (*CredentialsIdsResponse, error) newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -741,7 +741,7 @@ func (r ApiGetCredentialsIdsRequest) Execute() (*CredentialsIdsResponse, error) err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -798,7 +798,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstance") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -844,7 +844,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -856,7 +856,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -867,7 +867,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -875,7 +875,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -931,7 +931,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstanceList, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstances") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances" @@ -976,7 +976,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstanceList, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -988,7 +988,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstanceList, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -996,7 +996,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstanceList, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1049,7 +1049,7 @@ func (r ApiGetOfferingsRequest) Execute() (*OfferingList, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetOfferings") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/offerings" @@ -1094,7 +1094,7 @@ func (r ApiGetOfferingsRequest) Execute() (*OfferingList, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1104,7 +1104,7 @@ func (r ApiGetOfferingsRequest) Execute() (*OfferingList, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1165,7 +1165,7 @@ func (r ApiUpdateInstanceRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateInstance") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -1216,7 +1216,7 @@ func (r ApiUpdateInstanceRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1228,7 +1228,7 @@ func (r ApiUpdateInstanceRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -1239,7 +1239,7 @@ func (r ApiUpdateInstanceRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return newErr diff --git a/services/logme/wait/wait.go b/services/logme/wait/wait.go index 1a298ec4..4b4f0d0f 100644 --- a/services/logme/wait/wait.go +++ b/services/logme/wait/wait.go @@ -6,7 +6,7 @@ import ( "net/http" "strings" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/core/wait" "github.com/stackitcloud/stackit-sdk-go/services/logme" ) @@ -88,9 +88,9 @@ func DeleteInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface } return s, false, nil } - oapiErr, ok := err.(*oapiError.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if !ok { - return nil, false, fmt.Errorf("could not convert error to oapiError.GenericOpenAPIError") + return nil, false, fmt.Errorf("could not convert error to oapierror.GenericOpenAPIError") } if oapiErr.StatusCode != http.StatusGone { return nil, false, err @@ -104,9 +104,9 @@ func CreateCredentialsWaitHandler(ctx context.Context, a APIClientCredentialsInt return wait.New(func() (res interface{}, done bool, err error) { s, err := a.GetCredentialsExecute(ctx, projectId, instanceId, credentialsId) if err != nil { - oapiErr, ok := err.(*oapiError.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if !ok { - return nil, false, fmt.Errorf("could not convert error to oapiError.GenericOpenAPIError") + return nil, false, fmt.Errorf("could not convert error to oapierror.GenericOpenAPIError") } // If the request returns 404, the credentials have not been created yet if oapiErr.StatusCode == http.StatusNotFound { @@ -126,9 +126,9 @@ func DeleteCredentialsWaitHandler(ctx context.Context, a APIClientCredentialsInt return wait.New(func() (res interface{}, done bool, err error) { s, err := a.GetCredentialsExecute(ctx, projectId, instanceId, credentialsId) if err != nil { - oapiErr, ok := err.(*oapiError.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if !ok { - return nil, false, fmt.Errorf("could not convert error to oapiError.GenericOpenAPIError") + return nil, false, fmt.Errorf("could not convert error to oapierror.GenericOpenAPIError") } if oapiErr.StatusCode != http.StatusNotFound && oapiErr.StatusCode != http.StatusGone { return nil, false, err diff --git a/services/logme/wait/wait_test.go b/services/logme/wait/wait_test.go index 243dc4eb..f69d339e 100644 --- a/services/logme/wait/wait_test.go +++ b/services/logme/wait/wait_test.go @@ -6,7 +6,7 @@ import ( "time" "github.com/google/go-cmp/cmp" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/core/utils" "github.com/stackitcloud/stackit-sdk-go/services/logme" ) @@ -29,7 +29,7 @@ var ( func (a *apiClientInstanceMocked) GetInstanceExecute(_ context.Context, _, _ string) (*logme.Instance, error) { if a.getFails { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 500, } } @@ -44,7 +44,7 @@ func (a *apiClientInstanceMocked) GetInstanceExecute(_ context.Context, _, _ str }, }, nil } - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 410, } } @@ -69,13 +69,13 @@ type apiClientCredentialsMocked struct { func (a *apiClientCredentialsMocked) GetCredentialsExecute(_ context.Context, _, _, _ string) (*logme.CredentialsResponse, error) { if a.getFails { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 500, } } if !a.operationSucceeds || a.deletionSucceeds { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 404, } } diff --git a/services/mariadb/api_default.go b/services/mariadb/api_default.go index cc6a9b92..0303a9b0 100644 --- a/services/mariadb/api_default.go +++ b/services/mariadb/api_default.go @@ -19,7 +19,7 @@ import ( "net/url" "strings" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" ) // DefaultApiService DefaultApi service @@ -42,7 +42,7 @@ func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateCredentials") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" @@ -88,7 +88,7 @@ func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -100,7 +100,7 @@ func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -108,7 +108,7 @@ func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -172,7 +172,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateInstance") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances" @@ -222,7 +222,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -234,7 +234,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -245,7 +245,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -253,7 +253,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -307,7 +307,7 @@ func (r ApiDeleteCredentialsRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteCredentials") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{credentialsId}" @@ -354,7 +354,7 @@ func (r ApiDeleteCredentialsRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -366,7 +366,7 @@ func (r ApiDeleteCredentialsRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return newErr @@ -423,7 +423,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteInstance") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -469,7 +469,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -481,7 +481,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -492,7 +492,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return newErr @@ -548,7 +548,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCredentials") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{credentialsId}" @@ -595,7 +595,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -607,7 +607,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -615,7 +615,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -675,7 +675,7 @@ func (r ApiGetCredentialsIdsRequest) Execute() (*CredentialsIdsResponse, error) a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCredentialsIds") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" @@ -721,7 +721,7 @@ func (r ApiGetCredentialsIdsRequest) Execute() (*CredentialsIdsResponse, error) } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -733,7 +733,7 @@ func (r ApiGetCredentialsIdsRequest) Execute() (*CredentialsIdsResponse, error) newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -741,7 +741,7 @@ func (r ApiGetCredentialsIdsRequest) Execute() (*CredentialsIdsResponse, error) err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -798,7 +798,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstance") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -844,7 +844,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -856,7 +856,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -867,7 +867,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -875,7 +875,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -931,7 +931,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstanceList, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstances") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances" @@ -976,7 +976,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstanceList, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -988,7 +988,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstanceList, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -996,7 +996,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstanceList, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1049,7 +1049,7 @@ func (r ApiGetOfferingsRequest) Execute() (*OfferingList, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetOfferings") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/offerings" @@ -1094,7 +1094,7 @@ func (r ApiGetOfferingsRequest) Execute() (*OfferingList, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1104,7 +1104,7 @@ func (r ApiGetOfferingsRequest) Execute() (*OfferingList, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1165,7 +1165,7 @@ func (r ApiUpdateInstanceRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateInstance") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -1216,7 +1216,7 @@ func (r ApiUpdateInstanceRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1228,7 +1228,7 @@ func (r ApiUpdateInstanceRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -1239,7 +1239,7 @@ func (r ApiUpdateInstanceRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return newErr diff --git a/services/mariadb/wait/wait.go b/services/mariadb/wait/wait.go index a1667edb..2e8d7e80 100644 --- a/services/mariadb/wait/wait.go +++ b/services/mariadb/wait/wait.go @@ -6,7 +6,7 @@ import ( "net/http" "strings" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/core/wait" "github.com/stackitcloud/stackit-sdk-go/services/mariadb" ) @@ -88,9 +88,9 @@ func DeleteInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface } return s, false, nil } - oapiErr, ok := err.(*oapiError.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if !ok { - return nil, false, fmt.Errorf("could not convert error to oapiError.GenericOpenAPIError") + return nil, false, fmt.Errorf("could not convert error to oapierror.GenericOpenAPIError") } if oapiErr.StatusCode != http.StatusGone { return nil, false, err @@ -104,9 +104,9 @@ func CreateCredentialsWaitHandler(ctx context.Context, a APIClientCredentialsInt return wait.New(func() (res interface{}, done bool, err error) { s, err := a.GetCredentialsExecute(ctx, projectId, instanceId, credentialsId) if err != nil { - oapiErr, ok := err.(*oapiError.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if !ok { - return nil, false, fmt.Errorf("could not convert error to oapiError.GenericOpenAPIError") + return nil, false, fmt.Errorf("could not convert error to oapierror.GenericOpenAPIError") } // If the request returns 404, the credentials have not been created yet if oapiErr.StatusCode == http.StatusNotFound { @@ -126,9 +126,9 @@ func DeleteCredentialsWaitHandler(ctx context.Context, a APIClientCredentialsInt return wait.New(func() (res interface{}, done bool, err error) { s, err := a.GetCredentialsExecute(ctx, projectId, instanceId, credentialsId) if err != nil { - oapiErr, ok := err.(*oapiError.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if !ok { - return nil, false, fmt.Errorf("could not convert error to oapiError.GenericOpenAPIError") + return nil, false, fmt.Errorf("could not convert error to oapierror.GenericOpenAPIError") } if oapiErr.StatusCode != http.StatusNotFound && oapiErr.StatusCode != http.StatusGone { return nil, false, err diff --git a/services/mariadb/wait/wait_test.go b/services/mariadb/wait/wait_test.go index 7c1cd59c..b308019c 100644 --- a/services/mariadb/wait/wait_test.go +++ b/services/mariadb/wait/wait_test.go @@ -6,7 +6,7 @@ import ( "time" "github.com/google/go-cmp/cmp" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/core/utils" "github.com/stackitcloud/stackit-sdk-go/services/mariadb" ) @@ -29,7 +29,7 @@ var ( func (a *apiClientInstanceMocked) GetInstanceExecute(_ context.Context, _, _ string) (*mariadb.Instance, error) { if a.getFails { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 500, } } @@ -44,7 +44,7 @@ func (a *apiClientInstanceMocked) GetInstanceExecute(_ context.Context, _, _ str }, }, nil } - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 410, } } @@ -69,13 +69,13 @@ type apiClientCredentialsMocked struct { func (a *apiClientCredentialsMocked) GetCredentialsExecute(_ context.Context, _, _, _ string) (*mariadb.CredentialsResponse, error) { if a.getFails { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 500, } } if !a.operationSucceeds || a.deletionSucceeds { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 404, } } diff --git a/services/mongodbflex/api_default.go b/services/mongodbflex/api_default.go index 585a21dd..2f5e0b92 100644 --- a/services/mongodbflex/api_default.go +++ b/services/mongodbflex/api_default.go @@ -19,7 +19,7 @@ import ( "net/url" "strings" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" ) // DefaultApiService DefaultApi service @@ -50,7 +50,7 @@ func (r ApiCloneInstanceRequest) Execute() (*CloneInstanceResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CloneInstance") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/clone" @@ -101,7 +101,7 @@ func (r ApiCloneInstanceRequest) Execute() (*CloneInstanceResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -113,7 +113,7 @@ func (r ApiCloneInstanceRequest) Execute() (*CloneInstanceResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -124,7 +124,7 @@ func (r ApiCloneInstanceRequest) Execute() (*CloneInstanceResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -132,7 +132,7 @@ func (r ApiCloneInstanceRequest) Execute() (*CloneInstanceResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -197,7 +197,7 @@ func (r ApiCreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateInstance") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances" @@ -247,7 +247,7 @@ func (r ApiCreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -259,7 +259,7 @@ func (r ApiCreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -270,7 +270,7 @@ func (r ApiCreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -281,7 +281,7 @@ func (r ApiCreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -289,7 +289,7 @@ func (r ApiCreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -351,7 +351,7 @@ func (r ApiCreateUserRequest) Execute() (*CreateUserResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateUser") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users" @@ -402,7 +402,7 @@ func (r ApiCreateUserRequest) Execute() (*CreateUserResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -414,7 +414,7 @@ func (r ApiCreateUserRequest) Execute() (*CreateUserResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -425,7 +425,7 @@ func (r ApiCreateUserRequest) Execute() (*CreateUserResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -436,7 +436,7 @@ func (r ApiCreateUserRequest) Execute() (*CreateUserResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -447,7 +447,7 @@ func (r ApiCreateUserRequest) Execute() (*CreateUserResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -455,7 +455,7 @@ func (r ApiCreateUserRequest) Execute() (*CreateUserResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -511,7 +511,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteInstance") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -557,7 +557,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -569,7 +569,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -580,7 +580,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -591,7 +591,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return newErr @@ -644,7 +644,7 @@ func (r ApiDeleteProjectRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteProject") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}" @@ -689,7 +689,7 @@ func (r ApiDeleteProjectRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -701,7 +701,7 @@ func (r ApiDeleteProjectRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -712,7 +712,7 @@ func (r ApiDeleteProjectRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return newErr @@ -764,7 +764,7 @@ func (r ApiDeleteUserRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteUser") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" @@ -811,7 +811,7 @@ func (r ApiDeleteUserRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -823,7 +823,7 @@ func (r ApiDeleteUserRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -834,7 +834,7 @@ func (r ApiDeleteUserRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return newErr @@ -893,7 +893,7 @@ func (r ApiGetBackupRequest) Execute() (*GetBackupResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetBackup") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups/{backupId}" @@ -940,7 +940,7 @@ func (r ApiGetBackupRequest) Execute() (*GetBackupResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -952,7 +952,7 @@ func (r ApiGetBackupRequest) Execute() (*GetBackupResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -963,7 +963,7 @@ func (r ApiGetBackupRequest) Execute() (*GetBackupResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -971,7 +971,7 @@ func (r ApiGetBackupRequest) Execute() (*GetBackupResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1031,7 +1031,7 @@ func (r ApiGetBackupsRequest) Execute() (*GetBackupsResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetBackups") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups" @@ -1077,7 +1077,7 @@ func (r ApiGetBackupsRequest) Execute() (*GetBackupsResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1089,7 +1089,7 @@ func (r ApiGetBackupsRequest) Execute() (*GetBackupsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1100,7 +1100,7 @@ func (r ApiGetBackupsRequest) Execute() (*GetBackupsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -1108,7 +1108,7 @@ func (r ApiGetBackupsRequest) Execute() (*GetBackupsResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1197,7 +1197,7 @@ func (r ApiGetCPUMetricsRequest) Execute() (*GetMetricsResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCPUMetrics") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/metrics/cpu" @@ -1256,7 +1256,7 @@ func (r ApiGetCPUMetricsRequest) Execute() (*GetMetricsResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1268,7 +1268,7 @@ func (r ApiGetCPUMetricsRequest) Execute() (*GetMetricsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1279,7 +1279,7 @@ func (r ApiGetCPUMetricsRequest) Execute() (*GetMetricsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1290,7 +1290,7 @@ func (r ApiGetCPUMetricsRequest) Execute() (*GetMetricsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -1298,7 +1298,7 @@ func (r ApiGetCPUMetricsRequest) Execute() (*GetMetricsResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1387,7 +1387,7 @@ func (r ApiGetDatabaseStorageMetricsRequest) Execute() (*GetMetricsResponse, err a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetDatabaseStorageMetrics") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/metrics/database" @@ -1446,7 +1446,7 @@ func (r ApiGetDatabaseStorageMetricsRequest) Execute() (*GetMetricsResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1458,7 +1458,7 @@ func (r ApiGetDatabaseStorageMetricsRequest) Execute() (*GetMetricsResponse, err newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1469,7 +1469,7 @@ func (r ApiGetDatabaseStorageMetricsRequest) Execute() (*GetMetricsResponse, err newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1480,7 +1480,7 @@ func (r ApiGetDatabaseStorageMetricsRequest) Execute() (*GetMetricsResponse, err newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -1488,7 +1488,7 @@ func (r ApiGetDatabaseStorageMetricsRequest) Execute() (*GetMetricsResponse, err err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1577,7 +1577,7 @@ func (r ApiGetDiskIOPSMetricsRequest) Execute() (*GetMetricsResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetDiskIOPSMetrics") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/metrics/disk-iops" @@ -1636,7 +1636,7 @@ func (r ApiGetDiskIOPSMetricsRequest) Execute() (*GetMetricsResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1648,7 +1648,7 @@ func (r ApiGetDiskIOPSMetricsRequest) Execute() (*GetMetricsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1659,7 +1659,7 @@ func (r ApiGetDiskIOPSMetricsRequest) Execute() (*GetMetricsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1670,7 +1670,7 @@ func (r ApiGetDiskIOPSMetricsRequest) Execute() (*GetMetricsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -1678,7 +1678,7 @@ func (r ApiGetDiskIOPSMetricsRequest) Execute() (*GetMetricsResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1767,7 +1767,7 @@ func (r ApiGetDiskUsageMetricsRequest) Execute() (*GetMetricsResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetDiskUsageMetrics") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/metrics/disk-use" @@ -1826,7 +1826,7 @@ func (r ApiGetDiskUsageMetricsRequest) Execute() (*GetMetricsResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1838,7 +1838,7 @@ func (r ApiGetDiskUsageMetricsRequest) Execute() (*GetMetricsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1849,7 +1849,7 @@ func (r ApiGetDiskUsageMetricsRequest) Execute() (*GetMetricsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1860,7 +1860,7 @@ func (r ApiGetDiskUsageMetricsRequest) Execute() (*GetMetricsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -1868,7 +1868,7 @@ func (r ApiGetDiskUsageMetricsRequest) Execute() (*GetMetricsResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1957,7 +1957,7 @@ func (r ApiGetExecutionTimesMetricsRequest) Execute() (*GetMetricsResponse, erro a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetExecutionTimesMetrics") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/metrics/exec-time" @@ -2016,7 +2016,7 @@ func (r ApiGetExecutionTimesMetricsRequest) Execute() (*GetMetricsResponse, erro } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -2028,7 +2028,7 @@ func (r ApiGetExecutionTimesMetricsRequest) Execute() (*GetMetricsResponse, erro newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -2039,7 +2039,7 @@ func (r ApiGetExecutionTimesMetricsRequest) Execute() (*GetMetricsResponse, erro newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -2050,7 +2050,7 @@ func (r ApiGetExecutionTimesMetricsRequest) Execute() (*GetMetricsResponse, erro newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -2058,7 +2058,7 @@ func (r ApiGetExecutionTimesMetricsRequest) Execute() (*GetMetricsResponse, erro err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -2114,7 +2114,7 @@ func (r ApiGetFlavorsRequest) Execute() (*GetFlavorsResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetFlavors") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/flavors" @@ -2159,7 +2159,7 @@ func (r ApiGetFlavorsRequest) Execute() (*GetFlavorsResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -2171,7 +2171,7 @@ func (r ApiGetFlavorsRequest) Execute() (*GetFlavorsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -2182,7 +2182,7 @@ func (r ApiGetFlavorsRequest) Execute() (*GetFlavorsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -2190,7 +2190,7 @@ func (r ApiGetFlavorsRequest) Execute() (*GetFlavorsResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -2244,7 +2244,7 @@ func (r ApiGetInstanceRequest) Execute() (*GetInstanceResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstance") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -2290,7 +2290,7 @@ func (r ApiGetInstanceRequest) Execute() (*GetInstanceResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -2302,7 +2302,7 @@ func (r ApiGetInstanceRequest) Execute() (*GetInstanceResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -2313,7 +2313,7 @@ func (r ApiGetInstanceRequest) Execute() (*GetInstanceResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -2321,7 +2321,7 @@ func (r ApiGetInstanceRequest) Execute() (*GetInstanceResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -2378,7 +2378,7 @@ func (r ApiGetInstanceRestoresRequest) Execute() (*GetInstanceRestoresResponse, a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstanceRestores") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/restores" @@ -2424,7 +2424,7 @@ func (r ApiGetInstanceRestoresRequest) Execute() (*GetInstanceRestoresResponse, } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -2436,7 +2436,7 @@ func (r ApiGetInstanceRestoresRequest) Execute() (*GetInstanceRestoresResponse, newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -2447,7 +2447,7 @@ func (r ApiGetInstanceRestoresRequest) Execute() (*GetInstanceRestoresResponse, newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -2455,7 +2455,7 @@ func (r ApiGetInstanceRestoresRequest) Execute() (*GetInstanceRestoresResponse, err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -2519,7 +2519,7 @@ func (r ApiGetInstancesRequest) Execute() (*GetInstancesResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstances") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances" @@ -2568,7 +2568,7 @@ func (r ApiGetInstancesRequest) Execute() (*GetInstancesResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -2580,7 +2580,7 @@ func (r ApiGetInstancesRequest) Execute() (*GetInstancesResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -2591,7 +2591,7 @@ func (r ApiGetInstancesRequest) Execute() (*GetInstancesResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -2599,7 +2599,7 @@ func (r ApiGetInstancesRequest) Execute() (*GetInstancesResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -2693,7 +2693,7 @@ func (r ApiGetMemoryMetricsRequest) Execute() (*GetMetricsResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetMemoryMetrics") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/metrics/memory" @@ -2756,7 +2756,7 @@ func (r ApiGetMemoryMetricsRequest) Execute() (*GetMetricsResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -2768,7 +2768,7 @@ func (r ApiGetMemoryMetricsRequest) Execute() (*GetMetricsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -2779,7 +2779,7 @@ func (r ApiGetMemoryMetricsRequest) Execute() (*GetMetricsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -2790,7 +2790,7 @@ func (r ApiGetMemoryMetricsRequest) Execute() (*GetMetricsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -2798,7 +2798,7 @@ func (r ApiGetMemoryMetricsRequest) Execute() (*GetMetricsResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -2855,7 +2855,7 @@ func (r ApiGetStorageRequest) Execute() (*GetStorageResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetStorage") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/storages/{flavor}" @@ -2901,7 +2901,7 @@ func (r ApiGetStorageRequest) Execute() (*GetStorageResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -2913,7 +2913,7 @@ func (r ApiGetStorageRequest) Execute() (*GetStorageResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -2924,7 +2924,7 @@ func (r ApiGetStorageRequest) Execute() (*GetStorageResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -2932,7 +2932,7 @@ func (r ApiGetStorageRequest) Execute() (*GetStorageResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -2990,7 +2990,7 @@ func (r ApiGetUserRequest) Execute() (*GetUserResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetUser") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" @@ -3037,7 +3037,7 @@ func (r ApiGetUserRequest) Execute() (*GetUserResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -3049,7 +3049,7 @@ func (r ApiGetUserRequest) Execute() (*GetUserResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -3060,7 +3060,7 @@ func (r ApiGetUserRequest) Execute() (*GetUserResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -3068,7 +3068,7 @@ func (r ApiGetUserRequest) Execute() (*GetUserResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -3128,7 +3128,7 @@ func (r ApiGetUsersRequest) Execute() (*GetUsersResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetUsers") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users" @@ -3174,7 +3174,7 @@ func (r ApiGetUsersRequest) Execute() (*GetUsersResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -3186,7 +3186,7 @@ func (r ApiGetUsersRequest) Execute() (*GetUsersResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -3197,7 +3197,7 @@ func (r ApiGetUsersRequest) Execute() (*GetUsersResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -3205,7 +3205,7 @@ func (r ApiGetUsersRequest) Execute() (*GetUsersResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -3261,7 +3261,7 @@ func (r ApiGetVersionsRequest) Execute() (*GetVersionsResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetVersions") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/versions" @@ -3306,7 +3306,7 @@ func (r ApiGetVersionsRequest) Execute() (*GetVersionsResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -3318,7 +3318,7 @@ func (r ApiGetVersionsRequest) Execute() (*GetVersionsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -3326,7 +3326,7 @@ func (r ApiGetVersionsRequest) Execute() (*GetVersionsResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -3388,7 +3388,7 @@ func (r ApiPartialUpdateInstanceRequest) Execute() (*UpdateInstanceResponse, err a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.PartialUpdateInstance") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -3439,7 +3439,7 @@ func (r ApiPartialUpdateInstanceRequest) Execute() (*UpdateInstanceResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -3451,7 +3451,7 @@ func (r ApiPartialUpdateInstanceRequest) Execute() (*UpdateInstanceResponse, err newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -3462,7 +3462,7 @@ func (r ApiPartialUpdateInstanceRequest) Execute() (*UpdateInstanceResponse, err newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -3473,7 +3473,7 @@ func (r ApiPartialUpdateInstanceRequest) Execute() (*UpdateInstanceResponse, err newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -3484,7 +3484,7 @@ func (r ApiPartialUpdateInstanceRequest) Execute() (*UpdateInstanceResponse, err newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -3492,7 +3492,7 @@ func (r ApiPartialUpdateInstanceRequest) Execute() (*UpdateInstanceResponse, err err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -3557,7 +3557,7 @@ func (r ApiPartialUpdateUserRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.PartialUpdateUser") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" @@ -3609,7 +3609,7 @@ func (r ApiPartialUpdateUserRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -3621,7 +3621,7 @@ func (r ApiPartialUpdateUserRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -3632,7 +3632,7 @@ func (r ApiPartialUpdateUserRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -3643,7 +3643,7 @@ func (r ApiPartialUpdateUserRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return newErr @@ -3702,7 +3702,7 @@ func (r ApiResetUserRequest) Execute() (*InstanceUser, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ResetUser") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}/reset" @@ -3749,7 +3749,7 @@ func (r ApiResetUserRequest) Execute() (*InstanceUser, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -3761,7 +3761,7 @@ func (r ApiResetUserRequest) Execute() (*InstanceUser, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -3772,7 +3772,7 @@ func (r ApiResetUserRequest) Execute() (*InstanceUser, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -3780,7 +3780,7 @@ func (r ApiResetUserRequest) Execute() (*InstanceUser, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -3848,7 +3848,7 @@ func (r ApiRestoreInstanceRequest) Execute() (*RestoreInstanceResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RestoreInstance") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/restores" @@ -3899,7 +3899,7 @@ func (r ApiRestoreInstanceRequest) Execute() (*RestoreInstanceResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -3911,7 +3911,7 @@ func (r ApiRestoreInstanceRequest) Execute() (*RestoreInstanceResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -3922,7 +3922,7 @@ func (r ApiRestoreInstanceRequest) Execute() (*RestoreInstanceResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -3930,7 +3930,7 @@ func (r ApiRestoreInstanceRequest) Execute() (*RestoreInstanceResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -3995,7 +3995,7 @@ func (r ApiUpdateBackupScheduleRequest) Execute() (*UpdateBackupSchedulePayload, a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateBackupSchedule") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups" @@ -4046,7 +4046,7 @@ func (r ApiUpdateBackupScheduleRequest) Execute() (*UpdateBackupSchedulePayload, } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -4058,7 +4058,7 @@ func (r ApiUpdateBackupScheduleRequest) Execute() (*UpdateBackupSchedulePayload, newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -4069,7 +4069,7 @@ func (r ApiUpdateBackupScheduleRequest) Execute() (*UpdateBackupSchedulePayload, newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -4077,7 +4077,7 @@ func (r ApiUpdateBackupScheduleRequest) Execute() (*UpdateBackupSchedulePayload, err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -4142,7 +4142,7 @@ func (r ApiUpdateInstanceRequest) Execute() (*UpdateInstanceResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateInstance") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -4193,7 +4193,7 @@ func (r ApiUpdateInstanceRequest) Execute() (*UpdateInstanceResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -4205,7 +4205,7 @@ func (r ApiUpdateInstanceRequest) Execute() (*UpdateInstanceResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -4216,7 +4216,7 @@ func (r ApiUpdateInstanceRequest) Execute() (*UpdateInstanceResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -4227,7 +4227,7 @@ func (r ApiUpdateInstanceRequest) Execute() (*UpdateInstanceResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -4238,7 +4238,7 @@ func (r ApiUpdateInstanceRequest) Execute() (*UpdateInstanceResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -4246,7 +4246,7 @@ func (r ApiUpdateInstanceRequest) Execute() (*UpdateInstanceResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -4311,7 +4311,7 @@ func (r ApiUpdateUserRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateUser") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" @@ -4363,7 +4363,7 @@ func (r ApiUpdateUserRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -4375,7 +4375,7 @@ func (r ApiUpdateUserRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -4386,7 +4386,7 @@ func (r ApiUpdateUserRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -4397,7 +4397,7 @@ func (r ApiUpdateUserRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return newErr diff --git a/services/mongodbflex/wait/wait.go b/services/mongodbflex/wait/wait.go index 364015bf..b061820f 100644 --- a/services/mongodbflex/wait/wait.go +++ b/services/mongodbflex/wait/wait.go @@ -6,7 +6,7 @@ import ( "net/http" "time" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/core/wait" "github.com/stackitcloud/stackit-sdk-go/services/mongodbflex" ) @@ -86,9 +86,9 @@ func DeleteInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface if err == nil { return s, false, nil } - oapiErr, ok := err.(*oapiError.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if !ok { - return nil, false, fmt.Errorf("could not convert error to oapiError.GenericOpenAPIError") + return nil, false, fmt.Errorf("could not convert error to oapierror.GenericOpenAPIError") } if oapiErr.StatusCode != http.StatusNotFound { return nil, false, err diff --git a/services/mongodbflex/wait/wait_test.go b/services/mongodbflex/wait/wait_test.go index 2b24dd0f..573f77fd 100644 --- a/services/mongodbflex/wait/wait_test.go +++ b/services/mongodbflex/wait/wait_test.go @@ -6,7 +6,7 @@ import ( "time" "github.com/google/go-cmp/cmp" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/services/mongodbflex" ) @@ -20,13 +20,13 @@ type apiClientInstanceMocked struct { func (a *apiClientInstanceMocked) GetInstanceExecute(_ context.Context, _, _ string) (*mongodbflex.GetInstanceResponse, error) { if a.instanceGetFails { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 500, } } if a.instanceIsDeleted { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 404, } } diff --git a/services/objectstorage/api_default.go b/services/objectstorage/api_default.go index 706c8577..68de5626 100644 --- a/services/objectstorage/api_default.go +++ b/services/objectstorage/api_default.go @@ -19,7 +19,7 @@ import ( "net/url" "strings" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" ) // DefaultApiService DefaultApi service @@ -53,7 +53,7 @@ func (r ApiCreateAccessKeyRequest) Execute() (*CreateAccessKeyResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateAccessKey") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/project/{projectId}/access-key" @@ -106,7 +106,7 @@ func (r ApiCreateAccessKeyRequest) Execute() (*CreateAccessKeyResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -118,7 +118,7 @@ func (r ApiCreateAccessKeyRequest) Execute() (*CreateAccessKeyResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -129,7 +129,7 @@ func (r ApiCreateAccessKeyRequest) Execute() (*CreateAccessKeyResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -140,7 +140,7 @@ func (r ApiCreateAccessKeyRequest) Execute() (*CreateAccessKeyResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -151,7 +151,7 @@ func (r ApiCreateAccessKeyRequest) Execute() (*CreateAccessKeyResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -159,7 +159,7 @@ func (r ApiCreateAccessKeyRequest) Execute() (*CreateAccessKeyResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -213,7 +213,7 @@ func (r ApiCreateBucketRequest) Execute() (*CreateBucketResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateBucket") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/project/{projectId}/bucket/{bucketName}" @@ -265,7 +265,7 @@ func (r ApiCreateBucketRequest) Execute() (*CreateBucketResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -277,7 +277,7 @@ func (r ApiCreateBucketRequest) Execute() (*CreateBucketResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -288,7 +288,7 @@ func (r ApiCreateBucketRequest) Execute() (*CreateBucketResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -299,7 +299,7 @@ func (r ApiCreateBucketRequest) Execute() (*CreateBucketResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -310,7 +310,7 @@ func (r ApiCreateBucketRequest) Execute() (*CreateBucketResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -318,7 +318,7 @@ func (r ApiCreateBucketRequest) Execute() (*CreateBucketResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -381,7 +381,7 @@ func (r ApiCreateCredentialsGroupRequest) Execute() (*CreateCredentialsGroupResp a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateCredentialsGroup") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/project/{projectId}/credentials-group" @@ -431,7 +431,7 @@ func (r ApiCreateCredentialsGroupRequest) Execute() (*CreateCredentialsGroupResp } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -443,7 +443,7 @@ func (r ApiCreateCredentialsGroupRequest) Execute() (*CreateCredentialsGroupResp newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -454,7 +454,7 @@ func (r ApiCreateCredentialsGroupRequest) Execute() (*CreateCredentialsGroupResp newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -465,7 +465,7 @@ func (r ApiCreateCredentialsGroupRequest) Execute() (*CreateCredentialsGroupResp newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -476,7 +476,7 @@ func (r ApiCreateCredentialsGroupRequest) Execute() (*CreateCredentialsGroupResp newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -487,7 +487,7 @@ func (r ApiCreateCredentialsGroupRequest) Execute() (*CreateCredentialsGroupResp newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -495,7 +495,7 @@ func (r ApiCreateCredentialsGroupRequest) Execute() (*CreateCredentialsGroupResp err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -546,7 +546,7 @@ func (r ApiCreateProjectRequest) Execute() (*GetProjectResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateProject") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/project/{projectId}" @@ -591,7 +591,7 @@ func (r ApiCreateProjectRequest) Execute() (*GetProjectResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -603,7 +603,7 @@ func (r ApiCreateProjectRequest) Execute() (*GetProjectResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -614,7 +614,7 @@ func (r ApiCreateProjectRequest) Execute() (*GetProjectResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -625,7 +625,7 @@ func (r ApiCreateProjectRequest) Execute() (*GetProjectResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -636,7 +636,7 @@ func (r ApiCreateProjectRequest) Execute() (*GetProjectResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -644,7 +644,7 @@ func (r ApiCreateProjectRequest) Execute() (*GetProjectResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -705,7 +705,7 @@ func (r ApiDeleteAccessKeyRequest) Execute() (*DeleteAccessKeyResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteAccessKey") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/project/{projectId}/access-key/{keyId}" @@ -754,7 +754,7 @@ func (r ApiDeleteAccessKeyRequest) Execute() (*DeleteAccessKeyResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -766,7 +766,7 @@ func (r ApiDeleteAccessKeyRequest) Execute() (*DeleteAccessKeyResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -777,7 +777,7 @@ func (r ApiDeleteAccessKeyRequest) Execute() (*DeleteAccessKeyResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -788,7 +788,7 @@ func (r ApiDeleteAccessKeyRequest) Execute() (*DeleteAccessKeyResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -799,7 +799,7 @@ func (r ApiDeleteAccessKeyRequest) Execute() (*DeleteAccessKeyResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -810,7 +810,7 @@ func (r ApiDeleteAccessKeyRequest) Execute() (*DeleteAccessKeyResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -818,7 +818,7 @@ func (r ApiDeleteAccessKeyRequest) Execute() (*DeleteAccessKeyResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -875,7 +875,7 @@ func (r ApiDeleteBucketRequest) Execute() (*DeleteBucketResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteBucket") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/project/{projectId}/bucket/{bucketName}" @@ -927,7 +927,7 @@ func (r ApiDeleteBucketRequest) Execute() (*DeleteBucketResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -939,7 +939,7 @@ func (r ApiDeleteBucketRequest) Execute() (*DeleteBucketResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -950,7 +950,7 @@ func (r ApiDeleteBucketRequest) Execute() (*DeleteBucketResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -961,7 +961,7 @@ func (r ApiDeleteBucketRequest) Execute() (*DeleteBucketResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -969,7 +969,7 @@ func (r ApiDeleteBucketRequest) Execute() (*DeleteBucketResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1026,7 +1026,7 @@ func (r ApiDeleteCredentialsGroupRequest) Execute() (*DeleteCredentialsGroupResp a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteCredentialsGroup") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/project/{projectId}/credentials-group/{groupId}" @@ -1072,7 +1072,7 @@ func (r ApiDeleteCredentialsGroupRequest) Execute() (*DeleteCredentialsGroupResp } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1084,7 +1084,7 @@ func (r ApiDeleteCredentialsGroupRequest) Execute() (*DeleteCredentialsGroupResp newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1095,7 +1095,7 @@ func (r ApiDeleteCredentialsGroupRequest) Execute() (*DeleteCredentialsGroupResp newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1106,7 +1106,7 @@ func (r ApiDeleteCredentialsGroupRequest) Execute() (*DeleteCredentialsGroupResp newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -1114,7 +1114,7 @@ func (r ApiDeleteCredentialsGroupRequest) Execute() (*DeleteCredentialsGroupResp err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1171,7 +1171,7 @@ func (r ApiDeleteProjectRequest) Execute() (*GetProjectResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteProject") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/project/{projectId}" @@ -1216,7 +1216,7 @@ func (r ApiDeleteProjectRequest) Execute() (*GetProjectResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1228,7 +1228,7 @@ func (r ApiDeleteProjectRequest) Execute() (*GetProjectResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1239,7 +1239,7 @@ func (r ApiDeleteProjectRequest) Execute() (*GetProjectResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1250,7 +1250,7 @@ func (r ApiDeleteProjectRequest) Execute() (*GetProjectResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1261,7 +1261,7 @@ func (r ApiDeleteProjectRequest) Execute() (*GetProjectResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1272,7 +1272,7 @@ func (r ApiDeleteProjectRequest) Execute() (*GetProjectResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -1280,7 +1280,7 @@ func (r ApiDeleteProjectRequest) Execute() (*GetProjectResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1339,7 +1339,7 @@ func (r ApiGetAccessKeysRequest) Execute() (*GetAccessKeysResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetAccessKeys") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/project/{projectId}/access-keys" @@ -1387,7 +1387,7 @@ func (r ApiGetAccessKeysRequest) Execute() (*GetAccessKeysResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1399,7 +1399,7 @@ func (r ApiGetAccessKeysRequest) Execute() (*GetAccessKeysResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1410,7 +1410,7 @@ func (r ApiGetAccessKeysRequest) Execute() (*GetAccessKeysResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1421,7 +1421,7 @@ func (r ApiGetAccessKeysRequest) Execute() (*GetAccessKeysResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1432,7 +1432,7 @@ func (r ApiGetAccessKeysRequest) Execute() (*GetAccessKeysResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -1440,7 +1440,7 @@ func (r ApiGetAccessKeysRequest) Execute() (*GetAccessKeysResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1494,7 +1494,7 @@ func (r ApiGetBucketRequest) Execute() (*GetBucketResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetBucket") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/project/{projectId}/bucket/{bucketName}" @@ -1546,7 +1546,7 @@ func (r ApiGetBucketRequest) Execute() (*GetBucketResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1558,7 +1558,7 @@ func (r ApiGetBucketRequest) Execute() (*GetBucketResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1569,7 +1569,7 @@ func (r ApiGetBucketRequest) Execute() (*GetBucketResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1580,7 +1580,7 @@ func (r ApiGetBucketRequest) Execute() (*GetBucketResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1591,7 +1591,7 @@ func (r ApiGetBucketRequest) Execute() (*GetBucketResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -1599,7 +1599,7 @@ func (r ApiGetBucketRequest) Execute() (*GetBucketResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1655,7 +1655,7 @@ func (r ApiGetBucketsRequest) Execute() (*GetBucketsResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetBuckets") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/project/{projectId}/buckets" @@ -1700,7 +1700,7 @@ func (r ApiGetBucketsRequest) Execute() (*GetBucketsResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1712,7 +1712,7 @@ func (r ApiGetBucketsRequest) Execute() (*GetBucketsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1723,7 +1723,7 @@ func (r ApiGetBucketsRequest) Execute() (*GetBucketsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1734,7 +1734,7 @@ func (r ApiGetBucketsRequest) Execute() (*GetBucketsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1745,7 +1745,7 @@ func (r ApiGetBucketsRequest) Execute() (*GetBucketsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -1753,7 +1753,7 @@ func (r ApiGetBucketsRequest) Execute() (*GetBucketsResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1806,7 +1806,7 @@ func (r ApiGetCredentialsGroupsRequest) Execute() (*GetCredentialsGroupsResponse a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCredentialsGroups") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/project/{projectId}/credentials-groups" @@ -1851,7 +1851,7 @@ func (r ApiGetCredentialsGroupsRequest) Execute() (*GetCredentialsGroupsResponse } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1863,7 +1863,7 @@ func (r ApiGetCredentialsGroupsRequest) Execute() (*GetCredentialsGroupsResponse newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1874,7 +1874,7 @@ func (r ApiGetCredentialsGroupsRequest) Execute() (*GetCredentialsGroupsResponse newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1885,7 +1885,7 @@ func (r ApiGetCredentialsGroupsRequest) Execute() (*GetCredentialsGroupsResponse newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -1893,7 +1893,7 @@ func (r ApiGetCredentialsGroupsRequest) Execute() (*GetCredentialsGroupsResponse err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1946,7 +1946,7 @@ func (r ApiGetProjectRequest) Execute() (*GetProjectResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetProject") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/project/{projectId}" @@ -1991,7 +1991,7 @@ func (r ApiGetProjectRequest) Execute() (*GetProjectResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -2003,7 +2003,7 @@ func (r ApiGetProjectRequest) Execute() (*GetProjectResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -2014,7 +2014,7 @@ func (r ApiGetProjectRequest) Execute() (*GetProjectResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -2025,7 +2025,7 @@ func (r ApiGetProjectRequest) Execute() (*GetProjectResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -2036,7 +2036,7 @@ func (r ApiGetProjectRequest) Execute() (*GetProjectResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -2044,7 +2044,7 @@ func (r ApiGetProjectRequest) Execute() (*GetProjectResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), diff --git a/services/objectstorage/wait/wait.go b/services/objectstorage/wait/wait.go index 2043b1d3..7a4418ac 100644 --- a/services/objectstorage/wait/wait.go +++ b/services/objectstorage/wait/wait.go @@ -5,7 +5,7 @@ import ( "fmt" "net/http" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/core/wait" "github.com/stackitcloud/stackit-sdk-go/services/objectstorage" ) @@ -34,7 +34,7 @@ func DeleteBucketWaitHandler(ctx context.Context, a APIClientBucketInterface, pr if err == nil { return s, false, nil } - oapiErr, ok := err.(*oapiError.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if !ok { return nil, false, fmt.Errorf("could not convert error to GenericOpenApiError") } diff --git a/services/objectstorage/wait/wait_test.go b/services/objectstorage/wait/wait_test.go index c64f5487..8187ac95 100644 --- a/services/objectstorage/wait/wait_test.go +++ b/services/objectstorage/wait/wait_test.go @@ -6,7 +6,7 @@ import ( "time" "github.com/google/go-cmp/cmp" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/services/objectstorage" ) @@ -18,13 +18,13 @@ type apiClientBucketMocked struct { func (a *apiClientBucketMocked) GetBucketExecute(_ context.Context, _, _ string) (*objectstorage.GetBucketResponse, error) { if a.bucketGetFails { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 500, } } if a.bucketIsDeleted { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 404, } } diff --git a/services/opensearch/api_default.go b/services/opensearch/api_default.go index f2ffd116..0774ae57 100644 --- a/services/opensearch/api_default.go +++ b/services/opensearch/api_default.go @@ -19,7 +19,7 @@ import ( "net/url" "strings" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" ) // DefaultApiService DefaultApi service @@ -42,7 +42,7 @@ func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateCredentials") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" @@ -88,7 +88,7 @@ func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -100,7 +100,7 @@ func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -108,7 +108,7 @@ func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -172,7 +172,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateInstance") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances" @@ -222,7 +222,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -234,7 +234,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -245,7 +245,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -253,7 +253,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -307,7 +307,7 @@ func (r ApiDeleteCredentialsRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteCredentials") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{credentialsId}" @@ -354,7 +354,7 @@ func (r ApiDeleteCredentialsRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -366,7 +366,7 @@ func (r ApiDeleteCredentialsRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return newErr @@ -423,7 +423,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteInstance") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -469,7 +469,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -481,7 +481,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -492,7 +492,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return newErr @@ -548,7 +548,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCredentials") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{credentialsId}" @@ -595,7 +595,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -607,7 +607,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -615,7 +615,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -675,7 +675,7 @@ func (r ApiGetCredentialsIdsRequest) Execute() (*CredentialsIdsResponse, error) a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCredentialsIds") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" @@ -721,7 +721,7 @@ func (r ApiGetCredentialsIdsRequest) Execute() (*CredentialsIdsResponse, error) } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -733,7 +733,7 @@ func (r ApiGetCredentialsIdsRequest) Execute() (*CredentialsIdsResponse, error) newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -741,7 +741,7 @@ func (r ApiGetCredentialsIdsRequest) Execute() (*CredentialsIdsResponse, error) err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -798,7 +798,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstance") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -844,7 +844,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -856,7 +856,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -867,7 +867,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -875,7 +875,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -931,7 +931,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstanceList, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstances") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances" @@ -976,7 +976,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstanceList, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -988,7 +988,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstanceList, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -996,7 +996,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstanceList, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1049,7 +1049,7 @@ func (r ApiGetOfferingsRequest) Execute() (*OfferingList, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetOfferings") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/offerings" @@ -1094,7 +1094,7 @@ func (r ApiGetOfferingsRequest) Execute() (*OfferingList, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1104,7 +1104,7 @@ func (r ApiGetOfferingsRequest) Execute() (*OfferingList, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1165,7 +1165,7 @@ func (r ApiUpdateInstanceRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateInstance") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -1216,7 +1216,7 @@ func (r ApiUpdateInstanceRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1228,7 +1228,7 @@ func (r ApiUpdateInstanceRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -1239,7 +1239,7 @@ func (r ApiUpdateInstanceRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return newErr diff --git a/services/opensearch/wait/wait.go b/services/opensearch/wait/wait.go index 91dd5786..f2bbf948 100644 --- a/services/opensearch/wait/wait.go +++ b/services/opensearch/wait/wait.go @@ -6,7 +6,7 @@ import ( "net/http" "strings" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/core/wait" "github.com/stackitcloud/stackit-sdk-go/services/opensearch" ) @@ -88,9 +88,9 @@ func DeleteInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface } return s, false, nil } - oapiErr, ok := err.(*oapiError.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if !ok { - return nil, false, fmt.Errorf("could not convert error to oapiError.GenericOpenAPIError") + return nil, false, fmt.Errorf("could not convert error to oapierror.GenericOpenAPIError") } if oapiErr.StatusCode != http.StatusGone { return nil, false, err @@ -104,9 +104,9 @@ func CreateCredentialsWaitHandler(ctx context.Context, a APIClientCredentialsInt return wait.New(func() (res interface{}, done bool, err error) { s, err := a.GetCredentialsExecute(ctx, projectId, instanceId, credentialsId) if err != nil { - oapiErr, ok := err.(*oapiError.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if !ok { - return nil, false, fmt.Errorf("could not convert error to oapiError.GenericOpenAPIError") + return nil, false, fmt.Errorf("could not convert error to oapierror.GenericOpenAPIError") } // If the request returns 404, the credentials have not been created yet if oapiErr.StatusCode == http.StatusNotFound { @@ -126,9 +126,9 @@ func DeleteCredentialsWaitHandler(ctx context.Context, a APIClientCredentialsInt return wait.New(func() (res interface{}, done bool, err error) { s, err := a.GetCredentialsExecute(ctx, projectId, instanceId, credentialsId) if err != nil { - oapiErr, ok := err.(*oapiError.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if !ok { - return nil, false, fmt.Errorf("could not convert error to oapiError.GenericOpenAPIError") + return nil, false, fmt.Errorf("could not convert error to oapierror.GenericOpenAPIError") } if oapiErr.StatusCode != http.StatusNotFound && oapiErr.StatusCode != http.StatusGone { return nil, false, err diff --git a/services/opensearch/wait/wait_test.go b/services/opensearch/wait/wait_test.go index 41acd434..045b8a1c 100644 --- a/services/opensearch/wait/wait_test.go +++ b/services/opensearch/wait/wait_test.go @@ -6,7 +6,7 @@ import ( "time" "github.com/google/go-cmp/cmp" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/core/utils" "github.com/stackitcloud/stackit-sdk-go/services/opensearch" ) @@ -29,7 +29,7 @@ var ( func (a *apiClientInstanceMocked) GetInstanceExecute(_ context.Context, _, _ string) (*opensearch.Instance, error) { if a.getFails { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 500, } } @@ -44,7 +44,7 @@ func (a *apiClientInstanceMocked) GetInstanceExecute(_ context.Context, _, _ str }, }, nil } - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 410, } } @@ -69,13 +69,13 @@ type apiClientCredentialsMocked struct { func (a *apiClientCredentialsMocked) GetCredentialsExecute(_ context.Context, _, _, _ string) (*opensearch.CredentialsResponse, error) { if a.getFails { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 500, } } if !a.operationSucceeds || a.deletionSucceeds { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 404, } } diff --git a/services/postgresflex/api_default.go b/services/postgresflex/api_default.go index 8b94e3bb..4ebe6677 100644 --- a/services/postgresflex/api_default.go +++ b/services/postgresflex/api_default.go @@ -19,7 +19,7 @@ import ( "net/url" "strings" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" ) // DefaultApiService DefaultApi service @@ -49,7 +49,7 @@ func (r ApiCreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateInstance") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances" @@ -99,7 +99,7 @@ func (r ApiCreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -111,7 +111,7 @@ func (r ApiCreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -120,7 +120,7 @@ func (r ApiCreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -182,7 +182,7 @@ func (r ApiCreateUserRequest) Execute() (*CreateUserResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateUser") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users" @@ -233,7 +233,7 @@ func (r ApiCreateUserRequest) Execute() (*CreateUserResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -245,7 +245,7 @@ func (r ApiCreateUserRequest) Execute() (*CreateUserResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -254,7 +254,7 @@ func (r ApiCreateUserRequest) Execute() (*CreateUserResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -310,7 +310,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteInstance") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -356,7 +356,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -368,7 +368,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -424,7 +424,7 @@ func (r ApiDeleteUserRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteUser") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" @@ -471,7 +471,7 @@ func (r ApiDeleteUserRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -483,7 +483,7 @@ func (r ApiDeleteUserRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -543,7 +543,7 @@ func (r ApiGetBackupRequest) Execute() (*BackupResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetBackup") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups/{backupId}" @@ -590,7 +590,7 @@ func (r ApiGetBackupRequest) Execute() (*BackupResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -602,7 +602,7 @@ func (r ApiGetBackupRequest) Execute() (*BackupResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -611,7 +611,7 @@ func (r ApiGetBackupRequest) Execute() (*BackupResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -671,7 +671,7 @@ func (r ApiGetBackupsRequest) Execute() (*BackupsResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetBackups") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups" @@ -717,7 +717,7 @@ func (r ApiGetBackupsRequest) Execute() (*BackupsResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -729,7 +729,7 @@ func (r ApiGetBackupsRequest) Execute() (*BackupsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -738,7 +738,7 @@ func (r ApiGetBackupsRequest) Execute() (*BackupsResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -794,7 +794,7 @@ func (r ApiGetFlavorsRequest) Execute() (*FlavorsResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetFlavors") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/flavors" @@ -839,7 +839,7 @@ func (r ApiGetFlavorsRequest) Execute() (*FlavorsResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -851,7 +851,7 @@ func (r ApiGetFlavorsRequest) Execute() (*FlavorsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -860,7 +860,7 @@ func (r ApiGetFlavorsRequest) Execute() (*FlavorsResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -914,7 +914,7 @@ func (r ApiGetInstanceRequest) Execute() (*InstanceResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstance") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -960,7 +960,7 @@ func (r ApiGetInstanceRequest) Execute() (*InstanceResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -972,7 +972,7 @@ func (r ApiGetInstanceRequest) Execute() (*InstanceResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -981,7 +981,7 @@ func (r ApiGetInstanceRequest) Execute() (*InstanceResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1037,7 +1037,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstancesResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstances") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances" @@ -1082,7 +1082,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstancesResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1094,7 +1094,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstancesResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1103,7 +1103,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstancesResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1157,7 +1157,7 @@ func (r ApiGetStoragesRequest) Execute() (*StoragesResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetStorages") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/storages/{flavorId}" @@ -1203,7 +1203,7 @@ func (r ApiGetStoragesRequest) Execute() (*StoragesResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1215,7 +1215,7 @@ func (r ApiGetStoragesRequest) Execute() (*StoragesResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1224,7 +1224,7 @@ func (r ApiGetStoragesRequest) Execute() (*StoragesResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1282,7 +1282,7 @@ func (r ApiGetUserRequest) Execute() (*UserResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetUser") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" @@ -1329,7 +1329,7 @@ func (r ApiGetUserRequest) Execute() (*UserResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1341,7 +1341,7 @@ func (r ApiGetUserRequest) Execute() (*UserResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1350,7 +1350,7 @@ func (r ApiGetUserRequest) Execute() (*UserResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1410,7 +1410,7 @@ func (r ApiGetUsersRequest) Execute() (*UsersResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetUsers") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users" @@ -1456,7 +1456,7 @@ func (r ApiGetUsersRequest) Execute() (*UsersResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1468,7 +1468,7 @@ func (r ApiGetUsersRequest) Execute() (*UsersResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1477,7 +1477,7 @@ func (r ApiGetUsersRequest) Execute() (*UsersResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1541,7 +1541,7 @@ func (r ApiGetVersionsRequest) Execute() (*VersionsResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetVersions") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/versions" @@ -1589,7 +1589,7 @@ func (r ApiGetVersionsRequest) Execute() (*VersionsResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1601,7 +1601,7 @@ func (r ApiGetVersionsRequest) Execute() (*VersionsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1610,7 +1610,7 @@ func (r ApiGetVersionsRequest) Execute() (*VersionsResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1671,7 +1671,7 @@ func (r ApiUpdateBackupScheduleRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateBackupSchedule") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups" @@ -1722,7 +1722,7 @@ func (r ApiUpdateBackupScheduleRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1734,7 +1734,7 @@ func (r ApiUpdateBackupScheduleRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -1798,7 +1798,7 @@ func (r ApiUpdateInstanceRequest) Execute() (*UpdateInstanceResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateInstance") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -1849,7 +1849,7 @@ func (r ApiUpdateInstanceRequest) Execute() (*UpdateInstanceResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1861,7 +1861,7 @@ func (r ApiUpdateInstanceRequest) Execute() (*UpdateInstanceResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1870,7 +1870,7 @@ func (r ApiUpdateInstanceRequest) Execute() (*UpdateInstanceResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), diff --git a/services/postgresflex/wait/wait.go b/services/postgresflex/wait/wait.go index 33ec68dc..5d8ae3a5 100644 --- a/services/postgresflex/wait/wait.go +++ b/services/postgresflex/wait/wait.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/core/wait" "github.com/stackitcloud/stackit-sdk-go/services/postgresflex" ) @@ -62,7 +62,7 @@ func CreateInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface if err == nil { return instanceGetResponse, true, nil } - oapiErr, ok := err.(*oapiError.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if !ok { return nil, false, err } @@ -105,7 +105,7 @@ func DeleteInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface if err == nil { return s, false, nil } - oapiErr, ok := err.(*oapiError.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if !ok { return nil, false, err } @@ -123,7 +123,7 @@ func DeleteUserWaitHandler(ctx context.Context, a APIClientUserInterface, projec if err == nil { return u, false, nil } - oapiErr, ok := err.(*oapiError.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if !ok { return nil, false, err } diff --git a/services/postgresflex/wait/wait_test.go b/services/postgresflex/wait/wait_test.go index ca75e080..35d9ea21 100644 --- a/services/postgresflex/wait/wait_test.go +++ b/services/postgresflex/wait/wait_test.go @@ -6,7 +6,7 @@ import ( "time" "github.com/google/go-cmp/cmp" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/services/postgresflex" ) @@ -21,13 +21,13 @@ type apiClientInstanceMocked struct { func (a *apiClientInstanceMocked) GetInstanceExecute(_ context.Context, _, _ string) (*postgresflex.InstanceResponse, error) { if a.instanceGetFails { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 500, } } if a.instanceIsDeleted { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 404, } } @@ -42,7 +42,7 @@ func (a *apiClientInstanceMocked) GetInstanceExecute(_ context.Context, _, _ str func (a *apiClientInstanceMocked) GetUsersExecute(_ context.Context, _, _ string) (*postgresflex.UsersResponse, error) { if a.usersGetErrorStatus != 0 { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: a.usersGetErrorStatus, } } @@ -63,13 +63,13 @@ type apiClientUserMocked struct { func (a *apiClientUserMocked) GetUserExecute(_ context.Context, _, _, _ string) (*postgresflex.UserResponse, error) { if a.getFails { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 500, } } if a.isUserDeleted { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 404, } } diff --git a/services/postgresql/api_default.go b/services/postgresql/api_default.go index bd377617..c70073c8 100644 --- a/services/postgresql/api_default.go +++ b/services/postgresql/api_default.go @@ -19,7 +19,7 @@ import ( "net/url" "strings" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" ) // DefaultApiService DefaultApi service @@ -42,7 +42,7 @@ func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateCredentials") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" @@ -88,7 +88,7 @@ func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -100,7 +100,7 @@ func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -108,7 +108,7 @@ func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -172,7 +172,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateInstance") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances" @@ -222,7 +222,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -234,7 +234,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -245,7 +245,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -253,7 +253,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -307,7 +307,7 @@ func (r ApiDeleteCredentialsRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteCredentials") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{credentialsId}" @@ -354,7 +354,7 @@ func (r ApiDeleteCredentialsRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -366,7 +366,7 @@ func (r ApiDeleteCredentialsRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return newErr @@ -423,7 +423,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteInstance") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -469,7 +469,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -481,7 +481,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -492,7 +492,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return newErr @@ -548,7 +548,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCredentials") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{credentialsId}" @@ -595,7 +595,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -607,7 +607,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -615,7 +615,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -675,7 +675,7 @@ func (r ApiGetCredentialsIdsRequest) Execute() (*CredentialsIdsResponse, error) a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCredentialsIds") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" @@ -721,7 +721,7 @@ func (r ApiGetCredentialsIdsRequest) Execute() (*CredentialsIdsResponse, error) } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -733,7 +733,7 @@ func (r ApiGetCredentialsIdsRequest) Execute() (*CredentialsIdsResponse, error) newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -741,7 +741,7 @@ func (r ApiGetCredentialsIdsRequest) Execute() (*CredentialsIdsResponse, error) err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -798,7 +798,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstance") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -844,7 +844,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -856,7 +856,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -867,7 +867,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -875,7 +875,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -931,7 +931,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstanceList, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstances") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances" @@ -976,7 +976,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstanceList, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -988,7 +988,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstanceList, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -996,7 +996,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstanceList, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1049,7 +1049,7 @@ func (r ApiGetOfferingsRequest) Execute() (*OfferingList, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetOfferings") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/offerings" @@ -1094,7 +1094,7 @@ func (r ApiGetOfferingsRequest) Execute() (*OfferingList, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1104,7 +1104,7 @@ func (r ApiGetOfferingsRequest) Execute() (*OfferingList, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1165,7 +1165,7 @@ func (r ApiUpdateInstanceRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateInstance") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -1216,7 +1216,7 @@ func (r ApiUpdateInstanceRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1228,7 +1228,7 @@ func (r ApiUpdateInstanceRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -1239,7 +1239,7 @@ func (r ApiUpdateInstanceRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return newErr diff --git a/services/postgresql/wait/wait.go b/services/postgresql/wait/wait.go index 60a615bb..a00aba24 100644 --- a/services/postgresql/wait/wait.go +++ b/services/postgresql/wait/wait.go @@ -6,7 +6,7 @@ import ( "net/http" "strings" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/core/wait" "github.com/stackitcloud/stackit-sdk-go/services/postgresql" ) @@ -88,9 +88,9 @@ func DeleteInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface } return s, false, nil } - oapiErr, ok := err.(*oapiError.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if !ok { - return nil, false, fmt.Errorf("could not convert error to oapiError.GenericOpenAPIError") + return nil, false, fmt.Errorf("could not convert error to oapierror.GenericOpenAPIError") } if oapiErr.StatusCode != http.StatusGone { return nil, false, err @@ -104,9 +104,9 @@ func CreateCredentialsWaitHandler(ctx context.Context, a APIClientCredentialsInt return wait.New(func() (res interface{}, done bool, err error) { s, err := a.GetCredentialsExecute(ctx, projectId, instanceId, credentialsId) if err != nil { - oapiErr, ok := err.(*oapiError.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if !ok { - return nil, false, fmt.Errorf("could not convert error to oapiError.GenericOpenAPIError") + return nil, false, fmt.Errorf("could not convert error to oapierror.GenericOpenAPIError") } // If the request returns 404, the credentials have not been created yet if oapiErr.StatusCode == http.StatusNotFound { @@ -126,9 +126,9 @@ func DeleteCredentialsWaitHandler(ctx context.Context, a APIClientCredentialsInt return wait.New(func() (res interface{}, done bool, err error) { s, err := a.GetCredentialsExecute(ctx, projectId, instanceId, credentialsId) if err != nil { - oapiErr, ok := err.(*oapiError.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if !ok { - return nil, false, fmt.Errorf("could not convert error to oapiError.GenericOpenAPIError") + return nil, false, fmt.Errorf("could not convert error to oapierror.GenericOpenAPIError") } if oapiErr.StatusCode != http.StatusNotFound && oapiErr.StatusCode != http.StatusGone { return nil, false, err diff --git a/services/postgresql/wait/wait_test.go b/services/postgresql/wait/wait_test.go index b536e1bd..64e35dd7 100644 --- a/services/postgresql/wait/wait_test.go +++ b/services/postgresql/wait/wait_test.go @@ -6,7 +6,7 @@ import ( "time" "github.com/google/go-cmp/cmp" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/core/utils" "github.com/stackitcloud/stackit-sdk-go/services/postgresql" ) @@ -23,7 +23,7 @@ type apiClientInstanceMocked struct { func (a *apiClientInstanceMocked) GetInstanceExecute(_ context.Context, _, _ string) (*postgresql.Instance, error) { if a.getFails { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 500, } } @@ -38,7 +38,7 @@ func (a *apiClientInstanceMocked) GetInstanceExecute(_ context.Context, _, _ str }, }, nil } - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 410, } } @@ -63,13 +63,13 @@ type apiClientCredentialsMocked struct { func (a *apiClientCredentialsMocked) GetCredentialsExecute(_ context.Context, _, _, _ string) (*postgresql.CredentialsResponse, error) { if a.getFails { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 500, } } if !a.operationSucceeds || a.deletionSucceeds { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 404, } } diff --git a/services/rabbitmq/api_default.go b/services/rabbitmq/api_default.go index 72453bdf..85b8c0c8 100644 --- a/services/rabbitmq/api_default.go +++ b/services/rabbitmq/api_default.go @@ -19,7 +19,7 @@ import ( "net/url" "strings" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" ) // DefaultApiService DefaultApi service @@ -42,7 +42,7 @@ func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateCredentials") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" @@ -88,7 +88,7 @@ func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -100,7 +100,7 @@ func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -108,7 +108,7 @@ func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -172,7 +172,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateInstance") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances" @@ -222,7 +222,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -234,7 +234,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -245,7 +245,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -253,7 +253,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -307,7 +307,7 @@ func (r ApiDeleteCredentialsRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteCredentials") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{credentialsId}" @@ -354,7 +354,7 @@ func (r ApiDeleteCredentialsRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -366,7 +366,7 @@ func (r ApiDeleteCredentialsRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return newErr @@ -423,7 +423,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteInstance") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -469,7 +469,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -481,7 +481,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -492,7 +492,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return newErr @@ -548,7 +548,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCredentials") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{credentialsId}" @@ -595,7 +595,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -607,7 +607,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -615,7 +615,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -675,7 +675,7 @@ func (r ApiGetCredentialsIdsRequest) Execute() (*CredentialsIdsResponse, error) a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCredentialsIds") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" @@ -721,7 +721,7 @@ func (r ApiGetCredentialsIdsRequest) Execute() (*CredentialsIdsResponse, error) } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -733,7 +733,7 @@ func (r ApiGetCredentialsIdsRequest) Execute() (*CredentialsIdsResponse, error) newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -741,7 +741,7 @@ func (r ApiGetCredentialsIdsRequest) Execute() (*CredentialsIdsResponse, error) err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -798,7 +798,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstance") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -844,7 +844,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -856,7 +856,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -867,7 +867,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -875,7 +875,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -931,7 +931,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstanceList, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstances") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances" @@ -976,7 +976,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstanceList, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -988,7 +988,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstanceList, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -996,7 +996,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstanceList, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1049,7 +1049,7 @@ func (r ApiGetOfferingsRequest) Execute() (*OfferingList, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetOfferings") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/offerings" @@ -1094,7 +1094,7 @@ func (r ApiGetOfferingsRequest) Execute() (*OfferingList, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1104,7 +1104,7 @@ func (r ApiGetOfferingsRequest) Execute() (*OfferingList, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1165,7 +1165,7 @@ func (r ApiUpdateInstanceRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateInstance") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -1216,7 +1216,7 @@ func (r ApiUpdateInstanceRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1228,7 +1228,7 @@ func (r ApiUpdateInstanceRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -1239,7 +1239,7 @@ func (r ApiUpdateInstanceRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return newErr diff --git a/services/rabbitmq/wait/wait.go b/services/rabbitmq/wait/wait.go index afa27765..0ef2f3b0 100644 --- a/services/rabbitmq/wait/wait.go +++ b/services/rabbitmq/wait/wait.go @@ -6,7 +6,7 @@ import ( "net/http" "strings" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/core/wait" "github.com/stackitcloud/stackit-sdk-go/services/rabbitmq" ) @@ -88,9 +88,9 @@ func DeleteInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface } return s, false, nil } - oapiErr, ok := err.(*oapiError.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if !ok { - return nil, false, fmt.Errorf("could not convert error to oapiError.GenericOpenAPIError") + return nil, false, fmt.Errorf("could not convert error to oapierror.GenericOpenAPIError") } if oapiErr.StatusCode != http.StatusGone { return nil, false, err @@ -104,9 +104,9 @@ func CreateCredentialsWaitHandler(ctx context.Context, a APIClientCredentialsInt return wait.New(func() (res interface{}, done bool, err error) { s, err := a.GetCredentialsExecute(ctx, projectId, instanceId, credentialsId) if err != nil { - oapiErr, ok := err.(*oapiError.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if !ok { - return nil, false, fmt.Errorf("could not convert error to oapiError.GenericOpenAPIError") + return nil, false, fmt.Errorf("could not convert error to oapierror.GenericOpenAPIError") } // If the request returns 404, the credentials have not been created yet if oapiErr.StatusCode == http.StatusNotFound { @@ -126,9 +126,9 @@ func DeleteCredentialsWaitHandler(ctx context.Context, a APIClientCredentialsInt return wait.New(func() (res interface{}, done bool, err error) { s, err := a.GetCredentialsExecute(ctx, projectId, instanceId, credentialsId) if err != nil { - oapiErr, ok := err.(*oapiError.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if !ok { - return nil, false, fmt.Errorf("could not convert error to oapiError.GenericOpenAPIError") + return nil, false, fmt.Errorf("could not convert error to oapierror.GenericOpenAPIError") } if oapiErr.StatusCode != http.StatusNotFound && oapiErr.StatusCode != http.StatusGone { return nil, false, err diff --git a/services/rabbitmq/wait/wait_test.go b/services/rabbitmq/wait/wait_test.go index 806eefd1..ec7dc20d 100644 --- a/services/rabbitmq/wait/wait_test.go +++ b/services/rabbitmq/wait/wait_test.go @@ -6,7 +6,7 @@ import ( "time" "github.com/google/go-cmp/cmp" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/core/utils" "github.com/stackitcloud/stackit-sdk-go/services/rabbitmq" ) @@ -29,7 +29,7 @@ var ( func (a *apiClientInstanceMocked) GetInstanceExecute(_ context.Context, _, _ string) (*rabbitmq.Instance, error) { if a.getFails { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 500, } } @@ -44,7 +44,7 @@ func (a *apiClientInstanceMocked) GetInstanceExecute(_ context.Context, _, _ str }, }, nil } - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 410, } } @@ -69,13 +69,13 @@ type apiClientCredentialsMocked struct { func (a *apiClientCredentialsMocked) GetCredentialsExecute(_ context.Context, _, _, _ string) (*rabbitmq.CredentialsResponse, error) { if a.getFails { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 500, } } if !a.operationSucceeds || a.deletionSucceeds { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 404, } } diff --git a/services/redis/api_default.go b/services/redis/api_default.go index df0051f7..24ca8386 100644 --- a/services/redis/api_default.go +++ b/services/redis/api_default.go @@ -19,7 +19,7 @@ import ( "net/url" "strings" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" ) // DefaultApiService DefaultApi service @@ -42,7 +42,7 @@ func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateCredentials") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" @@ -88,7 +88,7 @@ func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -100,7 +100,7 @@ func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -108,7 +108,7 @@ func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -172,7 +172,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateInstance") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances" @@ -222,7 +222,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -234,7 +234,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -245,7 +245,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -253,7 +253,7 @@ func (r ApiCreateInstanceRequest) Execute() (*InstanceId, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -307,7 +307,7 @@ func (r ApiDeleteCredentialsRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteCredentials") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{credentialsId}" @@ -354,7 +354,7 @@ func (r ApiDeleteCredentialsRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -366,7 +366,7 @@ func (r ApiDeleteCredentialsRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return newErr @@ -423,7 +423,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteInstance") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -469,7 +469,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -481,7 +481,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -492,7 +492,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return newErr @@ -548,7 +548,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCredentials") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{credentialsId}" @@ -595,7 +595,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -607,7 +607,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -615,7 +615,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -675,7 +675,7 @@ func (r ApiGetCredentialsIdsRequest) Execute() (*CredentialsIdsResponse, error) a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCredentialsIds") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" @@ -721,7 +721,7 @@ func (r ApiGetCredentialsIdsRequest) Execute() (*CredentialsIdsResponse, error) } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -733,7 +733,7 @@ func (r ApiGetCredentialsIdsRequest) Execute() (*CredentialsIdsResponse, error) newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -741,7 +741,7 @@ func (r ApiGetCredentialsIdsRequest) Execute() (*CredentialsIdsResponse, error) err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -798,7 +798,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstance") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -844,7 +844,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -856,7 +856,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -867,7 +867,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -875,7 +875,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -931,7 +931,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstanceList, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstances") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances" @@ -976,7 +976,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstanceList, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -988,7 +988,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstanceList, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -996,7 +996,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstanceList, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1049,7 +1049,7 @@ func (r ApiGetOfferingsRequest) Execute() (*OfferingList, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetOfferings") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/offerings" @@ -1094,7 +1094,7 @@ func (r ApiGetOfferingsRequest) Execute() (*OfferingList, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1104,7 +1104,7 @@ func (r ApiGetOfferingsRequest) Execute() (*OfferingList, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1165,7 +1165,7 @@ func (r ApiUpdateInstanceRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateInstance") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -1216,7 +1216,7 @@ func (r ApiUpdateInstanceRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1228,7 +1228,7 @@ func (r ApiUpdateInstanceRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -1239,7 +1239,7 @@ func (r ApiUpdateInstanceRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return newErr diff --git a/services/redis/wait/wait.go b/services/redis/wait/wait.go index dc549bf5..22581ea7 100644 --- a/services/redis/wait/wait.go +++ b/services/redis/wait/wait.go @@ -6,7 +6,7 @@ import ( "net/http" "strings" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/core/wait" "github.com/stackitcloud/stackit-sdk-go/services/redis" ) @@ -88,9 +88,9 @@ func DeleteInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface } return s, false, nil } - oapiErr, ok := err.(*oapiError.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if !ok { - return nil, false, fmt.Errorf("could not convert error to oapiError.GenericOpenAPIError") + return nil, false, fmt.Errorf("could not convert error to oapierror.GenericOpenAPIError") } if oapiErr.StatusCode != http.StatusGone { return nil, false, err @@ -104,9 +104,9 @@ func CreateCredentialsWaitHandler(ctx context.Context, a APIClientCredentialsInt return wait.New(func() (res interface{}, done bool, err error) { s, err := a.GetCredentialsExecute(ctx, projectId, instanceId, credentialsId) if err != nil { - oapiErr, ok := err.(*oapiError.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if !ok { - return nil, false, fmt.Errorf("could not convert error to oapiError.GenericOpenAPIError") + return nil, false, fmt.Errorf("could not convert error to oapierror.GenericOpenAPIError") } // If the request returns 404, the credentials have not been created yet if oapiErr.StatusCode == http.StatusNotFound { @@ -126,9 +126,9 @@ func DeleteCredentialsWaitHandler(ctx context.Context, a APIClientCredentialsInt return wait.New(func() (res interface{}, done bool, err error) { s, err := a.GetCredentialsExecute(ctx, projectId, instanceId, credentialsId) if err != nil { - oapiErr, ok := err.(*oapiError.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if !ok { - return nil, false, fmt.Errorf("could not convert error to oapiError.GenericOpenAPIError") + return nil, false, fmt.Errorf("could not convert error to oapierror.GenericOpenAPIError") } if oapiErr.StatusCode != http.StatusNotFound && oapiErr.StatusCode != http.StatusGone { return nil, false, err diff --git a/services/redis/wait/wait_test.go b/services/redis/wait/wait_test.go index beffb6cc..07097a18 100644 --- a/services/redis/wait/wait_test.go +++ b/services/redis/wait/wait_test.go @@ -6,7 +6,7 @@ import ( "time" "github.com/google/go-cmp/cmp" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/core/utils" "github.com/stackitcloud/stackit-sdk-go/services/redis" ) @@ -29,7 +29,7 @@ var ( func (a *apiClientInstanceMocked) GetInstanceExecute(_ context.Context, _, _ string) (*redis.Instance, error) { if a.getFails { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 500, } } @@ -44,7 +44,7 @@ func (a *apiClientInstanceMocked) GetInstanceExecute(_ context.Context, _, _ str }, }, nil } - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 410, } } @@ -69,13 +69,13 @@ type apiClientCredentialsMocked struct { func (a *apiClientCredentialsMocked) GetCredentialsExecute(_ context.Context, _, _, _ string) (*redis.CredentialsResponse, error) { if a.getFails { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 500, } } if !a.operationSucceeds || a.deletionSucceeds { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: 404, } } diff --git a/services/resourcemanager/api_default.go b/services/resourcemanager/api_default.go index 844a21ab..1c4402a3 100644 --- a/services/resourcemanager/api_default.go +++ b/services/resourcemanager/api_default.go @@ -20,7 +20,7 @@ import ( "strings" "time" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" ) // DefaultApiService DefaultApi service @@ -47,7 +47,7 @@ func (r ApiCreateProjectRequest) Execute() (*ProjectResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateProject") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v2/projects" @@ -93,7 +93,7 @@ func (r ApiCreateProjectRequest) Execute() (*ProjectResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -105,7 +105,7 @@ func (r ApiCreateProjectRequest) Execute() (*ProjectResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -116,7 +116,7 @@ func (r ApiCreateProjectRequest) Execute() (*ProjectResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -127,7 +127,7 @@ func (r ApiCreateProjectRequest) Execute() (*ProjectResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -135,7 +135,7 @@ func (r ApiCreateProjectRequest) Execute() (*ProjectResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -186,7 +186,7 @@ func (r ApiDeleteProjectRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteProject") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v2/projects/{containerId}" @@ -231,7 +231,7 @@ func (r ApiDeleteProjectRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -243,7 +243,7 @@ func (r ApiDeleteProjectRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return newErr @@ -302,7 +302,7 @@ func (r ApiGetProjectRequest) Execute() (*ProjectResponseWithParents, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetProject") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v2/projects/{containerId}" @@ -350,7 +350,7 @@ func (r ApiGetProjectRequest) Execute() (*ProjectResponseWithParents, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -362,7 +362,7 @@ func (r ApiGetProjectRequest) Execute() (*ProjectResponseWithParents, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -373,7 +373,7 @@ func (r ApiGetProjectRequest) Execute() (*ProjectResponseWithParents, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -381,7 +381,7 @@ func (r ApiGetProjectRequest) Execute() (*ProjectResponseWithParents, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -481,7 +481,7 @@ func (r ApiGetProjectsRequest) Execute() (*AllProjectsResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetProjects") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v2/projects" @@ -551,7 +551,7 @@ func (r ApiGetProjectsRequest) Execute() (*AllProjectsResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -563,7 +563,7 @@ func (r ApiGetProjectsRequest) Execute() (*AllProjectsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -574,7 +574,7 @@ func (r ApiGetProjectsRequest) Execute() (*AllProjectsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -585,7 +585,7 @@ func (r ApiGetProjectsRequest) Execute() (*AllProjectsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -593,7 +593,7 @@ func (r ApiGetProjectsRequest) Execute() (*AllProjectsResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -658,7 +658,7 @@ func (r ApiUpdateProjectRequest) Execute() (*ProjectResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateProject") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v2/projects/{containerId}" @@ -705,7 +705,7 @@ func (r ApiUpdateProjectRequest) Execute() (*ProjectResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -717,7 +717,7 @@ func (r ApiUpdateProjectRequest) Execute() (*ProjectResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -728,7 +728,7 @@ func (r ApiUpdateProjectRequest) Execute() (*ProjectResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -739,7 +739,7 @@ func (r ApiUpdateProjectRequest) Execute() (*ProjectResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -747,7 +747,7 @@ func (r ApiUpdateProjectRequest) Execute() (*ProjectResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), diff --git a/services/resourcemanager/wait/wait.go b/services/resourcemanager/wait/wait.go index 9b2fc46b..cb54c206 100644 --- a/services/resourcemanager/wait/wait.go +++ b/services/resourcemanager/wait/wait.go @@ -5,7 +5,7 @@ import ( "fmt" "net/http" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/core/wait" "github.com/stackitcloud/stackit-sdk-go/services/resourcemanager" ) @@ -47,9 +47,9 @@ func DeleteProjectWaitHandler(ctx context.Context, a APIClientInterface, contain return wait.New(func() (res interface{}, done bool, err error) { p, err := a.GetProjectExecute(ctx, containerId) if err != nil { - oapiErr, ok := err.(*oapiError.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if !ok { - return nil, false, fmt.Errorf("could not convert error to oapiError.GenericOpenAPIError") + return nil, false, fmt.Errorf("could not convert error to oapierror.GenericOpenAPIError") } if oapiErr.StatusCode == http.StatusNotFound || oapiErr.StatusCode == http.StatusForbidden { return nil, true, nil diff --git a/services/resourcemanager/wait/wait_test.go b/services/resourcemanager/wait/wait_test.go index 63268892..10195c67 100644 --- a/services/resourcemanager/wait/wait_test.go +++ b/services/resourcemanager/wait/wait_test.go @@ -7,7 +7,7 @@ import ( "time" "github.com/google/go-cmp/cmp" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/core/utils" "github.com/stackitcloud/stackit-sdk-go/services/resourcemanager" ) @@ -20,13 +20,13 @@ type apiClientMocked struct { func (a *apiClientMocked) GetProjectExecute(_ context.Context, _ string) (*resourcemanager.ProjectResponseWithParents, error) { if a.getFails { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: http.StatusInternalServerError, } } if a.getNotFound { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: http.StatusNotFound, } } diff --git a/services/secretsmanager/api_default.go b/services/secretsmanager/api_default.go index 39425494..511dd30f 100644 --- a/services/secretsmanager/api_default.go +++ b/services/secretsmanager/api_default.go @@ -19,7 +19,7 @@ import ( "net/url" "strings" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" ) // DefaultApiService DefaultApi service @@ -48,7 +48,7 @@ func (r ApiCreateAclRequest) Execute() (*Acl, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateAcl") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/acls" @@ -99,7 +99,7 @@ func (r ApiCreateAclRequest) Execute() (*Acl, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -109,7 +109,7 @@ func (r ApiCreateAclRequest) Execute() (*Acl, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -171,7 +171,7 @@ func (r ApiCreateInstanceRequest) Execute() (*Instance, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateInstance") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances" @@ -221,7 +221,7 @@ func (r ApiCreateInstanceRequest) Execute() (*Instance, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -231,7 +231,7 @@ func (r ApiCreateInstanceRequest) Execute() (*Instance, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -291,7 +291,7 @@ func (r ApiCreateUserRequest) Execute() (*User, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateUser") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users" @@ -342,7 +342,7 @@ func (r ApiCreateUserRequest) Execute() (*User, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -352,7 +352,7 @@ func (r ApiCreateUserRequest) Execute() (*User, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -409,7 +409,7 @@ func (r ApiDeleteAclRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteAcl") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/acls/{aclId}" @@ -456,7 +456,7 @@ func (r ApiDeleteAclRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -515,7 +515,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteInstance") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -561,7 +561,7 @@ func (r ApiDeleteInstanceRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -618,7 +618,7 @@ func (r ApiDeleteUserRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteUser") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" @@ -665,7 +665,7 @@ func (r ApiDeleteUserRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -726,7 +726,7 @@ func (r ApiGetAclRequest) Execute() (*Acl, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetAcl") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/acls/{aclId}" @@ -773,7 +773,7 @@ func (r ApiGetAclRequest) Execute() (*Acl, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -783,7 +783,7 @@ func (r ApiGetAclRequest) Execute() (*Acl, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -843,7 +843,7 @@ func (r ApiGetAclsRequest) Execute() (*AclList, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetAcls") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/acls" @@ -889,7 +889,7 @@ func (r ApiGetAclsRequest) Execute() (*AclList, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -899,7 +899,7 @@ func (r ApiGetAclsRequest) Execute() (*AclList, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -956,7 +956,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstance") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" @@ -1002,7 +1002,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1012,7 +1012,7 @@ func (r ApiGetInstanceRequest) Execute() (*Instance, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1068,7 +1068,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstanceList, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstances") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances" @@ -1113,7 +1113,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstanceList, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1123,7 +1123,7 @@ func (r ApiGetInstancesRequest) Execute() (*InstanceList, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1178,7 +1178,7 @@ func (r ApiGetUserRequest) Execute() (*User, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetUser") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" @@ -1225,7 +1225,7 @@ func (r ApiGetUserRequest) Execute() (*User, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1235,7 +1235,7 @@ func (r ApiGetUserRequest) Execute() (*User, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1295,7 +1295,7 @@ func (r ApiGetUsersRequest) Execute() (*UserList, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetUsers") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users" @@ -1341,7 +1341,7 @@ func (r ApiGetUsersRequest) Execute() (*UserList, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1351,7 +1351,7 @@ func (r ApiGetUsersRequest) Execute() (*UserList, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1414,7 +1414,7 @@ func (r ApiUpdateAclRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateAcl") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/acls/{aclId}" @@ -1466,7 +1466,7 @@ func (r ApiUpdateAclRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1532,7 +1532,7 @@ func (r ApiUpdateUserRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateUser") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" @@ -1584,7 +1584,7 @@ func (r ApiUpdateUserRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, diff --git a/services/serviceaccount/api_default.go b/services/serviceaccount/api_default.go index cb6c4329..52682236 100644 --- a/services/serviceaccount/api_default.go +++ b/services/serviceaccount/api_default.go @@ -19,7 +19,7 @@ import ( "net/url" "strings" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" ) // DefaultApiService DefaultApi service @@ -50,7 +50,7 @@ func (r ApiCreateAccessTokenRequest) Execute() (*AccessToken, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateAccessToken") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v2/projects/{projectId}/service-accounts/{serviceAccountEmail}/access-tokens" @@ -98,7 +98,7 @@ func (r ApiCreateAccessTokenRequest) Execute() (*AccessToken, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -110,7 +110,7 @@ func (r ApiCreateAccessTokenRequest) Execute() (*AccessToken, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -121,7 +121,7 @@ func (r ApiCreateAccessTokenRequest) Execute() (*AccessToken, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -132,7 +132,7 @@ func (r ApiCreateAccessTokenRequest) Execute() (*AccessToken, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -143,7 +143,7 @@ func (r ApiCreateAccessTokenRequest) Execute() (*AccessToken, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -151,7 +151,7 @@ func (r ApiCreateAccessTokenRequest) Execute() (*AccessToken, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -215,7 +215,7 @@ func (r ApiCreateServiceAccountRequest) Execute() (*ServiceAccount, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateServiceAccount") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v2/projects/{projectId}/service-accounts" @@ -262,7 +262,7 @@ func (r ApiCreateServiceAccountRequest) Execute() (*ServiceAccount, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -274,7 +274,7 @@ func (r ApiCreateServiceAccountRequest) Execute() (*ServiceAccount, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -285,7 +285,7 @@ func (r ApiCreateServiceAccountRequest) Execute() (*ServiceAccount, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -296,7 +296,7 @@ func (r ApiCreateServiceAccountRequest) Execute() (*ServiceAccount, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -307,7 +307,7 @@ func (r ApiCreateServiceAccountRequest) Execute() (*ServiceAccount, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -315,7 +315,7 @@ func (r ApiCreateServiceAccountRequest) Execute() (*ServiceAccount, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -377,7 +377,7 @@ func (r ApiCreateServiceAccountKeyRequest) Execute() (*CreateServiceAccountKeyRe a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateServiceAccountKey") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v2/projects/{projectId}/service-accounts/{serviceAccountEmail}/keys" @@ -425,7 +425,7 @@ func (r ApiCreateServiceAccountKeyRequest) Execute() (*CreateServiceAccountKeyRe } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -437,7 +437,7 @@ func (r ApiCreateServiceAccountKeyRequest) Execute() (*CreateServiceAccountKeyRe newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -448,7 +448,7 @@ func (r ApiCreateServiceAccountKeyRequest) Execute() (*CreateServiceAccountKeyRe newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -459,7 +459,7 @@ func (r ApiCreateServiceAccountKeyRequest) Execute() (*CreateServiceAccountKeyRe newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -470,7 +470,7 @@ func (r ApiCreateServiceAccountKeyRequest) Execute() (*CreateServiceAccountKeyRe newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -478,7 +478,7 @@ func (r ApiCreateServiceAccountKeyRequest) Execute() (*CreateServiceAccountKeyRe err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -557,7 +557,7 @@ func (r ApiCreateShortLivedAccessTokenRequest) Execute() (*CreateShortLivedAcces a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateShortLivedAccessToken") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/token" @@ -611,7 +611,7 @@ func (r ApiCreateShortLivedAccessTokenRequest) Execute() (*CreateShortLivedAcces } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -621,7 +621,7 @@ func (r ApiCreateShortLivedAccessTokenRequest) Execute() (*CreateShortLivedAcces err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -673,7 +673,7 @@ func (r ApiDeleteAccessTokenRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteAccessToken") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v2/projects/{projectId}/service-accounts/{serviceAccountEmail}/access-tokens/{accessTokenId}" @@ -720,7 +720,7 @@ func (r ApiDeleteAccessTokenRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -732,7 +732,7 @@ func (r ApiDeleteAccessTokenRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -743,7 +743,7 @@ func (r ApiDeleteAccessTokenRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -754,7 +754,7 @@ func (r ApiDeleteAccessTokenRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -765,7 +765,7 @@ func (r ApiDeleteAccessTokenRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -776,7 +776,7 @@ func (r ApiDeleteAccessTokenRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return newErr @@ -833,7 +833,7 @@ func (r ApiDeleteServiceAccountRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteServiceAccount") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v2/projects/{projectId}/service-accounts/{serviceAccountEmail}" @@ -879,7 +879,7 @@ func (r ApiDeleteServiceAccountRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -891,7 +891,7 @@ func (r ApiDeleteServiceAccountRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -902,7 +902,7 @@ func (r ApiDeleteServiceAccountRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -913,7 +913,7 @@ func (r ApiDeleteServiceAccountRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -924,7 +924,7 @@ func (r ApiDeleteServiceAccountRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return newErr @@ -979,7 +979,7 @@ func (r ApiDeleteServiceAccountKeyRequest) Execute() error { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteServiceAccountKey") if err != nil { - return &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v2/projects/{projectId}/service-accounts/{serviceAccountEmail}/keys/{keyId}" @@ -1026,7 +1026,7 @@ func (r ApiDeleteServiceAccountKeyRequest) Execute() error { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1038,7 +1038,7 @@ func (r ApiDeleteServiceAccountKeyRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -1049,7 +1049,7 @@ func (r ApiDeleteServiceAccountKeyRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return newErr } @@ -1060,7 +1060,7 @@ func (r ApiDeleteServiceAccountKeyRequest) Execute() error { newErr.ErrorMessage = err.Error() return newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return newErr @@ -1118,7 +1118,7 @@ func (r ApiGetAccessTokensRequest) Execute() (*AccessTokensResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetAccessTokens") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v2/projects/{projectId}/service-accounts/{serviceAccountEmail}/access-tokens" @@ -1164,7 +1164,7 @@ func (r ApiGetAccessTokensRequest) Execute() (*AccessTokensResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1176,7 +1176,7 @@ func (r ApiGetAccessTokensRequest) Execute() (*AccessTokensResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1187,7 +1187,7 @@ func (r ApiGetAccessTokensRequest) Execute() (*AccessTokensResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1198,7 +1198,7 @@ func (r ApiGetAccessTokensRequest) Execute() (*AccessTokensResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1209,7 +1209,7 @@ func (r ApiGetAccessTokensRequest) Execute() (*AccessTokensResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -1217,7 +1217,7 @@ func (r ApiGetAccessTokensRequest) Execute() (*AccessTokensResponse, error) { err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1273,7 +1273,7 @@ func (r ApiGetServiceAccountJWKSRequest) Execute() (*GetServiceAccountJWKS, erro a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServiceAccountJWKS") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v2/service-accounts/public/jwk/{serviceAccountEmail}" @@ -1318,7 +1318,7 @@ func (r ApiGetServiceAccountJWKSRequest) Execute() (*GetServiceAccountJWKS, erro } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1328,7 +1328,7 @@ func (r ApiGetServiceAccountJWKSRequest) Execute() (*GetServiceAccountJWKS, erro err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1391,7 +1391,7 @@ func (r ApiGetServiceAccountKeyRequest) Execute() (*GetServiceAccountKeyResponse a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServiceAccountKey") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v2/projects/{projectId}/service-accounts/{serviceAccountEmail}/keys/{keyId}" @@ -1441,7 +1441,7 @@ func (r ApiGetServiceAccountKeyRequest) Execute() (*GetServiceAccountKeyResponse } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1453,7 +1453,7 @@ func (r ApiGetServiceAccountKeyRequest) Execute() (*GetServiceAccountKeyResponse newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1464,7 +1464,7 @@ func (r ApiGetServiceAccountKeyRequest) Execute() (*GetServiceAccountKeyResponse newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1475,7 +1475,7 @@ func (r ApiGetServiceAccountKeyRequest) Execute() (*GetServiceAccountKeyResponse newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -1483,7 +1483,7 @@ func (r ApiGetServiceAccountKeyRequest) Execute() (*GetServiceAccountKeyResponse err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1543,7 +1543,7 @@ func (r ApiGetServiceAccountKeysRequest) Execute() (*GetServiceAccountsKeysRespo a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServiceAccountKeys") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v2/projects/{projectId}/service-accounts/{serviceAccountEmail}/keys" @@ -1589,7 +1589,7 @@ func (r ApiGetServiceAccountKeysRequest) Execute() (*GetServiceAccountsKeysRespo } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1601,7 +1601,7 @@ func (r ApiGetServiceAccountKeysRequest) Execute() (*GetServiceAccountsKeysRespo newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1612,7 +1612,7 @@ func (r ApiGetServiceAccountKeysRequest) Execute() (*GetServiceAccountsKeysRespo newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1623,7 +1623,7 @@ func (r ApiGetServiceAccountKeysRequest) Execute() (*GetServiceAccountsKeysRespo newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -1631,7 +1631,7 @@ func (r ApiGetServiceAccountKeysRequest) Execute() (*GetServiceAccountsKeysRespo err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1687,7 +1687,7 @@ func (r ApiGetServiceAccountsRequest) Execute() (*GetServiceAccountsResponse, er a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServiceAccounts") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v2/projects/{projectId}/service-accounts" @@ -1732,7 +1732,7 @@ func (r ApiGetServiceAccountsRequest) Execute() (*GetServiceAccountsResponse, er } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1744,7 +1744,7 @@ func (r ApiGetServiceAccountsRequest) Execute() (*GetServiceAccountsResponse, er newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1755,7 +1755,7 @@ func (r ApiGetServiceAccountsRequest) Execute() (*GetServiceAccountsResponse, er newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1766,7 +1766,7 @@ func (r ApiGetServiceAccountsRequest) Execute() (*GetServiceAccountsResponse, er newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -1774,7 +1774,7 @@ func (r ApiGetServiceAccountsRequest) Execute() (*GetServiceAccountsResponse, er err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1837,7 +1837,7 @@ func (r ApiUpdateServiceAccountKeyRequest) Execute() (*UpdateServiceAccountKeyRe a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateServiceAccountKey") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v2/projects/{projectId}/service-accounts/{serviceAccountEmail}/keys/{keyId}" @@ -1886,7 +1886,7 @@ func (r ApiUpdateServiceAccountKeyRequest) Execute() (*UpdateServiceAccountKeyRe } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1898,7 +1898,7 @@ func (r ApiUpdateServiceAccountKeyRequest) Execute() (*UpdateServiceAccountKeyRe newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1909,7 +1909,7 @@ func (r ApiUpdateServiceAccountKeyRequest) Execute() (*UpdateServiceAccountKeyRe newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1920,7 +1920,7 @@ func (r ApiUpdateServiceAccountKeyRequest) Execute() (*UpdateServiceAccountKeyRe newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1931,7 +1931,7 @@ func (r ApiUpdateServiceAccountKeyRequest) Execute() (*UpdateServiceAccountKeyRe newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } return localVarReturnValue, newErr @@ -1939,7 +1939,7 @@ func (r ApiUpdateServiceAccountKeyRequest) Execute() (*UpdateServiceAccountKeyRe err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), diff --git a/services/ske/api_default.go b/services/ske/api_default.go index b78334ad..b78a6835 100644 --- a/services/ske/api_default.go +++ b/services/ske/api_default.go @@ -19,7 +19,7 @@ import ( "net/url" "strings" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" ) // DefaultApiService DefaultApi service @@ -48,7 +48,7 @@ func (r ApiCreateOrUpdateClusterRequest) Execute() (*ClusterResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateOrUpdateCluster") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/clusters/{clusterName}" @@ -99,7 +99,7 @@ func (r ApiCreateOrUpdateClusterRequest) Execute() (*ClusterResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -111,7 +111,7 @@ func (r ApiCreateOrUpdateClusterRequest) Execute() (*ClusterResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -122,7 +122,7 @@ func (r ApiCreateOrUpdateClusterRequest) Execute() (*ClusterResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -132,14 +132,14 @@ func (r ApiCreateOrUpdateClusterRequest) Execute() (*ClusterResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -195,7 +195,7 @@ func (r ApiCreateProjectRequest) Execute() (*ProjectResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateProject") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}" @@ -240,7 +240,7 @@ func (r ApiCreateProjectRequest) Execute() (*ProjectResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -252,7 +252,7 @@ func (r ApiCreateProjectRequest) Execute() (*ProjectResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -262,14 +262,14 @@ func (r ApiCreateProjectRequest) Execute() (*ProjectResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -323,7 +323,7 @@ func (r ApiDeleteClusterRequest) Execute() (map[string]interface{}, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteCluster") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/clusters/{clusterName}" @@ -369,7 +369,7 @@ func (r ApiDeleteClusterRequest) Execute() (map[string]interface{}, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -380,14 +380,14 @@ func (r ApiDeleteClusterRequest) Execute() (map[string]interface{}, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -443,7 +443,7 @@ func (r ApiDeleteProjectRequest) Execute() (map[string]interface{}, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteProject") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}" @@ -488,7 +488,7 @@ func (r ApiDeleteProjectRequest) Execute() (map[string]interface{}, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -500,7 +500,7 @@ func (r ApiDeleteProjectRequest) Execute() (map[string]interface{}, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -510,14 +510,14 @@ func (r ApiDeleteProjectRequest) Execute() (map[string]interface{}, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -571,7 +571,7 @@ func (r ApiGetClusterRequest) Execute() (*ClusterResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCluster") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/clusters/{clusterName}" @@ -617,7 +617,7 @@ func (r ApiGetClusterRequest) Execute() (*ClusterResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -628,14 +628,14 @@ func (r ApiGetClusterRequest) Execute() (*ClusterResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -691,7 +691,7 @@ func (r ApiGetClustersRequest) Execute() (*ClustersResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetClusters") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/clusters" @@ -736,7 +736,7 @@ func (r ApiGetClustersRequest) Execute() (*ClustersResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -748,7 +748,7 @@ func (r ApiGetClustersRequest) Execute() (*ClustersResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -759,7 +759,7 @@ func (r ApiGetClustersRequest) Execute() (*ClustersResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -769,14 +769,14 @@ func (r ApiGetClustersRequest) Execute() (*ClustersResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -830,7 +830,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetCredentials") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/clusters/{clusterName}/credentials" @@ -876,7 +876,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -888,7 +888,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -899,7 +899,7 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -909,14 +909,14 @@ func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -971,7 +971,7 @@ func (r ApiGetOptionsRequest) Execute() (*ProviderOptions, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetOptions") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/provider-options" @@ -1015,7 +1015,7 @@ func (r ApiGetOptionsRequest) Execute() (*ProviderOptions, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1026,14 +1026,14 @@ func (r ApiGetOptionsRequest) Execute() (*ProviderOptions, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1083,7 +1083,7 @@ func (r ApiGetProjectRequest) Execute() (*ProjectResponse, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetProject") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}" @@ -1128,7 +1128,7 @@ func (r ApiGetProjectRequest) Execute() (*ProjectResponse, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1140,7 +1140,7 @@ func (r ApiGetProjectRequest) Execute() (*ProjectResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1150,14 +1150,14 @@ func (r ApiGetProjectRequest) Execute() (*ProjectResponse, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1211,7 +1211,7 @@ func (r ApiTriggerHibernateRequest) Execute() (map[string]interface{}, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.TriggerHibernate") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/clusters/{clusterName}/hibernate" @@ -1257,7 +1257,7 @@ func (r ApiTriggerHibernateRequest) Execute() (map[string]interface{}, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1269,7 +1269,7 @@ func (r ApiTriggerHibernateRequest) Execute() (map[string]interface{}, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1279,14 +1279,14 @@ func (r ApiTriggerHibernateRequest) Execute() (map[string]interface{}, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1343,7 +1343,7 @@ func (r ApiTriggerMaintenanceRequest) Execute() (map[string]interface{}, error) a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.TriggerMaintenance") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/clusters/{clusterName}/maintenance" @@ -1389,7 +1389,7 @@ func (r ApiTriggerMaintenanceRequest) Execute() (map[string]interface{}, error) } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1401,7 +1401,7 @@ func (r ApiTriggerMaintenanceRequest) Execute() (map[string]interface{}, error) newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1411,14 +1411,14 @@ func (r ApiTriggerMaintenanceRequest) Execute() (map[string]interface{}, error) newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1475,7 +1475,7 @@ func (r ApiTriggerReconcileRequest) Execute() (map[string]interface{}, error) { a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.TriggerReconcile") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/clusters/{clusterName}/reconcile" @@ -1521,7 +1521,7 @@ func (r ApiTriggerReconcileRequest) Execute() (map[string]interface{}, error) { } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1533,7 +1533,7 @@ func (r ApiTriggerReconcileRequest) Execute() (map[string]interface{}, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1543,14 +1543,14 @@ func (r ApiTriggerReconcileRequest) Execute() (map[string]interface{}, error) { newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), @@ -1607,7 +1607,7 @@ func (r ApiTriggerRotateCredentialsRequest) Execute() (map[string]interface{}, e a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.TriggerRotateCredentials") if err != nil { - return localVarReturnValue, &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } localVarPath := localBasePath + "/v1/projects/{projectId}/clusters/{clusterName}/rotate-credentials" @@ -1653,7 +1653,7 @@ func (r ApiTriggerRotateCredentialsRequest) Execute() (map[string]interface{}, e } if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, @@ -1665,7 +1665,7 @@ func (r ApiTriggerRotateCredentialsRequest) Execute() (map[string]interface{}, e newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } @@ -1675,14 +1675,14 @@ func (r ApiTriggerRotateCredentialsRequest) Execute() (map[string]interface{}, e newErr.ErrorMessage = err.Error() return localVarReturnValue, newErr } - newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v return localVarReturnValue, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := &oapiError.GenericOpenAPIError{ + newErr := &oapierror.GenericOpenAPIError{ StatusCode: localVarHTTPResponse.StatusCode, Body: localVarBody, ErrorMessage: err.Error(), diff --git a/services/ske/wait/wait.go b/services/ske/wait/wait.go index 5843c7a6..49d147f8 100644 --- a/services/ske/wait/wait.go +++ b/services/ske/wait/wait.go @@ -5,7 +5,7 @@ import ( "fmt" "net/http" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/core/wait" "github.com/stackitcloud/stackit-sdk-go/services/ske" ) @@ -97,9 +97,9 @@ func DeleteProjectWaitHandler(ctx context.Context, a APIClientProjectInterface, return wait.New(func() (res interface{}, done bool, err error) { s, err := a.GetProjectExecute(ctx, projectId) if err != nil { - oapiErr, ok := err.(*oapiError.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped + oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if !ok { - return nil, false, fmt.Errorf("could not convert error to oapiError.GenericOpenAPIError in delete wait handler, %w", err) + return nil, false, fmt.Errorf("could not convert error to oapierror.GenericOpenAPIError in delete wait handler, %w", err) } if oapiErr.StatusCode == http.StatusNotFound || oapiErr.StatusCode == http.StatusForbidden { return nil, true, nil diff --git a/services/ske/wait/wait_test.go b/services/ske/wait/wait_test.go index 8f5663f4..ad41d800 100644 --- a/services/ske/wait/wait_test.go +++ b/services/ske/wait/wait_test.go @@ -7,7 +7,7 @@ import ( "time" "github.com/google/go-cmp/cmp" - oapiError "github.com/stackitcloud/stackit-sdk-go/core/oapierror" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/core/utils" "github.com/stackitcloud/stackit-sdk-go/services/ske" ) @@ -22,7 +22,7 @@ type apiClientClusterMocked struct { func (a *apiClientClusterMocked) GetClusterExecute(_ context.Context, _, _ string) (*ske.ClusterResponse, error) { if a.getFails { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: http.StatusInternalServerError, } } @@ -50,7 +50,7 @@ func (a *apiClientClusterMocked) GetClusterExecute(_ context.Context, _, _ strin func (a *apiClientClusterMocked) GetClustersExecute(_ context.Context, _ string) (*ske.ClustersResponse, error) { if a.getFails { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: http.StatusInternalServerError, } } @@ -76,12 +76,12 @@ type apiClientProjectMocked struct { func (a *apiClientProjectMocked) GetProjectExecute(_ context.Context, _ string) (*ske.ProjectResponse, error) { if a.getFails { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: http.StatusInternalServerError, } } if a.getNotFound { - return nil, &oapiError.GenericOpenAPIError{ + return nil, &oapierror.GenericOpenAPIError{ StatusCode: http.StatusNotFound, } }