From f405e3db3f6e42d5116f76fb220f94ccc5fbfda9 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Wed, 17 Jun 2026 07:11:12 +0000 Subject: [PATCH] Generate postgresflex --- services/postgresflex/oas_commit | 2 +- .../postgresflex/v3alpha1api/api_default.go | 407 ++++++++++++++++-- .../v3alpha1api/api_default_mock.go | 6 +- ...el_list_backup.go => model_backup_data.go} | 90 ++-- .../model_clone_instance_overrides.go | 38 ++ .../model_create_instance_request_payload.go | 16 +- .../model_create_user_request_payload.go | 14 +- .../v3alpha1api/model_create_user_response.go | 32 +- .../v3alpha1api/model_get_backup_response.go | 318 -------------- .../model_get_instance_response.go | 49 ++- .../v3alpha1api/model_get_user_response.go | 42 +- .../v3alpha1api/model_instance_encryption.go | 2 +- .../v3alpha1api/model_instance_sort.go | 4 + .../v3alpha1api/model_list_backup_response.go | 12 +- .../v3alpha1api/model_list_instance.go | 31 +- .../v3alpha1api/model_list_user.go | 32 +- .../v3alpha1api/model_reset_user_response.go | 32 +- .../postgresflex/v3alpha1api/model_status.go | 2 + .../model_update_instance_request_payload.go | 16 +- ...l_update_user_partially_request_payload.go | 14 +- .../model_update_user_request_payload.go | 14 +- .../v3alpha1api/model_user_role.go | 114 ----- .../v3alpha1api/model_user_sort.go | 4 + 23 files changed, 716 insertions(+), 575 deletions(-) rename services/postgresflex/v3alpha1api/{model_list_backup.go => model_backup_data.go} (71%) delete mode 100644 services/postgresflex/v3alpha1api/model_get_backup_response.go delete mode 100644 services/postgresflex/v3alpha1api/model_user_role.go diff --git a/services/postgresflex/oas_commit b/services/postgresflex/oas_commit index f87355dc7..92110ac5e 100644 --- a/services/postgresflex/oas_commit +++ b/services/postgresflex/oas_commit @@ -1 +1 @@ -b007357148d67833f3db635716935453d20a8609 +dced41b14515398157ee7204ef11256b9e3fcbdc diff --git a/services/postgresflex/v3alpha1api/api_default.go b/services/postgresflex/v3alpha1api/api_default.go index 378953bd5..a62b33995 100644 --- a/services/postgresflex/v3alpha1api/api_default.go +++ b/services/postgresflex/v3alpha1api/api_default.go @@ -156,8 +156,8 @@ type DefaultAPI interface { GetBackupRequest(ctx context.Context, projectId string, region string, instanceId string, backupId int32) ApiGetBackupRequestRequest // GetBackupRequestExecute executes the request - // @return GetBackupResponse - GetBackupRequestExecute(r ApiGetBackupRequestRequest) (*GetBackupResponse, error) + // @return BackupData + GetBackupRequestExecute(r ApiGetBackupRequestRequest) (*BackupData, error) /* GetCollationsRequest Get Collations for an Instance @@ -644,6 +644,17 @@ func (a *DefaultAPIService) CloneRequestExecute(r ApiCloneRequestRequest) (*Clon newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 422 { var v ValidationError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -675,6 +686,17 @@ func (a *DefaultAPIService) CloneRequestExecute(r ApiCloneRequestRequest) (*Clon } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + 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 } @@ -866,8 +888,8 @@ func (a *DefaultAPIService) CreateDatabaseRequestExecute(r ApiCreateDatabaseRequ newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 412 { - var v Error + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -877,8 +899,8 @@ func (a *DefaultAPIService) CreateDatabaseRequestExecute(r ApiCreateDatabaseRequ newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 422 { - var v ValidationError + if localVarHTTPResponse.StatusCode == 423 { + var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -897,6 +919,17 @@ func (a *DefaultAPIService) CreateDatabaseRequestExecute(r ApiCreateDatabaseRequ } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + 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 } @@ -1093,6 +1126,17 @@ func (a *DefaultAPIService) CreateInstanceRequestExecute(r ApiCreateInstanceRequ } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + 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 } @@ -1273,7 +1317,7 @@ func (a *DefaultAPIService) CreateUserRequestExecute(r ApiCreateUserRequestReque newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 412 { + if localVarHTTPResponse.StatusCode == 409 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1295,6 +1339,17 @@ func (a *DefaultAPIService) CreateUserRequestExecute(r ApiCreateUserRequestReque newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 423 { + 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 == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1304,6 +1359,17 @@ func (a *DefaultAPIService) CreateUserRequestExecute(r ApiCreateUserRequestReque } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + 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 } @@ -1473,7 +1539,7 @@ func (a *DefaultAPIService) DeleteDatabaseRequestExecute(r ApiDeleteDatabaseRequ newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 412 { + if localVarHTTPResponse.StatusCode == 423 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1493,6 +1559,17 @@ func (a *DefaultAPIService) DeleteDatabaseRequestExecute(r ApiDeleteDatabaseRequ } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + 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 } @@ -1668,6 +1745,17 @@ func (a *DefaultAPIService) DeleteInstanceRequestExecute(r ApiDeleteInstanceRequ } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + 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 } @@ -1827,7 +1915,18 @@ func (a *DefaultAPIService) DeleteUserRequestExecute(r ApiDeleteUserRequestReque newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 412 { + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 423 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1847,6 +1946,17 @@ func (a *DefaultAPIService) DeleteUserRequestExecute(r ApiDeleteUserRequestReque } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + 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 } @@ -1863,7 +1973,7 @@ type ApiGetBackupRequestRequest struct { backupId int32 } -func (r ApiGetBackupRequestRequest) Execute() (*GetBackupResponse, error) { +func (r ApiGetBackupRequestRequest) Execute() (*BackupData, error) { return r.ApiService.GetBackupRequestExecute(r) } @@ -1892,13 +2002,13 @@ func (a *DefaultAPIService) GetBackupRequest(ctx context.Context, projectId stri // Execute executes the request // -// @return GetBackupResponse -func (a *DefaultAPIService) GetBackupRequestExecute(r ApiGetBackupRequestRequest) (*GetBackupResponse, error) { +// @return BackupData +func (a *DefaultAPIService) GetBackupRequestExecute(r ApiGetBackupRequestRequest) (*BackupData, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetBackupResponse + localVarReturnValue *BackupData ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetBackupRequest") @@ -2029,6 +2139,17 @@ func (a *DefaultAPIService) GetBackupRequestExecute(r ApiGetBackupRequestRequest } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + 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 } @@ -2217,6 +2338,17 @@ func (a *DefaultAPIService) GetCollationsRequestExecute(r ApiGetCollationsReques } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + 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 } @@ -2398,6 +2530,17 @@ func (a *DefaultAPIService) GetDatabaseRequestExecute(r ApiGetDatabaseRequestReq } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + 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 } @@ -2620,6 +2763,17 @@ func (a *DefaultAPIService) GetFlavorsRequestExecute(r ApiGetFlavorsRequestReque } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + 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 } @@ -2797,6 +2951,17 @@ func (a *DefaultAPIService) GetInstanceRequestExecute(r ApiGetInstanceRequestReq } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + 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 } @@ -2978,6 +3143,17 @@ func (a *DefaultAPIService) GetUserRequestExecute(r ApiGetUserRequestRequest) (* } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + 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 } @@ -3388,6 +3564,17 @@ func (a *DefaultAPIService) ListBackupsRequestExecute(r ApiListBackupsRequestReq } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + 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 } @@ -3603,6 +3790,17 @@ func (a *DefaultAPIService) ListDatabasesRequestExecute(r ApiListDatabasesReques } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + 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 } @@ -3814,6 +4012,17 @@ func (a *DefaultAPIService) ListInstancesRequestExecute(r ApiListInstancesReques } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + 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 } @@ -3991,6 +4200,17 @@ func (a *DefaultAPIService) ListRolesRequestExecute(r ApiListRolesRequestRequest } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + 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 } @@ -4206,6 +4426,17 @@ func (a *DefaultAPIService) ListUsersRequestExecute(r ApiListUsersRequestRequest } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + 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 } @@ -4417,6 +4648,17 @@ func (a *DefaultAPIService) ProtectInstanceRequestExecute(r ApiProtectInstanceRe } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + 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 } @@ -4589,8 +4831,8 @@ func (a *DefaultAPIService) ResetUserRequestExecute(r ApiResetUserRequestRequest newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 412 { - var v Error + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -4600,8 +4842,8 @@ func (a *DefaultAPIService) ResetUserRequestExecute(r ApiResetUserRequestRequest newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 422 { - var v ValidationError + if localVarHTTPResponse.StatusCode == 423 { + var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -4620,6 +4862,17 @@ func (a *DefaultAPIService) ResetUserRequestExecute(r ApiResetUserRequestRequest } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + 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 } @@ -4801,8 +5054,8 @@ func (a *DefaultAPIService) UpdateDatabasePartiallyRequestExecute(r ApiUpdateDat newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 412 { - var v Error + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -4812,8 +5065,8 @@ func (a *DefaultAPIService) UpdateDatabasePartiallyRequestExecute(r ApiUpdateDat newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 422 { - var v ValidationError + if localVarHTTPResponse.StatusCode == 423 { + var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -4832,6 +5085,17 @@ func (a *DefaultAPIService) UpdateDatabasePartiallyRequestExecute(r ApiUpdateDat } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + 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 } @@ -5003,8 +5267,8 @@ func (a *DefaultAPIService) UpdateDatabaseRequestExecute(r ApiUpdateDatabaseRequ newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 412 { - var v Error + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -5014,8 +5278,8 @@ func (a *DefaultAPIService) UpdateDatabaseRequestExecute(r ApiUpdateDatabaseRequ newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 422 { - var v ValidationError + if localVarHTTPResponse.StatusCode == 423 { + var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -5034,6 +5298,17 @@ func (a *DefaultAPIService) UpdateDatabaseRequestExecute(r ApiUpdateDatabaseRequ } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + 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 } @@ -5223,6 +5498,17 @@ func (a *DefaultAPIService) UpdateInstancePartiallyRequestExecute(r ApiUpdateIns newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 423 { + 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")) @@ -5232,6 +5518,17 @@ func (a *DefaultAPIService) UpdateInstancePartiallyRequestExecute(r ApiUpdateIns } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + 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 } @@ -5421,6 +5718,17 @@ func (a *DefaultAPIService) UpdateInstanceRequestExecute(r ApiUpdateInstanceRequ newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 423 { + 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")) @@ -5430,6 +5738,17 @@ func (a *DefaultAPIService) UpdateInstanceRequestExecute(r ApiUpdateInstanceRequ } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + 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 } @@ -5598,8 +5917,8 @@ func (a *DefaultAPIService) UpdateUserPartiallyRequestExecute(r ApiUpdateUserPar newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 412 { - var v Error + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -5609,8 +5928,8 @@ func (a *DefaultAPIService) UpdateUserPartiallyRequestExecute(r ApiUpdateUserPar newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 422 { - var v ValidationError + if localVarHTTPResponse.StatusCode == 423 { + var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -5629,6 +5948,17 @@ func (a *DefaultAPIService) UpdateUserPartiallyRequestExecute(r ApiUpdateUserPar } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + 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 } @@ -5800,8 +6130,8 @@ func (a *DefaultAPIService) UpdateUserRequestExecute(r ApiUpdateUserRequestReque newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 412 { - var v Error + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -5811,8 +6141,8 @@ func (a *DefaultAPIService) UpdateUserRequestExecute(r ApiUpdateUserRequestReque newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 422 { - var v ValidationError + if localVarHTTPResponse.StatusCode == 423 { + var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -5831,6 +6161,17 @@ func (a *DefaultAPIService) UpdateUserRequestExecute(r ApiUpdateUserRequestReque } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + 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 } diff --git a/services/postgresflex/v3alpha1api/api_default_mock.go b/services/postgresflex/v3alpha1api/api_default_mock.go index 8a2fefee0..15a607e45 100644 --- a/services/postgresflex/v3alpha1api/api_default_mock.go +++ b/services/postgresflex/v3alpha1api/api_default_mock.go @@ -36,7 +36,7 @@ type DefaultAPIServiceMock struct { // DeleteUserRequestExecuteMock can be populated to implement the behavior of the DeleteUserRequestExecute function of this mock DeleteUserRequestExecuteMock *func(r ApiDeleteUserRequestRequest) error // GetBackupRequestExecuteMock can be populated to implement the behavior of the GetBackupRequestExecute function of this mock - GetBackupRequestExecuteMock *func(r ApiGetBackupRequestRequest) (*GetBackupResponse, error) + GetBackupRequestExecuteMock *func(r ApiGetBackupRequestRequest) (*BackupData, error) // GetCollationsRequestExecuteMock can be populated to implement the behavior of the GetCollationsRequestExecute function of this mock GetCollationsRequestExecuteMock *func(r ApiGetCollationsRequestRequest) (*GetCollationsResponse, error) // GetDatabaseRequestExecuteMock can be populated to implement the behavior of the GetDatabaseRequestExecute function of this mock @@ -227,9 +227,9 @@ func (a DefaultAPIServiceMock) GetBackupRequest(ctx context.Context, projectId s } // GetBackupRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetBackupRequestExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) GetBackupRequestExecute(r ApiGetBackupRequestRequest) (*GetBackupResponse, error) { +func (a DefaultAPIServiceMock) GetBackupRequestExecute(r ApiGetBackupRequestRequest) (*BackupData, error) { if a.GetBackupRequestExecuteMock == nil { - var localVarReturnValue *GetBackupResponse + var localVarReturnValue *BackupData return localVarReturnValue, nil } diff --git a/services/postgresflex/v3alpha1api/model_list_backup.go b/services/postgresflex/v3alpha1api/model_backup_data.go similarity index 71% rename from services/postgresflex/v3alpha1api/model_list_backup.go rename to services/postgresflex/v3alpha1api/model_backup_data.go index 6086a3a75..f8253074c 100644 --- a/services/postgresflex/v3alpha1api/model_list_backup.go +++ b/services/postgresflex/v3alpha1api/model_backup_data.go @@ -16,11 +16,11 @@ import ( "fmt" ) -// checks if the ListBackup type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListBackup{} +// checks if the BackupData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupData{} -// ListBackup struct for ListBackup -type ListBackup struct { +// BackupData struct for BackupData +type BackupData struct { // The time when the backup was completed in RFC3339 format. CompletionTime string `json:"completionTime"` // The ID of the backup. @@ -36,14 +36,14 @@ type ListBackup struct { AdditionalProperties map[string]interface{} } -type _ListBackup ListBackup +type _BackupData BackupData -// NewListBackup instantiates a new ListBackup object +// NewBackupData instantiates a new BackupData object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewListBackup(completionTime string, id int32, name string, retainedUntil string, size int32, types string) *ListBackup { - this := ListBackup{} +func NewBackupData(completionTime string, id int32, name string, retainedUntil string, size int32, types string) *BackupData { + this := BackupData{} this.CompletionTime = completionTime this.Id = id this.Name = name @@ -53,16 +53,16 @@ func NewListBackup(completionTime string, id int32, name string, retainedUntil s return &this } -// NewListBackupWithDefaults instantiates a new ListBackup object +// NewBackupDataWithDefaults instantiates a new BackupData object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set -func NewListBackupWithDefaults() *ListBackup { - this := ListBackup{} +func NewBackupDataWithDefaults() *BackupData { + this := BackupData{} return &this } // GetCompletionTime returns the CompletionTime field value -func (o *ListBackup) GetCompletionTime() string { +func (o *BackupData) GetCompletionTime() string { if o == nil { var ret string return ret @@ -73,7 +73,7 @@ func (o *ListBackup) GetCompletionTime() string { // GetCompletionTimeOk returns a tuple with the CompletionTime field value // and a boolean to check if the value has been set. -func (o *ListBackup) GetCompletionTimeOk() (*string, bool) { +func (o *BackupData) GetCompletionTimeOk() (*string, bool) { if o == nil { return nil, false } @@ -81,12 +81,12 @@ func (o *ListBackup) GetCompletionTimeOk() (*string, bool) { } // SetCompletionTime sets field value -func (o *ListBackup) SetCompletionTime(v string) { +func (o *BackupData) SetCompletionTime(v string) { o.CompletionTime = v } // GetId returns the Id field value -func (o *ListBackup) GetId() int32 { +func (o *BackupData) GetId() int32 { if o == nil { var ret int32 return ret @@ -97,7 +97,7 @@ func (o *ListBackup) GetId() int32 { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *ListBackup) GetIdOk() (*int32, bool) { +func (o *BackupData) GetIdOk() (*int32, bool) { if o == nil { return nil, false } @@ -105,12 +105,12 @@ func (o *ListBackup) GetIdOk() (*int32, bool) { } // SetId sets field value -func (o *ListBackup) SetId(v int32) { +func (o *BackupData) SetId(v int32) { o.Id = v } // GetName returns the Name field value -func (o *ListBackup) GetName() string { +func (o *BackupData) GetName() string { if o == nil { var ret string return ret @@ -121,7 +121,7 @@ func (o *ListBackup) GetName() string { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. -func (o *ListBackup) GetNameOk() (*string, bool) { +func (o *BackupData) GetNameOk() (*string, bool) { if o == nil { return nil, false } @@ -129,12 +129,12 @@ func (o *ListBackup) GetNameOk() (*string, bool) { } // SetName sets field value -func (o *ListBackup) SetName(v string) { +func (o *BackupData) SetName(v string) { o.Name = v } // GetRetainedUntil returns the RetainedUntil field value -func (o *ListBackup) GetRetainedUntil() string { +func (o *BackupData) GetRetainedUntil() string { if o == nil { var ret string return ret @@ -145,7 +145,7 @@ func (o *ListBackup) GetRetainedUntil() string { // GetRetainedUntilOk returns a tuple with the RetainedUntil field value // and a boolean to check if the value has been set. -func (o *ListBackup) GetRetainedUntilOk() (*string, bool) { +func (o *BackupData) GetRetainedUntilOk() (*string, bool) { if o == nil { return nil, false } @@ -153,12 +153,12 @@ func (o *ListBackup) GetRetainedUntilOk() (*string, bool) { } // SetRetainedUntil sets field value -func (o *ListBackup) SetRetainedUntil(v string) { +func (o *BackupData) SetRetainedUntil(v string) { o.RetainedUntil = v } // GetSize returns the Size field value -func (o *ListBackup) GetSize() int32 { +func (o *BackupData) GetSize() int32 { if o == nil { var ret int32 return ret @@ -169,7 +169,7 @@ func (o *ListBackup) GetSize() int32 { // GetSizeOk returns a tuple with the Size field value // and a boolean to check if the value has been set. -func (o *ListBackup) GetSizeOk() (*int32, bool) { +func (o *BackupData) GetSizeOk() (*int32, bool) { if o == nil { return nil, false } @@ -177,12 +177,12 @@ func (o *ListBackup) GetSizeOk() (*int32, bool) { } // SetSize sets field value -func (o *ListBackup) SetSize(v int32) { +func (o *BackupData) SetSize(v int32) { o.Size = v } // GetType returns the Type field value -func (o *ListBackup) GetType() string { +func (o *BackupData) GetType() string { if o == nil { var ret string return ret @@ -193,7 +193,7 @@ func (o *ListBackup) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *ListBackup) GetTypeOk() (*string, bool) { +func (o *BackupData) GetTypeOk() (*string, bool) { if o == nil { return nil, false } @@ -201,11 +201,11 @@ func (o *ListBackup) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *ListBackup) SetType(v string) { +func (o *BackupData) SetType(v string) { o.Type = v } -func (o ListBackup) MarshalJSON() ([]byte, error) { +func (o BackupData) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { return []byte{}, err @@ -213,7 +213,7 @@ func (o ListBackup) MarshalJSON() ([]byte, error) { return json.Marshal(toSerialize) } -func (o ListBackup) ToMap() (map[string]interface{}, error) { +func (o BackupData) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["completionTime"] = o.CompletionTime toSerialize["id"] = o.Id @@ -229,7 +229,7 @@ func (o ListBackup) ToMap() (map[string]interface{}, error) { return toSerialize, nil } -func (o *ListBackup) UnmarshalJSON(data []byte) (err error) { +func (o *BackupData) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. @@ -256,15 +256,15 @@ func (o *ListBackup) UnmarshalJSON(data []byte) (err error) { } } - varListBackup := _ListBackup{} + varBackupData := _BackupData{} - err = json.Unmarshal(data, &varListBackup) + err = json.Unmarshal(data, &varBackupData) if err != nil { return err } - *o = ListBackup(varListBackup) + *o = BackupData(varBackupData) additionalProperties := make(map[string]interface{}) @@ -281,38 +281,38 @@ func (o *ListBackup) UnmarshalJSON(data []byte) (err error) { return err } -type NullableListBackup struct { - value *ListBackup +type NullableBackupData struct { + value *BackupData isSet bool } -func (v NullableListBackup) Get() *ListBackup { +func (v NullableBackupData) Get() *BackupData { return v.value } -func (v *NullableListBackup) Set(val *ListBackup) { +func (v *NullableBackupData) Set(val *BackupData) { v.value = val v.isSet = true } -func (v NullableListBackup) IsSet() bool { +func (v NullableBackupData) IsSet() bool { return v.isSet } -func (v *NullableListBackup) Unset() { +func (v *NullableBackupData) Unset() { v.value = nil v.isSet = false } -func NewNullableListBackup(val *ListBackup) *NullableListBackup { - return &NullableListBackup{value: val, isSet: true} +func NewNullableBackupData(val *BackupData) *NullableBackupData { + return &NullableBackupData{value: val, isSet: true} } -func (v NullableListBackup) MarshalJSON() ([]byte, error) { +func (v NullableBackupData) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } -func (v *NullableListBackup) UnmarshalJSON(src []byte) error { +func (v *NullableBackupData) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/postgresflex/v3alpha1api/model_clone_instance_overrides.go b/services/postgresflex/v3alpha1api/model_clone_instance_overrides.go index f74d96940..d6bec8478 100644 --- a/services/postgresflex/v3alpha1api/model_clone_instance_overrides.go +++ b/services/postgresflex/v3alpha1api/model_clone_instance_overrides.go @@ -21,6 +21,8 @@ var _ MappedNullable = &CloneInstanceOverrides{} // CloneInstanceOverrides struct for CloneInstanceOverrides type CloneInstanceOverrides struct { + // The name of the cloned instance. If not provided, the default naming behavior of appending '-clone' to the source instance name is used. + Name *string `json:"name,omitempty"` // The storage class for the storage. PerformanceClass string `json:"performanceClass"` // The storage size in Gigabytes. @@ -49,6 +51,38 @@ func NewCloneInstanceOverridesWithDefaults() *CloneInstanceOverrides { return &this } +// GetName returns the Name field value if set, zero value otherwise. +func (o *CloneInstanceOverrides) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CloneInstanceOverrides) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *CloneInstanceOverrides) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CloneInstanceOverrides) SetName(v string) { + o.Name = &v +} + // GetPerformanceClass returns the PerformanceClass field value func (o *CloneInstanceOverrides) GetPerformanceClass() string { if o == nil { @@ -107,6 +141,9 @@ func (o CloneInstanceOverrides) MarshalJSON() ([]byte, error) { func (o CloneInstanceOverrides) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } toSerialize["performanceClass"] = o.PerformanceClass toSerialize["size"] = o.Size @@ -153,6 +190,7 @@ func (o *CloneInstanceOverrides) UnmarshalJSON(data []byte) (err error) { additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") delete(additionalProperties, "performanceClass") delete(additionalProperties, "size") o.AdditionalProperties = additionalProperties diff --git a/services/postgresflex/v3alpha1api/model_create_instance_request_payload.go b/services/postgresflex/v3alpha1api/model_create_instance_request_payload.go index 478ae8739..53f01c94d 100644 --- a/services/postgresflex/v3alpha1api/model_create_instance_request_payload.go +++ b/services/postgresflex/v3alpha1api/model_create_instance_request_payload.go @@ -33,7 +33,7 @@ type CreateInstanceRequestPayload struct { Network InstanceNetworkCreate `json:"network"` Replicas Replicas `json:"replicas"` // How long backups are retained. The value can only be between 32 and 90 days. - RetentionDays int32 `json:"retentionDays"` + RetentionDays NullableInt32 `json:"retentionDays"` Storage StorageCreate `json:"storage"` // The Postgres version used for the instance. See [Versions Endpoint](/documentation/postgres-flex-service/version/v3alpha1#tag/Version) for supported version parameters. Version string `json:"version"` @@ -46,7 +46,7 @@ type _CreateInstanceRequestPayload CreateInstanceRequestPayload // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCreateInstanceRequestPayload(backupSchedule string, flavorId string, name string, network InstanceNetworkCreate, replicas Replicas, retentionDays int32, storage StorageCreate, version string) *CreateInstanceRequestPayload { +func NewCreateInstanceRequestPayload(backupSchedule string, flavorId string, name string, network InstanceNetworkCreate, replicas Replicas, retentionDays NullableInt32, storage StorageCreate, version string) *CreateInstanceRequestPayload { this := CreateInstanceRequestPayload{} this.BackupSchedule = backupSchedule this.FlavorId = flavorId @@ -252,27 +252,29 @@ func (o *CreateInstanceRequestPayload) SetReplicas(v Replicas) { } // GetRetentionDays returns the RetentionDays field value +// If the value is explicit nil, the zero value for int32 will be returned func (o *CreateInstanceRequestPayload) GetRetentionDays() int32 { - if o == nil { + if o == nil || o.RetentionDays.Get() == nil { var ret int32 return ret } - return o.RetentionDays + return *o.RetentionDays.Get() } // GetRetentionDaysOk returns a tuple with the RetentionDays field value // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CreateInstanceRequestPayload) GetRetentionDaysOk() (*int32, bool) { if o == nil { return nil, false } - return &o.RetentionDays, true + return o.RetentionDays.Get(), o.RetentionDays.IsSet() } // SetRetentionDays sets field value func (o *CreateInstanceRequestPayload) SetRetentionDays(v int32) { - o.RetentionDays = v + o.RetentionDays.Set(&v) } // GetStorage returns the Storage field value @@ -344,7 +346,7 @@ func (o CreateInstanceRequestPayload) ToMap() (map[string]interface{}, error) { toSerialize["name"] = o.Name toSerialize["network"] = o.Network toSerialize["replicas"] = o.Replicas - toSerialize["retentionDays"] = o.RetentionDays + toSerialize["retentionDays"] = o.RetentionDays.Get() toSerialize["storage"] = o.Storage toSerialize["version"] = o.Version diff --git a/services/postgresflex/v3alpha1api/model_create_user_request_payload.go b/services/postgresflex/v3alpha1api/model_create_user_request_payload.go index f26e937b7..82c279e00 100644 --- a/services/postgresflex/v3alpha1api/model_create_user_request_payload.go +++ b/services/postgresflex/v3alpha1api/model_create_user_request_payload.go @@ -23,8 +23,8 @@ var _ MappedNullable = &CreateUserRequestPayload{} type CreateUserRequestPayload struct { // The name of the user. Name string `json:"name"` - // A list containing the user roles for the instance. - Roles []UserRole `json:"roles,omitempty"` + // A list containing the user roles for the instance. Please refer to the List Roles endpoint for a list of all available Roles. + Roles []string `json:"roles,omitempty"` AdditionalProperties map[string]interface{} } @@ -73,9 +73,9 @@ func (o *CreateUserRequestPayload) SetName(v string) { } // GetRoles returns the Roles field value if set, zero value otherwise. -func (o *CreateUserRequestPayload) GetRoles() []UserRole { +func (o *CreateUserRequestPayload) GetRoles() []string { if o == nil || IsNil(o.Roles) { - var ret []UserRole + var ret []string return ret } return o.Roles @@ -83,7 +83,7 @@ func (o *CreateUserRequestPayload) GetRoles() []UserRole { // GetRolesOk returns a tuple with the Roles field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateUserRequestPayload) GetRolesOk() ([]UserRole, bool) { +func (o *CreateUserRequestPayload) GetRolesOk() ([]string, bool) { if o == nil || IsNil(o.Roles) { return nil, false } @@ -99,8 +99,8 @@ func (o *CreateUserRequestPayload) HasRoles() bool { return false } -// SetRoles gets a reference to the given []UserRole and assigns it to the Roles field. -func (o *CreateUserRequestPayload) SetRoles(v []UserRole) { +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +func (o *CreateUserRequestPayload) SetRoles(v []string) { o.Roles = v } diff --git a/services/postgresflex/v3alpha1api/model_create_user_response.go b/services/postgresflex/v3alpha1api/model_create_user_response.go index 6073751cd..051043885 100644 --- a/services/postgresflex/v3alpha1api/model_create_user_response.go +++ b/services/postgresflex/v3alpha1api/model_create_user_response.go @@ -28,6 +28,8 @@ type CreateUserResponse struct { // The password for the user. Password string `json:"password"` // The current status of the user. + State string `json:"state"` + // The current status of the user. Status string `json:"status"` AdditionalProperties map[string]interface{} } @@ -38,11 +40,12 @@ type _CreateUserResponse CreateUserResponse // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCreateUserResponse(id int32, name string, password string, status string) *CreateUserResponse { +func NewCreateUserResponse(id int32, name string, password string, state string, status string) *CreateUserResponse { this := CreateUserResponse{} this.Id = id this.Name = name this.Password = password + this.State = state this.Status = status return &this } @@ -127,6 +130,30 @@ func (o *CreateUserResponse) SetPassword(v string) { o.Password = v } +// GetState returns the State field value +func (o *CreateUserResponse) GetState() string { + if o == nil { + var ret string + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *CreateUserResponse) GetStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *CreateUserResponse) SetState(v string) { + o.State = v +} + // GetStatus returns the Status field value func (o *CreateUserResponse) GetStatus() string { if o == nil { @@ -164,6 +191,7 @@ func (o CreateUserResponse) ToMap() (map[string]interface{}, error) { toSerialize["id"] = o.Id toSerialize["name"] = o.Name toSerialize["password"] = o.Password + toSerialize["state"] = o.State toSerialize["status"] = o.Status for key, value := range o.AdditionalProperties { @@ -181,6 +209,7 @@ func (o *CreateUserResponse) UnmarshalJSON(data []byte) (err error) { "id", "name", "password", + "state", "status", } @@ -214,6 +243,7 @@ func (o *CreateUserResponse) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "id") delete(additionalProperties, "name") delete(additionalProperties, "password") + delete(additionalProperties, "state") delete(additionalProperties, "status") o.AdditionalProperties = additionalProperties } diff --git a/services/postgresflex/v3alpha1api/model_get_backup_response.go b/services/postgresflex/v3alpha1api/model_get_backup_response.go deleted file mode 100644 index 68b87f610..000000000 --- a/services/postgresflex/v3alpha1api/model_get_backup_response.go +++ /dev/null @@ -1,318 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT Postgres Flex service - -API version: 3alpha1 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v3alpha1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the GetBackupResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetBackupResponse{} - -// GetBackupResponse struct for GetBackupResponse -type GetBackupResponse struct { - // The time when the backup was completed in RFC3339 format. - CompletionTime string `json:"completionTime"` - // The ID of the backup. - Id int32 `json:"id"` - // The name of the backup. - Name string `json:"name"` - // The time until the backup will be retained. - RetainedUntil string `json:"retainedUntil"` - // The size of the backup in bytes. - Size int32 `json:"size"` - // The type of the backup, which can be automated or manual triggered. - Type string `json:"type"` - AdditionalProperties map[string]interface{} -} - -type _GetBackupResponse GetBackupResponse - -// NewGetBackupResponse instantiates a new GetBackupResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewGetBackupResponse(completionTime string, id int32, name string, retainedUntil string, size int32, types string) *GetBackupResponse { - this := GetBackupResponse{} - this.CompletionTime = completionTime - this.Id = id - this.Name = name - this.RetainedUntil = retainedUntil - this.Size = size - this.Type = types - return &this -} - -// NewGetBackupResponseWithDefaults instantiates a new GetBackupResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewGetBackupResponseWithDefaults() *GetBackupResponse { - this := GetBackupResponse{} - return &this -} - -// GetCompletionTime returns the CompletionTime field value -func (o *GetBackupResponse) GetCompletionTime() string { - if o == nil { - var ret string - return ret - } - - return o.CompletionTime -} - -// GetCompletionTimeOk returns a tuple with the CompletionTime field value -// and a boolean to check if the value has been set. -func (o *GetBackupResponse) GetCompletionTimeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.CompletionTime, true -} - -// SetCompletionTime sets field value -func (o *GetBackupResponse) SetCompletionTime(v string) { - o.CompletionTime = v -} - -// GetId returns the Id field value -func (o *GetBackupResponse) GetId() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *GetBackupResponse) GetIdOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *GetBackupResponse) SetId(v int32) { - o.Id = v -} - -// GetName returns the Name field value -func (o *GetBackupResponse) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *GetBackupResponse) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *GetBackupResponse) SetName(v string) { - o.Name = v -} - -// GetRetainedUntil returns the RetainedUntil field value -func (o *GetBackupResponse) GetRetainedUntil() string { - if o == nil { - var ret string - return ret - } - - return o.RetainedUntil -} - -// GetRetainedUntilOk returns a tuple with the RetainedUntil field value -// and a boolean to check if the value has been set. -func (o *GetBackupResponse) GetRetainedUntilOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.RetainedUntil, true -} - -// SetRetainedUntil sets field value -func (o *GetBackupResponse) SetRetainedUntil(v string) { - o.RetainedUntil = v -} - -// GetSize returns the Size field value -func (o *GetBackupResponse) GetSize() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Size -} - -// GetSizeOk returns a tuple with the Size field value -// and a boolean to check if the value has been set. -func (o *GetBackupResponse) GetSizeOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Size, true -} - -// SetSize sets field value -func (o *GetBackupResponse) SetSize(v int32) { - o.Size = v -} - -// GetType returns the Type field value -func (o *GetBackupResponse) GetType() string { - if o == nil { - var ret string - return ret - } - - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -func (o *GetBackupResponse) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *GetBackupResponse) SetType(v string) { - o.Type = v -} - -func (o GetBackupResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GetBackupResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["completionTime"] = o.CompletionTime - toSerialize["id"] = o.Id - toSerialize["name"] = o.Name - toSerialize["retainedUntil"] = o.RetainedUntil - toSerialize["size"] = o.Size - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *GetBackupResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "completionTime", - "id", - "name", - "retainedUntil", - "size", - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varGetBackupResponse := _GetBackupResponse{} - - err = json.Unmarshal(data, &varGetBackupResponse) - - if err != nil { - return err - } - - *o = GetBackupResponse(varGetBackupResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "completionTime") - delete(additionalProperties, "id") - delete(additionalProperties, "name") - delete(additionalProperties, "retainedUntil") - delete(additionalProperties, "size") - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableGetBackupResponse struct { - value *GetBackupResponse - isSet bool -} - -func (v NullableGetBackupResponse) Get() *GetBackupResponse { - return v.value -} - -func (v *NullableGetBackupResponse) Set(val *GetBackupResponse) { - v.value = val - v.isSet = true -} - -func (v NullableGetBackupResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableGetBackupResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetBackupResponse(val *GetBackupResponse) *NullableGetBackupResponse { - return &NullableGetBackupResponse{value: val, isSet: true} -} - -func (v NullableGetBackupResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetBackupResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v3alpha1api/model_get_instance_response.go b/services/postgresflex/v3alpha1api/model_get_instance_response.go index 39791bac2..c80897a76 100644 --- a/services/postgresflex/v3alpha1api/model_get_instance_response.go +++ b/services/postgresflex/v3alpha1api/model_get_instance_response.go @@ -40,9 +40,10 @@ type GetInstanceResponse struct { Network InstanceNetwork `json:"network"` Replicas Replicas `json:"replicas"` // How long backups are retained. The value can only be between 32 and 90 days. - RetentionDays int32 `json:"retentionDays"` - Status Status `json:"status"` - Storage Storage `json:"storage"` + RetentionDays NullableInt32 `json:"retentionDays"` + State Status `json:"state"` + Status Status `json:"status"` + Storage Storage `json:"storage"` // The Postgres version used for the instance. See [Versions Endpoint](/documentation/postgres-flex-service/version/v3alpha1#tag/Version) for supported version parameters. Version string `json:"version"` AdditionalProperties map[string]interface{} @@ -54,7 +55,7 @@ type _GetInstanceResponse GetInstanceResponse // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewGetInstanceResponse(backupSchedule string, connectionInfo InstanceConnectionInfo, flavorId string, id string, isDeletable bool, name string, network InstanceNetwork, replicas Replicas, retentionDays int32, status Status, storage Storage, version string) *GetInstanceResponse { +func NewGetInstanceResponse(backupSchedule string, connectionInfo InstanceConnectionInfo, flavorId string, id string, isDeletable bool, name string, network InstanceNetwork, replicas Replicas, retentionDays NullableInt32, state Status, status Status, storage Storage, version string) *GetInstanceResponse { this := GetInstanceResponse{} this.BackupSchedule = backupSchedule this.ConnectionInfo = connectionInfo @@ -65,6 +66,7 @@ func NewGetInstanceResponse(backupSchedule string, connectionInfo InstanceConnec this.Network = network this.Replicas = replicas this.RetentionDays = retentionDays + this.State = state this.Status = status this.Storage = storage this.Version = version @@ -368,27 +370,53 @@ func (o *GetInstanceResponse) SetReplicas(v Replicas) { } // GetRetentionDays returns the RetentionDays field value +// If the value is explicit nil, the zero value for int32 will be returned func (o *GetInstanceResponse) GetRetentionDays() int32 { - if o == nil { + if o == nil || o.RetentionDays.Get() == nil { var ret int32 return ret } - return o.RetentionDays + return *o.RetentionDays.Get() } // GetRetentionDaysOk returns a tuple with the RetentionDays field value // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *GetInstanceResponse) GetRetentionDaysOk() (*int32, bool) { if o == nil { return nil, false } - return &o.RetentionDays, true + return o.RetentionDays.Get(), o.RetentionDays.IsSet() } // SetRetentionDays sets field value func (o *GetInstanceResponse) SetRetentionDays(v int32) { - o.RetentionDays = v + o.RetentionDays.Set(&v) +} + +// GetState returns the State field value +func (o *GetInstanceResponse) GetState() Status { + if o == nil { + var ret Status + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *GetInstanceResponse) GetStateOk() (*Status, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *GetInstanceResponse) SetState(v Status) { + o.State = v } // GetStatus returns the Status field value @@ -490,7 +518,8 @@ func (o GetInstanceResponse) ToMap() (map[string]interface{}, error) { toSerialize["name"] = o.Name toSerialize["network"] = o.Network toSerialize["replicas"] = o.Replicas - toSerialize["retentionDays"] = o.RetentionDays + toSerialize["retentionDays"] = o.RetentionDays.Get() + toSerialize["state"] = o.State toSerialize["status"] = o.Status toSerialize["storage"] = o.Storage toSerialize["version"] = o.Version @@ -516,6 +545,7 @@ func (o *GetInstanceResponse) UnmarshalJSON(data []byte) (err error) { "network", "replicas", "retentionDays", + "state", "status", "storage", "version", @@ -560,6 +590,7 @@ func (o *GetInstanceResponse) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "network") delete(additionalProperties, "replicas") delete(additionalProperties, "retentionDays") + delete(additionalProperties, "state") delete(additionalProperties, "status") delete(additionalProperties, "storage") delete(additionalProperties, "version") diff --git a/services/postgresflex/v3alpha1api/model_get_user_response.go b/services/postgresflex/v3alpha1api/model_get_user_response.go index 908ef1656..67beae005 100644 --- a/services/postgresflex/v3alpha1api/model_get_user_response.go +++ b/services/postgresflex/v3alpha1api/model_get_user_response.go @@ -26,7 +26,9 @@ type GetUserResponse struct { // The name of the user. Name string `json:"name"` // A list of user roles. - Roles []UserRole `json:"roles"` + Roles []string `json:"roles"` + // The current status of the user. + State string `json:"state"` // The current status of the user. Status string `json:"status"` AdditionalProperties map[string]interface{} @@ -38,11 +40,12 @@ type _GetUserResponse GetUserResponse // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewGetUserResponse(id int32, name string, roles []UserRole, status string) *GetUserResponse { +func NewGetUserResponse(id int32, name string, roles []string, state string, status string) *GetUserResponse { this := GetUserResponse{} this.Id = id this.Name = name this.Roles = roles + this.State = state this.Status = status return &this } @@ -104,9 +107,9 @@ func (o *GetUserResponse) SetName(v string) { } // GetRoles returns the Roles field value -func (o *GetUserResponse) GetRoles() []UserRole { +func (o *GetUserResponse) GetRoles() []string { if o == nil { - var ret []UserRole + var ret []string return ret } @@ -115,7 +118,7 @@ func (o *GetUserResponse) GetRoles() []UserRole { // GetRolesOk returns a tuple with the Roles field value // and a boolean to check if the value has been set. -func (o *GetUserResponse) GetRolesOk() ([]UserRole, bool) { +func (o *GetUserResponse) GetRolesOk() ([]string, bool) { if o == nil { return nil, false } @@ -123,10 +126,34 @@ func (o *GetUserResponse) GetRolesOk() ([]UserRole, bool) { } // SetRoles sets field value -func (o *GetUserResponse) SetRoles(v []UserRole) { +func (o *GetUserResponse) SetRoles(v []string) { o.Roles = v } +// GetState returns the State field value +func (o *GetUserResponse) GetState() string { + if o == nil { + var ret string + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *GetUserResponse) GetStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *GetUserResponse) SetState(v string) { + o.State = v +} + // GetStatus returns the Status field value func (o *GetUserResponse) GetStatus() string { if o == nil { @@ -164,6 +191,7 @@ func (o GetUserResponse) ToMap() (map[string]interface{}, error) { toSerialize["id"] = o.Id toSerialize["name"] = o.Name toSerialize["roles"] = o.Roles + toSerialize["state"] = o.State toSerialize["status"] = o.Status for key, value := range o.AdditionalProperties { @@ -181,6 +209,7 @@ func (o *GetUserResponse) UnmarshalJSON(data []byte) (err error) { "id", "name", "roles", + "state", "status", } @@ -214,6 +243,7 @@ func (o *GetUserResponse) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "id") delete(additionalProperties, "name") delete(additionalProperties, "roles") + delete(additionalProperties, "state") delete(additionalProperties, "status") o.AdditionalProperties = additionalProperties } diff --git a/services/postgresflex/v3alpha1api/model_instance_encryption.go b/services/postgresflex/v3alpha1api/model_instance_encryption.go index 72c169041..51b2f02bc 100644 --- a/services/postgresflex/v3alpha1api/model_instance_encryption.go +++ b/services/postgresflex/v3alpha1api/model_instance_encryption.go @@ -19,7 +19,7 @@ import ( // checks if the InstanceEncryption type satisfies the MappedNullable interface at compile time var _ MappedNullable = &InstanceEncryption{} -// InstanceEncryption The configuration for instance's volume and backup storage encryption. ⚠︝ **Note:** This feature is in private preview. Supplying this object is only permitted for enabled accounts. If your account does not have access, the request will be rejected. +// InstanceEncryption The configuration for instance's volume and backup storage encryption. ⚠️ **Note:** This feature is in private preview. Supplying this object is only permitted for enabled accounts. If your account does not have access, the request will be rejected. type InstanceEncryption struct { // The encryption-key key identifier KekKeyId string `json:"kekKeyId"` diff --git a/services/postgresflex/v3alpha1api/model_instance_sort.go b/services/postgresflex/v3alpha1api/model_instance_sort.go index dda248669..3c4bb23f6 100644 --- a/services/postgresflex/v3alpha1api/model_instance_sort.go +++ b/services/postgresflex/v3alpha1api/model_instance_sort.go @@ -27,6 +27,8 @@ const ( INSTANCESORT_IS_DELETABLE_ASC InstanceSort = "is_deletable.asc" INSTANCESORT_NAME_ASC InstanceSort = "name.asc" INSTANCESORT_NAME_DESC InstanceSort = "name.desc" + INSTANCESORT_STATE_ASC InstanceSort = "state.asc" + INSTANCESORT_STATE_DESC InstanceSort = "state.desc" INSTANCESORT_STATUS_ASC InstanceSort = "status.asc" INSTANCESORT_STATUS_DESC InstanceSort = "status.desc" INSTANCESORT_UNKNOWN_DEFAULT_OPEN_API InstanceSort = "unknown_default_open_api" @@ -40,6 +42,8 @@ var AllowedInstanceSortEnumValues = []InstanceSort{ "is_deletable.asc", "name.asc", "name.desc", + "state.asc", + "state.desc", "status.asc", "status.desc", "unknown_default_open_api", diff --git a/services/postgresflex/v3alpha1api/model_list_backup_response.go b/services/postgresflex/v3alpha1api/model_list_backup_response.go index aec06a49c..2ea8b3f29 100644 --- a/services/postgresflex/v3alpha1api/model_list_backup_response.go +++ b/services/postgresflex/v3alpha1api/model_list_backup_response.go @@ -22,7 +22,7 @@ var _ MappedNullable = &ListBackupResponse{} // ListBackupResponse struct for ListBackupResponse type ListBackupResponse struct { // The list containing the information about the backups. - Backups []ListBackup `json:"backups"` + Backups []BackupData `json:"backups"` Pagination Pagination `json:"pagination"` AdditionalProperties map[string]interface{} } @@ -33,7 +33,7 @@ type _ListBackupResponse ListBackupResponse // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewListBackupResponse(backups []ListBackup, pagination Pagination) *ListBackupResponse { +func NewListBackupResponse(backups []BackupData, pagination Pagination) *ListBackupResponse { this := ListBackupResponse{} this.Backups = backups this.Pagination = pagination @@ -49,9 +49,9 @@ func NewListBackupResponseWithDefaults() *ListBackupResponse { } // GetBackups returns the Backups field value -func (o *ListBackupResponse) GetBackups() []ListBackup { +func (o *ListBackupResponse) GetBackups() []BackupData { if o == nil { - var ret []ListBackup + var ret []BackupData return ret } @@ -60,7 +60,7 @@ func (o *ListBackupResponse) GetBackups() []ListBackup { // GetBackupsOk returns a tuple with the Backups field value // and a boolean to check if the value has been set. -func (o *ListBackupResponse) GetBackupsOk() ([]ListBackup, bool) { +func (o *ListBackupResponse) GetBackupsOk() ([]BackupData, bool) { if o == nil { return nil, false } @@ -68,7 +68,7 @@ func (o *ListBackupResponse) GetBackupsOk() ([]ListBackup, bool) { } // SetBackups sets field value -func (o *ListBackupResponse) SetBackups(v []ListBackup) { +func (o *ListBackupResponse) SetBackups(v []BackupData) { o.Backups = v } diff --git a/services/postgresflex/v3alpha1api/model_list_instance.go b/services/postgresflex/v3alpha1api/model_list_instance.go index 0b44d87d0..ec695e1d9 100644 --- a/services/postgresflex/v3alpha1api/model_list_instance.go +++ b/services/postgresflex/v3alpha1api/model_list_instance.go @@ -27,6 +27,7 @@ type ListInstance struct { IsDeletable bool `json:"isDeletable"` // The name of the instance. Name string `json:"name"` + State Status `json:"state"` Status Status `json:"status"` AdditionalProperties map[string]interface{} } @@ -37,11 +38,12 @@ type _ListInstance ListInstance // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewListInstance(id string, isDeletable bool, name string, status Status) *ListInstance { +func NewListInstance(id string, isDeletable bool, name string, state Status, status Status) *ListInstance { this := ListInstance{} this.Id = id this.IsDeletable = isDeletable this.Name = name + this.State = state this.Status = status return &this } @@ -126,6 +128,30 @@ func (o *ListInstance) SetName(v string) { o.Name = v } +// GetState returns the State field value +func (o *ListInstance) GetState() Status { + if o == nil { + var ret Status + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *ListInstance) GetStateOk() (*Status, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *ListInstance) SetState(v Status) { + o.State = v +} + // GetStatus returns the Status field value func (o *ListInstance) GetStatus() Status { if o == nil { @@ -163,6 +189,7 @@ func (o ListInstance) ToMap() (map[string]interface{}, error) { toSerialize["id"] = o.Id toSerialize["isDeletable"] = o.IsDeletable toSerialize["name"] = o.Name + toSerialize["state"] = o.State toSerialize["status"] = o.Status for key, value := range o.AdditionalProperties { @@ -180,6 +207,7 @@ func (o *ListInstance) UnmarshalJSON(data []byte) (err error) { "id", "isDeletable", "name", + "state", "status", } @@ -213,6 +241,7 @@ func (o *ListInstance) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "id") delete(additionalProperties, "isDeletable") delete(additionalProperties, "name") + delete(additionalProperties, "state") delete(additionalProperties, "status") o.AdditionalProperties = additionalProperties } diff --git a/services/postgresflex/v3alpha1api/model_list_user.go b/services/postgresflex/v3alpha1api/model_list_user.go index 73fbe6c07..cc5a42b89 100644 --- a/services/postgresflex/v3alpha1api/model_list_user.go +++ b/services/postgresflex/v3alpha1api/model_list_user.go @@ -26,6 +26,8 @@ type ListUser struct { // The name of the user. Name string `json:"name"` // The current status of the user. + State string `json:"state"` + // The current status of the user. Status string `json:"status"` AdditionalProperties map[string]interface{} } @@ -36,10 +38,11 @@ type _ListUser ListUser // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewListUser(id int32, name string, status string) *ListUser { +func NewListUser(id int32, name string, state string, status string) *ListUser { this := ListUser{} this.Id = id this.Name = name + this.State = state this.Status = status return &this } @@ -100,6 +103,30 @@ func (o *ListUser) SetName(v string) { o.Name = v } +// GetState returns the State field value +func (o *ListUser) GetState() string { + if o == nil { + var ret string + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *ListUser) GetStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *ListUser) SetState(v string) { + o.State = v +} + // GetStatus returns the Status field value func (o *ListUser) GetStatus() string { if o == nil { @@ -136,6 +163,7 @@ func (o ListUser) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["id"] = o.Id toSerialize["name"] = o.Name + toSerialize["state"] = o.State toSerialize["status"] = o.Status for key, value := range o.AdditionalProperties { @@ -152,6 +180,7 @@ func (o *ListUser) UnmarshalJSON(data []byte) (err error) { requiredProperties := []string{ "id", "name", + "state", "status", } @@ -184,6 +213,7 @@ func (o *ListUser) UnmarshalJSON(data []byte) (err error) { if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "id") delete(additionalProperties, "name") + delete(additionalProperties, "state") delete(additionalProperties, "status") o.AdditionalProperties = additionalProperties } diff --git a/services/postgresflex/v3alpha1api/model_reset_user_response.go b/services/postgresflex/v3alpha1api/model_reset_user_response.go index 3705db4b4..1097ea23a 100644 --- a/services/postgresflex/v3alpha1api/model_reset_user_response.go +++ b/services/postgresflex/v3alpha1api/model_reset_user_response.go @@ -26,6 +26,8 @@ type ResetUserResponse struct { // The password for the user. Password string `json:"password"` // The current status of the user. + State string `json:"state"` + // The current status of the user. Status string `json:"status"` AdditionalProperties map[string]interface{} } @@ -36,10 +38,11 @@ type _ResetUserResponse ResetUserResponse // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewResetUserResponse(name string, password string, status string) *ResetUserResponse { +func NewResetUserResponse(name string, password string, state string, status string) *ResetUserResponse { this := ResetUserResponse{} this.Name = name this.Password = password + this.State = state this.Status = status return &this } @@ -100,6 +103,30 @@ func (o *ResetUserResponse) SetPassword(v string) { o.Password = v } +// GetState returns the State field value +func (o *ResetUserResponse) GetState() string { + if o == nil { + var ret string + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *ResetUserResponse) GetStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *ResetUserResponse) SetState(v string) { + o.State = v +} + // GetStatus returns the Status field value func (o *ResetUserResponse) GetStatus() string { if o == nil { @@ -136,6 +163,7 @@ func (o ResetUserResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["name"] = o.Name toSerialize["password"] = o.Password + toSerialize["state"] = o.State toSerialize["status"] = o.Status for key, value := range o.AdditionalProperties { @@ -152,6 +180,7 @@ func (o *ResetUserResponse) UnmarshalJSON(data []byte) (err error) { requiredProperties := []string{ "name", "password", + "state", "status", } @@ -184,6 +213,7 @@ func (o *ResetUserResponse) UnmarshalJSON(data []byte) (err error) { if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "name") delete(additionalProperties, "password") + delete(additionalProperties, "state") delete(additionalProperties, "status") o.AdditionalProperties = additionalProperties } diff --git a/services/postgresflex/v3alpha1api/model_status.go b/services/postgresflex/v3alpha1api/model_status.go index 837b957f0..23bc082b7 100644 --- a/services/postgresflex/v3alpha1api/model_status.go +++ b/services/postgresflex/v3alpha1api/model_status.go @@ -24,6 +24,7 @@ const ( STATUS_READY Status = "READY" STATUS_PENDING Status = "PENDING" STATUS_PROGRESSING Status = "PROGRESSING" + STATUS_WAITING Status = "WAITING" STATUS_FAILURE Status = "FAILURE" STATUS_UNKNOWN Status = "UNKNOWN" STATUS_TERMINATING Status = "TERMINATING" @@ -35,6 +36,7 @@ var AllowedStatusEnumValues = []Status{ "READY", "PENDING", "PROGRESSING", + "WAITING", "FAILURE", "UNKNOWN", "TERMINATING", diff --git a/services/postgresflex/v3alpha1api/model_update_instance_request_payload.go b/services/postgresflex/v3alpha1api/model_update_instance_request_payload.go index 85f6e84eb..48ce9c273 100644 --- a/services/postgresflex/v3alpha1api/model_update_instance_request_payload.go +++ b/services/postgresflex/v3alpha1api/model_update_instance_request_payload.go @@ -32,7 +32,7 @@ type UpdateInstanceRequestPayload struct { Network InstanceNetworkUpdate `json:"network"` Replicas Replicas `json:"replicas"` // How long backups are retained. The value can only be between 32 and 90 days. - RetentionDays int32 `json:"retentionDays"` + RetentionDays NullableInt32 `json:"retentionDays"` Storage StorageUpdate `json:"storage"` // The Postgres version used for the instance. See [Versions Endpoint](/documentation/postgres-flex-service/version/v3alpha1#tag/Version) for supported version parameters. Version string `json:"version"` @@ -45,7 +45,7 @@ type _UpdateInstanceRequestPayload UpdateInstanceRequestPayload // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewUpdateInstanceRequestPayload(backupSchedule string, flavorId string, name string, network InstanceNetworkUpdate, replicas Replicas, retentionDays int32, storage StorageUpdate, version string) *UpdateInstanceRequestPayload { +func NewUpdateInstanceRequestPayload(backupSchedule string, flavorId string, name string, network InstanceNetworkUpdate, replicas Replicas, retentionDays NullableInt32, storage StorageUpdate, version string) *UpdateInstanceRequestPayload { this := UpdateInstanceRequestPayload{} this.BackupSchedule = backupSchedule this.FlavorId = flavorId @@ -219,27 +219,29 @@ func (o *UpdateInstanceRequestPayload) SetReplicas(v Replicas) { } // GetRetentionDays returns the RetentionDays field value +// If the value is explicit nil, the zero value for int32 will be returned func (o *UpdateInstanceRequestPayload) GetRetentionDays() int32 { - if o == nil { + if o == nil || o.RetentionDays.Get() == nil { var ret int32 return ret } - return o.RetentionDays + return *o.RetentionDays.Get() } // GetRetentionDaysOk returns a tuple with the RetentionDays field value // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *UpdateInstanceRequestPayload) GetRetentionDaysOk() (*int32, bool) { if o == nil { return nil, false } - return &o.RetentionDays, true + return o.RetentionDays.Get(), o.RetentionDays.IsSet() } // SetRetentionDays sets field value func (o *UpdateInstanceRequestPayload) SetRetentionDays(v int32) { - o.RetentionDays = v + o.RetentionDays.Set(&v) } // GetStorage returns the Storage field value @@ -308,7 +310,7 @@ func (o UpdateInstanceRequestPayload) ToMap() (map[string]interface{}, error) { toSerialize["name"] = o.Name toSerialize["network"] = o.Network toSerialize["replicas"] = o.Replicas - toSerialize["retentionDays"] = o.RetentionDays + toSerialize["retentionDays"] = o.RetentionDays.Get() toSerialize["storage"] = o.Storage toSerialize["version"] = o.Version diff --git a/services/postgresflex/v3alpha1api/model_update_user_partially_request_payload.go b/services/postgresflex/v3alpha1api/model_update_user_partially_request_payload.go index e7c6c48f8..5852bb8d7 100644 --- a/services/postgresflex/v3alpha1api/model_update_user_partially_request_payload.go +++ b/services/postgresflex/v3alpha1api/model_update_user_partially_request_payload.go @@ -22,8 +22,8 @@ var _ MappedNullable = &UpdateUserPartiallyRequestPayload{} type UpdateUserPartiallyRequestPayload struct { // The name of the user. Name *string `json:"name,omitempty"` - // A list containing the user roles for the instance. - Roles []UserRole `json:"roles,omitempty"` + // A list containing the user roles for the instance. Please refer to the List Roles endpoint for a list of all available Roles. + Roles []string `json:"roles,omitempty"` AdditionalProperties map[string]interface{} } @@ -79,9 +79,9 @@ func (o *UpdateUserPartiallyRequestPayload) SetName(v string) { } // GetRoles returns the Roles field value if set, zero value otherwise. -func (o *UpdateUserPartiallyRequestPayload) GetRoles() []UserRole { +func (o *UpdateUserPartiallyRequestPayload) GetRoles() []string { if o == nil || IsNil(o.Roles) { - var ret []UserRole + var ret []string return ret } return o.Roles @@ -89,7 +89,7 @@ func (o *UpdateUserPartiallyRequestPayload) GetRoles() []UserRole { // GetRolesOk returns a tuple with the Roles field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateUserPartiallyRequestPayload) GetRolesOk() ([]UserRole, bool) { +func (o *UpdateUserPartiallyRequestPayload) GetRolesOk() ([]string, bool) { if o == nil || IsNil(o.Roles) { return nil, false } @@ -105,8 +105,8 @@ func (o *UpdateUserPartiallyRequestPayload) HasRoles() bool { return false } -// SetRoles gets a reference to the given []UserRole and assigns it to the Roles field. -func (o *UpdateUserPartiallyRequestPayload) SetRoles(v []UserRole) { +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +func (o *UpdateUserPartiallyRequestPayload) SetRoles(v []string) { o.Roles = v } diff --git a/services/postgresflex/v3alpha1api/model_update_user_request_payload.go b/services/postgresflex/v3alpha1api/model_update_user_request_payload.go index 556df7b2c..fe0f79378 100644 --- a/services/postgresflex/v3alpha1api/model_update_user_request_payload.go +++ b/services/postgresflex/v3alpha1api/model_update_user_request_payload.go @@ -23,8 +23,8 @@ var _ MappedNullable = &UpdateUserRequestPayload{} type UpdateUserRequestPayload struct { // The name of the user. Name *string `json:"name,omitempty"` - // A list containing the user roles for the instance. - Roles []UserRole `json:"roles"` + // A list containing the user roles for the instance. Please refer to the List Roles endpoint for a list of all available Roles. + Roles []string `json:"roles"` AdditionalProperties map[string]interface{} } @@ -34,7 +34,7 @@ type _UpdateUserRequestPayload UpdateUserRequestPayload // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewUpdateUserRequestPayload(roles []UserRole) *UpdateUserRequestPayload { +func NewUpdateUserRequestPayload(roles []string) *UpdateUserRequestPayload { this := UpdateUserRequestPayload{} this.Roles = roles return &this @@ -81,9 +81,9 @@ func (o *UpdateUserRequestPayload) SetName(v string) { } // GetRoles returns the Roles field value -func (o *UpdateUserRequestPayload) GetRoles() []UserRole { +func (o *UpdateUserRequestPayload) GetRoles() []string { if o == nil { - var ret []UserRole + var ret []string return ret } @@ -92,7 +92,7 @@ func (o *UpdateUserRequestPayload) GetRoles() []UserRole { // GetRolesOk returns a tuple with the Roles field value // and a boolean to check if the value has been set. -func (o *UpdateUserRequestPayload) GetRolesOk() ([]UserRole, bool) { +func (o *UpdateUserRequestPayload) GetRolesOk() ([]string, bool) { if o == nil { return nil, false } @@ -100,7 +100,7 @@ func (o *UpdateUserRequestPayload) GetRolesOk() ([]UserRole, bool) { } // SetRoles sets field value -func (o *UpdateUserRequestPayload) SetRoles(v []UserRole) { +func (o *UpdateUserRequestPayload) SetRoles(v []string) { o.Roles = v } diff --git a/services/postgresflex/v3alpha1api/model_user_role.go b/services/postgresflex/v3alpha1api/model_user_role.go deleted file mode 100644 index dd31c990d..000000000 --- a/services/postgresflex/v3alpha1api/model_user_role.go +++ /dev/null @@ -1,114 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT Postgres Flex service - -API version: 3alpha1 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v3alpha1api - -import ( - "encoding/json" - "fmt" -) - -// UserRole The user role for the instance. -type UserRole string - -// List of user.role -const ( - USERROLE_CREATEDB UserRole = "createdb" - USERROLE_LOGIN UserRole = "login" - USERROLE_UNKNOWN_DEFAULT_OPEN_API UserRole = "unknown_default_open_api" -) - -// All allowed values of UserRole enum -var AllowedUserRoleEnumValues = []UserRole{ - "createdb", - "login", - "unknown_default_open_api", -} - -func (v *UserRole) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := UserRole(value) - for _, existing := range AllowedUserRoleEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = USERROLE_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewUserRoleFromValue returns a pointer to a valid UserRole -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewUserRoleFromValue(v string) (*UserRole, error) { - ev := UserRole(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for UserRole: valid values are %v", v, AllowedUserRoleEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v UserRole) IsValid() bool { - for _, existing := range AllowedUserRoleEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to user.role value -func (v UserRole) Ptr() *UserRole { - return &v -} - -type NullableUserRole struct { - value *UserRole - isSet bool -} - -func (v NullableUserRole) Get() *UserRole { - return v.value -} - -func (v *NullableUserRole) Set(val *UserRole) { - v.value = val - v.isSet = true -} - -func (v NullableUserRole) IsSet() bool { - return v.isSet -} - -func (v *NullableUserRole) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUserRole(val *UserRole) *NullableUserRole { - return &NullableUserRole{value: val, isSet: true} -} - -func (v NullableUserRole) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUserRole) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v3alpha1api/model_user_sort.go b/services/postgresflex/v3alpha1api/model_user_sort.go index a064d3ae4..005dd42e1 100644 --- a/services/postgresflex/v3alpha1api/model_user_sort.go +++ b/services/postgresflex/v3alpha1api/model_user_sort.go @@ -25,6 +25,8 @@ const ( USERSORT_ID_DESC UserSort = "id.desc" USERSORT_NAME_DESC UserSort = "name.desc" USERSORT_NAME_ASC UserSort = "name.asc" + USERSORT_STATE_DESC UserSort = "state.desc" + USERSORT_STATE_ASC UserSort = "state.asc" USERSORT_STATUS_DESC UserSort = "status.desc" USERSORT_STATUS_ASC UserSort = "status.asc" USERSORT_UNKNOWN_DEFAULT_OPEN_API UserSort = "unknown_default_open_api" @@ -36,6 +38,8 @@ var AllowedUserSortEnumValues = []UserSort{ "id.desc", "name.desc", "name.asc", + "state.desc", + "state.asc", "status.desc", "status.asc", "unknown_default_open_api",