diff --git a/services/postgresflex/api_default.go b/services/postgresflex/api_default.go index 64a30e22f..896c75f2b 100644 --- a/services/postgresflex/api_default.go +++ b/services/postgresflex/api_default.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -30,6 +30,7 @@ type ApiCloneInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string instanceId string cloneInstancePayload *CloneInstancePayload } @@ -54,8 +55,9 @@ func (r ApiCloneInstanceRequest) Execute() (*CloneInstanceResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/clone" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/clone" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -127,6 +129,17 @@ func (r ApiCloneInstanceRequest) Execute() (*CloneInstanceResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } return localVarReturnValue, newErr } @@ -150,23 +163,26 @@ Clone an existing instance of a postgres database to a new destination instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project ID + @param region The region which should be addressed @param instanceId Instance ID @return ApiCloneInstanceRequest */ -func (a *APIClient) CloneInstance(ctx context.Context, projectId string, instanceId string) ApiCloneInstanceRequest { +func (a *APIClient) CloneInstance(ctx context.Context, projectId string, region string, instanceId string) ApiCloneInstanceRequest { return ApiCloneInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, } } -func (a *APIClient) CloneInstanceExecute(ctx context.Context, projectId string, instanceId string) (*CloneInstanceResponse, error) { +func (a *APIClient) CloneInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) (*CloneInstanceResponse, error) { r := ApiCloneInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, } return r.Execute() @@ -176,6 +192,7 @@ type ApiCreateDatabaseRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string instanceId string createDatabasePayload *CreateDatabasePayload } @@ -200,8 +217,9 @@ func (r ApiCreateDatabaseRequest) Execute() (*InstanceCreateDatabaseResponse, er return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/databases" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -273,6 +291,17 @@ func (r ApiCreateDatabaseRequest) Execute() (*InstanceCreateDatabaseResponse, er newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } return localVarReturnValue, newErr } @@ -297,23 +326,26 @@ Note: The name of a valid user must be provided in the "options" map field using @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project ID + @param region The region which should be addressed @param instanceId Instance ID @return ApiCreateDatabaseRequest */ -func (a *APIClient) CreateDatabase(ctx context.Context, projectId string, instanceId string) ApiCreateDatabaseRequest { +func (a *APIClient) CreateDatabase(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequest { return ApiCreateDatabaseRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, } } -func (a *APIClient) CreateDatabaseExecute(ctx context.Context, projectId string, instanceId string) (*InstanceCreateDatabaseResponse, error) { +func (a *APIClient) CreateDatabaseExecute(ctx context.Context, projectId string, region string, instanceId string) (*InstanceCreateDatabaseResponse, error) { r := ApiCreateDatabaseRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, } return r.Execute() @@ -323,6 +355,7 @@ type ApiCreateInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string createInstancePayload *CreateInstancePayload } @@ -346,8 +379,9 @@ func (r ApiCreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -418,6 +452,17 @@ func (r ApiCreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } return localVarReturnValue, newErr } @@ -441,21 +486,24 @@ Create a new instance of a postgres database @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project ID + @param region The region which should be addressed @return ApiCreateInstanceRequest */ -func (a *APIClient) CreateInstance(ctx context.Context, projectId string) ApiCreateInstanceRequest { +func (a *APIClient) CreateInstance(ctx context.Context, projectId string, region string) ApiCreateInstanceRequest { return ApiCreateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } } -func (a *APIClient) CreateInstanceExecute(ctx context.Context, projectId string) (*CreateInstanceResponse, error) { +func (a *APIClient) CreateInstanceExecute(ctx context.Context, projectId string, region string) (*CreateInstanceResponse, error) { r := ApiCreateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } return r.Execute() } @@ -464,6 +512,7 @@ type ApiCreateUserRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string instanceId string createUserPayload *CreateUserPayload } @@ -488,8 +537,9 @@ func (r ApiCreateUserRequest) Execute() (*CreateUserResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -561,6 +611,17 @@ func (r ApiCreateUserRequest) Execute() (*CreateUserResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } return localVarReturnValue, newErr } @@ -584,23 +645,26 @@ Create user for an instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project ID + @param region The region which should be addressed @param instanceId Instance ID @return ApiCreateUserRequest */ -func (a *APIClient) CreateUser(ctx context.Context, projectId string, instanceId string) ApiCreateUserRequest { +func (a *APIClient) CreateUser(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequest { return ApiCreateUserRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, } } -func (a *APIClient) CreateUserExecute(ctx context.Context, projectId string, instanceId string) (*CreateUserResponse, error) { +func (a *APIClient) CreateUserExecute(ctx context.Context, projectId string, region string, instanceId string) (*CreateUserResponse, error) { r := ApiCreateUserRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, } return r.Execute() @@ -610,6 +674,7 @@ type ApiDeleteDatabaseRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string instanceId string databaseId string } @@ -626,8 +691,9 @@ func (r ApiDeleteDatabaseRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/databases/{databaseId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"databaseId"+"}", url.PathEscape(ParameterValueToString(r.databaseId, "databaseId")), -1) @@ -695,6 +761,17 @@ func (r ApiDeleteDatabaseRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } return newErr } @@ -708,25 +785,28 @@ Delete database for an instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project ID + @param region The region which should be addressed @param instanceId Instance ID @param databaseId Database ID @return ApiDeleteDatabaseRequest */ -func (a *APIClient) DeleteDatabase(ctx context.Context, projectId string, instanceId string, databaseId string) ApiDeleteDatabaseRequest { +func (a *APIClient) DeleteDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId string) ApiDeleteDatabaseRequest { return ApiDeleteDatabaseRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, databaseId: databaseId, } } -func (a *APIClient) DeleteDatabaseExecute(ctx context.Context, projectId string, instanceId string, databaseId string) error { +func (a *APIClient) DeleteDatabaseExecute(ctx context.Context, projectId string, region string, instanceId string, databaseId string) error { r := ApiDeleteDatabaseRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, databaseId: databaseId, } @@ -737,6 +817,7 @@ type ApiDeleteInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string instanceId string } @@ -752,8 +833,9 @@ func (r ApiDeleteInstanceRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -820,6 +902,17 @@ func (r ApiDeleteInstanceRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -854,23 +947,26 @@ Delete available instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project ID + @param region The region which should be addressed @param instanceId Instance ID @return ApiDeleteInstanceRequest */ -func (a *APIClient) DeleteInstance(ctx context.Context, projectId string, instanceId string) ApiDeleteInstanceRequest { +func (a *APIClient) DeleteInstance(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequest { return ApiDeleteInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, } } -func (a *APIClient) DeleteInstanceExecute(ctx context.Context, projectId string, instanceId string) error { +func (a *APIClient) DeleteInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) error { r := ApiDeleteInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, } return r.Execute() @@ -880,6 +976,7 @@ type ApiDeleteUserRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string instanceId string userId string } @@ -896,8 +993,9 @@ func (r ApiDeleteUserRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(r.userId, "userId")), -1) @@ -965,6 +1063,17 @@ func (r ApiDeleteUserRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } return newErr } @@ -978,25 +1087,28 @@ Delete user for an instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project ID + @param region The region which should be addressed @param instanceId Instance ID @param userId User ID @return ApiDeleteUserRequest */ -func (a *APIClient) DeleteUser(ctx context.Context, projectId string, instanceId string, userId string) ApiDeleteUserRequest { +func (a *APIClient) DeleteUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiDeleteUserRequest { return ApiDeleteUserRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, userId: userId, } } -func (a *APIClient) DeleteUserExecute(ctx context.Context, projectId string, instanceId string, userId string) error { +func (a *APIClient) DeleteUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId string) error { r := ApiDeleteUserRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, userId: userId, } @@ -1007,6 +1119,7 @@ type ApiForceDeleteInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string instanceId string } @@ -1022,8 +1135,9 @@ func (r ApiForceDeleteInstanceRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/force" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/force" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -1079,6 +1193,28 @@ func (r ApiForceDeleteInstanceRequest) Execute() error { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 406 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1113,23 +1249,26 @@ Forces the deletion of an delayed deleted instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project ID + @param region The region which should be addressed @param instanceId Instance ID @return ApiForceDeleteInstanceRequest */ -func (a *APIClient) ForceDeleteInstance(ctx context.Context, projectId string, instanceId string) ApiForceDeleteInstanceRequest { +func (a *APIClient) ForceDeleteInstance(ctx context.Context, projectId string, region string, instanceId string) ApiForceDeleteInstanceRequest { return ApiForceDeleteInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, } } -func (a *APIClient) ForceDeleteInstanceExecute(ctx context.Context, projectId string, instanceId string) error { +func (a *APIClient) ForceDeleteInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) error { r := ApiForceDeleteInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, } return r.Execute() @@ -1139,6 +1278,7 @@ type ApiGetBackupRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string instanceId string backupId string } @@ -1156,8 +1296,9 @@ func (r ApiGetBackupRequest) Execute() (*GetBackupResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups/{backupId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/backups/{backupId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -1) @@ -1225,6 +1366,17 @@ func (r ApiGetBackupRequest) Execute() (*GetBackupResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } return localVarReturnValue, newErr } @@ -1248,25 +1400,28 @@ Get specific available backup @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project ID + @param region The region which should be addressed @param instanceId Instance ID @param backupId Backup ID @return ApiGetBackupRequest */ -func (a *APIClient) GetBackup(ctx context.Context, projectId string, instanceId string, backupId string) ApiGetBackupRequest { +func (a *APIClient) GetBackup(ctx context.Context, projectId string, region string, instanceId string, backupId string) ApiGetBackupRequest { return ApiGetBackupRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, backupId: backupId, } } -func (a *APIClient) GetBackupExecute(ctx context.Context, projectId string, instanceId string, backupId string) (*GetBackupResponse, error) { +func (a *APIClient) GetBackupExecute(ctx context.Context, projectId string, region string, instanceId string, backupId string) (*GetBackupResponse, error) { r := ApiGetBackupRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, backupId: backupId, } @@ -1277,6 +1432,7 @@ type ApiGetInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string instanceId string } @@ -1293,8 +1449,9 @@ func (r ApiGetInstanceRequest) Execute() (*InstanceResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -1361,6 +1518,17 @@ func (r ApiGetInstanceRequest) Execute() (*InstanceResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } return localVarReturnValue, newErr } @@ -1384,23 +1552,26 @@ Get specific available instances @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project ID + @param region The region which should be addressed @param instanceId Instance ID @return ApiGetInstanceRequest */ -func (a *APIClient) GetInstance(ctx context.Context, projectId string, instanceId string) ApiGetInstanceRequest { +func (a *APIClient) GetInstance(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequest { return ApiGetInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, } } -func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, instanceId string) (*InstanceResponse, error) { +func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) (*InstanceResponse, error) { r := ApiGetInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, } return r.Execute() @@ -1410,6 +1581,7 @@ type ApiGetUserRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string instanceId string userId string } @@ -1427,8 +1599,9 @@ func (r ApiGetUserRequest) Execute() (*GetUserResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(r.userId, "userId")), -1) @@ -1496,6 +1669,17 @@ func (r ApiGetUserRequest) Execute() (*GetUserResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } return localVarReturnValue, newErr } @@ -1519,25 +1703,28 @@ Get specific available user for an instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project ID + @param region The region which should be addressed @param instanceId Instance ID @param userId User ID @return ApiGetUserRequest */ -func (a *APIClient) GetUser(ctx context.Context, projectId string, instanceId string, userId string) ApiGetUserRequest { +func (a *APIClient) GetUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiGetUserRequest { return ApiGetUserRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, userId: userId, } } -func (a *APIClient) GetUserExecute(ctx context.Context, projectId string, instanceId string, userId string) (*GetUserResponse, error) { +func (a *APIClient) GetUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId string) (*GetUserResponse, error) { r := ApiGetUserRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, userId: userId, } @@ -1548,6 +1735,7 @@ type ApiListBackupsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string instanceId string } @@ -1564,8 +1752,9 @@ func (r ApiListBackupsRequest) Execute() (*ListBackupsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/backups" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -1632,6 +1821,17 @@ func (r ApiListBackupsRequest) Execute() (*ListBackupsResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } return localVarReturnValue, newErr } @@ -1655,23 +1855,26 @@ List all backups which are available for a specific instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project ID + @param region The region which should be addressed @param instanceId Instance ID @return ApiListBackupsRequest */ -func (a *APIClient) ListBackups(ctx context.Context, projectId string, instanceId string) ApiListBackupsRequest { +func (a *APIClient) ListBackups(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequest { return ApiListBackupsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, } } -func (a *APIClient) ListBackupsExecute(ctx context.Context, projectId string, instanceId string) (*ListBackupsResponse, error) { +func (a *APIClient) ListBackupsExecute(ctx context.Context, projectId string, region string, instanceId string) (*ListBackupsResponse, error) { r := ApiListBackupsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, } return r.Execute() @@ -1681,6 +1884,7 @@ type ApiListDatabaseParametersRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string instanceId string } @@ -1697,8 +1901,9 @@ func (r ApiListDatabaseParametersRequest) Execute() (*PostgresDatabaseParameterR return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/parameter" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/parameter" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -1765,6 +1970,17 @@ func (r ApiListDatabaseParametersRequest) Execute() (*PostgresDatabaseParameterR newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } return localVarReturnValue, newErr } @@ -1788,23 +2004,26 @@ List available databases parameter @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project ID + @param region The region which should be addressed @param instanceId Instance ID @return ApiListDatabaseParametersRequest */ -func (a *APIClient) ListDatabaseParameters(ctx context.Context, projectId string, instanceId string) ApiListDatabaseParametersRequest { +func (a *APIClient) ListDatabaseParameters(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabaseParametersRequest { return ApiListDatabaseParametersRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, } } -func (a *APIClient) ListDatabaseParametersExecute(ctx context.Context, projectId string, instanceId string) (*PostgresDatabaseParameterResponse, error) { +func (a *APIClient) ListDatabaseParametersExecute(ctx context.Context, projectId string, region string, instanceId string) (*PostgresDatabaseParameterResponse, error) { r := ApiListDatabaseParametersRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, } return r.Execute() @@ -1814,6 +2033,7 @@ type ApiListDatabasesRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string instanceId string } @@ -1830,8 +2050,9 @@ func (r ApiListDatabasesRequest) Execute() (*InstanceListDatabasesResponse, erro return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/databases" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -1898,6 +2119,17 @@ func (r ApiListDatabasesRequest) Execute() (*InstanceListDatabasesResponse, erro newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } return localVarReturnValue, newErr } @@ -1921,23 +2153,26 @@ List available databases for an instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project ID + @param region The region which should be addressed @param instanceId Instance ID @return ApiListDatabasesRequest */ -func (a *APIClient) ListDatabases(ctx context.Context, projectId string, instanceId string) ApiListDatabasesRequest { +func (a *APIClient) ListDatabases(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequest { return ApiListDatabasesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, } } -func (a *APIClient) ListDatabasesExecute(ctx context.Context, projectId string, instanceId string) (*InstanceListDatabasesResponse, error) { +func (a *APIClient) ListDatabasesExecute(ctx context.Context, projectId string, region string, instanceId string) (*InstanceListDatabasesResponse, error) { r := ApiListDatabasesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, } return r.Execute() @@ -1947,6 +2182,7 @@ type ApiListFlavorsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string } func (r ApiListFlavorsRequest) Execute() (*ListFlavorsResponse, error) { @@ -1962,8 +2198,9 @@ func (r ApiListFlavorsRequest) Execute() (*ListFlavorsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/flavors" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/flavors" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2029,6 +2266,17 @@ func (r ApiListFlavorsRequest) Execute() (*ListFlavorsResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } return localVarReturnValue, newErr } @@ -2052,21 +2300,24 @@ Get available flavors for a specific projectID @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project ID + @param region The region which should be addressed @return ApiListFlavorsRequest */ -func (a *APIClient) ListFlavors(ctx context.Context, projectId string) ApiListFlavorsRequest { +func (a *APIClient) ListFlavors(ctx context.Context, projectId string, region string) ApiListFlavorsRequest { return ApiListFlavorsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } } -func (a *APIClient) ListFlavorsExecute(ctx context.Context, projectId string) (*ListFlavorsResponse, error) { +func (a *APIClient) ListFlavorsExecute(ctx context.Context, projectId string, region string) (*ListFlavorsResponse, error) { r := ApiListFlavorsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } return r.Execute() } @@ -2075,6 +2326,7 @@ type ApiListInstancesRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string } func (r ApiListInstancesRequest) Execute() (*ListInstancesResponse, error) { @@ -2090,8 +2342,9 @@ func (r ApiListInstancesRequest) Execute() (*ListInstancesResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2157,6 +2410,17 @@ func (r ApiListInstancesRequest) Execute() (*ListInstancesResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } return localVarReturnValue, newErr } @@ -2180,21 +2444,24 @@ List available instances @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project ID + @param region The region which should be addressed @return ApiListInstancesRequest */ -func (a *APIClient) ListInstances(ctx context.Context, projectId string) ApiListInstancesRequest { +func (a *APIClient) ListInstances(ctx context.Context, projectId string, region string) ApiListInstancesRequest { return ApiListInstancesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } } -func (a *APIClient) ListInstancesExecute(ctx context.Context, projectId string) (*ListInstancesResponse, error) { +func (a *APIClient) ListInstancesExecute(ctx context.Context, projectId string, region string) (*ListInstancesResponse, error) { r := ApiListInstancesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } return r.Execute() } @@ -2203,6 +2470,7 @@ type ApiListMetricsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string instanceId string metric string granularity *string @@ -2252,8 +2520,9 @@ func (r ApiListMetricsRequest) Execute() (*InstanceMetricsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/metrics/{metric}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/metrics/{metric}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"metric"+"}", url.PathEscape(ParameterValueToString(r.metric, "metric")), -1) @@ -2334,6 +2603,17 @@ func (r ApiListMetricsRequest) Execute() (*InstanceMetricsResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 405 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2374,29 +2654,32 @@ func (r ApiListMetricsRequest) Execute() (*InstanceMetricsResponse, error) { /* ListMetrics: Get Metric -Returns a metric for an instance. The metric will only be for the master pod if needed. Granularity parameter is always needed. If start and end time is provided, period is not considered in connections and disk-use. If you provide start time, you have to provide end time as well and vice versa. +Returns a metric for an instance. The metric will only be for the master pod if needed. Granularity parameter is always needed. If start and end time is provided, period is not considered in max-connections and disk-use. If you provide start time, you have to provide end time as well and vice versa. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The UUID of the project. + @param region The region which should be addressed @param instanceId The UUID of the instance. - @param metric The name of the metric. Valid metrics are 'cpu', 'memory', 'disk-use', 'disk-size' and 'connections'. + @param metric The name of the metric. Valid metrics are 'cpu', 'memory', 'max-connections', 'connections' and 'disk-use'. @return ApiListMetricsRequest */ -func (a *APIClient) ListMetrics(ctx context.Context, projectId string, instanceId string, metric string) ApiListMetricsRequest { +func (a *APIClient) ListMetrics(ctx context.Context, projectId string, region string, instanceId string, metric string) ApiListMetricsRequest { return ApiListMetricsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, metric: metric, } } -func (a *APIClient) ListMetricsExecute(ctx context.Context, projectId string, instanceId string, metric string) (*InstanceMetricsResponse, error) { +func (a *APIClient) ListMetricsExecute(ctx context.Context, projectId string, region string, instanceId string, metric string) (*InstanceMetricsResponse, error) { r := ApiListMetricsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, metric: metric, } @@ -2407,6 +2690,7 @@ type ApiListStoragesRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string flavorId string } @@ -2423,8 +2707,9 @@ func (r ApiListStoragesRequest) Execute() (*ListStoragesResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/storages/{flavorId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/storages/{flavorId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"flavorId"+"}", url.PathEscape(ParameterValueToString(r.flavorId, "flavorId")), -1) localVarHeaderParams := make(map[string]string) @@ -2491,6 +2776,17 @@ func (r ApiListStoragesRequest) Execute() (*ListStoragesResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } return localVarReturnValue, newErr } @@ -2514,23 +2810,26 @@ Get available storages for a specific flavor @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project ID + @param region The region which should be addressed @param flavorId Flavor ID @return ApiListStoragesRequest */ -func (a *APIClient) ListStorages(ctx context.Context, projectId string, flavorId string) ApiListStoragesRequest { +func (a *APIClient) ListStorages(ctx context.Context, projectId string, region string, flavorId string) ApiListStoragesRequest { return ApiListStoragesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, flavorId: flavorId, } } -func (a *APIClient) ListStoragesExecute(ctx context.Context, projectId string, flavorId string) (*ListStoragesResponse, error) { +func (a *APIClient) ListStoragesExecute(ctx context.Context, projectId string, region string, flavorId string) (*ListStoragesResponse, error) { r := ApiListStoragesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, flavorId: flavorId, } return r.Execute() @@ -2540,6 +2839,7 @@ type ApiListUsersRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string instanceId string } @@ -2556,8 +2856,9 @@ func (r ApiListUsersRequest) Execute() (*ListUsersResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -2624,6 +2925,17 @@ func (r ApiListUsersRequest) Execute() (*ListUsersResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } return localVarReturnValue, newErr } @@ -2647,23 +2959,26 @@ List available users for an instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project ID + @param region The region which should be addressed @param instanceId Instance ID @return ApiListUsersRequest */ -func (a *APIClient) ListUsers(ctx context.Context, projectId string, instanceId string) ApiListUsersRequest { +func (a *APIClient) ListUsers(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequest { return ApiListUsersRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, } } -func (a *APIClient) ListUsersExecute(ctx context.Context, projectId string, instanceId string) (*ListUsersResponse, error) { +func (a *APIClient) ListUsersExecute(ctx context.Context, projectId string, region string, instanceId string) (*ListUsersResponse, error) { r := ApiListUsersRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, } return r.Execute() @@ -2673,6 +2988,7 @@ type ApiListVersionsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string instanceId *string } @@ -2696,8 +3012,9 @@ func (r ApiListVersionsRequest) Execute() (*ListVersionsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/versions" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/versions" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2766,6 +3083,17 @@ func (r ApiListVersionsRequest) Execute() (*ListVersionsResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } return localVarReturnValue, newErr } @@ -2789,21 +3117,24 @@ Get available versions for postgres database @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project ID + @param region The region which should be addressed @return ApiListVersionsRequest */ -func (a *APIClient) ListVersions(ctx context.Context, projectId string) ApiListVersionsRequest { +func (a *APIClient) ListVersions(ctx context.Context, projectId string, region string) ApiListVersionsRequest { return ApiListVersionsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } } -func (a *APIClient) ListVersionsExecute(ctx context.Context, projectId string) (*ListVersionsResponse, error) { +func (a *APIClient) ListVersionsExecute(ctx context.Context, projectId string, region string) (*ListVersionsResponse, error) { r := ApiListVersionsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } return r.Execute() } @@ -2812,6 +3143,7 @@ type ApiPartialUpdateInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string instanceId string partialUpdateInstancePayload *PartialUpdateInstancePayload } @@ -2836,8 +3168,9 @@ func (r ApiPartialUpdateInstanceRequest) Execute() (*PartialUpdateInstanceRespon return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -2909,6 +3242,17 @@ func (r ApiPartialUpdateInstanceRequest) Execute() (*PartialUpdateInstanceRespon newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } return localVarReturnValue, newErr } @@ -2932,23 +3276,26 @@ Update available instance of a postgres database. Supported Versions are 12, 13, @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project ID + @param region The region which should be addressed @param instanceId Instance ID @return ApiPartialUpdateInstanceRequest */ -func (a *APIClient) PartialUpdateInstance(ctx context.Context, projectId string, instanceId string) ApiPartialUpdateInstanceRequest { +func (a *APIClient) PartialUpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiPartialUpdateInstanceRequest { return ApiPartialUpdateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, } } -func (a *APIClient) PartialUpdateInstanceExecute(ctx context.Context, projectId string, instanceId string) (*PartialUpdateInstanceResponse, error) { +func (a *APIClient) PartialUpdateInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) (*PartialUpdateInstanceResponse, error) { r := ApiPartialUpdateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, } return r.Execute() @@ -2958,6 +3305,7 @@ type ApiPartialUpdateUserRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string instanceId string userId string partialUpdateUserPayload *PartialUpdateUserPayload @@ -2982,8 +3330,9 @@ func (r ApiPartialUpdateUserRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(r.userId, "userId")), -1) @@ -3053,6 +3402,17 @@ func (r ApiPartialUpdateUserRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -3076,25 +3436,28 @@ Update user for an instance. Only the roles are updatable. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The ID of the project + @param region The region which should be addressed @param instanceId The ID of the instance @param userId The ID of the user in the database @return ApiPartialUpdateUserRequest */ -func (a *APIClient) PartialUpdateUser(ctx context.Context, projectId string, instanceId string, userId string) ApiPartialUpdateUserRequest { +func (a *APIClient) PartialUpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiPartialUpdateUserRequest { return ApiPartialUpdateUserRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, userId: userId, } } -func (a *APIClient) PartialUpdateUserExecute(ctx context.Context, projectId string, instanceId string, userId string) error { +func (a *APIClient) PartialUpdateUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId string) error { r := ApiPartialUpdateUserRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, userId: userId, } @@ -3105,6 +3468,7 @@ type ApiResetUserRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string instanceId string userId string } @@ -3122,8 +3486,9 @@ func (r ApiResetUserRequest) Execute() (*ResetUserResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}/reset" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}/reset" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(r.userId, "userId")), -1) @@ -3191,6 +3556,17 @@ func (r ApiResetUserRequest) Execute() (*ResetUserResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -3235,25 +3611,28 @@ Reset user password for a postgres instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project ID + @param region The region which should be addressed @param instanceId Instance ID @param userId user ID @return ApiResetUserRequest */ -func (a *APIClient) ResetUser(ctx context.Context, projectId string, instanceId string, userId string) ApiResetUserRequest { +func (a *APIClient) ResetUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiResetUserRequest { return ApiResetUserRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, userId: userId, } } -func (a *APIClient) ResetUserExecute(ctx context.Context, projectId string, instanceId string, userId string) (*ResetUserResponse, error) { +func (a *APIClient) ResetUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId string) (*ResetUserResponse, error) { r := ApiResetUserRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, userId: userId, } @@ -3264,6 +3643,7 @@ type ApiUpdateBackupScheduleRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string instanceId string updateBackupSchedulePayload *UpdateBackupSchedulePayload } @@ -3287,8 +3667,9 @@ func (r ApiUpdateBackupScheduleRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/backups" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -3360,6 +3741,17 @@ func (r ApiUpdateBackupScheduleRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } return newErr } @@ -3373,23 +3765,26 @@ Update backup schedule @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project ID + @param region The region which should be addressed @param instanceId Instance ID @return ApiUpdateBackupScheduleRequest */ -func (a *APIClient) UpdateBackupSchedule(ctx context.Context, projectId string, instanceId string) ApiUpdateBackupScheduleRequest { +func (a *APIClient) UpdateBackupSchedule(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateBackupScheduleRequest { return ApiUpdateBackupScheduleRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, } } -func (a *APIClient) UpdateBackupScheduleExecute(ctx context.Context, projectId string, instanceId string) error { +func (a *APIClient) UpdateBackupScheduleExecute(ctx context.Context, projectId string, region string, instanceId string) error { r := ApiUpdateBackupScheduleRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, } return r.Execute() @@ -3399,6 +3794,7 @@ type ApiUpdateInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string instanceId string updateInstancePayload *UpdateInstancePayload } @@ -3423,8 +3819,9 @@ func (r ApiUpdateInstanceRequest) Execute() (*PartialUpdateInstanceResponse, err return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -3496,6 +3893,17 @@ func (r ApiUpdateInstanceRequest) Execute() (*PartialUpdateInstanceResponse, err newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } return localVarReturnValue, newErr } @@ -3519,23 +3927,26 @@ Update available instance of a postgres database. Supported Versions are 12, 13, @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project ID + @param region The region which should be addressed @param instanceId Instance ID @return ApiUpdateInstanceRequest */ -func (a *APIClient) UpdateInstance(ctx context.Context, projectId string, instanceId string) ApiUpdateInstanceRequest { +func (a *APIClient) UpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequest { return ApiUpdateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, } } -func (a *APIClient) UpdateInstanceExecute(ctx context.Context, projectId string, instanceId string) (*PartialUpdateInstanceResponse, error) { +func (a *APIClient) UpdateInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) (*PartialUpdateInstanceResponse, error) { r := ApiUpdateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, } return r.Execute() @@ -3545,6 +3956,7 @@ type ApiUpdateUserRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string instanceId string userId string updateUserPayload *UpdateUserPayload @@ -3569,8 +3981,9 @@ func (r ApiUpdateUserRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(r.userId, "userId")), -1) @@ -3640,6 +4053,17 @@ func (r ApiUpdateUserRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -3663,25 +4087,28 @@ Update user for an instance. Only the roles are updatable. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The ID of the project + @param region The region which should be addressed @param instanceId The ID of the instance @param userId The ID of the user in the database @return ApiUpdateUserRequest */ -func (a *APIClient) UpdateUser(ctx context.Context, projectId string, instanceId string, userId string) ApiUpdateUserRequest { +func (a *APIClient) UpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiUpdateUserRequest { return ApiUpdateUserRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, userId: userId, } } -func (a *APIClient) UpdateUserExecute(ctx context.Context, projectId string, instanceId string, userId string) error { +func (a *APIClient) UpdateUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId string) error { r := ApiUpdateUserRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, instanceId: instanceId, userId: userId, } diff --git a/services/postgresflex/api_default_test.go b/services/postgresflex/api_default_test.go index 583368d17..80cd17fb1 100644 --- a/services/postgresflex/api_default_test.go +++ b/services/postgresflex/api_default_test.go @@ -24,9 +24,11 @@ import ( func Test_postgresflex_DefaultApiService(t *testing.T) { t.Run("Test DefaultApiService CloneInstance", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}/clone" + path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/clone" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) @@ -66,10 +68,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" instanceId := "instanceId" cloneInstancePayload := CloneInstancePayload{} - resp, reqErr := apiClient.CloneInstance(context.Background(), projectId, instanceId).CloneInstancePayload(cloneInstancePayload).Execute() + resp, reqErr := apiClient.CloneInstance(context.Background(), projectId, region, instanceId).CloneInstancePayload(cloneInstancePayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -80,9 +83,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService CreateDatabase", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}/databases" + path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) @@ -122,10 +127,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" instanceId := "instanceId" createDatabasePayload := CreateDatabasePayload{} - resp, reqErr := apiClient.CreateDatabase(context.Background(), projectId, instanceId).CreateDatabasePayload(createDatabasePayload).Execute() + resp, reqErr := apiClient.CreateDatabase(context.Background(), projectId, region, instanceId).CreateDatabasePayload(createDatabasePayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -136,9 +142,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService CreateInstance", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances" + path := "/v2/projects/{projectId}/regions/{region}/instances" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { @@ -176,9 +184,10 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" createInstancePayload := CreateInstancePayload{} - resp, reqErr := apiClient.CreateInstance(context.Background(), projectId).CreateInstancePayload(createInstancePayload).Execute() + resp, reqErr := apiClient.CreateInstance(context.Background(), projectId, region).CreateInstancePayload(createInstancePayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -189,9 +198,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService CreateUser", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}/users" + path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) @@ -231,10 +242,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" instanceId := "instanceId" createUserPayload := CreateUserPayload{} - resp, reqErr := apiClient.CreateUser(context.Background(), projectId, instanceId).CreateUserPayload(createUserPayload).Execute() + resp, reqErr := apiClient.CreateUser(context.Background(), projectId, region, instanceId).CreateUserPayload(createUserPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -245,9 +257,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteDatabase", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}/databases/{databaseId}" + path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) databaseIdValue := "databaseId" @@ -286,10 +300,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" instanceId := "instanceId" databaseId := "databaseId" - reqErr := apiClient.DeleteDatabase(context.Background(), projectId, instanceId, databaseId).Execute() + reqErr := apiClient.DeleteDatabase(context.Background(), projectId, region, instanceId, databaseId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -297,9 +312,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteInstance", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}" + path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) @@ -336,9 +353,10 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" instanceId := "instanceId" - reqErr := apiClient.DeleteInstance(context.Background(), projectId, instanceId).Execute() + reqErr := apiClient.DeleteInstance(context.Background(), projectId, region, instanceId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -346,9 +364,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteUser", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" + path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) userIdValue := "userId" @@ -387,10 +407,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" instanceId := "instanceId" userId := "userId" - reqErr := apiClient.DeleteUser(context.Background(), projectId, instanceId, userId).Execute() + reqErr := apiClient.DeleteUser(context.Background(), projectId, region, instanceId, userId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -398,9 +419,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ForceDeleteInstance", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}/force" + path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/force" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) @@ -437,9 +460,10 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" instanceId := "instanceId" - reqErr := apiClient.ForceDeleteInstance(context.Background(), projectId, instanceId).Execute() + reqErr := apiClient.ForceDeleteInstance(context.Background(), projectId, region, instanceId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -447,9 +471,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetBackup", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}/backups/{backupId}" + path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/backups/{backupId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) backupIdValue := "backupId" @@ -491,10 +517,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" instanceId := "instanceId" backupId := "backupId" - resp, reqErr := apiClient.GetBackup(context.Background(), projectId, instanceId, backupId).Execute() + resp, reqErr := apiClient.GetBackup(context.Background(), projectId, region, instanceId, backupId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -505,9 +532,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetInstance", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}" + path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) @@ -547,9 +576,10 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" instanceId := "instanceId" - resp, reqErr := apiClient.GetInstance(context.Background(), projectId, instanceId).Execute() + resp, reqErr := apiClient.GetInstance(context.Background(), projectId, region, instanceId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -560,9 +590,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetUser", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" + path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) userIdValue := "userId" @@ -604,10 +636,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" instanceId := "instanceId" userId := "userId" - resp, reqErr := apiClient.GetUser(context.Background(), projectId, instanceId, userId).Execute() + resp, reqErr := apiClient.GetUser(context.Background(), projectId, region, instanceId, userId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -618,9 +651,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ListBackups", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}/backups" + path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/backups" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) @@ -660,9 +695,10 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" instanceId := "instanceId" - resp, reqErr := apiClient.ListBackups(context.Background(), projectId, instanceId).Execute() + resp, reqErr := apiClient.ListBackups(context.Background(), projectId, region, instanceId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -673,9 +709,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ListDatabaseParameters", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}/parameter" + path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/parameter" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) @@ -715,9 +753,10 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" instanceId := "instanceId" - resp, reqErr := apiClient.ListDatabaseParameters(context.Background(), projectId, instanceId).Execute() + resp, reqErr := apiClient.ListDatabaseParameters(context.Background(), projectId, region, instanceId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -728,9 +767,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ListDatabases", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}/databases" + path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) @@ -770,9 +811,10 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" instanceId := "instanceId" - resp, reqErr := apiClient.ListDatabases(context.Background(), projectId, instanceId).Execute() + resp, reqErr := apiClient.ListDatabases(context.Background(), projectId, region, instanceId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -783,9 +825,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ListFlavors", func(t *testing.T) { - path := "/v1/projects/{projectId}/flavors" + path := "/v2/projects/{projectId}/regions/{region}/flavors" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { @@ -823,8 +867,9 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" - resp, reqErr := apiClient.ListFlavors(context.Background(), projectId).Execute() + resp, reqErr := apiClient.ListFlavors(context.Background(), projectId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -835,9 +880,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ListInstances", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances" + path := "/v2/projects/{projectId}/regions/{region}/instances" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { @@ -875,8 +922,9 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" - resp, reqErr := apiClient.ListInstances(context.Background(), projectId).Execute() + resp, reqErr := apiClient.ListInstances(context.Background(), projectId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -887,9 +935,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ListMetrics", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}/metrics/{metric}" + path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/metrics/{metric}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) metricValue := "metric" @@ -931,11 +981,12 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" instanceId := "instanceId" metric := "metric" var granularity string - resp, reqErr := apiClient.ListMetrics(context.Background(), projectId, instanceId, metric).Granularity(granularity).Execute() + resp, reqErr := apiClient.ListMetrics(context.Background(), projectId, region, instanceId, metric).Granularity(granularity).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -946,9 +997,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ListStorages", func(t *testing.T) { - path := "/v1/projects/{projectId}/storages/{flavorId}" + path := "/v2/projects/{projectId}/regions/{region}/storages/{flavorId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) flavorIdValue := "flavorId" path = strings.Replace(path, "{"+"flavorId"+"}", url.PathEscape(ParameterValueToString(flavorIdValue, "flavorId")), -1) @@ -988,9 +1041,10 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" flavorId := "flavorId" - resp, reqErr := apiClient.ListStorages(context.Background(), projectId, flavorId).Execute() + resp, reqErr := apiClient.ListStorages(context.Background(), projectId, region, flavorId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -1001,9 +1055,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ListUsers", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}/users" + path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) @@ -1043,9 +1099,10 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" instanceId := "instanceId" - resp, reqErr := apiClient.ListUsers(context.Background(), projectId, instanceId).Execute() + resp, reqErr := apiClient.ListUsers(context.Background(), projectId, region, instanceId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -1056,9 +1113,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ListVersions", func(t *testing.T) { - path := "/v1/projects/{projectId}/versions" + path := "/v2/projects/{projectId}/regions/{region}/versions" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { @@ -1096,8 +1155,9 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" - resp, reqErr := apiClient.ListVersions(context.Background(), projectId).Execute() + resp, reqErr := apiClient.ListVersions(context.Background(), projectId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -1108,9 +1168,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService PartialUpdateInstance", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}" + path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) @@ -1150,10 +1212,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" instanceId := "instanceId" partialUpdateInstancePayload := PartialUpdateInstancePayload{} - resp, reqErr := apiClient.PartialUpdateInstance(context.Background(), projectId, instanceId).PartialUpdateInstancePayload(partialUpdateInstancePayload).Execute() + resp, reqErr := apiClient.PartialUpdateInstance(context.Background(), projectId, region, instanceId).PartialUpdateInstancePayload(partialUpdateInstancePayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -1164,9 +1227,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService PartialUpdateUser", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" + path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) userIdValue := "userId" @@ -1205,10 +1270,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" instanceId := "instanceId" userId := "userId" - reqErr := apiClient.PartialUpdateUser(context.Background(), projectId, instanceId, userId).Execute() + reqErr := apiClient.PartialUpdateUser(context.Background(), projectId, region, instanceId, userId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -1216,9 +1282,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ResetUser", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}/reset" + path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}/reset" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) userIdValue := "userId" @@ -1260,10 +1328,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" instanceId := "instanceId" userId := "userId" - resp, reqErr := apiClient.ResetUser(context.Background(), projectId, instanceId, userId).Execute() + resp, reqErr := apiClient.ResetUser(context.Background(), projectId, region, instanceId, userId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -1274,9 +1343,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService UpdateBackupSchedule", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}/backups" + path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/backups" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) @@ -1313,10 +1384,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" instanceId := "instanceId" updateBackupSchedulePayload := UpdateBackupSchedulePayload{} - reqErr := apiClient.UpdateBackupSchedule(context.Background(), projectId, instanceId).UpdateBackupSchedulePayload(updateBackupSchedulePayload).Execute() + reqErr := apiClient.UpdateBackupSchedule(context.Background(), projectId, region, instanceId).UpdateBackupSchedulePayload(updateBackupSchedulePayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -1324,9 +1396,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService UpdateInstance", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}" + path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) @@ -1366,10 +1440,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" instanceId := "instanceId" updateInstancePayload := UpdateInstancePayload{} - resp, reqErr := apiClient.UpdateInstance(context.Background(), projectId, instanceId).UpdateInstancePayload(updateInstancePayload).Execute() + resp, reqErr := apiClient.UpdateInstance(context.Background(), projectId, region, instanceId).UpdateInstancePayload(updateInstancePayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -1380,9 +1455,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService UpdateUser", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" + path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) userIdValue := "userId" @@ -1421,10 +1498,11 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { } projectId := "projectId" + region := "region" instanceId := "instanceId" userId := "userId" - reqErr := apiClient.UpdateUser(context.Background(), projectId, instanceId, userId).Execute() + reqErr := apiClient.UpdateUser(context.Background(), projectId, region, instanceId, userId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) diff --git a/services/postgresflex/client.go b/services/postgresflex/client.go index 3fcc396ec..28d9726e0 100644 --- a/services/postgresflex/client.go +++ b/services/postgresflex/client.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -42,7 +42,7 @@ var ( queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") ) -// APIClient manages communication with the STACKIT PostgreSQL Flex API API v1.0.0 +// APIClient manages communication with the STACKIT PostgreSQL Flex API API v2.0.0 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *config.Configuration @@ -66,10 +66,7 @@ func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { } } - err := config.ConfigureRegion(cfg) - if err != nil { - return nil, fmt.Errorf("configuring region: %w", err) - } + // using new regional api, so no region is set here if cfg.HTTPClient == nil { cfg.HTTPClient = &http.Client{} diff --git a/services/postgresflex/configuration.go b/services/postgresflex/configuration.go index 5f2d52966..149f561e2 100644 --- a/services/postgresflex/configuration.go +++ b/services/postgresflex/configuration.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -22,15 +22,12 @@ func NewConfiguration() *config.Configuration { Debug: false, Servers: config.ServerConfigurations{ { - URL: "https://postgres-flex-service.api.{region}stackit.cloud", + URL: "https://postgres-flex-service.api.stackit.cloud", Description: "No description provided", Variables: map[string]config.ServerVariable{ "region": { Description: "No description provided", - DefaultValue: "eu01.", - EnumValues: []string{ - "eu01.", - }, + DefaultValue: "global", }, }, }, diff --git a/services/postgresflex/model_acl.go b/services/postgresflex/model_acl.go index a5b2352aa..b644a1981 100644 --- a/services/postgresflex/model_acl.go +++ b/services/postgresflex/model_acl.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_api_configuration.go b/services/postgresflex/model_api_configuration.go index d0d5f2d56..65a87abfe 100644 --- a/services/postgresflex/model_api_configuration.go +++ b/services/postgresflex/model_api_configuration.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_api_extension_config_load_response.go b/services/postgresflex/model_api_extension_config_load_response.go index 4aa48e413..61e98f50d 100644 --- a/services/postgresflex/model_api_extension_config_load_response.go +++ b/services/postgresflex/model_api_extension_config_load_response.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_api_extension_configure_response.go b/services/postgresflex/model_api_extension_configure_response.go index 322960d9b..18d9f72c0 100644 --- a/services/postgresflex/model_api_extension_configure_response.go +++ b/services/postgresflex/model_api_extension_configure_response.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_api_extension_delete_response.go b/services/postgresflex/model_api_extension_delete_response.go index a427c61a3..a7578fd19 100644 --- a/services/postgresflex/model_api_extension_delete_response.go +++ b/services/postgresflex/model_api_extension_delete_response.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_api_extension_list.go b/services/postgresflex/model_api_extension_list.go index 9056ff299..41ccd0d8c 100644 --- a/services/postgresflex/model_api_extension_list.go +++ b/services/postgresflex/model_api_extension_list.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_api_extension_load_response.go b/services/postgresflex/model_api_extension_load_response.go index e88fc621c..f33f22efe 100644 --- a/services/postgresflex/model_api_extension_load_response.go +++ b/services/postgresflex/model_api_extension_load_response.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_api_install_response.go b/services/postgresflex/model_api_install_response.go index 3c419d2be..1d4e3222d 100644 --- a/services/postgresflex/model_api_install_response.go +++ b/services/postgresflex/model_api_install_response.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_api_installed_list_response.go b/services/postgresflex/model_api_installed_list_response.go index 6efea3d65..dddf0d3fb 100644 --- a/services/postgresflex/model_api_installed_list_response.go +++ b/services/postgresflex/model_api_installed_list_response.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_backup.go b/services/postgresflex/model_backup.go index ed4a5757a..699d58e35 100644 --- a/services/postgresflex/model_backup.go +++ b/services/postgresflex/model_backup.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_clone_instance_payload.go b/services/postgresflex/model_clone_instance_payload.go index 1aa6d9f57..501993d5b 100644 --- a/services/postgresflex/model_clone_instance_payload.go +++ b/services/postgresflex/model_clone_instance_payload.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_clone_instance_response.go b/services/postgresflex/model_clone_instance_response.go index d8c805cd9..3341081e2 100644 --- a/services/postgresflex/model_clone_instance_response.go +++ b/services/postgresflex/model_clone_instance_response.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_create_database_payload.go b/services/postgresflex/model_create_database_payload.go index ee897e421..f5defdab1 100644 --- a/services/postgresflex/model_create_database_payload.go +++ b/services/postgresflex/model_create_database_payload.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_create_instance_payload.go b/services/postgresflex/model_create_instance_payload.go index 8b1e14833..9e63bc154 100644 --- a/services/postgresflex/model_create_instance_payload.go +++ b/services/postgresflex/model_create_instance_payload.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -31,6 +31,7 @@ type CreateInstancePayload struct { Name *string `json:"name"` // REQUIRED Options *map[string]string `json:"options"` + // Can be cast to int32 without loss of precision. // REQUIRED Replicas *int64 `json:"replicas"` // REQUIRED diff --git a/services/postgresflex/model_create_instance_response.go b/services/postgresflex/model_create_instance_response.go index 5c32261af..fdb6fc851 100644 --- a/services/postgresflex/model_create_instance_response.go +++ b/services/postgresflex/model_create_instance_response.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_create_user_payload.go b/services/postgresflex/model_create_user_payload.go index a44698b19..a5078f0d9 100644 --- a/services/postgresflex/model_create_user_payload.go +++ b/services/postgresflex/model_create_user_payload.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_create_user_response.go b/services/postgresflex/model_create_user_response.go index 803acac2c..fb4abd057 100644 --- a/services/postgresflex/model_create_user_response.go +++ b/services/postgresflex/model_create_user_response.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_error.go b/services/postgresflex/model_error.go index 8199f09ae..dd63e06d4 100644 --- a/services/postgresflex/model_error.go +++ b/services/postgresflex/model_error.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,6 +19,7 @@ var _ MappedNullable = &Error{} // Error struct for Error type Error struct { + // Can be cast to int32 without loss of precision. Code *int64 `json:"code,omitempty"` Fields *map[string][]string `json:"fields,omitempty"` Message *string `json:"message,omitempty"` diff --git a/services/postgresflex/model_extensions_configuration.go b/services/postgresflex/model_extensions_configuration.go index e1ae619f9..7793def14 100644 --- a/services/postgresflex/model_extensions_configuration.go +++ b/services/postgresflex/model_extensions_configuration.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_extensions_extension_list_response.go b/services/postgresflex/model_extensions_extension_list_response.go index b5a5a992b..4c5d71b2f 100644 --- a/services/postgresflex/model_extensions_extension_list_response.go +++ b/services/postgresflex/model_extensions_extension_list_response.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_extensions_new_config.go b/services/postgresflex/model_extensions_new_config.go index 8b1ecd290..050607d0a 100644 --- a/services/postgresflex/model_extensions_new_config.go +++ b/services/postgresflex/model_extensions_new_config.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_flavor.go b/services/postgresflex/model_flavor.go index c6cb06f7c..346a68058 100644 --- a/services/postgresflex/model_flavor.go +++ b/services/postgresflex/model_flavor.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_get_backup_response.go b/services/postgresflex/model_get_backup_response.go index bb96bf4b5..9b714744d 100644 --- a/services/postgresflex/model_get_backup_response.go +++ b/services/postgresflex/model_get_backup_response.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_get_user_response.go b/services/postgresflex/model_get_user_response.go index f305470c8..30e5f47a0 100644 --- a/services/postgresflex/model_get_user_response.go +++ b/services/postgresflex/model_get_user_response.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_instance.go b/services/postgresflex/model_instance.go index 7bb58284b..b1652cc90 100644 --- a/services/postgresflex/model_instance.go +++ b/services/postgresflex/model_instance.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -25,10 +25,11 @@ type Instance struct { Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` Options *map[string]string `json:"options,omitempty"` - Replicas *int64 `json:"replicas,omitempty"` - Status *string `json:"status,omitempty"` - Storage *Storage `json:"storage,omitempty"` - Version *string `json:"version,omitempty"` + // Can be cast to int32 without loss of precision. + Replicas *int64 `json:"replicas,omitempty"` + Status *string `json:"status,omitempty"` + Storage *Storage `json:"storage,omitempty"` + Version *string `json:"version,omitempty"` } // NewInstance instantiates a new Instance object diff --git a/services/postgresflex/model_instance_create_database_response.go b/services/postgresflex/model_instance_create_database_response.go index 3b6ff9f73..3bd3b0c93 100644 --- a/services/postgresflex/model_instance_create_database_response.go +++ b/services/postgresflex/model_instance_create_database_response.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_instance_data_point.go b/services/postgresflex/model_instance_data_point.go index 39cc312d7..e3919124a 100644 --- a/services/postgresflex/model_instance_data_point.go +++ b/services/postgresflex/model_instance_data_point.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_instance_database.go b/services/postgresflex/model_instance_database.go index cca33c0f2..b38991be8 100644 --- a/services/postgresflex/model_instance_database.go +++ b/services/postgresflex/model_instance_database.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_instance_host.go b/services/postgresflex/model_instance_host.go index 744e354c4..a19dcab5c 100644 --- a/services/postgresflex/model_instance_host.go +++ b/services/postgresflex/model_instance_host.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_instance_host_metric.go b/services/postgresflex/model_instance_host_metric.go index 745f7da92..f2a3e0946 100644 --- a/services/postgresflex/model_instance_host_metric.go +++ b/services/postgresflex/model_instance_host_metric.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_instance_list_databases_response.go b/services/postgresflex/model_instance_list_databases_response.go index 3d1107b2b..41ecd99af 100644 --- a/services/postgresflex/model_instance_list_databases_response.go +++ b/services/postgresflex/model_instance_list_databases_response.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_instance_list_instance.go b/services/postgresflex/model_instance_list_instance.go index 8a8fa2779..be7a9aaac 100644 --- a/services/postgresflex/model_instance_list_instance.go +++ b/services/postgresflex/model_instance_list_instance.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_instance_metrics_response.go b/services/postgresflex/model_instance_metrics_response.go index 06c3790f5..042ef9ce0 100644 --- a/services/postgresflex/model_instance_metrics_response.go +++ b/services/postgresflex/model_instance_metrics_response.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_instance_response.go b/services/postgresflex/model_instance_response.go index 8f814ad26..8138df36f 100644 --- a/services/postgresflex/model_instance_response.go +++ b/services/postgresflex/model_instance_response.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_list_backups_response.go b/services/postgresflex/model_list_backups_response.go index ab789cc72..dccd329de 100644 --- a/services/postgresflex/model_list_backups_response.go +++ b/services/postgresflex/model_list_backups_response.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_list_flavors_response.go b/services/postgresflex/model_list_flavors_response.go index ba4da5871..94bb53046 100644 --- a/services/postgresflex/model_list_flavors_response.go +++ b/services/postgresflex/model_list_flavors_response.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_list_instances_response.go b/services/postgresflex/model_list_instances_response.go index bcf116f4b..596b65f98 100644 --- a/services/postgresflex/model_list_instances_response.go +++ b/services/postgresflex/model_list_instances_response.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_list_storages_response.go b/services/postgresflex/model_list_storages_response.go index 06a8a5a9e..d08cd34e2 100644 --- a/services/postgresflex/model_list_storages_response.go +++ b/services/postgresflex/model_list_storages_response.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_list_users_response.go b/services/postgresflex/model_list_users_response.go index a8cc5dc80..a18bf8936 100644 --- a/services/postgresflex/model_list_users_response.go +++ b/services/postgresflex/model_list_users_response.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_list_users_response_item.go b/services/postgresflex/model_list_users_response_item.go index 05637b838..eed4d1f8e 100644 --- a/services/postgresflex/model_list_users_response_item.go +++ b/services/postgresflex/model_list_users_response_item.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_list_versions_response.go b/services/postgresflex/model_list_versions_response.go index 5ecfd84a2..1a1323765 100644 --- a/services/postgresflex/model_list_versions_response.go +++ b/services/postgresflex/model_list_versions_response.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_partial_update_instance_payload.go b/services/postgresflex/model_partial_update_instance_payload.go index e5139826e..87961874d 100644 --- a/services/postgresflex/model_partial_update_instance_payload.go +++ b/services/postgresflex/model_partial_update_instance_payload.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -23,12 +23,13 @@ type PartialUpdateInstancePayload struct { BackupSchedule *string `json:"backupSchedule,omitempty"` FlavorId *string `json:"flavorId,omitempty"` // Labels field is not certain/clear - Labels *map[string]string `json:"labels,omitempty"` - Name *string `json:"name,omitempty"` - Options *map[string]string `json:"options,omitempty"` - Replicas *int64 `json:"replicas,omitempty"` - Storage *Storage `json:"storage,omitempty"` - Version *string `json:"version,omitempty"` + Labels *map[string]string `json:"labels,omitempty"` + Name *string `json:"name,omitempty"` + Options *map[string]string `json:"options,omitempty"` + // Can be cast to int32 without loss of precision. + Replicas *int64 `json:"replicas,omitempty"` + Storage *Storage `json:"storage,omitempty"` + Version *string `json:"version,omitempty"` } // NewPartialUpdateInstancePayload instantiates a new PartialUpdateInstancePayload object diff --git a/services/postgresflex/model_partial_update_instance_response.go b/services/postgresflex/model_partial_update_instance_response.go index 752510481..472c91d78 100644 --- a/services/postgresflex/model_partial_update_instance_response.go +++ b/services/postgresflex/model_partial_update_instance_response.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_partial_update_user_payload.go b/services/postgresflex/model_partial_update_user_payload.go index cadf8cdeb..b6e53523b 100644 --- a/services/postgresflex/model_partial_update_user_payload.go +++ b/services/postgresflex/model_partial_update_user_payload.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_postgres_database_parameter.go b/services/postgresflex/model_postgres_database_parameter.go index ca978fe85..6a5469697 100644 --- a/services/postgresflex/model_postgres_database_parameter.go +++ b/services/postgresflex/model_postgres_database_parameter.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_postgres_database_parameter_response.go b/services/postgresflex/model_postgres_database_parameter_response.go index 7d32cbafc..5eeb3aea5 100644 --- a/services/postgresflex/model_postgres_database_parameter_response.go +++ b/services/postgresflex/model_postgres_database_parameter_response.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_reset_user_response.go b/services/postgresflex/model_reset_user_response.go index ac85fe732..13445c7dd 100644 --- a/services/postgresflex/model_reset_user_response.go +++ b/services/postgresflex/model_reset_user_response.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_storage.go b/services/postgresflex/model_storage.go index 668064d9c..0e9030ae3 100644 --- a/services/postgresflex/model_storage.go +++ b/services/postgresflex/model_storage.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_storage_range.go b/services/postgresflex/model_storage_range.go index d76ce584e..2f905b177 100644 --- a/services/postgresflex/model_storage_range.go +++ b/services/postgresflex/model_storage_range.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_update_backup_schedule_payload.go b/services/postgresflex/model_update_backup_schedule_payload.go index 2d85cd31c..377cd1f39 100644 --- a/services/postgresflex/model_update_backup_schedule_payload.go +++ b/services/postgresflex/model_update_backup_schedule_payload.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_update_instance_payload.go b/services/postgresflex/model_update_instance_payload.go index 9bd35e981..29823bd8e 100644 --- a/services/postgresflex/model_update_instance_payload.go +++ b/services/postgresflex/model_update_instance_payload.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -23,12 +23,13 @@ type UpdateInstancePayload struct { BackupSchedule *string `json:"backupSchedule,omitempty"` FlavorId *string `json:"flavorId,omitempty"` // Labels field is not certain/clear - Labels *map[string]string `json:"labels,omitempty"` - Name *string `json:"name,omitempty"` - Options *map[string]string `json:"options,omitempty"` - Replicas *int64 `json:"replicas,omitempty"` - Storage *Storage `json:"storage,omitempty"` - Version *string `json:"version,omitempty"` + Labels *map[string]string `json:"labels,omitempty"` + Name *string `json:"name,omitempty"` + Options *map[string]string `json:"options,omitempty"` + // Can be cast to int32 without loss of precision. + Replicas *int64 `json:"replicas,omitempty"` + Storage *Storage `json:"storage,omitempty"` + Version *string `json:"version,omitempty"` } // NewUpdateInstancePayload instantiates a new UpdateInstancePayload object diff --git a/services/postgresflex/model_update_user_payload.go b/services/postgresflex/model_update_user_payload.go index 9361c7d35..fa229bbcd 100644 --- a/services/postgresflex/model_update_user_payload.go +++ b/services/postgresflex/model_update_user_payload.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_user.go b/services/postgresflex/model_user.go index 197537592..1561ccd31 100644 --- a/services/postgresflex/model_user.go +++ b/services/postgresflex/model_user.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_user_response.go b/services/postgresflex/model_user_response.go index de124b7d6..50909ebb6 100644 --- a/services/postgresflex/model_user_response.go +++ b/services/postgresflex/model_user_response.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/utils.go b/services/postgresflex/utils.go index 764e4f7cd..2076da42b 100644 --- a/services/postgresflex/utils.go +++ b/services/postgresflex/utils.go @@ -3,7 +3,7 @@ STACKIT PostgreSQL Flex API This is the documentation for the STACKIT postgres service -API version: 1.0.0 +API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.