diff --git a/services/sqlserverflex/api_default_test.go b/services/sqlserverflex/api_default_test.go index e2aa79cb8..c7c79f3e2 100644 --- a/services/sqlserverflex/api_default_test.go +++ b/services/sqlserverflex/api_default_test.go @@ -24,16 +24,16 @@ import ( func Test_sqlserverflex_DefaultApiService(t *testing.T) { 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) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -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 := CreateDatabaseResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -67,9 +67,9 @@ func Test_sqlserverflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" - region := "region" + projectId := projectIdValue + instanceId := instanceIdValue + region := regionValue createDatabasePayload := CreateDatabasePayload{} resp, reqErr := apiClient.CreateDatabase(context.Background(), projectId, instanceId, region).CreateDatabasePayload(createDatabasePayload).Execute() @@ -77,20 +77,20 @@ func Test_sqlserverflex_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) @@ -124,8 +124,8 @@ func Test_sqlserverflex_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() @@ -133,22 +133,22 @@ func Test_sqlserverflex_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) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -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 := CreateUserResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -182,9 +182,9 @@ func Test_sqlserverflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" - region := "region" + projectId := projectIdValue + instanceId := instanceIdValue + region := regionValue createUserPayload := CreateUserPayload{} resp, reqErr := apiClient.CreateUser(context.Background(), projectId, instanceId, region).CreateUserPayload(createUserPayload).Execute() @@ -192,24 +192,24 @@ func Test_sqlserverflex_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/{databaseName}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseName}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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) databaseNameValue := "databaseName" - path = strings.Replace(path, "{"+"databaseName"+"}", url.PathEscape(ParameterValueToString(databaseNameValue, "databaseName")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"databaseName"+"}", url.PathEscape(ParameterValueToString(databaseNameValue, "databaseName")), -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) { }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -240,10 +240,10 @@ func Test_sqlserverflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" - databaseName := "databaseName" - region := "region" + projectId := projectIdValue + instanceId := instanceIdValue + databaseName := databaseNameValue + region := regionValue reqErr := apiClient.DeleteDatabase(context.Background(), projectId, instanceId, databaseName, region).Execute() @@ -253,16 +253,16 @@ func Test_sqlserverflex_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) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -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) { }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -293,9 +293,9 @@ func Test_sqlserverflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" - region := "region" + projectId := projectIdValue + instanceId := instanceIdValue + region := regionValue reqErr := apiClient.DeleteInstance(context.Background(), projectId, instanceId, region).Execute() @@ -305,18 +305,18 @@ func Test_sqlserverflex_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) 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) 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) { }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -347,10 +347,10 @@ func Test_sqlserverflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" - userId := "userId" - region := "region" + projectId := projectIdValue + instanceId := instanceIdValue + userId := userIdValue + region := regionValue reqErr := apiClient.DeleteUser(context.Background(), projectId, instanceId, userId, region).Execute() @@ -360,18 +360,18 @@ func Test_sqlserverflex_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) 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) 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 := GetBackupResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -405,34 +405,34 @@ func Test_sqlserverflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" - backupId := "backupId" - region := "region" + projectId := projectIdValue + instanceId := instanceIdValue + backupId := backupIdValue + region := regionValue resp, reqErr := apiClient.GetBackup(context.Background(), projectId, instanceId, backupId, 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 GetDatabase", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseName}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseName}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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) databaseNameValue := "databaseName" - path = strings.Replace(path, "{"+"databaseName"+"}", url.PathEscape(ParameterValueToString(databaseNameValue, "databaseName")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"databaseName"+"}", url.PathEscape(ParameterValueToString(databaseNameValue, "databaseName")), -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 := GetDatabaseResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -466,32 +466,32 @@ func Test_sqlserverflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" - databaseName := "databaseName" - region := "region" + projectId := projectIdValue + instanceId := instanceIdValue + databaseName := databaseNameValue + region := regionValue resp, reqErr := apiClient.GetDatabase(context.Background(), projectId, instanceId, databaseName, 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 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) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -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 := GetInstanceResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -525,33 +525,33 @@ func Test_sqlserverflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" - region := "region" + projectId := projectIdValue + instanceId := instanceIdValue + region := regionValue resp, reqErr := apiClient.GetInstance(context.Background(), projectId, instanceId, 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 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) 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) 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 := GetUserResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -585,32 +585,32 @@ func Test_sqlserverflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" - userId := "userId" - region := "region" + projectId := projectIdValue + instanceId := instanceIdValue + userId := userIdValue + region := regionValue resp, reqErr := apiClient.GetUser(context.Background(), projectId, instanceId, userId, 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 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) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -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 := ListBackupsResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -644,31 +644,31 @@ func Test_sqlserverflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" - region := "region" + projectId := projectIdValue + instanceId := instanceIdValue + region := regionValue resp, reqErr := apiClient.ListBackups(context.Background(), projectId, instanceId, 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 ListCollations", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/collation" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/collation" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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) 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 := ListCollationsResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -702,31 +702,31 @@ func Test_sqlserverflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" - region := "region" + projectId := projectIdValue + instanceId := instanceIdValue + region := regionValue resp, reqErr := apiClient.ListCollations(context.Background(), projectId, instanceId, 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 ListCompatibility", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/compatibility" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/compatibility" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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) 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 := ListCompatibilityResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -760,31 +760,31 @@ func Test_sqlserverflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" - region := "region" + projectId := projectIdValue + instanceId := instanceIdValue + region := regionValue resp, reqErr := apiClient.ListCompatibility(context.Background(), projectId, instanceId, 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 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) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -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 := ListDatabasesResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -818,29 +818,29 @@ func Test_sqlserverflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" - region := "region" + projectId := projectIdValue + instanceId := instanceIdValue + region := regionValue resp, reqErr := apiClient.ListDatabases(context.Background(), projectId, instanceId, 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 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) @@ -874,28 +874,28 @@ func Test_sqlserverflex_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) @@ -929,30 +929,30 @@ func Test_sqlserverflex_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 ListRestoreJobs", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/restores" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/restores" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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) 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 := ListRestoreJobsResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -986,31 +986,31 @@ func Test_sqlserverflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" - region := "region" + projectId := projectIdValue + instanceId := instanceIdValue + region := regionValue resp, reqErr := apiClient.ListRestoreJobs(context.Background(), projectId, instanceId, 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 ListRoles", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/roles" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/roles" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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) 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 := ListRolesResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -1044,31 +1044,31 @@ func Test_sqlserverflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" - region := "region" + projectId := projectIdValue + instanceId := instanceIdValue + region := regionValue resp, reqErr := apiClient.ListRoles(context.Background(), projectId, instanceId, 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 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) flavorIdValue := "flavorId" - path = strings.Replace(path, "{"+"flavorId"+"}", url.PathEscape(ParameterValueToString(flavorIdValue, "flavorId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"flavorId"+"}", url.PathEscape(ParameterValueToString(flavorIdValue, "flavorId")), -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 := ListStoragesResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -1102,31 +1102,31 @@ func Test_sqlserverflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - flavorId := "flavorId" - region := "region" + projectId := projectIdValue + flavorId := flavorIdValue + region := regionValue resp, reqErr := apiClient.ListStorages(context.Background(), projectId, flavorId, 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 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) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -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 := ListUsersResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -1160,29 +1160,29 @@ func Test_sqlserverflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" - region := "region" + projectId := projectIdValue + instanceId := instanceIdValue + region := regionValue resp, reqErr := apiClient.ListUsers(context.Background(), projectId, instanceId, 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 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) @@ -1216,30 +1216,30 @@ func Test_sqlserverflex_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) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -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 := UpdateInstanceResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -1273,9 +1273,9 @@ func Test_sqlserverflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" - region := "region" + projectId := projectIdValue + instanceId := instanceIdValue + region := regionValue partialUpdateInstancePayload := PartialUpdateInstancePayload{} resp, reqErr := apiClient.PartialUpdateInstance(context.Background(), projectId, instanceId, region).PartialUpdateInstancePayload(partialUpdateInstancePayload).Execute() @@ -1283,24 +1283,24 @@ func Test_sqlserverflex_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 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) 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) 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 := ResetUserResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -1334,30 +1334,30 @@ func Test_sqlserverflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" - userId := "userId" - region := "region" + projectId := projectIdValue + instanceId := instanceIdValue + userId := userIdValue + region := regionValue resp, reqErr := apiClient.ResetUser(context.Background(), projectId, instanceId, userId, 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 TerminateProject", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}" 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) { }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -1388,8 +1388,8 @@ func Test_sqlserverflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" + projectId := projectIdValue + region := regionValue reqErr := apiClient.TerminateProject(context.Background(), projectId, region).Execute() @@ -1399,18 +1399,18 @@ func Test_sqlserverflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService TriggerDatabaseBackup", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/backups/databases/{databaseName}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/backups/databases/{databaseName}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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) databaseNameValue := "databaseName" - path = strings.Replace(path, "{"+"databaseName"+"}", url.PathEscape(ParameterValueToString(databaseNameValue, "databaseName")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"databaseName"+"}", url.PathEscape(ParameterValueToString(databaseNameValue, "databaseName")), -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) { }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -1441,10 +1441,10 @@ func Test_sqlserverflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" - databaseName := "databaseName" - region := "region" + projectId := projectIdValue + instanceId := instanceIdValue + databaseName := databaseNameValue + region := regionValue reqErr := apiClient.TriggerDatabaseBackup(context.Background(), projectId, instanceId, databaseName, region).Execute() @@ -1454,18 +1454,18 @@ func Test_sqlserverflex_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService TriggerDatabaseRestore", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/backups/databases/{databaseName}/restores" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/backups/databases/{databaseName}/restores" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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) databaseNameValue := "databaseName" - path = strings.Replace(path, "{"+"databaseName"+"}", url.PathEscape(ParameterValueToString(databaseNameValue, "databaseName")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"databaseName"+"}", url.PathEscape(ParameterValueToString(databaseNameValue, "databaseName")), -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) { }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -1496,10 +1496,10 @@ func Test_sqlserverflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" - databaseName := "databaseName" - region := "region" + projectId := projectIdValue + instanceId := instanceIdValue + databaseName := databaseNameValue + region := regionValue triggerDatabaseRestorePayload := TriggerDatabaseRestorePayload{} reqErr := apiClient.TriggerDatabaseRestore(context.Background(), projectId, instanceId, databaseName, region).TriggerDatabaseRestorePayload(triggerDatabaseRestorePayload).Execute() @@ -1510,16 +1510,16 @@ func Test_sqlserverflex_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) instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -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 := UpdateInstanceResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -1553,9 +1553,9 @@ func Test_sqlserverflex_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" - region := "region" + projectId := projectIdValue + instanceId := instanceIdValue + region := regionValue updateInstancePayload := UpdateInstancePayload{} resp, reqErr := apiClient.UpdateInstance(context.Background(), projectId, instanceId, region).UpdateInstancePayload(updateInstancePayload).Execute() @@ -1563,7 +1563,7 @@ func Test_sqlserverflex_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") } }) diff --git a/services/sqlserverflex/model_acl.go b/services/sqlserverflex/model_acl.go index 560c8fc28..a108f1cf2 100644 --- a/services/sqlserverflex/model_acl.go +++ b/services/sqlserverflex/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/sqlserverflex/model_backup.go b/services/sqlserverflex/model_backup.go index d4c35e8fa..22be75bf0 100644 --- a/services/sqlserverflex/model_backup.go +++ b/services/sqlserverflex/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/sqlserverflex/model_backup_list_backups_response_grouped.go b/services/sqlserverflex/model_backup_list_backups_response_grouped.go index 72d034ba5..56d98832e 100644 --- a/services/sqlserverflex/model_backup_list_backups_response_grouped.go +++ b/services/sqlserverflex/model_backup_list_backups_response_grouped.go @@ -17,10 +17,51 @@ import ( // checks if the BackupListBackupsResponseGrouped type satisfies the MappedNullable interface at compile time var _ MappedNullable = &BackupListBackupsResponseGrouped{} +/* + types and functions for backups +*/ + +// isArray +type BackupListBackupsResponseGroupedGetBackupsAttributeType = *[]Backup +type BackupListBackupsResponseGroupedGetBackupsArgType = []Backup +type BackupListBackupsResponseGroupedGetBackupsRetType = []Backup + +func getBackupListBackupsResponseGroupedGetBackupsAttributeTypeOk(arg BackupListBackupsResponseGroupedGetBackupsAttributeType) (ret BackupListBackupsResponseGroupedGetBackupsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupListBackupsResponseGroupedGetBackupsAttributeType(arg *BackupListBackupsResponseGroupedGetBackupsAttributeType, val BackupListBackupsResponseGroupedGetBackupsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type BackupListBackupsResponseGroupedGetNameAttributeType = *string + +func getBackupListBackupsResponseGroupedGetNameAttributeTypeOk(arg BackupListBackupsResponseGroupedGetNameAttributeType) (ret BackupListBackupsResponseGroupedGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupListBackupsResponseGroupedGetNameAttributeType(arg *BackupListBackupsResponseGroupedGetNameAttributeType, val BackupListBackupsResponseGroupedGetNameRetType) { + *arg = &val +} + +type BackupListBackupsResponseGroupedGetNameArgType = string +type BackupListBackupsResponseGroupedGetNameRetType = string + // BackupListBackupsResponseGrouped struct for BackupListBackupsResponseGrouped type BackupListBackupsResponseGrouped struct { - Backups *[]Backup `json:"backups,omitempty"` - Name *string `json:"name,omitempty"` + Backups BackupListBackupsResponseGroupedGetBackupsAttributeType `json:"backups,omitempty"` + Name BackupListBackupsResponseGroupedGetNameAttributeType `json:"name,omitempty"` } // NewBackupListBackupsResponseGrouped instantiates a new BackupListBackupsResponseGrouped object @@ -41,76 +82,58 @@ func NewBackupListBackupsResponseGroupedWithDefaults() *BackupListBackupsRespons } // GetBackups returns the Backups field value if set, zero value otherwise. -func (o *BackupListBackupsResponseGrouped) GetBackups() *[]Backup { - if o == nil || IsNil(o.Backups) { - var ret *[]Backup - return ret - } - return o.Backups +func (o *BackupListBackupsResponseGrouped) GetBackups() (res BackupListBackupsResponseGroupedGetBackupsRetType) { + res, _ = o.GetBackupsOk() + return } // GetBackupsOk returns a tuple with the Backups field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *BackupListBackupsResponseGrouped) GetBackupsOk() (*[]Backup, bool) { - if o == nil || IsNil(o.Backups) { - return nil, false - } - return o.Backups, true +func (o *BackupListBackupsResponseGrouped) GetBackupsOk() (ret BackupListBackupsResponseGroupedGetBackupsRetType, ok bool) { + return getBackupListBackupsResponseGroupedGetBackupsAttributeTypeOk(o.Backups) } // HasBackups returns a boolean if a field has been set. func (o *BackupListBackupsResponseGrouped) HasBackups() bool { - if o != nil && !IsNil(o.Backups) { - return true - } - - return false + _, ok := o.GetBackupsOk() + return ok } // SetBackups gets a reference to the given []Backup and assigns it to the Backups field. -func (o *BackupListBackupsResponseGrouped) SetBackups(v *[]Backup) { - o.Backups = v +func (o *BackupListBackupsResponseGrouped) SetBackups(v BackupListBackupsResponseGroupedGetBackupsRetType) { + setBackupListBackupsResponseGroupedGetBackupsAttributeType(&o.Backups, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *BackupListBackupsResponseGrouped) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *BackupListBackupsResponseGrouped) GetName() (res BackupListBackupsResponseGroupedGetNameRetType) { + 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 *BackupListBackupsResponseGrouped) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *BackupListBackupsResponseGrouped) GetNameOk() (ret BackupListBackupsResponseGroupedGetNameRetType, ok bool) { + return getBackupListBackupsResponseGroupedGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *BackupListBackupsResponseGrouped) 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 *BackupListBackupsResponseGrouped) SetName(v *string) { - o.Name = v +func (o *BackupListBackupsResponseGrouped) SetName(v BackupListBackupsResponseGroupedGetNameRetType) { + setBackupListBackupsResponseGroupedGetNameAttributeType(&o.Name, v) } func (o BackupListBackupsResponseGrouped) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Backups) { - toSerialize["backups"] = o.Backups + if val, ok := getBackupListBackupsResponseGroupedGetBackupsAttributeTypeOk(o.Backups); ok { + toSerialize["Backups"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getBackupListBackupsResponseGroupedGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_create_database_payload.go b/services/sqlserverflex/model_create_database_payload.go index d9a84d783..2f1d4645f 100644 --- a/services/sqlserverflex/model_create_database_payload.go +++ b/services/sqlserverflex/model_create_database_payload.go @@ -17,12 +17,53 @@ 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 +*/ + +// isModel +type CreateDatabasePayloadGetOptionsAttributeType = *DatabaseDocumentationCreateDatabaseRequestOptions +type CreateDatabasePayloadGetOptionsArgType = DatabaseDocumentationCreateDatabaseRequestOptions +type CreateDatabasePayloadGetOptionsRetType = DatabaseDocumentationCreateDatabaseRequestOptions + +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 { // REQUIRED - Name *string `json:"name"` + Name CreateDatabasePayloadGetNameAttributeType `json:"name"` // REQUIRED - Options *DatabaseDocumentationCreateDatabaseRequestOptions `json:"options"` + Options CreateDatabasePayloadGetOptionsAttributeType `json:"options"` } type _CreateDatabasePayload CreateDatabasePayload @@ -31,10 +72,10 @@ type _CreateDatabasePayload CreateDatabasePayload // 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 NewCreateDatabasePayload(name *string, options *DatabaseDocumentationCreateDatabaseRequestOptions) *CreateDatabasePayload { +func NewCreateDatabasePayload(name CreateDatabasePayloadGetNameArgType, options CreateDatabasePayloadGetOptionsArgType) *CreateDatabasePayload { this := CreateDatabasePayload{} - this.Name = name - this.Options = options + setCreateDatabasePayloadGetNameAttributeType(&this.Name, name) + setCreateDatabasePayloadGetOptionsAttributeType(&this.Options, options) return &this } @@ -47,57 +88,47 @@ func NewCreateDatabasePayloadWithDefaults() *CreateDatabasePayload { } // GetName returns the Name field value -func (o *CreateDatabasePayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *CreateDatabasePayload) GetName() (ret CreateDatabasePayloadGetNameRetType) { + 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 *CreateDatabasePayload) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *CreateDatabasePayload) GetNameOk() (ret CreateDatabasePayloadGetNameRetType, ok bool) { + return getCreateDatabasePayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value -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 -func (o *CreateDatabasePayload) GetOptions() *DatabaseDocumentationCreateDatabaseRequestOptions { - if o == nil || IsNil(o.Options) { - var ret *DatabaseDocumentationCreateDatabaseRequestOptions - return ret - } - - return o.Options +func (o *CreateDatabasePayload) GetOptions() (ret CreateDatabasePayloadGetOptionsRetType) { + 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 *CreateDatabasePayload) GetOptionsOk() (*DatabaseDocumentationCreateDatabaseRequestOptions, bool) { - if o == nil { - return nil, false - } - return o.Options, true +func (o *CreateDatabasePayload) GetOptionsOk() (ret CreateDatabasePayloadGetOptionsRetType, ok bool) { + return getCreateDatabasePayloadGetOptionsAttributeTypeOk(o.Options) } // SetOptions sets field value -func (o *CreateDatabasePayload) SetOptions(v *DatabaseDocumentationCreateDatabaseRequestOptions) { - 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{}{} - toSerialize["name"] = o.Name - toSerialize["options"] = o.Options + if val, ok := getCreateDatabasePayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getCreateDatabasePayloadGetOptionsAttributeTypeOk(o.Options); ok { + toSerialize["Options"] = val + } return toSerialize, nil } diff --git a/services/sqlserverflex/model_create_database_response.go b/services/sqlserverflex/model_create_database_response.go index 4e65e5403..493e2a5cc 100644 --- a/services/sqlserverflex/model_create_database_response.go +++ b/services/sqlserverflex/model_create_database_response.go @@ -17,9 +17,30 @@ import ( // checks if the CreateDatabaseResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateDatabaseResponse{} +/* + types and functions for id +*/ + +// isNotNullableString +type CreateDatabaseResponseGetIdAttributeType = *string + +func getCreateDatabaseResponseGetIdAttributeTypeOk(arg CreateDatabaseResponseGetIdAttributeType) (ret CreateDatabaseResponseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateDatabaseResponseGetIdAttributeType(arg *CreateDatabaseResponseGetIdAttributeType, val CreateDatabaseResponseGetIdRetType) { + *arg = &val +} + +type CreateDatabaseResponseGetIdArgType = string +type CreateDatabaseResponseGetIdRetType = string + // CreateDatabaseResponse struct for CreateDatabaseResponse type CreateDatabaseResponse struct { - Id *string `json:"id,omitempty"` + Id CreateDatabaseResponseGetIdAttributeType `json:"id,omitempty"` } // NewCreateDatabaseResponse instantiates a new CreateDatabaseResponse object @@ -40,41 +61,32 @@ func NewCreateDatabaseResponseWithDefaults() *CreateDatabaseResponse { } // GetId returns the Id field value if set, zero value otherwise. -func (o *CreateDatabaseResponse) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *CreateDatabaseResponse) GetId() (res CreateDatabaseResponseGetIdRetType) { + 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 *CreateDatabaseResponse) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *CreateDatabaseResponse) GetIdOk() (ret CreateDatabaseResponseGetIdRetType, ok bool) { + return getCreateDatabaseResponseGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *CreateDatabaseResponse) 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 *CreateDatabaseResponse) SetId(v *string) { - o.Id = v +func (o *CreateDatabaseResponse) SetId(v CreateDatabaseResponseGetIdRetType) { + setCreateDatabaseResponseGetIdAttributeType(&o.Id, v) } func (o CreateDatabaseResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getCreateDatabaseResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_create_instance_payload.go b/services/sqlserverflex/model_create_instance_payload.go index 23a5f1e6f..a3fa6363c 100644 --- a/services/sqlserverflex/model_create_instance_payload.go +++ b/services/sqlserverflex/model_create_instance_payload.go @@ -17,22 +17,186 @@ import ( // checks if the CreateInstancePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateInstancePayload{} +/* + types and functions for acl +*/ + +// isModel +type CreateInstancePayloadGetAclAttributeType = *CreateInstancePayloadAcl +type CreateInstancePayloadGetAclArgType = CreateInstancePayloadAcl +type CreateInstancePayloadGetAclRetType = CreateInstancePayloadAcl + +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 +*/ + +// isFreeform +type CreateInstancePayloadGetLabelsAttributeType = *map[string]interface{} +type CreateInstancePayloadGetLabelsArgType = map[string]interface{} +type CreateInstancePayloadGetLabelsRetType = map[string]interface{} + +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 +*/ + +// isModel +type CreateInstancePayloadGetOptionsAttributeType = *CreateInstancePayloadOptions +type CreateInstancePayloadGetOptionsArgType = CreateInstancePayloadOptions +type CreateInstancePayloadGetOptionsRetType = CreateInstancePayloadOptions + +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 storage +*/ + +// isModel +type CreateInstancePayloadGetStorageAttributeType = *CreateInstancePayloadStorage +type CreateInstancePayloadGetStorageArgType = CreateInstancePayloadStorage +type CreateInstancePayloadGetStorageRetType = CreateInstancePayloadStorage + +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 { - Acl *CreateInstancePayloadAcl `json:"acl,omitempty"` + Acl CreateInstancePayloadGetAclAttributeType `json:"acl,omitempty"` // Cronjob for the daily full backup if not provided a job will generated between 00:00 and 04:59 - BackupSchedule *string `json:"backupSchedule,omitempty"` + BackupSchedule CreateInstancePayloadGetBackupScheduleAttributeType `json:"backupSchedule,omitempty"` // Id of the selected flavor // REQUIRED - FlavorId *string `json:"flavorId"` - Labels *map[string]interface{} `json:"labels,omitempty"` + FlavorId CreateInstancePayloadGetFlavorIdAttributeType `json:"flavorId"` + Labels CreateInstancePayloadGetLabelsAttributeType `json:"labels,omitempty"` // Name of the instance // REQUIRED - Name *string `json:"name"` - Options *CreateInstancePayloadOptions `json:"options,omitempty"` - Storage *CreateInstancePayloadStorage `json:"storage,omitempty"` + Name CreateInstancePayloadGetNameAttributeType `json:"name"` + Options CreateInstancePayloadGetOptionsAttributeType `json:"options,omitempty"` + Storage CreateInstancePayloadGetStorageAttributeType `json:"storage,omitempty"` // Version of the MSSQL Server - Version *string `json:"version,omitempty"` + Version CreateInstancePayloadGetVersionAttributeType `json:"version,omitempty"` } type _CreateInstancePayload CreateInstancePayload @@ -41,12 +205,10 @@ 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(flavorId *string, name *string) *CreateInstancePayload { +func NewCreateInstancePayload(flavorId CreateInstancePayloadGetFlavorIdArgType, name CreateInstancePayloadGetNameArgType) *CreateInstancePayload { this := CreateInstancePayload{} - this.FlavorId = flavorId - this.Name = name - var version string = "2022" - this.Version = &version + setCreateInstancePayloadGetFlavorIdAttributeType(&this.FlavorId, flavorId) + setCreateInstancePayloadGetNameAttributeType(&this.Name, name) return &this } @@ -61,266 +223,202 @@ func NewCreateInstancePayloadWithDefaults() *CreateInstancePayload { } // GetAcl returns the Acl field value if set, zero value otherwise. -func (o *CreateInstancePayload) GetAcl() *CreateInstancePayloadAcl { - if o == nil || IsNil(o.Acl) { - var ret *CreateInstancePayloadAcl - return ret - } - return o.Acl +func (o *CreateInstancePayload) GetAcl() (res CreateInstancePayloadGetAclRetType) { + 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 *CreateInstancePayload) GetAclOk() (*CreateInstancePayloadAcl, bool) { - if o == nil || IsNil(o.Acl) { - return nil, false - } - return o.Acl, true +func (o *CreateInstancePayload) GetAclOk() (ret CreateInstancePayloadGetAclRetType, ok bool) { + return getCreateInstancePayloadGetAclAttributeTypeOk(o.Acl) } // HasAcl returns a boolean if a field has been set. func (o *CreateInstancePayload) HasAcl() bool { - if o != nil && !IsNil(o.Acl) { - return true - } - - return false + _, ok := o.GetAclOk() + return ok } // SetAcl gets a reference to the given CreateInstancePayloadAcl and assigns it to the Acl field. -func (o *CreateInstancePayload) SetAcl(v *CreateInstancePayloadAcl) { - o.Acl = v +func (o *CreateInstancePayload) SetAcl(v CreateInstancePayloadGetAclRetType) { + setCreateInstancePayloadGetAclAttributeType(&o.Acl, v) } // GetBackupSchedule returns the BackupSchedule field value if set, zero value otherwise. -func (o *CreateInstancePayload) GetBackupSchedule() *string { - if o == nil || IsNil(o.BackupSchedule) { - var ret *string - return ret - } - return o.BackupSchedule +func (o *CreateInstancePayload) GetBackupSchedule() (res CreateInstancePayloadGetBackupScheduleRetType) { + 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 *CreateInstancePayload) GetBackupScheduleOk() (*string, bool) { - if o == nil || IsNil(o.BackupSchedule) { - return nil, false - } - return o.BackupSchedule, true +func (o *CreateInstancePayload) GetBackupScheduleOk() (ret CreateInstancePayloadGetBackupScheduleRetType, ok bool) { + return getCreateInstancePayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule) } // HasBackupSchedule returns a boolean if a field has been set. func (o *CreateInstancePayload) 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 *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]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - 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]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, 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]interface{} and assigns it to the Labels field. -func (o *CreateInstancePayload) SetLabels(v *map[string]interface{}) { - 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 if set, zero value otherwise. -func (o *CreateInstancePayload) GetOptions() *CreateInstancePayloadOptions { - if o == nil || IsNil(o.Options) { - var ret *CreateInstancePayloadOptions - return ret - } - return o.Options +func (o *CreateInstancePayload) GetOptions() (res CreateInstancePayloadGetOptionsRetType) { + 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 *CreateInstancePayload) GetOptionsOk() (*CreateInstancePayloadOptions, bool) { - if o == nil || IsNil(o.Options) { - return nil, false - } - return o.Options, true +func (o *CreateInstancePayload) GetOptionsOk() (ret CreateInstancePayloadGetOptionsRetType, ok bool) { + return getCreateInstancePayloadGetOptionsAttributeTypeOk(o.Options) } // HasOptions returns a boolean if a field has been set. func (o *CreateInstancePayload) HasOptions() bool { - if o != nil && !IsNil(o.Options) { - return true - } - - return false + _, ok := o.GetOptionsOk() + return ok } // SetOptions gets a reference to the given CreateInstancePayloadOptions and assigns it to the Options field. -func (o *CreateInstancePayload) SetOptions(v *CreateInstancePayloadOptions) { - o.Options = v +func (o *CreateInstancePayload) SetOptions(v CreateInstancePayloadGetOptionsRetType) { + setCreateInstancePayloadGetOptionsAttributeType(&o.Options, v) } // GetStorage returns the Storage field value if set, zero value otherwise. -func (o *CreateInstancePayload) GetStorage() *CreateInstancePayloadStorage { - if o == nil || IsNil(o.Storage) { - var ret *CreateInstancePayloadStorage - return ret - } - return o.Storage +func (o *CreateInstancePayload) GetStorage() (res CreateInstancePayloadGetStorageRetType) { + 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 *CreateInstancePayload) GetStorageOk() (*CreateInstancePayloadStorage, bool) { - if o == nil || IsNil(o.Storage) { - return nil, false - } - return o.Storage, true +func (o *CreateInstancePayload) GetStorageOk() (ret CreateInstancePayloadGetStorageRetType, ok bool) { + return getCreateInstancePayloadGetStorageAttributeTypeOk(o.Storage) } // HasStorage returns a boolean if a field has been set. func (o *CreateInstancePayload) HasStorage() bool { - if o != nil && !IsNil(o.Storage) { - return true - } - - return false + _, ok := o.GetStorageOk() + return ok } // SetStorage gets a reference to the given CreateInstancePayloadStorage and assigns it to the Storage field. -func (o *CreateInstancePayload) SetStorage(v *CreateInstancePayloadStorage) { - o.Storage = v +func (o *CreateInstancePayload) SetStorage(v CreateInstancePayloadGetStorageRetType) { + setCreateInstancePayloadGetStorageAttributeType(&o.Storage, v) } // GetVersion returns the Version field value if set, zero value otherwise. -func (o *CreateInstancePayload) GetVersion() *string { - if o == nil || IsNil(o.Version) { - var ret *string - return ret - } - return o.Version +func (o *CreateInstancePayload) GetVersion() (res CreateInstancePayloadGetVersionRetType) { + 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 *CreateInstancePayload) GetVersionOk() (*string, bool) { - if o == nil || IsNil(o.Version) { - return nil, false - } - return o.Version, true +func (o *CreateInstancePayload) GetVersionOk() (ret CreateInstancePayloadGetVersionRetType, ok bool) { + return getCreateInstancePayloadGetVersionAttributeTypeOk(o.Version) } // HasVersion returns a boolean if a field has been set. func (o *CreateInstancePayload) 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 *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{}{} - if !IsNil(o.Acl) { - toSerialize["acl"] = o.Acl + 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 !IsNil(o.BackupSchedule) { - toSerialize["backupSchedule"] = o.BackupSchedule + if val, ok := getCreateInstancePayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - toSerialize["flavorId"] = o.FlavorId - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getCreateInstancePayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - toSerialize["name"] = o.Name - if !IsNil(o.Options) { - toSerialize["options"] = o.Options + if val, ok := getCreateInstancePayloadGetOptionsAttributeTypeOk(o.Options); ok { + toSerialize["Options"] = val } - if !IsNil(o.Storage) { - toSerialize["storage"] = o.Storage + if val, ok := getCreateInstancePayloadGetStorageAttributeTypeOk(o.Storage); ok { + toSerialize["Storage"] = val } - if !IsNil(o.Version) { - toSerialize["version"] = o.Version + if val, ok := getCreateInstancePayloadGetVersionAttributeTypeOk(o.Version); ok { + toSerialize["Version"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_create_instance_payload_acl.go b/services/sqlserverflex/model_create_instance_payload_acl.go index 07f4e40ac..d654de550 100644 --- a/services/sqlserverflex/model_create_instance_payload_acl.go +++ b/services/sqlserverflex/model_create_instance_payload_acl.go @@ -17,10 +17,30 @@ import ( // checks if the CreateInstancePayloadAcl type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateInstancePayloadAcl{} +/* + types and functions for items +*/ + +// isArray +type CreateInstancePayloadAclGetItemsAttributeType = *[]string +type CreateInstancePayloadAclGetItemsArgType = []string +type CreateInstancePayloadAclGetItemsRetType = []string + +func getCreateInstancePayloadAclGetItemsAttributeTypeOk(arg CreateInstancePayloadAclGetItemsAttributeType) (ret CreateInstancePayloadAclGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateInstancePayloadAclGetItemsAttributeType(arg *CreateInstancePayloadAclGetItemsAttributeType, val CreateInstancePayloadAclGetItemsRetType) { + *arg = &val +} + // CreateInstancePayloadAcl ACL is the Access Control List defining the IP ranges allowed to connect to the database type CreateInstancePayloadAcl struct { // a simple list with IP addresses with CIDR. - Items *[]string `json:"items,omitempty"` + Items CreateInstancePayloadAclGetItemsAttributeType `json:"items,omitempty"` } // NewCreateInstancePayloadAcl instantiates a new CreateInstancePayloadAcl object @@ -41,41 +61,32 @@ func NewCreateInstancePayloadAclWithDefaults() *CreateInstancePayloadAcl { } // GetItems returns the Items field value if set, zero value otherwise. -func (o *CreateInstancePayloadAcl) GetItems() *[]string { - if o == nil || IsNil(o.Items) { - var ret *[]string - return ret - } - return o.Items +func (o *CreateInstancePayloadAcl) GetItems() (res CreateInstancePayloadAclGetItemsRetType) { + 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 *CreateInstancePayloadAcl) GetItemsOk() (*[]string, bool) { - if o == nil || IsNil(o.Items) { - return nil, false - } - return o.Items, true +func (o *CreateInstancePayloadAcl) GetItemsOk() (ret CreateInstancePayloadAclGetItemsRetType, ok bool) { + return getCreateInstancePayloadAclGetItemsAttributeTypeOk(o.Items) } // HasItems returns a boolean if a field has been set. func (o *CreateInstancePayloadAcl) 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 *CreateInstancePayloadAcl) SetItems(v *[]string) { - o.Items = v +func (o *CreateInstancePayloadAcl) SetItems(v CreateInstancePayloadAclGetItemsRetType) { + setCreateInstancePayloadAclGetItemsAttributeType(&o.Items, v) } func (o CreateInstancePayloadAcl) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Items) { - toSerialize["items"] = o.Items + if val, ok := getCreateInstancePayloadAclGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_create_instance_payload_options.go b/services/sqlserverflex/model_create_instance_payload_options.go index 135b23128..84552ba28 100644 --- a/services/sqlserverflex/model_create_instance_payload_options.go +++ b/services/sqlserverflex/model_create_instance_payload_options.go @@ -17,12 +17,54 @@ import ( // checks if the CreateInstancePayloadOptions type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateInstancePayloadOptions{} +/* + types and functions for edition +*/ + +// isNotNullableString +type CreateInstancePayloadOptionsGetEditionAttributeType = *string + +func getCreateInstancePayloadOptionsGetEditionAttributeTypeOk(arg CreateInstancePayloadOptionsGetEditionAttributeType) (ret CreateInstancePayloadOptionsGetEditionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateInstancePayloadOptionsGetEditionAttributeType(arg *CreateInstancePayloadOptionsGetEditionAttributeType, val CreateInstancePayloadOptionsGetEditionRetType) { + *arg = &val +} + +type CreateInstancePayloadOptionsGetEditionArgType = string +type CreateInstancePayloadOptionsGetEditionRetType = string + +/* + types and functions for retentionDays +*/ + +// isNotNullableString +type CreateInstancePayloadOptionsGetRetentionDaysAttributeType = *string + +func getCreateInstancePayloadOptionsGetRetentionDaysAttributeTypeOk(arg CreateInstancePayloadOptionsGetRetentionDaysAttributeType) (ret CreateInstancePayloadOptionsGetRetentionDaysRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateInstancePayloadOptionsGetRetentionDaysAttributeType(arg *CreateInstancePayloadOptionsGetRetentionDaysAttributeType, val CreateInstancePayloadOptionsGetRetentionDaysRetType) { + *arg = &val +} + +type CreateInstancePayloadOptionsGetRetentionDaysArgType = string +type CreateInstancePayloadOptionsGetRetentionDaysRetType = string + // CreateInstancePayloadOptions Database instance specific options are requested via this field type CreateInstancePayloadOptions struct { // Edition of the MSSQL server instance - Edition *string `json:"edition,omitempty"` + Edition CreateInstancePayloadOptionsGetEditionAttributeType `json:"edition,omitempty"` // The days for how long the backup files should be stored before cleaned up. 30 to 365 - RetentionDays *string `json:"retentionDays,omitempty"` + RetentionDays CreateInstancePayloadOptionsGetRetentionDaysAttributeType `json:"retentionDays,omitempty"` } // NewCreateInstancePayloadOptions instantiates a new CreateInstancePayloadOptions object @@ -31,10 +73,6 @@ type CreateInstancePayloadOptions struct { // will change when the set of required properties is changed func NewCreateInstancePayloadOptions() *CreateInstancePayloadOptions { this := CreateInstancePayloadOptions{} - var edition string = "developer" - this.Edition = &edition - var retentionDays string = "32" - this.RetentionDays = &retentionDays return &this } @@ -51,76 +89,58 @@ func NewCreateInstancePayloadOptionsWithDefaults() *CreateInstancePayloadOptions } // GetEdition returns the Edition field value if set, zero value otherwise. -func (o *CreateInstancePayloadOptions) GetEdition() *string { - if o == nil || IsNil(o.Edition) { - var ret *string - return ret - } - return o.Edition +func (o *CreateInstancePayloadOptions) GetEdition() (res CreateInstancePayloadOptionsGetEditionRetType) { + res, _ = o.GetEditionOk() + return } // GetEditionOk returns a tuple with the Edition field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateInstancePayloadOptions) GetEditionOk() (*string, bool) { - if o == nil || IsNil(o.Edition) { - return nil, false - } - return o.Edition, true +func (o *CreateInstancePayloadOptions) GetEditionOk() (ret CreateInstancePayloadOptionsGetEditionRetType, ok bool) { + return getCreateInstancePayloadOptionsGetEditionAttributeTypeOk(o.Edition) } // HasEdition returns a boolean if a field has been set. func (o *CreateInstancePayloadOptions) HasEdition() bool { - if o != nil && !IsNil(o.Edition) { - return true - } - - return false + _, ok := o.GetEditionOk() + return ok } // SetEdition gets a reference to the given string and assigns it to the Edition field. -func (o *CreateInstancePayloadOptions) SetEdition(v *string) { - o.Edition = v +func (o *CreateInstancePayloadOptions) SetEdition(v CreateInstancePayloadOptionsGetEditionRetType) { + setCreateInstancePayloadOptionsGetEditionAttributeType(&o.Edition, v) } // GetRetentionDays returns the RetentionDays field value if set, zero value otherwise. -func (o *CreateInstancePayloadOptions) GetRetentionDays() *string { - if o == nil || IsNil(o.RetentionDays) { - var ret *string - return ret - } - return o.RetentionDays +func (o *CreateInstancePayloadOptions) GetRetentionDays() (res CreateInstancePayloadOptionsGetRetentionDaysRetType) { + res, _ = o.GetRetentionDaysOk() + return } // GetRetentionDaysOk returns a tuple with the RetentionDays field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateInstancePayloadOptions) GetRetentionDaysOk() (*string, bool) { - if o == nil || IsNil(o.RetentionDays) { - return nil, false - } - return o.RetentionDays, true +func (o *CreateInstancePayloadOptions) GetRetentionDaysOk() (ret CreateInstancePayloadOptionsGetRetentionDaysRetType, ok bool) { + return getCreateInstancePayloadOptionsGetRetentionDaysAttributeTypeOk(o.RetentionDays) } // HasRetentionDays returns a boolean if a field has been set. func (o *CreateInstancePayloadOptions) HasRetentionDays() bool { - if o != nil && !IsNil(o.RetentionDays) { - return true - } - - return false + _, ok := o.GetRetentionDaysOk() + return ok } // SetRetentionDays gets a reference to the given string and assigns it to the RetentionDays field. -func (o *CreateInstancePayloadOptions) SetRetentionDays(v *string) { - o.RetentionDays = v +func (o *CreateInstancePayloadOptions) SetRetentionDays(v CreateInstancePayloadOptionsGetRetentionDaysRetType) { + setCreateInstancePayloadOptionsGetRetentionDaysAttributeType(&o.RetentionDays, v) } func (o CreateInstancePayloadOptions) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Edition) { - toSerialize["edition"] = o.Edition + if val, ok := getCreateInstancePayloadOptionsGetEditionAttributeTypeOk(o.Edition); ok { + toSerialize["Edition"] = val } - if !IsNil(o.RetentionDays) { - toSerialize["retentionDays"] = o.RetentionDays + if val, ok := getCreateInstancePayloadOptionsGetRetentionDaysAttributeTypeOk(o.RetentionDays); ok { + toSerialize["RetentionDays"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_create_instance_payload_storage.go b/services/sqlserverflex/model_create_instance_payload_storage.go index cfc679127..857c57031 100644 --- a/services/sqlserverflex/model_create_instance_payload_storage.go +++ b/services/sqlserverflex/model_create_instance_payload_storage.go @@ -17,12 +17,53 @@ import ( // checks if the CreateInstancePayloadStorage type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateInstancePayloadStorage{} +/* + types and functions for class +*/ + +// isNotNullableString +type CreateInstancePayloadStorageGetClassAttributeType = *string + +func getCreateInstancePayloadStorageGetClassAttributeTypeOk(arg CreateInstancePayloadStorageGetClassAttributeType) (ret CreateInstancePayloadStorageGetClassRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateInstancePayloadStorageGetClassAttributeType(arg *CreateInstancePayloadStorageGetClassAttributeType, val CreateInstancePayloadStorageGetClassRetType) { + *arg = &val +} + +type CreateInstancePayloadStorageGetClassArgType = string +type CreateInstancePayloadStorageGetClassRetType = string + +/* + types and functions for size +*/ + +// isLong +type CreateInstancePayloadStorageGetSizeAttributeType = *int64 +type CreateInstancePayloadStorageGetSizeArgType = int64 +type CreateInstancePayloadStorageGetSizeRetType = int64 + +func getCreateInstancePayloadStorageGetSizeAttributeTypeOk(arg CreateInstancePayloadStorageGetSizeAttributeType) (ret CreateInstancePayloadStorageGetSizeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateInstancePayloadStorageGetSizeAttributeType(arg *CreateInstancePayloadStorageGetSizeAttributeType, val CreateInstancePayloadStorageGetSizeRetType) { + *arg = &val +} + // CreateInstancePayloadStorage Storage for the instance type CreateInstancePayloadStorage struct { // Class of the instance. - Class *string `json:"class,omitempty"` + Class CreateInstancePayloadStorageGetClassAttributeType `json:"class,omitempty"` // Size of the instance storage in GB - Size *int64 `json:"size,omitempty"` + Size CreateInstancePayloadStorageGetSizeAttributeType `json:"size,omitempty"` } // NewCreateInstancePayloadStorage instantiates a new CreateInstancePayloadStorage object @@ -31,8 +72,6 @@ type CreateInstancePayloadStorage struct { // will change when the set of required properties is changed func NewCreateInstancePayloadStorage() *CreateInstancePayloadStorage { this := CreateInstancePayloadStorage{} - var class string = "premium-perf12-stackit" - this.Class = &class return &this } @@ -47,76 +86,58 @@ func NewCreateInstancePayloadStorageWithDefaults() *CreateInstancePayloadStorage } // GetClass returns the Class field value if set, zero value otherwise. -func (o *CreateInstancePayloadStorage) GetClass() *string { - if o == nil || IsNil(o.Class) { - var ret *string - return ret - } - return o.Class +func (o *CreateInstancePayloadStorage) GetClass() (res CreateInstancePayloadStorageGetClassRetType) { + 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 *CreateInstancePayloadStorage) GetClassOk() (*string, bool) { - if o == nil || IsNil(o.Class) { - return nil, false - } - return o.Class, true +func (o *CreateInstancePayloadStorage) GetClassOk() (ret CreateInstancePayloadStorageGetClassRetType, ok bool) { + return getCreateInstancePayloadStorageGetClassAttributeTypeOk(o.Class) } // HasClass returns a boolean if a field has been set. func (o *CreateInstancePayloadStorage) 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 *CreateInstancePayloadStorage) SetClass(v *string) { - o.Class = v +func (o *CreateInstancePayloadStorage) SetClass(v CreateInstancePayloadStorageGetClassRetType) { + setCreateInstancePayloadStorageGetClassAttributeType(&o.Class, v) } // GetSize returns the Size field value if set, zero value otherwise. -func (o *CreateInstancePayloadStorage) GetSize() *int64 { - if o == nil || IsNil(o.Size) { - var ret *int64 - return ret - } - return o.Size +func (o *CreateInstancePayloadStorage) GetSize() (res CreateInstancePayloadStorageGetSizeRetType) { + 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 *CreateInstancePayloadStorage) GetSizeOk() (*int64, bool) { - if o == nil || IsNil(o.Size) { - return nil, false - } - return o.Size, true +func (o *CreateInstancePayloadStorage) GetSizeOk() (ret CreateInstancePayloadStorageGetSizeRetType, ok bool) { + return getCreateInstancePayloadStorageGetSizeAttributeTypeOk(o.Size) } // HasSize returns a boolean if a field has been set. func (o *CreateInstancePayloadStorage) 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 *CreateInstancePayloadStorage) SetSize(v *int64) { - o.Size = v +func (o *CreateInstancePayloadStorage) SetSize(v CreateInstancePayloadStorageGetSizeRetType) { + setCreateInstancePayloadStorageGetSizeAttributeType(&o.Size, v) } func (o CreateInstancePayloadStorage) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Class) { - toSerialize["class"] = o.Class + if val, ok := getCreateInstancePayloadStorageGetClassAttributeTypeOk(o.Class); ok { + toSerialize["Class"] = val } - if !IsNil(o.Size) { - toSerialize["size"] = o.Size + if val, ok := getCreateInstancePayloadStorageGetSizeAttributeTypeOk(o.Size); ok { + toSerialize["Size"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_create_instance_response.go b/services/sqlserverflex/model_create_instance_response.go index 1a507d644..3c6b77391 100644 --- a/services/sqlserverflex/model_create_instance_response.go +++ b/services/sqlserverflex/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/sqlserverflex/model_create_user_payload.go b/services/sqlserverflex/model_create_user_payload.go index 0c0cbcc47..4afd52706 100644 --- a/services/sqlserverflex/model_create_user_payload.go +++ b/services/sqlserverflex/model_create_user_payload.go @@ -17,13 +17,75 @@ import ( // checks if the CreateUserPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateUserPayload{} +/* + types and functions for default_database +*/ + +// isNotNullableString +type CreateUserPayloadGetDefaultDatabaseAttributeType = *string + +func getCreateUserPayloadGetDefaultDatabaseAttributeTypeOk(arg CreateUserPayloadGetDefaultDatabaseAttributeType) (ret CreateUserPayloadGetDefaultDatabaseRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateUserPayloadGetDefaultDatabaseAttributeType(arg *CreateUserPayloadGetDefaultDatabaseAttributeType, val CreateUserPayloadGetDefaultDatabaseRetType) { + *arg = &val +} + +type CreateUserPayloadGetDefaultDatabaseArgType = string +type CreateUserPayloadGetDefaultDatabaseRetType = string + +/* + 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 { - DefaultDatabase *string `json:"default_database,omitempty"` + DefaultDatabase CreateUserPayloadGetDefaultDatabaseAttributeType `json:"default_database,omitempty"` // REQUIRED - Roles *[]string `json:"roles"` + Roles CreateUserPayloadGetRolesAttributeType `json:"roles"` // REQUIRED - Username *string `json:"username"` + Username CreateUserPayloadGetUsernameAttributeType `json:"username"` } type _CreateUserPayload CreateUserPayload @@ -32,10 +94,10 @@ type _CreateUserPayload CreateUserPayload // 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 NewCreateUserPayload(roles *[]string, username *string) *CreateUserPayload { +func NewCreateUserPayload(roles CreateUserPayloadGetRolesArgType, username CreateUserPayloadGetUsernameArgType) *CreateUserPayload { this := CreateUserPayload{} - this.Roles = roles - this.Username = username + setCreateUserPayloadGetRolesAttributeType(&this.Roles, roles) + setCreateUserPayloadGetUsernameAttributeType(&this.Username, username) return &this } @@ -48,92 +110,73 @@ func NewCreateUserPayloadWithDefaults() *CreateUserPayload { } // GetDefaultDatabase returns the DefaultDatabase field value if set, zero value otherwise. -func (o *CreateUserPayload) GetDefaultDatabase() *string { - if o == nil || IsNil(o.DefaultDatabase) { - var ret *string - return ret - } - return o.DefaultDatabase +func (o *CreateUserPayload) GetDefaultDatabase() (res CreateUserPayloadGetDefaultDatabaseRetType) { + res, _ = o.GetDefaultDatabaseOk() + return } // GetDefaultDatabaseOk returns a tuple with the DefaultDatabase field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateUserPayload) GetDefaultDatabaseOk() (*string, bool) { - if o == nil || IsNil(o.DefaultDatabase) { - return nil, false - } - return o.DefaultDatabase, true +func (o *CreateUserPayload) GetDefaultDatabaseOk() (ret CreateUserPayloadGetDefaultDatabaseRetType, ok bool) { + return getCreateUserPayloadGetDefaultDatabaseAttributeTypeOk(o.DefaultDatabase) } // HasDefaultDatabase returns a boolean if a field has been set. func (o *CreateUserPayload) HasDefaultDatabase() bool { - if o != nil && !IsNil(o.DefaultDatabase) { - return true - } - - return false + _, ok := o.GetDefaultDatabaseOk() + return ok } // SetDefaultDatabase gets a reference to the given string and assigns it to the DefaultDatabase field. -func (o *CreateUserPayload) SetDefaultDatabase(v *string) { - o.DefaultDatabase = v +func (o *CreateUserPayload) SetDefaultDatabase(v CreateUserPayloadGetDefaultDatabaseRetType) { + setCreateUserPayloadGetDefaultDatabaseAttributeType(&o.DefaultDatabase, v) } // GetRoles returns the Roles field value -func (o *CreateUserPayload) GetRoles() *[]string { - if o == nil || IsNil(o.Roles) { - var ret *[]string - return ret - } - - return o.Roles +func (o *CreateUserPayload) GetRoles() (ret CreateUserPayloadGetRolesRetType) { + ret, _ = o.GetRolesOk() + return ret } // GetRolesOk returns a tuple with the Roles field value // and a boolean to check if the value has been set. -func (o *CreateUserPayload) GetRolesOk() (*[]string, bool) { - if o == nil { - return nil, false - } - return o.Roles, true +func (o *CreateUserPayload) GetRolesOk() (ret CreateUserPayloadGetRolesRetType, ok bool) { + return getCreateUserPayloadGetRolesAttributeTypeOk(o.Roles) } // SetRoles sets field value -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 -func (o *CreateUserPayload) GetUsername() *string { - if o == nil || IsNil(o.Username) { - var ret *string - return ret - } - - return o.Username +func (o *CreateUserPayload) GetUsername() (ret CreateUserPayloadGetUsernameRetType) { + ret, _ = o.GetUsernameOk() + return ret } // GetUsernameOk returns a tuple with the Username field value // and a boolean to check if the value has been set. -func (o *CreateUserPayload) GetUsernameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Username, true +func (o *CreateUserPayload) GetUsernameOk() (ret CreateUserPayloadGetUsernameRetType, ok bool) { + return getCreateUserPayloadGetUsernameAttributeTypeOk(o.Username) } // SetUsername sets field value -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.DefaultDatabase) { - toSerialize["default_database"] = o.DefaultDatabase + if val, ok := getCreateUserPayloadGetDefaultDatabaseAttributeTypeOk(o.DefaultDatabase); ok { + toSerialize["DefaultDatabase"] = val + } + if val, ok := getCreateUserPayloadGetRolesAttributeTypeOk(o.Roles); ok { + toSerialize["Roles"] = val + } + if val, ok := getCreateUserPayloadGetUsernameAttributeTypeOk(o.Username); ok { + toSerialize["Username"] = val } - toSerialize["roles"] = o.Roles - toSerialize["username"] = o.Username return toSerialize, nil } diff --git a/services/sqlserverflex/model_create_user_response.go b/services/sqlserverflex/model_create_user_response.go index ba0372728..d5f21ae61 100644 --- a/services/sqlserverflex/model_create_user_response.go +++ b/services/sqlserverflex/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 = *SingleUser +type CreateUserResponseGetItemArgType = SingleUser +type CreateUserResponseGetItemRetType = SingleUser + +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 *SingleUser `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() *SingleUser { - if o == nil || IsNil(o.Item) { - var ret *SingleUser - 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() (*SingleUser, 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 SingleUser and assigns it to the Item field. -func (o *CreateUserResponse) SetItem(v *SingleUser) { - 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/sqlserverflex/model_database.go b/services/sqlserverflex/model_database.go index 06df808f2..1ade6bddf 100644 --- a/services/sqlserverflex/model_database.go +++ b/services/sqlserverflex/model_database.go @@ -17,12 +17,74 @@ import ( // checks if the Database type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Database{} +/* + types and functions for id +*/ + +// isNotNullableString +type DatabaseGetIdAttributeType = *string + +func getDatabaseGetIdAttributeTypeOk(arg DatabaseGetIdAttributeType) (ret DatabaseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDatabaseGetIdAttributeType(arg *DatabaseGetIdAttributeType, val DatabaseGetIdRetType) { + *arg = &val +} + +type DatabaseGetIdArgType = string +type DatabaseGetIdRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +type DatabaseGetNameAttributeType = *string + +func getDatabaseGetNameAttributeTypeOk(arg DatabaseGetNameAttributeType) (ret DatabaseGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDatabaseGetNameAttributeType(arg *DatabaseGetNameAttributeType, val DatabaseGetNameRetType) { + *arg = &val +} + +type DatabaseGetNameArgType = string +type DatabaseGetNameRetType = string + +/* + types and functions for options +*/ + +// isFreeform +type DatabaseGetOptionsAttributeType = *map[string]interface{} +type DatabaseGetOptionsArgType = map[string]interface{} +type DatabaseGetOptionsRetType = map[string]interface{} + +func getDatabaseGetOptionsAttributeTypeOk(arg DatabaseGetOptionsAttributeType) (ret DatabaseGetOptionsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDatabaseGetOptionsAttributeType(arg *DatabaseGetOptionsAttributeType, val DatabaseGetOptionsRetType) { + *arg = &val +} + // Database struct for Database type Database struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` + Id DatabaseGetIdAttributeType `json:"id,omitempty"` + Name DatabaseGetNameAttributeType `json:"name,omitempty"` // Database specific options - Options *map[string]interface{} `json:"options,omitempty"` + Options DatabaseGetOptionsAttributeType `json:"options,omitempty"` } // NewDatabase instantiates a new Database object @@ -43,111 +105,84 @@ func NewDatabaseWithDefaults() *Database { } // GetId returns the Id field value if set, zero value otherwise. -func (o *Database) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *Database) GetId() (res DatabaseGetIdRetType) { + 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 *Database) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *Database) GetIdOk() (ret DatabaseGetIdRetType, ok bool) { + return getDatabaseGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *Database) 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 *Database) SetId(v *string) { - o.Id = v +func (o *Database) SetId(v DatabaseGetIdRetType) { + setDatabaseGetIdAttributeType(&o.Id, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *Database) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *Database) GetName() (res DatabaseGetNameRetType) { + 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 *Database) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *Database) GetNameOk() (ret DatabaseGetNameRetType, ok bool) { + return getDatabaseGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *Database) 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 *Database) SetName(v *string) { - o.Name = v +func (o *Database) SetName(v DatabaseGetNameRetType) { + setDatabaseGetNameAttributeType(&o.Name, v) } // GetOptions returns the Options field value if set, zero value otherwise. -func (o *Database) GetOptions() *map[string]interface{} { - if o == nil || IsNil(o.Options) { - var ret *map[string]interface{} - return ret - } - return o.Options +func (o *Database) GetOptions() (res DatabaseGetOptionsRetType) { + 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 *Database) GetOptionsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Options) { - return &map[string]interface{}{}, false - } - return o.Options, true +func (o *Database) GetOptionsOk() (ret DatabaseGetOptionsRetType, ok bool) { + return getDatabaseGetOptionsAttributeTypeOk(o.Options) } // HasOptions returns a boolean if a field has been set. func (o *Database) 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 *Database) SetOptions(v *map[string]interface{}) { - o.Options = v +func (o *Database) SetOptions(v DatabaseGetOptionsRetType) { + setDatabaseGetOptionsAttributeType(&o.Options, v) } func (o Database) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getDatabaseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getDatabaseGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Options) { - toSerialize["options"] = o.Options + if val, ok := getDatabaseGetOptionsAttributeTypeOk(o.Options); ok { + toSerialize["Options"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_database_documentation_create_database_request_options.go b/services/sqlserverflex/model_database_documentation_create_database_request_options.go index b111f4320..c08670449 100644 --- a/services/sqlserverflex/model_database_documentation_create_database_request_options.go +++ b/services/sqlserverflex/model_database_documentation_create_database_request_options.go @@ -17,15 +17,78 @@ import ( // checks if the DatabaseDocumentationCreateDatabaseRequestOptions type satisfies the MappedNullable interface at compile time var _ MappedNullable = &DatabaseDocumentationCreateDatabaseRequestOptions{} +/* + types and functions for collation +*/ + +// isNotNullableString +type DatabaseDocumentationCreateDatabaseRequestOptionsGetCollationAttributeType = *string + +func getDatabaseDocumentationCreateDatabaseRequestOptionsGetCollationAttributeTypeOk(arg DatabaseDocumentationCreateDatabaseRequestOptionsGetCollationAttributeType) (ret DatabaseDocumentationCreateDatabaseRequestOptionsGetCollationRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDatabaseDocumentationCreateDatabaseRequestOptionsGetCollationAttributeType(arg *DatabaseDocumentationCreateDatabaseRequestOptionsGetCollationAttributeType, val DatabaseDocumentationCreateDatabaseRequestOptionsGetCollationRetType) { + *arg = &val +} + +type DatabaseDocumentationCreateDatabaseRequestOptionsGetCollationArgType = string +type DatabaseDocumentationCreateDatabaseRequestOptionsGetCollationRetType = string + +/* + types and functions for compatibilityLevel +*/ + +// isNotNullableString +type DatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelAttributeType = *string + +func getDatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelAttributeTypeOk(arg DatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelAttributeType) (ret DatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelAttributeType(arg *DatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelAttributeType, val DatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelRetType) { + *arg = &val +} + +type DatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelArgType = string +type DatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelRetType = string + +/* + types and functions for owner +*/ + +// isNotNullableString +type DatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerAttributeType = *string + +func getDatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerAttributeTypeOk(arg DatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerAttributeType) (ret DatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerAttributeType(arg *DatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerAttributeType, val DatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerRetType) { + *arg = &val +} + +type DatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerArgType = string +type DatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerRetType = string + // DatabaseDocumentationCreateDatabaseRequestOptions struct for DatabaseDocumentationCreateDatabaseRequestOptions type DatabaseDocumentationCreateDatabaseRequestOptions struct { // Collation of the database - Collation *string `json:"collation,omitempty"` + Collation DatabaseDocumentationCreateDatabaseRequestOptionsGetCollationAttributeType `json:"collation,omitempty"` // CompatibilityLevel of the Database. - CompatibilityLevel *string `json:"compatibilityLevel,omitempty"` + CompatibilityLevel DatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelAttributeType `json:"compatibilityLevel,omitempty"` // Name of the owner of the database. // REQUIRED - Owner *string `json:"owner"` + Owner DatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerAttributeType `json:"owner"` } type _DatabaseDocumentationCreateDatabaseRequestOptions DatabaseDocumentationCreateDatabaseRequestOptions @@ -34,9 +97,9 @@ type _DatabaseDocumentationCreateDatabaseRequestOptions DatabaseDocumentationCre // 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 NewDatabaseDocumentationCreateDatabaseRequestOptions(owner *string) *DatabaseDocumentationCreateDatabaseRequestOptions { +func NewDatabaseDocumentationCreateDatabaseRequestOptions(owner DatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerArgType) *DatabaseDocumentationCreateDatabaseRequestOptions { this := DatabaseDocumentationCreateDatabaseRequestOptions{} - this.Owner = owner + setDatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerAttributeType(&this.Owner, owner) return &this } @@ -49,102 +112,79 @@ func NewDatabaseDocumentationCreateDatabaseRequestOptionsWithDefaults() *Databas } // GetCollation returns the Collation field value if set, zero value otherwise. -func (o *DatabaseDocumentationCreateDatabaseRequestOptions) GetCollation() *string { - if o == nil || IsNil(o.Collation) { - var ret *string - return ret - } - return o.Collation +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) GetCollation() (res DatabaseDocumentationCreateDatabaseRequestOptionsGetCollationRetType) { + res, _ = o.GetCollationOk() + return } // GetCollationOk returns a tuple with the Collation field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DatabaseDocumentationCreateDatabaseRequestOptions) GetCollationOk() (*string, bool) { - if o == nil || IsNil(o.Collation) { - return nil, false - } - return o.Collation, true +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) GetCollationOk() (ret DatabaseDocumentationCreateDatabaseRequestOptionsGetCollationRetType, ok bool) { + return getDatabaseDocumentationCreateDatabaseRequestOptionsGetCollationAttributeTypeOk(o.Collation) } // HasCollation returns a boolean if a field has been set. func (o *DatabaseDocumentationCreateDatabaseRequestOptions) HasCollation() bool { - if o != nil && !IsNil(o.Collation) { - return true - } - - return false + _, ok := o.GetCollationOk() + return ok } // SetCollation gets a reference to the given string and assigns it to the Collation field. -func (o *DatabaseDocumentationCreateDatabaseRequestOptions) SetCollation(v *string) { - o.Collation = v +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) SetCollation(v DatabaseDocumentationCreateDatabaseRequestOptionsGetCollationRetType) { + setDatabaseDocumentationCreateDatabaseRequestOptionsGetCollationAttributeType(&o.Collation, v) } // GetCompatibilityLevel returns the CompatibilityLevel field value if set, zero value otherwise. -func (o *DatabaseDocumentationCreateDatabaseRequestOptions) GetCompatibilityLevel() *string { - if o == nil || IsNil(o.CompatibilityLevel) { - var ret *string - return ret - } - return o.CompatibilityLevel +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) GetCompatibilityLevel() (res DatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelRetType) { + res, _ = o.GetCompatibilityLevelOk() + return } // GetCompatibilityLevelOk returns a tuple with the CompatibilityLevel field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DatabaseDocumentationCreateDatabaseRequestOptions) GetCompatibilityLevelOk() (*string, bool) { - if o == nil || IsNil(o.CompatibilityLevel) { - return nil, false - } - return o.CompatibilityLevel, true +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) GetCompatibilityLevelOk() (ret DatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelRetType, ok bool) { + return getDatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelAttributeTypeOk(o.CompatibilityLevel) } // HasCompatibilityLevel returns a boolean if a field has been set. func (o *DatabaseDocumentationCreateDatabaseRequestOptions) HasCompatibilityLevel() bool { - if o != nil && !IsNil(o.CompatibilityLevel) { - return true - } - - return false + _, ok := o.GetCompatibilityLevelOk() + return ok } // SetCompatibilityLevel gets a reference to the given string and assigns it to the CompatibilityLevel field. -func (o *DatabaseDocumentationCreateDatabaseRequestOptions) SetCompatibilityLevel(v *string) { - o.CompatibilityLevel = v +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) SetCompatibilityLevel(v DatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelRetType) { + setDatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelAttributeType(&o.CompatibilityLevel, v) } // GetOwner returns the Owner field value -func (o *DatabaseDocumentationCreateDatabaseRequestOptions) GetOwner() *string { - if o == nil || IsNil(o.Owner) { - var ret *string - return ret - } - - return o.Owner +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) GetOwner() (ret DatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerRetType) { + ret, _ = o.GetOwnerOk() + return ret } // GetOwnerOk returns a tuple with the Owner field value // and a boolean to check if the value has been set. -func (o *DatabaseDocumentationCreateDatabaseRequestOptions) GetOwnerOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Owner, true +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) GetOwnerOk() (ret DatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerRetType, ok bool) { + return getDatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerAttributeTypeOk(o.Owner) } // SetOwner sets field value -func (o *DatabaseDocumentationCreateDatabaseRequestOptions) SetOwner(v *string) { - o.Owner = v +func (o *DatabaseDocumentationCreateDatabaseRequestOptions) SetOwner(v DatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerRetType) { + setDatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerAttributeType(&o.Owner, v) } func (o DatabaseDocumentationCreateDatabaseRequestOptions) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Collation) { - toSerialize["collation"] = o.Collation + if val, ok := getDatabaseDocumentationCreateDatabaseRequestOptionsGetCollationAttributeTypeOk(o.Collation); ok { + toSerialize["Collation"] = val + } + if val, ok := getDatabaseDocumentationCreateDatabaseRequestOptionsGetCompatibilityLevelAttributeTypeOk(o.CompatibilityLevel); ok { + toSerialize["CompatibilityLevel"] = val } - if !IsNil(o.CompatibilityLevel) { - toSerialize["compatibilityLevel"] = o.CompatibilityLevel + if val, ok := getDatabaseDocumentationCreateDatabaseRequestOptionsGetOwnerAttributeTypeOk(o.Owner); ok { + toSerialize["Owner"] = val } - toSerialize["owner"] = o.Owner return toSerialize, nil } diff --git a/services/sqlserverflex/model_database_options.go b/services/sqlserverflex/model_database_options.go index a7099aef5..cdaabe608 100644 --- a/services/sqlserverflex/model_database_options.go +++ b/services/sqlserverflex/model_database_options.go @@ -17,14 +17,76 @@ import ( // checks if the DatabaseOptions type satisfies the MappedNullable interface at compile time var _ MappedNullable = &DatabaseOptions{} +/* + types and functions for collationName +*/ + +// isNotNullableString +type DatabaseOptionsGetCollationNameAttributeType = *string + +func getDatabaseOptionsGetCollationNameAttributeTypeOk(arg DatabaseOptionsGetCollationNameAttributeType) (ret DatabaseOptionsGetCollationNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDatabaseOptionsGetCollationNameAttributeType(arg *DatabaseOptionsGetCollationNameAttributeType, val DatabaseOptionsGetCollationNameRetType) { + *arg = &val +} + +type DatabaseOptionsGetCollationNameArgType = string +type DatabaseOptionsGetCollationNameRetType = string + +/* + types and functions for compatibilityLevel +*/ + +// isLong +type DatabaseOptionsGetCompatibilityLevelAttributeType = *int64 +type DatabaseOptionsGetCompatibilityLevelArgType = int64 +type DatabaseOptionsGetCompatibilityLevelRetType = int64 + +func getDatabaseOptionsGetCompatibilityLevelAttributeTypeOk(arg DatabaseOptionsGetCompatibilityLevelAttributeType) (ret DatabaseOptionsGetCompatibilityLevelRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDatabaseOptionsGetCompatibilityLevelAttributeType(arg *DatabaseOptionsGetCompatibilityLevelAttributeType, val DatabaseOptionsGetCompatibilityLevelRetType) { + *arg = &val +} + +/* + types and functions for owner +*/ + +// isNotNullableString +type DatabaseOptionsGetOwnerAttributeType = *string + +func getDatabaseOptionsGetOwnerAttributeTypeOk(arg DatabaseOptionsGetOwnerAttributeType) (ret DatabaseOptionsGetOwnerRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDatabaseOptionsGetOwnerAttributeType(arg *DatabaseOptionsGetOwnerAttributeType, val DatabaseOptionsGetOwnerRetType) { + *arg = &val +} + +type DatabaseOptionsGetOwnerArgType = string +type DatabaseOptionsGetOwnerRetType = string + // DatabaseOptions struct for DatabaseOptions type DatabaseOptions struct { // Name of the collation of the database - CollationName *string `json:"collationName,omitempty"` + CollationName DatabaseOptionsGetCollationNameAttributeType `json:"collationName,omitempty"` // CompatibilityLevel of the Database. - CompatibilityLevel *int64 `json:"compatibilityLevel,omitempty"` + CompatibilityLevel DatabaseOptionsGetCompatibilityLevelAttributeType `json:"compatibilityLevel,omitempty"` // Name of the owner of the database. - Owner *string `json:"owner,omitempty"` + Owner DatabaseOptionsGetOwnerAttributeType `json:"owner,omitempty"` } // NewDatabaseOptions instantiates a new DatabaseOptions object @@ -45,111 +107,84 @@ func NewDatabaseOptionsWithDefaults() *DatabaseOptions { } // GetCollationName returns the CollationName field value if set, zero value otherwise. -func (o *DatabaseOptions) GetCollationName() *string { - if o == nil || IsNil(o.CollationName) { - var ret *string - return ret - } - return o.CollationName +func (o *DatabaseOptions) GetCollationName() (res DatabaseOptionsGetCollationNameRetType) { + res, _ = o.GetCollationNameOk() + return } // GetCollationNameOk returns a tuple with the CollationName field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DatabaseOptions) GetCollationNameOk() (*string, bool) { - if o == nil || IsNil(o.CollationName) { - return nil, false - } - return o.CollationName, true +func (o *DatabaseOptions) GetCollationNameOk() (ret DatabaseOptionsGetCollationNameRetType, ok bool) { + return getDatabaseOptionsGetCollationNameAttributeTypeOk(o.CollationName) } // HasCollationName returns a boolean if a field has been set. func (o *DatabaseOptions) HasCollationName() bool { - if o != nil && !IsNil(o.CollationName) { - return true - } - - return false + _, ok := o.GetCollationNameOk() + return ok } // SetCollationName gets a reference to the given string and assigns it to the CollationName field. -func (o *DatabaseOptions) SetCollationName(v *string) { - o.CollationName = v +func (o *DatabaseOptions) SetCollationName(v DatabaseOptionsGetCollationNameRetType) { + setDatabaseOptionsGetCollationNameAttributeType(&o.CollationName, v) } // GetCompatibilityLevel returns the CompatibilityLevel field value if set, zero value otherwise. -func (o *DatabaseOptions) GetCompatibilityLevel() *int64 { - if o == nil || IsNil(o.CompatibilityLevel) { - var ret *int64 - return ret - } - return o.CompatibilityLevel +func (o *DatabaseOptions) GetCompatibilityLevel() (res DatabaseOptionsGetCompatibilityLevelRetType) { + res, _ = o.GetCompatibilityLevelOk() + return } // GetCompatibilityLevelOk returns a tuple with the CompatibilityLevel field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DatabaseOptions) GetCompatibilityLevelOk() (*int64, bool) { - if o == nil || IsNil(o.CompatibilityLevel) { - return nil, false - } - return o.CompatibilityLevel, true +func (o *DatabaseOptions) GetCompatibilityLevelOk() (ret DatabaseOptionsGetCompatibilityLevelRetType, ok bool) { + return getDatabaseOptionsGetCompatibilityLevelAttributeTypeOk(o.CompatibilityLevel) } // HasCompatibilityLevel returns a boolean if a field has been set. func (o *DatabaseOptions) HasCompatibilityLevel() bool { - if o != nil && !IsNil(o.CompatibilityLevel) { - return true - } - - return false + _, ok := o.GetCompatibilityLevelOk() + return ok } // SetCompatibilityLevel gets a reference to the given int64 and assigns it to the CompatibilityLevel field. -func (o *DatabaseOptions) SetCompatibilityLevel(v *int64) { - o.CompatibilityLevel = v +func (o *DatabaseOptions) SetCompatibilityLevel(v DatabaseOptionsGetCompatibilityLevelRetType) { + setDatabaseOptionsGetCompatibilityLevelAttributeType(&o.CompatibilityLevel, v) } // GetOwner returns the Owner field value if set, zero value otherwise. -func (o *DatabaseOptions) GetOwner() *string { - if o == nil || IsNil(o.Owner) { - var ret *string - return ret - } - return o.Owner +func (o *DatabaseOptions) GetOwner() (res DatabaseOptionsGetOwnerRetType) { + res, _ = o.GetOwnerOk() + return } // GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DatabaseOptions) GetOwnerOk() (*string, bool) { - if o == nil || IsNil(o.Owner) { - return nil, false - } - return o.Owner, true +func (o *DatabaseOptions) GetOwnerOk() (ret DatabaseOptionsGetOwnerRetType, ok bool) { + return getDatabaseOptionsGetOwnerAttributeTypeOk(o.Owner) } // HasOwner returns a boolean if a field has been set. func (o *DatabaseOptions) HasOwner() bool { - if o != nil && !IsNil(o.Owner) { - return true - } - - return false + _, ok := o.GetOwnerOk() + return ok } // SetOwner gets a reference to the given string and assigns it to the Owner field. -func (o *DatabaseOptions) SetOwner(v *string) { - o.Owner = v +func (o *DatabaseOptions) SetOwner(v DatabaseOptionsGetOwnerRetType) { + setDatabaseOptionsGetOwnerAttributeType(&o.Owner, v) } func (o DatabaseOptions) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.CollationName) { - toSerialize["collationName"] = o.CollationName + if val, ok := getDatabaseOptionsGetCollationNameAttributeTypeOk(o.CollationName); ok { + toSerialize["CollationName"] = val } - if !IsNil(o.CompatibilityLevel) { - toSerialize["compatibilityLevel"] = o.CompatibilityLevel + if val, ok := getDatabaseOptionsGetCompatibilityLevelAttributeTypeOk(o.CompatibilityLevel); ok { + toSerialize["CompatibilityLevel"] = val } - if !IsNil(o.Owner) { - toSerialize["owner"] = o.Owner + if val, ok := getDatabaseOptionsGetOwnerAttributeTypeOk(o.Owner); ok { + toSerialize["Owner"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_flavor.go b/services/sqlserverflex/model_flavor.go index 05d4deb4c..a568df4d6 100644 --- a/services/sqlserverflex/model_flavor.go +++ b/services/sqlserverflex/model_flavor.go @@ -17,14 +17,96 @@ import ( // checks if the Flavor type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Flavor{} +/* + types and functions for cpu +*/ + +// isInteger +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 +*/ + +// isInteger +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 { // Can be cast to int32 without loss of precision. - Cpu *int64 `json:"cpu,omitempty"` - Description *string `json:"description,omitempty"` - Id *string `json:"id,omitempty"` + Cpu FlavorGetCpuAttributeType `json:"cpu,omitempty"` + Description FlavorGetDescriptionAttributeType `json:"description,omitempty"` + Id FlavorGetIdAttributeType `json:"id,omitempty"` // Can be cast to int32 without loss of precision. - Memory *int64 `json:"memory,omitempty"` + Memory FlavorGetMemoryAttributeType `json:"memory,omitempty"` } // NewFlavor instantiates a new Flavor object @@ -45,146 +127,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/sqlserverflex/model_get_backup_response.go b/services/sqlserverflex/model_get_backup_response.go index 64ea7d2f2..86ae27193 100644 --- a/services/sqlserverflex/model_get_backup_response.go +++ b/services/sqlserverflex/model_get_backup_response.go @@ -17,24 +17,189 @@ import ( // checks if the GetBackupResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &GetBackupResponse{} +/* + types and functions for endTime +*/ + +// isNotNullableString +type GetBackupResponseGetEndTimeAttributeType = *string + +func getGetBackupResponseGetEndTimeAttributeTypeOk(arg GetBackupResponseGetEndTimeAttributeType) (ret GetBackupResponseGetEndTimeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetBackupResponseGetEndTimeAttributeType(arg *GetBackupResponseGetEndTimeAttributeType, val GetBackupResponseGetEndTimeRetType) { + *arg = &val +} + +type GetBackupResponseGetEndTimeArgType = string +type GetBackupResponseGetEndTimeRetType = string + +/* + types and functions for error +*/ + +// isNotNullableString +type GetBackupResponseGetErrorAttributeType = *string + +func getGetBackupResponseGetErrorAttributeTypeOk(arg GetBackupResponseGetErrorAttributeType) (ret GetBackupResponseGetErrorRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetBackupResponseGetErrorAttributeType(arg *GetBackupResponseGetErrorAttributeType, val GetBackupResponseGetErrorRetType) { + *arg = &val +} + +type GetBackupResponseGetErrorArgType = string +type GetBackupResponseGetErrorRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type GetBackupResponseGetIdAttributeType = *string + +func getGetBackupResponseGetIdAttributeTypeOk(arg GetBackupResponseGetIdAttributeType) (ret GetBackupResponseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetBackupResponseGetIdAttributeType(arg *GetBackupResponseGetIdAttributeType, val GetBackupResponseGetIdRetType) { + *arg = &val +} + +type GetBackupResponseGetIdArgType = string +type GetBackupResponseGetIdRetType = string + +/* + types and functions for labels +*/ + +// isArray +type GetBackupResponseGetLabelsAttributeType = *[]string +type GetBackupResponseGetLabelsArgType = []string +type GetBackupResponseGetLabelsRetType = []string + +func getGetBackupResponseGetLabelsAttributeTypeOk(arg GetBackupResponseGetLabelsAttributeType) (ret GetBackupResponseGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetBackupResponseGetLabelsAttributeType(arg *GetBackupResponseGetLabelsAttributeType, val GetBackupResponseGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type GetBackupResponseGetNameAttributeType = *string + +func getGetBackupResponseGetNameAttributeTypeOk(arg GetBackupResponseGetNameAttributeType) (ret GetBackupResponseGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetBackupResponseGetNameAttributeType(arg *GetBackupResponseGetNameAttributeType, val GetBackupResponseGetNameRetType) { + *arg = &val +} + +type GetBackupResponseGetNameArgType = string +type GetBackupResponseGetNameRetType = string + +/* + types and functions for options +*/ + +// isContainer +type GetBackupResponseGetOptionsAttributeType = *map[string]string +type GetBackupResponseGetOptionsArgType = map[string]string +type GetBackupResponseGetOptionsRetType = map[string]string + +func getGetBackupResponseGetOptionsAttributeTypeOk(arg GetBackupResponseGetOptionsAttributeType) (ret GetBackupResponseGetOptionsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetBackupResponseGetOptionsAttributeType(arg *GetBackupResponseGetOptionsAttributeType, val GetBackupResponseGetOptionsRetType) { + *arg = &val +} + +/* + types and functions for size +*/ + +// isLong +type GetBackupResponseGetSizeAttributeType = *int64 +type GetBackupResponseGetSizeArgType = int64 +type GetBackupResponseGetSizeRetType = int64 + +func getGetBackupResponseGetSizeAttributeTypeOk(arg GetBackupResponseGetSizeAttributeType) (ret GetBackupResponseGetSizeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetBackupResponseGetSizeAttributeType(arg *GetBackupResponseGetSizeAttributeType, val GetBackupResponseGetSizeRetType) { + *arg = &val +} + +/* + types and functions for startTime +*/ + +// isNotNullableString +type GetBackupResponseGetStartTimeAttributeType = *string + +func getGetBackupResponseGetStartTimeAttributeTypeOk(arg GetBackupResponseGetStartTimeAttributeType) (ret GetBackupResponseGetStartTimeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetBackupResponseGetStartTimeAttributeType(arg *GetBackupResponseGetStartTimeAttributeType, val GetBackupResponseGetStartTimeRetType) { + *arg = &val +} + +type GetBackupResponseGetStartTimeArgType = string +type GetBackupResponseGetStartTimeRetType = string + // GetBackupResponse struct for GetBackupResponse type GetBackupResponse struct { // Backup end time represents local server time - EndTime *string `json:"endTime,omitempty"` + EndTime GetBackupResponseGetEndTimeAttributeType `json:"endTime,omitempty"` // Backup error - Error *string `json:"error,omitempty"` + Error GetBackupResponseGetErrorAttributeType `json:"error,omitempty"` // Backup id - Id *string `json:"id,omitempty"` + Id GetBackupResponseGetIdAttributeType `json:"id,omitempty"` // Backup labels - Labels *[]string `json:"labels,omitempty"` + Labels GetBackupResponseGetLabelsAttributeType `json:"labels,omitempty"` // Backup name - Name *string `json:"name,omitempty"` + Name GetBackupResponseGetNameAttributeType `json:"name,omitempty"` // Backup specific options - Options *map[string]string `json:"options,omitempty"` + Options GetBackupResponseGetOptionsAttributeType `json:"options,omitempty"` // Backup size in byte - Size *int64 `json:"size,omitempty"` + Size GetBackupResponseGetSizeAttributeType `json:"size,omitempty"` // Backup start time represents local server time - StartTime *string `json:"startTime,omitempty"` + StartTime GetBackupResponseGetStartTimeAttributeType `json:"startTime,omitempty"` } // NewGetBackupResponse instantiates a new GetBackupResponse object @@ -55,286 +220,214 @@ func NewGetBackupResponseWithDefaults() *GetBackupResponse { } // GetEndTime returns the EndTime field value if set, zero value otherwise. -func (o *GetBackupResponse) GetEndTime() *string { - if o == nil || IsNil(o.EndTime) { - var ret *string - return ret - } - return o.EndTime +func (o *GetBackupResponse) GetEndTime() (res GetBackupResponseGetEndTimeRetType) { + 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 *GetBackupResponse) GetEndTimeOk() (*string, bool) { - if o == nil || IsNil(o.EndTime) { - return nil, false - } - return o.EndTime, true +func (o *GetBackupResponse) GetEndTimeOk() (ret GetBackupResponseGetEndTimeRetType, ok bool) { + return getGetBackupResponseGetEndTimeAttributeTypeOk(o.EndTime) } // HasEndTime returns a boolean if a field has been set. func (o *GetBackupResponse) 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 *GetBackupResponse) SetEndTime(v *string) { - o.EndTime = v +func (o *GetBackupResponse) SetEndTime(v GetBackupResponseGetEndTimeRetType) { + setGetBackupResponseGetEndTimeAttributeType(&o.EndTime, v) } // GetError returns the Error field value if set, zero value otherwise. -func (o *GetBackupResponse) GetError() *string { - if o == nil || IsNil(o.Error) { - var ret *string - return ret - } - return o.Error +func (o *GetBackupResponse) GetError() (res GetBackupResponseGetErrorRetType) { + 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 *GetBackupResponse) GetErrorOk() (*string, bool) { - if o == nil || IsNil(o.Error) { - return nil, false - } - return o.Error, true +func (o *GetBackupResponse) GetErrorOk() (ret GetBackupResponseGetErrorRetType, ok bool) { + return getGetBackupResponseGetErrorAttributeTypeOk(o.Error) } // HasError returns a boolean if a field has been set. func (o *GetBackupResponse) 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 *GetBackupResponse) SetError(v *string) { - o.Error = v +func (o *GetBackupResponse) SetError(v GetBackupResponseGetErrorRetType) { + setGetBackupResponseGetErrorAttributeType(&o.Error, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *GetBackupResponse) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *GetBackupResponse) GetId() (res GetBackupResponseGetIdRetType) { + 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 *GetBackupResponse) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *GetBackupResponse) GetIdOk() (ret GetBackupResponseGetIdRetType, ok bool) { + return getGetBackupResponseGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *GetBackupResponse) 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 *GetBackupResponse) SetId(v *string) { - o.Id = v +func (o *GetBackupResponse) SetId(v GetBackupResponseGetIdRetType) { + setGetBackupResponseGetIdAttributeType(&o.Id, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *GetBackupResponse) GetLabels() *[]string { - if o == nil || IsNil(o.Labels) { - var ret *[]string - return ret - } - return o.Labels +func (o *GetBackupResponse) GetLabels() (res GetBackupResponseGetLabelsRetType) { + 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 *GetBackupResponse) GetLabelsOk() (*[]string, bool) { - if o == nil || IsNil(o.Labels) { - return nil, false - } - return o.Labels, true +func (o *GetBackupResponse) GetLabelsOk() (ret GetBackupResponseGetLabelsRetType, ok bool) { + return getGetBackupResponseGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *GetBackupResponse) 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 *GetBackupResponse) SetLabels(v *[]string) { - o.Labels = v +func (o *GetBackupResponse) SetLabels(v GetBackupResponseGetLabelsRetType) { + setGetBackupResponseGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *GetBackupResponse) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *GetBackupResponse) GetName() (res GetBackupResponseGetNameRetType) { + 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 *GetBackupResponse) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *GetBackupResponse) GetNameOk() (ret GetBackupResponseGetNameRetType, ok bool) { + return getGetBackupResponseGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *GetBackupResponse) 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 *GetBackupResponse) SetName(v *string) { - o.Name = v +func (o *GetBackupResponse) SetName(v GetBackupResponseGetNameRetType) { + setGetBackupResponseGetNameAttributeType(&o.Name, v) } // GetOptions returns the Options field value if set, zero value otherwise. -func (o *GetBackupResponse) GetOptions() *map[string]string { - if o == nil || IsNil(o.Options) { - var ret *map[string]string - return ret - } - return o.Options +func (o *GetBackupResponse) GetOptions() (res GetBackupResponseGetOptionsRetType) { + 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 *GetBackupResponse) GetOptionsOk() (*map[string]string, bool) { - if o == nil || IsNil(o.Options) { - return nil, false - } - return o.Options, true +func (o *GetBackupResponse) GetOptionsOk() (ret GetBackupResponseGetOptionsRetType, ok bool) { + return getGetBackupResponseGetOptionsAttributeTypeOk(o.Options) } // HasOptions returns a boolean if a field has been set. func (o *GetBackupResponse) 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 *GetBackupResponse) SetOptions(v *map[string]string) { - o.Options = v +func (o *GetBackupResponse) SetOptions(v GetBackupResponseGetOptionsRetType) { + setGetBackupResponseGetOptionsAttributeType(&o.Options, v) } // GetSize returns the Size field value if set, zero value otherwise. -func (o *GetBackupResponse) GetSize() *int64 { - if o == nil || IsNil(o.Size) { - var ret *int64 - return ret - } - return o.Size +func (o *GetBackupResponse) GetSize() (res GetBackupResponseGetSizeRetType) { + 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 *GetBackupResponse) GetSizeOk() (*int64, bool) { - if o == nil || IsNil(o.Size) { - return nil, false - } - return o.Size, true +func (o *GetBackupResponse) GetSizeOk() (ret GetBackupResponseGetSizeRetType, ok bool) { + return getGetBackupResponseGetSizeAttributeTypeOk(o.Size) } // HasSize returns a boolean if a field has been set. func (o *GetBackupResponse) 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 *GetBackupResponse) SetSize(v *int64) { - o.Size = v +func (o *GetBackupResponse) SetSize(v GetBackupResponseGetSizeRetType) { + setGetBackupResponseGetSizeAttributeType(&o.Size, v) } // GetStartTime returns the StartTime field value if set, zero value otherwise. -func (o *GetBackupResponse) GetStartTime() *string { - if o == nil || IsNil(o.StartTime) { - var ret *string - return ret - } - return o.StartTime +func (o *GetBackupResponse) GetStartTime() (res GetBackupResponseGetStartTimeRetType) { + 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 *GetBackupResponse) GetStartTimeOk() (*string, bool) { - if o == nil || IsNil(o.StartTime) { - return nil, false - } - return o.StartTime, true +func (o *GetBackupResponse) GetStartTimeOk() (ret GetBackupResponseGetStartTimeRetType, ok bool) { + return getGetBackupResponseGetStartTimeAttributeTypeOk(o.StartTime) } // HasStartTime returns a boolean if a field has been set. func (o *GetBackupResponse) 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 *GetBackupResponse) SetStartTime(v *string) { - o.StartTime = v +func (o *GetBackupResponse) SetStartTime(v GetBackupResponseGetStartTimeRetType) { + setGetBackupResponseGetStartTimeAttributeType(&o.StartTime, v) } func (o GetBackupResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.EndTime) { - toSerialize["endTime"] = o.EndTime + if val, ok := getGetBackupResponseGetEndTimeAttributeTypeOk(o.EndTime); ok { + toSerialize["EndTime"] = val } - if !IsNil(o.Error) { - toSerialize["error"] = o.Error + if val, ok := getGetBackupResponseGetErrorAttributeTypeOk(o.Error); ok { + toSerialize["Error"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getGetBackupResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getGetBackupResponseGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getGetBackupResponseGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Options) { - toSerialize["options"] = o.Options + if val, ok := getGetBackupResponseGetOptionsAttributeTypeOk(o.Options); ok { + toSerialize["Options"] = val } - if !IsNil(o.Size) { - toSerialize["size"] = o.Size + if val, ok := getGetBackupResponseGetSizeAttributeTypeOk(o.Size); ok { + toSerialize["Size"] = val } - if !IsNil(o.StartTime) { - toSerialize["startTime"] = o.StartTime + if val, ok := getGetBackupResponseGetStartTimeAttributeTypeOk(o.StartTime); ok { + toSerialize["StartTime"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_get_database_response.go b/services/sqlserverflex/model_get_database_response.go index d0d2468b4..f9fae45a4 100644 --- a/services/sqlserverflex/model_get_database_response.go +++ b/services/sqlserverflex/model_get_database_response.go @@ -17,9 +17,29 @@ import ( // checks if the GetDatabaseResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &GetDatabaseResponse{} +/* + types and functions for database +*/ + +// isModel +type GetDatabaseResponseGetDatabaseAttributeType = *SingleDatabase +type GetDatabaseResponseGetDatabaseArgType = SingleDatabase +type GetDatabaseResponseGetDatabaseRetType = SingleDatabase + +func getGetDatabaseResponseGetDatabaseAttributeTypeOk(arg GetDatabaseResponseGetDatabaseAttributeType) (ret GetDatabaseResponseGetDatabaseRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetDatabaseResponseGetDatabaseAttributeType(arg *GetDatabaseResponseGetDatabaseAttributeType, val GetDatabaseResponseGetDatabaseRetType) { + *arg = &val +} + // GetDatabaseResponse struct for GetDatabaseResponse type GetDatabaseResponse struct { - Database *SingleDatabase `json:"database,omitempty"` + Database GetDatabaseResponseGetDatabaseAttributeType `json:"database,omitempty"` } // NewGetDatabaseResponse instantiates a new GetDatabaseResponse object @@ -40,41 +60,32 @@ func NewGetDatabaseResponseWithDefaults() *GetDatabaseResponse { } // GetDatabase returns the Database field value if set, zero value otherwise. -func (o *GetDatabaseResponse) GetDatabase() *SingleDatabase { - if o == nil || IsNil(o.Database) { - var ret *SingleDatabase - return ret - } - return o.Database +func (o *GetDatabaseResponse) GetDatabase() (res GetDatabaseResponseGetDatabaseRetType) { + 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 *GetDatabaseResponse) GetDatabaseOk() (*SingleDatabase, bool) { - if o == nil || IsNil(o.Database) { - return nil, false - } - return o.Database, true +func (o *GetDatabaseResponse) GetDatabaseOk() (ret GetDatabaseResponseGetDatabaseRetType, ok bool) { + return getGetDatabaseResponseGetDatabaseAttributeTypeOk(o.Database) } // HasDatabase returns a boolean if a field has been set. func (o *GetDatabaseResponse) HasDatabase() bool { - if o != nil && !IsNil(o.Database) { - return true - } - - return false + _, ok := o.GetDatabaseOk() + return ok } // SetDatabase gets a reference to the given SingleDatabase and assigns it to the Database field. -func (o *GetDatabaseResponse) SetDatabase(v *SingleDatabase) { - o.Database = v +func (o *GetDatabaseResponse) SetDatabase(v GetDatabaseResponseGetDatabaseRetType) { + setGetDatabaseResponseGetDatabaseAttributeType(&o.Database, v) } func (o GetDatabaseResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Database) { - toSerialize["database"] = o.Database + if val, ok := getGetDatabaseResponseGetDatabaseAttributeTypeOk(o.Database); ok { + toSerialize["Database"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_get_instance_response.go b/services/sqlserverflex/model_get_instance_response.go index 4bc5208f5..062b8ed21 100644 --- a/services/sqlserverflex/model_get_instance_response.go +++ b/services/sqlserverflex/model_get_instance_response.go @@ -17,9 +17,29 @@ import ( // checks if the GetInstanceResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &GetInstanceResponse{} +/* + types and functions for item +*/ + +// isModel +type GetInstanceResponseGetItemAttributeType = *Instance +type GetInstanceResponseGetItemArgType = Instance +type GetInstanceResponseGetItemRetType = Instance + +func getGetInstanceResponseGetItemAttributeTypeOk(arg GetInstanceResponseGetItemAttributeType) (ret GetInstanceResponseGetItemRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetInstanceResponseGetItemAttributeType(arg *GetInstanceResponseGetItemAttributeType, val GetInstanceResponseGetItemRetType) { + *arg = &val +} + // GetInstanceResponse struct for GetInstanceResponse type GetInstanceResponse struct { - Item *Instance `json:"item,omitempty"` + Item GetInstanceResponseGetItemAttributeType `json:"item,omitempty"` } // NewGetInstanceResponse instantiates a new GetInstanceResponse object @@ -40,41 +60,32 @@ func NewGetInstanceResponseWithDefaults() *GetInstanceResponse { } // GetItem returns the Item field value if set, zero value otherwise. -func (o *GetInstanceResponse) GetItem() *Instance { - if o == nil || IsNil(o.Item) { - var ret *Instance - return ret - } - return o.Item +func (o *GetInstanceResponse) GetItem() (res GetInstanceResponseGetItemRetType) { + 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 *GetInstanceResponse) GetItemOk() (*Instance, bool) { - if o == nil || IsNil(o.Item) { - return nil, false - } - return o.Item, true +func (o *GetInstanceResponse) GetItemOk() (ret GetInstanceResponseGetItemRetType, ok bool) { + return getGetInstanceResponseGetItemAttributeTypeOk(o.Item) } // HasItem returns a boolean if a field has been set. func (o *GetInstanceResponse) 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 *GetInstanceResponse) SetItem(v *Instance) { - o.Item = v +func (o *GetInstanceResponse) SetItem(v GetInstanceResponseGetItemRetType) { + setGetInstanceResponseGetItemAttributeType(&o.Item, v) } func (o GetInstanceResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Item) { - toSerialize["item"] = o.Item + if val, ok := getGetInstanceResponseGetItemAttributeTypeOk(o.Item); ok { + toSerialize["Item"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_get_user_response.go b/services/sqlserverflex/model_get_user_response.go index fcdd4aa11..3f8a26906 100644 --- a/services/sqlserverflex/model_get_user_response.go +++ b/services/sqlserverflex/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 = *UserResponseUser +type GetUserResponseGetItemArgType = UserResponseUser +type GetUserResponseGetItemRetType = UserResponseUser + +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 *UserResponseUser `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() *UserResponseUser { - if o == nil || IsNil(o.Item) { - var ret *UserResponseUser - 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() (*UserResponseUser, 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 UserResponseUser and assigns it to the Item field. -func (o *GetUserResponse) SetItem(v *UserResponseUser) { - 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/sqlserverflex/model_instance.go b/services/sqlserverflex/model_instance.go index c5d284299..61dcdfddc 100644 --- a/services/sqlserverflex/model_instance.go +++ b/services/sqlserverflex/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/sqlserverflex/model_instance_documentation_acl.go b/services/sqlserverflex/model_instance_documentation_acl.go index be38fab63..2206a0278 100644 --- a/services/sqlserverflex/model_instance_documentation_acl.go +++ b/services/sqlserverflex/model_instance_documentation_acl.go @@ -17,10 +17,30 @@ import ( // checks if the InstanceDocumentationACL type satisfies the MappedNullable interface at compile time var _ MappedNullable = &InstanceDocumentationACL{} +/* + types and functions for items +*/ + +// isArray +type InstanceDocumentationACLGetItemsAttributeType = *[]string +type InstanceDocumentationACLGetItemsArgType = []string +type InstanceDocumentationACLGetItemsRetType = []string + +func getInstanceDocumentationACLGetItemsAttributeTypeOk(arg InstanceDocumentationACLGetItemsAttributeType) (ret InstanceDocumentationACLGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceDocumentationACLGetItemsAttributeType(arg *InstanceDocumentationACLGetItemsAttributeType, val InstanceDocumentationACLGetItemsRetType) { + *arg = &val +} + // InstanceDocumentationACL struct for InstanceDocumentationACL type InstanceDocumentationACL struct { // a simple list with IP addresses with CIDR. - Items *[]string `json:"items,omitempty"` + Items InstanceDocumentationACLGetItemsAttributeType `json:"items,omitempty"` } // NewInstanceDocumentationACL instantiates a new InstanceDocumentationACL object @@ -41,41 +61,32 @@ func NewInstanceDocumentationACLWithDefaults() *InstanceDocumentationACL { } // GetItems returns the Items field value if set, zero value otherwise. -func (o *InstanceDocumentationACL) GetItems() *[]string { - if o == nil || IsNil(o.Items) { - var ret *[]string - return ret - } - return o.Items +func (o *InstanceDocumentationACL) GetItems() (res InstanceDocumentationACLGetItemsRetType) { + 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 *InstanceDocumentationACL) GetItemsOk() (*[]string, bool) { - if o == nil || IsNil(o.Items) { - return nil, false - } - return o.Items, true +func (o *InstanceDocumentationACL) GetItemsOk() (ret InstanceDocumentationACLGetItemsRetType, ok bool) { + return getInstanceDocumentationACLGetItemsAttributeTypeOk(o.Items) } // HasItems returns a boolean if a field has been set. func (o *InstanceDocumentationACL) 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 *InstanceDocumentationACL) SetItems(v *[]string) { - o.Items = v +func (o *InstanceDocumentationACL) SetItems(v InstanceDocumentationACLGetItemsRetType) { + setInstanceDocumentationACLGetItemsAttributeType(&o.Items, v) } func (o InstanceDocumentationACL) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Items) { - toSerialize["items"] = o.Items + if val, ok := getInstanceDocumentationACLGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_instance_documentation_options.go b/services/sqlserverflex/model_instance_documentation_options.go index 11551342a..1cbaec3a9 100644 --- a/services/sqlserverflex/model_instance_documentation_options.go +++ b/services/sqlserverflex/model_instance_documentation_options.go @@ -17,12 +17,54 @@ import ( // checks if the InstanceDocumentationOptions type satisfies the MappedNullable interface at compile time var _ MappedNullable = &InstanceDocumentationOptions{} +/* + types and functions for edition +*/ + +// isNotNullableString +type InstanceDocumentationOptionsGetEditionAttributeType = *string + +func getInstanceDocumentationOptionsGetEditionAttributeTypeOk(arg InstanceDocumentationOptionsGetEditionAttributeType) (ret InstanceDocumentationOptionsGetEditionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceDocumentationOptionsGetEditionAttributeType(arg *InstanceDocumentationOptionsGetEditionAttributeType, val InstanceDocumentationOptionsGetEditionRetType) { + *arg = &val +} + +type InstanceDocumentationOptionsGetEditionArgType = string +type InstanceDocumentationOptionsGetEditionRetType = string + +/* + types and functions for retentionDays +*/ + +// isNotNullableString +type InstanceDocumentationOptionsGetRetentionDaysAttributeType = *string + +func getInstanceDocumentationOptionsGetRetentionDaysAttributeTypeOk(arg InstanceDocumentationOptionsGetRetentionDaysAttributeType) (ret InstanceDocumentationOptionsGetRetentionDaysRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceDocumentationOptionsGetRetentionDaysAttributeType(arg *InstanceDocumentationOptionsGetRetentionDaysAttributeType, val InstanceDocumentationOptionsGetRetentionDaysRetType) { + *arg = &val +} + +type InstanceDocumentationOptionsGetRetentionDaysArgType = string +type InstanceDocumentationOptionsGetRetentionDaysRetType = string + // InstanceDocumentationOptions struct for InstanceDocumentationOptions type InstanceDocumentationOptions struct { // Edition of the MSSQL server instance - Edition *string `json:"edition,omitempty"` + Edition InstanceDocumentationOptionsGetEditionAttributeType `json:"edition,omitempty"` // The days for how long the backup files should be stored before cleaned up. 30 to 365 - RetentionDays *string `json:"retentionDays,omitempty"` + RetentionDays InstanceDocumentationOptionsGetRetentionDaysAttributeType `json:"retentionDays,omitempty"` } // NewInstanceDocumentationOptions instantiates a new InstanceDocumentationOptions object @@ -31,10 +73,6 @@ type InstanceDocumentationOptions struct { // will change when the set of required properties is changed func NewInstanceDocumentationOptions() *InstanceDocumentationOptions { this := InstanceDocumentationOptions{} - var edition string = "developer" - this.Edition = &edition - var retentionDays string = "32" - this.RetentionDays = &retentionDays return &this } @@ -51,76 +89,58 @@ func NewInstanceDocumentationOptionsWithDefaults() *InstanceDocumentationOptions } // GetEdition returns the Edition field value if set, zero value otherwise. -func (o *InstanceDocumentationOptions) GetEdition() *string { - if o == nil || IsNil(o.Edition) { - var ret *string - return ret - } - return o.Edition +func (o *InstanceDocumentationOptions) GetEdition() (res InstanceDocumentationOptionsGetEditionRetType) { + res, _ = o.GetEditionOk() + return } // GetEditionOk returns a tuple with the Edition field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceDocumentationOptions) GetEditionOk() (*string, bool) { - if o == nil || IsNil(o.Edition) { - return nil, false - } - return o.Edition, true +func (o *InstanceDocumentationOptions) GetEditionOk() (ret InstanceDocumentationOptionsGetEditionRetType, ok bool) { + return getInstanceDocumentationOptionsGetEditionAttributeTypeOk(o.Edition) } // HasEdition returns a boolean if a field has been set. func (o *InstanceDocumentationOptions) HasEdition() bool { - if o != nil && !IsNil(o.Edition) { - return true - } - - return false + _, ok := o.GetEditionOk() + return ok } // SetEdition gets a reference to the given string and assigns it to the Edition field. -func (o *InstanceDocumentationOptions) SetEdition(v *string) { - o.Edition = v +func (o *InstanceDocumentationOptions) SetEdition(v InstanceDocumentationOptionsGetEditionRetType) { + setInstanceDocumentationOptionsGetEditionAttributeType(&o.Edition, v) } // GetRetentionDays returns the RetentionDays field value if set, zero value otherwise. -func (o *InstanceDocumentationOptions) GetRetentionDays() *string { - if o == nil || IsNil(o.RetentionDays) { - var ret *string - return ret - } - return o.RetentionDays +func (o *InstanceDocumentationOptions) GetRetentionDays() (res InstanceDocumentationOptionsGetRetentionDaysRetType) { + res, _ = o.GetRetentionDaysOk() + return } // GetRetentionDaysOk returns a tuple with the RetentionDays field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceDocumentationOptions) GetRetentionDaysOk() (*string, bool) { - if o == nil || IsNil(o.RetentionDays) { - return nil, false - } - return o.RetentionDays, true +func (o *InstanceDocumentationOptions) GetRetentionDaysOk() (ret InstanceDocumentationOptionsGetRetentionDaysRetType, ok bool) { + return getInstanceDocumentationOptionsGetRetentionDaysAttributeTypeOk(o.RetentionDays) } // HasRetentionDays returns a boolean if a field has been set. func (o *InstanceDocumentationOptions) HasRetentionDays() bool { - if o != nil && !IsNil(o.RetentionDays) { - return true - } - - return false + _, ok := o.GetRetentionDaysOk() + return ok } // SetRetentionDays gets a reference to the given string and assigns it to the RetentionDays field. -func (o *InstanceDocumentationOptions) SetRetentionDays(v *string) { - o.RetentionDays = v +func (o *InstanceDocumentationOptions) SetRetentionDays(v InstanceDocumentationOptionsGetRetentionDaysRetType) { + setInstanceDocumentationOptionsGetRetentionDaysAttributeType(&o.RetentionDays, v) } func (o InstanceDocumentationOptions) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Edition) { - toSerialize["edition"] = o.Edition + if val, ok := getInstanceDocumentationOptionsGetEditionAttributeTypeOk(o.Edition); ok { + toSerialize["Edition"] = val } - if !IsNil(o.RetentionDays) { - toSerialize["retentionDays"] = o.RetentionDays + if val, ok := getInstanceDocumentationOptionsGetRetentionDaysAttributeTypeOk(o.RetentionDays); ok { + toSerialize["RetentionDays"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_instance_documentation_storage.go b/services/sqlserverflex/model_instance_documentation_storage.go index e65f32660..7d679a6c6 100644 --- a/services/sqlserverflex/model_instance_documentation_storage.go +++ b/services/sqlserverflex/model_instance_documentation_storage.go @@ -17,12 +17,53 @@ import ( // checks if the InstanceDocumentationStorage type satisfies the MappedNullable interface at compile time var _ MappedNullable = &InstanceDocumentationStorage{} +/* + types and functions for class +*/ + +// isNotNullableString +type InstanceDocumentationStorageGetClassAttributeType = *string + +func getInstanceDocumentationStorageGetClassAttributeTypeOk(arg InstanceDocumentationStorageGetClassAttributeType) (ret InstanceDocumentationStorageGetClassRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceDocumentationStorageGetClassAttributeType(arg *InstanceDocumentationStorageGetClassAttributeType, val InstanceDocumentationStorageGetClassRetType) { + *arg = &val +} + +type InstanceDocumentationStorageGetClassArgType = string +type InstanceDocumentationStorageGetClassRetType = string + +/* + types and functions for size +*/ + +// isLong +type InstanceDocumentationStorageGetSizeAttributeType = *int64 +type InstanceDocumentationStorageGetSizeArgType = int64 +type InstanceDocumentationStorageGetSizeRetType = int64 + +func getInstanceDocumentationStorageGetSizeAttributeTypeOk(arg InstanceDocumentationStorageGetSizeAttributeType) (ret InstanceDocumentationStorageGetSizeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceDocumentationStorageGetSizeAttributeType(arg *InstanceDocumentationStorageGetSizeAttributeType, val InstanceDocumentationStorageGetSizeRetType) { + *arg = &val +} + // InstanceDocumentationStorage struct for InstanceDocumentationStorage type InstanceDocumentationStorage struct { // Class of the instance. - Class *string `json:"class,omitempty"` + Class InstanceDocumentationStorageGetClassAttributeType `json:"class,omitempty"` // Size of the instance storage in GB - Size *int64 `json:"size,omitempty"` + Size InstanceDocumentationStorageGetSizeAttributeType `json:"size,omitempty"` } // NewInstanceDocumentationStorage instantiates a new InstanceDocumentationStorage object @@ -31,8 +72,6 @@ type InstanceDocumentationStorage struct { // will change when the set of required properties is changed func NewInstanceDocumentationStorage() *InstanceDocumentationStorage { this := InstanceDocumentationStorage{} - var class string = "premium-perf12-stackit" - this.Class = &class return &this } @@ -47,76 +86,58 @@ func NewInstanceDocumentationStorageWithDefaults() *InstanceDocumentationStorage } // GetClass returns the Class field value if set, zero value otherwise. -func (o *InstanceDocumentationStorage) GetClass() *string { - if o == nil || IsNil(o.Class) { - var ret *string - return ret - } - return o.Class +func (o *InstanceDocumentationStorage) GetClass() (res InstanceDocumentationStorageGetClassRetType) { + 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 *InstanceDocumentationStorage) GetClassOk() (*string, bool) { - if o == nil || IsNil(o.Class) { - return nil, false - } - return o.Class, true +func (o *InstanceDocumentationStorage) GetClassOk() (ret InstanceDocumentationStorageGetClassRetType, ok bool) { + return getInstanceDocumentationStorageGetClassAttributeTypeOk(o.Class) } // HasClass returns a boolean if a field has been set. func (o *InstanceDocumentationStorage) 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 *InstanceDocumentationStorage) SetClass(v *string) { - o.Class = v +func (o *InstanceDocumentationStorage) SetClass(v InstanceDocumentationStorageGetClassRetType) { + setInstanceDocumentationStorageGetClassAttributeType(&o.Class, v) } // GetSize returns the Size field value if set, zero value otherwise. -func (o *InstanceDocumentationStorage) GetSize() *int64 { - if o == nil || IsNil(o.Size) { - var ret *int64 - return ret - } - return o.Size +func (o *InstanceDocumentationStorage) GetSize() (res InstanceDocumentationStorageGetSizeRetType) { + 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 *InstanceDocumentationStorage) GetSizeOk() (*int64, bool) { - if o == nil || IsNil(o.Size) { - return nil, false - } - return o.Size, true +func (o *InstanceDocumentationStorage) GetSizeOk() (ret InstanceDocumentationStorageGetSizeRetType, ok bool) { + return getInstanceDocumentationStorageGetSizeAttributeTypeOk(o.Size) } // HasSize returns a boolean if a field has been set. func (o *InstanceDocumentationStorage) 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 *InstanceDocumentationStorage) SetSize(v *int64) { - o.Size = v +func (o *InstanceDocumentationStorage) SetSize(v InstanceDocumentationStorageGetSizeRetType) { + setInstanceDocumentationStorageGetSizeAttributeType(&o.Size, v) } func (o InstanceDocumentationStorage) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Class) { - toSerialize["class"] = o.Class + if val, ok := getInstanceDocumentationStorageGetClassAttributeTypeOk(o.Class); ok { + toSerialize["Class"] = val } - if !IsNil(o.Size) { - toSerialize["size"] = o.Size + if val, ok := getInstanceDocumentationStorageGetSizeAttributeTypeOk(o.Size); ok { + toSerialize["Size"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_instance_error.go b/services/sqlserverflex/model_instance_error.go index a622b8cfb..4f32c7474 100644 --- a/services/sqlserverflex/model_instance_error.go +++ b/services/sqlserverflex/model_instance_error.go @@ -17,13 +17,94 @@ import ( // checks if the InstanceError type satisfies the MappedNullable interface at compile time var _ MappedNullable = &InstanceError{} +/* + types and functions for code +*/ + +// isInteger +type InstanceErrorGetCodeAttributeType = *int64 +type InstanceErrorGetCodeArgType = int64 +type InstanceErrorGetCodeRetType = int64 + +func getInstanceErrorGetCodeAttributeTypeOk(arg InstanceErrorGetCodeAttributeType) (ret InstanceErrorGetCodeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceErrorGetCodeAttributeType(arg *InstanceErrorGetCodeAttributeType, val InstanceErrorGetCodeRetType) { + *arg = &val +} + +/* + types and functions for fields +*/ + +// isContainer +type InstanceErrorGetFieldsAttributeType = *map[string][]string +type InstanceErrorGetFieldsArgType = map[string][]string +type InstanceErrorGetFieldsRetType = map[string][]string + +func getInstanceErrorGetFieldsAttributeTypeOk(arg InstanceErrorGetFieldsAttributeType) (ret InstanceErrorGetFieldsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceErrorGetFieldsAttributeType(arg *InstanceErrorGetFieldsAttributeType, val InstanceErrorGetFieldsRetType) { + *arg = &val +} + +/* + types and functions for message +*/ + +// isNotNullableString +type InstanceErrorGetMessageAttributeType = *string + +func getInstanceErrorGetMessageAttributeTypeOk(arg InstanceErrorGetMessageAttributeType) (ret InstanceErrorGetMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceErrorGetMessageAttributeType(arg *InstanceErrorGetMessageAttributeType, val InstanceErrorGetMessageRetType) { + *arg = &val +} + +type InstanceErrorGetMessageArgType = string +type InstanceErrorGetMessageRetType = string + +/* + types and functions for type +*/ + +// isEnumRef +type InstanceErrorGetTypeAttributeType = *Type +type InstanceErrorGetTypeArgType = Type +type InstanceErrorGetTypeRetType = Type + +func getInstanceErrorGetTypeAttributeTypeOk(arg InstanceErrorGetTypeAttributeType) (ret InstanceErrorGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceErrorGetTypeAttributeType(arg *InstanceErrorGetTypeAttributeType, val InstanceErrorGetTypeRetType) { + *arg = &val +} + // InstanceError struct for InstanceError type InstanceError 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 *Type `json:"type,omitempty"` + Code InstanceErrorGetCodeAttributeType `json:"code,omitempty"` + Fields InstanceErrorGetFieldsAttributeType `json:"fields,omitempty"` + Message InstanceErrorGetMessageAttributeType `json:"message,omitempty"` + Type InstanceErrorGetTypeAttributeType `json:"type,omitempty"` } // NewInstanceError instantiates a new InstanceError object @@ -44,146 +125,110 @@ func NewInstanceErrorWithDefaults() *InstanceError { } // GetCode returns the Code field value if set, zero value otherwise. -func (o *InstanceError) GetCode() *int64 { - if o == nil || IsNil(o.Code) { - var ret *int64 - return ret - } - return o.Code +func (o *InstanceError) GetCode() (res InstanceErrorGetCodeRetType) { + 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 *InstanceError) GetCodeOk() (*int64, bool) { - if o == nil || IsNil(o.Code) { - return nil, false - } - return o.Code, true +func (o *InstanceError) GetCodeOk() (ret InstanceErrorGetCodeRetType, ok bool) { + return getInstanceErrorGetCodeAttributeTypeOk(o.Code) } // HasCode returns a boolean if a field has been set. func (o *InstanceError) 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 *InstanceError) SetCode(v *int64) { - o.Code = v +func (o *InstanceError) SetCode(v InstanceErrorGetCodeRetType) { + setInstanceErrorGetCodeAttributeType(&o.Code, v) } // GetFields returns the Fields field value if set, zero value otherwise. -func (o *InstanceError) GetFields() *map[string][]string { - if o == nil || IsNil(o.Fields) { - var ret *map[string][]string - return ret - } - return o.Fields +func (o *InstanceError) GetFields() (res InstanceErrorGetFieldsRetType) { + 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 *InstanceError) GetFieldsOk() (*map[string][]string, bool) { - if o == nil || IsNil(o.Fields) { - return nil, false - } - return o.Fields, true +func (o *InstanceError) GetFieldsOk() (ret InstanceErrorGetFieldsRetType, ok bool) { + return getInstanceErrorGetFieldsAttributeTypeOk(o.Fields) } // HasFields returns a boolean if a field has been set. func (o *InstanceError) 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 *InstanceError) SetFields(v *map[string][]string) { - o.Fields = v +func (o *InstanceError) SetFields(v InstanceErrorGetFieldsRetType) { + setInstanceErrorGetFieldsAttributeType(&o.Fields, v) } // GetMessage returns the Message field value if set, zero value otherwise. -func (o *InstanceError) GetMessage() *string { - if o == nil || IsNil(o.Message) { - var ret *string - return ret - } - return o.Message +func (o *InstanceError) GetMessage() (res InstanceErrorGetMessageRetType) { + 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 *InstanceError) GetMessageOk() (*string, bool) { - if o == nil || IsNil(o.Message) { - return nil, false - } - return o.Message, true +func (o *InstanceError) GetMessageOk() (ret InstanceErrorGetMessageRetType, ok bool) { + return getInstanceErrorGetMessageAttributeTypeOk(o.Message) } // HasMessage returns a boolean if a field has been set. func (o *InstanceError) 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 *InstanceError) SetMessage(v *string) { - o.Message = v +func (o *InstanceError) SetMessage(v InstanceErrorGetMessageRetType) { + setInstanceErrorGetMessageAttributeType(&o.Message, v) } // GetType returns the Type field value if set, zero value otherwise. -func (o *InstanceError) GetType() *Type { - if o == nil || IsNil(o.Type) { - var ret *Type - return ret - } - return o.Type +func (o *InstanceError) GetType() (res InstanceErrorGetTypeRetType) { + 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 *InstanceError) GetTypeOk() (*Type, bool) { - if o == nil || IsNil(o.Type) { - return nil, false - } - return o.Type, true +func (o *InstanceError) GetTypeOk() (ret InstanceErrorGetTypeRetType, ok bool) { + return getInstanceErrorGetTypeAttributeTypeOk(o.Type) } // HasType returns a boolean if a field has been set. func (o *InstanceError) HasType() bool { - if o != nil && !IsNil(o.Type) { - return true - } - - return false + _, ok := o.GetTypeOk() + return ok } // SetType gets a reference to the given Type and assigns it to the Type field. -func (o *InstanceError) SetType(v *Type) { - o.Type = v +func (o *InstanceError) SetType(v InstanceErrorGetTypeRetType) { + setInstanceErrorGetTypeAttributeType(&o.Type, v) } func (o InstanceError) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Code) { - toSerialize["code"] = o.Code + if val, ok := getInstanceErrorGetCodeAttributeTypeOk(o.Code); ok { + toSerialize["Code"] = val } - if !IsNil(o.Fields) { - toSerialize["fields"] = o.Fields + if val, ok := getInstanceErrorGetFieldsAttributeTypeOk(o.Fields); ok { + toSerialize["Fields"] = val } - if !IsNil(o.Message) { - toSerialize["message"] = o.Message + if val, ok := getInstanceErrorGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val } - if !IsNil(o.Type) { - toSerialize["type"] = o.Type + if val, ok := getInstanceErrorGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_instance_flavor_entry.go b/services/sqlserverflex/model_instance_flavor_entry.go index f567b4b2f..648e2056c 100644 --- a/services/sqlserverflex/model_instance_flavor_entry.go +++ b/services/sqlserverflex/model_instance_flavor_entry.go @@ -17,15 +17,118 @@ import ( // checks if the InstanceFlavorEntry type satisfies the MappedNullable interface at compile time var _ MappedNullable = &InstanceFlavorEntry{} +/* + types and functions for categories +*/ + +// isNotNullableString +type InstanceFlavorEntryGetCategoriesAttributeType = *string + +func getInstanceFlavorEntryGetCategoriesAttributeTypeOk(arg InstanceFlavorEntryGetCategoriesAttributeType) (ret InstanceFlavorEntryGetCategoriesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceFlavorEntryGetCategoriesAttributeType(arg *InstanceFlavorEntryGetCategoriesAttributeType, val InstanceFlavorEntryGetCategoriesRetType) { + *arg = &val +} + +type InstanceFlavorEntryGetCategoriesArgType = string +type InstanceFlavorEntryGetCategoriesRetType = string + +/* + types and functions for cpu +*/ + +// isInteger +type InstanceFlavorEntryGetCpuAttributeType = *int64 +type InstanceFlavorEntryGetCpuArgType = int64 +type InstanceFlavorEntryGetCpuRetType = int64 + +func getInstanceFlavorEntryGetCpuAttributeTypeOk(arg InstanceFlavorEntryGetCpuAttributeType) (ret InstanceFlavorEntryGetCpuRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceFlavorEntryGetCpuAttributeType(arg *InstanceFlavorEntryGetCpuAttributeType, val InstanceFlavorEntryGetCpuRetType) { + *arg = &val +} + +/* + types and functions for description +*/ + +// isNotNullableString +type InstanceFlavorEntryGetDescriptionAttributeType = *string + +func getInstanceFlavorEntryGetDescriptionAttributeTypeOk(arg InstanceFlavorEntryGetDescriptionAttributeType) (ret InstanceFlavorEntryGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceFlavorEntryGetDescriptionAttributeType(arg *InstanceFlavorEntryGetDescriptionAttributeType, val InstanceFlavorEntryGetDescriptionRetType) { + *arg = &val +} + +type InstanceFlavorEntryGetDescriptionArgType = string +type InstanceFlavorEntryGetDescriptionRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type InstanceFlavorEntryGetIdAttributeType = *string + +func getInstanceFlavorEntryGetIdAttributeTypeOk(arg InstanceFlavorEntryGetIdAttributeType) (ret InstanceFlavorEntryGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceFlavorEntryGetIdAttributeType(arg *InstanceFlavorEntryGetIdAttributeType, val InstanceFlavorEntryGetIdRetType) { + *arg = &val +} + +type InstanceFlavorEntryGetIdArgType = string +type InstanceFlavorEntryGetIdRetType = string + +/* + types and functions for memory +*/ + +// isInteger +type InstanceFlavorEntryGetMemoryAttributeType = *int64 +type InstanceFlavorEntryGetMemoryArgType = int64 +type InstanceFlavorEntryGetMemoryRetType = int64 + +func getInstanceFlavorEntryGetMemoryAttributeTypeOk(arg InstanceFlavorEntryGetMemoryAttributeType) (ret InstanceFlavorEntryGetMemoryRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceFlavorEntryGetMemoryAttributeType(arg *InstanceFlavorEntryGetMemoryAttributeType, val InstanceFlavorEntryGetMemoryRetType) { + *arg = &val +} + // InstanceFlavorEntry struct for InstanceFlavorEntry type InstanceFlavorEntry struct { - Categories *string `json:"categories,omitempty"` + Categories InstanceFlavorEntryGetCategoriesAttributeType `json:"categories,omitempty"` // Can be cast to int32 without loss of precision. - Cpu *int64 `json:"cpu,omitempty"` - Description *string `json:"description,omitempty"` - Id *string `json:"id,omitempty"` + Cpu InstanceFlavorEntryGetCpuAttributeType `json:"cpu,omitempty"` + Description InstanceFlavorEntryGetDescriptionAttributeType `json:"description,omitempty"` + Id InstanceFlavorEntryGetIdAttributeType `json:"id,omitempty"` // Can be cast to int32 without loss of precision. - Memory *int64 `json:"memory,omitempty"` + Memory InstanceFlavorEntryGetMemoryAttributeType `json:"memory,omitempty"` } // NewInstanceFlavorEntry instantiates a new InstanceFlavorEntry object @@ -46,181 +149,136 @@ func NewInstanceFlavorEntryWithDefaults() *InstanceFlavorEntry { } // GetCategories returns the Categories field value if set, zero value otherwise. -func (o *InstanceFlavorEntry) GetCategories() *string { - if o == nil || IsNil(o.Categories) { - var ret *string - return ret - } - return o.Categories +func (o *InstanceFlavorEntry) GetCategories() (res InstanceFlavorEntryGetCategoriesRetType) { + res, _ = o.GetCategoriesOk() + return } // GetCategoriesOk returns a tuple with the Categories field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceFlavorEntry) GetCategoriesOk() (*string, bool) { - if o == nil || IsNil(o.Categories) { - return nil, false - } - return o.Categories, true +func (o *InstanceFlavorEntry) GetCategoriesOk() (ret InstanceFlavorEntryGetCategoriesRetType, ok bool) { + return getInstanceFlavorEntryGetCategoriesAttributeTypeOk(o.Categories) } // HasCategories returns a boolean if a field has been set. func (o *InstanceFlavorEntry) HasCategories() bool { - if o != nil && !IsNil(o.Categories) { - return true - } - - return false + _, ok := o.GetCategoriesOk() + return ok } // SetCategories gets a reference to the given string and assigns it to the Categories field. -func (o *InstanceFlavorEntry) SetCategories(v *string) { - o.Categories = v +func (o *InstanceFlavorEntry) SetCategories(v InstanceFlavorEntryGetCategoriesRetType) { + setInstanceFlavorEntryGetCategoriesAttributeType(&o.Categories, v) } // GetCpu returns the Cpu field value if set, zero value otherwise. -func (o *InstanceFlavorEntry) GetCpu() *int64 { - if o == nil || IsNil(o.Cpu) { - var ret *int64 - return ret - } - return o.Cpu +func (o *InstanceFlavorEntry) GetCpu() (res InstanceFlavorEntryGetCpuRetType) { + 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 *InstanceFlavorEntry) GetCpuOk() (*int64, bool) { - if o == nil || IsNil(o.Cpu) { - return nil, false - } - return o.Cpu, true +func (o *InstanceFlavorEntry) GetCpuOk() (ret InstanceFlavorEntryGetCpuRetType, ok bool) { + return getInstanceFlavorEntryGetCpuAttributeTypeOk(o.Cpu) } // HasCpu returns a boolean if a field has been set. func (o *InstanceFlavorEntry) 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 *InstanceFlavorEntry) SetCpu(v *int64) { - o.Cpu = v +func (o *InstanceFlavorEntry) SetCpu(v InstanceFlavorEntryGetCpuRetType) { + setInstanceFlavorEntryGetCpuAttributeType(&o.Cpu, v) } // GetDescription returns the Description field value if set, zero value otherwise. -func (o *InstanceFlavorEntry) GetDescription() *string { - if o == nil || IsNil(o.Description) { - var ret *string - return ret - } - return o.Description +func (o *InstanceFlavorEntry) GetDescription() (res InstanceFlavorEntryGetDescriptionRetType) { + 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 *InstanceFlavorEntry) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true +func (o *InstanceFlavorEntry) GetDescriptionOk() (ret InstanceFlavorEntryGetDescriptionRetType, ok bool) { + return getInstanceFlavorEntryGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. func (o *InstanceFlavorEntry) 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 *InstanceFlavorEntry) SetDescription(v *string) { - o.Description = v +func (o *InstanceFlavorEntry) SetDescription(v InstanceFlavorEntryGetDescriptionRetType) { + setInstanceFlavorEntryGetDescriptionAttributeType(&o.Description, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *InstanceFlavorEntry) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *InstanceFlavorEntry) GetId() (res InstanceFlavorEntryGetIdRetType) { + 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 *InstanceFlavorEntry) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *InstanceFlavorEntry) GetIdOk() (ret InstanceFlavorEntryGetIdRetType, ok bool) { + return getInstanceFlavorEntryGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *InstanceFlavorEntry) 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 *InstanceFlavorEntry) SetId(v *string) { - o.Id = v +func (o *InstanceFlavorEntry) SetId(v InstanceFlavorEntryGetIdRetType) { + setInstanceFlavorEntryGetIdAttributeType(&o.Id, v) } // GetMemory returns the Memory field value if set, zero value otherwise. -func (o *InstanceFlavorEntry) GetMemory() *int64 { - if o == nil || IsNil(o.Memory) { - var ret *int64 - return ret - } - return o.Memory +func (o *InstanceFlavorEntry) GetMemory() (res InstanceFlavorEntryGetMemoryRetType) { + 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 *InstanceFlavorEntry) GetMemoryOk() (*int64, bool) { - if o == nil || IsNil(o.Memory) { - return nil, false - } - return o.Memory, true +func (o *InstanceFlavorEntry) GetMemoryOk() (ret InstanceFlavorEntryGetMemoryRetType, ok bool) { + return getInstanceFlavorEntryGetMemoryAttributeTypeOk(o.Memory) } // HasMemory returns a boolean if a field has been set. func (o *InstanceFlavorEntry) 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 *InstanceFlavorEntry) SetMemory(v *int64) { - o.Memory = v +func (o *InstanceFlavorEntry) SetMemory(v InstanceFlavorEntryGetMemoryRetType) { + setInstanceFlavorEntryGetMemoryAttributeType(&o.Memory, v) } func (o InstanceFlavorEntry) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Categories) { - toSerialize["categories"] = o.Categories + if val, ok := getInstanceFlavorEntryGetCategoriesAttributeTypeOk(o.Categories); ok { + toSerialize["Categories"] = val } - if !IsNil(o.Cpu) { - toSerialize["cpu"] = o.Cpu + if val, ok := getInstanceFlavorEntryGetCpuAttributeTypeOk(o.Cpu); ok { + toSerialize["Cpu"] = val } - if !IsNil(o.Description) { - toSerialize["description"] = o.Description + if val, ok := getInstanceFlavorEntryGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getInstanceFlavorEntryGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.Memory) { - toSerialize["memory"] = o.Memory + if val, ok := getInstanceFlavorEntryGetMemoryAttributeTypeOk(o.Memory); ok { + toSerialize["Memory"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_instance_list_instance.go b/services/sqlserverflex/model_instance_list_instance.go index bdf9683af..f376434d3 100644 --- a/services/sqlserverflex/model_instance_list_instance.go +++ b/services/sqlserverflex/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/sqlserverflex/model_instance_list_user.go b/services/sqlserverflex/model_instance_list_user.go index 7e60bbb14..390a826ea 100644 --- a/services/sqlserverflex/model_instance_list_user.go +++ b/services/sqlserverflex/model_instance_list_user.go @@ -17,10 +17,52 @@ import ( // checks if the InstanceListUser type satisfies the MappedNullable interface at compile time var _ MappedNullable = &InstanceListUser{} +/* + types and functions for id +*/ + +// isNotNullableString +type InstanceListUserGetIdAttributeType = *string + +func getInstanceListUserGetIdAttributeTypeOk(arg InstanceListUserGetIdAttributeType) (ret InstanceListUserGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceListUserGetIdAttributeType(arg *InstanceListUserGetIdAttributeType, val InstanceListUserGetIdRetType) { + *arg = &val +} + +type InstanceListUserGetIdArgType = string +type InstanceListUserGetIdRetType = string + +/* + types and functions for username +*/ + +// isNotNullableString +type InstanceListUserGetUsernameAttributeType = *string + +func getInstanceListUserGetUsernameAttributeTypeOk(arg InstanceListUserGetUsernameAttributeType) (ret InstanceListUserGetUsernameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceListUserGetUsernameAttributeType(arg *InstanceListUserGetUsernameAttributeType, val InstanceListUserGetUsernameRetType) { + *arg = &val +} + +type InstanceListUserGetUsernameArgType = string +type InstanceListUserGetUsernameRetType = string + // InstanceListUser struct for InstanceListUser type InstanceListUser struct { - Id *string `json:"id,omitempty"` - Username *string `json:"username,omitempty"` + Id InstanceListUserGetIdAttributeType `json:"id,omitempty"` + Username InstanceListUserGetUsernameAttributeType `json:"username,omitempty"` } // NewInstanceListUser instantiates a new InstanceListUser object @@ -41,76 +83,58 @@ func NewInstanceListUserWithDefaults() *InstanceListUser { } // GetId returns the Id field value if set, zero value otherwise. -func (o *InstanceListUser) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *InstanceListUser) GetId() (res InstanceListUserGetIdRetType) { + 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 *InstanceListUser) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *InstanceListUser) GetIdOk() (ret InstanceListUserGetIdRetType, ok bool) { + return getInstanceListUserGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *InstanceListUser) 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 *InstanceListUser) SetId(v *string) { - o.Id = v +func (o *InstanceListUser) SetId(v InstanceListUserGetIdRetType) { + setInstanceListUserGetIdAttributeType(&o.Id, v) } // GetUsername returns the Username field value if set, zero value otherwise. -func (o *InstanceListUser) GetUsername() *string { - if o == nil || IsNil(o.Username) { - var ret *string - return ret - } - return o.Username +func (o *InstanceListUser) GetUsername() (res InstanceListUserGetUsernameRetType) { + 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 *InstanceListUser) GetUsernameOk() (*string, bool) { - if o == nil || IsNil(o.Username) { - return nil, false - } - return o.Username, true +func (o *InstanceListUser) GetUsernameOk() (ret InstanceListUserGetUsernameRetType, ok bool) { + return getInstanceListUserGetUsernameAttributeTypeOk(o.Username) } // HasUsername returns a boolean if a field has been set. func (o *InstanceListUser) 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 *InstanceListUser) SetUsername(v *string) { - o.Username = v +func (o *InstanceListUser) SetUsername(v InstanceListUserGetUsernameRetType) { + setInstanceListUserGetUsernameAttributeType(&o.Username, v) } func (o InstanceListUser) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getInstanceListUserGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.Username) { - toSerialize["username"] = o.Username + if val, ok := getInstanceListUserGetUsernameAttributeTypeOk(o.Username); ok { + toSerialize["Username"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_list_backups_response.go b/services/sqlserverflex/model_list_backups_response.go index 8ac37f3f6..10291c506 100644 --- a/services/sqlserverflex/model_list_backups_response.go +++ b/services/sqlserverflex/model_list_backups_response.go @@ -17,9 +17,29 @@ import ( // checks if the ListBackupsResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ListBackupsResponse{} +/* + types and functions for databases +*/ + +// isArray +type ListBackupsResponseGetDatabasesAttributeType = *[]BackupListBackupsResponseGrouped +type ListBackupsResponseGetDatabasesArgType = []BackupListBackupsResponseGrouped +type ListBackupsResponseGetDatabasesRetType = []BackupListBackupsResponseGrouped + +func getListBackupsResponseGetDatabasesAttributeTypeOk(arg ListBackupsResponseGetDatabasesAttributeType) (ret ListBackupsResponseGetDatabasesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListBackupsResponseGetDatabasesAttributeType(arg *ListBackupsResponseGetDatabasesAttributeType, val ListBackupsResponseGetDatabasesRetType) { + *arg = &val +} + // ListBackupsResponse struct for ListBackupsResponse type ListBackupsResponse struct { - Databases *[]BackupListBackupsResponseGrouped `json:"databases,omitempty"` + Databases ListBackupsResponseGetDatabasesAttributeType `json:"databases,omitempty"` } // NewListBackupsResponse instantiates a new ListBackupsResponse object @@ -40,41 +60,32 @@ func NewListBackupsResponseWithDefaults() *ListBackupsResponse { } // GetDatabases returns the Databases field value if set, zero value otherwise. -func (o *ListBackupsResponse) GetDatabases() *[]BackupListBackupsResponseGrouped { - if o == nil || IsNil(o.Databases) { - var ret *[]BackupListBackupsResponseGrouped - return ret - } - return o.Databases +func (o *ListBackupsResponse) GetDatabases() (res ListBackupsResponseGetDatabasesRetType) { + 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 *ListBackupsResponse) GetDatabasesOk() (*[]BackupListBackupsResponseGrouped, bool) { - if o == nil || IsNil(o.Databases) { - return nil, false - } - return o.Databases, true +func (o *ListBackupsResponse) GetDatabasesOk() (ret ListBackupsResponseGetDatabasesRetType, ok bool) { + return getListBackupsResponseGetDatabasesAttributeTypeOk(o.Databases) } // HasDatabases returns a boolean if a field has been set. func (o *ListBackupsResponse) HasDatabases() bool { - if o != nil && !IsNil(o.Databases) { - return true - } - - return false + _, ok := o.GetDatabasesOk() + return ok } // SetDatabases gets a reference to the given []BackupListBackupsResponseGrouped and assigns it to the Databases field. -func (o *ListBackupsResponse) SetDatabases(v *[]BackupListBackupsResponseGrouped) { - o.Databases = v +func (o *ListBackupsResponse) SetDatabases(v ListBackupsResponseGetDatabasesRetType) { + setListBackupsResponseGetDatabasesAttributeType(&o.Databases, v) } func (o ListBackupsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Databases) { - toSerialize["databases"] = o.Databases + if val, ok := getListBackupsResponseGetDatabasesAttributeTypeOk(o.Databases); ok { + toSerialize["Databases"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_list_collations_response.go b/services/sqlserverflex/model_list_collations_response.go index 866629631..23c1df237 100644 --- a/services/sqlserverflex/model_list_collations_response.go +++ b/services/sqlserverflex/model_list_collations_response.go @@ -17,9 +17,29 @@ import ( // checks if the ListCollationsResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ListCollationsResponse{} +/* + types and functions for collations +*/ + +// isArray +type ListCollationsResponseGetCollationsAttributeType = *[]MssqlDatabaseCollation +type ListCollationsResponseGetCollationsArgType = []MssqlDatabaseCollation +type ListCollationsResponseGetCollationsRetType = []MssqlDatabaseCollation + +func getListCollationsResponseGetCollationsAttributeTypeOk(arg ListCollationsResponseGetCollationsAttributeType) (ret ListCollationsResponseGetCollationsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListCollationsResponseGetCollationsAttributeType(arg *ListCollationsResponseGetCollationsAttributeType, val ListCollationsResponseGetCollationsRetType) { + *arg = &val +} + // ListCollationsResponse struct for ListCollationsResponse type ListCollationsResponse struct { - Collations *[]MssqlDatabaseCollation `json:"collations,omitempty"` + Collations ListCollationsResponseGetCollationsAttributeType `json:"collations,omitempty"` } // NewListCollationsResponse instantiates a new ListCollationsResponse object @@ -40,41 +60,32 @@ func NewListCollationsResponseWithDefaults() *ListCollationsResponse { } // GetCollations returns the Collations field value if set, zero value otherwise. -func (o *ListCollationsResponse) GetCollations() *[]MssqlDatabaseCollation { - if o == nil || IsNil(o.Collations) { - var ret *[]MssqlDatabaseCollation - return ret - } - return o.Collations +func (o *ListCollationsResponse) GetCollations() (res ListCollationsResponseGetCollationsRetType) { + res, _ = o.GetCollationsOk() + return } // GetCollationsOk returns a tuple with the Collations field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListCollationsResponse) GetCollationsOk() (*[]MssqlDatabaseCollation, bool) { - if o == nil || IsNil(o.Collations) { - return nil, false - } - return o.Collations, true +func (o *ListCollationsResponse) GetCollationsOk() (ret ListCollationsResponseGetCollationsRetType, ok bool) { + return getListCollationsResponseGetCollationsAttributeTypeOk(o.Collations) } // HasCollations returns a boolean if a field has been set. func (o *ListCollationsResponse) HasCollations() bool { - if o != nil && !IsNil(o.Collations) { - return true - } - - return false + _, ok := o.GetCollationsOk() + return ok } // SetCollations gets a reference to the given []MssqlDatabaseCollation and assigns it to the Collations field. -func (o *ListCollationsResponse) SetCollations(v *[]MssqlDatabaseCollation) { - o.Collations = v +func (o *ListCollationsResponse) SetCollations(v ListCollationsResponseGetCollationsRetType) { + setListCollationsResponseGetCollationsAttributeType(&o.Collations, v) } func (o ListCollationsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Collations) { - toSerialize["collations"] = o.Collations + if val, ok := getListCollationsResponseGetCollationsAttributeTypeOk(o.Collations); ok { + toSerialize["Collations"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_list_compatibility_response.go b/services/sqlserverflex/model_list_compatibility_response.go index 368499b21..202bc9d7e 100644 --- a/services/sqlserverflex/model_list_compatibility_response.go +++ b/services/sqlserverflex/model_list_compatibility_response.go @@ -17,9 +17,29 @@ import ( // checks if the ListCompatibilityResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ListCompatibilityResponse{} +/* + types and functions for compatibilities +*/ + +// isArray +type ListCompatibilityResponseGetCompatibilitiesAttributeType = *[]MssqlDatabaseCompatibility +type ListCompatibilityResponseGetCompatibilitiesArgType = []MssqlDatabaseCompatibility +type ListCompatibilityResponseGetCompatibilitiesRetType = []MssqlDatabaseCompatibility + +func getListCompatibilityResponseGetCompatibilitiesAttributeTypeOk(arg ListCompatibilityResponseGetCompatibilitiesAttributeType) (ret ListCompatibilityResponseGetCompatibilitiesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListCompatibilityResponseGetCompatibilitiesAttributeType(arg *ListCompatibilityResponseGetCompatibilitiesAttributeType, val ListCompatibilityResponseGetCompatibilitiesRetType) { + *arg = &val +} + // ListCompatibilityResponse struct for ListCompatibilityResponse type ListCompatibilityResponse struct { - Compatibilities *[]MssqlDatabaseCompatibility `json:"compatibilities,omitempty"` + Compatibilities ListCompatibilityResponseGetCompatibilitiesAttributeType `json:"compatibilities,omitempty"` } // NewListCompatibilityResponse instantiates a new ListCompatibilityResponse object @@ -40,41 +60,32 @@ func NewListCompatibilityResponseWithDefaults() *ListCompatibilityResponse { } // GetCompatibilities returns the Compatibilities field value if set, zero value otherwise. -func (o *ListCompatibilityResponse) GetCompatibilities() *[]MssqlDatabaseCompatibility { - if o == nil || IsNil(o.Compatibilities) { - var ret *[]MssqlDatabaseCompatibility - return ret - } - return o.Compatibilities +func (o *ListCompatibilityResponse) GetCompatibilities() (res ListCompatibilityResponseGetCompatibilitiesRetType) { + res, _ = o.GetCompatibilitiesOk() + return } // GetCompatibilitiesOk returns a tuple with the Compatibilities field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListCompatibilityResponse) GetCompatibilitiesOk() (*[]MssqlDatabaseCompatibility, bool) { - if o == nil || IsNil(o.Compatibilities) { - return nil, false - } - return o.Compatibilities, true +func (o *ListCompatibilityResponse) GetCompatibilitiesOk() (ret ListCompatibilityResponseGetCompatibilitiesRetType, ok bool) { + return getListCompatibilityResponseGetCompatibilitiesAttributeTypeOk(o.Compatibilities) } // HasCompatibilities returns a boolean if a field has been set. func (o *ListCompatibilityResponse) HasCompatibilities() bool { - if o != nil && !IsNil(o.Compatibilities) { - return true - } - - return false + _, ok := o.GetCompatibilitiesOk() + return ok } // SetCompatibilities gets a reference to the given []MssqlDatabaseCompatibility and assigns it to the Compatibilities field. -func (o *ListCompatibilityResponse) SetCompatibilities(v *[]MssqlDatabaseCompatibility) { - o.Compatibilities = v +func (o *ListCompatibilityResponse) SetCompatibilities(v ListCompatibilityResponseGetCompatibilitiesRetType) { + setListCompatibilityResponseGetCompatibilitiesAttributeType(&o.Compatibilities, v) } func (o ListCompatibilityResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Compatibilities) { - toSerialize["compatibilities"] = o.Compatibilities + if val, ok := getListCompatibilityResponseGetCompatibilitiesAttributeTypeOk(o.Compatibilities); ok { + toSerialize["Compatibilities"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_list_databases_response.go b/services/sqlserverflex/model_list_databases_response.go index 41b1a7b81..29319a940 100644 --- a/services/sqlserverflex/model_list_databases_response.go +++ b/services/sqlserverflex/model_list_databases_response.go @@ -17,9 +17,29 @@ import ( // checks if the ListDatabasesResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ListDatabasesResponse{} +/* + types and functions for databases +*/ + +// isArray +type ListDatabasesResponseGetDatabasesAttributeType = *[]Database +type ListDatabasesResponseGetDatabasesArgType = []Database +type ListDatabasesResponseGetDatabasesRetType = []Database + +func getListDatabasesResponseGetDatabasesAttributeTypeOk(arg ListDatabasesResponseGetDatabasesAttributeType) (ret ListDatabasesResponseGetDatabasesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListDatabasesResponseGetDatabasesAttributeType(arg *ListDatabasesResponseGetDatabasesAttributeType, val ListDatabasesResponseGetDatabasesRetType) { + *arg = &val +} + // ListDatabasesResponse struct for ListDatabasesResponse type ListDatabasesResponse struct { - Databases *[]Database `json:"databases,omitempty"` + Databases ListDatabasesResponseGetDatabasesAttributeType `json:"databases,omitempty"` } // NewListDatabasesResponse instantiates a new ListDatabasesResponse object @@ -40,41 +60,32 @@ func NewListDatabasesResponseWithDefaults() *ListDatabasesResponse { } // GetDatabases returns the Databases field value if set, zero value otherwise. -func (o *ListDatabasesResponse) GetDatabases() *[]Database { - if o == nil || IsNil(o.Databases) { - var ret *[]Database - return ret - } - return o.Databases +func (o *ListDatabasesResponse) GetDatabases() (res ListDatabasesResponseGetDatabasesRetType) { + 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 *ListDatabasesResponse) GetDatabasesOk() (*[]Database, bool) { - if o == nil || IsNil(o.Databases) { - return nil, false - } - return o.Databases, true +func (o *ListDatabasesResponse) GetDatabasesOk() (ret ListDatabasesResponseGetDatabasesRetType, ok bool) { + return getListDatabasesResponseGetDatabasesAttributeTypeOk(o.Databases) } // HasDatabases returns a boolean if a field has been set. func (o *ListDatabasesResponse) HasDatabases() bool { - if o != nil && !IsNil(o.Databases) { - return true - } - - return false + _, ok := o.GetDatabasesOk() + return ok } // SetDatabases gets a reference to the given []Database and assigns it to the Databases field. -func (o *ListDatabasesResponse) SetDatabases(v *[]Database) { - o.Databases = v +func (o *ListDatabasesResponse) SetDatabases(v ListDatabasesResponseGetDatabasesRetType) { + setListDatabasesResponseGetDatabasesAttributeType(&o.Databases, v) } func (o ListDatabasesResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Databases) { - toSerialize["databases"] = o.Databases + if val, ok := getListDatabasesResponseGetDatabasesAttributeTypeOk(o.Databases); ok { + toSerialize["Databases"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_list_flavors_response.go b/services/sqlserverflex/model_list_flavors_response.go index 011153f9d..7fe9008b5 100644 --- a/services/sqlserverflex/model_list_flavors_response.go +++ b/services/sqlserverflex/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 = *[]InstanceFlavorEntry +type ListFlavorsResponseGetFlavorsArgType = []InstanceFlavorEntry +type ListFlavorsResponseGetFlavorsRetType = []InstanceFlavorEntry + +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 *[]InstanceFlavorEntry `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() *[]InstanceFlavorEntry { - if o == nil || IsNil(o.Flavors) { - var ret *[]InstanceFlavorEntry - 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() (*[]InstanceFlavorEntry, 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 []InstanceFlavorEntry and assigns it to the Flavors field. -func (o *ListFlavorsResponse) SetFlavors(v *[]InstanceFlavorEntry) { - 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/sqlserverflex/model_list_instances_response.go b/services/sqlserverflex/model_list_instances_response.go index 21a82db2b..a6213d1eb 100644 --- a/services/sqlserverflex/model_list_instances_response.go +++ b/services/sqlserverflex/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/sqlserverflex/model_list_restore_jobs_response.go b/services/sqlserverflex/model_list_restore_jobs_response.go index 7021eb086..62dbd433e 100644 --- a/services/sqlserverflex/model_list_restore_jobs_response.go +++ b/services/sqlserverflex/model_list_restore_jobs_response.go @@ -17,9 +17,29 @@ import ( // checks if the ListRestoreJobsResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ListRestoreJobsResponse{} +/* + types and functions for runningRestores +*/ + +// isArray +type ListRestoreJobsResponseGetRunningRestoresAttributeType = *[]RestoreRunningRestore +type ListRestoreJobsResponseGetRunningRestoresArgType = []RestoreRunningRestore +type ListRestoreJobsResponseGetRunningRestoresRetType = []RestoreRunningRestore + +func getListRestoreJobsResponseGetRunningRestoresAttributeTypeOk(arg ListRestoreJobsResponseGetRunningRestoresAttributeType) (ret ListRestoreJobsResponseGetRunningRestoresRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListRestoreJobsResponseGetRunningRestoresAttributeType(arg *ListRestoreJobsResponseGetRunningRestoresAttributeType, val ListRestoreJobsResponseGetRunningRestoresRetType) { + *arg = &val +} + // ListRestoreJobsResponse struct for ListRestoreJobsResponse type ListRestoreJobsResponse struct { - RunningRestores *[]RestoreRunningRestore `json:"runningRestores,omitempty"` + RunningRestores ListRestoreJobsResponseGetRunningRestoresAttributeType `json:"runningRestores,omitempty"` } // NewListRestoreJobsResponse instantiates a new ListRestoreJobsResponse object @@ -40,41 +60,32 @@ func NewListRestoreJobsResponseWithDefaults() *ListRestoreJobsResponse { } // GetRunningRestores returns the RunningRestores field value if set, zero value otherwise. -func (o *ListRestoreJobsResponse) GetRunningRestores() *[]RestoreRunningRestore { - if o == nil || IsNil(o.RunningRestores) { - var ret *[]RestoreRunningRestore - return ret - } - return o.RunningRestores +func (o *ListRestoreJobsResponse) GetRunningRestores() (res ListRestoreJobsResponseGetRunningRestoresRetType) { + res, _ = o.GetRunningRestoresOk() + return } // GetRunningRestoresOk returns a tuple with the RunningRestores field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListRestoreJobsResponse) GetRunningRestoresOk() (*[]RestoreRunningRestore, bool) { - if o == nil || IsNil(o.RunningRestores) { - return nil, false - } - return o.RunningRestores, true +func (o *ListRestoreJobsResponse) GetRunningRestoresOk() (ret ListRestoreJobsResponseGetRunningRestoresRetType, ok bool) { + return getListRestoreJobsResponseGetRunningRestoresAttributeTypeOk(o.RunningRestores) } // HasRunningRestores returns a boolean if a field has been set. func (o *ListRestoreJobsResponse) HasRunningRestores() bool { - if o != nil && !IsNil(o.RunningRestores) { - return true - } - - return false + _, ok := o.GetRunningRestoresOk() + return ok } // SetRunningRestores gets a reference to the given []RestoreRunningRestore and assigns it to the RunningRestores field. -func (o *ListRestoreJobsResponse) SetRunningRestores(v *[]RestoreRunningRestore) { - o.RunningRestores = v +func (o *ListRestoreJobsResponse) SetRunningRestores(v ListRestoreJobsResponseGetRunningRestoresRetType) { + setListRestoreJobsResponseGetRunningRestoresAttributeType(&o.RunningRestores, v) } func (o ListRestoreJobsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.RunningRestores) { - toSerialize["runningRestores"] = o.RunningRestores + if val, ok := getListRestoreJobsResponseGetRunningRestoresAttributeTypeOk(o.RunningRestores); ok { + toSerialize["RunningRestores"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_list_roles_response.go b/services/sqlserverflex/model_list_roles_response.go index 480e6d477..dd62d529d 100644 --- a/services/sqlserverflex/model_list_roles_response.go +++ b/services/sqlserverflex/model_list_roles_response.go @@ -17,9 +17,29 @@ import ( // checks if the ListRolesResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ListRolesResponse{} +/* + types and functions for roles +*/ + +// isArray +type ListRolesResponseGetRolesAttributeType = *[]string +type ListRolesResponseGetRolesArgType = []string +type ListRolesResponseGetRolesRetType = []string + +func getListRolesResponseGetRolesAttributeTypeOk(arg ListRolesResponseGetRolesAttributeType) (ret ListRolesResponseGetRolesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListRolesResponseGetRolesAttributeType(arg *ListRolesResponseGetRolesAttributeType, val ListRolesResponseGetRolesRetType) { + *arg = &val +} + // ListRolesResponse struct for ListRolesResponse type ListRolesResponse struct { - Roles *[]string `json:"roles,omitempty"` + Roles ListRolesResponseGetRolesAttributeType `json:"roles,omitempty"` } // NewListRolesResponse instantiates a new ListRolesResponse object @@ -40,41 +60,32 @@ func NewListRolesResponseWithDefaults() *ListRolesResponse { } // GetRoles returns the Roles field value if set, zero value otherwise. -func (o *ListRolesResponse) GetRoles() *[]string { - if o == nil || IsNil(o.Roles) { - var ret *[]string - return ret - } - return o.Roles +func (o *ListRolesResponse) GetRoles() (res ListRolesResponseGetRolesRetType) { + 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 *ListRolesResponse) GetRolesOk() (*[]string, bool) { - if o == nil || IsNil(o.Roles) { - return nil, false - } - return o.Roles, true +func (o *ListRolesResponse) GetRolesOk() (ret ListRolesResponseGetRolesRetType, ok bool) { + return getListRolesResponseGetRolesAttributeTypeOk(o.Roles) } // HasRoles returns a boolean if a field has been set. func (o *ListRolesResponse) 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 *ListRolesResponse) SetRoles(v *[]string) { - o.Roles = v +func (o *ListRolesResponse) SetRoles(v ListRolesResponseGetRolesRetType) { + setListRolesResponseGetRolesAttributeType(&o.Roles, v) } func (o ListRolesResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Roles) { - toSerialize["roles"] = o.Roles + if val, ok := getListRolesResponseGetRolesAttributeTypeOk(o.Roles); ok { + toSerialize["Roles"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_list_storages_response.go b/services/sqlserverflex/model_list_storages_response.go index b28bc3a79..2b7b56caa 100644 --- a/services/sqlserverflex/model_list_storages_response.go +++ b/services/sqlserverflex/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/sqlserverflex/model_list_users_response.go b/services/sqlserverflex/model_list_users_response.go index 981d49f4d..cbbdcd1d0 100644 --- a/services/sqlserverflex/model_list_users_response.go +++ b/services/sqlserverflex/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 = *[]InstanceListUser +type ListUsersResponseGetItemsArgType = []InstanceListUser +type ListUsersResponseGetItemsRetType = []InstanceListUser + +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 *[]InstanceListUser `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() *[]InstanceListUser { - if o == nil || IsNil(o.Items) { - var ret *[]InstanceListUser - 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() (*[]InstanceListUser, 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 []InstanceListUser and assigns it to the Items field. -func (o *ListUsersResponse) SetItems(v *[]InstanceListUser) { - 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/sqlserverflex/model_list_versions_response.go b/services/sqlserverflex/model_list_versions_response.go index 96e24e280..825316d04 100644 --- a/services/sqlserverflex/model_list_versions_response.go +++ b/services/sqlserverflex/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/sqlserverflex/model_mssql_database_collation.go b/services/sqlserverflex/model_mssql_database_collation.go index ebec24d3f..5b7759f6e 100644 --- a/services/sqlserverflex/model_mssql_database_collation.go +++ b/services/sqlserverflex/model_mssql_database_collation.go @@ -17,10 +17,52 @@ import ( // checks if the MssqlDatabaseCollation type satisfies the MappedNullable interface at compile time var _ MappedNullable = &MssqlDatabaseCollation{} +/* + types and functions for collation_name +*/ + +// isNotNullableString +type MssqlDatabaseCollationGetCollationNameAttributeType = *string + +func getMssqlDatabaseCollationGetCollationNameAttributeTypeOk(arg MssqlDatabaseCollationGetCollationNameAttributeType) (ret MssqlDatabaseCollationGetCollationNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMssqlDatabaseCollationGetCollationNameAttributeType(arg *MssqlDatabaseCollationGetCollationNameAttributeType, val MssqlDatabaseCollationGetCollationNameRetType) { + *arg = &val +} + +type MssqlDatabaseCollationGetCollationNameArgType = string +type MssqlDatabaseCollationGetCollationNameRetType = string + +/* + types and functions for description +*/ + +// isNotNullableString +type MssqlDatabaseCollationGetDescriptionAttributeType = *string + +func getMssqlDatabaseCollationGetDescriptionAttributeTypeOk(arg MssqlDatabaseCollationGetDescriptionAttributeType) (ret MssqlDatabaseCollationGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMssqlDatabaseCollationGetDescriptionAttributeType(arg *MssqlDatabaseCollationGetDescriptionAttributeType, val MssqlDatabaseCollationGetDescriptionRetType) { + *arg = &val +} + +type MssqlDatabaseCollationGetDescriptionArgType = string +type MssqlDatabaseCollationGetDescriptionRetType = string + // MssqlDatabaseCollation struct for MssqlDatabaseCollation type MssqlDatabaseCollation struct { - CollationName *string `json:"collation_name,omitempty"` - Description *string `json:"description,omitempty"` + CollationName MssqlDatabaseCollationGetCollationNameAttributeType `json:"collation_name,omitempty"` + Description MssqlDatabaseCollationGetDescriptionAttributeType `json:"description,omitempty"` } // NewMssqlDatabaseCollation instantiates a new MssqlDatabaseCollation object @@ -41,76 +83,58 @@ func NewMssqlDatabaseCollationWithDefaults() *MssqlDatabaseCollation { } // GetCollationName returns the CollationName field value if set, zero value otherwise. -func (o *MssqlDatabaseCollation) GetCollationName() *string { - if o == nil || IsNil(o.CollationName) { - var ret *string - return ret - } - return o.CollationName +func (o *MssqlDatabaseCollation) GetCollationName() (res MssqlDatabaseCollationGetCollationNameRetType) { + res, _ = o.GetCollationNameOk() + return } // GetCollationNameOk returns a tuple with the CollationName field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MssqlDatabaseCollation) GetCollationNameOk() (*string, bool) { - if o == nil || IsNil(o.CollationName) { - return nil, false - } - return o.CollationName, true +func (o *MssqlDatabaseCollation) GetCollationNameOk() (ret MssqlDatabaseCollationGetCollationNameRetType, ok bool) { + return getMssqlDatabaseCollationGetCollationNameAttributeTypeOk(o.CollationName) } // HasCollationName returns a boolean if a field has been set. func (o *MssqlDatabaseCollation) HasCollationName() bool { - if o != nil && !IsNil(o.CollationName) { - return true - } - - return false + _, ok := o.GetCollationNameOk() + return ok } // SetCollationName gets a reference to the given string and assigns it to the CollationName field. -func (o *MssqlDatabaseCollation) SetCollationName(v *string) { - o.CollationName = v +func (o *MssqlDatabaseCollation) SetCollationName(v MssqlDatabaseCollationGetCollationNameRetType) { + setMssqlDatabaseCollationGetCollationNameAttributeType(&o.CollationName, v) } // GetDescription returns the Description field value if set, zero value otherwise. -func (o *MssqlDatabaseCollation) GetDescription() *string { - if o == nil || IsNil(o.Description) { - var ret *string - return ret - } - return o.Description +func (o *MssqlDatabaseCollation) GetDescription() (res MssqlDatabaseCollationGetDescriptionRetType) { + 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 *MssqlDatabaseCollation) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true +func (o *MssqlDatabaseCollation) GetDescriptionOk() (ret MssqlDatabaseCollationGetDescriptionRetType, ok bool) { + return getMssqlDatabaseCollationGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. func (o *MssqlDatabaseCollation) 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 *MssqlDatabaseCollation) SetDescription(v *string) { - o.Description = v +func (o *MssqlDatabaseCollation) SetDescription(v MssqlDatabaseCollationGetDescriptionRetType) { + setMssqlDatabaseCollationGetDescriptionAttributeType(&o.Description, v) } func (o MssqlDatabaseCollation) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.CollationName) { - toSerialize["collation_name"] = o.CollationName + if val, ok := getMssqlDatabaseCollationGetCollationNameAttributeTypeOk(o.CollationName); ok { + toSerialize["CollationName"] = val } - if !IsNil(o.Description) { - toSerialize["description"] = o.Description + if val, ok := getMssqlDatabaseCollationGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_mssql_database_compatibility.go b/services/sqlserverflex/model_mssql_database_compatibility.go index a0bb7c8e5..e7a07972b 100644 --- a/services/sqlserverflex/model_mssql_database_compatibility.go +++ b/services/sqlserverflex/model_mssql_database_compatibility.go @@ -17,10 +17,51 @@ import ( // checks if the MssqlDatabaseCompatibility type satisfies the MappedNullable interface at compile time var _ MappedNullable = &MssqlDatabaseCompatibility{} +/* + types and functions for compatibility_level +*/ + +// isLong +type MssqlDatabaseCompatibilityGetCompatibilityLevelAttributeType = *int64 +type MssqlDatabaseCompatibilityGetCompatibilityLevelArgType = int64 +type MssqlDatabaseCompatibilityGetCompatibilityLevelRetType = int64 + +func getMssqlDatabaseCompatibilityGetCompatibilityLevelAttributeTypeOk(arg MssqlDatabaseCompatibilityGetCompatibilityLevelAttributeType) (ret MssqlDatabaseCompatibilityGetCompatibilityLevelRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMssqlDatabaseCompatibilityGetCompatibilityLevelAttributeType(arg *MssqlDatabaseCompatibilityGetCompatibilityLevelAttributeType, val MssqlDatabaseCompatibilityGetCompatibilityLevelRetType) { + *arg = &val +} + +/* + types and functions for description +*/ + +// isNotNullableString +type MssqlDatabaseCompatibilityGetDescriptionAttributeType = *string + +func getMssqlDatabaseCompatibilityGetDescriptionAttributeTypeOk(arg MssqlDatabaseCompatibilityGetDescriptionAttributeType) (ret MssqlDatabaseCompatibilityGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMssqlDatabaseCompatibilityGetDescriptionAttributeType(arg *MssqlDatabaseCompatibilityGetDescriptionAttributeType, val MssqlDatabaseCompatibilityGetDescriptionRetType) { + *arg = &val +} + +type MssqlDatabaseCompatibilityGetDescriptionArgType = string +type MssqlDatabaseCompatibilityGetDescriptionRetType = string + // MssqlDatabaseCompatibility struct for MssqlDatabaseCompatibility type MssqlDatabaseCompatibility struct { - CompatibilityLevel *int64 `json:"compatibility_level,omitempty"` - Description *string `json:"description,omitempty"` + CompatibilityLevel MssqlDatabaseCompatibilityGetCompatibilityLevelAttributeType `json:"compatibility_level,omitempty"` + Description MssqlDatabaseCompatibilityGetDescriptionAttributeType `json:"description,omitempty"` } // NewMssqlDatabaseCompatibility instantiates a new MssqlDatabaseCompatibility object @@ -41,76 +82,58 @@ func NewMssqlDatabaseCompatibilityWithDefaults() *MssqlDatabaseCompatibility { } // GetCompatibilityLevel returns the CompatibilityLevel field value if set, zero value otherwise. -func (o *MssqlDatabaseCompatibility) GetCompatibilityLevel() *int64 { - if o == nil || IsNil(o.CompatibilityLevel) { - var ret *int64 - return ret - } - return o.CompatibilityLevel +func (o *MssqlDatabaseCompatibility) GetCompatibilityLevel() (res MssqlDatabaseCompatibilityGetCompatibilityLevelRetType) { + res, _ = o.GetCompatibilityLevelOk() + return } // GetCompatibilityLevelOk returns a tuple with the CompatibilityLevel field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MssqlDatabaseCompatibility) GetCompatibilityLevelOk() (*int64, bool) { - if o == nil || IsNil(o.CompatibilityLevel) { - return nil, false - } - return o.CompatibilityLevel, true +func (o *MssqlDatabaseCompatibility) GetCompatibilityLevelOk() (ret MssqlDatabaseCompatibilityGetCompatibilityLevelRetType, ok bool) { + return getMssqlDatabaseCompatibilityGetCompatibilityLevelAttributeTypeOk(o.CompatibilityLevel) } // HasCompatibilityLevel returns a boolean if a field has been set. func (o *MssqlDatabaseCompatibility) HasCompatibilityLevel() bool { - if o != nil && !IsNil(o.CompatibilityLevel) { - return true - } - - return false + _, ok := o.GetCompatibilityLevelOk() + return ok } // SetCompatibilityLevel gets a reference to the given int64 and assigns it to the CompatibilityLevel field. -func (o *MssqlDatabaseCompatibility) SetCompatibilityLevel(v *int64) { - o.CompatibilityLevel = v +func (o *MssqlDatabaseCompatibility) SetCompatibilityLevel(v MssqlDatabaseCompatibilityGetCompatibilityLevelRetType) { + setMssqlDatabaseCompatibilityGetCompatibilityLevelAttributeType(&o.CompatibilityLevel, v) } // GetDescription returns the Description field value if set, zero value otherwise. -func (o *MssqlDatabaseCompatibility) GetDescription() *string { - if o == nil || IsNil(o.Description) { - var ret *string - return ret - } - return o.Description +func (o *MssqlDatabaseCompatibility) GetDescription() (res MssqlDatabaseCompatibilityGetDescriptionRetType) { + 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 *MssqlDatabaseCompatibility) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true +func (o *MssqlDatabaseCompatibility) GetDescriptionOk() (ret MssqlDatabaseCompatibilityGetDescriptionRetType, ok bool) { + return getMssqlDatabaseCompatibilityGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. func (o *MssqlDatabaseCompatibility) 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 *MssqlDatabaseCompatibility) SetDescription(v *string) { - o.Description = v +func (o *MssqlDatabaseCompatibility) SetDescription(v MssqlDatabaseCompatibilityGetDescriptionRetType) { + setMssqlDatabaseCompatibilityGetDescriptionAttributeType(&o.Description, v) } func (o MssqlDatabaseCompatibility) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.CompatibilityLevel) { - toSerialize["compatibility_level"] = o.CompatibilityLevel + if val, ok := getMssqlDatabaseCompatibilityGetCompatibilityLevelAttributeTypeOk(o.CompatibilityLevel); ok { + toSerialize["CompatibilityLevel"] = val } - if !IsNil(o.Description) { - toSerialize["description"] = o.Description + if val, ok := getMssqlDatabaseCompatibilityGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_partial_update_instance_payload.go b/services/sqlserverflex/model_partial_update_instance_payload.go index a15a78199..4f8443d6b 100644 --- a/services/sqlserverflex/model_partial_update_instance_payload.go +++ b/services/sqlserverflex/model_partial_update_instance_payload.go @@ -17,18 +17,142 @@ import ( // checks if the PartialUpdateInstancePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &PartialUpdateInstancePayload{} +/* + types and functions for acl +*/ + +// isModel +type PartialUpdateInstancePayloadGetAclAttributeType = *CreateInstancePayloadAcl +type PartialUpdateInstancePayloadGetAclArgType = CreateInstancePayloadAcl +type PartialUpdateInstancePayloadGetAclRetType = CreateInstancePayloadAcl + +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 +*/ + +// isFreeform +type PartialUpdateInstancePayloadGetLabelsAttributeType = *map[string]interface{} +type PartialUpdateInstancePayloadGetLabelsArgType = map[string]interface{} +type PartialUpdateInstancePayloadGetLabelsRetType = map[string]interface{} + +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 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 *CreateInstancePayloadAcl `json:"acl,omitempty"` + Acl PartialUpdateInstancePayloadGetAclAttributeType `json:"acl,omitempty"` // Cronjob for the daily full backup if not provided a job will generated between 00:00 and 04:59 - BackupSchedule *string `json:"backupSchedule,omitempty"` + BackupSchedule PartialUpdateInstancePayloadGetBackupScheduleAttributeType `json:"backupSchedule,omitempty"` // Id of the selected flavor - FlavorId *string `json:"flavorId,omitempty"` - Labels *map[string]interface{} `json:"labels,omitempty"` + FlavorId PartialUpdateInstancePayloadGetFlavorIdAttributeType `json:"flavorId,omitempty"` + Labels PartialUpdateInstancePayloadGetLabelsAttributeType `json:"labels,omitempty"` // Name of the instance - Name *string `json:"name,omitempty"` + Name PartialUpdateInstancePayloadGetNameAttributeType `json:"name,omitempty"` // Version of the MSSQL Server - Version *string `json:"version,omitempty"` + Version PartialUpdateInstancePayloadGetVersionAttributeType `json:"version,omitempty"` } // NewPartialUpdateInstancePayload instantiates a new PartialUpdateInstancePayload object @@ -37,8 +161,6 @@ type PartialUpdateInstancePayload struct { // will change when the set of required properties is changed func NewPartialUpdateInstancePayload() *PartialUpdateInstancePayload { this := PartialUpdateInstancePayload{} - var version string = "2022" - this.Version = &version return &this } @@ -53,216 +175,162 @@ func NewPartialUpdateInstancePayloadWithDefaults() *PartialUpdateInstancePayload } // GetAcl returns the Acl field value if set, zero value otherwise. -func (o *PartialUpdateInstancePayload) GetAcl() *CreateInstancePayloadAcl { - if o == nil || IsNil(o.Acl) { - var ret *CreateInstancePayloadAcl - 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() (*CreateInstancePayloadAcl, 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 CreateInstancePayloadAcl and assigns it to the Acl field. -func (o *PartialUpdateInstancePayload) SetAcl(v *CreateInstancePayloadAcl) { - 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]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - 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]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, 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]interface{} and assigns it to the Labels field. -func (o *PartialUpdateInstancePayload) SetLabels(v *map[string]interface{}) { - 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) } // 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.Version) { - toSerialize["version"] = o.Version + if val, ok := getPartialUpdateInstancePayloadGetVersionAttributeTypeOk(o.Version); ok { + toSerialize["Version"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_reset_user_response.go b/services/sqlserverflex/model_reset_user_response.go index a3eb98bde..d17c8d310 100644 --- a/services/sqlserverflex/model_reset_user_response.go +++ b/services/sqlserverflex/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 = *SingleUser +type ResetUserResponseGetItemArgType = SingleUser +type ResetUserResponseGetItemRetType = SingleUser + +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 *SingleUser `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() *SingleUser { - if o == nil || IsNil(o.Item) { - var ret *SingleUser - 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() (*SingleUser, 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 SingleUser and assigns it to the Item field. -func (o *ResetUserResponse) SetItem(v *SingleUser) { - 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/sqlserverflex/model_restore_running_restore.go b/services/sqlserverflex/model_restore_running_restore.go index 2bda294c4..40b717c79 100644 --- a/services/sqlserverflex/model_restore_running_restore.go +++ b/services/sqlserverflex/model_restore_running_restore.go @@ -17,14 +17,118 @@ import ( // checks if the RestoreRunningRestore type satisfies the MappedNullable interface at compile time var _ MappedNullable = &RestoreRunningRestore{} +/* + types and functions for command +*/ + +// isNotNullableString +type RestoreRunningRestoreGetCommandAttributeType = *string + +func getRestoreRunningRestoreGetCommandAttributeTypeOk(arg RestoreRunningRestoreGetCommandAttributeType) (ret RestoreRunningRestoreGetCommandRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRestoreRunningRestoreGetCommandAttributeType(arg *RestoreRunningRestoreGetCommandAttributeType, val RestoreRunningRestoreGetCommandRetType) { + *arg = &val +} + +type RestoreRunningRestoreGetCommandArgType = string +type RestoreRunningRestoreGetCommandRetType = string + +/* + types and functions for database_name +*/ + +// isNotNullableString +type RestoreRunningRestoreGetDatabaseNameAttributeType = *string + +func getRestoreRunningRestoreGetDatabaseNameAttributeTypeOk(arg RestoreRunningRestoreGetDatabaseNameAttributeType) (ret RestoreRunningRestoreGetDatabaseNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRestoreRunningRestoreGetDatabaseNameAttributeType(arg *RestoreRunningRestoreGetDatabaseNameAttributeType, val RestoreRunningRestoreGetDatabaseNameRetType) { + *arg = &val +} + +type RestoreRunningRestoreGetDatabaseNameArgType = string +type RestoreRunningRestoreGetDatabaseNameRetType = string + +/* + types and functions for estimated_completion_time +*/ + +// isNotNullableString +type RestoreRunningRestoreGetEstimatedCompletionTimeAttributeType = *string + +func getRestoreRunningRestoreGetEstimatedCompletionTimeAttributeTypeOk(arg RestoreRunningRestoreGetEstimatedCompletionTimeAttributeType) (ret RestoreRunningRestoreGetEstimatedCompletionTimeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRestoreRunningRestoreGetEstimatedCompletionTimeAttributeType(arg *RestoreRunningRestoreGetEstimatedCompletionTimeAttributeType, val RestoreRunningRestoreGetEstimatedCompletionTimeRetType) { + *arg = &val +} + +type RestoreRunningRestoreGetEstimatedCompletionTimeArgType = string +type RestoreRunningRestoreGetEstimatedCompletionTimeRetType = string + +/* + types and functions for percent_complete +*/ + +// isInteger +type RestoreRunningRestoreGetPercentCompleteAttributeType = *int64 +type RestoreRunningRestoreGetPercentCompleteArgType = int64 +type RestoreRunningRestoreGetPercentCompleteRetType = int64 + +func getRestoreRunningRestoreGetPercentCompleteAttributeTypeOk(arg RestoreRunningRestoreGetPercentCompleteAttributeType) (ret RestoreRunningRestoreGetPercentCompleteRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRestoreRunningRestoreGetPercentCompleteAttributeType(arg *RestoreRunningRestoreGetPercentCompleteAttributeType, val RestoreRunningRestoreGetPercentCompleteRetType) { + *arg = &val +} + +/* + types and functions for start_time +*/ + +// isNotNullableString +type RestoreRunningRestoreGetStartTimeAttributeType = *string + +func getRestoreRunningRestoreGetStartTimeAttributeTypeOk(arg RestoreRunningRestoreGetStartTimeAttributeType) (ret RestoreRunningRestoreGetStartTimeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRestoreRunningRestoreGetStartTimeAttributeType(arg *RestoreRunningRestoreGetStartTimeAttributeType, val RestoreRunningRestoreGetStartTimeRetType) { + *arg = &val +} + +type RestoreRunningRestoreGetStartTimeArgType = string +type RestoreRunningRestoreGetStartTimeRetType = string + // RestoreRunningRestore struct for RestoreRunningRestore type RestoreRunningRestore struct { - Command *string `json:"command,omitempty"` - DatabaseName *string `json:"database_name,omitempty"` - EstimatedCompletionTime *string `json:"estimated_completion_time,omitempty"` + Command RestoreRunningRestoreGetCommandAttributeType `json:"command,omitempty"` + DatabaseName RestoreRunningRestoreGetDatabaseNameAttributeType `json:"database_name,omitempty"` + EstimatedCompletionTime RestoreRunningRestoreGetEstimatedCompletionTimeAttributeType `json:"estimated_completion_time,omitempty"` // Can be cast to int32 without loss of precision. - PercentComplete *int64 `json:"percent_complete,omitempty"` - StartTime *string `json:"start_time,omitempty"` + PercentComplete RestoreRunningRestoreGetPercentCompleteAttributeType `json:"percent_complete,omitempty"` + StartTime RestoreRunningRestoreGetStartTimeAttributeType `json:"start_time,omitempty"` } // NewRestoreRunningRestore instantiates a new RestoreRunningRestore object @@ -45,181 +149,136 @@ func NewRestoreRunningRestoreWithDefaults() *RestoreRunningRestore { } // GetCommand returns the Command field value if set, zero value otherwise. -func (o *RestoreRunningRestore) GetCommand() *string { - if o == nil || IsNil(o.Command) { - var ret *string - return ret - } - return o.Command +func (o *RestoreRunningRestore) GetCommand() (res RestoreRunningRestoreGetCommandRetType) { + res, _ = o.GetCommandOk() + return } // GetCommandOk returns a tuple with the Command field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *RestoreRunningRestore) GetCommandOk() (*string, bool) { - if o == nil || IsNil(o.Command) { - return nil, false - } - return o.Command, true +func (o *RestoreRunningRestore) GetCommandOk() (ret RestoreRunningRestoreGetCommandRetType, ok bool) { + return getRestoreRunningRestoreGetCommandAttributeTypeOk(o.Command) } // HasCommand returns a boolean if a field has been set. func (o *RestoreRunningRestore) HasCommand() bool { - if o != nil && !IsNil(o.Command) { - return true - } - - return false + _, ok := o.GetCommandOk() + return ok } // SetCommand gets a reference to the given string and assigns it to the Command field. -func (o *RestoreRunningRestore) SetCommand(v *string) { - o.Command = v +func (o *RestoreRunningRestore) SetCommand(v RestoreRunningRestoreGetCommandRetType) { + setRestoreRunningRestoreGetCommandAttributeType(&o.Command, v) } // GetDatabaseName returns the DatabaseName field value if set, zero value otherwise. -func (o *RestoreRunningRestore) GetDatabaseName() *string { - if o == nil || IsNil(o.DatabaseName) { - var ret *string - return ret - } - return o.DatabaseName +func (o *RestoreRunningRestore) GetDatabaseName() (res RestoreRunningRestoreGetDatabaseNameRetType) { + res, _ = o.GetDatabaseNameOk() + return } // GetDatabaseNameOk returns a tuple with the DatabaseName field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *RestoreRunningRestore) GetDatabaseNameOk() (*string, bool) { - if o == nil || IsNil(o.DatabaseName) { - return nil, false - } - return o.DatabaseName, true +func (o *RestoreRunningRestore) GetDatabaseNameOk() (ret RestoreRunningRestoreGetDatabaseNameRetType, ok bool) { + return getRestoreRunningRestoreGetDatabaseNameAttributeTypeOk(o.DatabaseName) } // HasDatabaseName returns a boolean if a field has been set. func (o *RestoreRunningRestore) HasDatabaseName() bool { - if o != nil && !IsNil(o.DatabaseName) { - return true - } - - return false + _, ok := o.GetDatabaseNameOk() + return ok } // SetDatabaseName gets a reference to the given string and assigns it to the DatabaseName field. -func (o *RestoreRunningRestore) SetDatabaseName(v *string) { - o.DatabaseName = v +func (o *RestoreRunningRestore) SetDatabaseName(v RestoreRunningRestoreGetDatabaseNameRetType) { + setRestoreRunningRestoreGetDatabaseNameAttributeType(&o.DatabaseName, v) } // GetEstimatedCompletionTime returns the EstimatedCompletionTime field value if set, zero value otherwise. -func (o *RestoreRunningRestore) GetEstimatedCompletionTime() *string { - if o == nil || IsNil(o.EstimatedCompletionTime) { - var ret *string - return ret - } - return o.EstimatedCompletionTime +func (o *RestoreRunningRestore) GetEstimatedCompletionTime() (res RestoreRunningRestoreGetEstimatedCompletionTimeRetType) { + res, _ = o.GetEstimatedCompletionTimeOk() + return } // GetEstimatedCompletionTimeOk returns a tuple with the EstimatedCompletionTime field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *RestoreRunningRestore) GetEstimatedCompletionTimeOk() (*string, bool) { - if o == nil || IsNil(o.EstimatedCompletionTime) { - return nil, false - } - return o.EstimatedCompletionTime, true +func (o *RestoreRunningRestore) GetEstimatedCompletionTimeOk() (ret RestoreRunningRestoreGetEstimatedCompletionTimeRetType, ok bool) { + return getRestoreRunningRestoreGetEstimatedCompletionTimeAttributeTypeOk(o.EstimatedCompletionTime) } // HasEstimatedCompletionTime returns a boolean if a field has been set. func (o *RestoreRunningRestore) HasEstimatedCompletionTime() bool { - if o != nil && !IsNil(o.EstimatedCompletionTime) { - return true - } - - return false + _, ok := o.GetEstimatedCompletionTimeOk() + return ok } // SetEstimatedCompletionTime gets a reference to the given string and assigns it to the EstimatedCompletionTime field. -func (o *RestoreRunningRestore) SetEstimatedCompletionTime(v *string) { - o.EstimatedCompletionTime = v +func (o *RestoreRunningRestore) SetEstimatedCompletionTime(v RestoreRunningRestoreGetEstimatedCompletionTimeRetType) { + setRestoreRunningRestoreGetEstimatedCompletionTimeAttributeType(&o.EstimatedCompletionTime, v) } // GetPercentComplete returns the PercentComplete field value if set, zero value otherwise. -func (o *RestoreRunningRestore) GetPercentComplete() *int64 { - if o == nil || IsNil(o.PercentComplete) { - var ret *int64 - return ret - } - return o.PercentComplete +func (o *RestoreRunningRestore) GetPercentComplete() (res RestoreRunningRestoreGetPercentCompleteRetType) { + res, _ = o.GetPercentCompleteOk() + return } // GetPercentCompleteOk returns a tuple with the PercentComplete field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *RestoreRunningRestore) GetPercentCompleteOk() (*int64, bool) { - if o == nil || IsNil(o.PercentComplete) { - return nil, false - } - return o.PercentComplete, true +func (o *RestoreRunningRestore) GetPercentCompleteOk() (ret RestoreRunningRestoreGetPercentCompleteRetType, ok bool) { + return getRestoreRunningRestoreGetPercentCompleteAttributeTypeOk(o.PercentComplete) } // HasPercentComplete returns a boolean if a field has been set. func (o *RestoreRunningRestore) HasPercentComplete() bool { - if o != nil && !IsNil(o.PercentComplete) { - return true - } - - return false + _, ok := o.GetPercentCompleteOk() + return ok } // SetPercentComplete gets a reference to the given int64 and assigns it to the PercentComplete field. -func (o *RestoreRunningRestore) SetPercentComplete(v *int64) { - o.PercentComplete = v +func (o *RestoreRunningRestore) SetPercentComplete(v RestoreRunningRestoreGetPercentCompleteRetType) { + setRestoreRunningRestoreGetPercentCompleteAttributeType(&o.PercentComplete, v) } // GetStartTime returns the StartTime field value if set, zero value otherwise. -func (o *RestoreRunningRestore) GetStartTime() *string { - if o == nil || IsNil(o.StartTime) { - var ret *string - return ret - } - return o.StartTime +func (o *RestoreRunningRestore) GetStartTime() (res RestoreRunningRestoreGetStartTimeRetType) { + 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 *RestoreRunningRestore) GetStartTimeOk() (*string, bool) { - if o == nil || IsNil(o.StartTime) { - return nil, false - } - return o.StartTime, true +func (o *RestoreRunningRestore) GetStartTimeOk() (ret RestoreRunningRestoreGetStartTimeRetType, ok bool) { + return getRestoreRunningRestoreGetStartTimeAttributeTypeOk(o.StartTime) } // HasStartTime returns a boolean if a field has been set. func (o *RestoreRunningRestore) 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 *RestoreRunningRestore) SetStartTime(v *string) { - o.StartTime = v +func (o *RestoreRunningRestore) SetStartTime(v RestoreRunningRestoreGetStartTimeRetType) { + setRestoreRunningRestoreGetStartTimeAttributeType(&o.StartTime, v) } func (o RestoreRunningRestore) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Command) { - toSerialize["command"] = o.Command + if val, ok := getRestoreRunningRestoreGetCommandAttributeTypeOk(o.Command); ok { + toSerialize["Command"] = val } - if !IsNil(o.DatabaseName) { - toSerialize["database_name"] = o.DatabaseName + if val, ok := getRestoreRunningRestoreGetDatabaseNameAttributeTypeOk(o.DatabaseName); ok { + toSerialize["DatabaseName"] = val } - if !IsNil(o.EstimatedCompletionTime) { - toSerialize["estimated_completion_time"] = o.EstimatedCompletionTime + if val, ok := getRestoreRunningRestoreGetEstimatedCompletionTimeAttributeTypeOk(o.EstimatedCompletionTime); ok { + toSerialize["EstimatedCompletionTime"] = val } - if !IsNil(o.PercentComplete) { - toSerialize["percent_complete"] = o.PercentComplete + if val, ok := getRestoreRunningRestoreGetPercentCompleteAttributeTypeOk(o.PercentComplete); ok { + toSerialize["PercentComplete"] = val } - if !IsNil(o.StartTime) { - toSerialize["start_time"] = o.StartTime + if val, ok := getRestoreRunningRestoreGetStartTimeAttributeTypeOk(o.StartTime); ok { + toSerialize["StartTime"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_single_database.go b/services/sqlserverflex/model_single_database.go index 3115b8d84..3b1d02e06 100644 --- a/services/sqlserverflex/model_single_database.go +++ b/services/sqlserverflex/model_single_database.go @@ -17,13 +17,75 @@ import ( // checks if the SingleDatabase type satisfies the MappedNullable interface at compile time var _ MappedNullable = &SingleDatabase{} +/* + types and functions for id +*/ + +// isNotNullableString +type SingleDatabaseGetIdAttributeType = *string + +func getSingleDatabaseGetIdAttributeTypeOk(arg SingleDatabaseGetIdAttributeType) (ret SingleDatabaseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSingleDatabaseGetIdAttributeType(arg *SingleDatabaseGetIdAttributeType, val SingleDatabaseGetIdRetType) { + *arg = &val +} + +type SingleDatabaseGetIdArgType = string +type SingleDatabaseGetIdRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +type SingleDatabaseGetNameAttributeType = *string + +func getSingleDatabaseGetNameAttributeTypeOk(arg SingleDatabaseGetNameAttributeType) (ret SingleDatabaseGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSingleDatabaseGetNameAttributeType(arg *SingleDatabaseGetNameAttributeType, val SingleDatabaseGetNameRetType) { + *arg = &val +} + +type SingleDatabaseGetNameArgType = string +type SingleDatabaseGetNameRetType = string + +/* + types and functions for options +*/ + +// isModel +type SingleDatabaseGetOptionsAttributeType = *SingleDatabaseOptions +type SingleDatabaseGetOptionsArgType = SingleDatabaseOptions +type SingleDatabaseGetOptionsRetType = SingleDatabaseOptions + +func getSingleDatabaseGetOptionsAttributeTypeOk(arg SingleDatabaseGetOptionsAttributeType) (ret SingleDatabaseGetOptionsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSingleDatabaseGetOptionsAttributeType(arg *SingleDatabaseGetOptionsAttributeType, val SingleDatabaseGetOptionsRetType) { + *arg = &val +} + // SingleDatabase struct for SingleDatabase type SingleDatabase struct { // Database id - Id *string `json:"id,omitempty"` + Id SingleDatabaseGetIdAttributeType `json:"id,omitempty"` // Database name - Name *string `json:"name,omitempty"` - Options *SingleDatabaseOptions `json:"options,omitempty"` + Name SingleDatabaseGetNameAttributeType `json:"name,omitempty"` + Options SingleDatabaseGetOptionsAttributeType `json:"options,omitempty"` } // NewSingleDatabase instantiates a new SingleDatabase object @@ -44,111 +106,84 @@ func NewSingleDatabaseWithDefaults() *SingleDatabase { } // GetId returns the Id field value if set, zero value otherwise. -func (o *SingleDatabase) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *SingleDatabase) GetId() (res SingleDatabaseGetIdRetType) { + 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 *SingleDatabase) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *SingleDatabase) GetIdOk() (ret SingleDatabaseGetIdRetType, ok bool) { + return getSingleDatabaseGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *SingleDatabase) 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 *SingleDatabase) SetId(v *string) { - o.Id = v +func (o *SingleDatabase) SetId(v SingleDatabaseGetIdRetType) { + setSingleDatabaseGetIdAttributeType(&o.Id, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *SingleDatabase) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *SingleDatabase) GetName() (res SingleDatabaseGetNameRetType) { + 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 *SingleDatabase) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *SingleDatabase) GetNameOk() (ret SingleDatabaseGetNameRetType, ok bool) { + return getSingleDatabaseGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *SingleDatabase) 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 *SingleDatabase) SetName(v *string) { - o.Name = v +func (o *SingleDatabase) SetName(v SingleDatabaseGetNameRetType) { + setSingleDatabaseGetNameAttributeType(&o.Name, v) } // GetOptions returns the Options field value if set, zero value otherwise. -func (o *SingleDatabase) GetOptions() *SingleDatabaseOptions { - if o == nil || IsNil(o.Options) { - var ret *SingleDatabaseOptions - return ret - } - return o.Options +func (o *SingleDatabase) GetOptions() (res SingleDatabaseGetOptionsRetType) { + 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 *SingleDatabase) GetOptionsOk() (*SingleDatabaseOptions, bool) { - if o == nil || IsNil(o.Options) { - return nil, false - } - return o.Options, true +func (o *SingleDatabase) GetOptionsOk() (ret SingleDatabaseGetOptionsRetType, ok bool) { + return getSingleDatabaseGetOptionsAttributeTypeOk(o.Options) } // HasOptions returns a boolean if a field has been set. func (o *SingleDatabase) HasOptions() bool { - if o != nil && !IsNil(o.Options) { - return true - } - - return false + _, ok := o.GetOptionsOk() + return ok } // SetOptions gets a reference to the given SingleDatabaseOptions and assigns it to the Options field. -func (o *SingleDatabase) SetOptions(v *SingleDatabaseOptions) { - o.Options = v +func (o *SingleDatabase) SetOptions(v SingleDatabaseGetOptionsRetType) { + setSingleDatabaseGetOptionsAttributeType(&o.Options, v) } func (o SingleDatabase) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getSingleDatabaseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getSingleDatabaseGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Options) { - toSerialize["options"] = o.Options + if val, ok := getSingleDatabaseGetOptionsAttributeTypeOk(o.Options); ok { + toSerialize["Options"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_single_database_options.go b/services/sqlserverflex/model_single_database_options.go index 4586ea53d..01f18aa33 100644 --- a/services/sqlserverflex/model_single_database_options.go +++ b/services/sqlserverflex/model_single_database_options.go @@ -17,14 +17,76 @@ import ( // checks if the SingleDatabaseOptions type satisfies the MappedNullable interface at compile time var _ MappedNullable = &SingleDatabaseOptions{} +/* + types and functions for collationName +*/ + +// isNotNullableString +type SingleDatabaseOptionsGetCollationNameAttributeType = *string + +func getSingleDatabaseOptionsGetCollationNameAttributeTypeOk(arg SingleDatabaseOptionsGetCollationNameAttributeType) (ret SingleDatabaseOptionsGetCollationNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSingleDatabaseOptionsGetCollationNameAttributeType(arg *SingleDatabaseOptionsGetCollationNameAttributeType, val SingleDatabaseOptionsGetCollationNameRetType) { + *arg = &val +} + +type SingleDatabaseOptionsGetCollationNameArgType = string +type SingleDatabaseOptionsGetCollationNameRetType = string + +/* + types and functions for compatibilityLevel +*/ + +// isLong +type SingleDatabaseOptionsGetCompatibilityLevelAttributeType = *int64 +type SingleDatabaseOptionsGetCompatibilityLevelArgType = int64 +type SingleDatabaseOptionsGetCompatibilityLevelRetType = int64 + +func getSingleDatabaseOptionsGetCompatibilityLevelAttributeTypeOk(arg SingleDatabaseOptionsGetCompatibilityLevelAttributeType) (ret SingleDatabaseOptionsGetCompatibilityLevelRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSingleDatabaseOptionsGetCompatibilityLevelAttributeType(arg *SingleDatabaseOptionsGetCompatibilityLevelAttributeType, val SingleDatabaseOptionsGetCompatibilityLevelRetType) { + *arg = &val +} + +/* + types and functions for owner +*/ + +// isNotNullableString +type SingleDatabaseOptionsGetOwnerAttributeType = *string + +func getSingleDatabaseOptionsGetOwnerAttributeTypeOk(arg SingleDatabaseOptionsGetOwnerAttributeType) (ret SingleDatabaseOptionsGetOwnerRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSingleDatabaseOptionsGetOwnerAttributeType(arg *SingleDatabaseOptionsGetOwnerAttributeType, val SingleDatabaseOptionsGetOwnerRetType) { + *arg = &val +} + +type SingleDatabaseOptionsGetOwnerArgType = string +type SingleDatabaseOptionsGetOwnerRetType = string + // SingleDatabaseOptions Database specific options type SingleDatabaseOptions struct { // Name of the collation of the database - CollationName *string `json:"collationName,omitempty"` + CollationName SingleDatabaseOptionsGetCollationNameAttributeType `json:"collationName,omitempty"` // CompatibilityLevel of the Database. - CompatibilityLevel *int64 `json:"compatibilityLevel,omitempty"` + CompatibilityLevel SingleDatabaseOptionsGetCompatibilityLevelAttributeType `json:"compatibilityLevel,omitempty"` // Name of the owner of the database. - Owner *string `json:"owner,omitempty"` + Owner SingleDatabaseOptionsGetOwnerAttributeType `json:"owner,omitempty"` } // NewSingleDatabaseOptions instantiates a new SingleDatabaseOptions object @@ -45,111 +107,84 @@ func NewSingleDatabaseOptionsWithDefaults() *SingleDatabaseOptions { } // GetCollationName returns the CollationName field value if set, zero value otherwise. -func (o *SingleDatabaseOptions) GetCollationName() *string { - if o == nil || IsNil(o.CollationName) { - var ret *string - return ret - } - return o.CollationName +func (o *SingleDatabaseOptions) GetCollationName() (res SingleDatabaseOptionsGetCollationNameRetType) { + res, _ = o.GetCollationNameOk() + return } // GetCollationNameOk returns a tuple with the CollationName field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SingleDatabaseOptions) GetCollationNameOk() (*string, bool) { - if o == nil || IsNil(o.CollationName) { - return nil, false - } - return o.CollationName, true +func (o *SingleDatabaseOptions) GetCollationNameOk() (ret SingleDatabaseOptionsGetCollationNameRetType, ok bool) { + return getSingleDatabaseOptionsGetCollationNameAttributeTypeOk(o.CollationName) } // HasCollationName returns a boolean if a field has been set. func (o *SingleDatabaseOptions) HasCollationName() bool { - if o != nil && !IsNil(o.CollationName) { - return true - } - - return false + _, ok := o.GetCollationNameOk() + return ok } // SetCollationName gets a reference to the given string and assigns it to the CollationName field. -func (o *SingleDatabaseOptions) SetCollationName(v *string) { - o.CollationName = v +func (o *SingleDatabaseOptions) SetCollationName(v SingleDatabaseOptionsGetCollationNameRetType) { + setSingleDatabaseOptionsGetCollationNameAttributeType(&o.CollationName, v) } // GetCompatibilityLevel returns the CompatibilityLevel field value if set, zero value otherwise. -func (o *SingleDatabaseOptions) GetCompatibilityLevel() *int64 { - if o == nil || IsNil(o.CompatibilityLevel) { - var ret *int64 - return ret - } - return o.CompatibilityLevel +func (o *SingleDatabaseOptions) GetCompatibilityLevel() (res SingleDatabaseOptionsGetCompatibilityLevelRetType) { + res, _ = o.GetCompatibilityLevelOk() + return } // GetCompatibilityLevelOk returns a tuple with the CompatibilityLevel field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SingleDatabaseOptions) GetCompatibilityLevelOk() (*int64, bool) { - if o == nil || IsNil(o.CompatibilityLevel) { - return nil, false - } - return o.CompatibilityLevel, true +func (o *SingleDatabaseOptions) GetCompatibilityLevelOk() (ret SingleDatabaseOptionsGetCompatibilityLevelRetType, ok bool) { + return getSingleDatabaseOptionsGetCompatibilityLevelAttributeTypeOk(o.CompatibilityLevel) } // HasCompatibilityLevel returns a boolean if a field has been set. func (o *SingleDatabaseOptions) HasCompatibilityLevel() bool { - if o != nil && !IsNil(o.CompatibilityLevel) { - return true - } - - return false + _, ok := o.GetCompatibilityLevelOk() + return ok } // SetCompatibilityLevel gets a reference to the given int64 and assigns it to the CompatibilityLevel field. -func (o *SingleDatabaseOptions) SetCompatibilityLevel(v *int64) { - o.CompatibilityLevel = v +func (o *SingleDatabaseOptions) SetCompatibilityLevel(v SingleDatabaseOptionsGetCompatibilityLevelRetType) { + setSingleDatabaseOptionsGetCompatibilityLevelAttributeType(&o.CompatibilityLevel, v) } // GetOwner returns the Owner field value if set, zero value otherwise. -func (o *SingleDatabaseOptions) GetOwner() *string { - if o == nil || IsNil(o.Owner) { - var ret *string - return ret - } - return o.Owner +func (o *SingleDatabaseOptions) GetOwner() (res SingleDatabaseOptionsGetOwnerRetType) { + res, _ = o.GetOwnerOk() + return } // GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SingleDatabaseOptions) GetOwnerOk() (*string, bool) { - if o == nil || IsNil(o.Owner) { - return nil, false - } - return o.Owner, true +func (o *SingleDatabaseOptions) GetOwnerOk() (ret SingleDatabaseOptionsGetOwnerRetType, ok bool) { + return getSingleDatabaseOptionsGetOwnerAttributeTypeOk(o.Owner) } // HasOwner returns a boolean if a field has been set. func (o *SingleDatabaseOptions) HasOwner() bool { - if o != nil && !IsNil(o.Owner) { - return true - } - - return false + _, ok := o.GetOwnerOk() + return ok } // SetOwner gets a reference to the given string and assigns it to the Owner field. -func (o *SingleDatabaseOptions) SetOwner(v *string) { - o.Owner = v +func (o *SingleDatabaseOptions) SetOwner(v SingleDatabaseOptionsGetOwnerRetType) { + setSingleDatabaseOptionsGetOwnerAttributeType(&o.Owner, v) } func (o SingleDatabaseOptions) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.CollationName) { - toSerialize["collationName"] = o.CollationName + if val, ok := getSingleDatabaseOptionsGetCollationNameAttributeTypeOk(o.CollationName); ok { + toSerialize["CollationName"] = val } - if !IsNil(o.CompatibilityLevel) { - toSerialize["compatibilityLevel"] = o.CompatibilityLevel + if val, ok := getSingleDatabaseOptionsGetCompatibilityLevelAttributeTypeOk(o.CompatibilityLevel); ok { + toSerialize["CompatibilityLevel"] = val } - if !IsNil(o.Owner) { - toSerialize["owner"] = o.Owner + if val, ok := getSingleDatabaseOptionsGetOwnerAttributeTypeOk(o.Owner); ok { + toSerialize["Owner"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_single_user.go b/services/sqlserverflex/model_single_user.go index c49b0ee40..44ef867c3 100644 --- a/services/sqlserverflex/model_single_user.go +++ b/services/sqlserverflex/model_single_user.go @@ -17,16 +17,182 @@ import ( // checks if the SingleUser type satisfies the MappedNullable interface at compile time var _ MappedNullable = &SingleUser{} +/* + types and functions for default_database +*/ + +// isNotNullableString +type SingleUserGetDefaultDatabaseAttributeType = *string + +func getSingleUserGetDefaultDatabaseAttributeTypeOk(arg SingleUserGetDefaultDatabaseAttributeType) (ret SingleUserGetDefaultDatabaseRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSingleUserGetDefaultDatabaseAttributeType(arg *SingleUserGetDefaultDatabaseAttributeType, val SingleUserGetDefaultDatabaseRetType) { + *arg = &val +} + +type SingleUserGetDefaultDatabaseArgType = string +type SingleUserGetDefaultDatabaseRetType = string + +/* + types and functions for host +*/ + +// isNotNullableString +type SingleUserGetHostAttributeType = *string + +func getSingleUserGetHostAttributeTypeOk(arg SingleUserGetHostAttributeType) (ret SingleUserGetHostRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSingleUserGetHostAttributeType(arg *SingleUserGetHostAttributeType, val SingleUserGetHostRetType) { + *arg = &val +} + +type SingleUserGetHostArgType = string +type SingleUserGetHostRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type SingleUserGetIdAttributeType = *string + +func getSingleUserGetIdAttributeTypeOk(arg SingleUserGetIdAttributeType) (ret SingleUserGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSingleUserGetIdAttributeType(arg *SingleUserGetIdAttributeType, val SingleUserGetIdRetType) { + *arg = &val +} + +type SingleUserGetIdArgType = string +type SingleUserGetIdRetType = string + +/* + types and functions for password +*/ + +// isNotNullableString +type SingleUserGetPasswordAttributeType = *string + +func getSingleUserGetPasswordAttributeTypeOk(arg SingleUserGetPasswordAttributeType) (ret SingleUserGetPasswordRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSingleUserGetPasswordAttributeType(arg *SingleUserGetPasswordAttributeType, val SingleUserGetPasswordRetType) { + *arg = &val +} + +type SingleUserGetPasswordArgType = string +type SingleUserGetPasswordRetType = string + +/* + types and functions for port +*/ + +// isLong +type SingleUserGetPortAttributeType = *int64 +type SingleUserGetPortArgType = int64 +type SingleUserGetPortRetType = int64 + +func getSingleUserGetPortAttributeTypeOk(arg SingleUserGetPortAttributeType) (ret SingleUserGetPortRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSingleUserGetPortAttributeType(arg *SingleUserGetPortAttributeType, val SingleUserGetPortRetType) { + *arg = &val +} + +/* + types and functions for roles +*/ + +// isArray +type SingleUserGetRolesAttributeType = *[]string +type SingleUserGetRolesArgType = []string +type SingleUserGetRolesRetType = []string + +func getSingleUserGetRolesAttributeTypeOk(arg SingleUserGetRolesAttributeType) (ret SingleUserGetRolesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSingleUserGetRolesAttributeType(arg *SingleUserGetRolesAttributeType, val SingleUserGetRolesRetType) { + *arg = &val +} + +/* + types and functions for uri +*/ + +// isNotNullableString +type SingleUserGetUriAttributeType = *string + +func getSingleUserGetUriAttributeTypeOk(arg SingleUserGetUriAttributeType) (ret SingleUserGetUriRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSingleUserGetUriAttributeType(arg *SingleUserGetUriAttributeType, val SingleUserGetUriRetType) { + *arg = &val +} + +type SingleUserGetUriArgType = string +type SingleUserGetUriRetType = string + +/* + types and functions for username +*/ + +// isNotNullableString +type SingleUserGetUsernameAttributeType = *string + +func getSingleUserGetUsernameAttributeTypeOk(arg SingleUserGetUsernameAttributeType) (ret SingleUserGetUsernameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSingleUserGetUsernameAttributeType(arg *SingleUserGetUsernameAttributeType, val SingleUserGetUsernameRetType) { + *arg = &val +} + +type SingleUserGetUsernameArgType = string +type SingleUserGetUsernameRetType = string + // SingleUser struct for SingleUser type SingleUser struct { - DefaultDatabase *string `json:"default_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"` + DefaultDatabase SingleUserGetDefaultDatabaseAttributeType `json:"default_database,omitempty"` + Host SingleUserGetHostAttributeType `json:"host,omitempty"` + Id SingleUserGetIdAttributeType `json:"id,omitempty"` + Password SingleUserGetPasswordAttributeType `json:"password,omitempty"` + Port SingleUserGetPortAttributeType `json:"port,omitempty"` + Roles SingleUserGetRolesAttributeType `json:"roles,omitempty"` + Uri SingleUserGetUriAttributeType `json:"uri,omitempty"` + Username SingleUserGetUsernameAttributeType `json:"username,omitempty"` } // NewSingleUser instantiates a new SingleUser object @@ -47,286 +213,214 @@ func NewSingleUserWithDefaults() *SingleUser { } // GetDefaultDatabase returns the DefaultDatabase field value if set, zero value otherwise. -func (o *SingleUser) GetDefaultDatabase() *string { - if o == nil || IsNil(o.DefaultDatabase) { - var ret *string - return ret - } - return o.DefaultDatabase +func (o *SingleUser) GetDefaultDatabase() (res SingleUserGetDefaultDatabaseRetType) { + res, _ = o.GetDefaultDatabaseOk() + return } // GetDefaultDatabaseOk returns a tuple with the DefaultDatabase field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SingleUser) GetDefaultDatabaseOk() (*string, bool) { - if o == nil || IsNil(o.DefaultDatabase) { - return nil, false - } - return o.DefaultDatabase, true +func (o *SingleUser) GetDefaultDatabaseOk() (ret SingleUserGetDefaultDatabaseRetType, ok bool) { + return getSingleUserGetDefaultDatabaseAttributeTypeOk(o.DefaultDatabase) } // HasDefaultDatabase returns a boolean if a field has been set. func (o *SingleUser) HasDefaultDatabase() bool { - if o != nil && !IsNil(o.DefaultDatabase) { - return true - } - - return false + _, ok := o.GetDefaultDatabaseOk() + return ok } // SetDefaultDatabase gets a reference to the given string and assigns it to the DefaultDatabase field. -func (o *SingleUser) SetDefaultDatabase(v *string) { - o.DefaultDatabase = v +func (o *SingleUser) SetDefaultDatabase(v SingleUserGetDefaultDatabaseRetType) { + setSingleUserGetDefaultDatabaseAttributeType(&o.DefaultDatabase, v) } // GetHost returns the Host field value if set, zero value otherwise. -func (o *SingleUser) GetHost() *string { - if o == nil || IsNil(o.Host) { - var ret *string - return ret - } - return o.Host +func (o *SingleUser) GetHost() (res SingleUserGetHostRetType) { + 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 *SingleUser) GetHostOk() (*string, bool) { - if o == nil || IsNil(o.Host) { - return nil, false - } - return o.Host, true +func (o *SingleUser) GetHostOk() (ret SingleUserGetHostRetType, ok bool) { + return getSingleUserGetHostAttributeTypeOk(o.Host) } // HasHost returns a boolean if a field has been set. func (o *SingleUser) 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 *SingleUser) SetHost(v *string) { - o.Host = v +func (o *SingleUser) SetHost(v SingleUserGetHostRetType) { + setSingleUserGetHostAttributeType(&o.Host, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *SingleUser) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *SingleUser) GetId() (res SingleUserGetIdRetType) { + 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 *SingleUser) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *SingleUser) GetIdOk() (ret SingleUserGetIdRetType, ok bool) { + return getSingleUserGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *SingleUser) 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 *SingleUser) SetId(v *string) { - o.Id = v +func (o *SingleUser) SetId(v SingleUserGetIdRetType) { + setSingleUserGetIdAttributeType(&o.Id, v) } // GetPassword returns the Password field value if set, zero value otherwise. -func (o *SingleUser) GetPassword() *string { - if o == nil || IsNil(o.Password) { - var ret *string - return ret - } - return o.Password +func (o *SingleUser) GetPassword() (res SingleUserGetPasswordRetType) { + 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 *SingleUser) GetPasswordOk() (*string, bool) { - if o == nil || IsNil(o.Password) { - return nil, false - } - return o.Password, true +func (o *SingleUser) GetPasswordOk() (ret SingleUserGetPasswordRetType, ok bool) { + return getSingleUserGetPasswordAttributeTypeOk(o.Password) } // HasPassword returns a boolean if a field has been set. func (o *SingleUser) 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 *SingleUser) SetPassword(v *string) { - o.Password = v +func (o *SingleUser) SetPassword(v SingleUserGetPasswordRetType) { + setSingleUserGetPasswordAttributeType(&o.Password, v) } // GetPort returns the Port field value if set, zero value otherwise. -func (o *SingleUser) GetPort() *int64 { - if o == nil || IsNil(o.Port) { - var ret *int64 - return ret - } - return o.Port +func (o *SingleUser) GetPort() (res SingleUserGetPortRetType) { + 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 *SingleUser) GetPortOk() (*int64, bool) { - if o == nil || IsNil(o.Port) { - return nil, false - } - return o.Port, true +func (o *SingleUser) GetPortOk() (ret SingleUserGetPortRetType, ok bool) { + return getSingleUserGetPortAttributeTypeOk(o.Port) } // HasPort returns a boolean if a field has been set. func (o *SingleUser) 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 *SingleUser) SetPort(v *int64) { - o.Port = v +func (o *SingleUser) SetPort(v SingleUserGetPortRetType) { + setSingleUserGetPortAttributeType(&o.Port, v) } // GetRoles returns the Roles field value if set, zero value otherwise. -func (o *SingleUser) GetRoles() *[]string { - if o == nil || IsNil(o.Roles) { - var ret *[]string - return ret - } - return o.Roles +func (o *SingleUser) GetRoles() (res SingleUserGetRolesRetType) { + 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 *SingleUser) GetRolesOk() (*[]string, bool) { - if o == nil || IsNil(o.Roles) { - return nil, false - } - return o.Roles, true +func (o *SingleUser) GetRolesOk() (ret SingleUserGetRolesRetType, ok bool) { + return getSingleUserGetRolesAttributeTypeOk(o.Roles) } // HasRoles returns a boolean if a field has been set. func (o *SingleUser) 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 *SingleUser) SetRoles(v *[]string) { - o.Roles = v +func (o *SingleUser) SetRoles(v SingleUserGetRolesRetType) { + setSingleUserGetRolesAttributeType(&o.Roles, v) } // GetUri returns the Uri field value if set, zero value otherwise. -func (o *SingleUser) GetUri() *string { - if o == nil || IsNil(o.Uri) { - var ret *string - return ret - } - return o.Uri +func (o *SingleUser) GetUri() (res SingleUserGetUriRetType) { + 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 *SingleUser) GetUriOk() (*string, bool) { - if o == nil || IsNil(o.Uri) { - return nil, false - } - return o.Uri, true +func (o *SingleUser) GetUriOk() (ret SingleUserGetUriRetType, ok bool) { + return getSingleUserGetUriAttributeTypeOk(o.Uri) } // HasUri returns a boolean if a field has been set. func (o *SingleUser) 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 *SingleUser) SetUri(v *string) { - o.Uri = v +func (o *SingleUser) SetUri(v SingleUserGetUriRetType) { + setSingleUserGetUriAttributeType(&o.Uri, v) } // GetUsername returns the Username field value if set, zero value otherwise. -func (o *SingleUser) GetUsername() *string { - if o == nil || IsNil(o.Username) { - var ret *string - return ret - } - return o.Username +func (o *SingleUser) GetUsername() (res SingleUserGetUsernameRetType) { + 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 *SingleUser) GetUsernameOk() (*string, bool) { - if o == nil || IsNil(o.Username) { - return nil, false - } - return o.Username, true +func (o *SingleUser) GetUsernameOk() (ret SingleUserGetUsernameRetType, ok bool) { + return getSingleUserGetUsernameAttributeTypeOk(o.Username) } // HasUsername returns a boolean if a field has been set. func (o *SingleUser) 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 *SingleUser) SetUsername(v *string) { - o.Username = v +func (o *SingleUser) SetUsername(v SingleUserGetUsernameRetType) { + setSingleUserGetUsernameAttributeType(&o.Username, v) } func (o SingleUser) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.DefaultDatabase) { - toSerialize["default_database"] = o.DefaultDatabase + if val, ok := getSingleUserGetDefaultDatabaseAttributeTypeOk(o.DefaultDatabase); ok { + toSerialize["DefaultDatabase"] = val } - if !IsNil(o.Host) { - toSerialize["host"] = o.Host + if val, ok := getSingleUserGetHostAttributeTypeOk(o.Host); ok { + toSerialize["Host"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getSingleUserGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.Password) { - toSerialize["password"] = o.Password + if val, ok := getSingleUserGetPasswordAttributeTypeOk(o.Password); ok { + toSerialize["Password"] = val } - if !IsNil(o.Port) { - toSerialize["port"] = o.Port + if val, ok := getSingleUserGetPortAttributeTypeOk(o.Port); ok { + toSerialize["Port"] = val } - if !IsNil(o.Roles) { - toSerialize["roles"] = o.Roles + if val, ok := getSingleUserGetRolesAttributeTypeOk(o.Roles); ok { + toSerialize["Roles"] = val } - if !IsNil(o.Uri) { - toSerialize["uri"] = o.Uri + if val, ok := getSingleUserGetUriAttributeTypeOk(o.Uri); ok { + toSerialize["Uri"] = val } - if !IsNil(o.Username) { - toSerialize["username"] = o.Username + if val, ok := getSingleUserGetUsernameAttributeTypeOk(o.Username); ok { + toSerialize["Username"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_storage.go b/services/sqlserverflex/model_storage.go index 86bc47e26..80baab97c 100644 --- a/services/sqlserverflex/model_storage.go +++ b/services/sqlserverflex/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/sqlserverflex/model_storage_range.go b/services/sqlserverflex/model_storage_range.go index ff9905536..175ab890d 100644 --- a/services/sqlserverflex/model_storage_range.go +++ b/services/sqlserverflex/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/sqlserverflex/model_trigger_database_restore_payload.go b/services/sqlserverflex/model_trigger_database_restore_payload.go index 629853491..4cd535f00 100644 --- a/services/sqlserverflex/model_trigger_database_restore_payload.go +++ b/services/sqlserverflex/model_trigger_database_restore_payload.go @@ -17,14 +17,56 @@ import ( // checks if the TriggerDatabaseRestorePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &TriggerDatabaseRestorePayload{} +/* + types and functions for name +*/ + +// isNotNullableString +type TriggerDatabaseRestorePayloadGetNameAttributeType = *string + +func getTriggerDatabaseRestorePayloadGetNameAttributeTypeOk(arg TriggerDatabaseRestorePayloadGetNameAttributeType) (ret TriggerDatabaseRestorePayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setTriggerDatabaseRestorePayloadGetNameAttributeType(arg *TriggerDatabaseRestorePayloadGetNameAttributeType, val TriggerDatabaseRestorePayloadGetNameRetType) { + *arg = &val +} + +type TriggerDatabaseRestorePayloadGetNameArgType = string +type TriggerDatabaseRestorePayloadGetNameRetType = string + +/* + types and functions for restoreDateTime +*/ + +// isNotNullableString +type TriggerDatabaseRestorePayloadGetRestoreDateTimeAttributeType = *string + +func getTriggerDatabaseRestorePayloadGetRestoreDateTimeAttributeTypeOk(arg TriggerDatabaseRestorePayloadGetRestoreDateTimeAttributeType) (ret TriggerDatabaseRestorePayloadGetRestoreDateTimeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setTriggerDatabaseRestorePayloadGetRestoreDateTimeAttributeType(arg *TriggerDatabaseRestorePayloadGetRestoreDateTimeAttributeType, val TriggerDatabaseRestorePayloadGetRestoreDateTimeRetType) { + *arg = &val +} + +type TriggerDatabaseRestorePayloadGetRestoreDateTimeArgType = string +type TriggerDatabaseRestorePayloadGetRestoreDateTimeRetType = string + // TriggerDatabaseRestorePayload struct for TriggerDatabaseRestorePayload type TriggerDatabaseRestorePayload struct { // Name for the restored database no overwrite allowed at the moment // REQUIRED - Name *string `json:"name"` + Name TriggerDatabaseRestorePayloadGetNameAttributeType `json:"name"` // Time of the restore point formate RFC3339 // REQUIRED - RestoreDateTime *string `json:"restoreDateTime"` + RestoreDateTime TriggerDatabaseRestorePayloadGetRestoreDateTimeAttributeType `json:"restoreDateTime"` } type _TriggerDatabaseRestorePayload TriggerDatabaseRestorePayload @@ -33,10 +75,10 @@ type _TriggerDatabaseRestorePayload TriggerDatabaseRestorePayload // 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 NewTriggerDatabaseRestorePayload(name *string, restoreDateTime *string) *TriggerDatabaseRestorePayload { +func NewTriggerDatabaseRestorePayload(name TriggerDatabaseRestorePayloadGetNameArgType, restoreDateTime TriggerDatabaseRestorePayloadGetRestoreDateTimeArgType) *TriggerDatabaseRestorePayload { this := TriggerDatabaseRestorePayload{} - this.Name = name - this.RestoreDateTime = restoreDateTime + setTriggerDatabaseRestorePayloadGetNameAttributeType(&this.Name, name) + setTriggerDatabaseRestorePayloadGetRestoreDateTimeAttributeType(&this.RestoreDateTime, restoreDateTime) return &this } @@ -49,57 +91,47 @@ func NewTriggerDatabaseRestorePayloadWithDefaults() *TriggerDatabaseRestorePaylo } // GetName returns the Name field value -func (o *TriggerDatabaseRestorePayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *TriggerDatabaseRestorePayload) GetName() (ret TriggerDatabaseRestorePayloadGetNameRetType) { + 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 *TriggerDatabaseRestorePayload) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *TriggerDatabaseRestorePayload) GetNameOk() (ret TriggerDatabaseRestorePayloadGetNameRetType, ok bool) { + return getTriggerDatabaseRestorePayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *TriggerDatabaseRestorePayload) SetName(v *string) { - o.Name = v +func (o *TriggerDatabaseRestorePayload) SetName(v TriggerDatabaseRestorePayloadGetNameRetType) { + setTriggerDatabaseRestorePayloadGetNameAttributeType(&o.Name, v) } // GetRestoreDateTime returns the RestoreDateTime field value -func (o *TriggerDatabaseRestorePayload) GetRestoreDateTime() *string { - if o == nil || IsNil(o.RestoreDateTime) { - var ret *string - return ret - } - - return o.RestoreDateTime +func (o *TriggerDatabaseRestorePayload) GetRestoreDateTime() (ret TriggerDatabaseRestorePayloadGetRestoreDateTimeRetType) { + ret, _ = o.GetRestoreDateTimeOk() + return ret } // GetRestoreDateTimeOk returns a tuple with the RestoreDateTime field value // and a boolean to check if the value has been set. -func (o *TriggerDatabaseRestorePayload) GetRestoreDateTimeOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.RestoreDateTime, true +func (o *TriggerDatabaseRestorePayload) GetRestoreDateTimeOk() (ret TriggerDatabaseRestorePayloadGetRestoreDateTimeRetType, ok bool) { + return getTriggerDatabaseRestorePayloadGetRestoreDateTimeAttributeTypeOk(o.RestoreDateTime) } // SetRestoreDateTime sets field value -func (o *TriggerDatabaseRestorePayload) SetRestoreDateTime(v *string) { - o.RestoreDateTime = v +func (o *TriggerDatabaseRestorePayload) SetRestoreDateTime(v TriggerDatabaseRestorePayloadGetRestoreDateTimeRetType) { + setTriggerDatabaseRestorePayloadGetRestoreDateTimeAttributeType(&o.RestoreDateTime, v) } func (o TriggerDatabaseRestorePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["name"] = o.Name - toSerialize["restoreDateTime"] = o.RestoreDateTime + if val, ok := getTriggerDatabaseRestorePayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getTriggerDatabaseRestorePayloadGetRestoreDateTimeAttributeTypeOk(o.RestoreDateTime); ok { + toSerialize["RestoreDateTime"] = val + } return toSerialize, nil } diff --git a/services/sqlserverflex/model_update_instance_payload.go b/services/sqlserverflex/model_update_instance_payload.go index 48c676acb..395c60e44 100644 --- a/services/sqlserverflex/model_update_instance_payload.go +++ b/services/sqlserverflex/model_update_instance_payload.go @@ -17,24 +17,148 @@ import ( // checks if the UpdateInstancePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateInstancePayload{} +/* + types and functions for acl +*/ + +// isModel +type UpdateInstancePayloadGetAclAttributeType = *CreateInstancePayloadAcl +type UpdateInstancePayloadGetAclArgType = CreateInstancePayloadAcl +type UpdateInstancePayloadGetAclRetType = CreateInstancePayloadAcl + +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 +*/ + +// isFreeform +type UpdateInstancePayloadGetLabelsAttributeType = *map[string]interface{} +type UpdateInstancePayloadGetLabelsArgType = map[string]interface{} +type UpdateInstancePayloadGetLabelsRetType = map[string]interface{} + +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 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 { // REQUIRED - Acl *CreateInstancePayloadAcl `json:"acl"` + Acl UpdateInstancePayloadGetAclAttributeType `json:"acl"` // Cronjob for the daily full backup if not provided a job will generated between 00:00 and 04:59 // REQUIRED - BackupSchedule *string `json:"backupSchedule"` + BackupSchedule UpdateInstancePayloadGetBackupScheduleAttributeType `json:"backupSchedule"` // Id of the selected flavor // REQUIRED - FlavorId *string `json:"flavorId"` + FlavorId UpdateInstancePayloadGetFlavorIdAttributeType `json:"flavorId"` // REQUIRED - Labels *map[string]interface{} `json:"labels"` + Labels UpdateInstancePayloadGetLabelsAttributeType `json:"labels"` // Name of the instance // REQUIRED - Name *string `json:"name"` + Name UpdateInstancePayloadGetNameAttributeType `json:"name"` // Version of the MSSQL Server // REQUIRED - Version *string `json:"version"` + Version UpdateInstancePayloadGetVersionAttributeType `json:"version"` } type _UpdateInstancePayload UpdateInstancePayload @@ -43,14 +167,14 @@ type _UpdateInstancePayload UpdateInstancePayload // 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 NewUpdateInstancePayload(acl *CreateInstancePayloadAcl, backupSchedule *string, flavorId *string, labels *map[string]interface{}, name *string, version *string) *UpdateInstancePayload { +func NewUpdateInstancePayload(acl UpdateInstancePayloadGetAclArgType, backupSchedule UpdateInstancePayloadGetBackupScheduleArgType, flavorId UpdateInstancePayloadGetFlavorIdArgType, labels UpdateInstancePayloadGetLabelsArgType, name UpdateInstancePayloadGetNameArgType, version UpdateInstancePayloadGetVersionArgType) *UpdateInstancePayload { this := UpdateInstancePayload{} - this.Acl = acl - this.BackupSchedule = backupSchedule - this.FlavorId = flavorId - this.Labels = labels - this.Name = name - this.Version = version + setUpdateInstancePayloadGetAclAttributeType(&this.Acl, acl) + setUpdateInstancePayloadGetBackupScheduleAttributeType(&this.BackupSchedule, backupSchedule) + setUpdateInstancePayloadGetFlavorIdAttributeType(&this.FlavorId, flavorId) + setUpdateInstancePayloadGetLabelsAttributeType(&this.Labels, labels) + setUpdateInstancePayloadGetNameAttributeType(&this.Name, name) + setUpdateInstancePayloadGetVersionAttributeType(&this.Version, version) return &this } @@ -65,157 +189,127 @@ func NewUpdateInstancePayloadWithDefaults() *UpdateInstancePayload { } // GetAcl returns the Acl field value -func (o *UpdateInstancePayload) GetAcl() *CreateInstancePayloadAcl { - if o == nil || IsNil(o.Acl) { - var ret *CreateInstancePayloadAcl - return ret - } - - return o.Acl +func (o *UpdateInstancePayload) GetAcl() (ret UpdateInstancePayloadGetAclRetType) { + 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 *UpdateInstancePayload) GetAclOk() (*CreateInstancePayloadAcl, bool) { - if o == nil { - return nil, false - } - return o.Acl, true +func (o *UpdateInstancePayload) GetAclOk() (ret UpdateInstancePayloadGetAclRetType, ok bool) { + return getUpdateInstancePayloadGetAclAttributeTypeOk(o.Acl) } // SetAcl sets field value -func (o *UpdateInstancePayload) SetAcl(v *CreateInstancePayloadAcl) { - o.Acl = v +func (o *UpdateInstancePayload) SetAcl(v UpdateInstancePayloadGetAclRetType) { + setUpdateInstancePayloadGetAclAttributeType(&o.Acl, v) } // GetBackupSchedule returns the BackupSchedule field value -func (o *UpdateInstancePayload) GetBackupSchedule() *string { - if o == nil || IsNil(o.BackupSchedule) { - var ret *string - return ret - } - - return o.BackupSchedule +func (o *UpdateInstancePayload) GetBackupSchedule() (ret UpdateInstancePayloadGetBackupScheduleRetType) { + 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 *UpdateInstancePayload) GetBackupScheduleOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.BackupSchedule, true +func (o *UpdateInstancePayload) GetBackupScheduleOk() (ret UpdateInstancePayloadGetBackupScheduleRetType, ok bool) { + return getUpdateInstancePayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule) } // SetBackupSchedule sets field value -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 -func (o *UpdateInstancePayload) GetFlavorId() *string { - if o == nil || IsNil(o.FlavorId) { - var ret *string - return ret - } - - return o.FlavorId +func (o *UpdateInstancePayload) GetFlavorId() (ret UpdateInstancePayloadGetFlavorIdRetType) { + 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 *UpdateInstancePayload) GetFlavorIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.FlavorId, true +func (o *UpdateInstancePayload) GetFlavorIdOk() (ret UpdateInstancePayloadGetFlavorIdRetType, ok bool) { + return getUpdateInstancePayloadGetFlavorIdAttributeTypeOk(o.FlavorId) } // SetFlavorId sets field value -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 -func (o *UpdateInstancePayload) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - - return o.Labels +func (o *UpdateInstancePayload) GetLabels() (ret UpdateInstancePayloadGetLabelsRetType) { + ret, _ = o.GetLabelsOk() + return ret } // GetLabelsOk returns a tuple with the Labels field value // and a boolean to check if the value has been set. -func (o *UpdateInstancePayload) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *UpdateInstancePayload) GetLabelsOk() (ret UpdateInstancePayloadGetLabelsRetType, ok bool) { + return getUpdateInstancePayloadGetLabelsAttributeTypeOk(o.Labels) } // SetLabels sets field value -func (o *UpdateInstancePayload) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *UpdateInstancePayload) SetLabels(v UpdateInstancePayloadGetLabelsRetType) { + setUpdateInstancePayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value -func (o *UpdateInstancePayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *UpdateInstancePayload) GetName() (ret UpdateInstancePayloadGetNameRetType) { + 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 *UpdateInstancePayload) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *UpdateInstancePayload) GetNameOk() (ret UpdateInstancePayloadGetNameRetType, ok bool) { + return getUpdateInstancePayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *UpdateInstancePayload) SetName(v *string) { - o.Name = v +func (o *UpdateInstancePayload) SetName(v UpdateInstancePayloadGetNameRetType) { + setUpdateInstancePayloadGetNameAttributeType(&o.Name, v) } // GetVersion returns the Version field value -func (o *UpdateInstancePayload) GetVersion() *string { - if o == nil || IsNil(o.Version) { - var ret *string - return ret - } - - return o.Version +func (o *UpdateInstancePayload) GetVersion() (ret UpdateInstancePayloadGetVersionRetType) { + 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 *UpdateInstancePayload) GetVersionOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Version, true +func (o *UpdateInstancePayload) GetVersionOk() (ret UpdateInstancePayloadGetVersionRetType, ok bool) { + return getUpdateInstancePayloadGetVersionAttributeTypeOk(o.Version) } // SetVersion sets field value -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{}{} - toSerialize["acl"] = o.Acl - toSerialize["backupSchedule"] = o.BackupSchedule - toSerialize["flavorId"] = o.FlavorId - toSerialize["labels"] = o.Labels - toSerialize["name"] = o.Name - toSerialize["version"] = o.Version + if val, ok := getUpdateInstancePayloadGetAclAttributeTypeOk(o.Acl); ok { + toSerialize["Acl"] = val + } + if val, ok := getUpdateInstancePayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule); ok { + toSerialize["BackupSchedule"] = val + } + if val, ok := getUpdateInstancePayloadGetFlavorIdAttributeTypeOk(o.FlavorId); ok { + toSerialize["FlavorId"] = val + } + if val, ok := getUpdateInstancePayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getUpdateInstancePayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getUpdateInstancePayloadGetVersionAttributeTypeOk(o.Version); ok { + toSerialize["Version"] = val + } return toSerialize, nil } diff --git a/services/sqlserverflex/model_update_instance_response.go b/services/sqlserverflex/model_update_instance_response.go index 641797378..144342524 100644 --- a/services/sqlserverflex/model_update_instance_response.go +++ b/services/sqlserverflex/model_update_instance_response.go @@ -17,9 +17,29 @@ import ( // checks if the UpdateInstanceResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateInstanceResponse{} +/* + types and functions for item +*/ + +// isModel +type UpdateInstanceResponseGetItemAttributeType = *Instance +type UpdateInstanceResponseGetItemArgType = Instance +type UpdateInstanceResponseGetItemRetType = Instance + +func getUpdateInstanceResponseGetItemAttributeTypeOk(arg UpdateInstanceResponseGetItemAttributeType) (ret UpdateInstanceResponseGetItemRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateInstanceResponseGetItemAttributeType(arg *UpdateInstanceResponseGetItemAttributeType, val UpdateInstanceResponseGetItemRetType) { + *arg = &val +} + // UpdateInstanceResponse struct for UpdateInstanceResponse type UpdateInstanceResponse struct { - Item *Instance `json:"item,omitempty"` + Item UpdateInstanceResponseGetItemAttributeType `json:"item,omitempty"` } // NewUpdateInstanceResponse instantiates a new UpdateInstanceResponse object @@ -40,41 +60,32 @@ func NewUpdateInstanceResponseWithDefaults() *UpdateInstanceResponse { } // GetItem returns the Item field value if set, zero value otherwise. -func (o *UpdateInstanceResponse) GetItem() *Instance { - if o == nil || IsNil(o.Item) { - var ret *Instance - return ret - } - return o.Item +func (o *UpdateInstanceResponse) GetItem() (res UpdateInstanceResponseGetItemRetType) { + 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 *UpdateInstanceResponse) GetItemOk() (*Instance, bool) { - if o == nil || IsNil(o.Item) { - return nil, false - } - return o.Item, true +func (o *UpdateInstanceResponse) GetItemOk() (ret UpdateInstanceResponseGetItemRetType, ok bool) { + return getUpdateInstanceResponseGetItemAttributeTypeOk(o.Item) } // HasItem returns a boolean if a field has been set. func (o *UpdateInstanceResponse) 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 *UpdateInstanceResponse) SetItem(v *Instance) { - o.Item = v +func (o *UpdateInstanceResponse) SetItem(v UpdateInstanceResponseGetItemRetType) { + setUpdateInstanceResponseGetItemAttributeType(&o.Item, v) } func (o UpdateInstanceResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Item) { - toSerialize["item"] = o.Item + if val, ok := getUpdateInstanceResponseGetItemAttributeTypeOk(o.Item); ok { + toSerialize["Item"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/model_user.go b/services/sqlserverflex/model_user.go index c5c247890..cb02f0161 100644 --- a/services/sqlserverflex/model_user.go +++ b/services/sqlserverflex/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/sqlserverflex/model_user_response_user.go b/services/sqlserverflex/model_user_response_user.go index d7d05b49f..c7b095952 100644 --- a/services/sqlserverflex/model_user_response_user.go +++ b/services/sqlserverflex/model_user_response_user.go @@ -17,14 +17,138 @@ import ( // checks if the UserResponseUser type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UserResponseUser{} +/* + types and functions for default_database +*/ + +// isNotNullableString +type UserResponseUserGetDefaultDatabaseAttributeType = *string + +func getUserResponseUserGetDefaultDatabaseAttributeTypeOk(arg UserResponseUserGetDefaultDatabaseAttributeType) (ret UserResponseUserGetDefaultDatabaseRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUserResponseUserGetDefaultDatabaseAttributeType(arg *UserResponseUserGetDefaultDatabaseAttributeType, val UserResponseUserGetDefaultDatabaseRetType) { + *arg = &val +} + +type UserResponseUserGetDefaultDatabaseArgType = string +type UserResponseUserGetDefaultDatabaseRetType = string + +/* + types and functions for host +*/ + +// isNotNullableString +type UserResponseUserGetHostAttributeType = *string + +func getUserResponseUserGetHostAttributeTypeOk(arg UserResponseUserGetHostAttributeType) (ret UserResponseUserGetHostRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUserResponseUserGetHostAttributeType(arg *UserResponseUserGetHostAttributeType, val UserResponseUserGetHostRetType) { + *arg = &val +} + +type UserResponseUserGetHostArgType = string +type UserResponseUserGetHostRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type UserResponseUserGetIdAttributeType = *string + +func getUserResponseUserGetIdAttributeTypeOk(arg UserResponseUserGetIdAttributeType) (ret UserResponseUserGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUserResponseUserGetIdAttributeType(arg *UserResponseUserGetIdAttributeType, val UserResponseUserGetIdRetType) { + *arg = &val +} + +type UserResponseUserGetIdArgType = string +type UserResponseUserGetIdRetType = string + +/* + types and functions for port +*/ + +// isLong +type UserResponseUserGetPortAttributeType = *int64 +type UserResponseUserGetPortArgType = int64 +type UserResponseUserGetPortRetType = int64 + +func getUserResponseUserGetPortAttributeTypeOk(arg UserResponseUserGetPortAttributeType) (ret UserResponseUserGetPortRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUserResponseUserGetPortAttributeType(arg *UserResponseUserGetPortAttributeType, val UserResponseUserGetPortRetType) { + *arg = &val +} + +/* + types and functions for roles +*/ + +// isArray +type UserResponseUserGetRolesAttributeType = *[]string +type UserResponseUserGetRolesArgType = []string +type UserResponseUserGetRolesRetType = []string + +func getUserResponseUserGetRolesAttributeTypeOk(arg UserResponseUserGetRolesAttributeType) (ret UserResponseUserGetRolesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUserResponseUserGetRolesAttributeType(arg *UserResponseUserGetRolesAttributeType, val UserResponseUserGetRolesRetType) { + *arg = &val +} + +/* + types and functions for username +*/ + +// isNotNullableString +type UserResponseUserGetUsernameAttributeType = *string + +func getUserResponseUserGetUsernameAttributeTypeOk(arg UserResponseUserGetUsernameAttributeType) (ret UserResponseUserGetUsernameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUserResponseUserGetUsernameAttributeType(arg *UserResponseUserGetUsernameAttributeType, val UserResponseUserGetUsernameRetType) { + *arg = &val +} + +type UserResponseUserGetUsernameArgType = string +type UserResponseUserGetUsernameRetType = string + // UserResponseUser struct for UserResponseUser type UserResponseUser struct { - DefaultDatabase *string `json:"default_database,omitempty"` - 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"` + DefaultDatabase UserResponseUserGetDefaultDatabaseAttributeType `json:"default_database,omitempty"` + Host UserResponseUserGetHostAttributeType `json:"host,omitempty"` + Id UserResponseUserGetIdAttributeType `json:"id,omitempty"` + Port UserResponseUserGetPortAttributeType `json:"port,omitempty"` + Roles UserResponseUserGetRolesAttributeType `json:"roles,omitempty"` + Username UserResponseUserGetUsernameAttributeType `json:"username,omitempty"` } // NewUserResponseUser instantiates a new UserResponseUser object @@ -45,216 +169,162 @@ func NewUserResponseUserWithDefaults() *UserResponseUser { } // GetDefaultDatabase returns the DefaultDatabase field value if set, zero value otherwise. -func (o *UserResponseUser) GetDefaultDatabase() *string { - if o == nil || IsNil(o.DefaultDatabase) { - var ret *string - return ret - } - return o.DefaultDatabase +func (o *UserResponseUser) GetDefaultDatabase() (res UserResponseUserGetDefaultDatabaseRetType) { + res, _ = o.GetDefaultDatabaseOk() + return } // GetDefaultDatabaseOk returns a tuple with the DefaultDatabase field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UserResponseUser) GetDefaultDatabaseOk() (*string, bool) { - if o == nil || IsNil(o.DefaultDatabase) { - return nil, false - } - return o.DefaultDatabase, true +func (o *UserResponseUser) GetDefaultDatabaseOk() (ret UserResponseUserGetDefaultDatabaseRetType, ok bool) { + return getUserResponseUserGetDefaultDatabaseAttributeTypeOk(o.DefaultDatabase) } // HasDefaultDatabase returns a boolean if a field has been set. func (o *UserResponseUser) HasDefaultDatabase() bool { - if o != nil && !IsNil(o.DefaultDatabase) { - return true - } - - return false + _, ok := o.GetDefaultDatabaseOk() + return ok } // SetDefaultDatabase gets a reference to the given string and assigns it to the DefaultDatabase field. -func (o *UserResponseUser) SetDefaultDatabase(v *string) { - o.DefaultDatabase = v +func (o *UserResponseUser) SetDefaultDatabase(v UserResponseUserGetDefaultDatabaseRetType) { + setUserResponseUserGetDefaultDatabaseAttributeType(&o.DefaultDatabase, v) } // GetHost returns the Host field value if set, zero value otherwise. -func (o *UserResponseUser) GetHost() *string { - if o == nil || IsNil(o.Host) { - var ret *string - return ret - } - return o.Host +func (o *UserResponseUser) GetHost() (res UserResponseUserGetHostRetType) { + 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 *UserResponseUser) GetHostOk() (*string, bool) { - if o == nil || IsNil(o.Host) { - return nil, false - } - return o.Host, true +func (o *UserResponseUser) GetHostOk() (ret UserResponseUserGetHostRetType, ok bool) { + return getUserResponseUserGetHostAttributeTypeOk(o.Host) } // HasHost returns a boolean if a field has been set. func (o *UserResponseUser) 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 *UserResponseUser) SetHost(v *string) { - o.Host = v +func (o *UserResponseUser) SetHost(v UserResponseUserGetHostRetType) { + setUserResponseUserGetHostAttributeType(&o.Host, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *UserResponseUser) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *UserResponseUser) GetId() (res UserResponseUserGetIdRetType) { + 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 *UserResponseUser) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *UserResponseUser) GetIdOk() (ret UserResponseUserGetIdRetType, ok bool) { + return getUserResponseUserGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *UserResponseUser) 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 *UserResponseUser) SetId(v *string) { - o.Id = v +func (o *UserResponseUser) SetId(v UserResponseUserGetIdRetType) { + setUserResponseUserGetIdAttributeType(&o.Id, v) } // GetPort returns the Port field value if set, zero value otherwise. -func (o *UserResponseUser) GetPort() *int64 { - if o == nil || IsNil(o.Port) { - var ret *int64 - return ret - } - return o.Port +func (o *UserResponseUser) GetPort() (res UserResponseUserGetPortRetType) { + 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 *UserResponseUser) GetPortOk() (*int64, bool) { - if o == nil || IsNil(o.Port) { - return nil, false - } - return o.Port, true +func (o *UserResponseUser) GetPortOk() (ret UserResponseUserGetPortRetType, ok bool) { + return getUserResponseUserGetPortAttributeTypeOk(o.Port) } // HasPort returns a boolean if a field has been set. func (o *UserResponseUser) 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 *UserResponseUser) SetPort(v *int64) { - o.Port = v +func (o *UserResponseUser) SetPort(v UserResponseUserGetPortRetType) { + setUserResponseUserGetPortAttributeType(&o.Port, v) } // GetRoles returns the Roles field value if set, zero value otherwise. -func (o *UserResponseUser) GetRoles() *[]string { - if o == nil || IsNil(o.Roles) { - var ret *[]string - return ret - } - return o.Roles +func (o *UserResponseUser) GetRoles() (res UserResponseUserGetRolesRetType) { + 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 *UserResponseUser) GetRolesOk() (*[]string, bool) { - if o == nil || IsNil(o.Roles) { - return nil, false - } - return o.Roles, true +func (o *UserResponseUser) GetRolesOk() (ret UserResponseUserGetRolesRetType, ok bool) { + return getUserResponseUserGetRolesAttributeTypeOk(o.Roles) } // HasRoles returns a boolean if a field has been set. func (o *UserResponseUser) 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 *UserResponseUser) SetRoles(v *[]string) { - o.Roles = v +func (o *UserResponseUser) SetRoles(v UserResponseUserGetRolesRetType) { + setUserResponseUserGetRolesAttributeType(&o.Roles, v) } // GetUsername returns the Username field value if set, zero value otherwise. -func (o *UserResponseUser) GetUsername() *string { - if o == nil || IsNil(o.Username) { - var ret *string - return ret - } - return o.Username +func (o *UserResponseUser) GetUsername() (res UserResponseUserGetUsernameRetType) { + 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 *UserResponseUser) GetUsernameOk() (*string, bool) { - if o == nil || IsNil(o.Username) { - return nil, false - } - return o.Username, true +func (o *UserResponseUser) GetUsernameOk() (ret UserResponseUserGetUsernameRetType, ok bool) { + return getUserResponseUserGetUsernameAttributeTypeOk(o.Username) } // HasUsername returns a boolean if a field has been set. func (o *UserResponseUser) 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 *UserResponseUser) SetUsername(v *string) { - o.Username = v +func (o *UserResponseUser) SetUsername(v UserResponseUserGetUsernameRetType) { + setUserResponseUserGetUsernameAttributeType(&o.Username, v) } func (o UserResponseUser) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.DefaultDatabase) { - toSerialize["default_database"] = o.DefaultDatabase + if val, ok := getUserResponseUserGetDefaultDatabaseAttributeTypeOk(o.DefaultDatabase); ok { + toSerialize["DefaultDatabase"] = val } - if !IsNil(o.Host) { - toSerialize["host"] = o.Host + if val, ok := getUserResponseUserGetHostAttributeTypeOk(o.Host); ok { + toSerialize["Host"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getUserResponseUserGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.Port) { - toSerialize["port"] = o.Port + if val, ok := getUserResponseUserGetPortAttributeTypeOk(o.Port); ok { + toSerialize["Port"] = val } - if !IsNil(o.Roles) { - toSerialize["roles"] = o.Roles + if val, ok := getUserResponseUserGetRolesAttributeTypeOk(o.Roles); ok { + toSerialize["Roles"] = val } - if !IsNil(o.Username) { - toSerialize["username"] = o.Username + if val, ok := getUserResponseUserGetUsernameAttributeTypeOk(o.Username); ok { + toSerialize["Username"] = val } return toSerialize, nil } diff --git a/services/sqlserverflex/utils.go b/services/sqlserverflex/utils.go index 208583f82..b7aab5eda 100644 --- a/services/sqlserverflex/utils.go +++ b/services/sqlserverflex/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()