From b2dbd56329b542671c2a3c24497c22e4b9e4775f Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Tue, 18 Mar 2025 08:07:59 +0000 Subject: [PATCH] Generate postgresflex --- services/postgresflex/api_default_test.go | 470 ++++++------- services/postgresflex/model_acl.go | 53 +- .../postgresflex/model_api_configuration.go | 108 +-- ...odel_api_extension_config_load_response.go | 53 +- .../model_api_extension_configure_response.go | 53 +- .../model_api_extension_delete_response.go | 53 +- .../postgresflex/model_api_extension_list.go | 161 +++-- .../model_api_extension_load_response.go | 53 +- .../model_api_install_response.go | 53 +- .../model_api_installed_list_response.go | 53 +- services/postgresflex/model_backup.go | 429 +++++++----- .../model_clone_instance_payload.go | 161 +++-- .../model_clone_instance_response.go | 54 +- .../model_create_database_payload.go | 107 +-- .../model_create_instance_payload.go | 451 +++++++----- .../model_create_instance_response.go | 54 +- .../postgresflex/model_create_user_payload.go | 107 +-- .../model_create_user_response.go | 53 +- services/postgresflex/model_error.go | 214 +++--- .../model_extensions_configuration.go | 108 +-- ...odel_extensions_extension_list_response.go | 53 +- .../model_extensions_new_config.go | 53 +- services/postgresflex/model_flavor.go | 214 +++--- .../postgresflex/model_get_backup_response.go | 53 +- .../postgresflex/model_get_user_response.go | 53 +- services/postgresflex/model_instance.go | 535 +++++++++------ ...model_instance_create_database_response.go | 54 +- .../postgresflex/model_instance_data_point.go | 107 +-- .../postgresflex/model_instance_database.go | 161 +++-- services/postgresflex/model_instance_host.go | 107 +-- .../model_instance_host_metric.go | 161 +++-- .../model_instance_list_databases_response.go | 53 +- .../model_instance_list_instance.go | 162 +++-- .../model_instance_metrics_response.go | 53 +- .../postgresflex/model_instance_response.go | 53 +- .../model_list_backups_response.go | 106 +-- .../model_list_flavors_response.go | 53 +- .../model_list_instances_response.go | 106 +-- .../model_list_storages_response.go | 106 +-- .../postgresflex/model_list_users_response.go | 106 +-- .../model_list_users_response_item.go | 108 +-- .../model_list_versions_response.go | 53 +- .../model_partial_update_instance_payload.go | 481 ++++++++----- .../model_partial_update_instance_response.go | 53 +- .../model_partial_update_user_payload.go | 107 +-- .../model_postgres_database_parameter.go | 646 +++++++++++------- ...el_postgres_database_parameter_response.go | 53 +- .../postgresflex/model_reset_user_response.go | 53 +- services/postgresflex/model_storage.go | 107 +-- services/postgresflex/model_storage_range.go | 106 +-- .../model_update_backup_schedule_payload.go | 52 +- .../model_update_instance_payload.go | 481 ++++++++----- .../postgresflex/model_update_user_payload.go | 107 +-- services/postgresflex/model_user.go | 430 +++++++----- services/postgresflex/model_user_response.go | 268 +++++--- services/postgresflex/utils.go | 26 + 56 files changed, 5040 insertions(+), 3288 deletions(-) diff --git a/services/postgresflex/api_default_test.go b/services/postgresflex/api_default_test.go index 80cd17fb1..78b06ca50 100644 --- a/services/postgresflex/api_default_test.go +++ b/services/postgresflex/api_default_test.go @@ -24,16 +24,16 @@ import ( func Test_postgresflex_DefaultApiService(t *testing.T) { t.Run("Test DefaultApiService CloneInstance", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/clone" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/clone" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := CloneInstanceResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -67,9 +67,9 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" - instanceId := "instanceId" + projectId := projectIdValue + region := regionValue + instanceId := instanceIdValue cloneInstancePayload := CloneInstancePayload{} resp, reqErr := apiClient.CloneInstance(context.Background(), projectId, region, instanceId).CloneInstancePayload(cloneInstancePayload).Execute() @@ -77,22 +77,22 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService CreateDatabase", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := InstanceCreateDatabaseResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -126,9 +126,9 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" - instanceId := "instanceId" + projectId := projectIdValue + region := regionValue + instanceId := instanceIdValue createDatabasePayload := CreateDatabasePayload{} resp, reqErr := apiClient.CreateDatabase(context.Background(), projectId, region, instanceId).CreateDatabasePayload(createDatabasePayload).Execute() @@ -136,20 +136,20 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService CreateInstance", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := CreateInstanceResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -183,8 +183,8 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" + projectId := projectIdValue + region := regionValue createInstancePayload := CreateInstancePayload{} resp, reqErr := apiClient.CreateInstance(context.Background(), projectId, region).CreateInstancePayload(createInstancePayload).Execute() @@ -192,22 +192,22 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService CreateUser", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := CreateUserResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -241,9 +241,9 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" - instanceId := "instanceId" + projectId := projectIdValue + region := regionValue + instanceId := instanceIdValue createUserPayload := CreateUserPayload{} resp, reqErr := apiClient.CreateUser(context.Background(), projectId, region, instanceId).CreateUserPayload(createUserPayload).Execute() @@ -251,24 +251,24 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService DeleteDatabase", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseId}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) databaseIdValue := "databaseId" - path = strings.Replace(path, "{"+"databaseId"+"}", url.PathEscape(ParameterValueToString(databaseIdValue, "databaseId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"databaseId"+"}", url.PathEscape(ParameterValueToString(databaseIdValue, "databaseId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -299,10 +299,10 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" - instanceId := "instanceId" - databaseId := "databaseId" + projectId := projectIdValue + region := regionValue + instanceId := instanceIdValue + databaseId := databaseIdValue reqErr := apiClient.DeleteDatabase(context.Background(), projectId, region, instanceId, databaseId).Execute() @@ -312,16 +312,16 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteInstance", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -352,9 +352,9 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" - instanceId := "instanceId" + projectId := projectIdValue + region := regionValue + instanceId := instanceIdValue reqErr := apiClient.DeleteInstance(context.Background(), projectId, region, instanceId).Execute() @@ -364,18 +364,18 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteUser", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) userIdValue := "userId" - path = strings.Replace(path, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(userIdValue, "userId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(userIdValue, "userId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -406,10 +406,10 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" - instanceId := "instanceId" - userId := "userId" + projectId := projectIdValue + region := regionValue + instanceId := instanceIdValue + userId := userIdValue reqErr := apiClient.DeleteUser(context.Background(), projectId, region, instanceId, userId).Execute() @@ -419,16 +419,16 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ForceDeleteInstance", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/force" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/force" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -459,9 +459,9 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" - instanceId := "instanceId" + projectId := projectIdValue + region := regionValue + instanceId := instanceIdValue reqErr := apiClient.ForceDeleteInstance(context.Background(), projectId, region, instanceId).Execute() @@ -471,18 +471,18 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetBackup", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/backups/{backupId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/backups/{backupId}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) backupIdValue := "backupId" - path = strings.Replace(path, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(backupIdValue, "backupId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(backupIdValue, "backupId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := GetBackupResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -516,32 +516,32 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" - instanceId := "instanceId" - backupId := "backupId" + projectId := projectIdValue + region := regionValue + instanceId := instanceIdValue + backupId := backupIdValue resp, reqErr := apiClient.GetBackup(context.Background(), projectId, region, instanceId, backupId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService GetInstance", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := InstanceResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -575,33 +575,33 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" - instanceId := "instanceId" + projectId := projectIdValue + region := regionValue + instanceId := instanceIdValue resp, reqErr := apiClient.GetInstance(context.Background(), projectId, region, instanceId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService GetUser", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) userIdValue := "userId" - path = strings.Replace(path, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(userIdValue, "userId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(userIdValue, "userId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := GetUserResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -635,32 +635,32 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" - instanceId := "instanceId" - userId := "userId" + projectId := projectIdValue + region := regionValue + instanceId := instanceIdValue + userId := userIdValue resp, reqErr := apiClient.GetUser(context.Background(), projectId, region, instanceId, userId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService ListBackups", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/backups" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/backups" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := ListBackupsResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -694,31 +694,31 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" - instanceId := "instanceId" + projectId := projectIdValue + region := regionValue + instanceId := instanceIdValue resp, reqErr := apiClient.ListBackups(context.Background(), projectId, region, instanceId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService ListDatabaseParameters", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/parameter" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/parameter" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := PostgresDatabaseParameterResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -752,31 +752,31 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" - instanceId := "instanceId" + projectId := projectIdValue + region := regionValue + instanceId := instanceIdValue resp, reqErr := apiClient.ListDatabaseParameters(context.Background(), projectId, region, instanceId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService ListDatabases", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := InstanceListDatabasesResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -810,29 +810,29 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" - instanceId := "instanceId" + projectId := projectIdValue + region := regionValue + instanceId := instanceIdValue resp, reqErr := apiClient.ListDatabases(context.Background(), projectId, region, instanceId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService ListFlavors", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/flavors" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/flavors" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := ListFlavorsResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -866,28 +866,28 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" + projectId := projectIdValue + region := regionValue resp, reqErr := apiClient.ListFlavors(context.Background(), projectId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService ListInstances", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := ListInstancesResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -921,32 +921,32 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" + projectId := projectIdValue + region := regionValue resp, reqErr := apiClient.ListInstances(context.Background(), projectId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService ListMetrics", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/metrics/{metric}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/metrics/{metric}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) metricValue := "metric" - path = strings.Replace(path, "{"+"metric"+"}", url.PathEscape(ParameterValueToString(metricValue, "metric")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"metric"+"}", url.PathEscape(ParameterValueToString(metricValue, "metric")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := InstanceMetricsResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -980,10 +980,10 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" - instanceId := "instanceId" - metric := "metric" + projectId := projectIdValue + region := regionValue + instanceId := instanceIdValue + metric := metricValue var granularity string resp, reqErr := apiClient.ListMetrics(context.Background(), projectId, region, instanceId, metric).Granularity(granularity).Execute() @@ -991,22 +991,22 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService ListStorages", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/storages/{flavorId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/storages/{flavorId}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) flavorIdValue := "flavorId" - path = strings.Replace(path, "{"+"flavorId"+"}", url.PathEscape(ParameterValueToString(flavorIdValue, "flavorId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"flavorId"+"}", url.PathEscape(ParameterValueToString(flavorIdValue, "flavorId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := ListStoragesResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -1040,31 +1040,31 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" - flavorId := "flavorId" + projectId := projectIdValue + region := regionValue + flavorId := flavorIdValue resp, reqErr := apiClient.ListStorages(context.Background(), projectId, region, flavorId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService ListUsers", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := ListUsersResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -1098,29 +1098,29 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" - instanceId := "instanceId" + projectId := projectIdValue + region := regionValue + instanceId := instanceIdValue resp, reqErr := apiClient.ListUsers(context.Background(), projectId, region, instanceId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService ListVersions", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/versions" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/versions" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := ListVersionsResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -1154,30 +1154,30 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" + projectId := projectIdValue + region := regionValue resp, reqErr := apiClient.ListVersions(context.Background(), projectId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService PartialUpdateInstance", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := PartialUpdateInstanceResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -1211,9 +1211,9 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" - instanceId := "instanceId" + projectId := projectIdValue + region := regionValue + instanceId := instanceIdValue partialUpdateInstancePayload := PartialUpdateInstancePayload{} resp, reqErr := apiClient.PartialUpdateInstance(context.Background(), projectId, region, instanceId).PartialUpdateInstancePayload(partialUpdateInstancePayload).Execute() @@ -1221,24 +1221,24 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService PartialUpdateUser", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) userIdValue := "userId" - path = strings.Replace(path, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(userIdValue, "userId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(userIdValue, "userId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -1269,10 +1269,10 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" - instanceId := "instanceId" - userId := "userId" + projectId := projectIdValue + region := regionValue + instanceId := instanceIdValue + userId := userIdValue reqErr := apiClient.PartialUpdateUser(context.Background(), projectId, region, instanceId, userId).Execute() @@ -1282,18 +1282,18 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ResetUser", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}/reset" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}/reset" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) userIdValue := "userId" - path = strings.Replace(path, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(userIdValue, "userId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(userIdValue, "userId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := ResetUserResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -1327,32 +1327,32 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" - instanceId := "instanceId" - userId := "userId" + projectId := projectIdValue + region := regionValue + instanceId := instanceIdValue + userId := userIdValue resp, reqErr := apiClient.ResetUser(context.Background(), projectId, region, instanceId, userId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService UpdateBackupSchedule", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/backups" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/backups" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -1383,9 +1383,9 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" - instanceId := "instanceId" + projectId := projectIdValue + region := regionValue + instanceId := instanceIdValue updateBackupSchedulePayload := UpdateBackupSchedulePayload{} reqErr := apiClient.UpdateBackupSchedule(context.Background(), projectId, region, instanceId).UpdateBackupSchedulePayload(updateBackupSchedulePayload).Execute() @@ -1396,16 +1396,16 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService UpdateInstance", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := PartialUpdateInstanceResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -1439,9 +1439,9 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" - instanceId := "instanceId" + projectId := projectIdValue + region := regionValue + instanceId := instanceIdValue updateInstancePayload := UpdateInstancePayload{} resp, reqErr := apiClient.UpdateInstance(context.Background(), projectId, region, instanceId).UpdateInstancePayload(updateInstancePayload).Execute() @@ -1449,24 +1449,24 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService UpdateUser", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) userIdValue := "userId" - path = strings.Replace(path, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(userIdValue, "userId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(userIdValue, "userId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -1497,10 +1497,10 @@ func Test_postgresflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" - instanceId := "instanceId" - userId := "userId" + projectId := projectIdValue + region := regionValue + instanceId := instanceIdValue + userId := userIdValue reqErr := apiClient.UpdateUser(context.Background(), projectId, region, instanceId, userId).Execute() diff --git a/services/postgresflex/model_acl.go b/services/postgresflex/model_acl.go index b644a1981..061496408 100644 --- a/services/postgresflex/model_acl.go +++ b/services/postgresflex/model_acl.go @@ -17,9 +17,29 @@ import ( // checks if the ACL type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ACL{} +/* + types and functions for items +*/ + +// isArray +type ACLGetItemsAttributeType = *[]string +type ACLGetItemsArgType = []string +type ACLGetItemsRetType = []string + +func getACLGetItemsAttributeTypeOk(arg ACLGetItemsAttributeType) (ret ACLGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setACLGetItemsAttributeType(arg *ACLGetItemsAttributeType, val ACLGetItemsRetType) { + *arg = &val +} + // ACL struct for ACL type ACL struct { - Items *[]string `json:"items,omitempty"` + Items ACLGetItemsAttributeType `json:"items,omitempty"` } // NewACL instantiates a new ACL object @@ -40,41 +60,32 @@ func NewACLWithDefaults() *ACL { } // GetItems returns the Items field value if set, zero value otherwise. -func (o *ACL) GetItems() *[]string { - if o == nil || IsNil(o.Items) { - var ret *[]string - return ret - } - return o.Items +func (o *ACL) GetItems() (res ACLGetItemsRetType) { + res, _ = o.GetItemsOk() + return } // GetItemsOk returns a tuple with the Items field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ACL) GetItemsOk() (*[]string, bool) { - if o == nil || IsNil(o.Items) { - return nil, false - } - return o.Items, true +func (o *ACL) GetItemsOk() (ret ACLGetItemsRetType, ok bool) { + return getACLGetItemsAttributeTypeOk(o.Items) } // HasItems returns a boolean if a field has been set. func (o *ACL) HasItems() bool { - if o != nil && !IsNil(o.Items) { - return true - } - - return false + _, ok := o.GetItemsOk() + return ok } // SetItems gets a reference to the given []string and assigns it to the Items field. -func (o *ACL) SetItems(v *[]string) { - o.Items = v +func (o *ACL) SetItems(v ACLGetItemsRetType) { + setACLGetItemsAttributeType(&o.Items, v) } func (o ACL) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Items) { - toSerialize["items"] = o.Items + if val, ok := getACLGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_api_configuration.go b/services/postgresflex/model_api_configuration.go index 65a87abfe..45a3c6e68 100644 --- a/services/postgresflex/model_api_configuration.go +++ b/services/postgresflex/model_api_configuration.go @@ -17,10 +17,52 @@ import ( // checks if the ApiConfiguration type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ApiConfiguration{} +/* + types and functions for name +*/ + +// isNotNullableString +type ApiConfigurationGetNameAttributeType = *string + +func getApiConfigurationGetNameAttributeTypeOk(arg ApiConfigurationGetNameAttributeType) (ret ApiConfigurationGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setApiConfigurationGetNameAttributeType(arg *ApiConfigurationGetNameAttributeType, val ApiConfigurationGetNameRetType) { + *arg = &val +} + +type ApiConfigurationGetNameArgType = string +type ApiConfigurationGetNameRetType = string + +/* + types and functions for setting +*/ + +// isNotNullableString +type ApiConfigurationGetSettingAttributeType = *string + +func getApiConfigurationGetSettingAttributeTypeOk(arg ApiConfigurationGetSettingAttributeType) (ret ApiConfigurationGetSettingRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setApiConfigurationGetSettingAttributeType(arg *ApiConfigurationGetSettingAttributeType, val ApiConfigurationGetSettingRetType) { + *arg = &val +} + +type ApiConfigurationGetSettingArgType = string +type ApiConfigurationGetSettingRetType = string + // ApiConfiguration struct for ApiConfiguration type ApiConfiguration struct { - Name *string `json:"name,omitempty"` - Setting *string `json:"setting,omitempty"` + Name ApiConfigurationGetNameAttributeType `json:"name,omitempty"` + Setting ApiConfigurationGetSettingAttributeType `json:"setting,omitempty"` } // NewApiConfiguration instantiates a new ApiConfiguration object @@ -41,76 +83,58 @@ func NewApiConfigurationWithDefaults() *ApiConfiguration { } // GetName returns the Name field value if set, zero value otherwise. -func (o *ApiConfiguration) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *ApiConfiguration) GetName() (res ApiConfigurationGetNameRetType) { + res, _ = o.GetNameOk() + return } // 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 *ApiConfiguration) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *ApiConfiguration) GetNameOk() (ret ApiConfigurationGetNameRetType, ok bool) { + return getApiConfigurationGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *ApiConfiguration) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false + _, ok := o.GetNameOk() + return ok } // SetName gets a reference to the given string and assigns it to the Name field. -func (o *ApiConfiguration) SetName(v *string) { - o.Name = v +func (o *ApiConfiguration) SetName(v ApiConfigurationGetNameRetType) { + setApiConfigurationGetNameAttributeType(&o.Name, v) } // GetSetting returns the Setting field value if set, zero value otherwise. -func (o *ApiConfiguration) GetSetting() *string { - if o == nil || IsNil(o.Setting) { - var ret *string - return ret - } - return o.Setting +func (o *ApiConfiguration) GetSetting() (res ApiConfigurationGetSettingRetType) { + res, _ = o.GetSettingOk() + return } // GetSettingOk returns a tuple with the Setting field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ApiConfiguration) GetSettingOk() (*string, bool) { - if o == nil || IsNil(o.Setting) { - return nil, false - } - return o.Setting, true +func (o *ApiConfiguration) GetSettingOk() (ret ApiConfigurationGetSettingRetType, ok bool) { + return getApiConfigurationGetSettingAttributeTypeOk(o.Setting) } // HasSetting returns a boolean if a field has been set. func (o *ApiConfiguration) HasSetting() bool { - if o != nil && !IsNil(o.Setting) { - return true - } - - return false + _, ok := o.GetSettingOk() + return ok } // SetSetting gets a reference to the given string and assigns it to the Setting field. -func (o *ApiConfiguration) SetSetting(v *string) { - o.Setting = v +func (o *ApiConfiguration) SetSetting(v ApiConfigurationGetSettingRetType) { + setApiConfigurationGetSettingAttributeType(&o.Setting, v) } func (o ApiConfiguration) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getApiConfigurationGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Setting) { - toSerialize["setting"] = o.Setting + if val, ok := getApiConfigurationGetSettingAttributeTypeOk(o.Setting); ok { + toSerialize["Setting"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_api_extension_config_load_response.go b/services/postgresflex/model_api_extension_config_load_response.go index 61e98f50d..7ea6bf9f5 100644 --- a/services/postgresflex/model_api_extension_config_load_response.go +++ b/services/postgresflex/model_api_extension_config_load_response.go @@ -17,10 +17,30 @@ import ( // checks if the ApiExtensionConfigLoadResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ApiExtensionConfigLoadResponse{} +/* + types and functions for configuration +*/ + +// isArray +type ApiExtensionConfigLoadResponseGetConfigurationAttributeType = *[]ApiConfiguration +type ApiExtensionConfigLoadResponseGetConfigurationArgType = []ApiConfiguration +type ApiExtensionConfigLoadResponseGetConfigurationRetType = []ApiConfiguration + +func getApiExtensionConfigLoadResponseGetConfigurationAttributeTypeOk(arg ApiExtensionConfigLoadResponseGetConfigurationAttributeType) (ret ApiExtensionConfigLoadResponseGetConfigurationRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setApiExtensionConfigLoadResponseGetConfigurationAttributeType(arg *ApiExtensionConfigLoadResponseGetConfigurationAttributeType, val ApiExtensionConfigLoadResponseGetConfigurationRetType) { + *arg = &val +} + // ApiExtensionConfigLoadResponse struct for ApiExtensionConfigLoadResponse type ApiExtensionConfigLoadResponse struct { // Returns marshalled JSON of the new configuration of whatever extension is called - Configuration *[]ApiConfiguration `json:"configuration,omitempty"` + Configuration ApiExtensionConfigLoadResponseGetConfigurationAttributeType `json:"configuration,omitempty"` } // NewApiExtensionConfigLoadResponse instantiates a new ApiExtensionConfigLoadResponse object @@ -41,41 +61,32 @@ func NewApiExtensionConfigLoadResponseWithDefaults() *ApiExtensionConfigLoadResp } // GetConfiguration returns the Configuration field value if set, zero value otherwise. -func (o *ApiExtensionConfigLoadResponse) GetConfiguration() *[]ApiConfiguration { - if o == nil || IsNil(o.Configuration) { - var ret *[]ApiConfiguration - return ret - } - return o.Configuration +func (o *ApiExtensionConfigLoadResponse) GetConfiguration() (res ApiExtensionConfigLoadResponseGetConfigurationRetType) { + res, _ = o.GetConfigurationOk() + return } // GetConfigurationOk returns a tuple with the Configuration field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ApiExtensionConfigLoadResponse) GetConfigurationOk() (*[]ApiConfiguration, bool) { - if o == nil || IsNil(o.Configuration) { - return nil, false - } - return o.Configuration, true +func (o *ApiExtensionConfigLoadResponse) GetConfigurationOk() (ret ApiExtensionConfigLoadResponseGetConfigurationRetType, ok bool) { + return getApiExtensionConfigLoadResponseGetConfigurationAttributeTypeOk(o.Configuration) } // HasConfiguration returns a boolean if a field has been set. func (o *ApiExtensionConfigLoadResponse) HasConfiguration() bool { - if o != nil && !IsNil(o.Configuration) { - return true - } - - return false + _, ok := o.GetConfigurationOk() + return ok } // SetConfiguration gets a reference to the given []ApiConfiguration and assigns it to the Configuration field. -func (o *ApiExtensionConfigLoadResponse) SetConfiguration(v *[]ApiConfiguration) { - o.Configuration = v +func (o *ApiExtensionConfigLoadResponse) SetConfiguration(v ApiExtensionConfigLoadResponseGetConfigurationRetType) { + setApiExtensionConfigLoadResponseGetConfigurationAttributeType(&o.Configuration, v) } func (o ApiExtensionConfigLoadResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Configuration) { - toSerialize["configuration"] = o.Configuration + if val, ok := getApiExtensionConfigLoadResponseGetConfigurationAttributeTypeOk(o.Configuration); ok { + toSerialize["Configuration"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_api_extension_configure_response.go b/services/postgresflex/model_api_extension_configure_response.go index 18d9f72c0..e6d4cc6a2 100644 --- a/services/postgresflex/model_api_extension_configure_response.go +++ b/services/postgresflex/model_api_extension_configure_response.go @@ -17,10 +17,30 @@ import ( // checks if the ApiExtensionConfigureResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ApiExtensionConfigureResponse{} +/* + types and functions for configuration +*/ + +// isArray +type ApiExtensionConfigureResponseGetConfigurationAttributeType = *[]ApiConfiguration +type ApiExtensionConfigureResponseGetConfigurationArgType = []ApiConfiguration +type ApiExtensionConfigureResponseGetConfigurationRetType = []ApiConfiguration + +func getApiExtensionConfigureResponseGetConfigurationAttributeTypeOk(arg ApiExtensionConfigureResponseGetConfigurationAttributeType) (ret ApiExtensionConfigureResponseGetConfigurationRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setApiExtensionConfigureResponseGetConfigurationAttributeType(arg *ApiExtensionConfigureResponseGetConfigurationAttributeType, val ApiExtensionConfigureResponseGetConfigurationRetType) { + *arg = &val +} + // ApiExtensionConfigureResponse struct for ApiExtensionConfigureResponse type ApiExtensionConfigureResponse struct { // Returns marshalled JSON of the new configuration of whatever extension is called - Configuration *[]ApiConfiguration `json:"configuration,omitempty"` + Configuration ApiExtensionConfigureResponseGetConfigurationAttributeType `json:"configuration,omitempty"` } // NewApiExtensionConfigureResponse instantiates a new ApiExtensionConfigureResponse object @@ -41,41 +61,32 @@ func NewApiExtensionConfigureResponseWithDefaults() *ApiExtensionConfigureRespon } // GetConfiguration returns the Configuration field value if set, zero value otherwise. -func (o *ApiExtensionConfigureResponse) GetConfiguration() *[]ApiConfiguration { - if o == nil || IsNil(o.Configuration) { - var ret *[]ApiConfiguration - return ret - } - return o.Configuration +func (o *ApiExtensionConfigureResponse) GetConfiguration() (res ApiExtensionConfigureResponseGetConfigurationRetType) { + res, _ = o.GetConfigurationOk() + return } // GetConfigurationOk returns a tuple with the Configuration field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ApiExtensionConfigureResponse) GetConfigurationOk() (*[]ApiConfiguration, bool) { - if o == nil || IsNil(o.Configuration) { - return nil, false - } - return o.Configuration, true +func (o *ApiExtensionConfigureResponse) GetConfigurationOk() (ret ApiExtensionConfigureResponseGetConfigurationRetType, ok bool) { + return getApiExtensionConfigureResponseGetConfigurationAttributeTypeOk(o.Configuration) } // HasConfiguration returns a boolean if a field has been set. func (o *ApiExtensionConfigureResponse) HasConfiguration() bool { - if o != nil && !IsNil(o.Configuration) { - return true - } - - return false + _, ok := o.GetConfigurationOk() + return ok } // SetConfiguration gets a reference to the given []ApiConfiguration and assigns it to the Configuration field. -func (o *ApiExtensionConfigureResponse) SetConfiguration(v *[]ApiConfiguration) { - o.Configuration = v +func (o *ApiExtensionConfigureResponse) SetConfiguration(v ApiExtensionConfigureResponseGetConfigurationRetType) { + setApiExtensionConfigureResponseGetConfigurationAttributeType(&o.Configuration, v) } func (o ApiExtensionConfigureResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Configuration) { - toSerialize["configuration"] = o.Configuration + if val, ok := getApiExtensionConfigureResponseGetConfigurationAttributeTypeOk(o.Configuration); ok { + toSerialize["Configuration"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_api_extension_delete_response.go b/services/postgresflex/model_api_extension_delete_response.go index a7578fd19..1c2bdb238 100644 --- a/services/postgresflex/model_api_extension_delete_response.go +++ b/services/postgresflex/model_api_extension_delete_response.go @@ -17,9 +17,29 @@ import ( // checks if the ApiExtensionDeleteResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ApiExtensionDeleteResponse{} +/* + types and functions for isSucceded +*/ + +// isBoolean +type ApiExtensionDeleteResponsegetIsSuccededAttributeType = *bool +type ApiExtensionDeleteResponsegetIsSuccededArgType = bool +type ApiExtensionDeleteResponsegetIsSuccededRetType = bool + +func getApiExtensionDeleteResponsegetIsSuccededAttributeTypeOk(arg ApiExtensionDeleteResponsegetIsSuccededAttributeType) (ret ApiExtensionDeleteResponsegetIsSuccededRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setApiExtensionDeleteResponsegetIsSuccededAttributeType(arg *ApiExtensionDeleteResponsegetIsSuccededAttributeType, val ApiExtensionDeleteResponsegetIsSuccededRetType) { + *arg = &val +} + // ApiExtensionDeleteResponse struct for ApiExtensionDeleteResponse type ApiExtensionDeleteResponse struct { - IsSucceded *bool `json:"isSucceded,omitempty"` + IsSucceded ApiExtensionDeleteResponsegetIsSuccededAttributeType `json:"isSucceded,omitempty"` } // NewApiExtensionDeleteResponse instantiates a new ApiExtensionDeleteResponse object @@ -40,41 +60,32 @@ func NewApiExtensionDeleteResponseWithDefaults() *ApiExtensionDeleteResponse { } // GetIsSucceded returns the IsSucceded field value if set, zero value otherwise. -func (o *ApiExtensionDeleteResponse) GetIsSucceded() *bool { - if o == nil || IsNil(o.IsSucceded) { - var ret *bool - return ret - } - return o.IsSucceded +func (o *ApiExtensionDeleteResponse) GetIsSucceded() (res ApiExtensionDeleteResponsegetIsSuccededRetType) { + res, _ = o.GetIsSuccededOk() + return } // GetIsSuccededOk returns a tuple with the IsSucceded field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ApiExtensionDeleteResponse) GetIsSuccededOk() (*bool, bool) { - if o == nil || IsNil(o.IsSucceded) { - return nil, false - } - return o.IsSucceded, true +func (o *ApiExtensionDeleteResponse) GetIsSuccededOk() (ret ApiExtensionDeleteResponsegetIsSuccededRetType, ok bool) { + return getApiExtensionDeleteResponsegetIsSuccededAttributeTypeOk(o.IsSucceded) } // HasIsSucceded returns a boolean if a field has been set. func (o *ApiExtensionDeleteResponse) HasIsSucceded() bool { - if o != nil && !IsNil(o.IsSucceded) { - return true - } - - return false + _, ok := o.GetIsSuccededOk() + return ok } // SetIsSucceded gets a reference to the given bool and assigns it to the IsSucceded field. -func (o *ApiExtensionDeleteResponse) SetIsSucceded(v *bool) { - o.IsSucceded = v +func (o *ApiExtensionDeleteResponse) SetIsSucceded(v ApiExtensionDeleteResponsegetIsSuccededRetType) { + setApiExtensionDeleteResponsegetIsSuccededAttributeType(&o.IsSucceded, v) } func (o ApiExtensionDeleteResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.IsSucceded) { - toSerialize["isSucceded"] = o.IsSucceded + if val, ok := getApiExtensionDeleteResponsegetIsSuccededAttributeTypeOk(o.IsSucceded); ok { + toSerialize["IsSucceded"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_api_extension_list.go b/services/postgresflex/model_api_extension_list.go index 41ccd0d8c..baa2f37a3 100644 --- a/services/postgresflex/model_api_extension_list.go +++ b/services/postgresflex/model_api_extension_list.go @@ -17,11 +17,73 @@ import ( // checks if the ApiExtensionList type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ApiExtensionList{} +/* + types and functions for ID +*/ + +// isLong +type ApiExtensionListGetIDAttributeType = *int64 +type ApiExtensionListGetIDArgType = int64 +type ApiExtensionListGetIDRetType = int64 + +func getApiExtensionListGetIDAttributeTypeOk(arg ApiExtensionListGetIDAttributeType) (ret ApiExtensionListGetIDRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setApiExtensionListGetIDAttributeType(arg *ApiExtensionListGetIDAttributeType, val ApiExtensionListGetIDRetType) { + *arg = &val +} + +/* + types and functions for description +*/ + +// isNotNullableString +type ApiExtensionListGetDescriptionAttributeType = *string + +func getApiExtensionListGetDescriptionAttributeTypeOk(arg ApiExtensionListGetDescriptionAttributeType) (ret ApiExtensionListGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setApiExtensionListGetDescriptionAttributeType(arg *ApiExtensionListGetDescriptionAttributeType, val ApiExtensionListGetDescriptionRetType) { + *arg = &val +} + +type ApiExtensionListGetDescriptionArgType = string +type ApiExtensionListGetDescriptionRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +type ApiExtensionListGetNameAttributeType = *string + +func getApiExtensionListGetNameAttributeTypeOk(arg ApiExtensionListGetNameAttributeType) (ret ApiExtensionListGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setApiExtensionListGetNameAttributeType(arg *ApiExtensionListGetNameAttributeType, val ApiExtensionListGetNameRetType) { + *arg = &val +} + +type ApiExtensionListGetNameArgType = string +type ApiExtensionListGetNameRetType = string + // ApiExtensionList struct for ApiExtensionList type ApiExtensionList struct { - ID *int64 `json:"ID,omitempty"` - Description *string `json:"description,omitempty"` - Name *string `json:"name,omitempty"` + ID ApiExtensionListGetIDAttributeType `json:"ID,omitempty"` + Description ApiExtensionListGetDescriptionAttributeType `json:"description,omitempty"` + Name ApiExtensionListGetNameAttributeType `json:"name,omitempty"` } // NewApiExtensionList instantiates a new ApiExtensionList object @@ -42,111 +104,84 @@ func NewApiExtensionListWithDefaults() *ApiExtensionList { } // GetID returns the ID field value if set, zero value otherwise. -func (o *ApiExtensionList) GetID() *int64 { - if o == nil || IsNil(o.ID) { - var ret *int64 - return ret - } - return o.ID +func (o *ApiExtensionList) GetID() (res ApiExtensionListGetIDRetType) { + res, _ = o.GetIDOk() + return } // GetIDOk returns a tuple with the ID field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ApiExtensionList) GetIDOk() (*int64, bool) { - if o == nil || IsNil(o.ID) { - return nil, false - } - return o.ID, true +func (o *ApiExtensionList) GetIDOk() (ret ApiExtensionListGetIDRetType, ok bool) { + return getApiExtensionListGetIDAttributeTypeOk(o.ID) } // HasID returns a boolean if a field has been set. func (o *ApiExtensionList) HasID() bool { - if o != nil && !IsNil(o.ID) { - return true - } - - return false + _, ok := o.GetIDOk() + return ok } // SetID gets a reference to the given int64 and assigns it to the ID field. -func (o *ApiExtensionList) SetID(v *int64) { - o.ID = v +func (o *ApiExtensionList) SetID(v ApiExtensionListGetIDRetType) { + setApiExtensionListGetIDAttributeType(&o.ID, v) } // GetDescription returns the Description field value if set, zero value otherwise. -func (o *ApiExtensionList) GetDescription() *string { - if o == nil || IsNil(o.Description) { - var ret *string - return ret - } - return o.Description +func (o *ApiExtensionList) GetDescription() (res ApiExtensionListGetDescriptionRetType) { + res, _ = o.GetDescriptionOk() + return } // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ApiExtensionList) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true +func (o *ApiExtensionList) GetDescriptionOk() (ret ApiExtensionListGetDescriptionRetType, ok bool) { + return getApiExtensionListGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. func (o *ApiExtensionList) HasDescription() bool { - if o != nil && !IsNil(o.Description) { - return true - } - - return false + _, ok := o.GetDescriptionOk() + return ok } // SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *ApiExtensionList) SetDescription(v *string) { - o.Description = v +func (o *ApiExtensionList) SetDescription(v ApiExtensionListGetDescriptionRetType) { + setApiExtensionListGetDescriptionAttributeType(&o.Description, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *ApiExtensionList) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *ApiExtensionList) GetName() (res ApiExtensionListGetNameRetType) { + res, _ = o.GetNameOk() + return } // 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 *ApiExtensionList) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *ApiExtensionList) GetNameOk() (ret ApiExtensionListGetNameRetType, ok bool) { + return getApiExtensionListGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *ApiExtensionList) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false + _, ok := o.GetNameOk() + return ok } // SetName gets a reference to the given string and assigns it to the Name field. -func (o *ApiExtensionList) SetName(v *string) { - o.Name = v +func (o *ApiExtensionList) SetName(v ApiExtensionListGetNameRetType) { + setApiExtensionListGetNameAttributeType(&o.Name, v) } func (o ApiExtensionList) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.ID) { - toSerialize["ID"] = o.ID + if val, ok := getApiExtensionListGetIDAttributeTypeOk(o.ID); ok { + toSerialize["ID"] = val } - if !IsNil(o.Description) { - toSerialize["description"] = o.Description + if val, ok := getApiExtensionListGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getApiExtensionListGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_api_extension_load_response.go b/services/postgresflex/model_api_extension_load_response.go index f33f22efe..c92cb8830 100644 --- a/services/postgresflex/model_api_extension_load_response.go +++ b/services/postgresflex/model_api_extension_load_response.go @@ -17,9 +17,29 @@ import ( // checks if the ApiExtensionLoadResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ApiExtensionLoadResponse{} +/* + types and functions for extension +*/ + +// isModel +type ApiExtensionLoadResponseGetExtensionAttributeType = *ApiExtensionList +type ApiExtensionLoadResponseGetExtensionArgType = ApiExtensionList +type ApiExtensionLoadResponseGetExtensionRetType = ApiExtensionList + +func getApiExtensionLoadResponseGetExtensionAttributeTypeOk(arg ApiExtensionLoadResponseGetExtensionAttributeType) (ret ApiExtensionLoadResponseGetExtensionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setApiExtensionLoadResponseGetExtensionAttributeType(arg *ApiExtensionLoadResponseGetExtensionAttributeType, val ApiExtensionLoadResponseGetExtensionRetType) { + *arg = &val +} + // ApiExtensionLoadResponse struct for ApiExtensionLoadResponse type ApiExtensionLoadResponse struct { - Extension *ApiExtensionList `json:"extension,omitempty"` + Extension ApiExtensionLoadResponseGetExtensionAttributeType `json:"extension,omitempty"` } // NewApiExtensionLoadResponse instantiates a new ApiExtensionLoadResponse object @@ -40,41 +60,32 @@ func NewApiExtensionLoadResponseWithDefaults() *ApiExtensionLoadResponse { } // GetExtension returns the Extension field value if set, zero value otherwise. -func (o *ApiExtensionLoadResponse) GetExtension() *ApiExtensionList { - if o == nil || IsNil(o.Extension) { - var ret *ApiExtensionList - return ret - } - return o.Extension +func (o *ApiExtensionLoadResponse) GetExtension() (res ApiExtensionLoadResponseGetExtensionRetType) { + res, _ = o.GetExtensionOk() + return } // GetExtensionOk returns a tuple with the Extension field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ApiExtensionLoadResponse) GetExtensionOk() (*ApiExtensionList, bool) { - if o == nil || IsNil(o.Extension) { - return nil, false - } - return o.Extension, true +func (o *ApiExtensionLoadResponse) GetExtensionOk() (ret ApiExtensionLoadResponseGetExtensionRetType, ok bool) { + return getApiExtensionLoadResponseGetExtensionAttributeTypeOk(o.Extension) } // HasExtension returns a boolean if a field has been set. func (o *ApiExtensionLoadResponse) HasExtension() bool { - if o != nil && !IsNil(o.Extension) { - return true - } - - return false + _, ok := o.GetExtensionOk() + return ok } // SetExtension gets a reference to the given ApiExtensionList and assigns it to the Extension field. -func (o *ApiExtensionLoadResponse) SetExtension(v *ApiExtensionList) { - o.Extension = v +func (o *ApiExtensionLoadResponse) SetExtension(v ApiExtensionLoadResponseGetExtensionRetType) { + setApiExtensionLoadResponseGetExtensionAttributeType(&o.Extension, v) } func (o ApiExtensionLoadResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Extension) { - toSerialize["extension"] = o.Extension + if val, ok := getApiExtensionLoadResponseGetExtensionAttributeTypeOk(o.Extension); ok { + toSerialize["Extension"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_api_install_response.go b/services/postgresflex/model_api_install_response.go index 1d4e3222d..b51fe8ede 100644 --- a/services/postgresflex/model_api_install_response.go +++ b/services/postgresflex/model_api_install_response.go @@ -17,9 +17,29 @@ import ( // checks if the ApiInstallResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ApiInstallResponse{} +/* + types and functions for extension +*/ + +// isModel +type ApiInstallResponseGetExtensionAttributeType = *ApiExtensionList +type ApiInstallResponseGetExtensionArgType = ApiExtensionList +type ApiInstallResponseGetExtensionRetType = ApiExtensionList + +func getApiInstallResponseGetExtensionAttributeTypeOk(arg ApiInstallResponseGetExtensionAttributeType) (ret ApiInstallResponseGetExtensionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setApiInstallResponseGetExtensionAttributeType(arg *ApiInstallResponseGetExtensionAttributeType, val ApiInstallResponseGetExtensionRetType) { + *arg = &val +} + // ApiInstallResponse struct for ApiInstallResponse type ApiInstallResponse struct { - Extension *ApiExtensionList `json:"extension,omitempty"` + Extension ApiInstallResponseGetExtensionAttributeType `json:"extension,omitempty"` } // NewApiInstallResponse instantiates a new ApiInstallResponse object @@ -40,41 +60,32 @@ func NewApiInstallResponseWithDefaults() *ApiInstallResponse { } // GetExtension returns the Extension field value if set, zero value otherwise. -func (o *ApiInstallResponse) GetExtension() *ApiExtensionList { - if o == nil || IsNil(o.Extension) { - var ret *ApiExtensionList - return ret - } - return o.Extension +func (o *ApiInstallResponse) GetExtension() (res ApiInstallResponseGetExtensionRetType) { + res, _ = o.GetExtensionOk() + return } // GetExtensionOk returns a tuple with the Extension field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ApiInstallResponse) GetExtensionOk() (*ApiExtensionList, bool) { - if o == nil || IsNil(o.Extension) { - return nil, false - } - return o.Extension, true +func (o *ApiInstallResponse) GetExtensionOk() (ret ApiInstallResponseGetExtensionRetType, ok bool) { + return getApiInstallResponseGetExtensionAttributeTypeOk(o.Extension) } // HasExtension returns a boolean if a field has been set. func (o *ApiInstallResponse) HasExtension() bool { - if o != nil && !IsNil(o.Extension) { - return true - } - - return false + _, ok := o.GetExtensionOk() + return ok } // SetExtension gets a reference to the given ApiExtensionList and assigns it to the Extension field. -func (o *ApiInstallResponse) SetExtension(v *ApiExtensionList) { - o.Extension = v +func (o *ApiInstallResponse) SetExtension(v ApiInstallResponseGetExtensionRetType) { + setApiInstallResponseGetExtensionAttributeType(&o.Extension, v) } func (o ApiInstallResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Extension) { - toSerialize["extension"] = o.Extension + if val, ok := getApiInstallResponseGetExtensionAttributeTypeOk(o.Extension); ok { + toSerialize["Extension"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_api_installed_list_response.go b/services/postgresflex/model_api_installed_list_response.go index dddf0d3fb..af044bff8 100644 --- a/services/postgresflex/model_api_installed_list_response.go +++ b/services/postgresflex/model_api_installed_list_response.go @@ -17,9 +17,29 @@ import ( // checks if the ApiInstalledListResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ApiInstalledListResponse{} +/* + types and functions for installed +*/ + +// isArray +type ApiInstalledListResponseGetInstalledAttributeType = *[]ApiExtensionList +type ApiInstalledListResponseGetInstalledArgType = []ApiExtensionList +type ApiInstalledListResponseGetInstalledRetType = []ApiExtensionList + +func getApiInstalledListResponseGetInstalledAttributeTypeOk(arg ApiInstalledListResponseGetInstalledAttributeType) (ret ApiInstalledListResponseGetInstalledRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setApiInstalledListResponseGetInstalledAttributeType(arg *ApiInstalledListResponseGetInstalledAttributeType, val ApiInstalledListResponseGetInstalledRetType) { + *arg = &val +} + // ApiInstalledListResponse struct for ApiInstalledListResponse type ApiInstalledListResponse struct { - Installed *[]ApiExtensionList `json:"installed,omitempty"` + Installed ApiInstalledListResponseGetInstalledAttributeType `json:"installed,omitempty"` } // NewApiInstalledListResponse instantiates a new ApiInstalledListResponse object @@ -40,41 +60,32 @@ func NewApiInstalledListResponseWithDefaults() *ApiInstalledListResponse { } // GetInstalled returns the Installed field value if set, zero value otherwise. -func (o *ApiInstalledListResponse) GetInstalled() *[]ApiExtensionList { - if o == nil || IsNil(o.Installed) { - var ret *[]ApiExtensionList - return ret - } - return o.Installed +func (o *ApiInstalledListResponse) GetInstalled() (res ApiInstalledListResponseGetInstalledRetType) { + res, _ = o.GetInstalledOk() + return } // GetInstalledOk returns a tuple with the Installed field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ApiInstalledListResponse) GetInstalledOk() (*[]ApiExtensionList, bool) { - if o == nil || IsNil(o.Installed) { - return nil, false - } - return o.Installed, true +func (o *ApiInstalledListResponse) GetInstalledOk() (ret ApiInstalledListResponseGetInstalledRetType, ok bool) { + return getApiInstalledListResponseGetInstalledAttributeTypeOk(o.Installed) } // HasInstalled returns a boolean if a field has been set. func (o *ApiInstalledListResponse) HasInstalled() bool { - if o != nil && !IsNil(o.Installed) { - return true - } - - return false + _, ok := o.GetInstalledOk() + return ok } // SetInstalled gets a reference to the given []ApiExtensionList and assigns it to the Installed field. -func (o *ApiInstalledListResponse) SetInstalled(v *[]ApiExtensionList) { - o.Installed = v +func (o *ApiInstalledListResponse) SetInstalled(v ApiInstalledListResponseGetInstalledRetType) { + setApiInstalledListResponseGetInstalledAttributeType(&o.Installed, v) } func (o ApiInstalledListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Installed) { - toSerialize["installed"] = o.Installed + if val, ok := getApiInstalledListResponseGetInstalledAttributeTypeOk(o.Installed); ok { + toSerialize["Installed"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_backup.go b/services/postgresflex/model_backup.go index 699d58e35..18af8e99a 100644 --- a/services/postgresflex/model_backup.go +++ b/services/postgresflex/model_backup.go @@ -17,16 +17,181 @@ import ( // checks if the Backup type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Backup{} +/* + types and functions for endTime +*/ + +// isNotNullableString +type BackupGetEndTimeAttributeType = *string + +func getBackupGetEndTimeAttributeTypeOk(arg BackupGetEndTimeAttributeType) (ret BackupGetEndTimeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupGetEndTimeAttributeType(arg *BackupGetEndTimeAttributeType, val BackupGetEndTimeRetType) { + *arg = &val +} + +type BackupGetEndTimeArgType = string +type BackupGetEndTimeRetType = string + +/* + types and functions for error +*/ + +// isNotNullableString +type BackupGetErrorAttributeType = *string + +func getBackupGetErrorAttributeTypeOk(arg BackupGetErrorAttributeType) (ret BackupGetErrorRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupGetErrorAttributeType(arg *BackupGetErrorAttributeType, val BackupGetErrorRetType) { + *arg = &val +} + +type BackupGetErrorArgType = string +type BackupGetErrorRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type BackupGetIdAttributeType = *string + +func getBackupGetIdAttributeTypeOk(arg BackupGetIdAttributeType) (ret BackupGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupGetIdAttributeType(arg *BackupGetIdAttributeType, val BackupGetIdRetType) { + *arg = &val +} + +type BackupGetIdArgType = string +type BackupGetIdRetType = string + +/* + types and functions for labels +*/ + +// isArray +type BackupGetLabelsAttributeType = *[]string +type BackupGetLabelsArgType = []string +type BackupGetLabelsRetType = []string + +func getBackupGetLabelsAttributeTypeOk(arg BackupGetLabelsAttributeType) (ret BackupGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupGetLabelsAttributeType(arg *BackupGetLabelsAttributeType, val BackupGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type BackupGetNameAttributeType = *string + +func getBackupGetNameAttributeTypeOk(arg BackupGetNameAttributeType) (ret BackupGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupGetNameAttributeType(arg *BackupGetNameAttributeType, val BackupGetNameRetType) { + *arg = &val +} + +type BackupGetNameArgType = string +type BackupGetNameRetType = string + +/* + types and functions for options +*/ + +// isContainer +type BackupGetOptionsAttributeType = *map[string]string +type BackupGetOptionsArgType = map[string]string +type BackupGetOptionsRetType = map[string]string + +func getBackupGetOptionsAttributeTypeOk(arg BackupGetOptionsAttributeType) (ret BackupGetOptionsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupGetOptionsAttributeType(arg *BackupGetOptionsAttributeType, val BackupGetOptionsRetType) { + *arg = &val +} + +/* + types and functions for size +*/ + +// isLong +type BackupGetSizeAttributeType = *int64 +type BackupGetSizeArgType = int64 +type BackupGetSizeRetType = int64 + +func getBackupGetSizeAttributeTypeOk(arg BackupGetSizeAttributeType) (ret BackupGetSizeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupGetSizeAttributeType(arg *BackupGetSizeAttributeType, val BackupGetSizeRetType) { + *arg = &val +} + +/* + types and functions for startTime +*/ + +// isNotNullableString +type BackupGetStartTimeAttributeType = *string + +func getBackupGetStartTimeAttributeTypeOk(arg BackupGetStartTimeAttributeType) (ret BackupGetStartTimeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupGetStartTimeAttributeType(arg *BackupGetStartTimeAttributeType, val BackupGetStartTimeRetType) { + *arg = &val +} + +type BackupGetStartTimeArgType = string +type BackupGetStartTimeRetType = string + // Backup struct for Backup type Backup struct { - EndTime *string `json:"endTime,omitempty"` - Error *string `json:"error,omitempty"` - Id *string `json:"id,omitempty"` - Labels *[]string `json:"labels,omitempty"` - Name *string `json:"name,omitempty"` - Options *map[string]string `json:"options,omitempty"` - Size *int64 `json:"size,omitempty"` - StartTime *string `json:"startTime,omitempty"` + EndTime BackupGetEndTimeAttributeType `json:"endTime,omitempty"` + Error BackupGetErrorAttributeType `json:"error,omitempty"` + Id BackupGetIdAttributeType `json:"id,omitempty"` + Labels BackupGetLabelsAttributeType `json:"labels,omitempty"` + Name BackupGetNameAttributeType `json:"name,omitempty"` + Options BackupGetOptionsAttributeType `json:"options,omitempty"` + Size BackupGetSizeAttributeType `json:"size,omitempty"` + StartTime BackupGetStartTimeAttributeType `json:"startTime,omitempty"` } // NewBackup instantiates a new Backup object @@ -47,286 +212,214 @@ func NewBackupWithDefaults() *Backup { } // GetEndTime returns the EndTime field value if set, zero value otherwise. -func (o *Backup) GetEndTime() *string { - if o == nil || IsNil(o.EndTime) { - var ret *string - return ret - } - return o.EndTime +func (o *Backup) GetEndTime() (res BackupGetEndTimeRetType) { + res, _ = o.GetEndTimeOk() + return } // GetEndTimeOk returns a tuple with the EndTime field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Backup) GetEndTimeOk() (*string, bool) { - if o == nil || IsNil(o.EndTime) { - return nil, false - } - return o.EndTime, true +func (o *Backup) GetEndTimeOk() (ret BackupGetEndTimeRetType, ok bool) { + return getBackupGetEndTimeAttributeTypeOk(o.EndTime) } // HasEndTime returns a boolean if a field has been set. func (o *Backup) HasEndTime() bool { - if o != nil && !IsNil(o.EndTime) { - return true - } - - return false + _, ok := o.GetEndTimeOk() + return ok } // SetEndTime gets a reference to the given string and assigns it to the EndTime field. -func (o *Backup) SetEndTime(v *string) { - o.EndTime = v +func (o *Backup) SetEndTime(v BackupGetEndTimeRetType) { + setBackupGetEndTimeAttributeType(&o.EndTime, v) } // GetError returns the Error field value if set, zero value otherwise. -func (o *Backup) GetError() *string { - if o == nil || IsNil(o.Error) { - var ret *string - return ret - } - return o.Error +func (o *Backup) GetError() (res BackupGetErrorRetType) { + res, _ = o.GetErrorOk() + return } // GetErrorOk returns a tuple with the Error field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Backup) GetErrorOk() (*string, bool) { - if o == nil || IsNil(o.Error) { - return nil, false - } - return o.Error, true +func (o *Backup) GetErrorOk() (ret BackupGetErrorRetType, ok bool) { + return getBackupGetErrorAttributeTypeOk(o.Error) } // HasError returns a boolean if a field has been set. func (o *Backup) HasError() bool { - if o != nil && !IsNil(o.Error) { - return true - } - - return false + _, ok := o.GetErrorOk() + return ok } // SetError gets a reference to the given string and assigns it to the Error field. -func (o *Backup) SetError(v *string) { - o.Error = v +func (o *Backup) SetError(v BackupGetErrorRetType) { + setBackupGetErrorAttributeType(&o.Error, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *Backup) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *Backup) GetId() (res BackupGetIdRetType) { + res, _ = o.GetIdOk() + return } // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Backup) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *Backup) GetIdOk() (ret BackupGetIdRetType, ok bool) { + return getBackupGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *Backup) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false + _, ok := o.GetIdOk() + return ok } // SetId gets a reference to the given string and assigns it to the Id field. -func (o *Backup) SetId(v *string) { - o.Id = v +func (o *Backup) SetId(v BackupGetIdRetType) { + setBackupGetIdAttributeType(&o.Id, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *Backup) GetLabels() *[]string { - if o == nil || IsNil(o.Labels) { - var ret *[]string - return ret - } - return o.Labels +func (o *Backup) GetLabels() (res BackupGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return } // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Backup) GetLabelsOk() (*[]string, bool) { - if o == nil || IsNil(o.Labels) { - return nil, false - } - return o.Labels, true +func (o *Backup) GetLabelsOk() (ret BackupGetLabelsRetType, ok bool) { + return getBackupGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *Backup) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false + _, ok := o.GetLabelsOk() + return ok } // SetLabels gets a reference to the given []string and assigns it to the Labels field. -func (o *Backup) SetLabels(v *[]string) { - o.Labels = v +func (o *Backup) SetLabels(v BackupGetLabelsRetType) { + setBackupGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *Backup) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *Backup) GetName() (res BackupGetNameRetType) { + res, _ = o.GetNameOk() + return } // 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 *Backup) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *Backup) GetNameOk() (ret BackupGetNameRetType, ok bool) { + return getBackupGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *Backup) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false + _, ok := o.GetNameOk() + return ok } // SetName gets a reference to the given string and assigns it to the Name field. -func (o *Backup) SetName(v *string) { - o.Name = v +func (o *Backup) SetName(v BackupGetNameRetType) { + setBackupGetNameAttributeType(&o.Name, v) } // GetOptions returns the Options field value if set, zero value otherwise. -func (o *Backup) GetOptions() *map[string]string { - if o == nil || IsNil(o.Options) { - var ret *map[string]string - return ret - } - return o.Options +func (o *Backup) GetOptions() (res BackupGetOptionsRetType) { + res, _ = o.GetOptionsOk() + return } // GetOptionsOk returns a tuple with the Options field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Backup) GetOptionsOk() (*map[string]string, bool) { - if o == nil || IsNil(o.Options) { - return nil, false - } - return o.Options, true +func (o *Backup) GetOptionsOk() (ret BackupGetOptionsRetType, ok bool) { + return getBackupGetOptionsAttributeTypeOk(o.Options) } // HasOptions returns a boolean if a field has been set. func (o *Backup) HasOptions() bool { - if o != nil && !IsNil(o.Options) { - return true - } - - return false + _, ok := o.GetOptionsOk() + return ok } // SetOptions gets a reference to the given map[string]string and assigns it to the Options field. -func (o *Backup) SetOptions(v *map[string]string) { - o.Options = v +func (o *Backup) SetOptions(v BackupGetOptionsRetType) { + setBackupGetOptionsAttributeType(&o.Options, v) } // GetSize returns the Size field value if set, zero value otherwise. -func (o *Backup) GetSize() *int64 { - if o == nil || IsNil(o.Size) { - var ret *int64 - return ret - } - return o.Size +func (o *Backup) GetSize() (res BackupGetSizeRetType) { + res, _ = o.GetSizeOk() + return } // GetSizeOk returns a tuple with the Size field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Backup) GetSizeOk() (*int64, bool) { - if o == nil || IsNil(o.Size) { - return nil, false - } - return o.Size, true +func (o *Backup) GetSizeOk() (ret BackupGetSizeRetType, ok bool) { + return getBackupGetSizeAttributeTypeOk(o.Size) } // HasSize returns a boolean if a field has been set. func (o *Backup) HasSize() bool { - if o != nil && !IsNil(o.Size) { - return true - } - - return false + _, ok := o.GetSizeOk() + return ok } // SetSize gets a reference to the given int64 and assigns it to the Size field. -func (o *Backup) SetSize(v *int64) { - o.Size = v +func (o *Backup) SetSize(v BackupGetSizeRetType) { + setBackupGetSizeAttributeType(&o.Size, v) } // GetStartTime returns the StartTime field value if set, zero value otherwise. -func (o *Backup) GetStartTime() *string { - if o == nil || IsNil(o.StartTime) { - var ret *string - return ret - } - return o.StartTime +func (o *Backup) GetStartTime() (res BackupGetStartTimeRetType) { + res, _ = o.GetStartTimeOk() + return } // GetStartTimeOk returns a tuple with the StartTime field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Backup) GetStartTimeOk() (*string, bool) { - if o == nil || IsNil(o.StartTime) { - return nil, false - } - return o.StartTime, true +func (o *Backup) GetStartTimeOk() (ret BackupGetStartTimeRetType, ok bool) { + return getBackupGetStartTimeAttributeTypeOk(o.StartTime) } // HasStartTime returns a boolean if a field has been set. func (o *Backup) HasStartTime() bool { - if o != nil && !IsNil(o.StartTime) { - return true - } - - return false + _, ok := o.GetStartTimeOk() + return ok } // SetStartTime gets a reference to the given string and assigns it to the StartTime field. -func (o *Backup) SetStartTime(v *string) { - o.StartTime = v +func (o *Backup) SetStartTime(v BackupGetStartTimeRetType) { + setBackupGetStartTimeAttributeType(&o.StartTime, v) } func (o Backup) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.EndTime) { - toSerialize["endTime"] = o.EndTime + if val, ok := getBackupGetEndTimeAttributeTypeOk(o.EndTime); ok { + toSerialize["EndTime"] = val } - if !IsNil(o.Error) { - toSerialize["error"] = o.Error + if val, ok := getBackupGetErrorAttributeTypeOk(o.Error); ok { + toSerialize["Error"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getBackupGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getBackupGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getBackupGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Options) { - toSerialize["options"] = o.Options + if val, ok := getBackupGetOptionsAttributeTypeOk(o.Options); ok { + toSerialize["Options"] = val } - if !IsNil(o.Size) { - toSerialize["size"] = o.Size + if val, ok := getBackupGetSizeAttributeTypeOk(o.Size); ok { + toSerialize["Size"] = val } - if !IsNil(o.StartTime) { - toSerialize["startTime"] = o.StartTime + if val, ok := getBackupGetStartTimeAttributeTypeOk(o.StartTime); ok { + toSerialize["StartTime"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_clone_instance_payload.go b/services/postgresflex/model_clone_instance_payload.go index 501993d5b..5540810b6 100644 --- a/services/postgresflex/model_clone_instance_payload.go +++ b/services/postgresflex/model_clone_instance_payload.go @@ -17,12 +17,74 @@ import ( // checks if the CloneInstancePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CloneInstancePayload{} +/* + types and functions for class +*/ + +// isNotNullableString +type CloneInstancePayloadGetClassAttributeType = *string + +func getCloneInstancePayloadGetClassAttributeTypeOk(arg CloneInstancePayloadGetClassAttributeType) (ret CloneInstancePayloadGetClassRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCloneInstancePayloadGetClassAttributeType(arg *CloneInstancePayloadGetClassAttributeType, val CloneInstancePayloadGetClassRetType) { + *arg = &val +} + +type CloneInstancePayloadGetClassArgType = string +type CloneInstancePayloadGetClassRetType = string + +/* + types and functions for size +*/ + +// isLong +type CloneInstancePayloadGetSizeAttributeType = *int64 +type CloneInstancePayloadGetSizeArgType = int64 +type CloneInstancePayloadGetSizeRetType = int64 + +func getCloneInstancePayloadGetSizeAttributeTypeOk(arg CloneInstancePayloadGetSizeAttributeType) (ret CloneInstancePayloadGetSizeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCloneInstancePayloadGetSizeAttributeType(arg *CloneInstancePayloadGetSizeAttributeType, val CloneInstancePayloadGetSizeRetType) { + *arg = &val +} + +/* + types and functions for timestamp +*/ + +// isNotNullableString +type CloneInstancePayloadGetTimestampAttributeType = *string + +func getCloneInstancePayloadGetTimestampAttributeTypeOk(arg CloneInstancePayloadGetTimestampAttributeType) (ret CloneInstancePayloadGetTimestampRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCloneInstancePayloadGetTimestampAttributeType(arg *CloneInstancePayloadGetTimestampAttributeType, val CloneInstancePayloadGetTimestampRetType) { + *arg = &val +} + +type CloneInstancePayloadGetTimestampArgType = string +type CloneInstancePayloadGetTimestampRetType = string + // CloneInstancePayload struct for CloneInstancePayload type CloneInstancePayload struct { - Class *string `json:"class,omitempty"` - Size *int64 `json:"size,omitempty"` + Class CloneInstancePayloadGetClassAttributeType `json:"class,omitempty"` + Size CloneInstancePayloadGetSizeAttributeType `json:"size,omitempty"` // The timestamp should be specified in UTC time following the format provided in the example. - Timestamp *string `json:"timestamp,omitempty"` + Timestamp CloneInstancePayloadGetTimestampAttributeType `json:"timestamp,omitempty"` } // NewCloneInstancePayload instantiates a new CloneInstancePayload object @@ -43,111 +105,84 @@ func NewCloneInstancePayloadWithDefaults() *CloneInstancePayload { } // GetClass returns the Class field value if set, zero value otherwise. -func (o *CloneInstancePayload) GetClass() *string { - if o == nil || IsNil(o.Class) { - var ret *string - return ret - } - return o.Class +func (o *CloneInstancePayload) GetClass() (res CloneInstancePayloadGetClassRetType) { + res, _ = o.GetClassOk() + return } // GetClassOk returns a tuple with the Class field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CloneInstancePayload) GetClassOk() (*string, bool) { - if o == nil || IsNil(o.Class) { - return nil, false - } - return o.Class, true +func (o *CloneInstancePayload) GetClassOk() (ret CloneInstancePayloadGetClassRetType, ok bool) { + return getCloneInstancePayloadGetClassAttributeTypeOk(o.Class) } // HasClass returns a boolean if a field has been set. func (o *CloneInstancePayload) HasClass() bool { - if o != nil && !IsNil(o.Class) { - return true - } - - return false + _, ok := o.GetClassOk() + return ok } // SetClass gets a reference to the given string and assigns it to the Class field. -func (o *CloneInstancePayload) SetClass(v *string) { - o.Class = v +func (o *CloneInstancePayload) SetClass(v CloneInstancePayloadGetClassRetType) { + setCloneInstancePayloadGetClassAttributeType(&o.Class, v) } // GetSize returns the Size field value if set, zero value otherwise. -func (o *CloneInstancePayload) GetSize() *int64 { - if o == nil || IsNil(o.Size) { - var ret *int64 - return ret - } - return o.Size +func (o *CloneInstancePayload) GetSize() (res CloneInstancePayloadGetSizeRetType) { + res, _ = o.GetSizeOk() + return } // GetSizeOk returns a tuple with the Size field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CloneInstancePayload) GetSizeOk() (*int64, bool) { - if o == nil || IsNil(o.Size) { - return nil, false - } - return o.Size, true +func (o *CloneInstancePayload) GetSizeOk() (ret CloneInstancePayloadGetSizeRetType, ok bool) { + return getCloneInstancePayloadGetSizeAttributeTypeOk(o.Size) } // HasSize returns a boolean if a field has been set. func (o *CloneInstancePayload) HasSize() bool { - if o != nil && !IsNil(o.Size) { - return true - } - - return false + _, ok := o.GetSizeOk() + return ok } // SetSize gets a reference to the given int64 and assigns it to the Size field. -func (o *CloneInstancePayload) SetSize(v *int64) { - o.Size = v +func (o *CloneInstancePayload) SetSize(v CloneInstancePayloadGetSizeRetType) { + setCloneInstancePayloadGetSizeAttributeType(&o.Size, v) } // GetTimestamp returns the Timestamp field value if set, zero value otherwise. -func (o *CloneInstancePayload) GetTimestamp() *string { - if o == nil || IsNil(o.Timestamp) { - var ret *string - return ret - } - return o.Timestamp +func (o *CloneInstancePayload) GetTimestamp() (res CloneInstancePayloadGetTimestampRetType) { + res, _ = o.GetTimestampOk() + return } // GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CloneInstancePayload) GetTimestampOk() (*string, bool) { - if o == nil || IsNil(o.Timestamp) { - return nil, false - } - return o.Timestamp, true +func (o *CloneInstancePayload) GetTimestampOk() (ret CloneInstancePayloadGetTimestampRetType, ok bool) { + return getCloneInstancePayloadGetTimestampAttributeTypeOk(o.Timestamp) } // HasTimestamp returns a boolean if a field has been set. func (o *CloneInstancePayload) HasTimestamp() bool { - if o != nil && !IsNil(o.Timestamp) { - return true - } - - return false + _, ok := o.GetTimestampOk() + return ok } // SetTimestamp gets a reference to the given string and assigns it to the Timestamp field. -func (o *CloneInstancePayload) SetTimestamp(v *string) { - o.Timestamp = v +func (o *CloneInstancePayload) SetTimestamp(v CloneInstancePayloadGetTimestampRetType) { + setCloneInstancePayloadGetTimestampAttributeType(&o.Timestamp, v) } func (o CloneInstancePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Class) { - toSerialize["class"] = o.Class + if val, ok := getCloneInstancePayloadGetClassAttributeTypeOk(o.Class); ok { + toSerialize["Class"] = val } - if !IsNil(o.Size) { - toSerialize["size"] = o.Size + if val, ok := getCloneInstancePayloadGetSizeAttributeTypeOk(o.Size); ok { + toSerialize["Size"] = val } - if !IsNil(o.Timestamp) { - toSerialize["timestamp"] = o.Timestamp + if val, ok := getCloneInstancePayloadGetTimestampAttributeTypeOk(o.Timestamp); ok { + toSerialize["Timestamp"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_clone_instance_response.go b/services/postgresflex/model_clone_instance_response.go index 3341081e2..fa458670d 100644 --- a/services/postgresflex/model_clone_instance_response.go +++ b/services/postgresflex/model_clone_instance_response.go @@ -17,9 +17,30 @@ import ( // checks if the CloneInstanceResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CloneInstanceResponse{} +/* + types and functions for instanceId +*/ + +// isNotNullableString +type CloneInstanceResponseGetInstanceIdAttributeType = *string + +func getCloneInstanceResponseGetInstanceIdAttributeTypeOk(arg CloneInstanceResponseGetInstanceIdAttributeType) (ret CloneInstanceResponseGetInstanceIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCloneInstanceResponseGetInstanceIdAttributeType(arg *CloneInstanceResponseGetInstanceIdAttributeType, val CloneInstanceResponseGetInstanceIdRetType) { + *arg = &val +} + +type CloneInstanceResponseGetInstanceIdArgType = string +type CloneInstanceResponseGetInstanceIdRetType = string + // CloneInstanceResponse struct for CloneInstanceResponse type CloneInstanceResponse struct { - InstanceId *string `json:"instanceId,omitempty"` + InstanceId CloneInstanceResponseGetInstanceIdAttributeType `json:"instanceId,omitempty"` } // NewCloneInstanceResponse instantiates a new CloneInstanceResponse object @@ -40,41 +61,32 @@ func NewCloneInstanceResponseWithDefaults() *CloneInstanceResponse { } // GetInstanceId returns the InstanceId field value if set, zero value otherwise. -func (o *CloneInstanceResponse) GetInstanceId() *string { - if o == nil || IsNil(o.InstanceId) { - var ret *string - return ret - } - return o.InstanceId +func (o *CloneInstanceResponse) GetInstanceId() (res CloneInstanceResponseGetInstanceIdRetType) { + res, _ = o.GetInstanceIdOk() + return } // GetInstanceIdOk returns a tuple with the InstanceId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CloneInstanceResponse) GetInstanceIdOk() (*string, bool) { - if o == nil || IsNil(o.InstanceId) { - return nil, false - } - return o.InstanceId, true +func (o *CloneInstanceResponse) GetInstanceIdOk() (ret CloneInstanceResponseGetInstanceIdRetType, ok bool) { + return getCloneInstanceResponseGetInstanceIdAttributeTypeOk(o.InstanceId) } // HasInstanceId returns a boolean if a field has been set. func (o *CloneInstanceResponse) HasInstanceId() bool { - if o != nil && !IsNil(o.InstanceId) { - return true - } - - return false + _, ok := o.GetInstanceIdOk() + return ok } // SetInstanceId gets a reference to the given string and assigns it to the InstanceId field. -func (o *CloneInstanceResponse) SetInstanceId(v *string) { - o.InstanceId = v +func (o *CloneInstanceResponse) SetInstanceId(v CloneInstanceResponseGetInstanceIdRetType) { + setCloneInstanceResponseGetInstanceIdAttributeType(&o.InstanceId, v) } func (o CloneInstanceResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.InstanceId) { - toSerialize["instanceId"] = o.InstanceId + if val, ok := getCloneInstanceResponseGetInstanceIdAttributeTypeOk(o.InstanceId); ok { + toSerialize["InstanceId"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_create_database_payload.go b/services/postgresflex/model_create_database_payload.go index f5defdab1..9b00606a6 100644 --- a/services/postgresflex/model_create_database_payload.go +++ b/services/postgresflex/model_create_database_payload.go @@ -17,11 +17,52 @@ import ( // checks if the CreateDatabasePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateDatabasePayload{} +/* + types and functions for name +*/ + +// isNotNullableString +type CreateDatabasePayloadGetNameAttributeType = *string + +func getCreateDatabasePayloadGetNameAttributeTypeOk(arg CreateDatabasePayloadGetNameAttributeType) (ret CreateDatabasePayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateDatabasePayloadGetNameAttributeType(arg *CreateDatabasePayloadGetNameAttributeType, val CreateDatabasePayloadGetNameRetType) { + *arg = &val +} + +type CreateDatabasePayloadGetNameArgType = string +type CreateDatabasePayloadGetNameRetType = string + +/* + types and functions for options +*/ + +// isContainer +type CreateDatabasePayloadGetOptionsAttributeType = *map[string]string +type CreateDatabasePayloadGetOptionsArgType = map[string]string +type CreateDatabasePayloadGetOptionsRetType = map[string]string + +func getCreateDatabasePayloadGetOptionsAttributeTypeOk(arg CreateDatabasePayloadGetOptionsAttributeType) (ret CreateDatabasePayloadGetOptionsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateDatabasePayloadGetOptionsAttributeType(arg *CreateDatabasePayloadGetOptionsAttributeType, val CreateDatabasePayloadGetOptionsRetType) { + *arg = &val +} + // CreateDatabasePayload struct for CreateDatabasePayload type CreateDatabasePayload struct { - Name *string `json:"name,omitempty"` + Name CreateDatabasePayloadGetNameAttributeType `json:"name,omitempty"` // Database specific options - Options *map[string]string `json:"options,omitempty"` + Options CreateDatabasePayloadGetOptionsAttributeType `json:"options,omitempty"` } // NewCreateDatabasePayload instantiates a new CreateDatabasePayload object @@ -42,76 +83,58 @@ func NewCreateDatabasePayloadWithDefaults() *CreateDatabasePayload { } // GetName returns the Name field value if set, zero value otherwise. -func (o *CreateDatabasePayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *CreateDatabasePayload) GetName() (res CreateDatabasePayloadGetNameRetType) { + res, _ = o.GetNameOk() + return } // 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 *CreateDatabasePayload) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *CreateDatabasePayload) GetNameOk() (ret CreateDatabasePayloadGetNameRetType, ok bool) { + return getCreateDatabasePayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *CreateDatabasePayload) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false + _, ok := o.GetNameOk() + return ok } // SetName gets a reference to the given string and assigns it to the Name field. -func (o *CreateDatabasePayload) SetName(v *string) { - o.Name = v +func (o *CreateDatabasePayload) SetName(v CreateDatabasePayloadGetNameRetType) { + setCreateDatabasePayloadGetNameAttributeType(&o.Name, v) } // GetOptions returns the Options field value if set, zero value otherwise. -func (o *CreateDatabasePayload) GetOptions() *map[string]string { - if o == nil || IsNil(o.Options) { - var ret *map[string]string - return ret - } - return o.Options +func (o *CreateDatabasePayload) GetOptions() (res CreateDatabasePayloadGetOptionsRetType) { + res, _ = o.GetOptionsOk() + return } // GetOptionsOk returns a tuple with the Options field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateDatabasePayload) GetOptionsOk() (*map[string]string, bool) { - if o == nil || IsNil(o.Options) { - return nil, false - } - return o.Options, true +func (o *CreateDatabasePayload) GetOptionsOk() (ret CreateDatabasePayloadGetOptionsRetType, ok bool) { + return getCreateDatabasePayloadGetOptionsAttributeTypeOk(o.Options) } // HasOptions returns a boolean if a field has been set. func (o *CreateDatabasePayload) HasOptions() bool { - if o != nil && !IsNil(o.Options) { - return true - } - - return false + _, ok := o.GetOptionsOk() + return ok } // SetOptions gets a reference to the given map[string]string and assigns it to the Options field. -func (o *CreateDatabasePayload) SetOptions(v *map[string]string) { - o.Options = v +func (o *CreateDatabasePayload) SetOptions(v CreateDatabasePayloadGetOptionsRetType) { + setCreateDatabasePayloadGetOptionsAttributeType(&o.Options, v) } func (o CreateDatabasePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getCreateDatabasePayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Options) { - toSerialize["options"] = o.Options + if val, ok := getCreateDatabasePayloadGetOptionsAttributeTypeOk(o.Options); ok { + toSerialize["Options"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_create_instance_payload.go b/services/postgresflex/model_create_instance_payload.go index 9e63bc154..375d2f050 100644 --- a/services/postgresflex/model_create_instance_payload.go +++ b/services/postgresflex/model_create_instance_payload.go @@ -17,27 +17,211 @@ import ( // checks if the CreateInstancePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateInstancePayload{} +/* + types and functions for acl +*/ + +// isModel +type CreateInstancePayloadGetAclAttributeType = *ACL +type CreateInstancePayloadGetAclArgType = ACL +type CreateInstancePayloadGetAclRetType = ACL + +func getCreateInstancePayloadGetAclAttributeTypeOk(arg CreateInstancePayloadGetAclAttributeType) (ret CreateInstancePayloadGetAclRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateInstancePayloadGetAclAttributeType(arg *CreateInstancePayloadGetAclAttributeType, val CreateInstancePayloadGetAclRetType) { + *arg = &val +} + +/* + types and functions for backupSchedule +*/ + +// isNotNullableString +type CreateInstancePayloadGetBackupScheduleAttributeType = *string + +func getCreateInstancePayloadGetBackupScheduleAttributeTypeOk(arg CreateInstancePayloadGetBackupScheduleAttributeType) (ret CreateInstancePayloadGetBackupScheduleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateInstancePayloadGetBackupScheduleAttributeType(arg *CreateInstancePayloadGetBackupScheduleAttributeType, val CreateInstancePayloadGetBackupScheduleRetType) { + *arg = &val +} + +type CreateInstancePayloadGetBackupScheduleArgType = string +type CreateInstancePayloadGetBackupScheduleRetType = string + +/* + types and functions for flavorId +*/ + +// isNotNullableString +type CreateInstancePayloadGetFlavorIdAttributeType = *string + +func getCreateInstancePayloadGetFlavorIdAttributeTypeOk(arg CreateInstancePayloadGetFlavorIdAttributeType) (ret CreateInstancePayloadGetFlavorIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateInstancePayloadGetFlavorIdAttributeType(arg *CreateInstancePayloadGetFlavorIdAttributeType, val CreateInstancePayloadGetFlavorIdRetType) { + *arg = &val +} + +type CreateInstancePayloadGetFlavorIdArgType = string +type CreateInstancePayloadGetFlavorIdRetType = string + +/* + types and functions for labels +*/ + +// isContainer +type CreateInstancePayloadGetLabelsAttributeType = *map[string]string +type CreateInstancePayloadGetLabelsArgType = map[string]string +type CreateInstancePayloadGetLabelsRetType = map[string]string + +func getCreateInstancePayloadGetLabelsAttributeTypeOk(arg CreateInstancePayloadGetLabelsAttributeType) (ret CreateInstancePayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateInstancePayloadGetLabelsAttributeType(arg *CreateInstancePayloadGetLabelsAttributeType, val CreateInstancePayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type CreateInstancePayloadGetNameAttributeType = *string + +func getCreateInstancePayloadGetNameAttributeTypeOk(arg CreateInstancePayloadGetNameAttributeType) (ret CreateInstancePayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateInstancePayloadGetNameAttributeType(arg *CreateInstancePayloadGetNameAttributeType, val CreateInstancePayloadGetNameRetType) { + *arg = &val +} + +type CreateInstancePayloadGetNameArgType = string +type CreateInstancePayloadGetNameRetType = string + +/* + types and functions for options +*/ + +// isContainer +type CreateInstancePayloadGetOptionsAttributeType = *map[string]string +type CreateInstancePayloadGetOptionsArgType = map[string]string +type CreateInstancePayloadGetOptionsRetType = map[string]string + +func getCreateInstancePayloadGetOptionsAttributeTypeOk(arg CreateInstancePayloadGetOptionsAttributeType) (ret CreateInstancePayloadGetOptionsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateInstancePayloadGetOptionsAttributeType(arg *CreateInstancePayloadGetOptionsAttributeType, val CreateInstancePayloadGetOptionsRetType) { + *arg = &val +} + +/* + types and functions for replicas +*/ + +// isInteger +type CreateInstancePayloadGetReplicasAttributeType = *int64 +type CreateInstancePayloadGetReplicasArgType = int64 +type CreateInstancePayloadGetReplicasRetType = int64 + +func getCreateInstancePayloadGetReplicasAttributeTypeOk(arg CreateInstancePayloadGetReplicasAttributeType) (ret CreateInstancePayloadGetReplicasRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateInstancePayloadGetReplicasAttributeType(arg *CreateInstancePayloadGetReplicasAttributeType, val CreateInstancePayloadGetReplicasRetType) { + *arg = &val +} + +/* + types and functions for storage +*/ + +// isModel +type CreateInstancePayloadGetStorageAttributeType = *Storage +type CreateInstancePayloadGetStorageArgType = Storage +type CreateInstancePayloadGetStorageRetType = Storage + +func getCreateInstancePayloadGetStorageAttributeTypeOk(arg CreateInstancePayloadGetStorageAttributeType) (ret CreateInstancePayloadGetStorageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateInstancePayloadGetStorageAttributeType(arg *CreateInstancePayloadGetStorageAttributeType, val CreateInstancePayloadGetStorageRetType) { + *arg = &val +} + +/* + types and functions for version +*/ + +// isNotNullableString +type CreateInstancePayloadGetVersionAttributeType = *string + +func getCreateInstancePayloadGetVersionAttributeTypeOk(arg CreateInstancePayloadGetVersionAttributeType) (ret CreateInstancePayloadGetVersionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateInstancePayloadGetVersionAttributeType(arg *CreateInstancePayloadGetVersionAttributeType, val CreateInstancePayloadGetVersionRetType) { + *arg = &val +} + +type CreateInstancePayloadGetVersionArgType = string +type CreateInstancePayloadGetVersionRetType = string + // CreateInstancePayload struct for CreateInstancePayload type CreateInstancePayload struct { // REQUIRED - Acl *ACL `json:"acl"` + Acl CreateInstancePayloadGetAclAttributeType `json:"acl"` // REQUIRED - BackupSchedule *string `json:"backupSchedule"` + BackupSchedule CreateInstancePayloadGetBackupScheduleAttributeType `json:"backupSchedule"` // REQUIRED - FlavorId *string `json:"flavorId"` + FlavorId CreateInstancePayloadGetFlavorIdAttributeType `json:"flavorId"` // Labels field is not certain/clear - Labels *map[string]string `json:"labels,omitempty"` + Labels CreateInstancePayloadGetLabelsAttributeType `json:"labels,omitempty"` // REQUIRED - Name *string `json:"name"` + Name CreateInstancePayloadGetNameAttributeType `json:"name"` // REQUIRED - Options *map[string]string `json:"options"` + Options CreateInstancePayloadGetOptionsAttributeType `json:"options"` // Can be cast to int32 without loss of precision. // REQUIRED - Replicas *int64 `json:"replicas"` + Replicas CreateInstancePayloadGetReplicasAttributeType `json:"replicas"` // REQUIRED - Storage *Storage `json:"storage"` + Storage CreateInstancePayloadGetStorageAttributeType `json:"storage"` // REQUIRED - Version *string `json:"version"` + Version CreateInstancePayloadGetVersionAttributeType `json:"version"` } type _CreateInstancePayload CreateInstancePayload @@ -46,16 +230,16 @@ type _CreateInstancePayload CreateInstancePayload // 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 NewCreateInstancePayload(acl *ACL, backupSchedule *string, flavorId *string, name *string, options *map[string]string, replicas *int64, storage *Storage, version *string) *CreateInstancePayload { +func NewCreateInstancePayload(acl CreateInstancePayloadGetAclArgType, backupSchedule CreateInstancePayloadGetBackupScheduleArgType, flavorId CreateInstancePayloadGetFlavorIdArgType, name CreateInstancePayloadGetNameArgType, options CreateInstancePayloadGetOptionsArgType, replicas CreateInstancePayloadGetReplicasArgType, storage CreateInstancePayloadGetStorageArgType, version CreateInstancePayloadGetVersionArgType) *CreateInstancePayload { this := CreateInstancePayload{} - this.Acl = acl - this.BackupSchedule = backupSchedule - this.FlavorId = flavorId - this.Name = name - this.Options = options - this.Replicas = replicas - this.Storage = storage - this.Version = version + setCreateInstancePayloadGetAclAttributeType(&this.Acl, acl) + setCreateInstancePayloadGetBackupScheduleAttributeType(&this.BackupSchedule, backupSchedule) + setCreateInstancePayloadGetFlavorIdAttributeType(&this.FlavorId, flavorId) + setCreateInstancePayloadGetNameAttributeType(&this.Name, name) + setCreateInstancePayloadGetOptionsAttributeType(&this.Options, options) + setCreateInstancePayloadGetReplicasAttributeType(&this.Replicas, replicas) + setCreateInstancePayloadGetStorageAttributeType(&this.Storage, storage) + setCreateInstancePayloadGetVersionAttributeType(&this.Version, version) return &this } @@ -68,242 +252,193 @@ func NewCreateInstancePayloadWithDefaults() *CreateInstancePayload { } // GetAcl returns the Acl field value -func (o *CreateInstancePayload) GetAcl() *ACL { - if o == nil || IsNil(o.Acl) { - var ret *ACL - return ret - } - - return o.Acl +func (o *CreateInstancePayload) GetAcl() (ret CreateInstancePayloadGetAclRetType) { + ret, _ = o.GetAclOk() + return ret } // GetAclOk returns a tuple with the Acl field value // and a boolean to check if the value has been set. -func (o *CreateInstancePayload) GetAclOk() (*ACL, bool) { - if o == nil { - return nil, false - } - return o.Acl, true +func (o *CreateInstancePayload) GetAclOk() (ret CreateInstancePayloadGetAclRetType, ok bool) { + return getCreateInstancePayloadGetAclAttributeTypeOk(o.Acl) } // SetAcl sets field value -func (o *CreateInstancePayload) SetAcl(v *ACL) { - o.Acl = v +func (o *CreateInstancePayload) SetAcl(v CreateInstancePayloadGetAclRetType) { + setCreateInstancePayloadGetAclAttributeType(&o.Acl, v) } // GetBackupSchedule returns the BackupSchedule field value -func (o *CreateInstancePayload) GetBackupSchedule() *string { - if o == nil || IsNil(o.BackupSchedule) { - var ret *string - return ret - } - - return o.BackupSchedule +func (o *CreateInstancePayload) GetBackupSchedule() (ret CreateInstancePayloadGetBackupScheduleRetType) { + ret, _ = o.GetBackupScheduleOk() + return ret } // GetBackupScheduleOk returns a tuple with the BackupSchedule field value // and a boolean to check if the value has been set. -func (o *CreateInstancePayload) GetBackupScheduleOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.BackupSchedule, true +func (o *CreateInstancePayload) GetBackupScheduleOk() (ret CreateInstancePayloadGetBackupScheduleRetType, ok bool) { + return getCreateInstancePayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule) } // SetBackupSchedule sets field value -func (o *CreateInstancePayload) SetBackupSchedule(v *string) { - o.BackupSchedule = v +func (o *CreateInstancePayload) SetBackupSchedule(v CreateInstancePayloadGetBackupScheduleRetType) { + setCreateInstancePayloadGetBackupScheduleAttributeType(&o.BackupSchedule, v) } // GetFlavorId returns the FlavorId field value -func (o *CreateInstancePayload) GetFlavorId() *string { - if o == nil || IsNil(o.FlavorId) { - var ret *string - return ret - } - - return o.FlavorId +func (o *CreateInstancePayload) GetFlavorId() (ret CreateInstancePayloadGetFlavorIdRetType) { + ret, _ = o.GetFlavorIdOk() + return ret } // GetFlavorIdOk returns a tuple with the FlavorId field value // and a boolean to check if the value has been set. -func (o *CreateInstancePayload) GetFlavorIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.FlavorId, true +func (o *CreateInstancePayload) GetFlavorIdOk() (ret CreateInstancePayloadGetFlavorIdRetType, ok bool) { + return getCreateInstancePayloadGetFlavorIdAttributeTypeOk(o.FlavorId) } // SetFlavorId sets field value -func (o *CreateInstancePayload) SetFlavorId(v *string) { - o.FlavorId = v +func (o *CreateInstancePayload) SetFlavorId(v CreateInstancePayloadGetFlavorIdRetType) { + setCreateInstancePayloadGetFlavorIdAttributeType(&o.FlavorId, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateInstancePayload) GetLabels() *map[string]string { - if o == nil || IsNil(o.Labels) { - var ret *map[string]string - return ret - } - return o.Labels +func (o *CreateInstancePayload) GetLabels() (res CreateInstancePayloadGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return } // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateInstancePayload) GetLabelsOk() (*map[string]string, bool) { - if o == nil || IsNil(o.Labels) { - return nil, false - } - return o.Labels, true +func (o *CreateInstancePayload) GetLabelsOk() (ret CreateInstancePayloadGetLabelsRetType, ok bool) { + return getCreateInstancePayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *CreateInstancePayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false + _, ok := o.GetLabelsOk() + return ok } // SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. -func (o *CreateInstancePayload) SetLabels(v *map[string]string) { - o.Labels = v +func (o *CreateInstancePayload) SetLabels(v CreateInstancePayloadGetLabelsRetType) { + setCreateInstancePayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value -func (o *CreateInstancePayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *CreateInstancePayload) GetName() (ret CreateInstancePayloadGetNameRetType) { + ret, _ = o.GetNameOk() + return ret } // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. -func (o *CreateInstancePayload) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *CreateInstancePayload) GetNameOk() (ret CreateInstancePayloadGetNameRetType, ok bool) { + return getCreateInstancePayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *CreateInstancePayload) SetName(v *string) { - o.Name = v +func (o *CreateInstancePayload) SetName(v CreateInstancePayloadGetNameRetType) { + setCreateInstancePayloadGetNameAttributeType(&o.Name, v) } // GetOptions returns the Options field value -func (o *CreateInstancePayload) GetOptions() *map[string]string { - if o == nil || IsNil(o.Options) { - var ret *map[string]string - return ret - } - - return o.Options +func (o *CreateInstancePayload) GetOptions() (ret CreateInstancePayloadGetOptionsRetType) { + ret, _ = o.GetOptionsOk() + return ret } // GetOptionsOk returns a tuple with the Options field value // and a boolean to check if the value has been set. -func (o *CreateInstancePayload) GetOptionsOk() (*map[string]string, bool) { - if o == nil { - return nil, false - } - return o.Options, true +func (o *CreateInstancePayload) GetOptionsOk() (ret CreateInstancePayloadGetOptionsRetType, ok bool) { + return getCreateInstancePayloadGetOptionsAttributeTypeOk(o.Options) } // SetOptions sets field value -func (o *CreateInstancePayload) SetOptions(v *map[string]string) { - o.Options = v +func (o *CreateInstancePayload) SetOptions(v CreateInstancePayloadGetOptionsRetType) { + setCreateInstancePayloadGetOptionsAttributeType(&o.Options, v) } // GetReplicas returns the Replicas field value -func (o *CreateInstancePayload) GetReplicas() *int64 { - if o == nil || IsNil(o.Replicas) { - var ret *int64 - return ret - } - - return o.Replicas +func (o *CreateInstancePayload) GetReplicas() (ret CreateInstancePayloadGetReplicasRetType) { + ret, _ = o.GetReplicasOk() + return ret } // GetReplicasOk returns a tuple with the Replicas field value // and a boolean to check if the value has been set. -func (o *CreateInstancePayload) GetReplicasOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Replicas, true +func (o *CreateInstancePayload) GetReplicasOk() (ret CreateInstancePayloadGetReplicasRetType, ok bool) { + return getCreateInstancePayloadGetReplicasAttributeTypeOk(o.Replicas) } // SetReplicas sets field value -func (o *CreateInstancePayload) SetReplicas(v *int64) { - o.Replicas = v +func (o *CreateInstancePayload) SetReplicas(v CreateInstancePayloadGetReplicasRetType) { + setCreateInstancePayloadGetReplicasAttributeType(&o.Replicas, v) } // GetStorage returns the Storage field value -func (o *CreateInstancePayload) GetStorage() *Storage { - if o == nil || IsNil(o.Storage) { - var ret *Storage - return ret - } - - return o.Storage +func (o *CreateInstancePayload) GetStorage() (ret CreateInstancePayloadGetStorageRetType) { + ret, _ = o.GetStorageOk() + return ret } // GetStorageOk returns a tuple with the Storage field value // and a boolean to check if the value has been set. -func (o *CreateInstancePayload) GetStorageOk() (*Storage, bool) { - if o == nil { - return nil, false - } - return o.Storage, true +func (o *CreateInstancePayload) GetStorageOk() (ret CreateInstancePayloadGetStorageRetType, ok bool) { + return getCreateInstancePayloadGetStorageAttributeTypeOk(o.Storage) } // SetStorage sets field value -func (o *CreateInstancePayload) SetStorage(v *Storage) { - o.Storage = v +func (o *CreateInstancePayload) SetStorage(v CreateInstancePayloadGetStorageRetType) { + setCreateInstancePayloadGetStorageAttributeType(&o.Storage, v) } // GetVersion returns the Version field value -func (o *CreateInstancePayload) GetVersion() *string { - if o == nil || IsNil(o.Version) { - var ret *string - return ret - } - - return o.Version +func (o *CreateInstancePayload) GetVersion() (ret CreateInstancePayloadGetVersionRetType) { + ret, _ = o.GetVersionOk() + return ret } // GetVersionOk returns a tuple with the Version field value // and a boolean to check if the value has been set. -func (o *CreateInstancePayload) GetVersionOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Version, true +func (o *CreateInstancePayload) GetVersionOk() (ret CreateInstancePayloadGetVersionRetType, ok bool) { + return getCreateInstancePayloadGetVersionAttributeTypeOk(o.Version) } // SetVersion sets field value -func (o *CreateInstancePayload) SetVersion(v *string) { - o.Version = v +func (o *CreateInstancePayload) SetVersion(v CreateInstancePayloadGetVersionRetType) { + setCreateInstancePayloadGetVersionAttributeType(&o.Version, v) } func (o CreateInstancePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["acl"] = o.Acl - toSerialize["backupSchedule"] = o.BackupSchedule - toSerialize["flavorId"] = o.FlavorId - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getCreateInstancePayloadGetAclAttributeTypeOk(o.Acl); ok { + toSerialize["Acl"] = val + } + if val, ok := getCreateInstancePayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule); ok { + toSerialize["BackupSchedule"] = val + } + if val, ok := getCreateInstancePayloadGetFlavorIdAttributeTypeOk(o.FlavorId); ok { + toSerialize["FlavorId"] = val + } + if val, ok := getCreateInstancePayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getCreateInstancePayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getCreateInstancePayloadGetOptionsAttributeTypeOk(o.Options); ok { + toSerialize["Options"] = val + } + if val, ok := getCreateInstancePayloadGetReplicasAttributeTypeOk(o.Replicas); ok { + toSerialize["Replicas"] = val + } + if val, ok := getCreateInstancePayloadGetStorageAttributeTypeOk(o.Storage); ok { + toSerialize["Storage"] = val + } + if val, ok := getCreateInstancePayloadGetVersionAttributeTypeOk(o.Version); ok { + toSerialize["Version"] = val } - toSerialize["name"] = o.Name - toSerialize["options"] = o.Options - toSerialize["replicas"] = o.Replicas - toSerialize["storage"] = o.Storage - toSerialize["version"] = o.Version return toSerialize, nil } diff --git a/services/postgresflex/model_create_instance_response.go b/services/postgresflex/model_create_instance_response.go index fdb6fc851..394c6fdef 100644 --- a/services/postgresflex/model_create_instance_response.go +++ b/services/postgresflex/model_create_instance_response.go @@ -17,9 +17,30 @@ import ( // checks if the CreateInstanceResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateInstanceResponse{} +/* + types and functions for id +*/ + +// isNotNullableString +type CreateInstanceResponseGetIdAttributeType = *string + +func getCreateInstanceResponseGetIdAttributeTypeOk(arg CreateInstanceResponseGetIdAttributeType) (ret CreateInstanceResponseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateInstanceResponseGetIdAttributeType(arg *CreateInstanceResponseGetIdAttributeType, val CreateInstanceResponseGetIdRetType) { + *arg = &val +} + +type CreateInstanceResponseGetIdArgType = string +type CreateInstanceResponseGetIdRetType = string + // CreateInstanceResponse struct for CreateInstanceResponse type CreateInstanceResponse struct { - Id *string `json:"id,omitempty"` + Id CreateInstanceResponseGetIdAttributeType `json:"id,omitempty"` } // NewCreateInstanceResponse instantiates a new CreateInstanceResponse object @@ -40,41 +61,32 @@ func NewCreateInstanceResponseWithDefaults() *CreateInstanceResponse { } // GetId returns the Id field value if set, zero value otherwise. -func (o *CreateInstanceResponse) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *CreateInstanceResponse) GetId() (res CreateInstanceResponseGetIdRetType) { + res, _ = o.GetIdOk() + return } // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateInstanceResponse) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *CreateInstanceResponse) GetIdOk() (ret CreateInstanceResponseGetIdRetType, ok bool) { + return getCreateInstanceResponseGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *CreateInstanceResponse) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false + _, ok := o.GetIdOk() + return ok } // SetId gets a reference to the given string and assigns it to the Id field. -func (o *CreateInstanceResponse) SetId(v *string) { - o.Id = v +func (o *CreateInstanceResponse) SetId(v CreateInstanceResponseGetIdRetType) { + setCreateInstanceResponseGetIdAttributeType(&o.Id, v) } func (o CreateInstanceResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getCreateInstanceResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_create_user_payload.go b/services/postgresflex/model_create_user_payload.go index a5078f0d9..6ea341a80 100644 --- a/services/postgresflex/model_create_user_payload.go +++ b/services/postgresflex/model_create_user_payload.go @@ -17,10 +17,51 @@ import ( // checks if the CreateUserPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateUserPayload{} +/* + types and functions for roles +*/ + +// isArray +type CreateUserPayloadGetRolesAttributeType = *[]string +type CreateUserPayloadGetRolesArgType = []string +type CreateUserPayloadGetRolesRetType = []string + +func getCreateUserPayloadGetRolesAttributeTypeOk(arg CreateUserPayloadGetRolesAttributeType) (ret CreateUserPayloadGetRolesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateUserPayloadGetRolesAttributeType(arg *CreateUserPayloadGetRolesAttributeType, val CreateUserPayloadGetRolesRetType) { + *arg = &val +} + +/* + types and functions for username +*/ + +// isNotNullableString +type CreateUserPayloadGetUsernameAttributeType = *string + +func getCreateUserPayloadGetUsernameAttributeTypeOk(arg CreateUserPayloadGetUsernameAttributeType) (ret CreateUserPayloadGetUsernameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateUserPayloadGetUsernameAttributeType(arg *CreateUserPayloadGetUsernameAttributeType, val CreateUserPayloadGetUsernameRetType) { + *arg = &val +} + +type CreateUserPayloadGetUsernameArgType = string +type CreateUserPayloadGetUsernameRetType = string + // CreateUserPayload struct for CreateUserPayload type CreateUserPayload struct { - Roles *[]string `json:"roles,omitempty"` - Username *string `json:"username,omitempty"` + Roles CreateUserPayloadGetRolesAttributeType `json:"roles,omitempty"` + Username CreateUserPayloadGetUsernameAttributeType `json:"username,omitempty"` } // NewCreateUserPayload instantiates a new CreateUserPayload object @@ -41,76 +82,58 @@ func NewCreateUserPayloadWithDefaults() *CreateUserPayload { } // GetRoles returns the Roles field value if set, zero value otherwise. -func (o *CreateUserPayload) GetRoles() *[]string { - if o == nil || IsNil(o.Roles) { - var ret *[]string - return ret - } - return o.Roles +func (o *CreateUserPayload) GetRoles() (res CreateUserPayloadGetRolesRetType) { + res, _ = o.GetRolesOk() + return } // 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 *CreateUserPayload) GetRolesOk() (*[]string, bool) { - if o == nil || IsNil(o.Roles) { - return nil, false - } - return o.Roles, true +func (o *CreateUserPayload) GetRolesOk() (ret CreateUserPayloadGetRolesRetType, ok bool) { + return getCreateUserPayloadGetRolesAttributeTypeOk(o.Roles) } // HasRoles returns a boolean if a field has been set. func (o *CreateUserPayload) HasRoles() bool { - if o != nil && !IsNil(o.Roles) { - return true - } - - return false + _, ok := o.GetRolesOk() + return ok } // SetRoles gets a reference to the given []string and assigns it to the Roles field. -func (o *CreateUserPayload) SetRoles(v *[]string) { - o.Roles = v +func (o *CreateUserPayload) SetRoles(v CreateUserPayloadGetRolesRetType) { + setCreateUserPayloadGetRolesAttributeType(&o.Roles, v) } // GetUsername returns the Username field value if set, zero value otherwise. -func (o *CreateUserPayload) GetUsername() *string { - if o == nil || IsNil(o.Username) { - var ret *string - return ret - } - return o.Username +func (o *CreateUserPayload) GetUsername() (res CreateUserPayloadGetUsernameRetType) { + res, _ = o.GetUsernameOk() + return } // GetUsernameOk returns a tuple with the Username field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateUserPayload) GetUsernameOk() (*string, bool) { - if o == nil || IsNil(o.Username) { - return nil, false - } - return o.Username, true +func (o *CreateUserPayload) GetUsernameOk() (ret CreateUserPayloadGetUsernameRetType, ok bool) { + return getCreateUserPayloadGetUsernameAttributeTypeOk(o.Username) } // HasUsername returns a boolean if a field has been set. func (o *CreateUserPayload) HasUsername() bool { - if o != nil && !IsNil(o.Username) { - return true - } - - return false + _, ok := o.GetUsernameOk() + return ok } // SetUsername gets a reference to the given string and assigns it to the Username field. -func (o *CreateUserPayload) SetUsername(v *string) { - o.Username = v +func (o *CreateUserPayload) SetUsername(v CreateUserPayloadGetUsernameRetType) { + setCreateUserPayloadGetUsernameAttributeType(&o.Username, v) } func (o CreateUserPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Roles) { - toSerialize["roles"] = o.Roles + if val, ok := getCreateUserPayloadGetRolesAttributeTypeOk(o.Roles); ok { + toSerialize["Roles"] = val } - if !IsNil(o.Username) { - toSerialize["username"] = o.Username + if val, ok := getCreateUserPayloadGetUsernameAttributeTypeOk(o.Username); ok { + toSerialize["Username"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_create_user_response.go b/services/postgresflex/model_create_user_response.go index fb4abd057..6ebc16caf 100644 --- a/services/postgresflex/model_create_user_response.go +++ b/services/postgresflex/model_create_user_response.go @@ -17,9 +17,29 @@ import ( // checks if the CreateUserResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateUserResponse{} +/* + types and functions for item +*/ + +// isModel +type CreateUserResponseGetItemAttributeType = *User +type CreateUserResponseGetItemArgType = User +type CreateUserResponseGetItemRetType = User + +func getCreateUserResponseGetItemAttributeTypeOk(arg CreateUserResponseGetItemAttributeType) (ret CreateUserResponseGetItemRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateUserResponseGetItemAttributeType(arg *CreateUserResponseGetItemAttributeType, val CreateUserResponseGetItemRetType) { + *arg = &val +} + // CreateUserResponse struct for CreateUserResponse type CreateUserResponse struct { - Item *User `json:"item,omitempty"` + Item CreateUserResponseGetItemAttributeType `json:"item,omitempty"` } // NewCreateUserResponse instantiates a new CreateUserResponse object @@ -40,41 +60,32 @@ func NewCreateUserResponseWithDefaults() *CreateUserResponse { } // GetItem returns the Item field value if set, zero value otherwise. -func (o *CreateUserResponse) GetItem() *User { - if o == nil || IsNil(o.Item) { - var ret *User - return ret - } - return o.Item +func (o *CreateUserResponse) GetItem() (res CreateUserResponseGetItemRetType) { + res, _ = o.GetItemOk() + return } // GetItemOk returns a tuple with the Item field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateUserResponse) GetItemOk() (*User, bool) { - if o == nil || IsNil(o.Item) { - return nil, false - } - return o.Item, true +func (o *CreateUserResponse) GetItemOk() (ret CreateUserResponseGetItemRetType, ok bool) { + return getCreateUserResponseGetItemAttributeTypeOk(o.Item) } // HasItem returns a boolean if a field has been set. func (o *CreateUserResponse) HasItem() bool { - if o != nil && !IsNil(o.Item) { - return true - } - - return false + _, ok := o.GetItemOk() + return ok } // SetItem gets a reference to the given User and assigns it to the Item field. -func (o *CreateUserResponse) SetItem(v *User) { - o.Item = v +func (o *CreateUserResponse) SetItem(v CreateUserResponseGetItemRetType) { + setCreateUserResponseGetItemAttributeType(&o.Item, v) } func (o CreateUserResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Item) { - toSerialize["item"] = o.Item + if val, ok := getCreateUserResponseGetItemAttributeTypeOk(o.Item); ok { + toSerialize["Item"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_error.go b/services/postgresflex/model_error.go index dd63e06d4..bb495a843 100644 --- a/services/postgresflex/model_error.go +++ b/services/postgresflex/model_error.go @@ -17,13 +17,95 @@ import ( // checks if the Error type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Error{} +/* + types and functions for code +*/ + +// isInteger +type ErrorGetCodeAttributeType = *int64 +type ErrorGetCodeArgType = int64 +type ErrorGetCodeRetType = int64 + +func getErrorGetCodeAttributeTypeOk(arg ErrorGetCodeAttributeType) (ret ErrorGetCodeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setErrorGetCodeAttributeType(arg *ErrorGetCodeAttributeType, val ErrorGetCodeRetType) { + *arg = &val +} + +/* + types and functions for fields +*/ + +// isContainer +type ErrorGetFieldsAttributeType = *map[string][]string +type ErrorGetFieldsArgType = map[string][]string +type ErrorGetFieldsRetType = map[string][]string + +func getErrorGetFieldsAttributeTypeOk(arg ErrorGetFieldsAttributeType) (ret ErrorGetFieldsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setErrorGetFieldsAttributeType(arg *ErrorGetFieldsAttributeType, val ErrorGetFieldsRetType) { + *arg = &val +} + +/* + types and functions for message +*/ + +// isNotNullableString +type ErrorGetMessageAttributeType = *string + +func getErrorGetMessageAttributeTypeOk(arg ErrorGetMessageAttributeType) (ret ErrorGetMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setErrorGetMessageAttributeType(arg *ErrorGetMessageAttributeType, val ErrorGetMessageRetType) { + *arg = &val +} + +type ErrorGetMessageArgType = string +type ErrorGetMessageRetType = string + +/* + types and functions for type +*/ + +// isNotNullableString +type ErrorGetTypeAttributeType = *string + +func getErrorGetTypeAttributeTypeOk(arg ErrorGetTypeAttributeType) (ret ErrorGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setErrorGetTypeAttributeType(arg *ErrorGetTypeAttributeType, val ErrorGetTypeRetType) { + *arg = &val +} + +type ErrorGetTypeArgType = string +type ErrorGetTypeRetType = string + // 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"` - Type *string `json:"type,omitempty"` + Code ErrorGetCodeAttributeType `json:"code,omitempty"` + Fields ErrorGetFieldsAttributeType `json:"fields,omitempty"` + Message ErrorGetMessageAttributeType `json:"message,omitempty"` + Type ErrorGetTypeAttributeType `json:"type,omitempty"` } // NewError instantiates a new Error object @@ -44,146 +126,110 @@ func NewErrorWithDefaults() *Error { } // GetCode returns the Code field value if set, zero value otherwise. -func (o *Error) GetCode() *int64 { - if o == nil || IsNil(o.Code) { - var ret *int64 - return ret - } - return o.Code +func (o *Error) GetCode() (res ErrorGetCodeRetType) { + res, _ = o.GetCodeOk() + return } // GetCodeOk returns a tuple with the Code field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Error) GetCodeOk() (*int64, bool) { - if o == nil || IsNil(o.Code) { - return nil, false - } - return o.Code, true +func (o *Error) GetCodeOk() (ret ErrorGetCodeRetType, ok bool) { + return getErrorGetCodeAttributeTypeOk(o.Code) } // HasCode returns a boolean if a field has been set. func (o *Error) HasCode() bool { - if o != nil && !IsNil(o.Code) { - return true - } - - return false + _, ok := o.GetCodeOk() + return ok } // SetCode gets a reference to the given int64 and assigns it to the Code field. -func (o *Error) SetCode(v *int64) { - o.Code = v +func (o *Error) SetCode(v ErrorGetCodeRetType) { + setErrorGetCodeAttributeType(&o.Code, v) } // GetFields returns the Fields field value if set, zero value otherwise. -func (o *Error) GetFields() *map[string][]string { - if o == nil || IsNil(o.Fields) { - var ret *map[string][]string - return ret - } - return o.Fields +func (o *Error) GetFields() (res ErrorGetFieldsRetType) { + res, _ = o.GetFieldsOk() + return } // GetFieldsOk returns a tuple with the Fields field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Error) GetFieldsOk() (*map[string][]string, bool) { - if o == nil || IsNil(o.Fields) { - return nil, false - } - return o.Fields, true +func (o *Error) GetFieldsOk() (ret ErrorGetFieldsRetType, ok bool) { + return getErrorGetFieldsAttributeTypeOk(o.Fields) } // HasFields returns a boolean if a field has been set. func (o *Error) HasFields() bool { - if o != nil && !IsNil(o.Fields) { - return true - } - - return false + _, ok := o.GetFieldsOk() + return ok } // SetFields gets a reference to the given map[string][]string and assigns it to the Fields field. -func (o *Error) SetFields(v *map[string][]string) { - o.Fields = v +func (o *Error) SetFields(v ErrorGetFieldsRetType) { + setErrorGetFieldsAttributeType(&o.Fields, v) } // GetMessage returns the Message field value if set, zero value otherwise. -func (o *Error) GetMessage() *string { - if o == nil || IsNil(o.Message) { - var ret *string - return ret - } - return o.Message +func (o *Error) GetMessage() (res ErrorGetMessageRetType) { + res, _ = o.GetMessageOk() + return } // GetMessageOk returns a tuple with the Message field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Error) GetMessageOk() (*string, bool) { - if o == nil || IsNil(o.Message) { - return nil, false - } - return o.Message, true +func (o *Error) GetMessageOk() (ret ErrorGetMessageRetType, ok bool) { + return getErrorGetMessageAttributeTypeOk(o.Message) } // HasMessage returns a boolean if a field has been set. func (o *Error) HasMessage() bool { - if o != nil && !IsNil(o.Message) { - return true - } - - return false + _, ok := o.GetMessageOk() + return ok } // SetMessage gets a reference to the given string and assigns it to the Message field. -func (o *Error) SetMessage(v *string) { - o.Message = v +func (o *Error) SetMessage(v ErrorGetMessageRetType) { + setErrorGetMessageAttributeType(&o.Message, v) } // GetType returns the Type field value if set, zero value otherwise. -func (o *Error) GetType() *string { - if o == nil || IsNil(o.Type) { - var ret *string - return ret - } - return o.Type +func (o *Error) GetType() (res ErrorGetTypeRetType) { + res, _ = o.GetTypeOk() + return } // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Error) GetTypeOk() (*string, bool) { - if o == nil || IsNil(o.Type) { - return nil, false - } - return o.Type, true +func (o *Error) GetTypeOk() (ret ErrorGetTypeRetType, ok bool) { + return getErrorGetTypeAttributeTypeOk(o.Type) } // HasType returns a boolean if a field has been set. func (o *Error) HasType() bool { - if o != nil && !IsNil(o.Type) { - return true - } - - return false + _, ok := o.GetTypeOk() + return ok } // SetType gets a reference to the given string and assigns it to the Type field. -func (o *Error) SetType(v *string) { - o.Type = v +func (o *Error) SetType(v ErrorGetTypeRetType) { + setErrorGetTypeAttributeType(&o.Type, v) } func (o Error) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Code) { - toSerialize["code"] = o.Code + if val, ok := getErrorGetCodeAttributeTypeOk(o.Code); ok { + toSerialize["Code"] = val } - if !IsNil(o.Fields) { - toSerialize["fields"] = o.Fields + if val, ok := getErrorGetFieldsAttributeTypeOk(o.Fields); ok { + toSerialize["Fields"] = val } - if !IsNil(o.Message) { - toSerialize["message"] = o.Message + if val, ok := getErrorGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val } - if !IsNil(o.Type) { - toSerialize["type"] = o.Type + if val, ok := getErrorGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_extensions_configuration.go b/services/postgresflex/model_extensions_configuration.go index 7793def14..bfc83e699 100644 --- a/services/postgresflex/model_extensions_configuration.go +++ b/services/postgresflex/model_extensions_configuration.go @@ -17,10 +17,52 @@ import ( // checks if the ExtensionsConfiguration type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ExtensionsConfiguration{} +/* + types and functions for name +*/ + +// isNotNullableString +type ExtensionsConfigurationGetNameAttributeType = *string + +func getExtensionsConfigurationGetNameAttributeTypeOk(arg ExtensionsConfigurationGetNameAttributeType) (ret ExtensionsConfigurationGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setExtensionsConfigurationGetNameAttributeType(arg *ExtensionsConfigurationGetNameAttributeType, val ExtensionsConfigurationGetNameRetType) { + *arg = &val +} + +type ExtensionsConfigurationGetNameArgType = string +type ExtensionsConfigurationGetNameRetType = string + +/* + types and functions for setting +*/ + +// isNotNullableString +type ExtensionsConfigurationGetSettingAttributeType = *string + +func getExtensionsConfigurationGetSettingAttributeTypeOk(arg ExtensionsConfigurationGetSettingAttributeType) (ret ExtensionsConfigurationGetSettingRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setExtensionsConfigurationGetSettingAttributeType(arg *ExtensionsConfigurationGetSettingAttributeType, val ExtensionsConfigurationGetSettingRetType) { + *arg = &val +} + +type ExtensionsConfigurationGetSettingArgType = string +type ExtensionsConfigurationGetSettingRetType = string + // ExtensionsConfiguration struct for ExtensionsConfiguration type ExtensionsConfiguration struct { - Name *string `json:"name,omitempty"` - Setting *string `json:"setting,omitempty"` + Name ExtensionsConfigurationGetNameAttributeType `json:"name,omitempty"` + Setting ExtensionsConfigurationGetSettingAttributeType `json:"setting,omitempty"` } // NewExtensionsConfiguration instantiates a new ExtensionsConfiguration object @@ -41,76 +83,58 @@ func NewExtensionsConfigurationWithDefaults() *ExtensionsConfiguration { } // GetName returns the Name field value if set, zero value otherwise. -func (o *ExtensionsConfiguration) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *ExtensionsConfiguration) GetName() (res ExtensionsConfigurationGetNameRetType) { + res, _ = o.GetNameOk() + return } // 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 *ExtensionsConfiguration) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *ExtensionsConfiguration) GetNameOk() (ret ExtensionsConfigurationGetNameRetType, ok bool) { + return getExtensionsConfigurationGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *ExtensionsConfiguration) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false + _, ok := o.GetNameOk() + return ok } // SetName gets a reference to the given string and assigns it to the Name field. -func (o *ExtensionsConfiguration) SetName(v *string) { - o.Name = v +func (o *ExtensionsConfiguration) SetName(v ExtensionsConfigurationGetNameRetType) { + setExtensionsConfigurationGetNameAttributeType(&o.Name, v) } // GetSetting returns the Setting field value if set, zero value otherwise. -func (o *ExtensionsConfiguration) GetSetting() *string { - if o == nil || IsNil(o.Setting) { - var ret *string - return ret - } - return o.Setting +func (o *ExtensionsConfiguration) GetSetting() (res ExtensionsConfigurationGetSettingRetType) { + res, _ = o.GetSettingOk() + return } // GetSettingOk returns a tuple with the Setting field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ExtensionsConfiguration) GetSettingOk() (*string, bool) { - if o == nil || IsNil(o.Setting) { - return nil, false - } - return o.Setting, true +func (o *ExtensionsConfiguration) GetSettingOk() (ret ExtensionsConfigurationGetSettingRetType, ok bool) { + return getExtensionsConfigurationGetSettingAttributeTypeOk(o.Setting) } // HasSetting returns a boolean if a field has been set. func (o *ExtensionsConfiguration) HasSetting() bool { - if o != nil && !IsNil(o.Setting) { - return true - } - - return false + _, ok := o.GetSettingOk() + return ok } // SetSetting gets a reference to the given string and assigns it to the Setting field. -func (o *ExtensionsConfiguration) SetSetting(v *string) { - o.Setting = v +func (o *ExtensionsConfiguration) SetSetting(v ExtensionsConfigurationGetSettingRetType) { + setExtensionsConfigurationGetSettingAttributeType(&o.Setting, v) } func (o ExtensionsConfiguration) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getExtensionsConfigurationGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Setting) { - toSerialize["setting"] = o.Setting + if val, ok := getExtensionsConfigurationGetSettingAttributeTypeOk(o.Setting); ok { + toSerialize["Setting"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_extensions_extension_list_response.go b/services/postgresflex/model_extensions_extension_list_response.go index 4c5d71b2f..0d94be2c3 100644 --- a/services/postgresflex/model_extensions_extension_list_response.go +++ b/services/postgresflex/model_extensions_extension_list_response.go @@ -17,9 +17,29 @@ import ( // checks if the ExtensionsExtensionListResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ExtensionsExtensionListResponse{} +/* + types and functions for list +*/ + +// isArray +type ExtensionsExtensionListResponseGetListAttributeType = *[]ApiExtensionList +type ExtensionsExtensionListResponseGetListArgType = []ApiExtensionList +type ExtensionsExtensionListResponseGetListRetType = []ApiExtensionList + +func getExtensionsExtensionListResponseGetListAttributeTypeOk(arg ExtensionsExtensionListResponseGetListAttributeType) (ret ExtensionsExtensionListResponseGetListRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setExtensionsExtensionListResponseGetListAttributeType(arg *ExtensionsExtensionListResponseGetListAttributeType, val ExtensionsExtensionListResponseGetListRetType) { + *arg = &val +} + // ExtensionsExtensionListResponse struct for ExtensionsExtensionListResponse type ExtensionsExtensionListResponse struct { - List *[]ApiExtensionList `json:"list,omitempty"` + List ExtensionsExtensionListResponseGetListAttributeType `json:"list,omitempty"` } // NewExtensionsExtensionListResponse instantiates a new ExtensionsExtensionListResponse object @@ -40,41 +60,32 @@ func NewExtensionsExtensionListResponseWithDefaults() *ExtensionsExtensionListRe } // GetList returns the List field value if set, zero value otherwise. -func (o *ExtensionsExtensionListResponse) GetList() *[]ApiExtensionList { - if o == nil || IsNil(o.List) { - var ret *[]ApiExtensionList - return ret - } - return o.List +func (o *ExtensionsExtensionListResponse) GetList() (res ExtensionsExtensionListResponseGetListRetType) { + res, _ = o.GetListOk() + return } // GetListOk returns a tuple with the List field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ExtensionsExtensionListResponse) GetListOk() (*[]ApiExtensionList, bool) { - if o == nil || IsNil(o.List) { - return nil, false - } - return o.List, true +func (o *ExtensionsExtensionListResponse) GetListOk() (ret ExtensionsExtensionListResponseGetListRetType, ok bool) { + return getExtensionsExtensionListResponseGetListAttributeTypeOk(o.List) } // HasList returns a boolean if a field has been set. func (o *ExtensionsExtensionListResponse) HasList() bool { - if o != nil && !IsNil(o.List) { - return true - } - - return false + _, ok := o.GetListOk() + return ok } // SetList gets a reference to the given []ApiExtensionList and assigns it to the List field. -func (o *ExtensionsExtensionListResponse) SetList(v *[]ApiExtensionList) { - o.List = v +func (o *ExtensionsExtensionListResponse) SetList(v ExtensionsExtensionListResponseGetListRetType) { + setExtensionsExtensionListResponseGetListAttributeType(&o.List, v) } func (o ExtensionsExtensionListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.List) { - toSerialize["list"] = o.List + if val, ok := getExtensionsExtensionListResponseGetListAttributeTypeOk(o.List); ok { + toSerialize["List"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_extensions_new_config.go b/services/postgresflex/model_extensions_new_config.go index 050607d0a..0f400ef5c 100644 --- a/services/postgresflex/model_extensions_new_config.go +++ b/services/postgresflex/model_extensions_new_config.go @@ -17,9 +17,29 @@ import ( // checks if the ExtensionsNewConfig type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ExtensionsNewConfig{} +/* + types and functions for configuration +*/ + +// isArray +type ExtensionsNewConfigGetConfigurationAttributeType = *[]ExtensionsConfiguration +type ExtensionsNewConfigGetConfigurationArgType = []ExtensionsConfiguration +type ExtensionsNewConfigGetConfigurationRetType = []ExtensionsConfiguration + +func getExtensionsNewConfigGetConfigurationAttributeTypeOk(arg ExtensionsNewConfigGetConfigurationAttributeType) (ret ExtensionsNewConfigGetConfigurationRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setExtensionsNewConfigGetConfigurationAttributeType(arg *ExtensionsNewConfigGetConfigurationAttributeType, val ExtensionsNewConfigGetConfigurationRetType) { + *arg = &val +} + // ExtensionsNewConfig struct for ExtensionsNewConfig type ExtensionsNewConfig struct { - Configuration *[]ExtensionsConfiguration `json:"configuration,omitempty"` + Configuration ExtensionsNewConfigGetConfigurationAttributeType `json:"configuration,omitempty"` } // NewExtensionsNewConfig instantiates a new ExtensionsNewConfig object @@ -40,41 +60,32 @@ func NewExtensionsNewConfigWithDefaults() *ExtensionsNewConfig { } // GetConfiguration returns the Configuration field value if set, zero value otherwise. -func (o *ExtensionsNewConfig) GetConfiguration() *[]ExtensionsConfiguration { - if o == nil || IsNil(o.Configuration) { - var ret *[]ExtensionsConfiguration - return ret - } - return o.Configuration +func (o *ExtensionsNewConfig) GetConfiguration() (res ExtensionsNewConfigGetConfigurationRetType) { + res, _ = o.GetConfigurationOk() + return } // GetConfigurationOk returns a tuple with the Configuration field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ExtensionsNewConfig) GetConfigurationOk() (*[]ExtensionsConfiguration, bool) { - if o == nil || IsNil(o.Configuration) { - return nil, false - } - return o.Configuration, true +func (o *ExtensionsNewConfig) GetConfigurationOk() (ret ExtensionsNewConfigGetConfigurationRetType, ok bool) { + return getExtensionsNewConfigGetConfigurationAttributeTypeOk(o.Configuration) } // HasConfiguration returns a boolean if a field has been set. func (o *ExtensionsNewConfig) HasConfiguration() bool { - if o != nil && !IsNil(o.Configuration) { - return true - } - - return false + _, ok := o.GetConfigurationOk() + return ok } // SetConfiguration gets a reference to the given []ExtensionsConfiguration and assigns it to the Configuration field. -func (o *ExtensionsNewConfig) SetConfiguration(v *[]ExtensionsConfiguration) { - o.Configuration = v +func (o *ExtensionsNewConfig) SetConfiguration(v ExtensionsNewConfigGetConfigurationRetType) { + setExtensionsNewConfigGetConfigurationAttributeType(&o.Configuration, v) } func (o ExtensionsNewConfig) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Configuration) { - toSerialize["configuration"] = o.Configuration + if val, ok := getExtensionsNewConfigGetConfigurationAttributeTypeOk(o.Configuration); ok { + toSerialize["Configuration"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_flavor.go b/services/postgresflex/model_flavor.go index 346a68058..fb7431a11 100644 --- a/services/postgresflex/model_flavor.go +++ b/services/postgresflex/model_flavor.go @@ -17,12 +17,94 @@ import ( // checks if the Flavor type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Flavor{} +/* + types and functions for cpu +*/ + +// isLong +type FlavorGetCpuAttributeType = *int64 +type FlavorGetCpuArgType = int64 +type FlavorGetCpuRetType = int64 + +func getFlavorGetCpuAttributeTypeOk(arg FlavorGetCpuAttributeType) (ret FlavorGetCpuRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setFlavorGetCpuAttributeType(arg *FlavorGetCpuAttributeType, val FlavorGetCpuRetType) { + *arg = &val +} + +/* + types and functions for description +*/ + +// isNotNullableString +type FlavorGetDescriptionAttributeType = *string + +func getFlavorGetDescriptionAttributeTypeOk(arg FlavorGetDescriptionAttributeType) (ret FlavorGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setFlavorGetDescriptionAttributeType(arg *FlavorGetDescriptionAttributeType, val FlavorGetDescriptionRetType) { + *arg = &val +} + +type FlavorGetDescriptionArgType = string +type FlavorGetDescriptionRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type FlavorGetIdAttributeType = *string + +func getFlavorGetIdAttributeTypeOk(arg FlavorGetIdAttributeType) (ret FlavorGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setFlavorGetIdAttributeType(arg *FlavorGetIdAttributeType, val FlavorGetIdRetType) { + *arg = &val +} + +type FlavorGetIdArgType = string +type FlavorGetIdRetType = string + +/* + types and functions for memory +*/ + +// isLong +type FlavorGetMemoryAttributeType = *int64 +type FlavorGetMemoryArgType = int64 +type FlavorGetMemoryRetType = int64 + +func getFlavorGetMemoryAttributeTypeOk(arg FlavorGetMemoryAttributeType) (ret FlavorGetMemoryRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setFlavorGetMemoryAttributeType(arg *FlavorGetMemoryAttributeType, val FlavorGetMemoryRetType) { + *arg = &val +} + // Flavor struct for Flavor type Flavor struct { - Cpu *int64 `json:"cpu,omitempty"` - Description *string `json:"description,omitempty"` - Id *string `json:"id,omitempty"` - Memory *int64 `json:"memory,omitempty"` + Cpu FlavorGetCpuAttributeType `json:"cpu,omitempty"` + Description FlavorGetDescriptionAttributeType `json:"description,omitempty"` + Id FlavorGetIdAttributeType `json:"id,omitempty"` + Memory FlavorGetMemoryAttributeType `json:"memory,omitempty"` } // NewFlavor instantiates a new Flavor object @@ -43,146 +125,110 @@ func NewFlavorWithDefaults() *Flavor { } // GetCpu returns the Cpu field value if set, zero value otherwise. -func (o *Flavor) GetCpu() *int64 { - if o == nil || IsNil(o.Cpu) { - var ret *int64 - return ret - } - return o.Cpu +func (o *Flavor) GetCpu() (res FlavorGetCpuRetType) { + res, _ = o.GetCpuOk() + return } // GetCpuOk returns a tuple with the Cpu field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Flavor) GetCpuOk() (*int64, bool) { - if o == nil || IsNil(o.Cpu) { - return nil, false - } - return o.Cpu, true +func (o *Flavor) GetCpuOk() (ret FlavorGetCpuRetType, ok bool) { + return getFlavorGetCpuAttributeTypeOk(o.Cpu) } // HasCpu returns a boolean if a field has been set. func (o *Flavor) HasCpu() bool { - if o != nil && !IsNil(o.Cpu) { - return true - } - - return false + _, ok := o.GetCpuOk() + return ok } // SetCpu gets a reference to the given int64 and assigns it to the Cpu field. -func (o *Flavor) SetCpu(v *int64) { - o.Cpu = v +func (o *Flavor) SetCpu(v FlavorGetCpuRetType) { + setFlavorGetCpuAttributeType(&o.Cpu, v) } // GetDescription returns the Description field value if set, zero value otherwise. -func (o *Flavor) GetDescription() *string { - if o == nil || IsNil(o.Description) { - var ret *string - return ret - } - return o.Description +func (o *Flavor) GetDescription() (res FlavorGetDescriptionRetType) { + res, _ = o.GetDescriptionOk() + return } // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Flavor) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true +func (o *Flavor) GetDescriptionOk() (ret FlavorGetDescriptionRetType, ok bool) { + return getFlavorGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. func (o *Flavor) HasDescription() bool { - if o != nil && !IsNil(o.Description) { - return true - } - - return false + _, ok := o.GetDescriptionOk() + return ok } // SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *Flavor) SetDescription(v *string) { - o.Description = v +func (o *Flavor) SetDescription(v FlavorGetDescriptionRetType) { + setFlavorGetDescriptionAttributeType(&o.Description, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *Flavor) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *Flavor) GetId() (res FlavorGetIdRetType) { + res, _ = o.GetIdOk() + return } // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Flavor) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *Flavor) GetIdOk() (ret FlavorGetIdRetType, ok bool) { + return getFlavorGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *Flavor) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false + _, ok := o.GetIdOk() + return ok } // SetId gets a reference to the given string and assigns it to the Id field. -func (o *Flavor) SetId(v *string) { - o.Id = v +func (o *Flavor) SetId(v FlavorGetIdRetType) { + setFlavorGetIdAttributeType(&o.Id, v) } // GetMemory returns the Memory field value if set, zero value otherwise. -func (o *Flavor) GetMemory() *int64 { - if o == nil || IsNil(o.Memory) { - var ret *int64 - return ret - } - return o.Memory +func (o *Flavor) GetMemory() (res FlavorGetMemoryRetType) { + res, _ = o.GetMemoryOk() + return } // GetMemoryOk returns a tuple with the Memory field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Flavor) GetMemoryOk() (*int64, bool) { - if o == nil || IsNil(o.Memory) { - return nil, false - } - return o.Memory, true +func (o *Flavor) GetMemoryOk() (ret FlavorGetMemoryRetType, ok bool) { + return getFlavorGetMemoryAttributeTypeOk(o.Memory) } // HasMemory returns a boolean if a field has been set. func (o *Flavor) HasMemory() bool { - if o != nil && !IsNil(o.Memory) { - return true - } - - return false + _, ok := o.GetMemoryOk() + return ok } // SetMemory gets a reference to the given int64 and assigns it to the Memory field. -func (o *Flavor) SetMemory(v *int64) { - o.Memory = v +func (o *Flavor) SetMemory(v FlavorGetMemoryRetType) { + setFlavorGetMemoryAttributeType(&o.Memory, v) } func (o Flavor) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Cpu) { - toSerialize["cpu"] = o.Cpu + if val, ok := getFlavorGetCpuAttributeTypeOk(o.Cpu); ok { + toSerialize["Cpu"] = val } - if !IsNil(o.Description) { - toSerialize["description"] = o.Description + if val, ok := getFlavorGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getFlavorGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.Memory) { - toSerialize["memory"] = o.Memory + if val, ok := getFlavorGetMemoryAttributeTypeOk(o.Memory); ok { + toSerialize["Memory"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_get_backup_response.go b/services/postgresflex/model_get_backup_response.go index 9b714744d..417e7c0b6 100644 --- a/services/postgresflex/model_get_backup_response.go +++ b/services/postgresflex/model_get_backup_response.go @@ -17,9 +17,29 @@ import ( // checks if the GetBackupResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &GetBackupResponse{} +/* + types and functions for item +*/ + +// isModel +type GetBackupResponseGetItemAttributeType = *Backup +type GetBackupResponseGetItemArgType = Backup +type GetBackupResponseGetItemRetType = Backup + +func getGetBackupResponseGetItemAttributeTypeOk(arg GetBackupResponseGetItemAttributeType) (ret GetBackupResponseGetItemRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetBackupResponseGetItemAttributeType(arg *GetBackupResponseGetItemAttributeType, val GetBackupResponseGetItemRetType) { + *arg = &val +} + // GetBackupResponse struct for GetBackupResponse type GetBackupResponse struct { - Item *Backup `json:"item,omitempty"` + Item GetBackupResponseGetItemAttributeType `json:"item,omitempty"` } // NewGetBackupResponse instantiates a new GetBackupResponse object @@ -40,41 +60,32 @@ func NewGetBackupResponseWithDefaults() *GetBackupResponse { } // GetItem returns the Item field value if set, zero value otherwise. -func (o *GetBackupResponse) GetItem() *Backup { - if o == nil || IsNil(o.Item) { - var ret *Backup - return ret - } - return o.Item +func (o *GetBackupResponse) GetItem() (res GetBackupResponseGetItemRetType) { + res, _ = o.GetItemOk() + return } // GetItemOk returns a tuple with the Item field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *GetBackupResponse) GetItemOk() (*Backup, bool) { - if o == nil || IsNil(o.Item) { - return nil, false - } - return o.Item, true +func (o *GetBackupResponse) GetItemOk() (ret GetBackupResponseGetItemRetType, ok bool) { + return getGetBackupResponseGetItemAttributeTypeOk(o.Item) } // HasItem returns a boolean if a field has been set. func (o *GetBackupResponse) HasItem() bool { - if o != nil && !IsNil(o.Item) { - return true - } - - return false + _, ok := o.GetItemOk() + return ok } // SetItem gets a reference to the given Backup and assigns it to the Item field. -func (o *GetBackupResponse) SetItem(v *Backup) { - o.Item = v +func (o *GetBackupResponse) SetItem(v GetBackupResponseGetItemRetType) { + setGetBackupResponseGetItemAttributeType(&o.Item, v) } func (o GetBackupResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Item) { - toSerialize["item"] = o.Item + if val, ok := getGetBackupResponseGetItemAttributeTypeOk(o.Item); ok { + toSerialize["Item"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_get_user_response.go b/services/postgresflex/model_get_user_response.go index 30e5f47a0..9e5070c8f 100644 --- a/services/postgresflex/model_get_user_response.go +++ b/services/postgresflex/model_get_user_response.go @@ -17,9 +17,29 @@ import ( // checks if the GetUserResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &GetUserResponse{} +/* + types and functions for item +*/ + +// isModel +type GetUserResponseGetItemAttributeType = *UserResponse +type GetUserResponseGetItemArgType = UserResponse +type GetUserResponseGetItemRetType = UserResponse + +func getGetUserResponseGetItemAttributeTypeOk(arg GetUserResponseGetItemAttributeType) (ret GetUserResponseGetItemRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetUserResponseGetItemAttributeType(arg *GetUserResponseGetItemAttributeType, val GetUserResponseGetItemRetType) { + *arg = &val +} + // GetUserResponse struct for GetUserResponse type GetUserResponse struct { - Item *UserResponse `json:"item,omitempty"` + Item GetUserResponseGetItemAttributeType `json:"item,omitempty"` } // NewGetUserResponse instantiates a new GetUserResponse object @@ -40,41 +60,32 @@ func NewGetUserResponseWithDefaults() *GetUserResponse { } // GetItem returns the Item field value if set, zero value otherwise. -func (o *GetUserResponse) GetItem() *UserResponse { - if o == nil || IsNil(o.Item) { - var ret *UserResponse - return ret - } - return o.Item +func (o *GetUserResponse) GetItem() (res GetUserResponseGetItemRetType) { + res, _ = o.GetItemOk() + return } // GetItemOk returns a tuple with the Item field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *GetUserResponse) GetItemOk() (*UserResponse, bool) { - if o == nil || IsNil(o.Item) { - return nil, false - } - return o.Item, true +func (o *GetUserResponse) GetItemOk() (ret GetUserResponseGetItemRetType, ok bool) { + return getGetUserResponseGetItemAttributeTypeOk(o.Item) } // HasItem returns a boolean if a field has been set. func (o *GetUserResponse) HasItem() bool { - if o != nil && !IsNil(o.Item) { - return true - } - - return false + _, ok := o.GetItemOk() + return ok } // SetItem gets a reference to the given UserResponse and assigns it to the Item field. -func (o *GetUserResponse) SetItem(v *UserResponse) { - o.Item = v +func (o *GetUserResponse) SetItem(v GetUserResponseGetItemRetType) { + setGetUserResponseGetItemAttributeType(&o.Item, v) } func (o GetUserResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Item) { - toSerialize["item"] = o.Item + if val, ok := getGetUserResponseGetItemAttributeTypeOk(o.Item); ok { + toSerialize["Item"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_instance.go b/services/postgresflex/model_instance.go index b1652cc90..39f6fc57c 100644 --- a/services/postgresflex/model_instance.go +++ b/services/postgresflex/model_instance.go @@ -17,19 +17,224 @@ import ( // checks if the Instance type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Instance{} +/* + types and functions for acl +*/ + +// isModel +type InstanceGetAclAttributeType = *ACL +type InstanceGetAclArgType = ACL +type InstanceGetAclRetType = ACL + +func getInstanceGetAclAttributeTypeOk(arg InstanceGetAclAttributeType) (ret InstanceGetAclRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceGetAclAttributeType(arg *InstanceGetAclAttributeType, val InstanceGetAclRetType) { + *arg = &val +} + +/* + types and functions for backupSchedule +*/ + +// isNotNullableString +type InstanceGetBackupScheduleAttributeType = *string + +func getInstanceGetBackupScheduleAttributeTypeOk(arg InstanceGetBackupScheduleAttributeType) (ret InstanceGetBackupScheduleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceGetBackupScheduleAttributeType(arg *InstanceGetBackupScheduleAttributeType, val InstanceGetBackupScheduleRetType) { + *arg = &val +} + +type InstanceGetBackupScheduleArgType = string +type InstanceGetBackupScheduleRetType = string + +/* + types and functions for flavor +*/ + +// isModel +type InstanceGetFlavorAttributeType = *Flavor +type InstanceGetFlavorArgType = Flavor +type InstanceGetFlavorRetType = Flavor + +func getInstanceGetFlavorAttributeTypeOk(arg InstanceGetFlavorAttributeType) (ret InstanceGetFlavorRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceGetFlavorAttributeType(arg *InstanceGetFlavorAttributeType, val InstanceGetFlavorRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type InstanceGetIdAttributeType = *string + +func getInstanceGetIdAttributeTypeOk(arg InstanceGetIdAttributeType) (ret InstanceGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceGetIdAttributeType(arg *InstanceGetIdAttributeType, val InstanceGetIdRetType) { + *arg = &val +} + +type InstanceGetIdArgType = string +type InstanceGetIdRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +type InstanceGetNameAttributeType = *string + +func getInstanceGetNameAttributeTypeOk(arg InstanceGetNameAttributeType) (ret InstanceGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceGetNameAttributeType(arg *InstanceGetNameAttributeType, val InstanceGetNameRetType) { + *arg = &val +} + +type InstanceGetNameArgType = string +type InstanceGetNameRetType = string + +/* + types and functions for options +*/ + +// isContainer +type InstanceGetOptionsAttributeType = *map[string]string +type InstanceGetOptionsArgType = map[string]string +type InstanceGetOptionsRetType = map[string]string + +func getInstanceGetOptionsAttributeTypeOk(arg InstanceGetOptionsAttributeType) (ret InstanceGetOptionsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceGetOptionsAttributeType(arg *InstanceGetOptionsAttributeType, val InstanceGetOptionsRetType) { + *arg = &val +} + +/* + types and functions for replicas +*/ + +// isInteger +type InstanceGetReplicasAttributeType = *int64 +type InstanceGetReplicasArgType = int64 +type InstanceGetReplicasRetType = int64 + +func getInstanceGetReplicasAttributeTypeOk(arg InstanceGetReplicasAttributeType) (ret InstanceGetReplicasRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceGetReplicasAttributeType(arg *InstanceGetReplicasAttributeType, val InstanceGetReplicasRetType) { + *arg = &val +} + +/* + types and functions for status +*/ + +// isNotNullableString +type InstanceGetStatusAttributeType = *string + +func getInstanceGetStatusAttributeTypeOk(arg InstanceGetStatusAttributeType) (ret InstanceGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceGetStatusAttributeType(arg *InstanceGetStatusAttributeType, val InstanceGetStatusRetType) { + *arg = &val +} + +type InstanceGetStatusArgType = string +type InstanceGetStatusRetType = string + +/* + types and functions for storage +*/ + +// isModel +type InstanceGetStorageAttributeType = *Storage +type InstanceGetStorageArgType = Storage +type InstanceGetStorageRetType = Storage + +func getInstanceGetStorageAttributeTypeOk(arg InstanceGetStorageAttributeType) (ret InstanceGetStorageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceGetStorageAttributeType(arg *InstanceGetStorageAttributeType, val InstanceGetStorageRetType) { + *arg = &val +} + +/* + types and functions for version +*/ + +// isNotNullableString +type InstanceGetVersionAttributeType = *string + +func getInstanceGetVersionAttributeTypeOk(arg InstanceGetVersionAttributeType) (ret InstanceGetVersionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceGetVersionAttributeType(arg *InstanceGetVersionAttributeType, val InstanceGetVersionRetType) { + *arg = &val +} + +type InstanceGetVersionArgType = string +type InstanceGetVersionRetType = string + // Instance struct for Instance type Instance struct { - Acl *ACL `json:"acl,omitempty"` - BackupSchedule *string `json:"backupSchedule,omitempty"` - Flavor *Flavor `json:"flavor,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Options *map[string]string `json:"options,omitempty"` + Acl InstanceGetAclAttributeType `json:"acl,omitempty"` + BackupSchedule InstanceGetBackupScheduleAttributeType `json:"backupSchedule,omitempty"` + Flavor InstanceGetFlavorAttributeType `json:"flavor,omitempty"` + Id InstanceGetIdAttributeType `json:"id,omitempty"` + Name InstanceGetNameAttributeType `json:"name,omitempty"` + Options InstanceGetOptionsAttributeType `json:"options,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"` + Replicas InstanceGetReplicasAttributeType `json:"replicas,omitempty"` + Status InstanceGetStatusAttributeType `json:"status,omitempty"` + Storage InstanceGetStorageAttributeType `json:"storage,omitempty"` + Version InstanceGetVersionAttributeType `json:"version,omitempty"` } // NewInstance instantiates a new Instance object @@ -50,356 +255,266 @@ func NewInstanceWithDefaults() *Instance { } // GetAcl returns the Acl field value if set, zero value otherwise. -func (o *Instance) GetAcl() *ACL { - if o == nil || IsNil(o.Acl) { - var ret *ACL - return ret - } - return o.Acl +func (o *Instance) GetAcl() (res InstanceGetAclRetType) { + res, _ = o.GetAclOk() + return } // GetAclOk returns a tuple with the Acl field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Instance) GetAclOk() (*ACL, bool) { - if o == nil || IsNil(o.Acl) { - return nil, false - } - return o.Acl, true +func (o *Instance) GetAclOk() (ret InstanceGetAclRetType, ok bool) { + return getInstanceGetAclAttributeTypeOk(o.Acl) } // HasAcl returns a boolean if a field has been set. func (o *Instance) HasAcl() bool { - if o != nil && !IsNil(o.Acl) { - return true - } - - return false + _, ok := o.GetAclOk() + return ok } // SetAcl gets a reference to the given ACL and assigns it to the Acl field. -func (o *Instance) SetAcl(v *ACL) { - o.Acl = v +func (o *Instance) SetAcl(v InstanceGetAclRetType) { + setInstanceGetAclAttributeType(&o.Acl, v) } // GetBackupSchedule returns the BackupSchedule field value if set, zero value otherwise. -func (o *Instance) GetBackupSchedule() *string { - if o == nil || IsNil(o.BackupSchedule) { - var ret *string - return ret - } - return o.BackupSchedule +func (o *Instance) GetBackupSchedule() (res InstanceGetBackupScheduleRetType) { + res, _ = o.GetBackupScheduleOk() + return } // GetBackupScheduleOk returns a tuple with the BackupSchedule field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Instance) GetBackupScheduleOk() (*string, bool) { - if o == nil || IsNil(o.BackupSchedule) { - return nil, false - } - return o.BackupSchedule, true +func (o *Instance) GetBackupScheduleOk() (ret InstanceGetBackupScheduleRetType, ok bool) { + return getInstanceGetBackupScheduleAttributeTypeOk(o.BackupSchedule) } // HasBackupSchedule returns a boolean if a field has been set. func (o *Instance) HasBackupSchedule() bool { - if o != nil && !IsNil(o.BackupSchedule) { - return true - } - - return false + _, ok := o.GetBackupScheduleOk() + return ok } // SetBackupSchedule gets a reference to the given string and assigns it to the BackupSchedule field. -func (o *Instance) SetBackupSchedule(v *string) { - o.BackupSchedule = v +func (o *Instance) SetBackupSchedule(v InstanceGetBackupScheduleRetType) { + setInstanceGetBackupScheduleAttributeType(&o.BackupSchedule, v) } // GetFlavor returns the Flavor field value if set, zero value otherwise. -func (o *Instance) GetFlavor() *Flavor { - if o == nil || IsNil(o.Flavor) { - var ret *Flavor - return ret - } - return o.Flavor +func (o *Instance) GetFlavor() (res InstanceGetFlavorRetType) { + res, _ = o.GetFlavorOk() + return } // GetFlavorOk returns a tuple with the Flavor field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Instance) GetFlavorOk() (*Flavor, bool) { - if o == nil || IsNil(o.Flavor) { - return nil, false - } - return o.Flavor, true +func (o *Instance) GetFlavorOk() (ret InstanceGetFlavorRetType, ok bool) { + return getInstanceGetFlavorAttributeTypeOk(o.Flavor) } // HasFlavor returns a boolean if a field has been set. func (o *Instance) HasFlavor() bool { - if o != nil && !IsNil(o.Flavor) { - return true - } - - return false + _, ok := o.GetFlavorOk() + return ok } // SetFlavor gets a reference to the given Flavor and assigns it to the Flavor field. -func (o *Instance) SetFlavor(v *Flavor) { - o.Flavor = v +func (o *Instance) SetFlavor(v InstanceGetFlavorRetType) { + setInstanceGetFlavorAttributeType(&o.Flavor, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *Instance) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *Instance) GetId() (res InstanceGetIdRetType) { + res, _ = o.GetIdOk() + return } // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Instance) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *Instance) GetIdOk() (ret InstanceGetIdRetType, ok bool) { + return getInstanceGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *Instance) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false + _, ok := o.GetIdOk() + return ok } // SetId gets a reference to the given string and assigns it to the Id field. -func (o *Instance) SetId(v *string) { - o.Id = v +func (o *Instance) SetId(v InstanceGetIdRetType) { + setInstanceGetIdAttributeType(&o.Id, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *Instance) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *Instance) GetName() (res InstanceGetNameRetType) { + res, _ = o.GetNameOk() + return } // 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 *Instance) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *Instance) GetNameOk() (ret InstanceGetNameRetType, ok bool) { + return getInstanceGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *Instance) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false + _, ok := o.GetNameOk() + return ok } // SetName gets a reference to the given string and assigns it to the Name field. -func (o *Instance) SetName(v *string) { - o.Name = v +func (o *Instance) SetName(v InstanceGetNameRetType) { + setInstanceGetNameAttributeType(&o.Name, v) } // GetOptions returns the Options field value if set, zero value otherwise. -func (o *Instance) GetOptions() *map[string]string { - if o == nil || IsNil(o.Options) { - var ret *map[string]string - return ret - } - return o.Options +func (o *Instance) GetOptions() (res InstanceGetOptionsRetType) { + res, _ = o.GetOptionsOk() + return } // GetOptionsOk returns a tuple with the Options field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Instance) GetOptionsOk() (*map[string]string, bool) { - if o == nil || IsNil(o.Options) { - return nil, false - } - return o.Options, true +func (o *Instance) GetOptionsOk() (ret InstanceGetOptionsRetType, ok bool) { + return getInstanceGetOptionsAttributeTypeOk(o.Options) } // HasOptions returns a boolean if a field has been set. func (o *Instance) HasOptions() bool { - if o != nil && !IsNil(o.Options) { - return true - } - - return false + _, ok := o.GetOptionsOk() + return ok } // SetOptions gets a reference to the given map[string]string and assigns it to the Options field. -func (o *Instance) SetOptions(v *map[string]string) { - o.Options = v +func (o *Instance) SetOptions(v InstanceGetOptionsRetType) { + setInstanceGetOptionsAttributeType(&o.Options, v) } // GetReplicas returns the Replicas field value if set, zero value otherwise. -func (o *Instance) GetReplicas() *int64 { - if o == nil || IsNil(o.Replicas) { - var ret *int64 - return ret - } - return o.Replicas +func (o *Instance) GetReplicas() (res InstanceGetReplicasRetType) { + res, _ = o.GetReplicasOk() + return } // GetReplicasOk returns a tuple with the Replicas field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Instance) GetReplicasOk() (*int64, bool) { - if o == nil || IsNil(o.Replicas) { - return nil, false - } - return o.Replicas, true +func (o *Instance) GetReplicasOk() (ret InstanceGetReplicasRetType, ok bool) { + return getInstanceGetReplicasAttributeTypeOk(o.Replicas) } // HasReplicas returns a boolean if a field has been set. func (o *Instance) HasReplicas() bool { - if o != nil && !IsNil(o.Replicas) { - return true - } - - return false + _, ok := o.GetReplicasOk() + return ok } // SetReplicas gets a reference to the given int64 and assigns it to the Replicas field. -func (o *Instance) SetReplicas(v *int64) { - o.Replicas = v +func (o *Instance) SetReplicas(v InstanceGetReplicasRetType) { + setInstanceGetReplicasAttributeType(&o.Replicas, v) } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *Instance) GetStatus() *string { - if o == nil || IsNil(o.Status) { - var ret *string - return ret - } - return o.Status +func (o *Instance) GetStatus() (res InstanceGetStatusRetType) { + res, _ = o.GetStatusOk() + return } // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Instance) GetStatusOk() (*string, bool) { - if o == nil || IsNil(o.Status) { - return nil, false - } - return o.Status, true +func (o *Instance) GetStatusOk() (ret InstanceGetStatusRetType, ok bool) { + return getInstanceGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. func (o *Instance) HasStatus() bool { - if o != nil && !IsNil(o.Status) { - return true - } - - return false + _, ok := o.GetStatusOk() + return ok } // SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *Instance) SetStatus(v *string) { - o.Status = v +func (o *Instance) SetStatus(v InstanceGetStatusRetType) { + setInstanceGetStatusAttributeType(&o.Status, v) } // GetStorage returns the Storage field value if set, zero value otherwise. -func (o *Instance) GetStorage() *Storage { - if o == nil || IsNil(o.Storage) { - var ret *Storage - return ret - } - return o.Storage +func (o *Instance) GetStorage() (res InstanceGetStorageRetType) { + res, _ = o.GetStorageOk() + return } // GetStorageOk returns a tuple with the Storage field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Instance) GetStorageOk() (*Storage, bool) { - if o == nil || IsNil(o.Storage) { - return nil, false - } - return o.Storage, true +func (o *Instance) GetStorageOk() (ret InstanceGetStorageRetType, ok bool) { + return getInstanceGetStorageAttributeTypeOk(o.Storage) } // HasStorage returns a boolean if a field has been set. func (o *Instance) HasStorage() bool { - if o != nil && !IsNil(o.Storage) { - return true - } - - return false + _, ok := o.GetStorageOk() + return ok } // SetStorage gets a reference to the given Storage and assigns it to the Storage field. -func (o *Instance) SetStorage(v *Storage) { - o.Storage = v +func (o *Instance) SetStorage(v InstanceGetStorageRetType) { + setInstanceGetStorageAttributeType(&o.Storage, v) } // GetVersion returns the Version field value if set, zero value otherwise. -func (o *Instance) GetVersion() *string { - if o == nil || IsNil(o.Version) { - var ret *string - return ret - } - return o.Version +func (o *Instance) GetVersion() (res InstanceGetVersionRetType) { + res, _ = o.GetVersionOk() + return } // GetVersionOk returns a tuple with the Version field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Instance) GetVersionOk() (*string, bool) { - if o == nil || IsNil(o.Version) { - return nil, false - } - return o.Version, true +func (o *Instance) GetVersionOk() (ret InstanceGetVersionRetType, ok bool) { + return getInstanceGetVersionAttributeTypeOk(o.Version) } // HasVersion returns a boolean if a field has been set. func (o *Instance) HasVersion() bool { - if o != nil && !IsNil(o.Version) { - return true - } - - return false + _, ok := o.GetVersionOk() + return ok } // SetVersion gets a reference to the given string and assigns it to the Version field. -func (o *Instance) SetVersion(v *string) { - o.Version = v +func (o *Instance) SetVersion(v InstanceGetVersionRetType) { + setInstanceGetVersionAttributeType(&o.Version, v) } func (o Instance) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Acl) { - toSerialize["acl"] = o.Acl + if val, ok := getInstanceGetAclAttributeTypeOk(o.Acl); ok { + toSerialize["Acl"] = val } - if !IsNil(o.BackupSchedule) { - toSerialize["backupSchedule"] = o.BackupSchedule + if val, ok := getInstanceGetBackupScheduleAttributeTypeOk(o.BackupSchedule); ok { + toSerialize["BackupSchedule"] = val } - if !IsNil(o.Flavor) { - toSerialize["flavor"] = o.Flavor + if val, ok := getInstanceGetFlavorAttributeTypeOk(o.Flavor); ok { + toSerialize["Flavor"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getInstanceGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getInstanceGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Options) { - toSerialize["options"] = o.Options + if val, ok := getInstanceGetOptionsAttributeTypeOk(o.Options); ok { + toSerialize["Options"] = val } - if !IsNil(o.Replicas) { - toSerialize["replicas"] = o.Replicas + if val, ok := getInstanceGetReplicasAttributeTypeOk(o.Replicas); ok { + toSerialize["Replicas"] = val } - if !IsNil(o.Status) { - toSerialize["status"] = o.Status + if val, ok := getInstanceGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val } - if !IsNil(o.Storage) { - toSerialize["storage"] = o.Storage + if val, ok := getInstanceGetStorageAttributeTypeOk(o.Storage); ok { + toSerialize["Storage"] = val } - if !IsNil(o.Version) { - toSerialize["version"] = o.Version + if val, ok := getInstanceGetVersionAttributeTypeOk(o.Version); ok { + toSerialize["Version"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_instance_create_database_response.go b/services/postgresflex/model_instance_create_database_response.go index 3bd3b0c93..ad5ed08f9 100644 --- a/services/postgresflex/model_instance_create_database_response.go +++ b/services/postgresflex/model_instance_create_database_response.go @@ -17,9 +17,30 @@ import ( // checks if the InstanceCreateDatabaseResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &InstanceCreateDatabaseResponse{} +/* + types and functions for id +*/ + +// isNotNullableString +type InstanceCreateDatabaseResponseGetIdAttributeType = *string + +func getInstanceCreateDatabaseResponseGetIdAttributeTypeOk(arg InstanceCreateDatabaseResponseGetIdAttributeType) (ret InstanceCreateDatabaseResponseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceCreateDatabaseResponseGetIdAttributeType(arg *InstanceCreateDatabaseResponseGetIdAttributeType, val InstanceCreateDatabaseResponseGetIdRetType) { + *arg = &val +} + +type InstanceCreateDatabaseResponseGetIdArgType = string +type InstanceCreateDatabaseResponseGetIdRetType = string + // InstanceCreateDatabaseResponse struct for InstanceCreateDatabaseResponse type InstanceCreateDatabaseResponse struct { - Id *string `json:"id,omitempty"` + Id InstanceCreateDatabaseResponseGetIdAttributeType `json:"id,omitempty"` } // NewInstanceCreateDatabaseResponse instantiates a new InstanceCreateDatabaseResponse object @@ -40,41 +61,32 @@ func NewInstanceCreateDatabaseResponseWithDefaults() *InstanceCreateDatabaseResp } // GetId returns the Id field value if set, zero value otherwise. -func (o *InstanceCreateDatabaseResponse) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *InstanceCreateDatabaseResponse) GetId() (res InstanceCreateDatabaseResponseGetIdRetType) { + res, _ = o.GetIdOk() + return } // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceCreateDatabaseResponse) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *InstanceCreateDatabaseResponse) GetIdOk() (ret InstanceCreateDatabaseResponseGetIdRetType, ok bool) { + return getInstanceCreateDatabaseResponseGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *InstanceCreateDatabaseResponse) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false + _, ok := o.GetIdOk() + return ok } // SetId gets a reference to the given string and assigns it to the Id field. -func (o *InstanceCreateDatabaseResponse) SetId(v *string) { - o.Id = v +func (o *InstanceCreateDatabaseResponse) SetId(v InstanceCreateDatabaseResponseGetIdRetType) { + setInstanceCreateDatabaseResponseGetIdAttributeType(&o.Id, v) } func (o InstanceCreateDatabaseResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getInstanceCreateDatabaseResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_instance_data_point.go b/services/postgresflex/model_instance_data_point.go index e3919124a..65c54f4db 100644 --- a/services/postgresflex/model_instance_data_point.go +++ b/services/postgresflex/model_instance_data_point.go @@ -17,10 +17,51 @@ import ( // checks if the InstanceDataPoint type satisfies the MappedNullable interface at compile time var _ MappedNullable = &InstanceDataPoint{} +/* + types and functions for timestamp +*/ + +// isNotNullableString +type InstanceDataPointGetTimestampAttributeType = *string + +func getInstanceDataPointGetTimestampAttributeTypeOk(arg InstanceDataPointGetTimestampAttributeType) (ret InstanceDataPointGetTimestampRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceDataPointGetTimestampAttributeType(arg *InstanceDataPointGetTimestampAttributeType, val InstanceDataPointGetTimestampRetType) { + *arg = &val +} + +type InstanceDataPointGetTimestampArgType = string +type InstanceDataPointGetTimestampRetType = string + +/* + types and functions for value +*/ + +// isNumber +type InstanceDataPointGetValueAttributeType = *float64 +type InstanceDataPointGetValueArgType = float64 +type InstanceDataPointGetValueRetType = float64 + +func getInstanceDataPointGetValueAttributeTypeOk(arg InstanceDataPointGetValueAttributeType) (ret InstanceDataPointGetValueRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceDataPointGetValueAttributeType(arg *InstanceDataPointGetValueAttributeType, val InstanceDataPointGetValueRetType) { + *arg = &val +} + // InstanceDataPoint struct for InstanceDataPoint type InstanceDataPoint struct { - Timestamp *string `json:"timestamp,omitempty"` - Value *float64 `json:"value,omitempty"` + Timestamp InstanceDataPointGetTimestampAttributeType `json:"timestamp,omitempty"` + Value InstanceDataPointGetValueAttributeType `json:"value,omitempty"` } // NewInstanceDataPoint instantiates a new InstanceDataPoint object @@ -41,76 +82,58 @@ func NewInstanceDataPointWithDefaults() *InstanceDataPoint { } // GetTimestamp returns the Timestamp field value if set, zero value otherwise. -func (o *InstanceDataPoint) GetTimestamp() *string { - if o == nil || IsNil(o.Timestamp) { - var ret *string - return ret - } - return o.Timestamp +func (o *InstanceDataPoint) GetTimestamp() (res InstanceDataPointGetTimestampRetType) { + res, _ = o.GetTimestampOk() + return } // GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceDataPoint) GetTimestampOk() (*string, bool) { - if o == nil || IsNil(o.Timestamp) { - return nil, false - } - return o.Timestamp, true +func (o *InstanceDataPoint) GetTimestampOk() (ret InstanceDataPointGetTimestampRetType, ok bool) { + return getInstanceDataPointGetTimestampAttributeTypeOk(o.Timestamp) } // HasTimestamp returns a boolean if a field has been set. func (o *InstanceDataPoint) HasTimestamp() bool { - if o != nil && !IsNil(o.Timestamp) { - return true - } - - return false + _, ok := o.GetTimestampOk() + return ok } // SetTimestamp gets a reference to the given string and assigns it to the Timestamp field. -func (o *InstanceDataPoint) SetTimestamp(v *string) { - o.Timestamp = v +func (o *InstanceDataPoint) SetTimestamp(v InstanceDataPointGetTimestampRetType) { + setInstanceDataPointGetTimestampAttributeType(&o.Timestamp, v) } // GetValue returns the Value field value if set, zero value otherwise. -func (o *InstanceDataPoint) GetValue() *float64 { - if o == nil || IsNil(o.Value) { - var ret *float64 - return ret - } - return o.Value +func (o *InstanceDataPoint) GetValue() (res InstanceDataPointGetValueRetType) { + res, _ = o.GetValueOk() + return } // GetValueOk returns a tuple with the Value field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceDataPoint) GetValueOk() (*float64, bool) { - if o == nil || IsNil(o.Value) { - return nil, false - } - return o.Value, true +func (o *InstanceDataPoint) GetValueOk() (ret InstanceDataPointGetValueRetType, ok bool) { + return getInstanceDataPointGetValueAttributeTypeOk(o.Value) } // HasValue returns a boolean if a field has been set. func (o *InstanceDataPoint) HasValue() bool { - if o != nil && !IsNil(o.Value) { - return true - } - - return false + _, ok := o.GetValueOk() + return ok } // SetValue gets a reference to the given float64 and assigns it to the Value field. -func (o *InstanceDataPoint) SetValue(v *float64) { - o.Value = v +func (o *InstanceDataPoint) SetValue(v InstanceDataPointGetValueRetType) { + setInstanceDataPointGetValueAttributeType(&o.Value, v) } func (o InstanceDataPoint) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Timestamp) { - toSerialize["timestamp"] = o.Timestamp + if val, ok := getInstanceDataPointGetTimestampAttributeTypeOk(o.Timestamp); ok { + toSerialize["Timestamp"] = val } - if !IsNil(o.Value) { - toSerialize["value"] = o.Value + if val, ok := getInstanceDataPointGetValueAttributeTypeOk(o.Value); ok { + toSerialize["Value"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_instance_database.go b/services/postgresflex/model_instance_database.go index b38991be8..4a4477367 100644 --- a/services/postgresflex/model_instance_database.go +++ b/services/postgresflex/model_instance_database.go @@ -17,12 +17,74 @@ import ( // checks if the InstanceDatabase type satisfies the MappedNullable interface at compile time var _ MappedNullable = &InstanceDatabase{} +/* + types and functions for id +*/ + +// isNotNullableString +type InstanceDatabaseGetIdAttributeType = *string + +func getInstanceDatabaseGetIdAttributeTypeOk(arg InstanceDatabaseGetIdAttributeType) (ret InstanceDatabaseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceDatabaseGetIdAttributeType(arg *InstanceDatabaseGetIdAttributeType, val InstanceDatabaseGetIdRetType) { + *arg = &val +} + +type InstanceDatabaseGetIdArgType = string +type InstanceDatabaseGetIdRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +type InstanceDatabaseGetNameAttributeType = *string + +func getInstanceDatabaseGetNameAttributeTypeOk(arg InstanceDatabaseGetNameAttributeType) (ret InstanceDatabaseGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceDatabaseGetNameAttributeType(arg *InstanceDatabaseGetNameAttributeType, val InstanceDatabaseGetNameRetType) { + *arg = &val +} + +type InstanceDatabaseGetNameArgType = string +type InstanceDatabaseGetNameRetType = string + +/* + types and functions for options +*/ + +// isFreeform +type InstanceDatabaseGetOptionsAttributeType = *map[string]interface{} +type InstanceDatabaseGetOptionsArgType = map[string]interface{} +type InstanceDatabaseGetOptionsRetType = map[string]interface{} + +func getInstanceDatabaseGetOptionsAttributeTypeOk(arg InstanceDatabaseGetOptionsAttributeType) (ret InstanceDatabaseGetOptionsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceDatabaseGetOptionsAttributeType(arg *InstanceDatabaseGetOptionsAttributeType, val InstanceDatabaseGetOptionsRetType) { + *arg = &val +} + // InstanceDatabase struct for InstanceDatabase type InstanceDatabase struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` + Id InstanceDatabaseGetIdAttributeType `json:"id,omitempty"` + Name InstanceDatabaseGetNameAttributeType `json:"name,omitempty"` // Database specific options - Options *map[string]interface{} `json:"options,omitempty"` + Options InstanceDatabaseGetOptionsAttributeType `json:"options,omitempty"` } // NewInstanceDatabase instantiates a new InstanceDatabase object @@ -43,111 +105,84 @@ func NewInstanceDatabaseWithDefaults() *InstanceDatabase { } // GetId returns the Id field value if set, zero value otherwise. -func (o *InstanceDatabase) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *InstanceDatabase) GetId() (res InstanceDatabaseGetIdRetType) { + res, _ = o.GetIdOk() + return } // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceDatabase) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *InstanceDatabase) GetIdOk() (ret InstanceDatabaseGetIdRetType, ok bool) { + return getInstanceDatabaseGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *InstanceDatabase) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false + _, ok := o.GetIdOk() + return ok } // SetId gets a reference to the given string and assigns it to the Id field. -func (o *InstanceDatabase) SetId(v *string) { - o.Id = v +func (o *InstanceDatabase) SetId(v InstanceDatabaseGetIdRetType) { + setInstanceDatabaseGetIdAttributeType(&o.Id, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *InstanceDatabase) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *InstanceDatabase) GetName() (res InstanceDatabaseGetNameRetType) { + res, _ = o.GetNameOk() + return } // 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 *InstanceDatabase) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *InstanceDatabase) GetNameOk() (ret InstanceDatabaseGetNameRetType, ok bool) { + return getInstanceDatabaseGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *InstanceDatabase) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false + _, ok := o.GetNameOk() + return ok } // SetName gets a reference to the given string and assigns it to the Name field. -func (o *InstanceDatabase) SetName(v *string) { - o.Name = v +func (o *InstanceDatabase) SetName(v InstanceDatabaseGetNameRetType) { + setInstanceDatabaseGetNameAttributeType(&o.Name, v) } // GetOptions returns the Options field value if set, zero value otherwise. -func (o *InstanceDatabase) GetOptions() *map[string]interface{} { - if o == nil || IsNil(o.Options) { - var ret *map[string]interface{} - return ret - } - return o.Options +func (o *InstanceDatabase) GetOptions() (res InstanceDatabaseGetOptionsRetType) { + res, _ = o.GetOptionsOk() + return } // GetOptionsOk returns a tuple with the Options field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceDatabase) GetOptionsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Options) { - return &map[string]interface{}{}, false - } - return o.Options, true +func (o *InstanceDatabase) GetOptionsOk() (ret InstanceDatabaseGetOptionsRetType, ok bool) { + return getInstanceDatabaseGetOptionsAttributeTypeOk(o.Options) } // HasOptions returns a boolean if a field has been set. func (o *InstanceDatabase) HasOptions() bool { - if o != nil && !IsNil(o.Options) { - return true - } - - return false + _, ok := o.GetOptionsOk() + return ok } // SetOptions gets a reference to the given map[string]interface{} and assigns it to the Options field. -func (o *InstanceDatabase) SetOptions(v *map[string]interface{}) { - o.Options = v +func (o *InstanceDatabase) SetOptions(v InstanceDatabaseGetOptionsRetType) { + setInstanceDatabaseGetOptionsAttributeType(&o.Options, v) } func (o InstanceDatabase) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getInstanceDatabaseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getInstanceDatabaseGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Options) { - toSerialize["options"] = o.Options + if val, ok := getInstanceDatabaseGetOptionsAttributeTypeOk(o.Options); ok { + toSerialize["Options"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_instance_host.go b/services/postgresflex/model_instance_host.go index a19dcab5c..3b1d615a3 100644 --- a/services/postgresflex/model_instance_host.go +++ b/services/postgresflex/model_instance_host.go @@ -17,10 +17,51 @@ import ( // checks if the InstanceHost type satisfies the MappedNullable interface at compile time var _ MappedNullable = &InstanceHost{} +/* + types and functions for hostMetrics +*/ + +// isArray +type InstanceHostGetHostMetricsAttributeType = *[]InstanceHostMetric +type InstanceHostGetHostMetricsArgType = []InstanceHostMetric +type InstanceHostGetHostMetricsRetType = []InstanceHostMetric + +func getInstanceHostGetHostMetricsAttributeTypeOk(arg InstanceHostGetHostMetricsAttributeType) (ret InstanceHostGetHostMetricsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceHostGetHostMetricsAttributeType(arg *InstanceHostGetHostMetricsAttributeType, val InstanceHostGetHostMetricsRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type InstanceHostGetIdAttributeType = *string + +func getInstanceHostGetIdAttributeTypeOk(arg InstanceHostGetIdAttributeType) (ret InstanceHostGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceHostGetIdAttributeType(arg *InstanceHostGetIdAttributeType, val InstanceHostGetIdRetType) { + *arg = &val +} + +type InstanceHostGetIdArgType = string +type InstanceHostGetIdRetType = string + // InstanceHost struct for InstanceHost type InstanceHost struct { - HostMetrics *[]InstanceHostMetric `json:"hostMetrics,omitempty"` - Id *string `json:"id,omitempty"` + HostMetrics InstanceHostGetHostMetricsAttributeType `json:"hostMetrics,omitempty"` + Id InstanceHostGetIdAttributeType `json:"id,omitempty"` } // NewInstanceHost instantiates a new InstanceHost object @@ -41,76 +82,58 @@ func NewInstanceHostWithDefaults() *InstanceHost { } // GetHostMetrics returns the HostMetrics field value if set, zero value otherwise. -func (o *InstanceHost) GetHostMetrics() *[]InstanceHostMetric { - if o == nil || IsNil(o.HostMetrics) { - var ret *[]InstanceHostMetric - return ret - } - return o.HostMetrics +func (o *InstanceHost) GetHostMetrics() (res InstanceHostGetHostMetricsRetType) { + res, _ = o.GetHostMetricsOk() + return } // GetHostMetricsOk returns a tuple with the HostMetrics field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceHost) GetHostMetricsOk() (*[]InstanceHostMetric, bool) { - if o == nil || IsNil(o.HostMetrics) { - return nil, false - } - return o.HostMetrics, true +func (o *InstanceHost) GetHostMetricsOk() (ret InstanceHostGetHostMetricsRetType, ok bool) { + return getInstanceHostGetHostMetricsAttributeTypeOk(o.HostMetrics) } // HasHostMetrics returns a boolean if a field has been set. func (o *InstanceHost) HasHostMetrics() bool { - if o != nil && !IsNil(o.HostMetrics) { - return true - } - - return false + _, ok := o.GetHostMetricsOk() + return ok } // SetHostMetrics gets a reference to the given []InstanceHostMetric and assigns it to the HostMetrics field. -func (o *InstanceHost) SetHostMetrics(v *[]InstanceHostMetric) { - o.HostMetrics = v +func (o *InstanceHost) SetHostMetrics(v InstanceHostGetHostMetricsRetType) { + setInstanceHostGetHostMetricsAttributeType(&o.HostMetrics, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *InstanceHost) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *InstanceHost) GetId() (res InstanceHostGetIdRetType) { + res, _ = o.GetIdOk() + return } // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceHost) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *InstanceHost) GetIdOk() (ret InstanceHostGetIdRetType, ok bool) { + return getInstanceHostGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *InstanceHost) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false + _, ok := o.GetIdOk() + return ok } // SetId gets a reference to the given string and assigns it to the Id field. -func (o *InstanceHost) SetId(v *string) { - o.Id = v +func (o *InstanceHost) SetId(v InstanceHostGetIdRetType) { + setInstanceHostGetIdAttributeType(&o.Id, v) } func (o InstanceHost) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.HostMetrics) { - toSerialize["hostMetrics"] = o.HostMetrics + if val, ok := getInstanceHostGetHostMetricsAttributeTypeOk(o.HostMetrics); ok { + toSerialize["HostMetrics"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getInstanceHostGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_instance_host_metric.go b/services/postgresflex/model_instance_host_metric.go index f2a3e0946..e82764346 100644 --- a/services/postgresflex/model_instance_host_metric.go +++ b/services/postgresflex/model_instance_host_metric.go @@ -17,11 +17,73 @@ import ( // checks if the InstanceHostMetric type satisfies the MappedNullable interface at compile time var _ MappedNullable = &InstanceHostMetric{} +/* + types and functions for datapoints +*/ + +// isArray +type InstanceHostMetricGetDatapointsAttributeType = *[]InstanceDataPoint +type InstanceHostMetricGetDatapointsArgType = []InstanceDataPoint +type InstanceHostMetricGetDatapointsRetType = []InstanceDataPoint + +func getInstanceHostMetricGetDatapointsAttributeTypeOk(arg InstanceHostMetricGetDatapointsAttributeType) (ret InstanceHostMetricGetDatapointsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceHostMetricGetDatapointsAttributeType(arg *InstanceHostMetricGetDatapointsAttributeType, val InstanceHostMetricGetDatapointsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type InstanceHostMetricGetNameAttributeType = *string + +func getInstanceHostMetricGetNameAttributeTypeOk(arg InstanceHostMetricGetNameAttributeType) (ret InstanceHostMetricGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceHostMetricGetNameAttributeType(arg *InstanceHostMetricGetNameAttributeType, val InstanceHostMetricGetNameRetType) { + *arg = &val +} + +type InstanceHostMetricGetNameArgType = string +type InstanceHostMetricGetNameRetType = string + +/* + types and functions for units +*/ + +// isNotNullableString +type InstanceHostMetricGetUnitsAttributeType = *string + +func getInstanceHostMetricGetUnitsAttributeTypeOk(arg InstanceHostMetricGetUnitsAttributeType) (ret InstanceHostMetricGetUnitsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceHostMetricGetUnitsAttributeType(arg *InstanceHostMetricGetUnitsAttributeType, val InstanceHostMetricGetUnitsRetType) { + *arg = &val +} + +type InstanceHostMetricGetUnitsArgType = string +type InstanceHostMetricGetUnitsRetType = string + // InstanceHostMetric struct for InstanceHostMetric type InstanceHostMetric struct { - Datapoints *[]InstanceDataPoint `json:"datapoints,omitempty"` - Name *string `json:"name,omitempty"` - Units *string `json:"units,omitempty"` + Datapoints InstanceHostMetricGetDatapointsAttributeType `json:"datapoints,omitempty"` + Name InstanceHostMetricGetNameAttributeType `json:"name,omitempty"` + Units InstanceHostMetricGetUnitsAttributeType `json:"units,omitempty"` } // NewInstanceHostMetric instantiates a new InstanceHostMetric object @@ -42,111 +104,84 @@ func NewInstanceHostMetricWithDefaults() *InstanceHostMetric { } // GetDatapoints returns the Datapoints field value if set, zero value otherwise. -func (o *InstanceHostMetric) GetDatapoints() *[]InstanceDataPoint { - if o == nil || IsNil(o.Datapoints) { - var ret *[]InstanceDataPoint - return ret - } - return o.Datapoints +func (o *InstanceHostMetric) GetDatapoints() (res InstanceHostMetricGetDatapointsRetType) { + res, _ = o.GetDatapointsOk() + return } // GetDatapointsOk returns a tuple with the Datapoints field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceHostMetric) GetDatapointsOk() (*[]InstanceDataPoint, bool) { - if o == nil || IsNil(o.Datapoints) { - return nil, false - } - return o.Datapoints, true +func (o *InstanceHostMetric) GetDatapointsOk() (ret InstanceHostMetricGetDatapointsRetType, ok bool) { + return getInstanceHostMetricGetDatapointsAttributeTypeOk(o.Datapoints) } // HasDatapoints returns a boolean if a field has been set. func (o *InstanceHostMetric) HasDatapoints() bool { - if o != nil && !IsNil(o.Datapoints) { - return true - } - - return false + _, ok := o.GetDatapointsOk() + return ok } // SetDatapoints gets a reference to the given []InstanceDataPoint and assigns it to the Datapoints field. -func (o *InstanceHostMetric) SetDatapoints(v *[]InstanceDataPoint) { - o.Datapoints = v +func (o *InstanceHostMetric) SetDatapoints(v InstanceHostMetricGetDatapointsRetType) { + setInstanceHostMetricGetDatapointsAttributeType(&o.Datapoints, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *InstanceHostMetric) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *InstanceHostMetric) GetName() (res InstanceHostMetricGetNameRetType) { + res, _ = o.GetNameOk() + return } // 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 *InstanceHostMetric) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *InstanceHostMetric) GetNameOk() (ret InstanceHostMetricGetNameRetType, ok bool) { + return getInstanceHostMetricGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *InstanceHostMetric) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false + _, ok := o.GetNameOk() + return ok } // SetName gets a reference to the given string and assigns it to the Name field. -func (o *InstanceHostMetric) SetName(v *string) { - o.Name = v +func (o *InstanceHostMetric) SetName(v InstanceHostMetricGetNameRetType) { + setInstanceHostMetricGetNameAttributeType(&o.Name, v) } // GetUnits returns the Units field value if set, zero value otherwise. -func (o *InstanceHostMetric) GetUnits() *string { - if o == nil || IsNil(o.Units) { - var ret *string - return ret - } - return o.Units +func (o *InstanceHostMetric) GetUnits() (res InstanceHostMetricGetUnitsRetType) { + res, _ = o.GetUnitsOk() + return } // GetUnitsOk returns a tuple with the Units field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceHostMetric) GetUnitsOk() (*string, bool) { - if o == nil || IsNil(o.Units) { - return nil, false - } - return o.Units, true +func (o *InstanceHostMetric) GetUnitsOk() (ret InstanceHostMetricGetUnitsRetType, ok bool) { + return getInstanceHostMetricGetUnitsAttributeTypeOk(o.Units) } // HasUnits returns a boolean if a field has been set. func (o *InstanceHostMetric) HasUnits() bool { - if o != nil && !IsNil(o.Units) { - return true - } - - return false + _, ok := o.GetUnitsOk() + return ok } // SetUnits gets a reference to the given string and assigns it to the Units field. -func (o *InstanceHostMetric) SetUnits(v *string) { - o.Units = v +func (o *InstanceHostMetric) SetUnits(v InstanceHostMetricGetUnitsRetType) { + setInstanceHostMetricGetUnitsAttributeType(&o.Units, v) } func (o InstanceHostMetric) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Datapoints) { - toSerialize["datapoints"] = o.Datapoints + if val, ok := getInstanceHostMetricGetDatapointsAttributeTypeOk(o.Datapoints); ok { + toSerialize["Datapoints"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getInstanceHostMetricGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Units) { - toSerialize["units"] = o.Units + if val, ok := getInstanceHostMetricGetUnitsAttributeTypeOk(o.Units); ok { + toSerialize["Units"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_instance_list_databases_response.go b/services/postgresflex/model_instance_list_databases_response.go index 41ecd99af..030d62ab6 100644 --- a/services/postgresflex/model_instance_list_databases_response.go +++ b/services/postgresflex/model_instance_list_databases_response.go @@ -17,9 +17,29 @@ import ( // checks if the InstanceListDatabasesResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &InstanceListDatabasesResponse{} +/* + types and functions for databases +*/ + +// isArray +type InstanceListDatabasesResponseGetDatabasesAttributeType = *[]InstanceDatabase +type InstanceListDatabasesResponseGetDatabasesArgType = []InstanceDatabase +type InstanceListDatabasesResponseGetDatabasesRetType = []InstanceDatabase + +func getInstanceListDatabasesResponseGetDatabasesAttributeTypeOk(arg InstanceListDatabasesResponseGetDatabasesAttributeType) (ret InstanceListDatabasesResponseGetDatabasesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceListDatabasesResponseGetDatabasesAttributeType(arg *InstanceListDatabasesResponseGetDatabasesAttributeType, val InstanceListDatabasesResponseGetDatabasesRetType) { + *arg = &val +} + // InstanceListDatabasesResponse struct for InstanceListDatabasesResponse type InstanceListDatabasesResponse struct { - Databases *[]InstanceDatabase `json:"databases,omitempty"` + Databases InstanceListDatabasesResponseGetDatabasesAttributeType `json:"databases,omitempty"` } // NewInstanceListDatabasesResponse instantiates a new InstanceListDatabasesResponse object @@ -40,41 +60,32 @@ func NewInstanceListDatabasesResponseWithDefaults() *InstanceListDatabasesRespon } // GetDatabases returns the Databases field value if set, zero value otherwise. -func (o *InstanceListDatabasesResponse) GetDatabases() *[]InstanceDatabase { - if o == nil || IsNil(o.Databases) { - var ret *[]InstanceDatabase - return ret - } - return o.Databases +func (o *InstanceListDatabasesResponse) GetDatabases() (res InstanceListDatabasesResponseGetDatabasesRetType) { + res, _ = o.GetDatabasesOk() + return } // GetDatabasesOk returns a tuple with the Databases field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceListDatabasesResponse) GetDatabasesOk() (*[]InstanceDatabase, bool) { - if o == nil || IsNil(o.Databases) { - return nil, false - } - return o.Databases, true +func (o *InstanceListDatabasesResponse) GetDatabasesOk() (ret InstanceListDatabasesResponseGetDatabasesRetType, ok bool) { + return getInstanceListDatabasesResponseGetDatabasesAttributeTypeOk(o.Databases) } // HasDatabases returns a boolean if a field has been set. func (o *InstanceListDatabasesResponse) HasDatabases() bool { - if o != nil && !IsNil(o.Databases) { - return true - } - - return false + _, ok := o.GetDatabasesOk() + return ok } // SetDatabases gets a reference to the given []InstanceDatabase and assigns it to the Databases field. -func (o *InstanceListDatabasesResponse) SetDatabases(v *[]InstanceDatabase) { - o.Databases = v +func (o *InstanceListDatabasesResponse) SetDatabases(v InstanceListDatabasesResponseGetDatabasesRetType) { + setInstanceListDatabasesResponseGetDatabasesAttributeType(&o.Databases, v) } func (o InstanceListDatabasesResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Databases) { - toSerialize["databases"] = o.Databases + if val, ok := getInstanceListDatabasesResponseGetDatabasesAttributeTypeOk(o.Databases); ok { + toSerialize["Databases"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_instance_list_instance.go b/services/postgresflex/model_instance_list_instance.go index be7a9aaac..6cf3e5bdf 100644 --- a/services/postgresflex/model_instance_list_instance.go +++ b/services/postgresflex/model_instance_list_instance.go @@ -17,11 +17,74 @@ import ( // checks if the InstanceListInstance type satisfies the MappedNullable interface at compile time var _ MappedNullable = &InstanceListInstance{} +/* + types and functions for id +*/ + +// isNotNullableString +type InstanceListInstanceGetIdAttributeType = *string + +func getInstanceListInstanceGetIdAttributeTypeOk(arg InstanceListInstanceGetIdAttributeType) (ret InstanceListInstanceGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceListInstanceGetIdAttributeType(arg *InstanceListInstanceGetIdAttributeType, val InstanceListInstanceGetIdRetType) { + *arg = &val +} + +type InstanceListInstanceGetIdArgType = string +type InstanceListInstanceGetIdRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +type InstanceListInstanceGetNameAttributeType = *string + +func getInstanceListInstanceGetNameAttributeTypeOk(arg InstanceListInstanceGetNameAttributeType) (ret InstanceListInstanceGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceListInstanceGetNameAttributeType(arg *InstanceListInstanceGetNameAttributeType, val InstanceListInstanceGetNameRetType) { + *arg = &val +} + +type InstanceListInstanceGetNameArgType = string +type InstanceListInstanceGetNameRetType = string + +/* + types and functions for status +*/ + +// isNotNullableString +type InstanceListInstanceGetStatusAttributeType = *string + +func getInstanceListInstanceGetStatusAttributeTypeOk(arg InstanceListInstanceGetStatusAttributeType) (ret InstanceListInstanceGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceListInstanceGetStatusAttributeType(arg *InstanceListInstanceGetStatusAttributeType, val InstanceListInstanceGetStatusRetType) { + *arg = &val +} + +type InstanceListInstanceGetStatusArgType = string +type InstanceListInstanceGetStatusRetType = string + // InstanceListInstance struct for InstanceListInstance type InstanceListInstance struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Status *string `json:"status,omitempty"` + Id InstanceListInstanceGetIdAttributeType `json:"id,omitempty"` + Name InstanceListInstanceGetNameAttributeType `json:"name,omitempty"` + Status InstanceListInstanceGetStatusAttributeType `json:"status,omitempty"` } // NewInstanceListInstance instantiates a new InstanceListInstance object @@ -42,111 +105,84 @@ func NewInstanceListInstanceWithDefaults() *InstanceListInstance { } // GetId returns the Id field value if set, zero value otherwise. -func (o *InstanceListInstance) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *InstanceListInstance) GetId() (res InstanceListInstanceGetIdRetType) { + res, _ = o.GetIdOk() + return } // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceListInstance) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *InstanceListInstance) GetIdOk() (ret InstanceListInstanceGetIdRetType, ok bool) { + return getInstanceListInstanceGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *InstanceListInstance) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false + _, ok := o.GetIdOk() + return ok } // SetId gets a reference to the given string and assigns it to the Id field. -func (o *InstanceListInstance) SetId(v *string) { - o.Id = v +func (o *InstanceListInstance) SetId(v InstanceListInstanceGetIdRetType) { + setInstanceListInstanceGetIdAttributeType(&o.Id, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *InstanceListInstance) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *InstanceListInstance) GetName() (res InstanceListInstanceGetNameRetType) { + res, _ = o.GetNameOk() + return } // 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 *InstanceListInstance) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *InstanceListInstance) GetNameOk() (ret InstanceListInstanceGetNameRetType, ok bool) { + return getInstanceListInstanceGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *InstanceListInstance) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false + _, ok := o.GetNameOk() + return ok } // SetName gets a reference to the given string and assigns it to the Name field. -func (o *InstanceListInstance) SetName(v *string) { - o.Name = v +func (o *InstanceListInstance) SetName(v InstanceListInstanceGetNameRetType) { + setInstanceListInstanceGetNameAttributeType(&o.Name, v) } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *InstanceListInstance) GetStatus() *string { - if o == nil || IsNil(o.Status) { - var ret *string - return ret - } - return o.Status +func (o *InstanceListInstance) GetStatus() (res InstanceListInstanceGetStatusRetType) { + res, _ = o.GetStatusOk() + return } // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceListInstance) GetStatusOk() (*string, bool) { - if o == nil || IsNil(o.Status) { - return nil, false - } - return o.Status, true +func (o *InstanceListInstance) GetStatusOk() (ret InstanceListInstanceGetStatusRetType, ok bool) { + return getInstanceListInstanceGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. func (o *InstanceListInstance) HasStatus() bool { - if o != nil && !IsNil(o.Status) { - return true - } - - return false + _, ok := o.GetStatusOk() + return ok } // SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *InstanceListInstance) SetStatus(v *string) { - o.Status = v +func (o *InstanceListInstance) SetStatus(v InstanceListInstanceGetStatusRetType) { + setInstanceListInstanceGetStatusAttributeType(&o.Status, v) } func (o InstanceListInstance) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getInstanceListInstanceGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getInstanceListInstanceGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Status) { - toSerialize["status"] = o.Status + if val, ok := getInstanceListInstanceGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_instance_metrics_response.go b/services/postgresflex/model_instance_metrics_response.go index 042ef9ce0..10042cbc9 100644 --- a/services/postgresflex/model_instance_metrics_response.go +++ b/services/postgresflex/model_instance_metrics_response.go @@ -17,9 +17,29 @@ import ( // checks if the InstanceMetricsResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &InstanceMetricsResponse{} +/* + types and functions for hosts +*/ + +// isArray +type InstanceMetricsResponseGetHostsAttributeType = *[]InstanceHost +type InstanceMetricsResponseGetHostsArgType = []InstanceHost +type InstanceMetricsResponseGetHostsRetType = []InstanceHost + +func getInstanceMetricsResponseGetHostsAttributeTypeOk(arg InstanceMetricsResponseGetHostsAttributeType) (ret InstanceMetricsResponseGetHostsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceMetricsResponseGetHostsAttributeType(arg *InstanceMetricsResponseGetHostsAttributeType, val InstanceMetricsResponseGetHostsRetType) { + *arg = &val +} + // InstanceMetricsResponse struct for InstanceMetricsResponse type InstanceMetricsResponse struct { - Hosts *[]InstanceHost `json:"hosts,omitempty"` + Hosts InstanceMetricsResponseGetHostsAttributeType `json:"hosts,omitempty"` } // NewInstanceMetricsResponse instantiates a new InstanceMetricsResponse object @@ -40,41 +60,32 @@ func NewInstanceMetricsResponseWithDefaults() *InstanceMetricsResponse { } // GetHosts returns the Hosts field value if set, zero value otherwise. -func (o *InstanceMetricsResponse) GetHosts() *[]InstanceHost { - if o == nil || IsNil(o.Hosts) { - var ret *[]InstanceHost - return ret - } - return o.Hosts +func (o *InstanceMetricsResponse) GetHosts() (res InstanceMetricsResponseGetHostsRetType) { + res, _ = o.GetHostsOk() + return } // GetHostsOk returns a tuple with the Hosts field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceMetricsResponse) GetHostsOk() (*[]InstanceHost, bool) { - if o == nil || IsNil(o.Hosts) { - return nil, false - } - return o.Hosts, true +func (o *InstanceMetricsResponse) GetHostsOk() (ret InstanceMetricsResponseGetHostsRetType, ok bool) { + return getInstanceMetricsResponseGetHostsAttributeTypeOk(o.Hosts) } // HasHosts returns a boolean if a field has been set. func (o *InstanceMetricsResponse) HasHosts() bool { - if o != nil && !IsNil(o.Hosts) { - return true - } - - return false + _, ok := o.GetHostsOk() + return ok } // SetHosts gets a reference to the given []InstanceHost and assigns it to the Hosts field. -func (o *InstanceMetricsResponse) SetHosts(v *[]InstanceHost) { - o.Hosts = v +func (o *InstanceMetricsResponse) SetHosts(v InstanceMetricsResponseGetHostsRetType) { + setInstanceMetricsResponseGetHostsAttributeType(&o.Hosts, v) } func (o InstanceMetricsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Hosts) { - toSerialize["hosts"] = o.Hosts + if val, ok := getInstanceMetricsResponseGetHostsAttributeTypeOk(o.Hosts); ok { + toSerialize["Hosts"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_instance_response.go b/services/postgresflex/model_instance_response.go index 8138df36f..08fc15498 100644 --- a/services/postgresflex/model_instance_response.go +++ b/services/postgresflex/model_instance_response.go @@ -17,9 +17,29 @@ import ( // checks if the InstanceResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &InstanceResponse{} +/* + types and functions for item +*/ + +// isModel +type InstanceResponseGetItemAttributeType = *Instance +type InstanceResponseGetItemArgType = Instance +type InstanceResponseGetItemRetType = Instance + +func getInstanceResponseGetItemAttributeTypeOk(arg InstanceResponseGetItemAttributeType) (ret InstanceResponseGetItemRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceResponseGetItemAttributeType(arg *InstanceResponseGetItemAttributeType, val InstanceResponseGetItemRetType) { + *arg = &val +} + // InstanceResponse struct for InstanceResponse type InstanceResponse struct { - Item *Instance `json:"item,omitempty"` + Item InstanceResponseGetItemAttributeType `json:"item,omitempty"` } // NewInstanceResponse instantiates a new InstanceResponse object @@ -40,41 +60,32 @@ func NewInstanceResponseWithDefaults() *InstanceResponse { } // GetItem returns the Item field value if set, zero value otherwise. -func (o *InstanceResponse) GetItem() *Instance { - if o == nil || IsNil(o.Item) { - var ret *Instance - return ret - } - return o.Item +func (o *InstanceResponse) GetItem() (res InstanceResponseGetItemRetType) { + res, _ = o.GetItemOk() + return } // GetItemOk returns a tuple with the Item field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceResponse) GetItemOk() (*Instance, bool) { - if o == nil || IsNil(o.Item) { - return nil, false - } - return o.Item, true +func (o *InstanceResponse) GetItemOk() (ret InstanceResponseGetItemRetType, ok bool) { + return getInstanceResponseGetItemAttributeTypeOk(o.Item) } // HasItem returns a boolean if a field has been set. func (o *InstanceResponse) HasItem() bool { - if o != nil && !IsNil(o.Item) { - return true - } - - return false + _, ok := o.GetItemOk() + return ok } // SetItem gets a reference to the given Instance and assigns it to the Item field. -func (o *InstanceResponse) SetItem(v *Instance) { - o.Item = v +func (o *InstanceResponse) SetItem(v InstanceResponseGetItemRetType) { + setInstanceResponseGetItemAttributeType(&o.Item, v) } func (o InstanceResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Item) { - toSerialize["item"] = o.Item + if val, ok := getInstanceResponseGetItemAttributeTypeOk(o.Item); ok { + toSerialize["Item"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_list_backups_response.go b/services/postgresflex/model_list_backups_response.go index dccd329de..d083d437b 100644 --- a/services/postgresflex/model_list_backups_response.go +++ b/services/postgresflex/model_list_backups_response.go @@ -17,10 +17,50 @@ import ( // checks if the ListBackupsResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ListBackupsResponse{} +/* + types and functions for count +*/ + +// isLong +type ListBackupsResponseGetCountAttributeType = *int64 +type ListBackupsResponseGetCountArgType = int64 +type ListBackupsResponseGetCountRetType = int64 + +func getListBackupsResponseGetCountAttributeTypeOk(arg ListBackupsResponseGetCountAttributeType) (ret ListBackupsResponseGetCountRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListBackupsResponseGetCountAttributeType(arg *ListBackupsResponseGetCountAttributeType, val ListBackupsResponseGetCountRetType) { + *arg = &val +} + +/* + types and functions for items +*/ + +// isArray +type ListBackupsResponseGetItemsAttributeType = *[]Backup +type ListBackupsResponseGetItemsArgType = []Backup +type ListBackupsResponseGetItemsRetType = []Backup + +func getListBackupsResponseGetItemsAttributeTypeOk(arg ListBackupsResponseGetItemsAttributeType) (ret ListBackupsResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListBackupsResponseGetItemsAttributeType(arg *ListBackupsResponseGetItemsAttributeType, val ListBackupsResponseGetItemsRetType) { + *arg = &val +} + // ListBackupsResponse struct for ListBackupsResponse type ListBackupsResponse struct { - Count *int64 `json:"count,omitempty"` - Items *[]Backup `json:"items,omitempty"` + Count ListBackupsResponseGetCountAttributeType `json:"count,omitempty"` + Items ListBackupsResponseGetItemsAttributeType `json:"items,omitempty"` } // NewListBackupsResponse instantiates a new ListBackupsResponse object @@ -41,76 +81,58 @@ func NewListBackupsResponseWithDefaults() *ListBackupsResponse { } // GetCount returns the Count field value if set, zero value otherwise. -func (o *ListBackupsResponse) GetCount() *int64 { - if o == nil || IsNil(o.Count) { - var ret *int64 - return ret - } - return o.Count +func (o *ListBackupsResponse) GetCount() (res ListBackupsResponseGetCountRetType) { + res, _ = o.GetCountOk() + return } // GetCountOk returns a tuple with the Count field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListBackupsResponse) GetCountOk() (*int64, bool) { - if o == nil || IsNil(o.Count) { - return nil, false - } - return o.Count, true +func (o *ListBackupsResponse) GetCountOk() (ret ListBackupsResponseGetCountRetType, ok bool) { + return getListBackupsResponseGetCountAttributeTypeOk(o.Count) } // HasCount returns a boolean if a field has been set. func (o *ListBackupsResponse) HasCount() bool { - if o != nil && !IsNil(o.Count) { - return true - } - - return false + _, ok := o.GetCountOk() + return ok } // SetCount gets a reference to the given int64 and assigns it to the Count field. -func (o *ListBackupsResponse) SetCount(v *int64) { - o.Count = v +func (o *ListBackupsResponse) SetCount(v ListBackupsResponseGetCountRetType) { + setListBackupsResponseGetCountAttributeType(&o.Count, v) } // GetItems returns the Items field value if set, zero value otherwise. -func (o *ListBackupsResponse) GetItems() *[]Backup { - if o == nil || IsNil(o.Items) { - var ret *[]Backup - return ret - } - return o.Items +func (o *ListBackupsResponse) GetItems() (res ListBackupsResponseGetItemsRetType) { + res, _ = o.GetItemsOk() + return } // GetItemsOk returns a tuple with the Items field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListBackupsResponse) GetItemsOk() (*[]Backup, bool) { - if o == nil || IsNil(o.Items) { - return nil, false - } - return o.Items, true +func (o *ListBackupsResponse) GetItemsOk() (ret ListBackupsResponseGetItemsRetType, ok bool) { + return getListBackupsResponseGetItemsAttributeTypeOk(o.Items) } // HasItems returns a boolean if a field has been set. func (o *ListBackupsResponse) HasItems() bool { - if o != nil && !IsNil(o.Items) { - return true - } - - return false + _, ok := o.GetItemsOk() + return ok } // SetItems gets a reference to the given []Backup and assigns it to the Items field. -func (o *ListBackupsResponse) SetItems(v *[]Backup) { - o.Items = v +func (o *ListBackupsResponse) SetItems(v ListBackupsResponseGetItemsRetType) { + setListBackupsResponseGetItemsAttributeType(&o.Items, v) } func (o ListBackupsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Count) { - toSerialize["count"] = o.Count + if val, ok := getListBackupsResponseGetCountAttributeTypeOk(o.Count); ok { + toSerialize["Count"] = val } - if !IsNil(o.Items) { - toSerialize["items"] = o.Items + if val, ok := getListBackupsResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_list_flavors_response.go b/services/postgresflex/model_list_flavors_response.go index 94bb53046..b26b5744c 100644 --- a/services/postgresflex/model_list_flavors_response.go +++ b/services/postgresflex/model_list_flavors_response.go @@ -17,9 +17,29 @@ import ( // checks if the ListFlavorsResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ListFlavorsResponse{} +/* + types and functions for flavors +*/ + +// isArray +type ListFlavorsResponseGetFlavorsAttributeType = *[]Flavor +type ListFlavorsResponseGetFlavorsArgType = []Flavor +type ListFlavorsResponseGetFlavorsRetType = []Flavor + +func getListFlavorsResponseGetFlavorsAttributeTypeOk(arg ListFlavorsResponseGetFlavorsAttributeType) (ret ListFlavorsResponseGetFlavorsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListFlavorsResponseGetFlavorsAttributeType(arg *ListFlavorsResponseGetFlavorsAttributeType, val ListFlavorsResponseGetFlavorsRetType) { + *arg = &val +} + // ListFlavorsResponse struct for ListFlavorsResponse type ListFlavorsResponse struct { - Flavors *[]Flavor `json:"flavors,omitempty"` + Flavors ListFlavorsResponseGetFlavorsAttributeType `json:"flavors,omitempty"` } // NewListFlavorsResponse instantiates a new ListFlavorsResponse object @@ -40,41 +60,32 @@ func NewListFlavorsResponseWithDefaults() *ListFlavorsResponse { } // GetFlavors returns the Flavors field value if set, zero value otherwise. -func (o *ListFlavorsResponse) GetFlavors() *[]Flavor { - if o == nil || IsNil(o.Flavors) { - var ret *[]Flavor - return ret - } - return o.Flavors +func (o *ListFlavorsResponse) GetFlavors() (res ListFlavorsResponseGetFlavorsRetType) { + res, _ = o.GetFlavorsOk() + return } // GetFlavorsOk returns a tuple with the Flavors field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListFlavorsResponse) GetFlavorsOk() (*[]Flavor, bool) { - if o == nil || IsNil(o.Flavors) { - return nil, false - } - return o.Flavors, true +func (o *ListFlavorsResponse) GetFlavorsOk() (ret ListFlavorsResponseGetFlavorsRetType, ok bool) { + return getListFlavorsResponseGetFlavorsAttributeTypeOk(o.Flavors) } // HasFlavors returns a boolean if a field has been set. func (o *ListFlavorsResponse) HasFlavors() bool { - if o != nil && !IsNil(o.Flavors) { - return true - } - - return false + _, ok := o.GetFlavorsOk() + return ok } // SetFlavors gets a reference to the given []Flavor and assigns it to the Flavors field. -func (o *ListFlavorsResponse) SetFlavors(v *[]Flavor) { - o.Flavors = v +func (o *ListFlavorsResponse) SetFlavors(v ListFlavorsResponseGetFlavorsRetType) { + setListFlavorsResponseGetFlavorsAttributeType(&o.Flavors, v) } func (o ListFlavorsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Flavors) { - toSerialize["flavors"] = o.Flavors + if val, ok := getListFlavorsResponseGetFlavorsAttributeTypeOk(o.Flavors); ok { + toSerialize["Flavors"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_list_instances_response.go b/services/postgresflex/model_list_instances_response.go index 596b65f98..cd66d0b36 100644 --- a/services/postgresflex/model_list_instances_response.go +++ b/services/postgresflex/model_list_instances_response.go @@ -17,10 +17,50 @@ import ( // checks if the ListInstancesResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ListInstancesResponse{} +/* + types and functions for count +*/ + +// isLong +type ListInstancesResponseGetCountAttributeType = *int64 +type ListInstancesResponseGetCountArgType = int64 +type ListInstancesResponseGetCountRetType = int64 + +func getListInstancesResponseGetCountAttributeTypeOk(arg ListInstancesResponseGetCountAttributeType) (ret ListInstancesResponseGetCountRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListInstancesResponseGetCountAttributeType(arg *ListInstancesResponseGetCountAttributeType, val ListInstancesResponseGetCountRetType) { + *arg = &val +} + +/* + types and functions for items +*/ + +// isArray +type ListInstancesResponseGetItemsAttributeType = *[]InstanceListInstance +type ListInstancesResponseGetItemsArgType = []InstanceListInstance +type ListInstancesResponseGetItemsRetType = []InstanceListInstance + +func getListInstancesResponseGetItemsAttributeTypeOk(arg ListInstancesResponseGetItemsAttributeType) (ret ListInstancesResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListInstancesResponseGetItemsAttributeType(arg *ListInstancesResponseGetItemsAttributeType, val ListInstancesResponseGetItemsRetType) { + *arg = &val +} + // ListInstancesResponse struct for ListInstancesResponse type ListInstancesResponse struct { - Count *int64 `json:"count,omitempty"` - Items *[]InstanceListInstance `json:"items,omitempty"` + Count ListInstancesResponseGetCountAttributeType `json:"count,omitempty"` + Items ListInstancesResponseGetItemsAttributeType `json:"items,omitempty"` } // NewListInstancesResponse instantiates a new ListInstancesResponse object @@ -41,76 +81,58 @@ func NewListInstancesResponseWithDefaults() *ListInstancesResponse { } // GetCount returns the Count field value if set, zero value otherwise. -func (o *ListInstancesResponse) GetCount() *int64 { - if o == nil || IsNil(o.Count) { - var ret *int64 - return ret - } - return o.Count +func (o *ListInstancesResponse) GetCount() (res ListInstancesResponseGetCountRetType) { + res, _ = o.GetCountOk() + return } // GetCountOk returns a tuple with the Count field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListInstancesResponse) GetCountOk() (*int64, bool) { - if o == nil || IsNil(o.Count) { - return nil, false - } - return o.Count, true +func (o *ListInstancesResponse) GetCountOk() (ret ListInstancesResponseGetCountRetType, ok bool) { + return getListInstancesResponseGetCountAttributeTypeOk(o.Count) } // HasCount returns a boolean if a field has been set. func (o *ListInstancesResponse) HasCount() bool { - if o != nil && !IsNil(o.Count) { - return true - } - - return false + _, ok := o.GetCountOk() + return ok } // SetCount gets a reference to the given int64 and assigns it to the Count field. -func (o *ListInstancesResponse) SetCount(v *int64) { - o.Count = v +func (o *ListInstancesResponse) SetCount(v ListInstancesResponseGetCountRetType) { + setListInstancesResponseGetCountAttributeType(&o.Count, v) } // GetItems returns the Items field value if set, zero value otherwise. -func (o *ListInstancesResponse) GetItems() *[]InstanceListInstance { - if o == nil || IsNil(o.Items) { - var ret *[]InstanceListInstance - return ret - } - return o.Items +func (o *ListInstancesResponse) GetItems() (res ListInstancesResponseGetItemsRetType) { + res, _ = o.GetItemsOk() + return } // GetItemsOk returns a tuple with the Items field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListInstancesResponse) GetItemsOk() (*[]InstanceListInstance, bool) { - if o == nil || IsNil(o.Items) { - return nil, false - } - return o.Items, true +func (o *ListInstancesResponse) GetItemsOk() (ret ListInstancesResponseGetItemsRetType, ok bool) { + return getListInstancesResponseGetItemsAttributeTypeOk(o.Items) } // HasItems returns a boolean if a field has been set. func (o *ListInstancesResponse) HasItems() bool { - if o != nil && !IsNil(o.Items) { - return true - } - - return false + _, ok := o.GetItemsOk() + return ok } // SetItems gets a reference to the given []InstanceListInstance and assigns it to the Items field. -func (o *ListInstancesResponse) SetItems(v *[]InstanceListInstance) { - o.Items = v +func (o *ListInstancesResponse) SetItems(v ListInstancesResponseGetItemsRetType) { + setListInstancesResponseGetItemsAttributeType(&o.Items, v) } func (o ListInstancesResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Count) { - toSerialize["count"] = o.Count + if val, ok := getListInstancesResponseGetCountAttributeTypeOk(o.Count); ok { + toSerialize["Count"] = val } - if !IsNil(o.Items) { - toSerialize["items"] = o.Items + if val, ok := getListInstancesResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_list_storages_response.go b/services/postgresflex/model_list_storages_response.go index d08cd34e2..924970d0b 100644 --- a/services/postgresflex/model_list_storages_response.go +++ b/services/postgresflex/model_list_storages_response.go @@ -17,10 +17,50 @@ import ( // checks if the ListStoragesResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ListStoragesResponse{} +/* + types and functions for storageClasses +*/ + +// isArray +type ListStoragesResponseGetStorageClassesAttributeType = *[]string +type ListStoragesResponseGetStorageClassesArgType = []string +type ListStoragesResponseGetStorageClassesRetType = []string + +func getListStoragesResponseGetStorageClassesAttributeTypeOk(arg ListStoragesResponseGetStorageClassesAttributeType) (ret ListStoragesResponseGetStorageClassesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListStoragesResponseGetStorageClassesAttributeType(arg *ListStoragesResponseGetStorageClassesAttributeType, val ListStoragesResponseGetStorageClassesRetType) { + *arg = &val +} + +/* + types and functions for storageRange +*/ + +// isModel +type ListStoragesResponseGetStorageRangeAttributeType = *StorageRange +type ListStoragesResponseGetStorageRangeArgType = StorageRange +type ListStoragesResponseGetStorageRangeRetType = StorageRange + +func getListStoragesResponseGetStorageRangeAttributeTypeOk(arg ListStoragesResponseGetStorageRangeAttributeType) (ret ListStoragesResponseGetStorageRangeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListStoragesResponseGetStorageRangeAttributeType(arg *ListStoragesResponseGetStorageRangeAttributeType, val ListStoragesResponseGetStorageRangeRetType) { + *arg = &val +} + // ListStoragesResponse struct for ListStoragesResponse type ListStoragesResponse struct { - StorageClasses *[]string `json:"storageClasses,omitempty"` - StorageRange *StorageRange `json:"storageRange,omitempty"` + StorageClasses ListStoragesResponseGetStorageClassesAttributeType `json:"storageClasses,omitempty"` + StorageRange ListStoragesResponseGetStorageRangeAttributeType `json:"storageRange,omitempty"` } // NewListStoragesResponse instantiates a new ListStoragesResponse object @@ -41,76 +81,58 @@ func NewListStoragesResponseWithDefaults() *ListStoragesResponse { } // GetStorageClasses returns the StorageClasses field value if set, zero value otherwise. -func (o *ListStoragesResponse) GetStorageClasses() *[]string { - if o == nil || IsNil(o.StorageClasses) { - var ret *[]string - return ret - } - return o.StorageClasses +func (o *ListStoragesResponse) GetStorageClasses() (res ListStoragesResponseGetStorageClassesRetType) { + res, _ = o.GetStorageClassesOk() + return } // GetStorageClassesOk returns a tuple with the StorageClasses field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListStoragesResponse) GetStorageClassesOk() (*[]string, bool) { - if o == nil || IsNil(o.StorageClasses) { - return nil, false - } - return o.StorageClasses, true +func (o *ListStoragesResponse) GetStorageClassesOk() (ret ListStoragesResponseGetStorageClassesRetType, ok bool) { + return getListStoragesResponseGetStorageClassesAttributeTypeOk(o.StorageClasses) } // HasStorageClasses returns a boolean if a field has been set. func (o *ListStoragesResponse) HasStorageClasses() bool { - if o != nil && !IsNil(o.StorageClasses) { - return true - } - - return false + _, ok := o.GetStorageClassesOk() + return ok } // SetStorageClasses gets a reference to the given []string and assigns it to the StorageClasses field. -func (o *ListStoragesResponse) SetStorageClasses(v *[]string) { - o.StorageClasses = v +func (o *ListStoragesResponse) SetStorageClasses(v ListStoragesResponseGetStorageClassesRetType) { + setListStoragesResponseGetStorageClassesAttributeType(&o.StorageClasses, v) } // GetStorageRange returns the StorageRange field value if set, zero value otherwise. -func (o *ListStoragesResponse) GetStorageRange() *StorageRange { - if o == nil || IsNil(o.StorageRange) { - var ret *StorageRange - return ret - } - return o.StorageRange +func (o *ListStoragesResponse) GetStorageRange() (res ListStoragesResponseGetStorageRangeRetType) { + res, _ = o.GetStorageRangeOk() + return } // GetStorageRangeOk returns a tuple with the StorageRange field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListStoragesResponse) GetStorageRangeOk() (*StorageRange, bool) { - if o == nil || IsNil(o.StorageRange) { - return nil, false - } - return o.StorageRange, true +func (o *ListStoragesResponse) GetStorageRangeOk() (ret ListStoragesResponseGetStorageRangeRetType, ok bool) { + return getListStoragesResponseGetStorageRangeAttributeTypeOk(o.StorageRange) } // HasStorageRange returns a boolean if a field has been set. func (o *ListStoragesResponse) HasStorageRange() bool { - if o != nil && !IsNil(o.StorageRange) { - return true - } - - return false + _, ok := o.GetStorageRangeOk() + return ok } // SetStorageRange gets a reference to the given StorageRange and assigns it to the StorageRange field. -func (o *ListStoragesResponse) SetStorageRange(v *StorageRange) { - o.StorageRange = v +func (o *ListStoragesResponse) SetStorageRange(v ListStoragesResponseGetStorageRangeRetType) { + setListStoragesResponseGetStorageRangeAttributeType(&o.StorageRange, v) } func (o ListStoragesResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.StorageClasses) { - toSerialize["storageClasses"] = o.StorageClasses + if val, ok := getListStoragesResponseGetStorageClassesAttributeTypeOk(o.StorageClasses); ok { + toSerialize["StorageClasses"] = val } - if !IsNil(o.StorageRange) { - toSerialize["storageRange"] = o.StorageRange + if val, ok := getListStoragesResponseGetStorageRangeAttributeTypeOk(o.StorageRange); ok { + toSerialize["StorageRange"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_list_users_response.go b/services/postgresflex/model_list_users_response.go index a18bf8936..c9b934c87 100644 --- a/services/postgresflex/model_list_users_response.go +++ b/services/postgresflex/model_list_users_response.go @@ -17,10 +17,50 @@ import ( // checks if the ListUsersResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ListUsersResponse{} +/* + types and functions for count +*/ + +// isLong +type ListUsersResponseGetCountAttributeType = *int64 +type ListUsersResponseGetCountArgType = int64 +type ListUsersResponseGetCountRetType = int64 + +func getListUsersResponseGetCountAttributeTypeOk(arg ListUsersResponseGetCountAttributeType) (ret ListUsersResponseGetCountRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListUsersResponseGetCountAttributeType(arg *ListUsersResponseGetCountAttributeType, val ListUsersResponseGetCountRetType) { + *arg = &val +} + +/* + types and functions for items +*/ + +// isArray +type ListUsersResponseGetItemsAttributeType = *[]ListUsersResponseItem +type ListUsersResponseGetItemsArgType = []ListUsersResponseItem +type ListUsersResponseGetItemsRetType = []ListUsersResponseItem + +func getListUsersResponseGetItemsAttributeTypeOk(arg ListUsersResponseGetItemsAttributeType) (ret ListUsersResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListUsersResponseGetItemsAttributeType(arg *ListUsersResponseGetItemsAttributeType, val ListUsersResponseGetItemsRetType) { + *arg = &val +} + // ListUsersResponse struct for ListUsersResponse type ListUsersResponse struct { - Count *int64 `json:"count,omitempty"` - Items *[]ListUsersResponseItem `json:"items,omitempty"` + Count ListUsersResponseGetCountAttributeType `json:"count,omitempty"` + Items ListUsersResponseGetItemsAttributeType `json:"items,omitempty"` } // NewListUsersResponse instantiates a new ListUsersResponse object @@ -41,76 +81,58 @@ func NewListUsersResponseWithDefaults() *ListUsersResponse { } // GetCount returns the Count field value if set, zero value otherwise. -func (o *ListUsersResponse) GetCount() *int64 { - if o == nil || IsNil(o.Count) { - var ret *int64 - return ret - } - return o.Count +func (o *ListUsersResponse) GetCount() (res ListUsersResponseGetCountRetType) { + res, _ = o.GetCountOk() + return } // GetCountOk returns a tuple with the Count field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListUsersResponse) GetCountOk() (*int64, bool) { - if o == nil || IsNil(o.Count) { - return nil, false - } - return o.Count, true +func (o *ListUsersResponse) GetCountOk() (ret ListUsersResponseGetCountRetType, ok bool) { + return getListUsersResponseGetCountAttributeTypeOk(o.Count) } // HasCount returns a boolean if a field has been set. func (o *ListUsersResponse) HasCount() bool { - if o != nil && !IsNil(o.Count) { - return true - } - - return false + _, ok := o.GetCountOk() + return ok } // SetCount gets a reference to the given int64 and assigns it to the Count field. -func (o *ListUsersResponse) SetCount(v *int64) { - o.Count = v +func (o *ListUsersResponse) SetCount(v ListUsersResponseGetCountRetType) { + setListUsersResponseGetCountAttributeType(&o.Count, v) } // GetItems returns the Items field value if set, zero value otherwise. -func (o *ListUsersResponse) GetItems() *[]ListUsersResponseItem { - if o == nil || IsNil(o.Items) { - var ret *[]ListUsersResponseItem - return ret - } - return o.Items +func (o *ListUsersResponse) GetItems() (res ListUsersResponseGetItemsRetType) { + res, _ = o.GetItemsOk() + return } // GetItemsOk returns a tuple with the Items field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListUsersResponse) GetItemsOk() (*[]ListUsersResponseItem, bool) { - if o == nil || IsNil(o.Items) { - return nil, false - } - return o.Items, true +func (o *ListUsersResponse) GetItemsOk() (ret ListUsersResponseGetItemsRetType, ok bool) { + return getListUsersResponseGetItemsAttributeTypeOk(o.Items) } // HasItems returns a boolean if a field has been set. func (o *ListUsersResponse) HasItems() bool { - if o != nil && !IsNil(o.Items) { - return true - } - - return false + _, ok := o.GetItemsOk() + return ok } // SetItems gets a reference to the given []ListUsersResponseItem and assigns it to the Items field. -func (o *ListUsersResponse) SetItems(v *[]ListUsersResponseItem) { - o.Items = v +func (o *ListUsersResponse) SetItems(v ListUsersResponseGetItemsRetType) { + setListUsersResponseGetItemsAttributeType(&o.Items, v) } func (o ListUsersResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Count) { - toSerialize["count"] = o.Count + if val, ok := getListUsersResponseGetCountAttributeTypeOk(o.Count); ok { + toSerialize["Count"] = val } - if !IsNil(o.Items) { - toSerialize["items"] = o.Items + if val, ok := getListUsersResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_list_users_response_item.go b/services/postgresflex/model_list_users_response_item.go index eed4d1f8e..f43274641 100644 --- a/services/postgresflex/model_list_users_response_item.go +++ b/services/postgresflex/model_list_users_response_item.go @@ -17,10 +17,52 @@ import ( // checks if the ListUsersResponseItem type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ListUsersResponseItem{} +/* + types and functions for id +*/ + +// isNotNullableString +type ListUsersResponseItemGetIdAttributeType = *string + +func getListUsersResponseItemGetIdAttributeTypeOk(arg ListUsersResponseItemGetIdAttributeType) (ret ListUsersResponseItemGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListUsersResponseItemGetIdAttributeType(arg *ListUsersResponseItemGetIdAttributeType, val ListUsersResponseItemGetIdRetType) { + *arg = &val +} + +type ListUsersResponseItemGetIdArgType = string +type ListUsersResponseItemGetIdRetType = string + +/* + types and functions for username +*/ + +// isNotNullableString +type ListUsersResponseItemGetUsernameAttributeType = *string + +func getListUsersResponseItemGetUsernameAttributeTypeOk(arg ListUsersResponseItemGetUsernameAttributeType) (ret ListUsersResponseItemGetUsernameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListUsersResponseItemGetUsernameAttributeType(arg *ListUsersResponseItemGetUsernameAttributeType, val ListUsersResponseItemGetUsernameRetType) { + *arg = &val +} + +type ListUsersResponseItemGetUsernameArgType = string +type ListUsersResponseItemGetUsernameRetType = string + // ListUsersResponseItem struct for ListUsersResponseItem type ListUsersResponseItem struct { - Id *string `json:"id,omitempty"` - Username *string `json:"username,omitempty"` + Id ListUsersResponseItemGetIdAttributeType `json:"id,omitempty"` + Username ListUsersResponseItemGetUsernameAttributeType `json:"username,omitempty"` } // NewListUsersResponseItem instantiates a new ListUsersResponseItem object @@ -41,76 +83,58 @@ func NewListUsersResponseItemWithDefaults() *ListUsersResponseItem { } // GetId returns the Id field value if set, zero value otherwise. -func (o *ListUsersResponseItem) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *ListUsersResponseItem) GetId() (res ListUsersResponseItemGetIdRetType) { + res, _ = o.GetIdOk() + return } // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListUsersResponseItem) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *ListUsersResponseItem) GetIdOk() (ret ListUsersResponseItemGetIdRetType, ok bool) { + return getListUsersResponseItemGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *ListUsersResponseItem) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false + _, ok := o.GetIdOk() + return ok } // SetId gets a reference to the given string and assigns it to the Id field. -func (o *ListUsersResponseItem) SetId(v *string) { - o.Id = v +func (o *ListUsersResponseItem) SetId(v ListUsersResponseItemGetIdRetType) { + setListUsersResponseItemGetIdAttributeType(&o.Id, v) } // GetUsername returns the Username field value if set, zero value otherwise. -func (o *ListUsersResponseItem) GetUsername() *string { - if o == nil || IsNil(o.Username) { - var ret *string - return ret - } - return o.Username +func (o *ListUsersResponseItem) GetUsername() (res ListUsersResponseItemGetUsernameRetType) { + res, _ = o.GetUsernameOk() + return } // GetUsernameOk returns a tuple with the Username field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListUsersResponseItem) GetUsernameOk() (*string, bool) { - if o == nil || IsNil(o.Username) { - return nil, false - } - return o.Username, true +func (o *ListUsersResponseItem) GetUsernameOk() (ret ListUsersResponseItemGetUsernameRetType, ok bool) { + return getListUsersResponseItemGetUsernameAttributeTypeOk(o.Username) } // HasUsername returns a boolean if a field has been set. func (o *ListUsersResponseItem) HasUsername() bool { - if o != nil && !IsNil(o.Username) { - return true - } - - return false + _, ok := o.GetUsernameOk() + return ok } // SetUsername gets a reference to the given string and assigns it to the Username field. -func (o *ListUsersResponseItem) SetUsername(v *string) { - o.Username = v +func (o *ListUsersResponseItem) SetUsername(v ListUsersResponseItemGetUsernameRetType) { + setListUsersResponseItemGetUsernameAttributeType(&o.Username, v) } func (o ListUsersResponseItem) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getListUsersResponseItemGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.Username) { - toSerialize["username"] = o.Username + if val, ok := getListUsersResponseItemGetUsernameAttributeTypeOk(o.Username); ok { + toSerialize["Username"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_list_versions_response.go b/services/postgresflex/model_list_versions_response.go index 1a1323765..83a01701c 100644 --- a/services/postgresflex/model_list_versions_response.go +++ b/services/postgresflex/model_list_versions_response.go @@ -17,9 +17,29 @@ import ( // checks if the ListVersionsResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ListVersionsResponse{} +/* + types and functions for versions +*/ + +// isArray +type ListVersionsResponseGetVersionsAttributeType = *[]string +type ListVersionsResponseGetVersionsArgType = []string +type ListVersionsResponseGetVersionsRetType = []string + +func getListVersionsResponseGetVersionsAttributeTypeOk(arg ListVersionsResponseGetVersionsAttributeType) (ret ListVersionsResponseGetVersionsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListVersionsResponseGetVersionsAttributeType(arg *ListVersionsResponseGetVersionsAttributeType, val ListVersionsResponseGetVersionsRetType) { + *arg = &val +} + // ListVersionsResponse struct for ListVersionsResponse type ListVersionsResponse struct { - Versions *[]string `json:"versions,omitempty"` + Versions ListVersionsResponseGetVersionsAttributeType `json:"versions,omitempty"` } // NewListVersionsResponse instantiates a new ListVersionsResponse object @@ -40,41 +60,32 @@ func NewListVersionsResponseWithDefaults() *ListVersionsResponse { } // GetVersions returns the Versions field value if set, zero value otherwise. -func (o *ListVersionsResponse) GetVersions() *[]string { - if o == nil || IsNil(o.Versions) { - var ret *[]string - return ret - } - return o.Versions +func (o *ListVersionsResponse) GetVersions() (res ListVersionsResponseGetVersionsRetType) { + res, _ = o.GetVersionsOk() + return } // GetVersionsOk returns a tuple with the Versions field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListVersionsResponse) GetVersionsOk() (*[]string, bool) { - if o == nil || IsNil(o.Versions) { - return nil, false - } - return o.Versions, true +func (o *ListVersionsResponse) GetVersionsOk() (ret ListVersionsResponseGetVersionsRetType, ok bool) { + return getListVersionsResponseGetVersionsAttributeTypeOk(o.Versions) } // HasVersions returns a boolean if a field has been set. func (o *ListVersionsResponse) HasVersions() bool { - if o != nil && !IsNil(o.Versions) { - return true - } - - return false + _, ok := o.GetVersionsOk() + return ok } // SetVersions gets a reference to the given []string and assigns it to the Versions field. -func (o *ListVersionsResponse) SetVersions(v *[]string) { - o.Versions = v +func (o *ListVersionsResponse) SetVersions(v ListVersionsResponseGetVersionsRetType) { + setListVersionsResponseGetVersionsAttributeType(&o.Versions, v) } func (o ListVersionsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Versions) { - toSerialize["versions"] = o.Versions + if val, ok := getListVersionsResponseGetVersionsAttributeTypeOk(o.Versions); ok { + toSerialize["Versions"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_partial_update_instance_payload.go b/services/postgresflex/model_partial_update_instance_payload.go index 87961874d..2db7f1e8f 100644 --- a/services/postgresflex/model_partial_update_instance_payload.go +++ b/services/postgresflex/model_partial_update_instance_payload.go @@ -17,19 +17,203 @@ import ( // checks if the PartialUpdateInstancePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &PartialUpdateInstancePayload{} +/* + types and functions for acl +*/ + +// isModel +type PartialUpdateInstancePayloadGetAclAttributeType = *ACL +type PartialUpdateInstancePayloadGetAclArgType = ACL +type PartialUpdateInstancePayloadGetAclRetType = ACL + +func getPartialUpdateInstancePayloadGetAclAttributeTypeOk(arg PartialUpdateInstancePayloadGetAclAttributeType) (ret PartialUpdateInstancePayloadGetAclRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateInstancePayloadGetAclAttributeType(arg *PartialUpdateInstancePayloadGetAclAttributeType, val PartialUpdateInstancePayloadGetAclRetType) { + *arg = &val +} + +/* + types and functions for backupSchedule +*/ + +// isNotNullableString +type PartialUpdateInstancePayloadGetBackupScheduleAttributeType = *string + +func getPartialUpdateInstancePayloadGetBackupScheduleAttributeTypeOk(arg PartialUpdateInstancePayloadGetBackupScheduleAttributeType) (ret PartialUpdateInstancePayloadGetBackupScheduleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateInstancePayloadGetBackupScheduleAttributeType(arg *PartialUpdateInstancePayloadGetBackupScheduleAttributeType, val PartialUpdateInstancePayloadGetBackupScheduleRetType) { + *arg = &val +} + +type PartialUpdateInstancePayloadGetBackupScheduleArgType = string +type PartialUpdateInstancePayloadGetBackupScheduleRetType = string + +/* + types and functions for flavorId +*/ + +// isNotNullableString +type PartialUpdateInstancePayloadGetFlavorIdAttributeType = *string + +func getPartialUpdateInstancePayloadGetFlavorIdAttributeTypeOk(arg PartialUpdateInstancePayloadGetFlavorIdAttributeType) (ret PartialUpdateInstancePayloadGetFlavorIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateInstancePayloadGetFlavorIdAttributeType(arg *PartialUpdateInstancePayloadGetFlavorIdAttributeType, val PartialUpdateInstancePayloadGetFlavorIdRetType) { + *arg = &val +} + +type PartialUpdateInstancePayloadGetFlavorIdArgType = string +type PartialUpdateInstancePayloadGetFlavorIdRetType = string + +/* + types and functions for labels +*/ + +// isContainer +type PartialUpdateInstancePayloadGetLabelsAttributeType = *map[string]string +type PartialUpdateInstancePayloadGetLabelsArgType = map[string]string +type PartialUpdateInstancePayloadGetLabelsRetType = map[string]string + +func getPartialUpdateInstancePayloadGetLabelsAttributeTypeOk(arg PartialUpdateInstancePayloadGetLabelsAttributeType) (ret PartialUpdateInstancePayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateInstancePayloadGetLabelsAttributeType(arg *PartialUpdateInstancePayloadGetLabelsAttributeType, val PartialUpdateInstancePayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type PartialUpdateInstancePayloadGetNameAttributeType = *string + +func getPartialUpdateInstancePayloadGetNameAttributeTypeOk(arg PartialUpdateInstancePayloadGetNameAttributeType) (ret PartialUpdateInstancePayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateInstancePayloadGetNameAttributeType(arg *PartialUpdateInstancePayloadGetNameAttributeType, val PartialUpdateInstancePayloadGetNameRetType) { + *arg = &val +} + +type PartialUpdateInstancePayloadGetNameArgType = string +type PartialUpdateInstancePayloadGetNameRetType = string + +/* + types and functions for options +*/ + +// isContainer +type PartialUpdateInstancePayloadGetOptionsAttributeType = *map[string]string +type PartialUpdateInstancePayloadGetOptionsArgType = map[string]string +type PartialUpdateInstancePayloadGetOptionsRetType = map[string]string + +func getPartialUpdateInstancePayloadGetOptionsAttributeTypeOk(arg PartialUpdateInstancePayloadGetOptionsAttributeType) (ret PartialUpdateInstancePayloadGetOptionsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateInstancePayloadGetOptionsAttributeType(arg *PartialUpdateInstancePayloadGetOptionsAttributeType, val PartialUpdateInstancePayloadGetOptionsRetType) { + *arg = &val +} + +/* + types and functions for replicas +*/ + +// isInteger +type PartialUpdateInstancePayloadGetReplicasAttributeType = *int64 +type PartialUpdateInstancePayloadGetReplicasArgType = int64 +type PartialUpdateInstancePayloadGetReplicasRetType = int64 + +func getPartialUpdateInstancePayloadGetReplicasAttributeTypeOk(arg PartialUpdateInstancePayloadGetReplicasAttributeType) (ret PartialUpdateInstancePayloadGetReplicasRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateInstancePayloadGetReplicasAttributeType(arg *PartialUpdateInstancePayloadGetReplicasAttributeType, val PartialUpdateInstancePayloadGetReplicasRetType) { + *arg = &val +} + +/* + types and functions for storage +*/ + +// isModel +type PartialUpdateInstancePayloadGetStorageAttributeType = *Storage +type PartialUpdateInstancePayloadGetStorageArgType = Storage +type PartialUpdateInstancePayloadGetStorageRetType = Storage + +func getPartialUpdateInstancePayloadGetStorageAttributeTypeOk(arg PartialUpdateInstancePayloadGetStorageAttributeType) (ret PartialUpdateInstancePayloadGetStorageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateInstancePayloadGetStorageAttributeType(arg *PartialUpdateInstancePayloadGetStorageAttributeType, val PartialUpdateInstancePayloadGetStorageRetType) { + *arg = &val +} + +/* + types and functions for version +*/ + +// isNotNullableString +type PartialUpdateInstancePayloadGetVersionAttributeType = *string + +func getPartialUpdateInstancePayloadGetVersionAttributeTypeOk(arg PartialUpdateInstancePayloadGetVersionAttributeType) (ret PartialUpdateInstancePayloadGetVersionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateInstancePayloadGetVersionAttributeType(arg *PartialUpdateInstancePayloadGetVersionAttributeType, val PartialUpdateInstancePayloadGetVersionRetType) { + *arg = &val +} + +type PartialUpdateInstancePayloadGetVersionArgType = string +type PartialUpdateInstancePayloadGetVersionRetType = string + // PartialUpdateInstancePayload struct for PartialUpdateInstancePayload type PartialUpdateInstancePayload struct { - Acl *ACL `json:"acl,omitempty"` - BackupSchedule *string `json:"backupSchedule,omitempty"` - FlavorId *string `json:"flavorId,omitempty"` + Acl PartialUpdateInstancePayloadGetAclAttributeType `json:"acl,omitempty"` + BackupSchedule PartialUpdateInstancePayloadGetBackupScheduleAttributeType `json:"backupSchedule,omitempty"` + FlavorId PartialUpdateInstancePayloadGetFlavorIdAttributeType `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"` + Labels PartialUpdateInstancePayloadGetLabelsAttributeType `json:"labels,omitempty"` + Name PartialUpdateInstancePayloadGetNameAttributeType `json:"name,omitempty"` + Options PartialUpdateInstancePayloadGetOptionsAttributeType `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"` + Replicas PartialUpdateInstancePayloadGetReplicasAttributeType `json:"replicas,omitempty"` + Storage PartialUpdateInstancePayloadGetStorageAttributeType `json:"storage,omitempty"` + Version PartialUpdateInstancePayloadGetVersionAttributeType `json:"version,omitempty"` } // NewPartialUpdateInstancePayload instantiates a new PartialUpdateInstancePayload object @@ -50,321 +234,240 @@ func NewPartialUpdateInstancePayloadWithDefaults() *PartialUpdateInstancePayload } // GetAcl returns the Acl field value if set, zero value otherwise. -func (o *PartialUpdateInstancePayload) GetAcl() *ACL { - if o == nil || IsNil(o.Acl) { - var ret *ACL - return ret - } - return o.Acl +func (o *PartialUpdateInstancePayload) GetAcl() (res PartialUpdateInstancePayloadGetAclRetType) { + res, _ = o.GetAclOk() + return } // GetAclOk returns a tuple with the Acl field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PartialUpdateInstancePayload) GetAclOk() (*ACL, bool) { - if o == nil || IsNil(o.Acl) { - return nil, false - } - return o.Acl, true +func (o *PartialUpdateInstancePayload) GetAclOk() (ret PartialUpdateInstancePayloadGetAclRetType, ok bool) { + return getPartialUpdateInstancePayloadGetAclAttributeTypeOk(o.Acl) } // HasAcl returns a boolean if a field has been set. func (o *PartialUpdateInstancePayload) HasAcl() bool { - if o != nil && !IsNil(o.Acl) { - return true - } - - return false + _, ok := o.GetAclOk() + return ok } // SetAcl gets a reference to the given ACL and assigns it to the Acl field. -func (o *PartialUpdateInstancePayload) SetAcl(v *ACL) { - o.Acl = v +func (o *PartialUpdateInstancePayload) SetAcl(v PartialUpdateInstancePayloadGetAclRetType) { + setPartialUpdateInstancePayloadGetAclAttributeType(&o.Acl, v) } // GetBackupSchedule returns the BackupSchedule field value if set, zero value otherwise. -func (o *PartialUpdateInstancePayload) GetBackupSchedule() *string { - if o == nil || IsNil(o.BackupSchedule) { - var ret *string - return ret - } - return o.BackupSchedule +func (o *PartialUpdateInstancePayload) GetBackupSchedule() (res PartialUpdateInstancePayloadGetBackupScheduleRetType) { + res, _ = o.GetBackupScheduleOk() + return } // GetBackupScheduleOk returns a tuple with the BackupSchedule field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PartialUpdateInstancePayload) GetBackupScheduleOk() (*string, bool) { - if o == nil || IsNil(o.BackupSchedule) { - return nil, false - } - return o.BackupSchedule, true +func (o *PartialUpdateInstancePayload) GetBackupScheduleOk() (ret PartialUpdateInstancePayloadGetBackupScheduleRetType, ok bool) { + return getPartialUpdateInstancePayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule) } // HasBackupSchedule returns a boolean if a field has been set. func (o *PartialUpdateInstancePayload) HasBackupSchedule() bool { - if o != nil && !IsNil(o.BackupSchedule) { - return true - } - - return false + _, ok := o.GetBackupScheduleOk() + return ok } // SetBackupSchedule gets a reference to the given string and assigns it to the BackupSchedule field. -func (o *PartialUpdateInstancePayload) SetBackupSchedule(v *string) { - o.BackupSchedule = v +func (o *PartialUpdateInstancePayload) SetBackupSchedule(v PartialUpdateInstancePayloadGetBackupScheduleRetType) { + setPartialUpdateInstancePayloadGetBackupScheduleAttributeType(&o.BackupSchedule, v) } // GetFlavorId returns the FlavorId field value if set, zero value otherwise. -func (o *PartialUpdateInstancePayload) GetFlavorId() *string { - if o == nil || IsNil(o.FlavorId) { - var ret *string - return ret - } - return o.FlavorId +func (o *PartialUpdateInstancePayload) GetFlavorId() (res PartialUpdateInstancePayloadGetFlavorIdRetType) { + res, _ = o.GetFlavorIdOk() + return } // GetFlavorIdOk returns a tuple with the FlavorId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PartialUpdateInstancePayload) GetFlavorIdOk() (*string, bool) { - if o == nil || IsNil(o.FlavorId) { - return nil, false - } - return o.FlavorId, true +func (o *PartialUpdateInstancePayload) GetFlavorIdOk() (ret PartialUpdateInstancePayloadGetFlavorIdRetType, ok bool) { + return getPartialUpdateInstancePayloadGetFlavorIdAttributeTypeOk(o.FlavorId) } // HasFlavorId returns a boolean if a field has been set. func (o *PartialUpdateInstancePayload) HasFlavorId() bool { - if o != nil && !IsNil(o.FlavorId) { - return true - } - - return false + _, ok := o.GetFlavorIdOk() + return ok } // SetFlavorId gets a reference to the given string and assigns it to the FlavorId field. -func (o *PartialUpdateInstancePayload) SetFlavorId(v *string) { - o.FlavorId = v +func (o *PartialUpdateInstancePayload) SetFlavorId(v PartialUpdateInstancePayloadGetFlavorIdRetType) { + setPartialUpdateInstancePayloadGetFlavorIdAttributeType(&o.FlavorId, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *PartialUpdateInstancePayload) GetLabels() *map[string]string { - if o == nil || IsNil(o.Labels) { - var ret *map[string]string - return ret - } - return o.Labels +func (o *PartialUpdateInstancePayload) GetLabels() (res PartialUpdateInstancePayloadGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return } // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PartialUpdateInstancePayload) GetLabelsOk() (*map[string]string, bool) { - if o == nil || IsNil(o.Labels) { - return nil, false - } - return o.Labels, true +func (o *PartialUpdateInstancePayload) GetLabelsOk() (ret PartialUpdateInstancePayloadGetLabelsRetType, ok bool) { + return getPartialUpdateInstancePayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *PartialUpdateInstancePayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false + _, ok := o.GetLabelsOk() + return ok } // SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. -func (o *PartialUpdateInstancePayload) SetLabels(v *map[string]string) { - o.Labels = v +func (o *PartialUpdateInstancePayload) SetLabels(v PartialUpdateInstancePayloadGetLabelsRetType) { + setPartialUpdateInstancePayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *PartialUpdateInstancePayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *PartialUpdateInstancePayload) GetName() (res PartialUpdateInstancePayloadGetNameRetType) { + res, _ = o.GetNameOk() + return } // 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 *PartialUpdateInstancePayload) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *PartialUpdateInstancePayload) GetNameOk() (ret PartialUpdateInstancePayloadGetNameRetType, ok bool) { + return getPartialUpdateInstancePayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *PartialUpdateInstancePayload) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false + _, ok := o.GetNameOk() + return ok } // SetName gets a reference to the given string and assigns it to the Name field. -func (o *PartialUpdateInstancePayload) SetName(v *string) { - o.Name = v +func (o *PartialUpdateInstancePayload) SetName(v PartialUpdateInstancePayloadGetNameRetType) { + setPartialUpdateInstancePayloadGetNameAttributeType(&o.Name, v) } // GetOptions returns the Options field value if set, zero value otherwise. -func (o *PartialUpdateInstancePayload) GetOptions() *map[string]string { - if o == nil || IsNil(o.Options) { - var ret *map[string]string - return ret - } - return o.Options +func (o *PartialUpdateInstancePayload) GetOptions() (res PartialUpdateInstancePayloadGetOptionsRetType) { + res, _ = o.GetOptionsOk() + return } // GetOptionsOk returns a tuple with the Options field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PartialUpdateInstancePayload) GetOptionsOk() (*map[string]string, bool) { - if o == nil || IsNil(o.Options) { - return nil, false - } - return o.Options, true +func (o *PartialUpdateInstancePayload) GetOptionsOk() (ret PartialUpdateInstancePayloadGetOptionsRetType, ok bool) { + return getPartialUpdateInstancePayloadGetOptionsAttributeTypeOk(o.Options) } // HasOptions returns a boolean if a field has been set. func (o *PartialUpdateInstancePayload) HasOptions() bool { - if o != nil && !IsNil(o.Options) { - return true - } - - return false + _, ok := o.GetOptionsOk() + return ok } // SetOptions gets a reference to the given map[string]string and assigns it to the Options field. -func (o *PartialUpdateInstancePayload) SetOptions(v *map[string]string) { - o.Options = v +func (o *PartialUpdateInstancePayload) SetOptions(v PartialUpdateInstancePayloadGetOptionsRetType) { + setPartialUpdateInstancePayloadGetOptionsAttributeType(&o.Options, v) } // GetReplicas returns the Replicas field value if set, zero value otherwise. -func (o *PartialUpdateInstancePayload) GetReplicas() *int64 { - if o == nil || IsNil(o.Replicas) { - var ret *int64 - return ret - } - return o.Replicas +func (o *PartialUpdateInstancePayload) GetReplicas() (res PartialUpdateInstancePayloadGetReplicasRetType) { + res, _ = o.GetReplicasOk() + return } // GetReplicasOk returns a tuple with the Replicas field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PartialUpdateInstancePayload) GetReplicasOk() (*int64, bool) { - if o == nil || IsNil(o.Replicas) { - return nil, false - } - return o.Replicas, true +func (o *PartialUpdateInstancePayload) GetReplicasOk() (ret PartialUpdateInstancePayloadGetReplicasRetType, ok bool) { + return getPartialUpdateInstancePayloadGetReplicasAttributeTypeOk(o.Replicas) } // HasReplicas returns a boolean if a field has been set. func (o *PartialUpdateInstancePayload) HasReplicas() bool { - if o != nil && !IsNil(o.Replicas) { - return true - } - - return false + _, ok := o.GetReplicasOk() + return ok } // SetReplicas gets a reference to the given int64 and assigns it to the Replicas field. -func (o *PartialUpdateInstancePayload) SetReplicas(v *int64) { - o.Replicas = v +func (o *PartialUpdateInstancePayload) SetReplicas(v PartialUpdateInstancePayloadGetReplicasRetType) { + setPartialUpdateInstancePayloadGetReplicasAttributeType(&o.Replicas, v) } // GetStorage returns the Storage field value if set, zero value otherwise. -func (o *PartialUpdateInstancePayload) GetStorage() *Storage { - if o == nil || IsNil(o.Storage) { - var ret *Storage - return ret - } - return o.Storage +func (o *PartialUpdateInstancePayload) GetStorage() (res PartialUpdateInstancePayloadGetStorageRetType) { + res, _ = o.GetStorageOk() + return } // GetStorageOk returns a tuple with the Storage field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PartialUpdateInstancePayload) GetStorageOk() (*Storage, bool) { - if o == nil || IsNil(o.Storage) { - return nil, false - } - return o.Storage, true +func (o *PartialUpdateInstancePayload) GetStorageOk() (ret PartialUpdateInstancePayloadGetStorageRetType, ok bool) { + return getPartialUpdateInstancePayloadGetStorageAttributeTypeOk(o.Storage) } // HasStorage returns a boolean if a field has been set. func (o *PartialUpdateInstancePayload) HasStorage() bool { - if o != nil && !IsNil(o.Storage) { - return true - } - - return false + _, ok := o.GetStorageOk() + return ok } // SetStorage gets a reference to the given Storage and assigns it to the Storage field. -func (o *PartialUpdateInstancePayload) SetStorage(v *Storage) { - o.Storage = v +func (o *PartialUpdateInstancePayload) SetStorage(v PartialUpdateInstancePayloadGetStorageRetType) { + setPartialUpdateInstancePayloadGetStorageAttributeType(&o.Storage, v) } // GetVersion returns the Version field value if set, zero value otherwise. -func (o *PartialUpdateInstancePayload) GetVersion() *string { - if o == nil || IsNil(o.Version) { - var ret *string - return ret - } - return o.Version +func (o *PartialUpdateInstancePayload) GetVersion() (res PartialUpdateInstancePayloadGetVersionRetType) { + res, _ = o.GetVersionOk() + return } // GetVersionOk returns a tuple with the Version field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PartialUpdateInstancePayload) GetVersionOk() (*string, bool) { - if o == nil || IsNil(o.Version) { - return nil, false - } - return o.Version, true +func (o *PartialUpdateInstancePayload) GetVersionOk() (ret PartialUpdateInstancePayloadGetVersionRetType, ok bool) { + return getPartialUpdateInstancePayloadGetVersionAttributeTypeOk(o.Version) } // HasVersion returns a boolean if a field has been set. func (o *PartialUpdateInstancePayload) HasVersion() bool { - if o != nil && !IsNil(o.Version) { - return true - } - - return false + _, ok := o.GetVersionOk() + return ok } // SetVersion gets a reference to the given string and assigns it to the Version field. -func (o *PartialUpdateInstancePayload) SetVersion(v *string) { - o.Version = v +func (o *PartialUpdateInstancePayload) SetVersion(v PartialUpdateInstancePayloadGetVersionRetType) { + setPartialUpdateInstancePayloadGetVersionAttributeType(&o.Version, v) } func (o PartialUpdateInstancePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Acl) { - toSerialize["acl"] = o.Acl + if val, ok := getPartialUpdateInstancePayloadGetAclAttributeTypeOk(o.Acl); ok { + toSerialize["Acl"] = val } - if !IsNil(o.BackupSchedule) { - toSerialize["backupSchedule"] = o.BackupSchedule + if val, ok := getPartialUpdateInstancePayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule); ok { + toSerialize["BackupSchedule"] = val } - if !IsNil(o.FlavorId) { - toSerialize["flavorId"] = o.FlavorId + if val, ok := getPartialUpdateInstancePayloadGetFlavorIdAttributeTypeOk(o.FlavorId); ok { + toSerialize["FlavorId"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getPartialUpdateInstancePayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getPartialUpdateInstancePayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Options) { - toSerialize["options"] = o.Options + if val, ok := getPartialUpdateInstancePayloadGetOptionsAttributeTypeOk(o.Options); ok { + toSerialize["Options"] = val } - if !IsNil(o.Replicas) { - toSerialize["replicas"] = o.Replicas + if val, ok := getPartialUpdateInstancePayloadGetReplicasAttributeTypeOk(o.Replicas); ok { + toSerialize["Replicas"] = val } - if !IsNil(o.Storage) { - toSerialize["storage"] = o.Storage + if val, ok := getPartialUpdateInstancePayloadGetStorageAttributeTypeOk(o.Storage); ok { + toSerialize["Storage"] = val } - if !IsNil(o.Version) { - toSerialize["version"] = o.Version + if val, ok := getPartialUpdateInstancePayloadGetVersionAttributeTypeOk(o.Version); ok { + toSerialize["Version"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_partial_update_instance_response.go b/services/postgresflex/model_partial_update_instance_response.go index 472c91d78..74e90e25e 100644 --- a/services/postgresflex/model_partial_update_instance_response.go +++ b/services/postgresflex/model_partial_update_instance_response.go @@ -17,9 +17,29 @@ import ( // checks if the PartialUpdateInstanceResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &PartialUpdateInstanceResponse{} +/* + types and functions for item +*/ + +// isModel +type PartialUpdateInstanceResponseGetItemAttributeType = *Instance +type PartialUpdateInstanceResponseGetItemArgType = Instance +type PartialUpdateInstanceResponseGetItemRetType = Instance + +func getPartialUpdateInstanceResponseGetItemAttributeTypeOk(arg PartialUpdateInstanceResponseGetItemAttributeType) (ret PartialUpdateInstanceResponseGetItemRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateInstanceResponseGetItemAttributeType(arg *PartialUpdateInstanceResponseGetItemAttributeType, val PartialUpdateInstanceResponseGetItemRetType) { + *arg = &val +} + // PartialUpdateInstanceResponse struct for PartialUpdateInstanceResponse type PartialUpdateInstanceResponse struct { - Item *Instance `json:"item,omitempty"` + Item PartialUpdateInstanceResponseGetItemAttributeType `json:"item,omitempty"` } // NewPartialUpdateInstanceResponse instantiates a new PartialUpdateInstanceResponse object @@ -40,41 +60,32 @@ func NewPartialUpdateInstanceResponseWithDefaults() *PartialUpdateInstanceRespon } // GetItem returns the Item field value if set, zero value otherwise. -func (o *PartialUpdateInstanceResponse) GetItem() *Instance { - if o == nil || IsNil(o.Item) { - var ret *Instance - return ret - } - return o.Item +func (o *PartialUpdateInstanceResponse) GetItem() (res PartialUpdateInstanceResponseGetItemRetType) { + res, _ = o.GetItemOk() + return } // GetItemOk returns a tuple with the Item field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PartialUpdateInstanceResponse) GetItemOk() (*Instance, bool) { - if o == nil || IsNil(o.Item) { - return nil, false - } - return o.Item, true +func (o *PartialUpdateInstanceResponse) GetItemOk() (ret PartialUpdateInstanceResponseGetItemRetType, ok bool) { + return getPartialUpdateInstanceResponseGetItemAttributeTypeOk(o.Item) } // HasItem returns a boolean if a field has been set. func (o *PartialUpdateInstanceResponse) HasItem() bool { - if o != nil && !IsNil(o.Item) { - return true - } - - return false + _, ok := o.GetItemOk() + return ok } // SetItem gets a reference to the given Instance and assigns it to the Item field. -func (o *PartialUpdateInstanceResponse) SetItem(v *Instance) { - o.Item = v +func (o *PartialUpdateInstanceResponse) SetItem(v PartialUpdateInstanceResponseGetItemRetType) { + setPartialUpdateInstanceResponseGetItemAttributeType(&o.Item, v) } func (o PartialUpdateInstanceResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Item) { - toSerialize["item"] = o.Item + if val, ok := getPartialUpdateInstanceResponseGetItemAttributeTypeOk(o.Item); ok { + toSerialize["Item"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_partial_update_user_payload.go b/services/postgresflex/model_partial_update_user_payload.go index b6e53523b..a6c0ba631 100644 --- a/services/postgresflex/model_partial_update_user_payload.go +++ b/services/postgresflex/model_partial_update_user_payload.go @@ -17,10 +17,51 @@ import ( // checks if the PartialUpdateUserPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &PartialUpdateUserPayload{} +/* + types and functions for database +*/ + +// isNotNullableString +type PartialUpdateUserPayloadGetDatabaseAttributeType = *string + +func getPartialUpdateUserPayloadGetDatabaseAttributeTypeOk(arg PartialUpdateUserPayloadGetDatabaseAttributeType) (ret PartialUpdateUserPayloadGetDatabaseRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateUserPayloadGetDatabaseAttributeType(arg *PartialUpdateUserPayloadGetDatabaseAttributeType, val PartialUpdateUserPayloadGetDatabaseRetType) { + *arg = &val +} + +type PartialUpdateUserPayloadGetDatabaseArgType = string +type PartialUpdateUserPayloadGetDatabaseRetType = string + +/* + types and functions for roles +*/ + +// isArray +type PartialUpdateUserPayloadGetRolesAttributeType = *[]string +type PartialUpdateUserPayloadGetRolesArgType = []string +type PartialUpdateUserPayloadGetRolesRetType = []string + +func getPartialUpdateUserPayloadGetRolesAttributeTypeOk(arg PartialUpdateUserPayloadGetRolesAttributeType) (ret PartialUpdateUserPayloadGetRolesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateUserPayloadGetRolesAttributeType(arg *PartialUpdateUserPayloadGetRolesAttributeType, val PartialUpdateUserPayloadGetRolesRetType) { + *arg = &val +} + // PartialUpdateUserPayload struct for PartialUpdateUserPayload type PartialUpdateUserPayload struct { - Database *string `json:"database,omitempty"` - Roles *[]string `json:"roles,omitempty"` + Database PartialUpdateUserPayloadGetDatabaseAttributeType `json:"database,omitempty"` + Roles PartialUpdateUserPayloadGetRolesAttributeType `json:"roles,omitempty"` } // NewPartialUpdateUserPayload instantiates a new PartialUpdateUserPayload object @@ -41,76 +82,58 @@ func NewPartialUpdateUserPayloadWithDefaults() *PartialUpdateUserPayload { } // GetDatabase returns the Database field value if set, zero value otherwise. -func (o *PartialUpdateUserPayload) GetDatabase() *string { - if o == nil || IsNil(o.Database) { - var ret *string - return ret - } - return o.Database +func (o *PartialUpdateUserPayload) GetDatabase() (res PartialUpdateUserPayloadGetDatabaseRetType) { + res, _ = o.GetDatabaseOk() + return } // GetDatabaseOk returns a tuple with the Database field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PartialUpdateUserPayload) GetDatabaseOk() (*string, bool) { - if o == nil || IsNil(o.Database) { - return nil, false - } - return o.Database, true +func (o *PartialUpdateUserPayload) GetDatabaseOk() (ret PartialUpdateUserPayloadGetDatabaseRetType, ok bool) { + return getPartialUpdateUserPayloadGetDatabaseAttributeTypeOk(o.Database) } // HasDatabase returns a boolean if a field has been set. func (o *PartialUpdateUserPayload) HasDatabase() bool { - if o != nil && !IsNil(o.Database) { - return true - } - - return false + _, ok := o.GetDatabaseOk() + return ok } // SetDatabase gets a reference to the given string and assigns it to the Database field. -func (o *PartialUpdateUserPayload) SetDatabase(v *string) { - o.Database = v +func (o *PartialUpdateUserPayload) SetDatabase(v PartialUpdateUserPayloadGetDatabaseRetType) { + setPartialUpdateUserPayloadGetDatabaseAttributeType(&o.Database, v) } // GetRoles returns the Roles field value if set, zero value otherwise. -func (o *PartialUpdateUserPayload) GetRoles() *[]string { - if o == nil || IsNil(o.Roles) { - var ret *[]string - return ret - } - return o.Roles +func (o *PartialUpdateUserPayload) GetRoles() (res PartialUpdateUserPayloadGetRolesRetType) { + res, _ = o.GetRolesOk() + return } // 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 *PartialUpdateUserPayload) GetRolesOk() (*[]string, bool) { - if o == nil || IsNil(o.Roles) { - return nil, false - } - return o.Roles, true +func (o *PartialUpdateUserPayload) GetRolesOk() (ret PartialUpdateUserPayloadGetRolesRetType, ok bool) { + return getPartialUpdateUserPayloadGetRolesAttributeTypeOk(o.Roles) } // HasRoles returns a boolean if a field has been set. func (o *PartialUpdateUserPayload) HasRoles() bool { - if o != nil && !IsNil(o.Roles) { - return true - } - - return false + _, ok := o.GetRolesOk() + return ok } // SetRoles gets a reference to the given []string and assigns it to the Roles field. -func (o *PartialUpdateUserPayload) SetRoles(v *[]string) { - o.Roles = v +func (o *PartialUpdateUserPayload) SetRoles(v PartialUpdateUserPayloadGetRolesRetType) { + setPartialUpdateUserPayloadGetRolesAttributeType(&o.Roles, v) } func (o PartialUpdateUserPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Database) { - toSerialize["database"] = o.Database + if val, ok := getPartialUpdateUserPayloadGetDatabaseAttributeTypeOk(o.Database); ok { + toSerialize["Database"] = val } - if !IsNil(o.Roles) { - toSerialize["roles"] = o.Roles + if val, ok := getPartialUpdateUserPayloadGetRolesAttributeTypeOk(o.Roles); ok { + toSerialize["Roles"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_postgres_database_parameter.go b/services/postgresflex/model_postgres_database_parameter.go index 6a5469697..623289803 100644 --- a/services/postgresflex/model_postgres_database_parameter.go +++ b/services/postgresflex/model_postgres_database_parameter.go @@ -17,32 +17,282 @@ import ( // checks if the PostgresDatabaseParameter type satisfies the MappedNullable interface at compile time var _ MappedNullable = &PostgresDatabaseParameter{} +/* + types and functions for context +*/ + +// isNotNullableString +type PostgresDatabaseParameterGetContextAttributeType = *string + +func getPostgresDatabaseParameterGetContextAttributeTypeOk(arg PostgresDatabaseParameterGetContextAttributeType) (ret PostgresDatabaseParameterGetContextRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPostgresDatabaseParameterGetContextAttributeType(arg *PostgresDatabaseParameterGetContextAttributeType, val PostgresDatabaseParameterGetContextRetType) { + *arg = &val +} + +type PostgresDatabaseParameterGetContextArgType = string +type PostgresDatabaseParameterGetContextRetType = string + +/* + types and functions for dataType +*/ + +// isNotNullableString +type PostgresDatabaseParameterGetDataTypeAttributeType = *string + +func getPostgresDatabaseParameterGetDataTypeAttributeTypeOk(arg PostgresDatabaseParameterGetDataTypeAttributeType) (ret PostgresDatabaseParameterGetDataTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPostgresDatabaseParameterGetDataTypeAttributeType(arg *PostgresDatabaseParameterGetDataTypeAttributeType, val PostgresDatabaseParameterGetDataTypeRetType) { + *arg = &val +} + +type PostgresDatabaseParameterGetDataTypeArgType = string +type PostgresDatabaseParameterGetDataTypeRetType = string + +/* + types and functions for defaultValue +*/ + +// isNotNullableString +type PostgresDatabaseParameterGetDefaultValueAttributeType = *string + +func getPostgresDatabaseParameterGetDefaultValueAttributeTypeOk(arg PostgresDatabaseParameterGetDefaultValueAttributeType) (ret PostgresDatabaseParameterGetDefaultValueRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPostgresDatabaseParameterGetDefaultValueAttributeType(arg *PostgresDatabaseParameterGetDefaultValueAttributeType, val PostgresDatabaseParameterGetDefaultValueRetType) { + *arg = &val +} + +type PostgresDatabaseParameterGetDefaultValueArgType = string +type PostgresDatabaseParameterGetDefaultValueRetType = string + +/* + types and functions for description +*/ + +// isNotNullableString +type PostgresDatabaseParameterGetDescriptionAttributeType = *string + +func getPostgresDatabaseParameterGetDescriptionAttributeTypeOk(arg PostgresDatabaseParameterGetDescriptionAttributeType) (ret PostgresDatabaseParameterGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPostgresDatabaseParameterGetDescriptionAttributeType(arg *PostgresDatabaseParameterGetDescriptionAttributeType, val PostgresDatabaseParameterGetDescriptionRetType) { + *arg = &val +} + +type PostgresDatabaseParameterGetDescriptionArgType = string +type PostgresDatabaseParameterGetDescriptionRetType = string + +/* + types and functions for edit +*/ + +// isBoolean +type PostgresDatabaseParametergetEditAttributeType = *bool +type PostgresDatabaseParametergetEditArgType = bool +type PostgresDatabaseParametergetEditRetType = bool + +func getPostgresDatabaseParametergetEditAttributeTypeOk(arg PostgresDatabaseParametergetEditAttributeType) (ret PostgresDatabaseParametergetEditRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPostgresDatabaseParametergetEditAttributeType(arg *PostgresDatabaseParametergetEditAttributeType, val PostgresDatabaseParametergetEditRetType) { + *arg = &val +} + +/* + types and functions for maxValue +*/ + +// isNotNullableString +type PostgresDatabaseParameterGetMaxValueAttributeType = *string + +func getPostgresDatabaseParameterGetMaxValueAttributeTypeOk(arg PostgresDatabaseParameterGetMaxValueAttributeType) (ret PostgresDatabaseParameterGetMaxValueRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPostgresDatabaseParameterGetMaxValueAttributeType(arg *PostgresDatabaseParameterGetMaxValueAttributeType, val PostgresDatabaseParameterGetMaxValueRetType) { + *arg = &val +} + +type PostgresDatabaseParameterGetMaxValueArgType = string +type PostgresDatabaseParameterGetMaxValueRetType = string + +/* + types and functions for minValue +*/ + +// isNotNullableString +type PostgresDatabaseParameterGetMinValueAttributeType = *string + +func getPostgresDatabaseParameterGetMinValueAttributeTypeOk(arg PostgresDatabaseParameterGetMinValueAttributeType) (ret PostgresDatabaseParameterGetMinValueRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPostgresDatabaseParameterGetMinValueAttributeType(arg *PostgresDatabaseParameterGetMinValueAttributeType, val PostgresDatabaseParameterGetMinValueRetType) { + *arg = &val +} + +type PostgresDatabaseParameterGetMinValueArgType = string +type PostgresDatabaseParameterGetMinValueRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +type PostgresDatabaseParameterGetNameAttributeType = *string + +func getPostgresDatabaseParameterGetNameAttributeTypeOk(arg PostgresDatabaseParameterGetNameAttributeType) (ret PostgresDatabaseParameterGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPostgresDatabaseParameterGetNameAttributeType(arg *PostgresDatabaseParameterGetNameAttributeType, val PostgresDatabaseParameterGetNameRetType) { + *arg = &val +} + +type PostgresDatabaseParameterGetNameArgType = string +type PostgresDatabaseParameterGetNameRetType = string + +/* + types and functions for pendingRestart +*/ + +// isBoolean +type PostgresDatabaseParametergetPendingRestartAttributeType = *bool +type PostgresDatabaseParametergetPendingRestartArgType = bool +type PostgresDatabaseParametergetPendingRestartRetType = bool + +func getPostgresDatabaseParametergetPendingRestartAttributeTypeOk(arg PostgresDatabaseParametergetPendingRestartAttributeType) (ret PostgresDatabaseParametergetPendingRestartRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPostgresDatabaseParametergetPendingRestartAttributeType(arg *PostgresDatabaseParametergetPendingRestartAttributeType, val PostgresDatabaseParametergetPendingRestartRetType) { + *arg = &val +} + +/* + types and functions for resetValue +*/ + +// isNotNullableString +type PostgresDatabaseParameterGetResetValueAttributeType = *string + +func getPostgresDatabaseParameterGetResetValueAttributeTypeOk(arg PostgresDatabaseParameterGetResetValueAttributeType) (ret PostgresDatabaseParameterGetResetValueRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPostgresDatabaseParameterGetResetValueAttributeType(arg *PostgresDatabaseParameterGetResetValueAttributeType, val PostgresDatabaseParameterGetResetValueRetType) { + *arg = &val +} + +type PostgresDatabaseParameterGetResetValueArgType = string +type PostgresDatabaseParameterGetResetValueRetType = string + +/* + types and functions for unit +*/ + +// isNotNullableString +type PostgresDatabaseParameterGetUnitAttributeType = *string + +func getPostgresDatabaseParameterGetUnitAttributeTypeOk(arg PostgresDatabaseParameterGetUnitAttributeType) (ret PostgresDatabaseParameterGetUnitRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPostgresDatabaseParameterGetUnitAttributeType(arg *PostgresDatabaseParameterGetUnitAttributeType, val PostgresDatabaseParameterGetUnitRetType) { + *arg = &val +} + +type PostgresDatabaseParameterGetUnitArgType = string +type PostgresDatabaseParameterGetUnitRetType = string + +/* + types and functions for value +*/ + +// isNotNullableString +type PostgresDatabaseParameterGetValueAttributeType = *string + +func getPostgresDatabaseParameterGetValueAttributeTypeOk(arg PostgresDatabaseParameterGetValueAttributeType) (ret PostgresDatabaseParameterGetValueRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPostgresDatabaseParameterGetValueAttributeType(arg *PostgresDatabaseParameterGetValueAttributeType, val PostgresDatabaseParameterGetValueRetType) { + *arg = &val +} + +type PostgresDatabaseParameterGetValueArgType = string +type PostgresDatabaseParameterGetValueRetType = string + // PostgresDatabaseParameter struct for PostgresDatabaseParameter type PostgresDatabaseParameter struct { // Context of the parameter. - Context *string `json:"context,omitempty"` + Context PostgresDatabaseParameterGetContextAttributeType `json:"context,omitempty"` // Datatype describes the type of data that is used in the Value field. - DataType *string `json:"dataType,omitempty"` + DataType PostgresDatabaseParameterGetDataTypeAttributeType `json:"dataType,omitempty"` // DefaultValue for the value field. - DefaultValue *string `json:"defaultValue,omitempty"` + DefaultValue PostgresDatabaseParameterGetDefaultValueAttributeType `json:"defaultValue,omitempty"` // Description of the parameter. - Description *string `json:"description,omitempty"` + Description PostgresDatabaseParameterGetDescriptionAttributeType `json:"description,omitempty"` // Edit shows if the user can change this value. - Edit *bool `json:"edit,omitempty"` + Edit PostgresDatabaseParametergetEditAttributeType `json:"edit,omitempty"` // MaxValue describes the highest possible value that can be set. - MaxValue *string `json:"maxValue,omitempty"` + MaxValue PostgresDatabaseParameterGetMaxValueAttributeType `json:"maxValue,omitempty"` // MinValue describes the lowest possible value that can be set. - MinValue *string `json:"minValue,omitempty"` + MinValue PostgresDatabaseParameterGetMinValueAttributeType `json:"minValue,omitempty"` // Name of the parameter. - Name *string `json:"name,omitempty"` + Name PostgresDatabaseParameterGetNameAttributeType `json:"name,omitempty"` // PendingRestart describes if a parameter change requires a restart of the server. - PendingRestart *bool `json:"pendingRestart,omitempty"` + PendingRestart PostgresDatabaseParametergetPendingRestartAttributeType `json:"pendingRestart,omitempty"` // ResetValue for the value field af.ter a reset. - ResetValue *string `json:"resetValue,omitempty"` + ResetValue PostgresDatabaseParameterGetResetValueAttributeType `json:"resetValue,omitempty"` // Unit if the parameter has a unit if not empty. - Unit *string `json:"unit,omitempty"` + Unit PostgresDatabaseParameterGetUnitAttributeType `json:"unit,omitempty"` // Value of this parameter. - Value *string `json:"value,omitempty"` + Value PostgresDatabaseParameterGetValueAttributeType `json:"value,omitempty"` } // NewPostgresDatabaseParameter instantiates a new PostgresDatabaseParameter object @@ -63,426 +313,318 @@ func NewPostgresDatabaseParameterWithDefaults() *PostgresDatabaseParameter { } // GetContext returns the Context field value if set, zero value otherwise. -func (o *PostgresDatabaseParameter) GetContext() *string { - if o == nil || IsNil(o.Context) { - var ret *string - return ret - } - return o.Context +func (o *PostgresDatabaseParameter) GetContext() (res PostgresDatabaseParameterGetContextRetType) { + res, _ = o.GetContextOk() + return } // GetContextOk returns a tuple with the Context field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PostgresDatabaseParameter) GetContextOk() (*string, bool) { - if o == nil || IsNil(o.Context) { - return nil, false - } - return o.Context, true +func (o *PostgresDatabaseParameter) GetContextOk() (ret PostgresDatabaseParameterGetContextRetType, ok bool) { + return getPostgresDatabaseParameterGetContextAttributeTypeOk(o.Context) } // HasContext returns a boolean if a field has been set. func (o *PostgresDatabaseParameter) HasContext() bool { - if o != nil && !IsNil(o.Context) { - return true - } - - return false + _, ok := o.GetContextOk() + return ok } // SetContext gets a reference to the given string and assigns it to the Context field. -func (o *PostgresDatabaseParameter) SetContext(v *string) { - o.Context = v +func (o *PostgresDatabaseParameter) SetContext(v PostgresDatabaseParameterGetContextRetType) { + setPostgresDatabaseParameterGetContextAttributeType(&o.Context, v) } // GetDataType returns the DataType field value if set, zero value otherwise. -func (o *PostgresDatabaseParameter) GetDataType() *string { - if o == nil || IsNil(o.DataType) { - var ret *string - return ret - } - return o.DataType +func (o *PostgresDatabaseParameter) GetDataType() (res PostgresDatabaseParameterGetDataTypeRetType) { + res, _ = o.GetDataTypeOk() + return } // GetDataTypeOk returns a tuple with the DataType field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PostgresDatabaseParameter) GetDataTypeOk() (*string, bool) { - if o == nil || IsNil(o.DataType) { - return nil, false - } - return o.DataType, true +func (o *PostgresDatabaseParameter) GetDataTypeOk() (ret PostgresDatabaseParameterGetDataTypeRetType, ok bool) { + return getPostgresDatabaseParameterGetDataTypeAttributeTypeOk(o.DataType) } // HasDataType returns a boolean if a field has been set. func (o *PostgresDatabaseParameter) HasDataType() bool { - if o != nil && !IsNil(o.DataType) { - return true - } - - return false + _, ok := o.GetDataTypeOk() + return ok } // SetDataType gets a reference to the given string and assigns it to the DataType field. -func (o *PostgresDatabaseParameter) SetDataType(v *string) { - o.DataType = v +func (o *PostgresDatabaseParameter) SetDataType(v PostgresDatabaseParameterGetDataTypeRetType) { + setPostgresDatabaseParameterGetDataTypeAttributeType(&o.DataType, v) } // GetDefaultValue returns the DefaultValue field value if set, zero value otherwise. -func (o *PostgresDatabaseParameter) GetDefaultValue() *string { - if o == nil || IsNil(o.DefaultValue) { - var ret *string - return ret - } - return o.DefaultValue +func (o *PostgresDatabaseParameter) GetDefaultValue() (res PostgresDatabaseParameterGetDefaultValueRetType) { + res, _ = o.GetDefaultValueOk() + return } // GetDefaultValueOk returns a tuple with the DefaultValue field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PostgresDatabaseParameter) GetDefaultValueOk() (*string, bool) { - if o == nil || IsNil(o.DefaultValue) { - return nil, false - } - return o.DefaultValue, true +func (o *PostgresDatabaseParameter) GetDefaultValueOk() (ret PostgresDatabaseParameterGetDefaultValueRetType, ok bool) { + return getPostgresDatabaseParameterGetDefaultValueAttributeTypeOk(o.DefaultValue) } // HasDefaultValue returns a boolean if a field has been set. func (o *PostgresDatabaseParameter) HasDefaultValue() bool { - if o != nil && !IsNil(o.DefaultValue) { - return true - } - - return false + _, ok := o.GetDefaultValueOk() + return ok } // SetDefaultValue gets a reference to the given string and assigns it to the DefaultValue field. -func (o *PostgresDatabaseParameter) SetDefaultValue(v *string) { - o.DefaultValue = v +func (o *PostgresDatabaseParameter) SetDefaultValue(v PostgresDatabaseParameterGetDefaultValueRetType) { + setPostgresDatabaseParameterGetDefaultValueAttributeType(&o.DefaultValue, v) } // GetDescription returns the Description field value if set, zero value otherwise. -func (o *PostgresDatabaseParameter) GetDescription() *string { - if o == nil || IsNil(o.Description) { - var ret *string - return ret - } - return o.Description +func (o *PostgresDatabaseParameter) GetDescription() (res PostgresDatabaseParameterGetDescriptionRetType) { + res, _ = o.GetDescriptionOk() + return } // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PostgresDatabaseParameter) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true +func (o *PostgresDatabaseParameter) GetDescriptionOk() (ret PostgresDatabaseParameterGetDescriptionRetType, ok bool) { + return getPostgresDatabaseParameterGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. func (o *PostgresDatabaseParameter) HasDescription() bool { - if o != nil && !IsNil(o.Description) { - return true - } - - return false + _, ok := o.GetDescriptionOk() + return ok } // SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *PostgresDatabaseParameter) SetDescription(v *string) { - o.Description = v +func (o *PostgresDatabaseParameter) SetDescription(v PostgresDatabaseParameterGetDescriptionRetType) { + setPostgresDatabaseParameterGetDescriptionAttributeType(&o.Description, v) } // GetEdit returns the Edit field value if set, zero value otherwise. -func (o *PostgresDatabaseParameter) GetEdit() *bool { - if o == nil || IsNil(o.Edit) { - var ret *bool - return ret - } - return o.Edit +func (o *PostgresDatabaseParameter) GetEdit() (res PostgresDatabaseParametergetEditRetType) { + res, _ = o.GetEditOk() + return } // GetEditOk returns a tuple with the Edit field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PostgresDatabaseParameter) GetEditOk() (*bool, bool) { - if o == nil || IsNil(o.Edit) { - return nil, false - } - return o.Edit, true +func (o *PostgresDatabaseParameter) GetEditOk() (ret PostgresDatabaseParametergetEditRetType, ok bool) { + return getPostgresDatabaseParametergetEditAttributeTypeOk(o.Edit) } // HasEdit returns a boolean if a field has been set. func (o *PostgresDatabaseParameter) HasEdit() bool { - if o != nil && !IsNil(o.Edit) { - return true - } - - return false + _, ok := o.GetEditOk() + return ok } // SetEdit gets a reference to the given bool and assigns it to the Edit field. -func (o *PostgresDatabaseParameter) SetEdit(v *bool) { - o.Edit = v +func (o *PostgresDatabaseParameter) SetEdit(v PostgresDatabaseParametergetEditRetType) { + setPostgresDatabaseParametergetEditAttributeType(&o.Edit, v) } // GetMaxValue returns the MaxValue field value if set, zero value otherwise. -func (o *PostgresDatabaseParameter) GetMaxValue() *string { - if o == nil || IsNil(o.MaxValue) { - var ret *string - return ret - } - return o.MaxValue +func (o *PostgresDatabaseParameter) GetMaxValue() (res PostgresDatabaseParameterGetMaxValueRetType) { + res, _ = o.GetMaxValueOk() + return } // GetMaxValueOk returns a tuple with the MaxValue field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PostgresDatabaseParameter) GetMaxValueOk() (*string, bool) { - if o == nil || IsNil(o.MaxValue) { - return nil, false - } - return o.MaxValue, true +func (o *PostgresDatabaseParameter) GetMaxValueOk() (ret PostgresDatabaseParameterGetMaxValueRetType, ok bool) { + return getPostgresDatabaseParameterGetMaxValueAttributeTypeOk(o.MaxValue) } // HasMaxValue returns a boolean if a field has been set. func (o *PostgresDatabaseParameter) HasMaxValue() bool { - if o != nil && !IsNil(o.MaxValue) { - return true - } - - return false + _, ok := o.GetMaxValueOk() + return ok } // SetMaxValue gets a reference to the given string and assigns it to the MaxValue field. -func (o *PostgresDatabaseParameter) SetMaxValue(v *string) { - o.MaxValue = v +func (o *PostgresDatabaseParameter) SetMaxValue(v PostgresDatabaseParameterGetMaxValueRetType) { + setPostgresDatabaseParameterGetMaxValueAttributeType(&o.MaxValue, v) } // GetMinValue returns the MinValue field value if set, zero value otherwise. -func (o *PostgresDatabaseParameter) GetMinValue() *string { - if o == nil || IsNil(o.MinValue) { - var ret *string - return ret - } - return o.MinValue +func (o *PostgresDatabaseParameter) GetMinValue() (res PostgresDatabaseParameterGetMinValueRetType) { + res, _ = o.GetMinValueOk() + return } // GetMinValueOk returns a tuple with the MinValue field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PostgresDatabaseParameter) GetMinValueOk() (*string, bool) { - if o == nil || IsNil(o.MinValue) { - return nil, false - } - return o.MinValue, true +func (o *PostgresDatabaseParameter) GetMinValueOk() (ret PostgresDatabaseParameterGetMinValueRetType, ok bool) { + return getPostgresDatabaseParameterGetMinValueAttributeTypeOk(o.MinValue) } // HasMinValue returns a boolean if a field has been set. func (o *PostgresDatabaseParameter) HasMinValue() bool { - if o != nil && !IsNil(o.MinValue) { - return true - } - - return false + _, ok := o.GetMinValueOk() + return ok } // SetMinValue gets a reference to the given string and assigns it to the MinValue field. -func (o *PostgresDatabaseParameter) SetMinValue(v *string) { - o.MinValue = v +func (o *PostgresDatabaseParameter) SetMinValue(v PostgresDatabaseParameterGetMinValueRetType) { + setPostgresDatabaseParameterGetMinValueAttributeType(&o.MinValue, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *PostgresDatabaseParameter) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *PostgresDatabaseParameter) GetName() (res PostgresDatabaseParameterGetNameRetType) { + res, _ = o.GetNameOk() + return } // 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 *PostgresDatabaseParameter) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *PostgresDatabaseParameter) GetNameOk() (ret PostgresDatabaseParameterGetNameRetType, ok bool) { + return getPostgresDatabaseParameterGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *PostgresDatabaseParameter) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false + _, ok := o.GetNameOk() + return ok } // SetName gets a reference to the given string and assigns it to the Name field. -func (o *PostgresDatabaseParameter) SetName(v *string) { - o.Name = v +func (o *PostgresDatabaseParameter) SetName(v PostgresDatabaseParameterGetNameRetType) { + setPostgresDatabaseParameterGetNameAttributeType(&o.Name, v) } // GetPendingRestart returns the PendingRestart field value if set, zero value otherwise. -func (o *PostgresDatabaseParameter) GetPendingRestart() *bool { - if o == nil || IsNil(o.PendingRestart) { - var ret *bool - return ret - } - return o.PendingRestart +func (o *PostgresDatabaseParameter) GetPendingRestart() (res PostgresDatabaseParametergetPendingRestartRetType) { + res, _ = o.GetPendingRestartOk() + return } // GetPendingRestartOk returns a tuple with the PendingRestart field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PostgresDatabaseParameter) GetPendingRestartOk() (*bool, bool) { - if o == nil || IsNil(o.PendingRestart) { - return nil, false - } - return o.PendingRestart, true +func (o *PostgresDatabaseParameter) GetPendingRestartOk() (ret PostgresDatabaseParametergetPendingRestartRetType, ok bool) { + return getPostgresDatabaseParametergetPendingRestartAttributeTypeOk(o.PendingRestart) } // HasPendingRestart returns a boolean if a field has been set. func (o *PostgresDatabaseParameter) HasPendingRestart() bool { - if o != nil && !IsNil(o.PendingRestart) { - return true - } - - return false + _, ok := o.GetPendingRestartOk() + return ok } // SetPendingRestart gets a reference to the given bool and assigns it to the PendingRestart field. -func (o *PostgresDatabaseParameter) SetPendingRestart(v *bool) { - o.PendingRestart = v +func (o *PostgresDatabaseParameter) SetPendingRestart(v PostgresDatabaseParametergetPendingRestartRetType) { + setPostgresDatabaseParametergetPendingRestartAttributeType(&o.PendingRestart, v) } // GetResetValue returns the ResetValue field value if set, zero value otherwise. -func (o *PostgresDatabaseParameter) GetResetValue() *string { - if o == nil || IsNil(o.ResetValue) { - var ret *string - return ret - } - return o.ResetValue +func (o *PostgresDatabaseParameter) GetResetValue() (res PostgresDatabaseParameterGetResetValueRetType) { + res, _ = o.GetResetValueOk() + return } // GetResetValueOk returns a tuple with the ResetValue field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PostgresDatabaseParameter) GetResetValueOk() (*string, bool) { - if o == nil || IsNil(o.ResetValue) { - return nil, false - } - return o.ResetValue, true +func (o *PostgresDatabaseParameter) GetResetValueOk() (ret PostgresDatabaseParameterGetResetValueRetType, ok bool) { + return getPostgresDatabaseParameterGetResetValueAttributeTypeOk(o.ResetValue) } // HasResetValue returns a boolean if a field has been set. func (o *PostgresDatabaseParameter) HasResetValue() bool { - if o != nil && !IsNil(o.ResetValue) { - return true - } - - return false + _, ok := o.GetResetValueOk() + return ok } // SetResetValue gets a reference to the given string and assigns it to the ResetValue field. -func (o *PostgresDatabaseParameter) SetResetValue(v *string) { - o.ResetValue = v +func (o *PostgresDatabaseParameter) SetResetValue(v PostgresDatabaseParameterGetResetValueRetType) { + setPostgresDatabaseParameterGetResetValueAttributeType(&o.ResetValue, v) } // GetUnit returns the Unit field value if set, zero value otherwise. -func (o *PostgresDatabaseParameter) GetUnit() *string { - if o == nil || IsNil(o.Unit) { - var ret *string - return ret - } - return o.Unit +func (o *PostgresDatabaseParameter) GetUnit() (res PostgresDatabaseParameterGetUnitRetType) { + res, _ = o.GetUnitOk() + return } // GetUnitOk returns a tuple with the Unit field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PostgresDatabaseParameter) GetUnitOk() (*string, bool) { - if o == nil || IsNil(o.Unit) { - return nil, false - } - return o.Unit, true +func (o *PostgresDatabaseParameter) GetUnitOk() (ret PostgresDatabaseParameterGetUnitRetType, ok bool) { + return getPostgresDatabaseParameterGetUnitAttributeTypeOk(o.Unit) } // HasUnit returns a boolean if a field has been set. func (o *PostgresDatabaseParameter) HasUnit() bool { - if o != nil && !IsNil(o.Unit) { - return true - } - - return false + _, ok := o.GetUnitOk() + return ok } // SetUnit gets a reference to the given string and assigns it to the Unit field. -func (o *PostgresDatabaseParameter) SetUnit(v *string) { - o.Unit = v +func (o *PostgresDatabaseParameter) SetUnit(v PostgresDatabaseParameterGetUnitRetType) { + setPostgresDatabaseParameterGetUnitAttributeType(&o.Unit, v) } // GetValue returns the Value field value if set, zero value otherwise. -func (o *PostgresDatabaseParameter) GetValue() *string { - if o == nil || IsNil(o.Value) { - var ret *string - return ret - } - return o.Value +func (o *PostgresDatabaseParameter) GetValue() (res PostgresDatabaseParameterGetValueRetType) { + res, _ = o.GetValueOk() + return } // GetValueOk returns a tuple with the Value field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PostgresDatabaseParameter) GetValueOk() (*string, bool) { - if o == nil || IsNil(o.Value) { - return nil, false - } - return o.Value, true +func (o *PostgresDatabaseParameter) GetValueOk() (ret PostgresDatabaseParameterGetValueRetType, ok bool) { + return getPostgresDatabaseParameterGetValueAttributeTypeOk(o.Value) } // HasValue returns a boolean if a field has been set. func (o *PostgresDatabaseParameter) HasValue() bool { - if o != nil && !IsNil(o.Value) { - return true - } - - return false + _, ok := o.GetValueOk() + return ok } // SetValue gets a reference to the given string and assigns it to the Value field. -func (o *PostgresDatabaseParameter) SetValue(v *string) { - o.Value = v +func (o *PostgresDatabaseParameter) SetValue(v PostgresDatabaseParameterGetValueRetType) { + setPostgresDatabaseParameterGetValueAttributeType(&o.Value, v) } func (o PostgresDatabaseParameter) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Context) { - toSerialize["context"] = o.Context + if val, ok := getPostgresDatabaseParameterGetContextAttributeTypeOk(o.Context); ok { + toSerialize["Context"] = val } - if !IsNil(o.DataType) { - toSerialize["dataType"] = o.DataType + if val, ok := getPostgresDatabaseParameterGetDataTypeAttributeTypeOk(o.DataType); ok { + toSerialize["DataType"] = val } - if !IsNil(o.DefaultValue) { - toSerialize["defaultValue"] = o.DefaultValue + if val, ok := getPostgresDatabaseParameterGetDefaultValueAttributeTypeOk(o.DefaultValue); ok { + toSerialize["DefaultValue"] = val } - if !IsNil(o.Description) { - toSerialize["description"] = o.Description + if val, ok := getPostgresDatabaseParameterGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val } - if !IsNil(o.Edit) { - toSerialize["edit"] = o.Edit + if val, ok := getPostgresDatabaseParametergetEditAttributeTypeOk(o.Edit); ok { + toSerialize["Edit"] = val } - if !IsNil(o.MaxValue) { - toSerialize["maxValue"] = o.MaxValue + if val, ok := getPostgresDatabaseParameterGetMaxValueAttributeTypeOk(o.MaxValue); ok { + toSerialize["MaxValue"] = val } - if !IsNil(o.MinValue) { - toSerialize["minValue"] = o.MinValue + if val, ok := getPostgresDatabaseParameterGetMinValueAttributeTypeOk(o.MinValue); ok { + toSerialize["MinValue"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getPostgresDatabaseParameterGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.PendingRestart) { - toSerialize["pendingRestart"] = o.PendingRestart + if val, ok := getPostgresDatabaseParametergetPendingRestartAttributeTypeOk(o.PendingRestart); ok { + toSerialize["PendingRestart"] = val } - if !IsNil(o.ResetValue) { - toSerialize["resetValue"] = o.ResetValue + if val, ok := getPostgresDatabaseParameterGetResetValueAttributeTypeOk(o.ResetValue); ok { + toSerialize["ResetValue"] = val } - if !IsNil(o.Unit) { - toSerialize["unit"] = o.Unit + if val, ok := getPostgresDatabaseParameterGetUnitAttributeTypeOk(o.Unit); ok { + toSerialize["Unit"] = val } - if !IsNil(o.Value) { - toSerialize["value"] = o.Value + if val, ok := getPostgresDatabaseParameterGetValueAttributeTypeOk(o.Value); ok { + toSerialize["Value"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_postgres_database_parameter_response.go b/services/postgresflex/model_postgres_database_parameter_response.go index 5eeb3aea5..d469d7ff6 100644 --- a/services/postgresflex/model_postgres_database_parameter_response.go +++ b/services/postgresflex/model_postgres_database_parameter_response.go @@ -17,10 +17,30 @@ import ( // checks if the PostgresDatabaseParameterResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &PostgresDatabaseParameterResponse{} +/* + types and functions for parameter +*/ + +// isArray +type PostgresDatabaseParameterResponseGetParameterAttributeType = *[]PostgresDatabaseParameter +type PostgresDatabaseParameterResponseGetParameterArgType = []PostgresDatabaseParameter +type PostgresDatabaseParameterResponseGetParameterRetType = []PostgresDatabaseParameter + +func getPostgresDatabaseParameterResponseGetParameterAttributeTypeOk(arg PostgresDatabaseParameterResponseGetParameterAttributeType) (ret PostgresDatabaseParameterResponseGetParameterRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPostgresDatabaseParameterResponseGetParameterAttributeType(arg *PostgresDatabaseParameterResponseGetParameterAttributeType, val PostgresDatabaseParameterResponseGetParameterRetType) { + *arg = &val +} + // PostgresDatabaseParameterResponse struct for PostgresDatabaseParameterResponse type PostgresDatabaseParameterResponse struct { // List of the parameter - Parameter *[]PostgresDatabaseParameter `json:"parameter,omitempty"` + Parameter PostgresDatabaseParameterResponseGetParameterAttributeType `json:"parameter,omitempty"` } // NewPostgresDatabaseParameterResponse instantiates a new PostgresDatabaseParameterResponse object @@ -41,41 +61,32 @@ func NewPostgresDatabaseParameterResponseWithDefaults() *PostgresDatabaseParamet } // GetParameter returns the Parameter field value if set, zero value otherwise. -func (o *PostgresDatabaseParameterResponse) GetParameter() *[]PostgresDatabaseParameter { - if o == nil || IsNil(o.Parameter) { - var ret *[]PostgresDatabaseParameter - return ret - } - return o.Parameter +func (o *PostgresDatabaseParameterResponse) GetParameter() (res PostgresDatabaseParameterResponseGetParameterRetType) { + res, _ = o.GetParameterOk() + return } // GetParameterOk returns a tuple with the Parameter field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PostgresDatabaseParameterResponse) GetParameterOk() (*[]PostgresDatabaseParameter, bool) { - if o == nil || IsNil(o.Parameter) { - return nil, false - } - return o.Parameter, true +func (o *PostgresDatabaseParameterResponse) GetParameterOk() (ret PostgresDatabaseParameterResponseGetParameterRetType, ok bool) { + return getPostgresDatabaseParameterResponseGetParameterAttributeTypeOk(o.Parameter) } // HasParameter returns a boolean if a field has been set. func (o *PostgresDatabaseParameterResponse) HasParameter() bool { - if o != nil && !IsNil(o.Parameter) { - return true - } - - return false + _, ok := o.GetParameterOk() + return ok } // SetParameter gets a reference to the given []PostgresDatabaseParameter and assigns it to the Parameter field. -func (o *PostgresDatabaseParameterResponse) SetParameter(v *[]PostgresDatabaseParameter) { - o.Parameter = v +func (o *PostgresDatabaseParameterResponse) SetParameter(v PostgresDatabaseParameterResponseGetParameterRetType) { + setPostgresDatabaseParameterResponseGetParameterAttributeType(&o.Parameter, v) } func (o PostgresDatabaseParameterResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Parameter) { - toSerialize["parameter"] = o.Parameter + if val, ok := getPostgresDatabaseParameterResponseGetParameterAttributeTypeOk(o.Parameter); ok { + toSerialize["Parameter"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_reset_user_response.go b/services/postgresflex/model_reset_user_response.go index 13445c7dd..4ff2ef111 100644 --- a/services/postgresflex/model_reset_user_response.go +++ b/services/postgresflex/model_reset_user_response.go @@ -17,9 +17,29 @@ import ( // checks if the ResetUserResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ResetUserResponse{} +/* + types and functions for item +*/ + +// isModel +type ResetUserResponseGetItemAttributeType = *User +type ResetUserResponseGetItemArgType = User +type ResetUserResponseGetItemRetType = User + +func getResetUserResponseGetItemAttributeTypeOk(arg ResetUserResponseGetItemAttributeType) (ret ResetUserResponseGetItemRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setResetUserResponseGetItemAttributeType(arg *ResetUserResponseGetItemAttributeType, val ResetUserResponseGetItemRetType) { + *arg = &val +} + // ResetUserResponse struct for ResetUserResponse type ResetUserResponse struct { - Item *User `json:"item,omitempty"` + Item ResetUserResponseGetItemAttributeType `json:"item,omitempty"` } // NewResetUserResponse instantiates a new ResetUserResponse object @@ -40,41 +60,32 @@ func NewResetUserResponseWithDefaults() *ResetUserResponse { } // GetItem returns the Item field value if set, zero value otherwise. -func (o *ResetUserResponse) GetItem() *User { - if o == nil || IsNil(o.Item) { - var ret *User - return ret - } - return o.Item +func (o *ResetUserResponse) GetItem() (res ResetUserResponseGetItemRetType) { + res, _ = o.GetItemOk() + return } // GetItemOk returns a tuple with the Item field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ResetUserResponse) GetItemOk() (*User, bool) { - if o == nil || IsNil(o.Item) { - return nil, false - } - return o.Item, true +func (o *ResetUserResponse) GetItemOk() (ret ResetUserResponseGetItemRetType, ok bool) { + return getResetUserResponseGetItemAttributeTypeOk(o.Item) } // HasItem returns a boolean if a field has been set. func (o *ResetUserResponse) HasItem() bool { - if o != nil && !IsNil(o.Item) { - return true - } - - return false + _, ok := o.GetItemOk() + return ok } // SetItem gets a reference to the given User and assigns it to the Item field. -func (o *ResetUserResponse) SetItem(v *User) { - o.Item = v +func (o *ResetUserResponse) SetItem(v ResetUserResponseGetItemRetType) { + setResetUserResponseGetItemAttributeType(&o.Item, v) } func (o ResetUserResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Item) { - toSerialize["item"] = o.Item + if val, ok := getResetUserResponseGetItemAttributeTypeOk(o.Item); ok { + toSerialize["Item"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_storage.go b/services/postgresflex/model_storage.go index 0e9030ae3..1c1fa94cf 100644 --- a/services/postgresflex/model_storage.go +++ b/services/postgresflex/model_storage.go @@ -17,10 +17,51 @@ import ( // checks if the Storage type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Storage{} +/* + types and functions for class +*/ + +// isNotNullableString +type StorageGetClassAttributeType = *string + +func getStorageGetClassAttributeTypeOk(arg StorageGetClassAttributeType) (ret StorageGetClassRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setStorageGetClassAttributeType(arg *StorageGetClassAttributeType, val StorageGetClassRetType) { + *arg = &val +} + +type StorageGetClassArgType = string +type StorageGetClassRetType = string + +/* + types and functions for size +*/ + +// isLong +type StorageGetSizeAttributeType = *int64 +type StorageGetSizeArgType = int64 +type StorageGetSizeRetType = int64 + +func getStorageGetSizeAttributeTypeOk(arg StorageGetSizeAttributeType) (ret StorageGetSizeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setStorageGetSizeAttributeType(arg *StorageGetSizeAttributeType, val StorageGetSizeRetType) { + *arg = &val +} + // Storage struct for Storage type Storage struct { - Class *string `json:"class,omitempty"` - Size *int64 `json:"size,omitempty"` + Class StorageGetClassAttributeType `json:"class,omitempty"` + Size StorageGetSizeAttributeType `json:"size,omitempty"` } // NewStorage instantiates a new Storage object @@ -41,76 +82,58 @@ func NewStorageWithDefaults() *Storage { } // GetClass returns the Class field value if set, zero value otherwise. -func (o *Storage) GetClass() *string { - if o == nil || IsNil(o.Class) { - var ret *string - return ret - } - return o.Class +func (o *Storage) GetClass() (res StorageGetClassRetType) { + res, _ = o.GetClassOk() + return } // GetClassOk returns a tuple with the Class field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Storage) GetClassOk() (*string, bool) { - if o == nil || IsNil(o.Class) { - return nil, false - } - return o.Class, true +func (o *Storage) GetClassOk() (ret StorageGetClassRetType, ok bool) { + return getStorageGetClassAttributeTypeOk(o.Class) } // HasClass returns a boolean if a field has been set. func (o *Storage) HasClass() bool { - if o != nil && !IsNil(o.Class) { - return true - } - - return false + _, ok := o.GetClassOk() + return ok } // SetClass gets a reference to the given string and assigns it to the Class field. -func (o *Storage) SetClass(v *string) { - o.Class = v +func (o *Storage) SetClass(v StorageGetClassRetType) { + setStorageGetClassAttributeType(&o.Class, v) } // GetSize returns the Size field value if set, zero value otherwise. -func (o *Storage) GetSize() *int64 { - if o == nil || IsNil(o.Size) { - var ret *int64 - return ret - } - return o.Size +func (o *Storage) GetSize() (res StorageGetSizeRetType) { + res, _ = o.GetSizeOk() + return } // GetSizeOk returns a tuple with the Size field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Storage) GetSizeOk() (*int64, bool) { - if o == nil || IsNil(o.Size) { - return nil, false - } - return o.Size, true +func (o *Storage) GetSizeOk() (ret StorageGetSizeRetType, ok bool) { + return getStorageGetSizeAttributeTypeOk(o.Size) } // HasSize returns a boolean if a field has been set. func (o *Storage) HasSize() bool { - if o != nil && !IsNil(o.Size) { - return true - } - - return false + _, ok := o.GetSizeOk() + return ok } // SetSize gets a reference to the given int64 and assigns it to the Size field. -func (o *Storage) SetSize(v *int64) { - o.Size = v +func (o *Storage) SetSize(v StorageGetSizeRetType) { + setStorageGetSizeAttributeType(&o.Size, v) } func (o Storage) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Class) { - toSerialize["class"] = o.Class + if val, ok := getStorageGetClassAttributeTypeOk(o.Class); ok { + toSerialize["Class"] = val } - if !IsNil(o.Size) { - toSerialize["size"] = o.Size + if val, ok := getStorageGetSizeAttributeTypeOk(o.Size); ok { + toSerialize["Size"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_storage_range.go b/services/postgresflex/model_storage_range.go index 2f905b177..022ebe8a4 100644 --- a/services/postgresflex/model_storage_range.go +++ b/services/postgresflex/model_storage_range.go @@ -17,10 +17,50 @@ import ( // checks if the StorageRange type satisfies the MappedNullable interface at compile time var _ MappedNullable = &StorageRange{} +/* + types and functions for max +*/ + +// isLong +type StorageRangeGetMaxAttributeType = *int64 +type StorageRangeGetMaxArgType = int64 +type StorageRangeGetMaxRetType = int64 + +func getStorageRangeGetMaxAttributeTypeOk(arg StorageRangeGetMaxAttributeType) (ret StorageRangeGetMaxRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setStorageRangeGetMaxAttributeType(arg *StorageRangeGetMaxAttributeType, val StorageRangeGetMaxRetType) { + *arg = &val +} + +/* + types and functions for min +*/ + +// isLong +type StorageRangeGetMinAttributeType = *int64 +type StorageRangeGetMinArgType = int64 +type StorageRangeGetMinRetType = int64 + +func getStorageRangeGetMinAttributeTypeOk(arg StorageRangeGetMinAttributeType) (ret StorageRangeGetMinRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setStorageRangeGetMinAttributeType(arg *StorageRangeGetMinAttributeType, val StorageRangeGetMinRetType) { + *arg = &val +} + // StorageRange struct for StorageRange type StorageRange struct { - Max *int64 `json:"max,omitempty"` - Min *int64 `json:"min,omitempty"` + Max StorageRangeGetMaxAttributeType `json:"max,omitempty"` + Min StorageRangeGetMinAttributeType `json:"min,omitempty"` } // NewStorageRange instantiates a new StorageRange object @@ -41,76 +81,58 @@ func NewStorageRangeWithDefaults() *StorageRange { } // GetMax returns the Max field value if set, zero value otherwise. -func (o *StorageRange) GetMax() *int64 { - if o == nil || IsNil(o.Max) { - var ret *int64 - return ret - } - return o.Max +func (o *StorageRange) GetMax() (res StorageRangeGetMaxRetType) { + res, _ = o.GetMaxOk() + return } // GetMaxOk returns a tuple with the Max field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *StorageRange) GetMaxOk() (*int64, bool) { - if o == nil || IsNil(o.Max) { - return nil, false - } - return o.Max, true +func (o *StorageRange) GetMaxOk() (ret StorageRangeGetMaxRetType, ok bool) { + return getStorageRangeGetMaxAttributeTypeOk(o.Max) } // HasMax returns a boolean if a field has been set. func (o *StorageRange) HasMax() bool { - if o != nil && !IsNil(o.Max) { - return true - } - - return false + _, ok := o.GetMaxOk() + return ok } // SetMax gets a reference to the given int64 and assigns it to the Max field. -func (o *StorageRange) SetMax(v *int64) { - o.Max = v +func (o *StorageRange) SetMax(v StorageRangeGetMaxRetType) { + setStorageRangeGetMaxAttributeType(&o.Max, v) } // GetMin returns the Min field value if set, zero value otherwise. -func (o *StorageRange) GetMin() *int64 { - if o == nil || IsNil(o.Min) { - var ret *int64 - return ret - } - return o.Min +func (o *StorageRange) GetMin() (res StorageRangeGetMinRetType) { + res, _ = o.GetMinOk() + return } // GetMinOk returns a tuple with the Min field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *StorageRange) GetMinOk() (*int64, bool) { - if o == nil || IsNil(o.Min) { - return nil, false - } - return o.Min, true +func (o *StorageRange) GetMinOk() (ret StorageRangeGetMinRetType, ok bool) { + return getStorageRangeGetMinAttributeTypeOk(o.Min) } // HasMin returns a boolean if a field has been set. func (o *StorageRange) HasMin() bool { - if o != nil && !IsNil(o.Min) { - return true - } - - return false + _, ok := o.GetMinOk() + return ok } // SetMin gets a reference to the given int64 and assigns it to the Min field. -func (o *StorageRange) SetMin(v *int64) { - o.Min = v +func (o *StorageRange) SetMin(v StorageRangeGetMinRetType) { + setStorageRangeGetMinAttributeType(&o.Min, v) } func (o StorageRange) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Max) { - toSerialize["max"] = o.Max + if val, ok := getStorageRangeGetMaxAttributeTypeOk(o.Max); ok { + toSerialize["Max"] = val } - if !IsNil(o.Min) { - toSerialize["min"] = o.Min + if val, ok := getStorageRangeGetMinAttributeTypeOk(o.Min); ok { + toSerialize["Min"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_update_backup_schedule_payload.go b/services/postgresflex/model_update_backup_schedule_payload.go index 377cd1f39..dd12b4045 100644 --- a/services/postgresflex/model_update_backup_schedule_payload.go +++ b/services/postgresflex/model_update_backup_schedule_payload.go @@ -17,10 +17,31 @@ import ( // checks if the UpdateBackupSchedulePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateBackupSchedulePayload{} +/* + types and functions for backupSchedule +*/ + +// isNotNullableString +type UpdateBackupSchedulePayloadGetBackupScheduleAttributeType = *string + +func getUpdateBackupSchedulePayloadGetBackupScheduleAttributeTypeOk(arg UpdateBackupSchedulePayloadGetBackupScheduleAttributeType) (ret UpdateBackupSchedulePayloadGetBackupScheduleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateBackupSchedulePayloadGetBackupScheduleAttributeType(arg *UpdateBackupSchedulePayloadGetBackupScheduleAttributeType, val UpdateBackupSchedulePayloadGetBackupScheduleRetType) { + *arg = &val +} + +type UpdateBackupSchedulePayloadGetBackupScheduleArgType = string +type UpdateBackupSchedulePayloadGetBackupScheduleRetType = string + // UpdateBackupSchedulePayload struct for UpdateBackupSchedulePayload type UpdateBackupSchedulePayload struct { // REQUIRED - BackupSchedule *string `json:"backupSchedule"` + BackupSchedule UpdateBackupSchedulePayloadGetBackupScheduleAttributeType `json:"backupSchedule"` } type _UpdateBackupSchedulePayload UpdateBackupSchedulePayload @@ -29,9 +50,9 @@ type _UpdateBackupSchedulePayload UpdateBackupSchedulePayload // 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 NewUpdateBackupSchedulePayload(backupSchedule *string) *UpdateBackupSchedulePayload { +func NewUpdateBackupSchedulePayload(backupSchedule UpdateBackupSchedulePayloadGetBackupScheduleArgType) *UpdateBackupSchedulePayload { this := UpdateBackupSchedulePayload{} - this.BackupSchedule = backupSchedule + setUpdateBackupSchedulePayloadGetBackupScheduleAttributeType(&this.BackupSchedule, backupSchedule) return &this } @@ -44,32 +65,27 @@ func NewUpdateBackupSchedulePayloadWithDefaults() *UpdateBackupSchedulePayload { } // GetBackupSchedule returns the BackupSchedule field value -func (o *UpdateBackupSchedulePayload) GetBackupSchedule() *string { - if o == nil || IsNil(o.BackupSchedule) { - var ret *string - return ret - } - - return o.BackupSchedule +func (o *UpdateBackupSchedulePayload) GetBackupSchedule() (ret UpdateBackupSchedulePayloadGetBackupScheduleRetType) { + ret, _ = o.GetBackupScheduleOk() + return ret } // GetBackupScheduleOk returns a tuple with the BackupSchedule field value // and a boolean to check if the value has been set. -func (o *UpdateBackupSchedulePayload) GetBackupScheduleOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.BackupSchedule, true +func (o *UpdateBackupSchedulePayload) GetBackupScheduleOk() (ret UpdateBackupSchedulePayloadGetBackupScheduleRetType, ok bool) { + return getUpdateBackupSchedulePayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule) } // SetBackupSchedule sets field value -func (o *UpdateBackupSchedulePayload) SetBackupSchedule(v *string) { - o.BackupSchedule = v +func (o *UpdateBackupSchedulePayload) SetBackupSchedule(v UpdateBackupSchedulePayloadGetBackupScheduleRetType) { + setUpdateBackupSchedulePayloadGetBackupScheduleAttributeType(&o.BackupSchedule, v) } func (o UpdateBackupSchedulePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["backupSchedule"] = o.BackupSchedule + if val, ok := getUpdateBackupSchedulePayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule); ok { + toSerialize["BackupSchedule"] = val + } return toSerialize, nil } diff --git a/services/postgresflex/model_update_instance_payload.go b/services/postgresflex/model_update_instance_payload.go index 29823bd8e..e4a87dea8 100644 --- a/services/postgresflex/model_update_instance_payload.go +++ b/services/postgresflex/model_update_instance_payload.go @@ -17,19 +17,203 @@ import ( // checks if the UpdateInstancePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateInstancePayload{} +/* + types and functions for acl +*/ + +// isModel +type UpdateInstancePayloadGetAclAttributeType = *ACL +type UpdateInstancePayloadGetAclArgType = ACL +type UpdateInstancePayloadGetAclRetType = ACL + +func getUpdateInstancePayloadGetAclAttributeTypeOk(arg UpdateInstancePayloadGetAclAttributeType) (ret UpdateInstancePayloadGetAclRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateInstancePayloadGetAclAttributeType(arg *UpdateInstancePayloadGetAclAttributeType, val UpdateInstancePayloadGetAclRetType) { + *arg = &val +} + +/* + types and functions for backupSchedule +*/ + +// isNotNullableString +type UpdateInstancePayloadGetBackupScheduleAttributeType = *string + +func getUpdateInstancePayloadGetBackupScheduleAttributeTypeOk(arg UpdateInstancePayloadGetBackupScheduleAttributeType) (ret UpdateInstancePayloadGetBackupScheduleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateInstancePayloadGetBackupScheduleAttributeType(arg *UpdateInstancePayloadGetBackupScheduleAttributeType, val UpdateInstancePayloadGetBackupScheduleRetType) { + *arg = &val +} + +type UpdateInstancePayloadGetBackupScheduleArgType = string +type UpdateInstancePayloadGetBackupScheduleRetType = string + +/* + types and functions for flavorId +*/ + +// isNotNullableString +type UpdateInstancePayloadGetFlavorIdAttributeType = *string + +func getUpdateInstancePayloadGetFlavorIdAttributeTypeOk(arg UpdateInstancePayloadGetFlavorIdAttributeType) (ret UpdateInstancePayloadGetFlavorIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateInstancePayloadGetFlavorIdAttributeType(arg *UpdateInstancePayloadGetFlavorIdAttributeType, val UpdateInstancePayloadGetFlavorIdRetType) { + *arg = &val +} + +type UpdateInstancePayloadGetFlavorIdArgType = string +type UpdateInstancePayloadGetFlavorIdRetType = string + +/* + types and functions for labels +*/ + +// isContainer +type UpdateInstancePayloadGetLabelsAttributeType = *map[string]string +type UpdateInstancePayloadGetLabelsArgType = map[string]string +type UpdateInstancePayloadGetLabelsRetType = map[string]string + +func getUpdateInstancePayloadGetLabelsAttributeTypeOk(arg UpdateInstancePayloadGetLabelsAttributeType) (ret UpdateInstancePayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateInstancePayloadGetLabelsAttributeType(arg *UpdateInstancePayloadGetLabelsAttributeType, val UpdateInstancePayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type UpdateInstancePayloadGetNameAttributeType = *string + +func getUpdateInstancePayloadGetNameAttributeTypeOk(arg UpdateInstancePayloadGetNameAttributeType) (ret UpdateInstancePayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateInstancePayloadGetNameAttributeType(arg *UpdateInstancePayloadGetNameAttributeType, val UpdateInstancePayloadGetNameRetType) { + *arg = &val +} + +type UpdateInstancePayloadGetNameArgType = string +type UpdateInstancePayloadGetNameRetType = string + +/* + types and functions for options +*/ + +// isContainer +type UpdateInstancePayloadGetOptionsAttributeType = *map[string]string +type UpdateInstancePayloadGetOptionsArgType = map[string]string +type UpdateInstancePayloadGetOptionsRetType = map[string]string + +func getUpdateInstancePayloadGetOptionsAttributeTypeOk(arg UpdateInstancePayloadGetOptionsAttributeType) (ret UpdateInstancePayloadGetOptionsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateInstancePayloadGetOptionsAttributeType(arg *UpdateInstancePayloadGetOptionsAttributeType, val UpdateInstancePayloadGetOptionsRetType) { + *arg = &val +} + +/* + types and functions for replicas +*/ + +// isInteger +type UpdateInstancePayloadGetReplicasAttributeType = *int64 +type UpdateInstancePayloadGetReplicasArgType = int64 +type UpdateInstancePayloadGetReplicasRetType = int64 + +func getUpdateInstancePayloadGetReplicasAttributeTypeOk(arg UpdateInstancePayloadGetReplicasAttributeType) (ret UpdateInstancePayloadGetReplicasRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateInstancePayloadGetReplicasAttributeType(arg *UpdateInstancePayloadGetReplicasAttributeType, val UpdateInstancePayloadGetReplicasRetType) { + *arg = &val +} + +/* + types and functions for storage +*/ + +// isModel +type UpdateInstancePayloadGetStorageAttributeType = *Storage +type UpdateInstancePayloadGetStorageArgType = Storage +type UpdateInstancePayloadGetStorageRetType = Storage + +func getUpdateInstancePayloadGetStorageAttributeTypeOk(arg UpdateInstancePayloadGetStorageAttributeType) (ret UpdateInstancePayloadGetStorageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateInstancePayloadGetStorageAttributeType(arg *UpdateInstancePayloadGetStorageAttributeType, val UpdateInstancePayloadGetStorageRetType) { + *arg = &val +} + +/* + types and functions for version +*/ + +// isNotNullableString +type UpdateInstancePayloadGetVersionAttributeType = *string + +func getUpdateInstancePayloadGetVersionAttributeTypeOk(arg UpdateInstancePayloadGetVersionAttributeType) (ret UpdateInstancePayloadGetVersionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateInstancePayloadGetVersionAttributeType(arg *UpdateInstancePayloadGetVersionAttributeType, val UpdateInstancePayloadGetVersionRetType) { + *arg = &val +} + +type UpdateInstancePayloadGetVersionArgType = string +type UpdateInstancePayloadGetVersionRetType = string + // UpdateInstancePayload struct for UpdateInstancePayload type UpdateInstancePayload struct { - Acl *ACL `json:"acl,omitempty"` - BackupSchedule *string `json:"backupSchedule,omitempty"` - FlavorId *string `json:"flavorId,omitempty"` + Acl UpdateInstancePayloadGetAclAttributeType `json:"acl,omitempty"` + BackupSchedule UpdateInstancePayloadGetBackupScheduleAttributeType `json:"backupSchedule,omitempty"` + FlavorId UpdateInstancePayloadGetFlavorIdAttributeType `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"` + Labels UpdateInstancePayloadGetLabelsAttributeType `json:"labels,omitempty"` + Name UpdateInstancePayloadGetNameAttributeType `json:"name,omitempty"` + Options UpdateInstancePayloadGetOptionsAttributeType `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"` + Replicas UpdateInstancePayloadGetReplicasAttributeType `json:"replicas,omitempty"` + Storage UpdateInstancePayloadGetStorageAttributeType `json:"storage,omitempty"` + Version UpdateInstancePayloadGetVersionAttributeType `json:"version,omitempty"` } // NewUpdateInstancePayload instantiates a new UpdateInstancePayload object @@ -50,321 +234,240 @@ func NewUpdateInstancePayloadWithDefaults() *UpdateInstancePayload { } // GetAcl returns the Acl field value if set, zero value otherwise. -func (o *UpdateInstancePayload) GetAcl() *ACL { - if o == nil || IsNil(o.Acl) { - var ret *ACL - return ret - } - return o.Acl +func (o *UpdateInstancePayload) GetAcl() (res UpdateInstancePayloadGetAclRetType) { + res, _ = o.GetAclOk() + return } // GetAclOk returns a tuple with the Acl field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateInstancePayload) GetAclOk() (*ACL, bool) { - if o == nil || IsNil(o.Acl) { - return nil, false - } - return o.Acl, true +func (o *UpdateInstancePayload) GetAclOk() (ret UpdateInstancePayloadGetAclRetType, ok bool) { + return getUpdateInstancePayloadGetAclAttributeTypeOk(o.Acl) } // HasAcl returns a boolean if a field has been set. func (o *UpdateInstancePayload) HasAcl() bool { - if o != nil && !IsNil(o.Acl) { - return true - } - - return false + _, ok := o.GetAclOk() + return ok } // SetAcl gets a reference to the given ACL and assigns it to the Acl field. -func (o *UpdateInstancePayload) SetAcl(v *ACL) { - o.Acl = v +func (o *UpdateInstancePayload) SetAcl(v UpdateInstancePayloadGetAclRetType) { + setUpdateInstancePayloadGetAclAttributeType(&o.Acl, v) } // GetBackupSchedule returns the BackupSchedule field value if set, zero value otherwise. -func (o *UpdateInstancePayload) GetBackupSchedule() *string { - if o == nil || IsNil(o.BackupSchedule) { - var ret *string - return ret - } - return o.BackupSchedule +func (o *UpdateInstancePayload) GetBackupSchedule() (res UpdateInstancePayloadGetBackupScheduleRetType) { + res, _ = o.GetBackupScheduleOk() + return } // GetBackupScheduleOk returns a tuple with the BackupSchedule field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateInstancePayload) GetBackupScheduleOk() (*string, bool) { - if o == nil || IsNil(o.BackupSchedule) { - return nil, false - } - return o.BackupSchedule, true +func (o *UpdateInstancePayload) GetBackupScheduleOk() (ret UpdateInstancePayloadGetBackupScheduleRetType, ok bool) { + return getUpdateInstancePayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule) } // HasBackupSchedule returns a boolean if a field has been set. func (o *UpdateInstancePayload) HasBackupSchedule() bool { - if o != nil && !IsNil(o.BackupSchedule) { - return true - } - - return false + _, ok := o.GetBackupScheduleOk() + return ok } // SetBackupSchedule gets a reference to the given string and assigns it to the BackupSchedule field. -func (o *UpdateInstancePayload) SetBackupSchedule(v *string) { - o.BackupSchedule = v +func (o *UpdateInstancePayload) SetBackupSchedule(v UpdateInstancePayloadGetBackupScheduleRetType) { + setUpdateInstancePayloadGetBackupScheduleAttributeType(&o.BackupSchedule, v) } // GetFlavorId returns the FlavorId field value if set, zero value otherwise. -func (o *UpdateInstancePayload) GetFlavorId() *string { - if o == nil || IsNil(o.FlavorId) { - var ret *string - return ret - } - return o.FlavorId +func (o *UpdateInstancePayload) GetFlavorId() (res UpdateInstancePayloadGetFlavorIdRetType) { + res, _ = o.GetFlavorIdOk() + return } // GetFlavorIdOk returns a tuple with the FlavorId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateInstancePayload) GetFlavorIdOk() (*string, bool) { - if o == nil || IsNil(o.FlavorId) { - return nil, false - } - return o.FlavorId, true +func (o *UpdateInstancePayload) GetFlavorIdOk() (ret UpdateInstancePayloadGetFlavorIdRetType, ok bool) { + return getUpdateInstancePayloadGetFlavorIdAttributeTypeOk(o.FlavorId) } // HasFlavorId returns a boolean if a field has been set. func (o *UpdateInstancePayload) HasFlavorId() bool { - if o != nil && !IsNil(o.FlavorId) { - return true - } - - return false + _, ok := o.GetFlavorIdOk() + return ok } // SetFlavorId gets a reference to the given string and assigns it to the FlavorId field. -func (o *UpdateInstancePayload) SetFlavorId(v *string) { - o.FlavorId = v +func (o *UpdateInstancePayload) SetFlavorId(v UpdateInstancePayloadGetFlavorIdRetType) { + setUpdateInstancePayloadGetFlavorIdAttributeType(&o.FlavorId, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateInstancePayload) GetLabels() *map[string]string { - if o == nil || IsNil(o.Labels) { - var ret *map[string]string - return ret - } - return o.Labels +func (o *UpdateInstancePayload) GetLabels() (res UpdateInstancePayloadGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return } // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateInstancePayload) GetLabelsOk() (*map[string]string, bool) { - if o == nil || IsNil(o.Labels) { - return nil, false - } - return o.Labels, true +func (o *UpdateInstancePayload) GetLabelsOk() (ret UpdateInstancePayloadGetLabelsRetType, ok bool) { + return getUpdateInstancePayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *UpdateInstancePayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false + _, ok := o.GetLabelsOk() + return ok } // SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. -func (o *UpdateInstancePayload) SetLabels(v *map[string]string) { - o.Labels = v +func (o *UpdateInstancePayload) SetLabels(v UpdateInstancePayloadGetLabelsRetType) { + setUpdateInstancePayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *UpdateInstancePayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *UpdateInstancePayload) GetName() (res UpdateInstancePayloadGetNameRetType) { + res, _ = o.GetNameOk() + return } // 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 *UpdateInstancePayload) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *UpdateInstancePayload) GetNameOk() (ret UpdateInstancePayloadGetNameRetType, ok bool) { + return getUpdateInstancePayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *UpdateInstancePayload) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false + _, ok := o.GetNameOk() + return ok } // SetName gets a reference to the given string and assigns it to the Name field. -func (o *UpdateInstancePayload) SetName(v *string) { - o.Name = v +func (o *UpdateInstancePayload) SetName(v UpdateInstancePayloadGetNameRetType) { + setUpdateInstancePayloadGetNameAttributeType(&o.Name, v) } // GetOptions returns the Options field value if set, zero value otherwise. -func (o *UpdateInstancePayload) GetOptions() *map[string]string { - if o == nil || IsNil(o.Options) { - var ret *map[string]string - return ret - } - return o.Options +func (o *UpdateInstancePayload) GetOptions() (res UpdateInstancePayloadGetOptionsRetType) { + res, _ = o.GetOptionsOk() + return } // GetOptionsOk returns a tuple with the Options field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateInstancePayload) GetOptionsOk() (*map[string]string, bool) { - if o == nil || IsNil(o.Options) { - return nil, false - } - return o.Options, true +func (o *UpdateInstancePayload) GetOptionsOk() (ret UpdateInstancePayloadGetOptionsRetType, ok bool) { + return getUpdateInstancePayloadGetOptionsAttributeTypeOk(o.Options) } // HasOptions returns a boolean if a field has been set. func (o *UpdateInstancePayload) HasOptions() bool { - if o != nil && !IsNil(o.Options) { - return true - } - - return false + _, ok := o.GetOptionsOk() + return ok } // SetOptions gets a reference to the given map[string]string and assigns it to the Options field. -func (o *UpdateInstancePayload) SetOptions(v *map[string]string) { - o.Options = v +func (o *UpdateInstancePayload) SetOptions(v UpdateInstancePayloadGetOptionsRetType) { + setUpdateInstancePayloadGetOptionsAttributeType(&o.Options, v) } // GetReplicas returns the Replicas field value if set, zero value otherwise. -func (o *UpdateInstancePayload) GetReplicas() *int64 { - if o == nil || IsNil(o.Replicas) { - var ret *int64 - return ret - } - return o.Replicas +func (o *UpdateInstancePayload) GetReplicas() (res UpdateInstancePayloadGetReplicasRetType) { + res, _ = o.GetReplicasOk() + return } // GetReplicasOk returns a tuple with the Replicas field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateInstancePayload) GetReplicasOk() (*int64, bool) { - if o == nil || IsNil(o.Replicas) { - return nil, false - } - return o.Replicas, true +func (o *UpdateInstancePayload) GetReplicasOk() (ret UpdateInstancePayloadGetReplicasRetType, ok bool) { + return getUpdateInstancePayloadGetReplicasAttributeTypeOk(o.Replicas) } // HasReplicas returns a boolean if a field has been set. func (o *UpdateInstancePayload) HasReplicas() bool { - if o != nil && !IsNil(o.Replicas) { - return true - } - - return false + _, ok := o.GetReplicasOk() + return ok } // SetReplicas gets a reference to the given int64 and assigns it to the Replicas field. -func (o *UpdateInstancePayload) SetReplicas(v *int64) { - o.Replicas = v +func (o *UpdateInstancePayload) SetReplicas(v UpdateInstancePayloadGetReplicasRetType) { + setUpdateInstancePayloadGetReplicasAttributeType(&o.Replicas, v) } // GetStorage returns the Storage field value if set, zero value otherwise. -func (o *UpdateInstancePayload) GetStorage() *Storage { - if o == nil || IsNil(o.Storage) { - var ret *Storage - return ret - } - return o.Storage +func (o *UpdateInstancePayload) GetStorage() (res UpdateInstancePayloadGetStorageRetType) { + res, _ = o.GetStorageOk() + return } // GetStorageOk returns a tuple with the Storage field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateInstancePayload) GetStorageOk() (*Storage, bool) { - if o == nil || IsNil(o.Storage) { - return nil, false - } - return o.Storage, true +func (o *UpdateInstancePayload) GetStorageOk() (ret UpdateInstancePayloadGetStorageRetType, ok bool) { + return getUpdateInstancePayloadGetStorageAttributeTypeOk(o.Storage) } // HasStorage returns a boolean if a field has been set. func (o *UpdateInstancePayload) HasStorage() bool { - if o != nil && !IsNil(o.Storage) { - return true - } - - return false + _, ok := o.GetStorageOk() + return ok } // SetStorage gets a reference to the given Storage and assigns it to the Storage field. -func (o *UpdateInstancePayload) SetStorage(v *Storage) { - o.Storage = v +func (o *UpdateInstancePayload) SetStorage(v UpdateInstancePayloadGetStorageRetType) { + setUpdateInstancePayloadGetStorageAttributeType(&o.Storage, v) } // GetVersion returns the Version field value if set, zero value otherwise. -func (o *UpdateInstancePayload) GetVersion() *string { - if o == nil || IsNil(o.Version) { - var ret *string - return ret - } - return o.Version +func (o *UpdateInstancePayload) GetVersion() (res UpdateInstancePayloadGetVersionRetType) { + res, _ = o.GetVersionOk() + return } // GetVersionOk returns a tuple with the Version field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateInstancePayload) GetVersionOk() (*string, bool) { - if o == nil || IsNil(o.Version) { - return nil, false - } - return o.Version, true +func (o *UpdateInstancePayload) GetVersionOk() (ret UpdateInstancePayloadGetVersionRetType, ok bool) { + return getUpdateInstancePayloadGetVersionAttributeTypeOk(o.Version) } // HasVersion returns a boolean if a field has been set. func (o *UpdateInstancePayload) HasVersion() bool { - if o != nil && !IsNil(o.Version) { - return true - } - - return false + _, ok := o.GetVersionOk() + return ok } // SetVersion gets a reference to the given string and assigns it to the Version field. -func (o *UpdateInstancePayload) SetVersion(v *string) { - o.Version = v +func (o *UpdateInstancePayload) SetVersion(v UpdateInstancePayloadGetVersionRetType) { + setUpdateInstancePayloadGetVersionAttributeType(&o.Version, v) } func (o UpdateInstancePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Acl) { - toSerialize["acl"] = o.Acl + if val, ok := getUpdateInstancePayloadGetAclAttributeTypeOk(o.Acl); ok { + toSerialize["Acl"] = val } - if !IsNil(o.BackupSchedule) { - toSerialize["backupSchedule"] = o.BackupSchedule + if val, ok := getUpdateInstancePayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule); ok { + toSerialize["BackupSchedule"] = val } - if !IsNil(o.FlavorId) { - toSerialize["flavorId"] = o.FlavorId + if val, ok := getUpdateInstancePayloadGetFlavorIdAttributeTypeOk(o.FlavorId); ok { + toSerialize["FlavorId"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getUpdateInstancePayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getUpdateInstancePayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Options) { - toSerialize["options"] = o.Options + if val, ok := getUpdateInstancePayloadGetOptionsAttributeTypeOk(o.Options); ok { + toSerialize["Options"] = val } - if !IsNil(o.Replicas) { - toSerialize["replicas"] = o.Replicas + if val, ok := getUpdateInstancePayloadGetReplicasAttributeTypeOk(o.Replicas); ok { + toSerialize["Replicas"] = val } - if !IsNil(o.Storage) { - toSerialize["storage"] = o.Storage + if val, ok := getUpdateInstancePayloadGetStorageAttributeTypeOk(o.Storage); ok { + toSerialize["Storage"] = val } - if !IsNil(o.Version) { - toSerialize["version"] = o.Version + if val, ok := getUpdateInstancePayloadGetVersionAttributeTypeOk(o.Version); ok { + toSerialize["Version"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_update_user_payload.go b/services/postgresflex/model_update_user_payload.go index fa229bbcd..fedade0b3 100644 --- a/services/postgresflex/model_update_user_payload.go +++ b/services/postgresflex/model_update_user_payload.go @@ -17,10 +17,51 @@ import ( // checks if the UpdateUserPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateUserPayload{} +/* + types and functions for database +*/ + +// isNotNullableString +type UpdateUserPayloadGetDatabaseAttributeType = *string + +func getUpdateUserPayloadGetDatabaseAttributeTypeOk(arg UpdateUserPayloadGetDatabaseAttributeType) (ret UpdateUserPayloadGetDatabaseRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateUserPayloadGetDatabaseAttributeType(arg *UpdateUserPayloadGetDatabaseAttributeType, val UpdateUserPayloadGetDatabaseRetType) { + *arg = &val +} + +type UpdateUserPayloadGetDatabaseArgType = string +type UpdateUserPayloadGetDatabaseRetType = string + +/* + types and functions for roles +*/ + +// isArray +type UpdateUserPayloadGetRolesAttributeType = *[]string +type UpdateUserPayloadGetRolesArgType = []string +type UpdateUserPayloadGetRolesRetType = []string + +func getUpdateUserPayloadGetRolesAttributeTypeOk(arg UpdateUserPayloadGetRolesAttributeType) (ret UpdateUserPayloadGetRolesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateUserPayloadGetRolesAttributeType(arg *UpdateUserPayloadGetRolesAttributeType, val UpdateUserPayloadGetRolesRetType) { + *arg = &val +} + // UpdateUserPayload struct for UpdateUserPayload type UpdateUserPayload struct { - Database *string `json:"database,omitempty"` - Roles *[]string `json:"roles,omitempty"` + Database UpdateUserPayloadGetDatabaseAttributeType `json:"database,omitempty"` + Roles UpdateUserPayloadGetRolesAttributeType `json:"roles,omitempty"` } // NewUpdateUserPayload instantiates a new UpdateUserPayload object @@ -41,76 +82,58 @@ func NewUpdateUserPayloadWithDefaults() *UpdateUserPayload { } // GetDatabase returns the Database field value if set, zero value otherwise. -func (o *UpdateUserPayload) GetDatabase() *string { - if o == nil || IsNil(o.Database) { - var ret *string - return ret - } - return o.Database +func (o *UpdateUserPayload) GetDatabase() (res UpdateUserPayloadGetDatabaseRetType) { + res, _ = o.GetDatabaseOk() + return } // GetDatabaseOk returns a tuple with the Database field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateUserPayload) GetDatabaseOk() (*string, bool) { - if o == nil || IsNil(o.Database) { - return nil, false - } - return o.Database, true +func (o *UpdateUserPayload) GetDatabaseOk() (ret UpdateUserPayloadGetDatabaseRetType, ok bool) { + return getUpdateUserPayloadGetDatabaseAttributeTypeOk(o.Database) } // HasDatabase returns a boolean if a field has been set. func (o *UpdateUserPayload) HasDatabase() bool { - if o != nil && !IsNil(o.Database) { - return true - } - - return false + _, ok := o.GetDatabaseOk() + return ok } // SetDatabase gets a reference to the given string and assigns it to the Database field. -func (o *UpdateUserPayload) SetDatabase(v *string) { - o.Database = v +func (o *UpdateUserPayload) SetDatabase(v UpdateUserPayloadGetDatabaseRetType) { + setUpdateUserPayloadGetDatabaseAttributeType(&o.Database, v) } // GetRoles returns the Roles field value if set, zero value otherwise. -func (o *UpdateUserPayload) GetRoles() *[]string { - if o == nil || IsNil(o.Roles) { - var ret *[]string - return ret - } - return o.Roles +func (o *UpdateUserPayload) GetRoles() (res UpdateUserPayloadGetRolesRetType) { + res, _ = o.GetRolesOk() + return } // 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 *UpdateUserPayload) GetRolesOk() (*[]string, bool) { - if o == nil || IsNil(o.Roles) { - return nil, false - } - return o.Roles, true +func (o *UpdateUserPayload) GetRolesOk() (ret UpdateUserPayloadGetRolesRetType, ok bool) { + return getUpdateUserPayloadGetRolesAttributeTypeOk(o.Roles) } // HasRoles returns a boolean if a field has been set. func (o *UpdateUserPayload) HasRoles() bool { - if o != nil && !IsNil(o.Roles) { - return true - } - - return false + _, ok := o.GetRolesOk() + return ok } // SetRoles gets a reference to the given []string and assigns it to the Roles field. -func (o *UpdateUserPayload) SetRoles(v *[]string) { - o.Roles = v +func (o *UpdateUserPayload) SetRoles(v UpdateUserPayloadGetRolesRetType) { + setUpdateUserPayloadGetRolesAttributeType(&o.Roles, v) } func (o UpdateUserPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Database) { - toSerialize["database"] = o.Database + if val, ok := getUpdateUserPayloadGetDatabaseAttributeTypeOk(o.Database); ok { + toSerialize["Database"] = val } - if !IsNil(o.Roles) { - toSerialize["roles"] = o.Roles + if val, ok := getUpdateUserPayloadGetRolesAttributeTypeOk(o.Roles); ok { + toSerialize["Roles"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_user.go b/services/postgresflex/model_user.go index 1561ccd31..bfb19a64b 100644 --- a/services/postgresflex/model_user.go +++ b/services/postgresflex/model_user.go @@ -17,16 +17,182 @@ import ( // checks if the User type satisfies the MappedNullable interface at compile time var _ MappedNullable = &User{} +/* + types and functions for database +*/ + +// isNotNullableString +type UserGetDatabaseAttributeType = *string + +func getUserGetDatabaseAttributeTypeOk(arg UserGetDatabaseAttributeType) (ret UserGetDatabaseRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUserGetDatabaseAttributeType(arg *UserGetDatabaseAttributeType, val UserGetDatabaseRetType) { + *arg = &val +} + +type UserGetDatabaseArgType = string +type UserGetDatabaseRetType = string + +/* + types and functions for host +*/ + +// isNotNullableString +type UserGetHostAttributeType = *string + +func getUserGetHostAttributeTypeOk(arg UserGetHostAttributeType) (ret UserGetHostRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUserGetHostAttributeType(arg *UserGetHostAttributeType, val UserGetHostRetType) { + *arg = &val +} + +type UserGetHostArgType = string +type UserGetHostRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type UserGetIdAttributeType = *string + +func getUserGetIdAttributeTypeOk(arg UserGetIdAttributeType) (ret UserGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUserGetIdAttributeType(arg *UserGetIdAttributeType, val UserGetIdRetType) { + *arg = &val +} + +type UserGetIdArgType = string +type UserGetIdRetType = string + +/* + types and functions for password +*/ + +// isNotNullableString +type UserGetPasswordAttributeType = *string + +func getUserGetPasswordAttributeTypeOk(arg UserGetPasswordAttributeType) (ret UserGetPasswordRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUserGetPasswordAttributeType(arg *UserGetPasswordAttributeType, val UserGetPasswordRetType) { + *arg = &val +} + +type UserGetPasswordArgType = string +type UserGetPasswordRetType = string + +/* + types and functions for port +*/ + +// isLong +type UserGetPortAttributeType = *int64 +type UserGetPortArgType = int64 +type UserGetPortRetType = int64 + +func getUserGetPortAttributeTypeOk(arg UserGetPortAttributeType) (ret UserGetPortRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUserGetPortAttributeType(arg *UserGetPortAttributeType, val UserGetPortRetType) { + *arg = &val +} + +/* + types and functions for roles +*/ + +// isArray +type UserGetRolesAttributeType = *[]string +type UserGetRolesArgType = []string +type UserGetRolesRetType = []string + +func getUserGetRolesAttributeTypeOk(arg UserGetRolesAttributeType) (ret UserGetRolesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUserGetRolesAttributeType(arg *UserGetRolesAttributeType, val UserGetRolesRetType) { + *arg = &val +} + +/* + types and functions for uri +*/ + +// isNotNullableString +type UserGetUriAttributeType = *string + +func getUserGetUriAttributeTypeOk(arg UserGetUriAttributeType) (ret UserGetUriRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUserGetUriAttributeType(arg *UserGetUriAttributeType, val UserGetUriRetType) { + *arg = &val +} + +type UserGetUriArgType = string +type UserGetUriRetType = string + +/* + types and functions for username +*/ + +// isNotNullableString +type UserGetUsernameAttributeType = *string + +func getUserGetUsernameAttributeTypeOk(arg UserGetUsernameAttributeType) (ret UserGetUsernameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUserGetUsernameAttributeType(arg *UserGetUsernameAttributeType, val UserGetUsernameRetType) { + *arg = &val +} + +type UserGetUsernameArgType = string +type UserGetUsernameRetType = string + // User struct for User type User struct { - Database *string `json:"database,omitempty"` - Host *string `json:"host,omitempty"` - Id *string `json:"id,omitempty"` - Password *string `json:"password,omitempty"` - Port *int64 `json:"port,omitempty"` - Roles *[]string `json:"roles,omitempty"` - Uri *string `json:"uri,omitempty"` - Username *string `json:"username,omitempty"` + Database UserGetDatabaseAttributeType `json:"database,omitempty"` + Host UserGetHostAttributeType `json:"host,omitempty"` + Id UserGetIdAttributeType `json:"id,omitempty"` + Password UserGetPasswordAttributeType `json:"password,omitempty"` + Port UserGetPortAttributeType `json:"port,omitempty"` + Roles UserGetRolesAttributeType `json:"roles,omitempty"` + Uri UserGetUriAttributeType `json:"uri,omitempty"` + Username UserGetUsernameAttributeType `json:"username,omitempty"` } // NewUser instantiates a new User object @@ -47,286 +213,214 @@ func NewUserWithDefaults() *User { } // GetDatabase returns the Database field value if set, zero value otherwise. -func (o *User) GetDatabase() *string { - if o == nil || IsNil(o.Database) { - var ret *string - return ret - } - return o.Database +func (o *User) GetDatabase() (res UserGetDatabaseRetType) { + res, _ = o.GetDatabaseOk() + return } // GetDatabaseOk returns a tuple with the Database field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *User) GetDatabaseOk() (*string, bool) { - if o == nil || IsNil(o.Database) { - return nil, false - } - return o.Database, true +func (o *User) GetDatabaseOk() (ret UserGetDatabaseRetType, ok bool) { + return getUserGetDatabaseAttributeTypeOk(o.Database) } // HasDatabase returns a boolean if a field has been set. func (o *User) HasDatabase() bool { - if o != nil && !IsNil(o.Database) { - return true - } - - return false + _, ok := o.GetDatabaseOk() + return ok } // SetDatabase gets a reference to the given string and assigns it to the Database field. -func (o *User) SetDatabase(v *string) { - o.Database = v +func (o *User) SetDatabase(v UserGetDatabaseRetType) { + setUserGetDatabaseAttributeType(&o.Database, v) } // GetHost returns the Host field value if set, zero value otherwise. -func (o *User) GetHost() *string { - if o == nil || IsNil(o.Host) { - var ret *string - return ret - } - return o.Host +func (o *User) GetHost() (res UserGetHostRetType) { + res, _ = o.GetHostOk() + return } // GetHostOk returns a tuple with the Host field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *User) GetHostOk() (*string, bool) { - if o == nil || IsNil(o.Host) { - return nil, false - } - return o.Host, true +func (o *User) GetHostOk() (ret UserGetHostRetType, ok bool) { + return getUserGetHostAttributeTypeOk(o.Host) } // HasHost returns a boolean if a field has been set. func (o *User) HasHost() bool { - if o != nil && !IsNil(o.Host) { - return true - } - - return false + _, ok := o.GetHostOk() + return ok } // SetHost gets a reference to the given string and assigns it to the Host field. -func (o *User) SetHost(v *string) { - o.Host = v +func (o *User) SetHost(v UserGetHostRetType) { + setUserGetHostAttributeType(&o.Host, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *User) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *User) GetId() (res UserGetIdRetType) { + res, _ = o.GetIdOk() + return } // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *User) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *User) GetIdOk() (ret UserGetIdRetType, ok bool) { + return getUserGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *User) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false + _, ok := o.GetIdOk() + return ok } // SetId gets a reference to the given string and assigns it to the Id field. -func (o *User) SetId(v *string) { - o.Id = v +func (o *User) SetId(v UserGetIdRetType) { + setUserGetIdAttributeType(&o.Id, v) } // GetPassword returns the Password field value if set, zero value otherwise. -func (o *User) GetPassword() *string { - if o == nil || IsNil(o.Password) { - var ret *string - return ret - } - return o.Password +func (o *User) GetPassword() (res UserGetPasswordRetType) { + res, _ = o.GetPasswordOk() + return } // GetPasswordOk returns a tuple with the Password field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *User) GetPasswordOk() (*string, bool) { - if o == nil || IsNil(o.Password) { - return nil, false - } - return o.Password, true +func (o *User) GetPasswordOk() (ret UserGetPasswordRetType, ok bool) { + return getUserGetPasswordAttributeTypeOk(o.Password) } // HasPassword returns a boolean if a field has been set. func (o *User) HasPassword() bool { - if o != nil && !IsNil(o.Password) { - return true - } - - return false + _, ok := o.GetPasswordOk() + return ok } // SetPassword gets a reference to the given string and assigns it to the Password field. -func (o *User) SetPassword(v *string) { - o.Password = v +func (o *User) SetPassword(v UserGetPasswordRetType) { + setUserGetPasswordAttributeType(&o.Password, v) } // GetPort returns the Port field value if set, zero value otherwise. -func (o *User) GetPort() *int64 { - if o == nil || IsNil(o.Port) { - var ret *int64 - return ret - } - return o.Port +func (o *User) GetPort() (res UserGetPortRetType) { + res, _ = o.GetPortOk() + return } // GetPortOk returns a tuple with the Port field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *User) GetPortOk() (*int64, bool) { - if o == nil || IsNil(o.Port) { - return nil, false - } - return o.Port, true +func (o *User) GetPortOk() (ret UserGetPortRetType, ok bool) { + return getUserGetPortAttributeTypeOk(o.Port) } // HasPort returns a boolean if a field has been set. func (o *User) HasPort() bool { - if o != nil && !IsNil(o.Port) { - return true - } - - return false + _, ok := o.GetPortOk() + return ok } // SetPort gets a reference to the given int64 and assigns it to the Port field. -func (o *User) SetPort(v *int64) { - o.Port = v +func (o *User) SetPort(v UserGetPortRetType) { + setUserGetPortAttributeType(&o.Port, v) } // GetRoles returns the Roles field value if set, zero value otherwise. -func (o *User) GetRoles() *[]string { - if o == nil || IsNil(o.Roles) { - var ret *[]string - return ret - } - return o.Roles +func (o *User) GetRoles() (res UserGetRolesRetType) { + res, _ = o.GetRolesOk() + return } // 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 *User) GetRolesOk() (*[]string, bool) { - if o == nil || IsNil(o.Roles) { - return nil, false - } - return o.Roles, true +func (o *User) GetRolesOk() (ret UserGetRolesRetType, ok bool) { + return getUserGetRolesAttributeTypeOk(o.Roles) } // HasRoles returns a boolean if a field has been set. func (o *User) HasRoles() bool { - if o != nil && !IsNil(o.Roles) { - return true - } - - return false + _, ok := o.GetRolesOk() + return ok } // SetRoles gets a reference to the given []string and assigns it to the Roles field. -func (o *User) SetRoles(v *[]string) { - o.Roles = v +func (o *User) SetRoles(v UserGetRolesRetType) { + setUserGetRolesAttributeType(&o.Roles, v) } // GetUri returns the Uri field value if set, zero value otherwise. -func (o *User) GetUri() *string { - if o == nil || IsNil(o.Uri) { - var ret *string - return ret - } - return o.Uri +func (o *User) GetUri() (res UserGetUriRetType) { + res, _ = o.GetUriOk() + return } // GetUriOk returns a tuple with the Uri field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *User) GetUriOk() (*string, bool) { - if o == nil || IsNil(o.Uri) { - return nil, false - } - return o.Uri, true +func (o *User) GetUriOk() (ret UserGetUriRetType, ok bool) { + return getUserGetUriAttributeTypeOk(o.Uri) } // HasUri returns a boolean if a field has been set. func (o *User) HasUri() bool { - if o != nil && !IsNil(o.Uri) { - return true - } - - return false + _, ok := o.GetUriOk() + return ok } // SetUri gets a reference to the given string and assigns it to the Uri field. -func (o *User) SetUri(v *string) { - o.Uri = v +func (o *User) SetUri(v UserGetUriRetType) { + setUserGetUriAttributeType(&o.Uri, v) } // GetUsername returns the Username field value if set, zero value otherwise. -func (o *User) GetUsername() *string { - if o == nil || IsNil(o.Username) { - var ret *string - return ret - } - return o.Username +func (o *User) GetUsername() (res UserGetUsernameRetType) { + res, _ = o.GetUsernameOk() + return } // GetUsernameOk returns a tuple with the Username field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *User) GetUsernameOk() (*string, bool) { - if o == nil || IsNil(o.Username) { - return nil, false - } - return o.Username, true +func (o *User) GetUsernameOk() (ret UserGetUsernameRetType, ok bool) { + return getUserGetUsernameAttributeTypeOk(o.Username) } // HasUsername returns a boolean if a field has been set. func (o *User) HasUsername() bool { - if o != nil && !IsNil(o.Username) { - return true - } - - return false + _, ok := o.GetUsernameOk() + return ok } // SetUsername gets a reference to the given string and assigns it to the Username field. -func (o *User) SetUsername(v *string) { - o.Username = v +func (o *User) SetUsername(v UserGetUsernameRetType) { + setUserGetUsernameAttributeType(&o.Username, v) } func (o User) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Database) { - toSerialize["database"] = o.Database + if val, ok := getUserGetDatabaseAttributeTypeOk(o.Database); ok { + toSerialize["Database"] = val } - if !IsNil(o.Host) { - toSerialize["host"] = o.Host + if val, ok := getUserGetHostAttributeTypeOk(o.Host); ok { + toSerialize["Host"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getUserGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.Password) { - toSerialize["password"] = o.Password + if val, ok := getUserGetPasswordAttributeTypeOk(o.Password); ok { + toSerialize["Password"] = val } - if !IsNil(o.Port) { - toSerialize["port"] = o.Port + if val, ok := getUserGetPortAttributeTypeOk(o.Port); ok { + toSerialize["Port"] = val } - if !IsNil(o.Roles) { - toSerialize["roles"] = o.Roles + if val, ok := getUserGetRolesAttributeTypeOk(o.Roles); ok { + toSerialize["Roles"] = val } - if !IsNil(o.Uri) { - toSerialize["uri"] = o.Uri + if val, ok := getUserGetUriAttributeTypeOk(o.Uri); ok { + toSerialize["Uri"] = val } - if !IsNil(o.Username) { - toSerialize["username"] = o.Username + if val, ok := getUserGetUsernameAttributeTypeOk(o.Username); ok { + toSerialize["Username"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_user_response.go b/services/postgresflex/model_user_response.go index 50909ebb6..76ad6a067 100644 --- a/services/postgresflex/model_user_response.go +++ b/services/postgresflex/model_user_response.go @@ -17,13 +17,116 @@ import ( // checks if the UserResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UserResponse{} +/* + types and functions for host +*/ + +// isNotNullableString +type UserResponseGetHostAttributeType = *string + +func getUserResponseGetHostAttributeTypeOk(arg UserResponseGetHostAttributeType) (ret UserResponseGetHostRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUserResponseGetHostAttributeType(arg *UserResponseGetHostAttributeType, val UserResponseGetHostRetType) { + *arg = &val +} + +type UserResponseGetHostArgType = string +type UserResponseGetHostRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type UserResponseGetIdAttributeType = *string + +func getUserResponseGetIdAttributeTypeOk(arg UserResponseGetIdAttributeType) (ret UserResponseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUserResponseGetIdAttributeType(arg *UserResponseGetIdAttributeType, val UserResponseGetIdRetType) { + *arg = &val +} + +type UserResponseGetIdArgType = string +type UserResponseGetIdRetType = string + +/* + types and functions for port +*/ + +// isLong +type UserResponseGetPortAttributeType = *int64 +type UserResponseGetPortArgType = int64 +type UserResponseGetPortRetType = int64 + +func getUserResponseGetPortAttributeTypeOk(arg UserResponseGetPortAttributeType) (ret UserResponseGetPortRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUserResponseGetPortAttributeType(arg *UserResponseGetPortAttributeType, val UserResponseGetPortRetType) { + *arg = &val +} + +/* + types and functions for roles +*/ + +// isArray +type UserResponseGetRolesAttributeType = *[]string +type UserResponseGetRolesArgType = []string +type UserResponseGetRolesRetType = []string + +func getUserResponseGetRolesAttributeTypeOk(arg UserResponseGetRolesAttributeType) (ret UserResponseGetRolesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUserResponseGetRolesAttributeType(arg *UserResponseGetRolesAttributeType, val UserResponseGetRolesRetType) { + *arg = &val +} + +/* + types and functions for username +*/ + +// isNotNullableString +type UserResponseGetUsernameAttributeType = *string + +func getUserResponseGetUsernameAttributeTypeOk(arg UserResponseGetUsernameAttributeType) (ret UserResponseGetUsernameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUserResponseGetUsernameAttributeType(arg *UserResponseGetUsernameAttributeType, val UserResponseGetUsernameRetType) { + *arg = &val +} + +type UserResponseGetUsernameArgType = string +type UserResponseGetUsernameRetType = string + // UserResponse struct for UserResponse type UserResponse struct { - Host *string `json:"host,omitempty"` - Id *string `json:"id,omitempty"` - Port *int64 `json:"port,omitempty"` - Roles *[]string `json:"roles,omitempty"` - Username *string `json:"username,omitempty"` + Host UserResponseGetHostAttributeType `json:"host,omitempty"` + Id UserResponseGetIdAttributeType `json:"id,omitempty"` + Port UserResponseGetPortAttributeType `json:"port,omitempty"` + Roles UserResponseGetRolesAttributeType `json:"roles,omitempty"` + Username UserResponseGetUsernameAttributeType `json:"username,omitempty"` } // NewUserResponse instantiates a new UserResponse object @@ -44,181 +147,136 @@ func NewUserResponseWithDefaults() *UserResponse { } // GetHost returns the Host field value if set, zero value otherwise. -func (o *UserResponse) GetHost() *string { - if o == nil || IsNil(o.Host) { - var ret *string - return ret - } - return o.Host +func (o *UserResponse) GetHost() (res UserResponseGetHostRetType) { + res, _ = o.GetHostOk() + return } // GetHostOk returns a tuple with the Host field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UserResponse) GetHostOk() (*string, bool) { - if o == nil || IsNil(o.Host) { - return nil, false - } - return o.Host, true +func (o *UserResponse) GetHostOk() (ret UserResponseGetHostRetType, ok bool) { + return getUserResponseGetHostAttributeTypeOk(o.Host) } // HasHost returns a boolean if a field has been set. func (o *UserResponse) HasHost() bool { - if o != nil && !IsNil(o.Host) { - return true - } - - return false + _, ok := o.GetHostOk() + return ok } // SetHost gets a reference to the given string and assigns it to the Host field. -func (o *UserResponse) SetHost(v *string) { - o.Host = v +func (o *UserResponse) SetHost(v UserResponseGetHostRetType) { + setUserResponseGetHostAttributeType(&o.Host, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *UserResponse) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *UserResponse) GetId() (res UserResponseGetIdRetType) { + res, _ = o.GetIdOk() + return } // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UserResponse) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *UserResponse) GetIdOk() (ret UserResponseGetIdRetType, ok bool) { + return getUserResponseGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *UserResponse) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false + _, ok := o.GetIdOk() + return ok } // SetId gets a reference to the given string and assigns it to the Id field. -func (o *UserResponse) SetId(v *string) { - o.Id = v +func (o *UserResponse) SetId(v UserResponseGetIdRetType) { + setUserResponseGetIdAttributeType(&o.Id, v) } // GetPort returns the Port field value if set, zero value otherwise. -func (o *UserResponse) GetPort() *int64 { - if o == nil || IsNil(o.Port) { - var ret *int64 - return ret - } - return o.Port +func (o *UserResponse) GetPort() (res UserResponseGetPortRetType) { + res, _ = o.GetPortOk() + return } // GetPortOk returns a tuple with the Port field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UserResponse) GetPortOk() (*int64, bool) { - if o == nil || IsNil(o.Port) { - return nil, false - } - return o.Port, true +func (o *UserResponse) GetPortOk() (ret UserResponseGetPortRetType, ok bool) { + return getUserResponseGetPortAttributeTypeOk(o.Port) } // HasPort returns a boolean if a field has been set. func (o *UserResponse) HasPort() bool { - if o != nil && !IsNil(o.Port) { - return true - } - - return false + _, ok := o.GetPortOk() + return ok } // SetPort gets a reference to the given int64 and assigns it to the Port field. -func (o *UserResponse) SetPort(v *int64) { - o.Port = v +func (o *UserResponse) SetPort(v UserResponseGetPortRetType) { + setUserResponseGetPortAttributeType(&o.Port, v) } // GetRoles returns the Roles field value if set, zero value otherwise. -func (o *UserResponse) GetRoles() *[]string { - if o == nil || IsNil(o.Roles) { - var ret *[]string - return ret - } - return o.Roles +func (o *UserResponse) GetRoles() (res UserResponseGetRolesRetType) { + res, _ = o.GetRolesOk() + return } // 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 *UserResponse) GetRolesOk() (*[]string, bool) { - if o == nil || IsNil(o.Roles) { - return nil, false - } - return o.Roles, true +func (o *UserResponse) GetRolesOk() (ret UserResponseGetRolesRetType, ok bool) { + return getUserResponseGetRolesAttributeTypeOk(o.Roles) } // HasRoles returns a boolean if a field has been set. func (o *UserResponse) HasRoles() bool { - if o != nil && !IsNil(o.Roles) { - return true - } - - return false + _, ok := o.GetRolesOk() + return ok } // SetRoles gets a reference to the given []string and assigns it to the Roles field. -func (o *UserResponse) SetRoles(v *[]string) { - o.Roles = v +func (o *UserResponse) SetRoles(v UserResponseGetRolesRetType) { + setUserResponseGetRolesAttributeType(&o.Roles, v) } // GetUsername returns the Username field value if set, zero value otherwise. -func (o *UserResponse) GetUsername() *string { - if o == nil || IsNil(o.Username) { - var ret *string - return ret - } - return o.Username +func (o *UserResponse) GetUsername() (res UserResponseGetUsernameRetType) { + res, _ = o.GetUsernameOk() + return } // GetUsernameOk returns a tuple with the Username field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UserResponse) GetUsernameOk() (*string, bool) { - if o == nil || IsNil(o.Username) { - return nil, false - } - return o.Username, true +func (o *UserResponse) GetUsernameOk() (ret UserResponseGetUsernameRetType, ok bool) { + return getUserResponseGetUsernameAttributeTypeOk(o.Username) } // HasUsername returns a boolean if a field has been set. func (o *UserResponse) HasUsername() bool { - if o != nil && !IsNil(o.Username) { - return true - } - - return false + _, ok := o.GetUsernameOk() + return ok } // SetUsername gets a reference to the given string and assigns it to the Username field. -func (o *UserResponse) SetUsername(v *string) { - o.Username = v +func (o *UserResponse) SetUsername(v UserResponseGetUsernameRetType) { + setUserResponseGetUsernameAttributeType(&o.Username, v) } func (o UserResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Host) { - toSerialize["host"] = o.Host + if val, ok := getUserResponseGetHostAttributeTypeOk(o.Host); ok { + toSerialize["Host"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getUserResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.Port) { - toSerialize["port"] = o.Port + if val, ok := getUserResponseGetPortAttributeTypeOk(o.Port); ok { + toSerialize["Port"] = val } - if !IsNil(o.Roles) { - toSerialize["roles"] = o.Roles + if val, ok := getUserResponseGetRolesAttributeTypeOk(o.Roles); ok { + toSerialize["Roles"] = val } - if !IsNil(o.Username) { - toSerialize["username"] = o.Username + if val, ok := getUserResponseGetUsernameAttributeTypeOk(o.Username); ok { + toSerialize["Username"] = val } return toSerialize, nil } diff --git a/services/postgresflex/utils.go b/services/postgresflex/utils.go index 2076da42b..d9d4aee12 100644 --- a/services/postgresflex/utils.go +++ b/services/postgresflex/utils.go @@ -40,6 +40,29 @@ func PtrString(v string) *string { return &v } // PtrTime is helper routine that returns a pointer to given Time value. func PtrTime(v time.Time) *time.Time { return &v } +type NullableValue[T any] struct { + value *T + isSet bool +} + +func (v NullableValue[T]) Get() *T { + return v.value +} + +func (v *NullableValue[T]) Set(val *T) { + v.value = val + v.isSet = true +} + +func (v NullableValue[T]) IsSet() bool { + return v.isSet +} + +func (v *NullableValue[T]) Unset() { + v.value = nil + v.isSet = false +} + type NullableBool struct { value *bool isSet bool @@ -333,6 +356,9 @@ func IsNil(i interface{}) bool { if i == nil { return true } + if t, ok := i.(interface{ IsSet() bool }); ok { + return !t.IsSet() + } switch reflect.TypeOf(i).Kind() { case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: return reflect.ValueOf(i).IsNil()